Tuesday, December 7, 2010


I'm a man of milestones ... so since 2006 I'm keeping track of the novels I read. Not the articles, blogs or profession-related papers and books, just the novels, literature. And it's a shaming seven novels per year. Good novels, famous authors, good Amazon ranking, but still ... seven. 25% of them are in English which accounts in part for the low number. Still ... seveeeen ?!

I then started this interesting exercise, of building from memory the list of novels I've ever read. Subject to memory loses, the list is still small, way too small. But doing the exercise, it felt good, it was in essence a review of an important aspect of my life. The list I built it's a snapshot to which to compare against in one year, two years, every year.

I won't set personal targets at this point, nothing like the one novel a month type, I'll just keep the list as a snapshot. And I'm going to think positive, low number but high quality. As someone dear to me said once, Life is too short to read bad books.

Here are two links you might find useful:
All Nobel Prizes in Literature
All TIME 100 novels

Wednesday, November 17, 2010

what is an API

It's about that part of the code that's exposed to the public, the public API ...

When you need to change it, you might have to go through an API review board. Generally they will reject any changes that will make the API incompatible with previous versions. Cause this translates to having all the clients of the API change their code against your new API version.

There are cases when keeping the API compatible will be so difficult and add/or so much technical debt that the review board will accept version incompatible changes. They will work with the field engineers to understand what clients feel about this change and with the PM so that the next product version (the one shipping the version incompatible API) increments its major number.

It's not only the changes to and the removals from the API that should be reviewed by the API, it's also the additions. If the additions are badly designed, you'll still have to stick to them in the future, cause that's what public in public API obeys you to.

Yet there is another type of change that must be brought to the attention of the board: not an API change, but a behavioural change. Why bother then? Cause while clients' code will still compile, it will stop functioning as expected any more. And the only way to communicate this is through the API documentation.

Here is an example: a login API that changes from querying the company ActiveDirectory in favor of OpenID.

We should stop thinking about the API as just a set of classes and their methods. It's also the behaviour that's triggered when using those classes and methods.

Friday, October 29, 2010

automated replies

Sometimes I find it hard and sometimes time consuming to compose an email: it has to say Hi and then at least a one line as introduction and then the real message, and then a signature. Should I write my job title above my name or they'd think I am too formal? Should I say Respectfully yours or just Cheers?

The format is something that emails sent by a software do not have to conform to. In the end who would think badly about some bytes that are not polite enough?! Instead the recipient will be quite accommodating with the message and more than this, grateful that someone took the time to code and set up a program that actually does notify people about things happening.

This is what I speculated on. After getting an invitation to a one-hour event that SDL Language Weaver is organizing in Cluj, this is what I wrote as a response to their confirmation request:
This is an automated confirmation email that I intend to participate at the event SDL Language Weaver is holding on Nov the 4th at City Plaza.

Funny enough, I've just received a Thank you message from their HR manager. There was no mention of my name there, so she must have sent an automated reply.

Wednesday, September 8, 2010

Tuesday, August 10, 2010


There are 3 main languages in Server Automation: Java, Python and PL-SQL.

I am using this Java code
new SimpleDateFormat("dd/MM/yyyy hh:mm")
to format a Date object like this
day/month/year hour:minute

This is how I'd do it in Python:
time.strftime("%d/%m/%Y %H:%M", time.localtime())

and this is how I coded it in PLSQL a few day ago (obviously mislead by the two guys above):
TO_CHAR(_column_, 'DD/MM/YYYY HH:mm')

which resulted in me spending one hour starring at the same output '09:08'. For one hour I was tricked into thinking the business logic that updated the column was wrong. But the hour passed by and Oracle said to me: now it's '10:08', which lead me to think we were not speaking the same language ... definitely I was not mastering Oraclian (=PLSQL) properly: it turned out that if I wanted minutes, it should be MI and not mm.

For that hour ... someone should take the blame, what about the creators of one of these languages for not following the conventions set out by the others. It should be the ones that arrived afterwards, right? Or probably it should be the standard bodies for not getting into date formatting.

Or should I think that French sounds sexier than English, learn both and embrace the diversity? But I have not been acquainted to many sexy engineers over time ... so can we all agree from this point on that when I want the time printed ... it should be HH:minutes? I'm hearing they spell it the same in France ...

