Test your english pronunciation

I saw this text on Facebook and I think this is so interesting that I decided to post here so I would be able to send this test to my friends. (If this text/audio belongs to you and I’m infringing your copyright, please let me know and I’ll remove it.)

At the end you will find the correct audio (with the britain english accent).
Continue reading

Autobid bot for mukirana.com

I was cleaning up my trashbin when I found this Javascript code created back in 2010 for autobid on mukirana.com (a brazilian penny auction website). I don’t think they are worried with this kind of fraud because they still are susceptible to this autobid mechanism.

This code will autobid when remains only 2 seconds or less. By the way, it won’t work without some minor fixes.

Are you a good programmer?

Every single day in the last few years I do almost the same thing when I wake up (well, probably you do too). Anyway, during my quick breakfast I ask myself if I did everything possible to be a better person (as father, co-worker, …) than the day before, I think about my family and things that we have to do together and, finally, about my daily tasks at work.

But what relation does this daily routine description have to do with being a good programmer? Well, I’m starting to ask myself everyday if I am a good programmer and, from a specific point of view, my answer is: no, I am not. I think that the first thing to do is acknowledge this “defect” and work to fix it. Unfortunately I have to say that probably you are an amateur or an average programmer.

Let’s take a step back and try to answer…

Continue reading

SQLite and Sqliteman with Mac OSX

If you want a free and open-source “Database Manager” for SQLite running on Mac OS X, I would suggest you to stick with Sqliteman. I think this is the best open-source tool to handle sqlite databases on Mac OS. Check their website for more information about features and screenshots.

How to install on Mac OS X

There is no version available for download on Sqliteman website and you’ll have to install using MacPorts:

hell:~ fmachado$ sudo port install sqliteman

 “QSqlDatabase: QSQLITE driver not loaded” error

I got this error and was a bit painful to figure out how to fix it. Anyway, if you get this error when trying to open a SQLite database, all you have to do is install “qt4-mac-sqlite3-plugin”.

hell:~ fmachado$ sudo port install qt4-mac-sqlite3-plugin


OCPJP6 exam question – serialization

I was reading the SCJP6 book from Kathy Sierra and Bert Bates (one of the most prestigious books if you are pursuing the Oracle Certification for Java SE 6 Programmer) and I found a question that will blow your mind. Well, at least my reaction was something like “wtf! there must be an errata somewhere…”.

Which are true? (Choose all that apply.)

  • A. Compilation fails
  • B. The output is 10 0 9
  • C. The output is 10 0 10
  • D. The output is 10 7 9
  • E. The output is 10 7 10
  • F. In order to alter the standard deserialization process you would implement the readObject() method in SpecialSerial
  • G. In order to alter the standard deserialization process you would implement the defaultReadObject() method in SpecialSerial

My answer was B but the correct answer is “C and F”. Ok, I missed the “F” one and the entire question but why “C” ?!?!?!

What the heck the guys behind exams and certifications think when they are creating evil questions like this one.  Probably you know that static variables aren’t serialized, right? So, why SpecialSerial.z has 10 instead of 9 ? Because “z” is static and any SpecialSerial instance created or unserialized during the execution of this Java application will always have z = 10. 😉

Connecting to a Mac with VNC

How to connect to a Mac from Windows or Linux?

I was figuring out how to do it: should I install something like a dedicated Mac Terminal Server (e.g. Aqua Connect) or compile a VNC from source? Well, neither one. I can use the built-in VNC available with the latest Mac OS (Leopard and Snow Leopard have it).

Just open “System Preferences” → “Sharing“, tick the “Screen Sharing” box and, with this option selected, click on the “Computer Settings” and setup a VNC password. If you want a step-by-step, follow this how to.