Skip to content


Burn, AVG! Burn!

I had about it with AVG 8.0 on my office computer. It is nearly as intrusive as Norton. Today i just decided to start a scanner in the middle of my work and naturally it took about 60-70% CPU.. And thats with my settings set to scan at 3 a.m everyday instead of 12.00 as it wanted earlier.

Well AVG is gone.. i just can’t stand it.. NOD32 is taking it’s place. At least it has been tested a lot by me at home and proven to be the best. I still cannot understand why we never installed it int he first place.

Now i will finally be able to do the work without bothering with stupid AV software taking all the resources from my system. And the best part is that ESET updates NOD32 often and detection rate is nearly perfect. Not like AVG that failed the virus test by detecting only about 50%..

Posted in General. Tagged with , , .

WordPress 2.7 – impressive

Yes, I must admit i am impressed by the new 2.7 design and support for Gears.
The dashboard is simply awesome. and with Gears enabled its running really fast.

WP 2.7 Dashboard

WP 2.7 Dashboard

Everyone should try it .. it just rocks :-)

5/5 stars from me

Posted in General. Tagged with .

Useful iPhone apps

After playing around with my iPhone for a few days, i have naturally came to a conslusion that there are tons of useless and crappy apps for it, but at the same time some are quite usefull. Unfortunately most of them cost a lot and therefore I jailbroke my iPhone.. and found a bunch of nice free apps :-)

I guess it was just a matter of time till I would jailbreak that baby.

Anyhow here are some of the nice apps I have discovered (Jailbreak required for all of them):

  • Cycorder – Allows you to record videos with your iPhone, something that Apple does not allow you to do, weird enough.
  • WinterBoard – A very nice replacement for standard SpringBoard, allows custom wallpapers on the SB screens, theme support and lost of other stuff.
  • StatusNotifier and Notifier Widget addon – Combination of those 2 apps will allow you to see the status on your lock screen and status bars with small icons. Really usefull if you ask me.
  • PDANet -This allows you to turn your iPhone into a modem for your PC. Quite nice as well when you are on the road and have unlimited traffic plan.
  • Terminal — Now this baby is really nice for those who are used to Terminal on MacOSX or Linux. Works just the same way and lets you do all tons of stuff. Install OpenSSH and yuo got an SSH client in your iPhone. Now you can manage all your servers remotely via iPhone, no need for a laptop

There are natually way more applications available and probably most people will find something else that is useful just for them, but this is my list.

Posted in General. Tagged with , .

IPhone is here

Got my iPhone today. Finally! Took ages because of Telia being slow as hell. They actually ran out of iPhone when i called them.

Posted in Life. Tagged with .

Happy birthday to me!

Yes indeed! It is my birthday, the 9th of December.

Today i turn 22 which seems like a nice number. I am yet to see what this day will surprise me with and how it will all turn out to be.

Happy birthday to me, i say!

Posted in Life.

Finally some word about the car

Finally I heard something about my car!

Apparently it has already been registered, got registration number and should be ready on Friday or begining of the next week. I sure hope it will be on Friday! That way i ahve an entire weekend to drive around and enjoy!

More update on this matter later :-)

Posted in Life.

First step in Java application optimization

We are always trying to optimize our applications, make them run faster, use less resources, be more stable. Unfortunately this part of the development process is often left as a finishing part and sometimes is completely skipped.

And yet it is so simple to do those improvements while developing applications. One of them is not to use import package.*; and only include the packages you really need. This may sound so simple but I doubt many people think about this when developing applications. I have often heard (and yes i have done that mistake myself recently) people say stuff like “I cant be bothered with every single include, i rather just include everything” and “It doesnt really matter”.

And to be all honest – it is true when developing small applicationsm that do not require to be run for a very long time without destroying the VM (a.k.a restarting the application). But in the long run – the more classes you are importing, the more PermGen memory is used — and that is a waste when you do not need so many classes.

So here is a first and really basic optimization suggestion:

Try avoiding importing * packages as much as possible. I do realize that it may not always be easy to do and your code may become a few hundered lines larger — but in the long run you will not regret it!

Now a fast numbers to prove my point

Unoptimized application PermGen usage:14.5Mb With the following * imports:

import java.util.*;
import java.io.*;
import java.sql.*;

Optimized application PermGen usage: 10.2Mb When replaced * imports with in somewhat 30 classes:

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Iterator;
import java.util.Vector;