Friday, June 4, 2010

in an immature market ...

... interviewees for your job might ask you to double their current salary without any apparent reason except they want to change houses
Begging? Are you kidding? We'll live in a big house on Harbour Road. You, me and Salim, the three musketeers. (Slumdog Millionaire)
... interviewees for your job might ask for a significant raise just because the local currency went down and car prices are still expressed in euros
There's a lot of very important decisions into buying a car. So we have to approach it as mature, responsible adults. (So Little Time)
... there is a crisis of managers
Deputy Arnold. He took a seminar in crisis management last year. (Leverage)
... if you are a smart engineer and have some above average communication skills, your employer will want to make you a manager; change the employer, same story
Me? Why me? I'm nobody. I'm the supervisor of a Nerd Herd, at a Buy More. Maybe someday I'll be assistant manager. but I don't even know if I want that job. (Chuck)
... employees are titled "senior" much earlier; the employer has to be inventive and come up with more titles ... senior++?
Oh, yes, I remember this case. A high school senior at age 12. (CSI: Crime Scene Investigation)
... some software engineers change jobs every year or so and get raises with each move they make; employers, when will you start rejecting such candidates solely based on this criterion?
To kill an infidel, the Pope has said, is not murder; it is the path to Heaven (Kingdom of Heaven)
... 10+ years of experience in the same field and you're a superstar
Travis Colt. Our local superstar. He used to race for Nascar... (Death Race)

Tuesday, May 25, 2010

a tool to watch my busy hdd

1. Windows TaskManager (MS): It shows a historical view of the various I/O operations performed by the processes. It's not about NOW, so this is not the tool I'm looking for:

2. ProcessExplorer (MS): there are two views to choose from:
- the column-oriented view, where you can add a I/O delta metric to show what process is doing I/O NOW; here is my ClearCase client right after starting it, clearly the top performer

- the graphical view where the process is shown as you hover your mouse over the I/O graph

This tool can do the job. But if you are a purist and consider that I/O in ProcessExplorer it's not only about the disk, but also networking and other devices, then you might want to continue your search (see below, definitely Gmail Notifier and Yahoo Messenger are not that disk intensive, it must be networking).

3. Free Extended Task Manager (Extensoft): Right to the point.

