June 1st, 2009

Skyfire 1.0 is the new kid on the block in the mobile browser war. Its not a kid per se but there are some big boys like Opera Mini and Opera Mobile who don’t give up all too easily. I have been a beta user of it from India since 0.6 😉 and it was fun all this while to keep track of this superb browser. Their main aim is to bring desktop like browsing experience to the mobile browser and they are almost there. So near, yet so far.

Like all other reviews about this browser until now, its safe to tell that it is able to play flash videos pretty well inside the small screen. Here are some notable differences between the earlier betas and this 1.0 version:

While watching any videos on youtube, my Nokia E51‘s rear would just heat up quickly & few minutes down, it would be difficult to hold the phone. This problem has been nearly solved in 1.0. That’s possibly due to power optimization techniques.

When you scroll very quickly on long web pages, Skyfire usually shows a checkered screen with gray squares (screenshot below), which disappear as and when content appears. Pre 1.0, this checkered screen would take a long time to disappear. With 1.0, this problem has been solved. Same problem used to occur during zoom in/out. Now zoom happens at blazing speed. Neat!

Its able to handle basic javascript very well. For e.g. its able to display the hover menus that are present on top of my blog. Its also able to show alert boxes.

Video quality is maintained even during zoom in and zoom out. This was a major drawback in pre 1.0 versions.

The initial loading and shutdown of the browser would take a long time in pre 1.0 releases. Not so in this current release. This has been drastically improved.

File downloads happens excellently. Kudos for this. This is a major drawback with the E51’s native browser.

May 23rd, 2009

This one could save you lot of time 🙂 In short, the answer is to “return false;”. That’s it. If you want to know more details, read ahead.

Say, you have an awesome page where you want to disable right click and also disable Ctrl+C (copy), Ctrl+S (save page). The process is simple. Just register an event for right click and when the event fires, just return false. Since false is being returned, the browser will cancel the event.

Same goes with keyboard. ‘onkeypress’ event is fired whenever a key is pressed. To reject any key, just capture that event and return false. If you want to do anything special, just do it before returning false. Ctrl+S is interesting. In most web browsers (notably google chrome), it brings up the default Save Dialog. Most web apps have keyboard shortcuts these days & oh! 99% of them don’t return false, only to find the user experience irritating when the save dialog pops up; when something else should occur. Hence, if you wish to customize the functionality of the default browser specific keyboard shortcuts, do the following:

May 4th, 2009

Here’s the trick below to open multiple gmail accounts with the same version of firefox.

Open the Run dialog. In linux, press Alt+F2. On Windows, press WinKey+R.

In the dialog box, type “firefox -p -no-remote”. This will bring up firefox’s profiles dialog box.

Click on “Create Profile” and follow the wizard. Lets assume you named the profile as “gmail2“.

Now close the dialogs and return to desktop.

Now, open the Run dialog again. In the dialog box, type “firefox -p gmail2 -no-remote“.

“-no-remote” option is very important because it creates an isolated session that is different from the currently open firefox windows of other profiles. If -no-remote option is not given, then a new window of the currently running profile or the default profile is opened, where session sharing happens (which we don’t want).

Now, since sessions aren’t shared between different profiles, you can open two accounts and happily have them.

Suggested Improvement for Firefox:

Internet Explorer 8 has this amazing option in the File menu where you can open a completely new session of IE. Sessions are completly isolated and gives lot of relief. Its available at File->New Session. Hope this feature is brought into Firefox as well. Or if this feature is already available as a plugin, please let me know in the comments. Actually speaking, this feature was available in IE since IE 6 (AFAIK). In IE6/7, you can open a completely new session by clicking the IE icon on the desktop.

April 3rd, 2009

If I were asked to pick one best lab feature from all of them, this would be it. I have set up filters extensively to mark labels to most of my emails. I’m also a keyboard shortcut junkie & expect web apps to have keyboard shortcuts. Retrieving emails based on a given label had never been this easier. Just type ‘g‘ followed by ‘l‘. A small dialog opens and offers suggestions as you type the label names. This is an awesome feature that saves loads of scrolling and clicking.

This is an Excellent lab feature that was announced yesterday. I have enabled it and searching mail using its operators has been made very easy. This also offers suggestions from your contacts as you type. For each letter that you type, if there’s an available search operator, it lists that as well; neatly separating the operators from the contacts with a black line.

Less is more. This tasks features offers very little features, almost mimicking it to a paper to-do list. Just list the tasks and strike them as you are done with it. There are of course some advanced features tucked in. But they don’t appear at first sight. This is a well executed Labs Feature. There are times when you do not need a full blown task manager & this feature comes in handy. I hope they bring this feature to their gmail mobile app.

Recently, I have been trekking/touring a lot. People from the trekking gang send emails with links to Picasa/Flickr albums. They also add youtube video links to the email because there’s no way to actually embed a video inside an email. With this labs feature, I’m able to enjoy all the related photos/videos in one place. Really cool.

This is one awesome feature. Many months ago, I posted a question on a mailing list asking for suggestions for buying wireless routers. After a week since the discussion, I was searching high and low for that email but couldn’t find it. Lots of people had given valuable suggestions and how can I lose them all? As soon as I found the email, I activated this quick links feature and clicked on “Add Quick Link” button in its dialog box. Voila! Now I can reach this email directly with a mouse click.

There are also times when I search for “in:inbox is:unread“. This search operator retrieves all mails in your inbox that have not been read yet. I didn’t want to type this operator every time to check for unread messages that are buried somewhere. I just added a Quick Link for this operator and now its just a click away. Happy times!

What are your favourite Gmail Lab features? Let me know in the comments.

