web development

A Facebook Bug Causes Lots of Headaches To Developers

Facebook logo

I had a good day yesterday. After spending almost six hours debugging a problem with Internet Explorer (yeah, old news) and a Drupal based Facebook application we're writing for 49st I finally found a solution.

However, this morning I found that the same code that was working yesterday showed some nasty error message. What now?

Javascript Expected Identifier Error On Internet Explorer

A really weird thing was happening with some jQuery code, I was getting this error in both Internet Explorer 6 and 7: Expected Identifier.

I googled a little and found this could happen if you included an extra comma in some expressions but that wasn't my case.

Some coffees later I found the offending code was:

var class = $(this).parent().attr('class');

Yep, class seems to be a reserved word in Internet Explorer, thanks again Microsoft for making web developers lives so difficult.

I just changed the variable name to fix the error, something like this:

var tabClass = $(this).parent().attr('class');

A little later I found another mention of the class problem, hell!, where was this article when I was looking for the fix? It seems you can't set classes with jQuery's attr() method in Internet Explorer either, well, I guess that's why we have addClass() and removeClass().

Why I Decided To Use FSFS Over Berkeley DB With Subversion

I've had enough dealing with permission errors and corrupted database issues in the Subversion repository I use in one of my development servers. Most problems came from using the default Berkeley database as my repository store so I decided to move to FSFS.

Even if the Subversion book has a section explaining how to setup users and permissions and create wrapper scripts to use the correct umask, I didn't feel safe running a repository store that even the Subversion development team perceives as very sensible to interruptions.

Some advantages of FSFS over Berkeley database include:

  • Can be used from a read only mount and doesn't depend on umask settings
  • It's platform independent
  • Repository size is slightly smaller
  • It can be used on network filesystems
  • Quite insensitive to interruptions

So, I've created a new repository specifying FSFS. You just need to add the --fs-type fsfs parameter, like this:

$ svnadmin create --fs-type fsfs /path/to/repos

I'd recommend not wasting your time with Berkeley database for your Subversion setup, just go for FSFS and you'll be cool.

More about Subversion and how I use it on all my web projects coming soon.

The All New Ventanazul: Ready Before 2008?

Brand New VentanazulWell, I don't know, but if not then I'm expecting to have it between January and February 2008.

The new design and relaunch of Ventanazul's site, in English and Spanish, should position it better as the webzine for web developers, with sections for articles, news, podcasts (yeah, I'm preparing for my first English episodes) and a much more active community.

Oh, and speaking of community: even if it's more work I've removed the new users moderation from the forum, there are lots of those horrible spammers that we have to manually remove everyday but more real, and very cool, people are registering and posting, and that's good, we have a lot to talk about: online businesses, Internet marketing, ideas for code and design, music, movies, books, well, a lot, so, don't forget to visit and post in the forum.

Come on!, what you think? Crazy ideas are welcomed as well as suggestions, invitations to speak anywhere on the world and coffee, lots of coffee.

Open Source Applications For Database Modelling

Are there any open source applications to model my database? Many developers have asked me that question quite often lately.

When coding Drupal modules having a good picture of the database model can help a lot to write the right queries, well, actually this applies to any programming project that uses a database with more than a few tables.

Even if there are many commercial applications, many of them quite stable and complete, I think their prices are way too much for most developers, specially for open source developers like most of us Drupal dudes. Want numbers? I got numbers: CA Erwin Data Modeler costs US$ 3995. With that much dough I'd prefer to complete my list of gadgets I want for 2007 and add another laptop with Linux to my arsenal.

So, what are the options to model your database with an open source tool?

Some years ago I found DBDesigner 4 and used it in a few projects to model on MySQL, the only RDBMS it handles. I was quite happy to know that MySQL had taken over the product to relaunch it as MySQL Workbench, however, MySQL has focused on other tools and Workbench progress has been slow. I've recently read in their forum that they were almost finished with other tasks and would return to work with MySQL Workbench. Good to know.

DBDesigner 4 is still available and is a good choice if all you need is MySQL support. The installation is a little difficult in Ubuntu, although I didn't have any trouble with Fedora..

