Can anyone tell me why I cant upgrade my mobile phone software?? Not some Java application on the phone, but the actual operating system. How much of a difference is there between a Nokia series 40 and Nokia series 60 phone in terms of hardware? Should I not be able to swipe the existing JVM which was based on an older Java implementation to a newer one? Will I ever be able to customise the hardware in the phone? Maybe we'll have to wait a bit longer for programmable hardware.. probably through FPGA's.
In a few years the mobile phone will be more important the the average computer. More people will use handheld devices for their daily tasks like browsing the net and listening to music. Developers will follow.. creating the next generation of killer applications.. followed by hackers to free the platform.. and by then google will own all your data
Monday, October 30, 2006
Tuesday, October 24, 2006
Ubuntu 6.06 (Dapper Drake) on Acer AS3004WLCi
I had installed Dapper Drake on my Acer AS3004WLCi Laptop a few months back. I've been happy with it but there were several things that didn't work. I've been pretty lazy but I think I've finally resolved most, if not all, of them. Here's a run down.
Firstly, what didn't work:
What I did to resolve these issues:
Most problems have solutions out there. All it needs is a bit of searching/reading/trying.
Lets see how many of these issues are resolved in Egdy Eft which comes out tomorrow!
Firstly, what didn't work:
- After booting up and picking Ubuntu from the grub menu list, a few kernel messages would show up and then there would be a blank screen until X Server started up with the login box. Similar issue when shutting down... didn't see any messages.
- Same thing for Virtual Terminals... Ctl-Alt-[F1-F6] would bring up a blank screen.
- Resolution for the 15.4 inch screen would only bring up 640x480, 800x600 and 1024x768 options. No wide-screen 1280x800 resolution.
- Touchpad scrolling would not work.
- Suspend/Hibernate would work the first time after booting up, but after resuming there would be a message saying there was a problem and on subsequent attemps would fail. It would look like it's doing something, screen would go blank, then all of a sudden some garbled text would be displayed at the top of a black screen and the screen saver would start up.
- Wireless would not work. Would not detect the card.
- Issues with sound... If multiple applications which use sound such as a music player, a flash site and skype were open, things would be very erratic. Skype would give errors like 'Problem with sound device'. Flash based sites like YouTube or Google Video would not have sound etc...
What I did to resolve these issues:
- Turns out that the blank 'bootup/shutdown screen' and blank virtual terminals are related. When you pick Ubuntu from the grub menu list, it loads up the linux kernel which in turn loads a basic video driver to show the kernel messages. The video driver is considered to be basic and compatible with most screens. If the vga parameter is not passed to the kernel it defaults to vga=normal. It seems it wasn't with my Acer screen. So this needed to be changed. Edit /boot/grub/menu.lst. Add vga=792 to the kernel /boot/vmlinuz-<version> root=<hda> ro quiet splash line.
HOWTO: Change bootup resolution was really helpful. It goes into further details about the bootup process etc... Also read it to understand the 792 value.
The kernel uses the same driver for both the 'bootup/shutdown screens' as well as the virtual terminals. The vga parameter fixed both these issues. - The touchpad scrolling problem and the screen resolution problem had a common resolution.
lspci | grep VGA
shows
VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760/761 PCI/AGP VGA Display Adapter
on my Acer laptop.
So we need a sis driver. Looking at /etc/X11/xorg.conf showed that it was loading the vesa driver. To fix this run
sudo dpkg-reconfigure xserver-xorg.
Go through all the screens and answer the questions. For most, the default will do. When you get to the video screen, pick the sis driver and the desired resolution (1280x800). Make it the default. After this is done restart X-server (Ctl-Alt-Backspace). It should start with the crisp widescreen resolution.
The Strange screen resolution thread got me the lead on trying dpkg-reconfigure.
Check this page for some bedtime reading on sis drivers.
The touchpad scroll started working after going through the reconfigure. I didn't do anything specific. I think I just picked default options for the touchpad/mouse screen. - The Suspend/Hibernate issue was related to Wifi not working. Funny how these things are related no? The garbled text that was displayed after a failed suspend became clear after the virtual terminal issue was resolved. It was outputting bcm43xx: Error: Microcode "bcm43xx_microcode5.fw". dmesg showed the same error.
lspci | grep Wireless
shows
Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
on this Acer laptop.
So this is the wi-fi driver. After some searching, came upon How to: Broadcom Wireless cards (These How-Tos are amazingly helpful!). I followed the instructions and it seemed to work. iwconfig brings up the wireless network interface information + iwlst <eth> scanning shows the wireless connections available.
After suspending and resuming, looking at the dmesg output, the errors weren't there anymore.
Check this page for some insight into the suspend/hibernate process. - The sound issues took care of themselves really :) Upgrading the kernel to 2.6.15-27-386 seemed to resolve all of them. Also upgrading to Skype 1.3.0.53 helped.
Most problems have solutions out there. All it needs is a bit of searching/reading/trying.
Lets see how many of these issues are resolved in Egdy Eft which comes out tomorrow!
Saturday, October 14, 2006
Dependency biculturalism
Nicely put: What do dependencies have to do with Free Software?
This relates closely to Biculturalism which Joel talks about.
This relates closely to Biculturalism which Joel talks about.
Monday, October 09, 2006
Thursday, October 05, 2006
Ubuntu on a Dell 6400
Yipee.. I recently purchased a Dell laptop - Inspiron 6400 (also known as E1505). The first thing I had to do was to install Ubuntu. Luckily for me this is a common model and comes with some standard components and most of the things work with little or no configuration.
By default I got a resolution of 1028x768 on the widescreen which supports 1280x800 natively. So things were looking pretty stretched. The i915 wiki page explains pretty well howto get the correct resolution.
Another fun thing I did was to get the GKrellM with i8kutils. GKrellM is used to monitor the system. Its something I need to look more into. i8kutils is a dell laptop specific lib for intrumentation of the processor fans. Installation was explained in the Ubuntu forums over here. However after installing everything as explained, GKrellM still does not show any fans. For that, within the GKrellM configuration, the i8k plugin needs to be enabled first. After that two fans will be visible. Clicking on the fan can be used to toggle to Manual mode for fan and set the speed as well which you can confirm by listening to the low buzzing noise!! However I dont expect the processor to burn as the author says :) as the Intel motherboard automatically sets the fan speed based on heat.
By default I got a resolution of 1028x768 on the widescreen which supports 1280x800 natively. So things were looking pretty stretched. The i915 wiki page explains pretty well howto get the correct resolution.
Another fun thing I did was to get the GKrellM with i8kutils. GKrellM is used to monitor the system. Its something I need to look more into. i8kutils is a dell laptop specific lib for intrumentation of the processor fans. Installation was explained in the Ubuntu forums over here. However after installing everything as explained, GKrellM still does not show any fans. For that, within the GKrellM configuration, the i8k plugin needs to be enabled first. After that two fans will be visible. Clicking on the fan can be used to toggle to Manual mode for fan and set the speed as well which you can confirm by listening to the low buzzing noise!! However I dont expect the processor to burn as the author says :) as the Intel motherboard automatically sets the fan speed based on heat.
Sunday, October 01, 2006
final by default
When talking about 'good programming practices', one thing that was recommended by a good professor of mine was to declare variables that you aren't going to modify as final. It serves two purposes:
While trying to follow this (in Java) I found all these 'final' keywords all over the place. I began to feel that it wasn't really helping. Just cluttering the codebase with 'final's.
So why not just have all variables be final by default?
Along these lines, I feel providing all the abilities of C++'s const to Java's final would be a tremendous boon. Your contracts can be better defined - not just on references but on the objects themselves.
<soapbox>Code maintainability - getting up to speed on a codebase and changing someone else's code is something that is done far more than adding new code. Anything to make readability better by clearly defining contracts/intent can only be a benefit and should be strived for.</soapbox>
1) A self check for yourself so you don't accidentally modify the variable down the line somewhere
2) Self documents the code: Other's reading your code know immediately of your intent.
While trying to follow this (in Java) I found all these 'final' keywords all over the place. I began to feel that it wasn't really helping. Just cluttering the codebase with 'final's.
So why not just have all variables be final by default?
Along these lines, I feel providing all the abilities of C++'s const to Java's final would be a tremendous boon. Your contracts can be better defined - not just on references but on the objects themselves.
<soapbox>Code maintainability - getting up to speed on a codebase and changing someone else's code is something that is done far more than adding new code. Anything to make readability better by clearly defining contracts/intent can only be a benefit and should be strived for.</soapbox>
Monday, September 11, 2006
Shutup PHP @ $%!
OK.. I'm getting a bit carried away here.
I saw a bit of code in PHP like ..
$contents = @file_get_contents($filename);
But what is the @ before the function call?? As bad as I am with googling I was not able to get some good docs on this. The best info I got was from meeting notes which says that its called the shut-up operator.
So then I backtracked to the PHP manual and found Error Control Operators. The doc says..
"PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored."
Yet another example of a lazy programmer trying to code before reading docs
I saw a bit of code in PHP like ..
$contents = @file_get_contents($filename);
But what is the @ before the function call?? As bad as I am with googling I was not able to get some good docs on this. The best info I got was from meeting notes which says that its called the shut-up operator.
So then I backtracked to the PHP manual and found Error Control Operators. The doc says..
"PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored."
Yet another example of a lazy programmer trying to code before reading docs
Monday, September 04, 2006
Re: On the road
Saturday, August 26, 2006
Internet Explorer on Linux??
You mostly want to check for web page compatibility with IE if you're doing some web app stuff. So whats the solution if you prefer to use a linux distro rather than Windoz??
Enter ies4linux. ies4linux installs IE binaries over Wine. Wine is an Open Source implementation of the Windows API on top of X and Unix. ies4linux has a script which will download the IE setup files right from the microsoft site, and install over Wine. The best part is that you can install multiple versions of IE as well ;)
Enter ies4linux. ies4linux installs IE binaries over Wine. Wine is an Open Source implementation of the Windows API on top of X and Unix. ies4linux has a script which will download the IE setup files right from the microsoft site, and install over Wine. The best part is that you can install multiple versions of IE as well ;)
Wednesday, August 16, 2006
Saturday, August 05, 2006
Circular dependency between Tables in SQL
Update: Added a new way to solve the problem
Q) How had to create Tables with a circular dependency between them. Like
CREATE TABLE A (
....A_ID INT,
....PRIMARY KEY A_ID,
....B_FK INT,
....FOREIGN KEY B_FK
....REFERENCES B(B_ID)
);
CREATE TABLE B (
....B_ID INT,
....PRIMARY KEY B_ID,
....A_FK INT,
....FOREIGN KEY A_FK
....REFERENCES A(A_ID)
);
... now this will not work as during create, table B does not exist
A) So one solution is ...
CREATE TABLE A (
....A_ID INT,
....PRIMARY KEY A_ID
);
CREATE TABLE B (
....B_ID INT,
....PRIMARY KEY B_ID,
....A_FK INT,
....FOREIGN KEY A_FK
....REFERENCES A(A_ID)
);
ALTER TABLE A ADD COLUMN B_FK INT AFTER A_ID;
ALTER TABLE A ADD FOREIGN KEY B_FK REFERENCES B(B_ID);
A little bit of cheating does the trick :)
A) Another mysql specific solution is to use the FOREIGN_KEY_CHECKS variable.
mysql> SET FOREIGN_KEY_CHECKS = 0;
mysql> SOURCE dump_file_name;
mysql> SET FOREIGN_KEY_CHECKS = 1;
In the dump_file_name, tables can be created in any order without checking of Foreign Key constraints. So we can create tables with circular depenndencies
Q) How had to create Tables with a circular dependency between them. Like
CREATE TABLE A (
....A_ID INT,
....PRIMARY KEY A_ID,
....B_FK INT,
....FOREIGN KEY B_FK
....REFERENCES B(B_ID)
);
CREATE TABLE B (
....B_ID INT,
....PRIMARY KEY B_ID,
....A_FK INT,
....FOREIGN KEY A_FK
....REFERENCES A(A_ID)
);
... now this will not work as during create, table B does not exist
A) So one solution is ...
CREATE TABLE A (
....A_ID INT,
....PRIMARY KEY A_ID
);
CREATE TABLE B (
....B_ID INT,
....PRIMARY KEY B_ID,
....A_FK INT,
....FOREIGN KEY A_FK
....REFERENCES A(A_ID)
);
ALTER TABLE A ADD COLUMN B_FK INT AFTER A_ID;
ALTER TABLE A ADD FOREIGN KEY B_FK REFERENCES B(B_ID);
A little bit of cheating does the trick :)
A) Another mysql specific solution is to use the FOREIGN_KEY_CHECKS variable.
mysql> SET FOREIGN_KEY_CHECKS = 0;
mysql> SOURCE dump_file_name;
mysql> SET FOREIGN_KEY_CHECKS = 1;
In the dump_file_name, tables can be created in any order without checking of Foreign Key constraints. So we can create tables with circular depenndencies
Monday, July 24, 2006
Java Generics FAQ
Java Generics FAQs - Frequently Asked Questions - This is a collection of answers to frequently asked questions (FAQs) about Java Generics, a new language feature added to the Java programming language in version 5.0 of the Java Standard Edition (J2SE 5.0).
Sunday, July 23, 2006
midday
I've always liked Mid-Day. I was pretty happy to find their site. But the format they have is pretty sucky. They provide a pdf for each page. So to read the entier paper, each page has to be downloaded separately. Not the most convenient thing.
I had started looking at Python a bit (going from the previous post). This seemed to be a pretty good project to use it for. The script - midday - automates the process. Given the paper you want (sunday|mumbai|vashi), it downloads each paper's pdf pages to your machine. It also uses a third party app - pdftk - to combine all the pages into one pdf. It needs to be downloaded and the location it was installed in needs to be passed into the script, but its not necessary. The script still works w/o it, but the pages are in separate pdfs. Should work on both Windows and Linux, but I've tested it only on Linux.
Overall, I liked Python quite a bit. Definitely more productive that Java... for something like this. Less upfront design needed, but is still structured. All the data structures mentioned in the last post came into play. Also, being interpreted, it's pretty easy to make it work on multiple platforms. The library is pretty extensive and with the easy ability to call other programs (especially in the linux environment where the culture is to create small programs that can be stiched together), python can be used for a wide range of applications.
I had started looking at Python a bit (going from the previous post). This seemed to be a pretty good project to use it for. The script - midday - automates the process. Given the paper you want (sunday|mumbai|vashi), it downloads each paper's pdf pages to your machine. It also uses a third party app - pdftk - to combine all the pages into one pdf. It needs to be downloaded and the location it was installed in needs to be passed into the script, but its not necessary. The script still works w/o it, but the pages are in separate pdfs. Should work on both Windows and Linux, but I've tested it only on Linux.
Overall, I liked Python quite a bit. Definitely more productive that Java... for something like this. Less upfront design needed, but is still structured. All the data structures mentioned in the last post came into play. Also, being interpreted, it's pretty easy to make it work on multiple platforms. The library is pretty extensive and with the easy ability to call other programs (especially in the linux environment where the culture is to create small programs that can be stiched together), python can be used for a wide range of applications.
Re: One Array to rule them all
Pretty late reply... I've been doing a bit of python of late. And although there isn't 'one array to rule them all' there are some similarities. In python there are three main data structures - lists, dictionaries and tuples. Lists are growable arrays (ArrayList in Java) and Dictionaries are associative arrays (HashMap in Java). Tuples are just containters to hold other objects (No equivalent in Java). They are immutable.
People always talk of productivity with dynamic languages. These built-in data structures are one of the main reasons for it. Sure Java has an amazing collections framework, but it's not a language feature. It's a framework built on top of the language. In python, these are part of the language... [] creates a list, {} creates a dictionary and () creates a tuple.
Having these be part of the language makes a huge difference. In Java, if you want to return multiple values from a method... either do something ugly like return an array with the values (the values have to be of the same type) or define a new class to hold the values and return an instance of that class. Quite a pain. In python, you just put the values (of any type) inside a tuple and return. As simple as that. And as you can imagine, lists are used a lot to hold collections of data. But probably the most used data structure is the dictionary. It's a dumping ground in all sorts of situations. You would think it would be a readability nightmare but it isn't. It's almost a convention in python and when you come across code, it is immediately recognizable. And these ds's combined make for more productivity gains. Tuples, being immutable, can be used as keys. Also, python has support for sets as well.
People always talk of productivity with dynamic languages. These built-in data structures are one of the main reasons for it. Sure Java has an amazing collections framework, but it's not a language feature. It's a framework built on top of the language. In python, these are part of the language... [] creates a list, {} creates a dictionary and () creates a tuple.
Having these be part of the language makes a huge difference. In Java, if you want to return multiple values from a method... either do something ugly like return an array with the values (the values have to be of the same type) or define a new class to hold the values and return an instance of that class. Quite a pain. In python, you just put the values (of any type) inside a tuple and return. As simple as that. And as you can imagine, lists are used a lot to hold collections of data. But probably the most used data structure is the dictionary. It's a dumping ground in all sorts of situations. You would think it would be a readability nightmare but it isn't. It's almost a convention in python and when you come across code, it is immediately recognizable. And these ds's combined make for more productivity gains. Tuples, being immutable, can be used as keys. Also, python has support for sets as well.
Wednesday, July 19, 2006
Saturday, July 15, 2006
Right to Information
The Right to Information Act (RTI) was passed in 2005 which empowers Indians to ask the Government about anything that concerns them. You can ask questions like why the road outside your house is not repaired or why some facility is polluting your city. The official is under an obligation to respond to your query within a stipulated period.
Now things are amazing on paper. I doubt that information comes so fast and easily. There are a few sites, organisations which assist in this.
See http://www.righttoinformation.org/
Maybe such a wiki like community site would better serve this purpose
Now things are amazing on paper. I doubt that information comes so fast and easily. There are a few sites, organisations which assist in this.
See http://www.righttoinformation.org/
Maybe such a wiki like community site would better serve this purpose
Thursday, July 06, 2006
[Trackback]How to concentrate on writing
Something to think about..
<quote>
When I am up against a deadline and I absolutely, definitely have to get on with my work, I use a few tactics to force myself to concentrate:
1. Switch off email. I don’t start Outlook (or if I do, I disable all the notifications that tell me I have new mail).
2. Isolate myself. I use Bose noise-cancelling headphones but don’t plug them into anything. The silence really is golden.
3. Greed and guilt. I remind myself how much money I’m getting paid for a particular assignment and how ashamed I will be if I miss the deadline. This actually works sometimes.
4. Stop with the blog already. When I’m pressed for time, distractions like blogging and hoovering become very compelling. Knowing this makes it easier to resist.
5. Get up early. 6am is the most productive time of day for writing. No distractions. It also feels more virtuous than staying up late with work.
6. Little treats. I bribe myself: ‘Matthew, if you write another 500 words, you can have a cup of tea and a biscuit.’
7. Chunking. Setting a timer or alarm clock for 15, 20, 30, 50 minutes and doing nothing but writing until it goes off and then taking a break seems like a good way to make progress.
8. Go full screen. Switching Word into full screen mode (from the view menu) eliminates all distractions but the piece I’m working on.
9. Shitty first draft. Splitting the work into distinct writing and editing phases breaks the job down nicely and it takes off some of the pressure to ‘get it right first time’.
10. Change location. Sometimes, if I’m really struggling to get started, taking a laptop or my notebook to a cafe and scribbling out something there - a fresh new location - is a good way to jolt-start an assignment.
</quote>
<quote>
When I am up against a deadline and I absolutely, definitely have to get on with my work, I use a few tactics to force myself to concentrate:
1. Switch off email. I don’t start Outlook (or if I do, I disable all the notifications that tell me I have new mail).
2. Isolate myself. I use Bose noise-cancelling headphones but don’t plug them into anything. The silence really is golden.
3. Greed and guilt. I remind myself how much money I’m getting paid for a particular assignment and how ashamed I will be if I miss the deadline. This actually works sometimes.
4. Stop with the blog already. When I’m pressed for time, distractions like blogging and hoovering become very compelling. Knowing this makes it easier to resist.
5. Get up early. 6am is the most productive time of day for writing. No distractions. It also feels more virtuous than staying up late with work.
6. Little treats. I bribe myself: ‘Matthew, if you write another 500 words, you can have a cup of tea and a biscuit.’
7. Chunking. Setting a timer or alarm clock for 15, 20, 30, 50 minutes and doing nothing but writing until it goes off and then taking a break seems like a good way to make progress.
8. Go full screen. Switching Word into full screen mode (from the view menu) eliminates all distractions but the piece I’m working on.
9. Shitty first draft. Splitting the work into distinct writing and editing phases breaks the job down nicely and it takes off some of the pressure to ‘get it right first time’.
10. Change location. Sometimes, if I’m really struggling to get started, taking a laptop or my notebook to a cafe and scribbling out something there - a fresh new location - is a good way to jolt-start an assignment.
</quote>
Thursday, June 29, 2006
One Array to rule them all
I've been coding in php of late. So some thoughts on that...
Most languages have a few Data Structures (ds). Java has the excellent Collections framework which contains quite a few types of ds as shown in the figure