(But every tool has its problems: if you need to watch how a particular process uses the disk over a short span of time, it'll be difficult since the processes table above looses its selection after every few refreshes)

Friday, April 2, 2010

EDT deadlock

Many swing developers are probably unconsciously on the it-won't-happen-to-me side on this one, but I am the living proof that these things happen ... ok, once in a year. The bad part is that it can manifest for your clients running the latest Windows 2008 build, while your XP buddy will behave ok.

This is one of the situations when a debugger can't help you out cause your app is frozen, so ... meet thread dumps. Because most swing apps are consoleless, Ctrl+Break or Ctrl+/ won't work. But your smart IDE should help you take thread dumps; alternatively use <JAVA_HOME>/bin/jstack.

When your application freezes, you might be experiencing a deadlock, ex. when 2 or more threads are blocking each other, or it could be a temporary blockage due to resource unavailability. Let's go for the first case in this post.

Finding the buggy code turns out to be very easy: for a thread dump generated by the Sun JVM, start by looking for the string BLOCKED in the thread dump.

Immediately you can see the lock that this thread is trying to acquire, search for it in the rest of the thread dump.

It turns out the same lock was acquired previously, and in this case by the EDT. Moreover, the lock that the misbehaved "NGUI Thread Pool-2" thread is trying to acquire is a core swing lock.

The fix in such cases is (almost?) always making the code that tries to acquire the lock run on the EDT: go to the misbehaving thread, then backwards on the stacktrace until you can recognize some of your code. Then dig through it and decide on the place where the flow should continue on the EDT instead of your own (background) thread. You do the magic by wrapping your call like this:
SwingUtilities.invokeLater(new Runnable() {
    public void run() {
        <your call>    }
If you want to avoid such headaches altogether in the future, then play by the book ... and the book says:

Swing event handling code runs on a special thread known as the event dispatch thread. Most code that invokes Swing methods also runs on this thread. This is necessary because most Swing object methods are not "thread safe": invoking them from multiple threads risks thread interference or memory consistency errors. Some Swing component methods are labeled "thread safe" in the API specification; these can be safely invoked from any thread. All other Swing component methods must be invoked from the event dispatch thread. Programs that ignore this rule may function correctly most of the time, but are subject to unpredictable errors that are difficult to reproduce.

Wednesday, March 10, 2010

agile is not communism

I enjoy a lot articles that mix social and software sciences. And I think they provide much value to the software community cause software is built by people (still, as of 2010), so their psychology and their interactions drive the software development.

This is a lightweight reading for the morning in this respect: Agile is Not Communism. And even if the author does a pretty good job of proving there is not much similarity between Agile and Communism, this phrase stayed with me: Several people in my class are asserting that agile is just like communism and since communism failed, agile is not likely to succeed either.

If you are like me and feel that today's Capitalism is not far from failure too, then take my advice and visit Greece, while it still has its islands ...

But since it's still early morning and we need our optimism for the day, take this quote from John Kenneth Galbraith: Under capitalism, man exploits man. Under communism, it's just the opposite. ... uhh, did I say optimism?!

Monday, March 1, 2010

next to binaries

There are not many things you can deliver to make your customers happy: one is definitely the code, and the 2nd are the docs: user-level documentation.

I've been recently asked to review the part of the documentation for the feature we are owning, and it was a surprisingly fun thing to do. I had no different feeling when reviewing it than the one I have when cutting some clever piece of code. It felt like putting the cream on the cake. It was an easy win: improve a deliverable that the client will definitely touch, cause our customers do use the documentation.

This line probably sounds right: good software comes with good documentation. But it's the other direction I am interested in exploring right now, what can documentation do for the code?

When evaluating new software I could use, like a web framework, those that have good docs have a much higher chance of getting in my toolbox. I start by looking for a section that would give me a basic setup fast, like Up and Running in Ten Minutes. Then I am awarding additional points for an introductory video. Then I will scan for How To-s for sensitive problems and references like configuration file and API ones. I admit though that once the tool is in my inbox, a weak online help won't make me drop the tool, as long as the help is not annoying.

For software developers good documentation means marketing. You'd want to grab market share, which for freelancers especially translates into increasing the number of users of the software. My advice is Write docs and keep them up to date, ask for reviews for even better docs.

Disclaimer: this post has not been reviewed before publication, hence it might contain some typos. No excuse though if it contains stupid ideas.

Wednesday, February 10, 2010

customers have a say

They are the most useful slides I've seen in quite a while. No need for anyone to narrate them, no regrets that you were not there when the presentation was held. Cause they are self contained, straight to the point.

If you asked yourself at a certain time What feature should we implement for the next release? then these slides are for you. No guessing, no gut-feeling, but real-world data ... from those who dislike wasting extra clicks, who feel pain because you don't support the new device out on the market, who would love your shiny feature even more had you documented it. Your customers.

Wednesday, January 20, 2010

the essence of agile

For those who love agile, practice agile daily, feel it in their bones but have not been so agile to find the site with the essence, here it is http://agilemanifesto.org.

Saturday, January 16, 2010

a low importance misfeature

JDoe had a long day, he's been debugging and re-installing and patching for the last 10 hours. And it all worked like magic in the end after a simple reboot. He had spammed quite a few inboxes in the process, so he is thinking now he should probably send a final email saying Hey, it all worked out after a reboot, thanks for your help.

Is this important enough to warrant a new email? Wouldn't he bother the team even more? So he decides he will send the email with low importance ... see, every problem has a solution.

... is it so? What do you do when you get a low importance email in your inbox, do you skip it? Do you simply delete it? Or you have a filter that does this for you? I admit none of the above in my case. I read all my daily 30 something emails in the order I get them, normal, high or low importance ... indeed in some cases I go to high ones first, rarely though.

Weird enough, low importance emails draw my attention more than normal ones thanks to the nice little blue arrow in front:

AND my email client pops up notifications for low importance emails just as for the others, instead of letting me focus on tasks with a normal importance at a minimum.

Dear JDoe,

I am sending this normal importance email just to you. Please save some of my time by sending a regular email only to the ones that tried to help; forget low importance emails.