Rails Plugin: Superdumper, helps you visualize your database schema

You know the problem. You are agile like hell. You don’t bother doing complicated diagrams to show somebody what you’re doing. That’s okay. But sometimes, you need to show off what you’ve been struggling with, and if that day comes, this little rakefile can save some time.

Simply , Unpack this file ( tar bz btw ) in your rails app’s root folder and call rake db:superdumper. This will create a file called database.dot in your root folder, containing your database scheme, including associations, in the so-called “dot” format, used by the open-source GraphViz package as input. If you don’t have that package, install it, via ports or apt or whatever applies to your platform. 

In Detail what you have to do is here ( assuming you unpacked the file already.. )
 

rake db:superdumper

This task will automatically dump your scheme and call GraphViz, resulting in a pdf file in the root of your app with the name database.pdf. If it’s not your database schema smiling at you, let me know.

Still alive and well

But just busy doing _work_. It’s fun, but it’s keeping me from blogging the way I’d like to. What happened in the meantime? First of all my MacBook pretended to die, as I wrote here. I figured out yesterday that it was only the new harddisk refusing the work. So now I got a new iMac on the way and a functioning MacBook at home. Luxury is here.

I think it’s a bit nasty that Apple enrolls the AppleCare subscription just after completing the order process, without being able to use this machine. This means I’m paying for 5 days more than I can actually use this service. Sucks.

Next I’m quite impressed by Rails ( again ). It just works like a charm, really, although I couldn’t get passenger on Debian etch to work, but I think that’s something quite fixable. We’ll see.

Unfortunately I can’t tell you anything about the project I’m working on, but I’m very excited to be part of it and hopefully I’ll show you what I’m doing here. I also wrote an acts_as_localized plugin, enabling localized database models that are used just as normal models. The code is not the best, but if someone wants to have it, just ask.

So long :-)

The need for web-development certification

Good day. I need to distract myself from trying to reanimate a Windows-PC. Quite frustrating and pretty unsuccessful so far, but let’s see. Why a certification of the abilities of a web-developer? Well, there are plenty of good reasons. Let’s get into them.

First of all, everyone doing something seriously should be able to get a certificate on his or her field of work. If you’re a professional, why bother taking a test and tell the world you made it? I’m getting your point here: a test only for the sake of a test isn’t worth it, right.

Web standards are a very serious matter. Of course, the average internet user doesn’t bother if a page doesn’t look cool or something, even flash-based pages impress. But when it comes to accessability, typography, usability, web standards try to give developers a good set of tools one can use to improve the overall experience of both the developer and the consumer. There is no direct impact of whether you’re still using tables or already using divs to layout your content, but in the long run it will pay out, even if it’s only that you made it to decrease your traffic costs.

Another very important reason is that web-development and web-design is still terribly underpaid. Many of my friends are doing such things for .. almost nothing, while some well-established companies are building terrible html4 pages and getting a huge load of money for it. And that’s where a certification would kick in. And by proving customers that you are indeed worth it, everyone with the real ability to build web-based stuff would certainly have the realistic chance to increase his or her income.

In my opinion, this certification should be something free, a community should build it, I don’t know how but I’d be glad to have such a thing.

Still no Java 6 for Intel 32 bit and PowerPC based Macs

Running Mac OS X, i forgot to mention that in the headline. Why? Apple is most likely busy updating it’s own stuff, promoting it’s platform, and since the iPhone came up, many people started learning Cocoa, so the developer base there has grown, too. Additionally, the general user base is also growing, making it a more interesting target for Software Companies. And there are not many basic rules, valid everywhere, but one is for sure that Java Desktop applications just don’t integrate well. There is maybe an exception for programs using SWT, but still, the native look and feel is something different.

So the question I’m asking is whether it’s that bad that there is no Java support? Yes! Absolutely! At least if you either use programs or build programs depending on it. Of course, most programs just work fine with Java 5, but there are some that just don’t. And so one of the main reasons for Java is obsolete: write once, run everywhere. And while Sun, the company behind Java, is providing Runtime Environments for Windows and Linux, it’s not for Mac. So it’s not Apples fault alone. But careless of who’s fault it is, it just sucks, clearly spoken.

The top 25 programming errors: Watch and avoid

Security is always a big issue, whether you are writing for a big company or just for fun. But many people, especially beginners, tend to underestimate the importance of securing their applications dramaticially. While stuff like a well-designed interface and the proper function of the application is directly visible, security works the other way round: it’s presence ( or a lack thereof ) are only visible when it’s in most cases too late. So, as for testing, security is a important quality attribute of your software, and you should care, and if you don’t know where to start, the SANS-institute released a very comprehensive list of the most wanted programming errors.