What I found in php was the array();
It can be used like...
$pasta = array('spaghetti', 'penne', 'macaroni');
In this case the array can be compared to a List or an Array.
You can also add an element to the end of an existing array with the array_push() function or remove an element from the end by using the array_pop() function.
Using the array_shift() and the array_unshift() function removing or adding elements to the beginning of the array can be done.
So now the array can work both as a Queue and a Stack.
Additionally it is possible to declare an array like..
$menu = array('breakfast' => 'bacon and eggs', 'lunch' => 'roast beef', 'dinner' => 'lasagna');
Here 'breakfast' is a key and 'bacon and eggs' is the value. Usually keys are numbers from 0 onwards. In effect our innocent array is now a Map as well.
All this is extremely great for learners. A few thoughts ..
1. The array exposes an API for all these ds'es. How can I enforce an array to act only as a Queue? Is the leakage of the abstraction too much.
2. How do they optimize? In Java I know the costs when I create a LinkedList or an ArrayList. Or use a TreeMap or HashMap. How is it done in php?
3. Also are there Sets in php where one object cannot be added twice. Maybe I am missing some ds library in php ;)
Most languages have a few Data Structures (ds). Java has the excellent Collections framework which contains quite a few types of ds as shown in the figure

What I found in php was the array();
It can be used like...
$pasta = array('spaghetti', 'penne', 'macaroni');
In this case the array can be compared to a List or an Array.
You can also add an element to the end of an existing array with the array_push() function or remove an element from the end by using the array_pop() function.
Using the array_shift() and the array_unshift() function removing or adding elements to the beginning of the array can be done.
So now the array can work both as a Queue and a Stack.
Additionally it is possible to declare an array like..
$menu = array('breakfast' => 'bacon and eggs', 'lunch' => 'roast beef', 'dinner' => 'lasagna');
Here 'breakfast' is a key and 'bacon and eggs' is the value. Usually keys are numbers from 0 onwards. In effect our innocent array is now a Map as well.
All this is extremely great for learners. A few thoughts ..
1. The array exposes an API for all these ds'es. How can I enforce an array to act only as a Queue? Is the leakage of the abstraction too much.
2. How do they optimize? In Java I know the costs when I create a LinkedList or an ArrayList. Or use a TreeMap or HashMap. How is it done in php?
3. Also are there Sets in php where one object cannot be added twice. Maybe I am missing some ds library in php ;)
Friday, June 23, 2006
Subscribe to:
Posts (Atom)

