Geneone 0.5 Technology Preview

I’ve compiled a package so you can try out Geneone 0.5 – the latest revision of the software which is powering my blog and the rest of This contains everything which has changed or been added since version 0.4.3. Much of the code and database structure has changed from version 0.4.3 so it is recommended you start fresh rather than attempt to upgrade.

The main new features are the permissions system, dynamic pages, the forum, new object interface, community portal editing and e-mail address changing. I will be writing a few more posts on the forum in the next few days. A full change log is available.

I should stress again that this is a technology preview and you shouldn’t run a website on it.

Download it here

You should only download and install this release if you are comfortable with PHP. Please read the Readme.txt file first; the install.txt file contains some basic instructions on how to set up Geneone. If you are getting a HTTP error 500, try renaming the .htaccess file to something else. If the index.php file is blank, check out rdf.php and see if it presents any errors.

The genescripts/ folder has 3 examples of scripts which integrate with Geneone. Integration with other scripts and being able to write useful scripts utilizing Geneone’s API should become a major selling point in the future.

Feedback, comments and bugs are welcome.  

More on reflection.js

Wow, thank you all for your comments and feedback. Imagine my surprise when I saw this on my reading list in Sage yesterday morning and an article on reflection.js made the front page of Digg. I guess I’m going to have to deal with an angry sysadmin for using the same amount of bandwidth in the last 36 hours as I used in the last 3 months 🙂 At least I can report that and Geneone can handle the digg effect/slashdotting 🙂


Various people have commented that the script does not work in Safari. Theoretically it should work as Safari supports canvas so I suspect that that my Javascript code is at fault. I don’t have a Mac nor is there a version of Safari for Windows so I’m unable to fix this. If anyone with Safari could take a look and maybe fix it, that’d be great. Either mail it to linuxrocks AT gmail DOT com or blog it or leave a comment. For the record, the script is freely distributable and usable.

Why Javascript?

It has been suggested at Channel 9 that "not everyone has a P4 2.8Ghz CPU people; why not pre-render the images if you want them to look like that every load". Doing reflections in Photoshop for every image can get tedious and although you can use PHP, not everyone has access to it. Additionally, using Javascript+Canvas you can do some additionally cool things. For example, have the opacity of the reflection change when you move your mouse over it. If you want to add reflections to forum avatars, JS+Canvas will probably also be a much better solution.

Can you change the parameters?

Parameters such as angle, opacity and fade are hard coded into the script but can be modified with a little bit of work. The following two lines control how it fades out:

gradient.addColorStop(0, "rgba(255, 255, 255, 1.0)");
gradient.addColorStop(0.9, "rgba(255, 255, 255, 0.5)");

The first parameters controls the location of the colour stop. The second parameters control what colour the colour stop is. If you want the image to fade out more intensly, try changing the first argument of the second colour stop to 0.5. If you want the reflection to be more transparent, change the 1.0 and 0.5 arguments. More on DevMo.

To change the height of the reflection, changing every instance of reflect[i].height/2 will pretty much do it. Changing the angle doesn’t work particularly well because canvas can’t (AFAIK) do perspective.

On Prototype

In the demo, I used the Prototype.js library. The only line of code which actually uses any Prototype.js features is var reflect = document.getElementsByClassName(‘reflect’);. If you can replace this line with something else to find all elements with the class name "reflect" then you can remove the requirement to have Prototype.


Download Reflection.js

Google Deal gives AOL preferential placement

According to multiple sources including the New York Times (registration required):

Rebuffing aggressive overtures from Microsoft, Time Warner has agreed to sell a 5 percent stake in America Online to Google for $1 billion as part of an expanded partnership between AOL, once the dominant company on the Internet, and Google, the current online king.

Finally, around 9 p.m., Richard D. Parsons, chief executive of Time Warner told Eric E. Schmidt, chief executive of Google, that he would accept Google’s recently sweetened offer. Google, which prides itself on the purity of its search results, agreed to give favored placement to content from AOL throughout its site, something it has never done before.

The New York Times also reports

If a user searches on Google for a topic for which AOL has content – like information about Madonna – there will be a special section on the bottom right corner of the search results page with links to Technically, AOL will pay for those links, which will be identified as advertising, but Google will give AOL credits to pay for them as part of the deal. They will also carry AOL’s logo, the first time Google has agreed to place graphic ads on its search result pages.