The list was created in collaboration with major actors, like Microsoft, Cisco and other popular names. While not all of them are applicable to all kinds of applications, you will certainly find some that do, and this list is certainly a very good source to start reading on that topic.

Enough written, the document can be found here: Top 25 programming errors.

Microsoft to receive the annual award for the funniest bug

Keep looking for that headline! The reason is simple, and you will agree ( hopefully ) that this is indeed a freaking funny bug description. The bug itself is funny, too. And I just don’t understand why, but let the details rest aside, and let’s enjoy it:

A Web site cannot set a cookie if the Domain attribute is in uppercase characters and has an odd number of characters in Internet Explorer 7

You can read find that bug in the Knowledge Base. This post features nothing else but this bold bug description, so here’s my question, to be answered in the comment: what do you think was the code that caused this bug looking like? Any languages ( even brainfuck! ) welcome..

Edit: I stumbled upon a video demonstrating that by getting the square root of 4 and subtracting 2 from the result, the calculator.. outputs some rather unique result. Any explanation here? Try it, works in any Windows version. Buggy times.

What my fellows are doing: Study projects

A lot of stuff. Mostly, their blogs and documentation of their study-related projects is in german ( which is not a big deal if you’re german .. haha ), but I think that it’s interesting to take a look at what they are doing.

Tommy was or is ( he claims to be at 90% ) busy coding some kind of document managing system in Java, you can read all about it in his blog. He seems to be a bit focused on glass effects, though. And his blog is in english, so good for you. 

Good boy Johannes, who is just like me, long-haired and changing his blog URL quite frequently, is very ambitious: he’s doing a game engine in C++. He points out what he’s doing very detailed in his new blog at mumpitz.p-shuttle.de. Unfortunately, it’s in german.. 

Käse ( best nickname ever, means just “cheese” ), who just got married, congratulations, creates some musical visualisation using Process. Read about it here. He’s not updating it too frequently, but the stuff present, especially the preview movie are quite amazing.

These are only the projects of the three guys I’m talking to frequently. I don’t have one so far, but I’m on it, trust me!

Zeroconf made easy: Bonjour for Java, Part 2, Client Implementation

I’ve been writing about the server side implementation aspects of Bonjour for Java a while ago, and I promised to explain the client side, which is a bit more tricky. The reasons therefore is that it makes heavy use of asynchronous callbacks, leaving you no other choice but to implement some interfaces and understand the way things work behind the curtain. Continue reading

Why PHP should be banned.

Neither is Basic! Really, normally I’m trying to be objective, but I just can’t when it comes to PHP. I’ve done a lot of stuff in PHP over the years ( yes, including a CMS, Portal, Guestbook and Gallery ) but as far as I can tell this language meets every requirement to be disqualified as something to consider when it comes to serious, professional software development.

There is certainly good software ( or software that pretends to be good ) written in PHP. But it’s not the majority. PHP just encourages programmers to do everything insecure, non-reusable and not really portable.

Just think of the word PHP/MySQL, which is nothing but a pain in the ass. I’ve been running Postgres for years, and every now and then a small PHP script comes my way requiring MySQL. Whhuuzza. No Database Abstraction. And now that there is one, all popular software still uses these funny mysql_do_whatever() methods.

Function naming is certainly another thing that terribly went wrong at some stage of the development. Has someone ever scanned the PHP sources for the functionNameObfuscator.c? I guess there is none, as no program could ever obfuscate stuff that badly. Now, in the upcoming PHP release there will be finally support for Namespaces, though I’m not really convinced that any of the built-in stuff will be used there prior to 2010.

PHP is perfect to learn some concepts. Like OOP, because there is no need to compile stuff, no need to worry too much about data types and stuff, but once you’re about to do a real project, keep in mind that type checking, namespaces etc. are stuff that could potentially matter at some point of the development. 

What I find most confusing is that simple statements just don’t work. Why? I don’t know, they just don’t. Example? There you go

// assuming the function foobar() returns some array.
// this won't work.
echo foobar()[0];

Cool, hu? Not really. And as far as anything WebProgramming is concerned, I just learned my lessons and use something like Merb, Rails or even Java EE. G’day.

Code Reviewing Techniques

I stumbled upon ( just love this proverb ) this nice article about different types of review techniques for software developing or engineering teams. Definitely worth reading.

Edit: I’m forced to claim that with appropriate code reviewing, the already world-famous bug in Microsoft’s Zune would have been found, prior to causing many people so much trouble. Look and Learn..

year = ORIGINYEAR; /* = 1980 */

while (days > 365)
{
    if (IsLeapYear(year))
    {
        if (days > 366)
        {
            days -= 366;
            year += 1;
        }
    }
    else
    {
        days -= 365;
        year += 1;
    }
}

If you don’t get it at the first sight: http://www.crunchgear.com/2008/12/31/zune-bug-explained-in-detail/ should help.