jQuery error in Internet Explorer

One cause of error at least.

Watch for stray commas at the end of an array.

For example :

 var array = [ 'zero', 'one', 'two', 'three', 'four',  ]; 

That comma after ‘four’ will be silent in most browsers. In Internet Explorer (lower than 8 at least), this will throw an error.

 

Spotlight keeps on indexing forever ?

Seemingly randomly, Spotlight indexing goes on and on…. seemingly forever. It was painful to hear the hard-drive cracking away in the background.

A quick search on Apple’s suport forums gave me the solution – add your bootcamp drive / partition to the exclusion list of Spotlight (in System preferences).

Indexing stopped instantly !

Embed presentations in MediaWiki

To embed slideshare presentations in your page, you can’t beat the Widget Extension.

The homepage for the extension features dozens of widgets to embed videos, feeds, maps and even other widgets from Google right in your MediaWiki pages.

Getting started with Semantic MediaWiki

So, you read about Semantic MediaWiki and were intrigued enough to install it.

Now what ?

First, do yourself a favor and install Semantic Forms.

It may seem a little intimidating at first, but it will save you loads of time later on.

You can learn a lot by checking out the source of pages in an already available wiki. A list is available at the bottom of the Semantic Forms page.

Finally, useful tips are also available in the Semantic MediaWIki community side of Referata.com.

Remember to add your tips to the list.

Fixing Lifestream’s broken icons

After a failed attempt at using action streams with Movable Type, I was very pleased to discover the Lifestream plugin for WordPress.

I set up my Family site to use Lifestream with various feeds from family members. Along with the P2 theme, it has been working great as a shared hub for family members…. except for some issues with the way Lifestream displays icons.

For some reason, the URL to icons (and thumbnails when available) includes the full base path of the icon file.

One solution ? Track down where path names are set and remove the base file path – until the real issue is resolved in a future version of this great plugin.

The piece of code to update is in the ‘lifestream/inc/core.php’ file, at line 2336.

		$file_path= $this->lifestream->get_absolute_media_url($path);
		$file_path= str_replace(str_replace('\\','/',WP_CONTENT_DIR),"",$file_path);
		return $file_path;
	}

	function get_public_url()
	{
		return $this->get_constant('URL');
	}

	function get_image_url($row, $item)
	{
		$file_path= is_array($item['image']) ? $item['image']['url'] : $item['image'];
		$file_path= str_replace(str_replace('\\','/',WP_CONTENT_DIR),"",$file_path);
		return $file_path;
	}

	function get_thumbnail_url($row, $item)
	{
		// Array checks are for backwards compatbility
		$file_path= is_array(@$item['thumbnail']) ? $item['thumbnail']['url'] : @$item['thumbnail'];
		$file_path= str_replace(str_replace('\\','/',WP_CONTENT_DIR),"",$file_path);
		return $file_path;
	}

I had to resort to some contortions because, since my server is running on Windows, WP_CONTENT_DIR looked something like : “C:\inetpub\wordpress\home/wp-content”.

Enable thumbnail support in SimplePress and a multi-site WordPress

I was looking forward to use the thumbnail and gallery options of the SimplePress theme from ElegantThemes, only to find empty thumbnails when I tried it out.

A bit of research put me on the way to a solution via ‘How to make TimThumb work with WordPress mu‘. The culprit was the difference between virtual paths and physical paths in a multi-site installation of WordPress (WordPress mu is now available by default in WordPress 3.0).

Between this post and some of the comments, I was able to get thumbnails to work.

1- Add a new function ‘get_image_path’ to ‘SimplePress/epanel/custom_functions.php’, at line 149 :


/* Get virtual path from post ID and full path - enable for multiple sites setup */
function get_image_path ($post_id = null, $theImageSrc) {
if ($post_id == null) {
global $post;
$post_id = $post->ID;
}

global $blog_id, $current_site;

if (isset($blog_id) && $blog_id > 0) {
$imageParts = explode('/files/', $theImageSrc);
if (isset($imageParts[1])) {
$theImageSrc = 'http://' . $current_site->domain . $current_site->path . 'wp-content/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
}
}
return $theImageSrc;
}

2- In the same file, add these lines at the end of ‘get_thumbnails’  (before ‘if ($fullpath)’ )


/* Replace virtual path by full path - enable for multiple sites setup */
$thumb_array['thumb'] = get_image_path($post->ID, $thumb_array['thumb']);

if ($fullpath) $thumb_array['fullpath'] = $thumb_array['thumb'];

This should make the thumbnails available assuming you are using images loaded to the site using the Media library.

Tip for performance improvement using #urlget

I came across an interesting performance issue using #urlget (from the URLGetparameters extension).