Google will also provide technical assistance so AOL can create Web pages that will appear more prominently in the search results list. But this assistance will not change computer formulas that determine the order in which pages are listed in Google’s search results.

In other words, Google is giving AOL preferential placement in it’s search engine but is doing everything to pretend it isn’t. How does one determine whether a computer formula change will give AOL pages an advantage? An algorithm change could be made with the intent of improving results but improves AOL’s placement.

Google has been living on the good guy image for a while but I believe they’re going downhill. The size and number of ads have been increasing, the eBay adverts are getting stupidly annoying and Google is releasing a lot of junk. Google Reader was a real disappointment, Gmail Web Clips is a useless feature and a way to show more advertising and Google Talk was equally a real disappointment.

In addition, Google results have been getting worse for me and I’ve found that MSN or Yahoo! can give equally good results. Not to mention the fact Google can’t do a simple math sum such as 1 – 0.9 – 0.1

Yahoo! adds JSON support

JSON (Javascript Object Notation) is a simple method for doing web services with Javascript. JSON does not require use of XmlHttpRequest and is unlike REST, XML-RPC or SOAP in that it doesn’t use XML. JSON can bypass the browser’s same-origin policy because it does not use XmlHttpRequest. The same-origin policy is what stops one site from using the XmlHttpRequest object to make a request to another site.

In JSON, you use HTML script tags to call a script from another server. You can dynamically add any arguments on the fly to customize your request to the web service (add search terms, etc.) The server/web service will return a simple line of Javascript code which will call a callback function with an the results of the web service query as an argument. There is an example at the Yahoo! Developer Network.

There is a potential security risk in JSON in that the web service could potentially return any Javascript code it wanted and could do evil things such as redirect the user to another web site or steal cookies. You can prevent this by ensuring only JSON code was returned.

Via Simon Willison

Annoying things about PHP

PHP sometimes really annoys me. Some examples from recent experiences:

References and Returning

I often like to return variables from functions by reference. Most of the time, this is just for performance reasons but there are certain places in Geneone where you must use references or the whole thing breaks. One example is the Gene::getObject() function. Two separate functions may want to call methods on this object. If one updates the state of the object, other instances of the object should also be up to date.

To return a reference from a function in PHP you need to do function &funcname() {}. Only variables can be returned as a reference. For example, function &funcname() { return true; } will give an error (certainly on E_ALL on PHP 4.4, I believe this BC break may have been introduced in 4.4.0). In the getObject() function, either a object or a boolean will be returned. If the object exists, a PHP object is returned by the function. If it does not exist, FALSE is returned. And thus whenever you call the function with an invalid object ID, PHP will produce an error because you cannot return a boolean directly by reference.

To get around this, I’ve had to first assign the boolean to a variable and then return the variable. It’s not elegant or tidy, but it does the job. I can’t think of another way to allow a function to return by reference an object or a boolean without a hack such as this.

When upgraded to PHP 4.4.0, I remember having to do quite a bit of hacking to make Wikipedia work with the 4.4.0 BC break. Some PEAR code will produce similar errors to that I’ve just mentioned so there have also been some ugly hacks there.

Optional and Reference

What if you want a function argument to be both optional and sent by reference. The permissions function took two arguments – the permission name and optionally the User object. The idea was that if no user object was provided, the system would use the currently logged in user. Otherwise, the system would check the permissions of the user object provided. Because an object is passed, it also needs to be passed as a reference.

function checkPermission($name, &$user=null) {} doesn’t work. You can’t seem to have an argument which is both optional and passed by reference.


Windows Live Messenger

The Messenger Says blog (official Microsoft blog run by people who build Messenger) has a feature list for Windows Live Messenger Beta. There is a detailed description of each of the new features and screenshots so there’s no point of repeating it here.

"Word Wheeling" sounds like a really useful feature to find people. I currently use Messenger Plus’ rename contact feature so I can work out who is who even with their esoteric ever-changing nicknames. Messenger Plus works quite well but instead of contacts being ordered by nickname, they are ordered by e-mail address which makes people a little harder to find. Windows Live Messenger will allow you to rename people. One less reason to use Messenger Plus!

