The Jelly Bean (Android 4.1.1) factory image was released by Google very recently. I did not want to wait any long this time. AT&T still did not push the ICS update, so nothing to expect from them. I went ahead and followed the same procedure I went through last time to install ICS. So far it seems like Jelly Bean is indeed faster than ICS. Right after the phone rebooted itself Google Play Store was downloading some 30+ apps I had before and I was browsing, setting up my exchange email account and synching it at the same time. I did not experience any significant lag even though such a large job was going on in the background, something unthinkable with Android before. I am certainly happy with the update but it still has to go a long way to match the instant reaction feel iOS gives to the user for any UI event. It is good to see that they finally started to address the issue.
I am Mohammad Farhan Husain, a Bangladeshi American. This is all about my day-to-day life and opinions.
Sunday, July 29, 2012
Thursday, February 23, 2012
Temporary fix for SSH broken pipe error with Mac OS X Lion
There is a lot of discussion going on in the web on how to fix this problem. I tried a few but none of them worked. Eventually I added an alias to my ".bash_profile" file:
This seems to be working for now.
Saturday, November 19, 2011
My Kindle Fire review
Thursday, November 10, 2011
C/C++ going stronger than what people think
Link: http://www.tiobe.com/content/paperinfo/tpci/images/tpci_trends.png
Wednesday, November 09, 2011
Development model using Git branching
Thursday, October 20, 2011
Quick and easy way to split lots of strings in Java
1. StringTokenizer
2. Scanner
3. String.split
StringTokenizer had to be discarded immediately as it is getting old and is only there for backward compatibility. The Javadoc itself says, "StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code." The Scanner is a great utility but seems to be bit heavy for that method. I had to keep in mind that the method would be called potentially billions of times in a row and it has to be as quick as possible. This left me with only the last option. String.split works in a simple way. It returns an array of strings. So, I could just use something like this:
However, as noted here, there is a performance issue with this. Each String.split() call compiles a regular expression pattern and then uses the pattern to split the string. The pattern compilation is indeed very expensive and can slow the method down significantly. So, essentially what the String.split() method does is this:
public String[] split(String regex) {
return Pattern.compile(regex).split(this);
}
By looking at the implementation, it becomes immediately obvious what one can do if lots of strings need to be split by the same regular expression. One can just have a pre-compiled pattern and call its split method repeatedly:
Patter pattern = Pattern.compile(regex);
...
for (String str : strings) {
String splits [] = pattern.split(str);
// Do something with the splits ...
}
The only thing unknown to me is whether the returned strings allocate new memory or the Pattern.split() method just behaves as String.substring(). But from running the code with more than 2.5 billion strings, I did not see any performance difference between the old and the new approach. It might mean that copies of strings are actually not made.
Sunday, May 02, 2010
My Ubuntu 10.04 Desktop
Friday, April 02, 2010
Vrapper
Tuesday, March 02, 2010
Getting openRDF Sesame 2.3.1 installation with Tomcat 6 to work
java.security.AccessControlException: access denied (java.util.PropertyPermission info.aduna.platform.appdata.basedir read)
I found a discussion about it here. Eventually I solved the problem in the following way:
1. Create and assign the home directory "/home/tomcat6" to tomcat6 user.
2. Create the directory "/home/tomcat6/.aduna".
3. Add the property "-Dinfo.aduna.platform.appdata.basedir=/home/tomcat6/.aduna/" in JAVA_OPTS in the /etc/default/tomcat6 file.
4. Restart Tomcat.
But this did not solve the problem. Then I had to turn off the security entirely which I am sure is not the recommended way. Here is what I did:
1. Set TOMCAT6_SECURITY=no in /etc/default/tomcat6 file.
2. Restart Tomcat.
Problem solved! But in an inelegant way. Does anyone have a better solution?
Monday, November 30, 2009
Problem with libssl-dev while installing Virtuoso Universal Server open source edition in Ubuntu 8.04
checking validity of the OpenSSL headers in /usr... configure: error: bad. Check config.log for details
The solution is to install libssl-dev which can be done as root as the following:
apt-get install libssl-dev
Then I ran make and make install without any problem.
Thursday, November 26, 2009
Web Calendar and Desktop Notifier?
I am looking for a good web calendar and a desktop notifier for it. I know there are couple of excellent web calendars out there like Google Calendar, Windows Live Calendar etc. But none of them has a good desktop notifier. In fact, I could not find any notifier for them. The motivation for not having a desktop notifier for Google Calendar is obvious. Google wants to move everything to the cloud and a desktop notifier for its calendar will be counter-intuitive to that. But I was expecting something from Microsoft as it proposes such a paradigm in its Software + Services strategy site. Though Outlook and Windows Live Mail both can access the calendar, there is not standalone notifier which will run at start up and show and notify upcoming events. Probably there are one or more desktop gadgets out there which I could not find. Can anyone help me in this regard?
Monday, May 04, 2009
Programmer Cartoons
Thursday, March 26, 2009
Change default shell in Linux
Monday, February 16, 2009
Setup passphraseless ssh for Hadoop in Fedora 10
Tuesday, February 10, 2009
Installing TrueType fonts in Fedora 10
1. Opened a shell and changed to super user:
# su
Password: myrootpassword
2.. Created a new directory "banglafonts" in /usr/share/fonts:
# mkdir /usr/share/fonts/banglafonts
3. Changed directory to that one:
# cd /usr/share/fonts/banglafonts
4. Copied the ttf fonts to that directory
# cp /path/to/directory/having/downloaded/fonts/*.ttf .
5. Created fonts.dir:
# mkfontdir
6. Rebuilt the fonts cache
# fc-cache
7. Exited the shell
# exit
8. Restarted Firefox.
There may be some GUI tools to ease the process but my system do not have them and I also do not want to install something which will be rarely used. The simple steps described above are easy enough, even for a newbie, to install ttf fonts in a Fedora box.
Wednesday, February 04, 2009
Adding mp3 Support to Fedora 10
Thursday, January 29, 2009
How to Determine Main Memory Size in Solaris
I was looking for a way to check the memory size of a Solaris machine I am working on. I found a blog post having three commands here: http://sysdigg.blogspot.com/2007/12/how-to-check-memory-size-in-solaris.html. I tried all three but only the following one worked for me:
# /usr/platform/sun4u/sbin/prtdiag | grep Memory
Memory size: 4096 Megabytes
Here is the machine information:
# uname -a
SunOS *** 5.10 Generic_127111-11 sun4u sparc SUNW,Sun-Fire-880
Friday, June 27, 2008
Windows Live Writer
Zippy Zed introduced this nice tool here and I decided to try it immediately. I was looking for something like this for a long time. I have blogs in Blogger and Wordpress and I wanted to have a tool by which I can post to both of them simultaneously. I tried at least one such tool before but was disappointed. I could not even connect to my Wordpress blog. But Windows Live Writer makes it so easy! Using the tool is very easy. It needs only one click to publish. To publish to more than one blog, you have to switch current blog but the text in the editing area does not get lost. Then you have to click the publish button again. The only downside I found so far is the installation process. It took longer than I expected. But considering installation a one time process, I would certainly recommend it to anyone who want to edit blog posts offline and/or want to post to multiple blogs. This is a good job done by Microsoft.