March 20th, 2009

Two days ago, as I switched on my computer, I got this error message; “A disk read error occurred. Press Ctrl + Alt + Del to restart”. It is the dreaded Black Screen of Death. The most probable reason for this message is that the hard disk on which the computer is booting would have crashed or its in the process of crashing.

The best you *must* do at this point is that, remove the faulty hard disk, connect it as a slave to another computer and take backup of all data. After data is safe, you can try and find out the point of failure. After all, that error message doesn’t necessarily mean that your disk has crashed.

Probable Points of Failure

The bus connecting the hard disk to the mother board is faulty.

The master boot record (MBR) on the hard disk got corrupted.

SMPS (Switch Mode Power Supply) failure. In this case, your computer may not boot at all. But there are times when only one of the power plugs may fail.

If anyone has encountered any other points of failure, please let me know in comments and I will add them here.

Answers

For the faulty bus, you can grab another bus cable from the secondary drives, connect it to the mother board with the faulty hard disk and try booting. If it works properly, head straight to the electronic store to get a new cable.

To replace the corrupted MBR, pop in your operating system’s installation CD/DVD and follow the on-screen instructions. For Windows, boot in from the installation CD, press ‘R’ for recovery console, give your administrator password, and type the following the commands: fixboot, fixmbr. For linux, you must reinstall the boot loader (grub). Restart the computer now. If all is well, it should reboot properly.

Remove the power plug connected to the faulty hard disk and connect one of the other plugs that are attached to the SMPS. Reboot the computer now and try.

In my case, my hard disk had crashed. But thankfully, I had proper backup of all data.

January 29th, 2009

HttpURLConnection in the JDK has a bizarre bug. When it receives a HTTP response code in the 3xx range, it performs redirection to the web page mentioned in the “Location” header. However, when it does this, it forgets to send all the cookies with the request. Therefore, if you are working with any of the web 2.0 APIs which perform redirection and require this authentication cookie with each request, you are doomed because the server will redirect to the login page thinking that this is an unauthenticated request.

The solution for this is pretty simple. If you have written code like below:

URL u = new URL(“http://www.example.com”);

HttpURLConnection conn = (HttpURLConnection) u.openConnection();

You have to add one more line that sets redirection to “FALSE” & do the redirection yourself with the cookies, which becomes like:

January 20th, 2009

If you have used the Free SMS web service already and craved a java version, it is here 🙂 . You can now send SMS from within your program by calling a simple method. Just download this JAR file and include it in your class path. Java source code for the class file is present in the JAR archive itself. So, if required you can browse through it.

How to use:

Please note that you need to create a free account at www.way2sms.com before attempting to use the library.

SMS should be sent now. If there are any errors then an exception will be thrown.

License:

This Java source code, the class file and the archive is licensed under “Creative Commons Attribution-Noncommercial”. License terms are here. Downloading the files means you agree to the license terms.

January 19th, 2009

There are a number of use-cases for which you would want to browse a mobile-optimized website on your PC. When you visit the mobile website on your PC’s web browser, the website displays the full content much to your dismay. However, when you visit the browser on a mobile, it displays a perfectly mobile optimized page.

In these cases, there are some simple steps that you can follow to open mobile websites on your PC:

Using the buttons on the Modify Headers addon window, you can enable or disable particular items.

That’s it! Whenever you want to view a mobile website, just go to Tools->Modify Headers and enable the user agent you added in step 8. When you don’t need it, just open this window and disable it.

You can close addon window after you have enabled/disabled items.

Enjoy! 🙂

Behind the Scenes:

Most mobile websites make use of the HTTP header called “User-Agent”. This header tells the server what kind of web browser the user has. So, mobile websites usually look for the name of the device manufacturer in the User-Agent header. If it matches one of the manufacturers then the mobile optimized web page is sent.

That’s about it! Hope you enjoyed this brief.

Now go and figure out how to display the iPhone version of Facebook on your PC 😉

January 8th, 2009

Recently I needed a way for Threaded Tweets to do HTTP basic authentication to try out some stuff. As you probably know by now, it is written in javascript and uses no server side code. So, I had to find out some way to pass basic authentication credentials through the XMLHttpRequest object so that I could be authenticated with the Twitter server.

Turns out that it is pretty simple. If you use FireBug on any website that supports Basic Authentication, you will note that a new HTTP header called ‘Authorization’ is added. It looks like:

Authorization: Basic aDkdjfZy==

Now all you need to do is somehow pass on this header to the XMLHttpRequest object. If you use the native XMLHttpRequest, you can use the setRequestHeader method to do this:

xhr.setRequestHeader(“Authorization”, “Basic aDkdjfZy”);

What if you are using jQuery? Then also its pretty simple. jQuery’s AJAX object allows us to change the XHR object before the AJAX request is sent by setting the “beforeSend” callback; which is done as follows:

One important part of Basic Authentication is that, you need to encode the username and password into Base 64. There are tons of Base 64 encoding tools written on javascript, which you can use. Example below:

Cross-domain GET requests work all the time. The problem is with POST requests. Most browsers don’t allow XHR to POST data to a domain that’s different from the one in which the page is loaded. For this to work correctly, the ‘document.domain’ property must be set correctly.

The second best way to POST to another domain is to use an iframe and submit the form with the iframe as the “target”. Again, to read the result of the iframe, the “document.domain” of the parent and that of the iframe should match. This can be easily set through javascript. Thus, when the form post is done and the page is loaded, its value can be accessed.

Note: Chrome and Safari don’t allow access to iframe’s DOM if its document.domain is different from that of the iframe’s parent.