The details are here : http://www.mediawiki.org/wiki/Extension_talk:UrlGetParameters#Performance

I know it is not directly related to SMW but since I used this extension to customize calls to semantic queries based on URL parameters, this may be relevant to other people doing the same thing.

I was able to reduce access times from 15 seconds to 3 seconds on a page using this tip.

How to import feeds from other sites into Facebook

social-icons

I came across this little advertised feature of Facebook while poking around in my Flickr account (at least, little known by me at the time).

To add feeds from other sites to your Facebook account :

1- Open your Profile in Facebook

2- Click on Options (under the Share button)

3- Click on Settings (same location at Options)

4- Select one of the applications listed and fill in the requested user ID / URL information.

Apparently, Facebook share the same short sighted approach as Movable Type Action Streams and supports only one account of each kind – that is, you can only register one Flickr account, one Blog feed with RSS, and so on… Too bad for people who own more than one account.

Still … it seems to be working nicely. I have seen updates to this blog and to flickr pop up on Facebook.

Note: If you are looking for the same option in flickr, open your flickr account, click on Your Account and select the ‘Extend flickr’ tab. The facebook link is at the bottom of the page.

Vista vs OSX upgrades

Every once in a while, planets align in such a way that computers start acting up, regardless of operating system.
I have been fighting with my desktop PC for weeks to troubleshoot random shutdowns and blue screen issues. All that time, I was thinking about my MacBook Pro laptop and how stable it is… until I upgraded it to Leopard, just around the time I upgraded my desktop to Vista.
On the Vista front, I first found out that there was no upgrade path from XP Pro to Vista Home edition. I guess once you are running Pro, you are not allowed to downgrade. Fine… I wiped out XP and replaced it with Vista as a fresh install after getting a new version.
That allowed me to enjoy the UAC nightmare that I have read so much about and two reactivations (one by phone) because I had the temerity to troubleshoot hardware and replace ethernet, video card and sound cards. I also found out that, for some obscure reason, Vista keeps leaving empty folder behind when I try to move a large amount of files. And here I thought moving files was one of these basic functions of an Operating System.
To make things more interesting, upgrading to Leopard on the laptop didn’t go without its own set of issues.
The upgrade didn’t keep track of the location of applications (I thought I would keep things organized in the Applications folder by grouping similar applications together).
Once upgraded, a secutiry patch disabled the sound device.
Note: It was reactivated weeks later with the next patch. Running the disk maintenance utility to track and restore corrupted permissions seems to have helped as well.

iPod Touchy

iPod Touchy
 So.. I received my iPod Touch today.

It was pre-ordered mid September through the Apple website, with a customization on the back. Announced to be available on the 28th. Shipped and received within two days – not bad. Nevermind the fact that the Touch was already available in stores at the same time the Apple site was listing it as ‘pre-order’.

The packaging was as usual simple and beautifully designed. Maybe too simple. The only option provided out of the box to protect your iPod Touch is a small piece of cloth to wipe the screen from the inevitable fingerprints and greasy marks that will eventually accumulate on its beautiful glass surface. Cases are unfortunately now available yet… maybe in a few weeks.

Speaking of ‘out of the box’, the instructions simply state that you only have to plug your ipod on a USB port and get started initializing it. Not so fast.

Following these instructions left me with a blank screen and an unresponsive ipod within a few minutes. Restoring it on a PC just timed out. Trying on a Powerbook G4 (with USB2.0) resulted in an ‘unkown error 1604′. the iPod Touch support site didn’t have much references to this error.

A visit to the nearest Apple store was not very helpful. After checking that error message was reproducible on one of their docks, the only option I was left with was to go back home and arrange to return my unit to Apple through their website. You see – if I had bought it from the store, they could have replaced it immediately. Apparently, this is not possible for units ordered online.

I guess this is what you get when Geniuses run out of appointment slots.

On a hunch, I bought a wall adapter to make sure the ipod was fully charged before trying again. Charging it on a USB or Firewire port didn’t take me very far… but as it turned out, the wall charger worked like a charm.

After 5 hours or so, and a fully charged unit, I could finally complete the initialization process without error. Well… almost. The ipod crashed twice during the initial synchronization with iTunes. From what I read on the iPod Touch user forum, the latest update of the ipod software (v1.1.1) introduced a few issues, including problems with missing cover art, incompatibility with iPhoto events and freezing synchronizations.

So… after spending the better part of a day getting set up, was it worth the trouble ?

Oh yes… the interface is as glorious as the previews and ads suggested it would be. Wireless connection works like a charm. Cover flow is beautifully fluid.

It may well be the best ipod yet … once you get it to work.