Otaqui.Com

Pete Otaqui’s blog about web development and everything else

Archive for the ‘webdev’ tag

Adobe CS3 “licensing for this product has stopped working” fix

leave a comment

After getting a new computer, and restoring my old system from a Time Machine backup, I found my Adobe Web Premium CS3 stopped working. Every application I started (Photoshop, Fireworks, Flash, etc) gave the error message:

Licensing for this product has stopped working.

After following every suggestion I could find in Adobe’s knowledge base and various online articles, I still couldn’t get any of the applications to start.

As a final act of complete desperation, after many rounds of removal-reboot-reinstall, I finally ran the installer and chose a product that I had not installed before (Contribute). Once that was done I started up the new app, and it asked me for my license key – which I entered and the app started. Then I tried Photoshop and it started up fine!

So – if you didn’t do a complete install int he first place, one of the easiest things could be to add a new app to your install, and get that to reset your licensing for you.

Written by pete

June 23rd, 2010 at 5:55 pm

Posted in Professional

Tagged with

If We Had A Web Of Data I Would Build …

leave a comment

Georgi Kobilarov has a post up asking what would you build with a function web of data and I have a few ideas. These all need fleshing out (and probably spell-checking ;), but if I didn’t post them now I might never get round to it!

Shopping

I think there are a few ways you could use a web of linked data to make online grocery shopping better – comparing prices across stores, create shopping lists from recipes, and get recipes from lists of goods.

Recruitment

With jobs and resumés available as linked data, recruitment could become much more machine-enabled, giving managers better abilities to find people themselves rather than relying on agents who don’t always understand their clients’ business or industry. It could also help people looking for work in a similar way. Types of skill, training and qualification could also be linked in, as could “linkedin” style personal recommendations.

E-Learning

Serious attempts have been made at making learning materials shareable and reusable. As part of the data web, finding and consuming these materials becomes easier but more than that we could build a development plan generator. Competency can be aligned to skills or training received, something that could be useful to government departments, schools, universities and business.

Written by pete

April 12th, 2010 at 10:24 pm

Posted in Professional

Tagged with ,

BBC Fisheye Greasemonkey Script

leave a comment

Greasemonkey script to reformat “Author” select elements on the BBC’s Fisheye repository browser, which are ridiculously long (because they contain a considerable chunk of certificate data) which messes with the whole page layout. Shrinking the selects to a more reasonable width fixes this and makes the site more usable.

http://otaqui.com/code/bbc-fisheye/bbc-fisheye.user.js

// ==UserScript==
// @name           BBC FishEye
// @namespace      http://otaqui.com/code/bbc-fisheye
// @description    Make BBC's Fisheye look more like it should
// @include        https://fisheye.dev.bbc.co.uk/*
// ==/UserScript==
var elems = document.evaluate(
    '//select[@name="wbauthor"]',
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null
);
var i=0;
var sel;
while ( sel = elems.snapshotItem(i++) ) sel.style.width = '200px';

Written by pete

April 12th, 2010 at 5:15 pm

Posted in Professional

Tagged with , ,

Bash Script for Serving Multiple Trac Projects and Sharing Authentication

leave a comment

I use Trac for personal projects, and I share some of these out with people as required. I use tracd (TracStandalone) for this, rather than a full-blown apache setup, since it serves my needs quite nicely and is a lot easier to turn on and off as required without tweaking apache config and rebooting the whole webserver.

All my projects live under a single parent directory, and I prefer to share a single users digest file between them all – so ideally I wanted to share a single tracd to run all my projects. This is fairly straightforward on the command line:

tracd --hostname=webhost.com -p 9876 \
--auth="*,/path/projects/people.htdigest,Realm" \
/path/projects/p1 \
/path/projects/p2

That is ….
Line 1 – start tracd for a given hostname and port,
Line 2 – specify auth for all projects (*), the auth file and the “Realm” you specified when creating the file with apache’s htdigest command
Lines 3+ – specify as many projects as you want to run

This is ok with a couple of projects, but gets unwieldy quite quickly. What I needed was a little shell script to open up all projects under a given directory quickly. Here’s what I came up with:

#!/bin/bash

# make / truncate a temp file to store names:
temp=/tmp/tracdpaths
> $temp

# specify base directory:
base=/path/projects/

# output all subdirectories to temp file:
find $base -maxdepth 1 -mindepth 1 -type d \
-exec echo -n "{} " > $temp \;

# now start tracd
tracd --hostname=webhost.com -p 9876 \
--auth="*,/path/projects/people.htdigest,Realm" \
`cat $temp`

Essentially this script uses ‘find’ to get all of the directories exactly 1 level down from your projects directory, and will echo their paths to a temp file (suppressing the newlines). It will then run run tracd, appending the contents of this file to the end of the call.

Written by pete

March 30th, 2010 at 4:55 pm

Posted in Professional

Tagged with ,

Custom User Agent with Cucumber Tests and Webrat in Mechanize Mode

leave a comment

It’s pretty straightforward to set a custom user agent with mechanize if you’re using it directly, KickAssLabs has a good example.

If you’re using Mechanize through Webrat though, things are a little different. The nice thing though, is that you can do this in a step definition – allowing features to be based on different browser scenarios (this is great if you’re developing across devices).

First off there are two accessors of interest in mechanize, “user_agent” and “user_agent_alias”. The former is fairly self evident and lets you define the user agent at will, the latter gives you shortcut access to a list of common user agents baked into mechanize. You can see that list in the mechanize.rb source. It contains some desktop browsers, the iPhone and the default Mechanize UA strings.

If you’re happy with the default alias list, you can just write a step definition like this:

Given /^I am using the "(.*)" browser$/ do |browser|
  webrat.adapter.mechanize.user_agent_alias = browser
end

And then you can use this in your features:

Given I am using the "iPhone" browser
When I visit the home page
Then I should see "You are using an iPhone!"

If you want to be able to specify your own UA strings, and as I said this is especially likely if you are developing cross-device applications where capabilities are important, then you can just use your own hash instead, and set “user_agent” rather than “user_agent_alias”:

Given /^I am using the "(.*)" browser$/ do |browser|
  UA_ALIASES = {
    "Nokia N95" => "Mozilla/5.0 (SymbianOS/9.2; .....",
    "Palm Pre" => "Mozilla/5.0 (webOS/1.0; ....."
  }
  webrat.adapter.mechanize.user_agent = UA_ALIASES[browser]
end

With a little tweaking you could use both the included list and, if the string from your feature isn’t there, look in a custom list too.

Written by pete

March 8th, 2010 at 8:08 pm

Posted in Professional

Tagged with , , ,