Monday, June 25, 2007

Yahoo! Mail Beta Login Workaround

I’ve always liked Yahoo! Mail, it’s fast and simple. I’d signed up for Yahoo! Mail Beta when I’d got the option but unfortunately, it seems to still have quite a few bugs in it and more often than not, I just see the welcome screen and nothing happens after that. None of the links respond and none of the buttons work.

Now, I don’t want to opt out of the programme but I’m not really keen on having to clear my browser’s cache and reload every time I want to check my mail. So here’s what I do: as soon as the login process completes and I’m directed to the mail URL, something that looks like this:

http://us.mg2.mail.yahoo.com/dc/launch?.rand=tnrkit406744a


I stop the page from loading and change the URL to this:

http://us.mg2.mail.yahoo.com/ymv/login?ymv=0

i.e. add ymv/login?ymv=0 to the end of the original URL. This takes me to the old Yahoo! Mail; speedy and simple. The URL may be slightly different; I used to get http://us.f527.mail.yahoo.com/

earlier but nowadays I seem to be getting redirected to this server. The technique works the same on both though.

Yes, I know you can click on ‘Trouble logging in?’ and then ‘Check your email in original Yahoo! Mail’ but it takes too long that way and sometimes the page just doesn’t load.

And anyway, you have to admit, this way looks much more impressive :D

Wednesday, June 20, 2007

Converting Java Primitives To Strings

It’s fairly easy to convert the primitives in Java; byte, short, char, int, long, float, double and boolean, into Strings; simply use the toString() method of the respective wrapper classes. But there’s a far easier way.

It’s pretty well known that the String class overrides the ‘+’ operator for concatenation of strings. It’s also often mentioned that one should be careful while using code like

String total = “The sum is ” + 2 + 4; 

since this will create the string as “The sum is 24” instead of the ( assumedly ) expected “The sum is 6” since the role of ‘+’ as the concatenation operator takes precedence over addition.

This very side-effect can be utilized for all primitives. Simply concatenate the required primitive with an empty string ( “” ) and you get the value as a String! Consider the sample below:

public class ConvertToString
{
    public static void main(String[] args)
    {
        String finalOutput = "";

        byte b = 1;
        short s = 3;
        char c = 'd';
        int i = 14;
        long l = 1234;
        float f = 2.0F;
        double d = 1.55;
        boolean bn = true;

        // finalOutput = b; //will not compile
        // finalOutput = (String)b; //will not compile

        // finalOutput = Byte.toString(b); //using the corresponding wrapper class

        finalOutput = b + "";
        System.out.println("The byte as String " + finalOutput);

        finalOutput = s + "";
        System.out.println("The short as String " + finalOutput);

        finalOutput = c + "";
        System.out.println("The char as String " + finalOutput);

        finalOutput = i + "";
        System.out.println("The int as String " + finalOutput);

        finalOutput = l + "";
        System.out.println("The long as String " + finalOutput);

        finalOutput = f + "";
        System.out.println("The float as String " + finalOutput);

        finalOutput = d + "";
        System.out.println("The double as String " + finalOutput);

        finalOutput = bn + "";
        System.out.println("The boolean as String " + finalOutput);
    }
}

As you can see, there’s no need to be messing around with the wrapper classes. Admittedly, it’s not that big a deal, but it does make the code a little neater.


Sunday, June 17, 2007

Solution For Slow Hibernation

Ever since I've been using Windows XP, I've been a fan of the 'Hibernate' feature since it significantly speeds up the boot time of my machines ( shutdown may be a little slower though, but it's worth it. Also, it may actually lead to slower booting on some machines; you'll have to try it out ).

A little while ago though, I faced a very frustrating problem: Windows would take almost 10 minutes to hibernate. And it was really weird because I had reinstalled Windows a few days earlier and it had been working absolutely as expected ( notice I didn't say 'fine'; not with Windows :D ). I couldn’t' for the life of me figure out what had gone wrong.

After a little bit of Google'ing, this is the solution I discovered: you need to have 'write caching' enabled for the drive. After reinstalling, I'd turned this off and when I turned it back on, hibernation was as fast as it had been before.

To turn on write-caching for a drive under Windows XP ( I'm using Windows XP Professional ):

Right-click the icon in My Computer > Properties option > Hardware tab > Properties button > Policies tab > Check the Enable write caching on the disk checkbox

Enable Write Caching

To enable hibernation under Windows XP ( I'm using Windows XP Professional ):

Right-click on your Desktop > Screen Saver tab > Power button > Hibernate tab > Check the Enable Hibernation checkbox

Enable Hibernation

Friday, June 15, 2007

NoGoodAtCoding.com

I own it! The it in question being the domain name 'nogoodatcoding.com'. I bought it yesterday and I've been fooling around with ever since. It's made me aware of a whole new dimension to the Internet. I'm still in the process of setting stuff up and so I guess I'll be a little busy for a while...which means no long, drawn-out posts :D

I have managed to publish both my blogs to custom domains using the feature offered by Blogger. There will be a few hiccups though; notably with images loading. I've also noticed that if you type in the blog's original, blogspot name with a 'www.' prefixed, it doesn't redirect to the custom domain.

Also, the blogs may simply not be available as the propagation of the changes across the DNS over the Internet takes some time; most sites I've seen say 24-48 hours, a couple stated up to 72 hours. Though I've already checked that a few people can already access these, it may still take sometime. Actually, if you're reading this, it's already happened; and if you weren't, well, then you wouldn't have known what was happening. :D

I think this post is getting close enough to being drawn-out now; and my domain settings beckon!

Thursday, June 14, 2007

What This Blog Is About

My original blog is an account of what I'm all about. I recently decided to start posting little tips and interesting stuff relating to technology that I use and some, rare snippets of curious code. It was immediately obvious to me that it would be out of place on that blog. So I started another; this one that you're reading now.

The posts may not be regular or even frequent. You may not think them smart; some may even seem lame. But it's something that I think I'm going to enjoy doing and so I will.

Well, so that is what it's all about; tips and tricks and other interesting things that I pick up as I make my way through it all.