Author Archive

2 coding tools to look at

Wednesday, December 12th, 2012

A couple of tools to look at is Sonar ( http://www.sonarsource.org/ ) and Open Grok ( http://hub.opensolaris.org/bin/view/Project+opengrok/ )

Being bitten by SimpleDateFormat

Wednesday, November 7th, 2012

It’s been a while since I’ve been bitten by a multi-threading issues with the code that we produced, but this one is probably very common problem that is hidden until it’s too late. When using SimpleDateFormat, one needs to remember that it is not thread safe class: so if you have an instance of it that is shared across threads (for example static final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");, you need to synchronize access to it. There are several ways to do it. The easiest is to use “synchronized” when accessing the methods for parsing and formatting, but you might pay a hefty performance penalty for doing that. If you are only interested in formatting, you can use FastDateFormat.html class. Or you can create a ThreadLocal, and initialize your format in initialValue method.

iBartNow – BART application for BlackBerry released

Saturday, May 5th, 2012

check out my new application iBartNow, available on http://www.ibartnow.com. This version (0.5.0) has real time ETA and a BART map – bare essentials, but it is fast and usefull for an everyday BART commuter. Enjoy!

Throwing the Elephant – zen and art of managing up

Friday, December 31st, 2010

My boss suggested I read a book or two on managing up, so I chose a few books that scored high on Amazon and were available at my local library branch. One of them was: Throwing the Elephant – zen and art of managing up.

The book is funny, but I did not find it too useful, since it mainly deals with Executive Level management. Here are quick points I remember from the book. It starts with the zen idea that nothing matters that much – we all are part of corporation, there is no self, there is no boss. Sit up, breathe, drop your ego, cheer up – remember nothing matters.

If you are willing and able to work, it gives you incredible power – since elephant does not want to return to do it. When meeting the creature look it in the eyes, look your best, and say minimal hello unless you know a lot about it already – e.g. it behooves you to study it before meeting. Language is self – learn the language! Know it’s likes and dislikes and feed it e-mails starting early in the morning to late at night. Compliment the creature. Smile.

Disobeying the elephant, which means wrong obeying, pestering disputation, non-obeying with delays. Mention, suggest to it about other people feeling, do not tell, imply. Praise it for humane actions. Convince the elephant the idea was of it’s own making. Take credit for things well done. Learn how to lead the elephant (ideas) and throw the elephant 🙂

Couple of interesting articles from Joel on Software

Friday, December 17th, 2010

Saving pointers for myself:

http://www.joelonsoftware.com/articles/fog0000000073.html – about hiring
http://www.joelonsoftware.com/articles/fog0000000043.html – about writing better code

Problem with Sybase performance

Wednesday, February 10th, 2010

We had a strange problem with Sybase performance: the query that should have used indexes while executing did not, and as a result took forever to execute.  For some reason the time stamp was not treated as date type when set from the code. So the easiest solution was to add ?DYNAMIC_PREPARE=true to the connection string, and that solved the problem.

Tip Calculator For Blackberry released

Friday, September 18th, 2009

A few days ago I release a tip calculator for blackberry phones. The application is very easy to use, and I’ve gotten very positive response so far. Check the calculator out at http://www.naftulinconsulting.com/j2me/tipcalculator.htm

Adding an Icon to Your Website

Wednesday, July 22nd, 2009

Here is how you can add an icon to your website – or actually to all the pages on your site. First of all you will need to find an image and convert it to the .ico format. I’ve used http://www.html-kit.com/favicon/ as an online tool to do that. Save icon image on your site and have pages refer to it with the following head segment:
<head>
….
<link rel=”shortcut icon” href=”_path_to_your_icon_.ico” >
</head>
And that’s it. Now I need to find a good icon for my sites 🙂

Integration testing with Maven

Tuesday, July 7th, 2009

If you need to run integration tests with Maven, check out FailSafe maven plug-in (http://mojo.codehaus.org/failsafe-maven-plugin/). It assumes that your integration tests are in the same directory as unit tests, but are named *IT.java. The reason you want to separate the integration tests execution from unit test integration tests, is because the integration tests take much longer and might have to have some setup before they are run and tear down after they are run.  You don’t want to run the integration tests all the time – it’s too expensive, but you do want to run them before developer checks in the code and (at least) for continuous build environment. To skip the integration tests you can use the following command:

mvn install -DskipITs

When using it, you will most probably get the following error:
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
To avoid this error add the following property in the properties part of pom.xm (after build as described by http://maven.apache.org/pom.html#Properties)
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

One more thing – I had problems by just putting -DskipITs=true, since the plug-in code did not check for it. So I used the following plugin configuration note the skipITs:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>failsafe-maven-plugin</artifactId>
<version>2.4.3-alpha-1</version>
<configuration>
<skipTests>${skipITs}</skipTests>
</configuration>

<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

Place to get video training

Wednesday, July 1st, 2009

http://www.lynda.com/ – one of the places to get the training! My boss mentioned it in our conversation about training materials and looking at the site it might be a worth the money they are asking for… Where does one find time though?