As you can see numbers speak for themselves – that is quite an optimization

Posted in Java, Programming, Work. Tagged with , , .

Monitoring Remote Java Apps

Monitoring remote Java applications may not be a very easy task. Especially considering the application needed to be started with -Dcom.sun.management.jmxremote option to allow jConsole access it.

VisualVM has made it a bit easier for us to monitor remote apps. You will have to start jstatd process on your remote system and then you can monitor how your remote VM is feeling.

However.. there are some pitfalls. Here are 2 of the most annoying once:

When starting jstatd you are getting Security Exceptions

To solve this error you will need to create a policy file containing something like this (call it jstatd.all.policy):

grant codebase "file:${java.home}/../lib/tools.jar" {

permission java.security.AllPermission;

};

Now start jstatd with the following command:

jstatd -J-Djava.security.policy=jstatd.all.policy

You are trying to connect to the remote host but getting Socket connection refused.

This is most likely caused because of an underlying exception – connection refused to host 127.0.0.1 or something simmilar (not the IP you are trying to access). This is easily solved by adding the following parameter to jstatd startup command:

-J-Djava.rmi.server.hostname=<your ip or hostname>

… Naturally there are more pitfalls but I am not going to cover all of them here. VirtualVM, just like legacy jConsole may be very usefull for monitoring how some applications act in the testing environment before you put them into producstion. Usually things that do not appear on your development machine while profiling may appear in the test environment where it is hard to notice them without profiling.

One of such problems may be MySQL Connector/J PermGen leak caused by Statement cancelation timer (something i have encountered recently and trying to come around)

Posted in Java, Programming. Tagged with , , .

iPhone Webapp starter kit

Ok, i have recently been interested in everything about iPhone, and one of the things i have looked into was Webapps.

Webapps are basicaly small applications running in the web browser. To make a webapp you simply need to know a little of HTML and Javascript.

First – something to laugh about:

Now, some people have created a starter kit, called iTemplate and are selling it for $199 !!!
Are you kidding me? $199 for a simple HTML page and an image?
Now here is what they write:

Do you want to create your own web app website but you don’t know how? Even if you have only a little website creation experience, you can create your own web app website with our new iTemplate starter kit!

What comes in the kit?

We give you an HTML template file, sample image files in various formats, links to important creation and submission information, and a document explaining just how to create your web app and submit it. We give you information that our design company has learned since day one of our online experience.

Now i seriously hope this is some kind of a joke, and nobody will actually be stupid enough to buy it. I can’t even understand how could Apple release it into their webapps page.

Want to see it for yourself?

Apple webapp page: http://www.apple.com/webapps/productivity/itemplatewebappstarterkit.html

iTemplate homepage: http://www.usa-links.com/itemplate/

And now – something usefull:

Well, that iTemplate thing was pretty amusing until it comes down to you – how do you start? Well, if you really need some kind of template to start from – do not worry – there are actually some good templates available for free, just like it should be.

I present you iWebkit 3.0 http://iwebkit.net/ — a good template under constant development that will help you get started with developing webapps for your iPhone and even let you easily create some cool effects for your webapp

Posted in General, HTML/JS. Tagged with , , .

MySQL Connector/J lockup

Lately I have been working on a multi-threaded Java application that utilizes MySQL Connector/J 5.1.7

This is probably the easiest way to access a MySQL database from Java. Everything seemed to be fine until i recently ran a few days long test of the daemon application on one of our test servers. It did not like me in the long run, i am still not sure why and whether it really was a Conenctor/J problem or not.

In any case, the problem i have faced was CPU usage suddenly started raising to about 50% (in a period of one day) and it wasnt a spike – it was a steady raise. When i checked the log file there were no warnings except one i got a at the end of the day: MySQL connection link failure.

Now one may wonder – how is this related to MySQL Connector. Well, it seems to me that it was due to Statement cancellation timer lockup that it started causing problems. Right now i have modified the code of the application to cancel all statemnts explicitly as well as some forced Garbage Collection, just to make sure that nothing unwanted slips by. The new test has been deployed to the servers and we are about to see if it has any effect.

Another note about Java (not really MySQL related):
It seems to be smart using “-server” option when starting a VM if the application is supposed to run for a very long time. The performance optimization is huge: we are talking about almost 2x performance optimization compared to “-client” VM (default).

Posted in Java, Programming, Work. Tagged with , , , , .