And what happens if, like me, you also need to model PostgreSQL databases? The only application I found for that some months ago was Mogwai ER-Designer, which works with MySQL, PostgreSQL, Oracle and a few other commercial RDBMS. Mogwai ER-Designer is written in Java, so it runs in most operating systems with a JVM.

Unfortunately Mogwai's interface still needs some work and creating models is not too user friendly, even when they correctly use domain dictionaries. I also think development progress is going a little slow.

What I'm using now, and recommend, is Power*Architect, which, like Mogwai, is a Java application and works with PostgreSQL, Mysql, Oracle and others.

I think Power*Architect has a better interface than Mogwai, creating models and generating SQL is quite easy and takes just a few clicks. Power*Architect has been declared open source just a few months ago, way to go guys!, and there are still many features to add and improve (like support for native auto increment fields in both MySQL and PostgreSQL) but it seems the development team is right on track and version 1.0 is coming.

So there you have it, there's still hope and we'll be seeing more mature database modelling tools in the open source arena soon.

Oh, and if you know of any other let us know.

Update September 19: Sean just told me that native types auto_increment in MySQL and serial in PostgreSQL are supported in the latest versions of Power*Architect.

We Need Standards For HTML Email

I've been using Campaign Monitor for a long time and I've just started working with them to improve the Drupal module I wrote a few months ago.

David Greiner and everybody at Campaign Monitor are doing a great job, specially promoting the use of web standards for email, and that's why I'm writing this article. We, professional web developers, must work to get email client vendors to fully support standard HTML and CSS in their products.

At 456 Berea St. Roger Johansson has already made the same call and I totally agree with him.

So, what you're waiting for? You can start by helping to define a baseline to support web standards in email.

Programming Facebook Applications in a DSL Based Server

I recently posted a few ideas on the opportunities for web developers in Facebook.

I decided to use DynDNS for creating a host name for my local DSL connected Ubuntu box, it's easier editing and making changes that way instead of using the other servers I have in a couple of data centers. I used the hostname as a callback url for a Facebook test application. Facebook saw my host and the application worked as expected.

A couple of hours later I disconnected from the Net to take a break, when I got back received a new IP address from my ISP's DHCP server and DynDNS updated my host information to point to the new IP. Unfortunately now Facebook can't find my callback url anymore. I tried editing settings and changed the host name to the new public IP address to discard, still no luck and I'm getting this error:

The URL http://xx.xx.xx.xx/facebook/application-name/ did not respond.

There are still a few kinks Facebook and the makers of application-name are trying to iron out. We appreciate your patience as we try to fix these issues. Your problem has been logged - if it persists, please come back in a few days. Thanks!

Is Facebook caching my older IP address? That was my first thought but even putting the actual public IP of my box in the callback url didn't work.

Is this a temporal glitch in the Facebook Platform or am I missing something else?

I'll keep testing but if you have any ideas I'd love to know.

Fixed: I'm an idiot! I forgot changing the IP address of my database server, also in my local box. Now everything's working again.

Developing In The Age of Facebook and Second Life

I've been in the social networking scene for some time already, I know the power of connecting with the right people and I love to be a part of the online society, gosh, I have a good life thanks to that! but I didn't realize how big all the Facebook frenzy was and the many new opportunities there are for us, web developers, until I started playing with the Facebook Platform.

A cool project in which I'm currently working involves some Drupal modules talking to Facebook and it's a great opportunity to explore new directions in the development of online projects.

As many of you may know (let's imagine you're a regular reader, if you aren't what are you waiting to grab the feed?), I'm a big fan of Second Life, so it was big news when I found a cool group of residents in Facebook, I've just joined.

I'm sure we'll see many new projects involving metaverses like Second Life and social networking platforms like Facebook sprouting online quite soon. Yeah, social networking platforms, not simply sites anymore, Facebook have changed it all.

There're plenty of opportunities for people creating online experiences and if you thought there were already too many fields in the web development arena think again, soon we'll see Facebook apps experts and Second Life experiences builders along with Drupal hackers in web teams.

Gosh!, these are really exciting times for those of us who love this stuff.

So, where do you think you're heading as a web developer? If we can call ourselves that way any longer.