Windows Live Messenger also allows you to show timestamps in front of messages. I really like this feature in Messenger Plus! and I had it enabled up until the upgrade to MSN Messenger 7.5 when it suddenly decided to stop working. Ahem, one less reason to use Messenger Plus!

The new design also looks good although I’m not sure about the orange. Red and Purple looks hip 🙂 File Sharing is also good and there is a feature allowing you to synchronise your files. If two people make changes at the same time, there will be a conflict. 

Linus on User Interface Design

Linus Torvalds is encouraging people to switch to KDE citing GNOME’s "mentality" of removing features.

This "users are idiots, and are confused by functionality" mentality of Gnome is a disease. If you think your users are idiots, only idiots will use it. I don’t use Gnome, because in striving to be simple, it has long since reached the point where it simply doesn’t do what I need it to do.

He also writes "Gnome seems to be developed by interface nazis" and "Same with the file dialog. Apparently it’s too "confusing" to let users just type the filename. So gnome forces you to do the icon selection thing, never mind that it’s a million times slower."

And the angriest parts:

In other words: your "majority" argument is total and utter BULLSHIT. It can be true for any particular feature, but it’s simply not true in general.

To put it in mathematical terms: "The Intersection of all Majorities is the empty set", or its corollary: "The Union of even the smallest minorities is the universal set".

Perhaps Linus should join the ranks of Jakob Nielsen and get his own user interface law: "The Intersection of all Majorities is the empty set" . It is true that I find KDE easier to use than GNOME even though KDE is cluttered and 80% of the features no body needs to ever use. Yet, I find Firefox infinitely easier to use.

Perhaps a better way of phrasing it would be to say that the program begins hard to use if the user interface gets in the way of the user. If the program provides too many obtrusive options (i.e. Mozilla Suite) then it becomes hard to find the options you are after. Similarly, if there are too little options and configuration then it again becomes hard to find the options that you are after. (In fact it’s probably worse since you’ll never ever find them.) The key is to find the right balance.

Firefox gets the right balance because it does not ask me to configure things I do not care about such as HTTP pipelining, bfcache or how the browser handles non-existant URLs. However, you can still configure things that you do care about: proxies, tabs, privacy, cookies. And for everyone else, there’s about:config and extensions which give you tons of configuration power. Probably about 99% of Firefox users don’t have extensions installed however because the default setup is brilliant.


Bringing this back to the comparison of forum creation forms I posted the other day, I want to try and give the best balance. We’re probably not there yet; passworded forums may be an important feature as well as permissions. The truth is the forum currently supports neither 🙂

However, there are some options I believe that people just won’t care about. Search Indexing or Topic Icons? Do specific forums really need to have these configurations? Would anyone really want some forums to be indexed and some forums with topic icons enabled and others with them disabled? Or different prune settings for each forum? That’s assuming people even know what pruning is.

VMWare Player with Ubuntu and Firefox

You can now get a Browser Appliance Virtual Machine for VMWare Player. It’s free and gives you a virtual machine with Firefox running on Ubuntu Linux 5.10.

According to VMWare the Browser Appliance will:

  • Protect Against Adware and Spyware: Users protect their PCs against adware, spyware and other malware while browsing the Internet with Firefox in a virtual machine. The Browser Appliance leverages virtual machine isolation capabilities to prevent malware downloaded in the browser from propagating to the normal desktop.
  • Safeguard Personal Information: The Browser Appliance can be configured to automatically reset itself after each use so personal information is never stored permanently.

VMWare Player is 30MB and the Browser Appliance is another 250MB. I can’t see much benefit for people who just want to browse unless your really paranoid but it’s quite a cool way of testing out Linux for free without any risk to your computer. Some other community virtual machines are also available.

Just tried the Browser Appliance and it is pretty immense. 

Via Asa.


Last lesson of the term so we get treated to a video. Yup, Fahrenheit 9/11. Regardless of what I think of Michael Moore or what anyone thinks of Bush, I thought it was highly inappropiate to show political propaganda at school especially since the film was so biased.

I know during the last election the staff made sure they didn’t reveal their political opinions and as well as teaching evolution, creationism also has to be taught.

The Vicar of Dibley or Mr Bean would have been a lot less controversial