Sunday, March 03, 2013

Windows 8 Legacy Boot Menu

This tip was learned at WinAero: How to customize the Windows 8 boot experience. If the steps below are too advanced for you, check out their Boot UI Tuner portable application to easily do the same and more with just two simple clicks.

Many tips online suggest making Windows 7 the default OS to bring back the legacy boot menu (this doesn't load the OS before presenting the OS options). But what if you want Windows 8 as the default?

To keep Windows 8 as the default OS and still enjoy the speed of legacy (Windows 7 style) boot menu:
  1. Launch Windows 8. On the Start screen, type 'cmd' (there's no search box, you just start typing on the screen with tiles).
  2. When results appear on left, right-click on "Command Prompt".
  3. At the bottom bar, click "Run as administrator". (Your computer may appear to be idle for a couple of seconds. This is normal.)
  4. In the User Account Control dialog, click "Yes".
  5. In the Command Prompt window that opens, type the following and press Enter:
     bcdedit /set {default} bootmenupolicy legacy
  6.  If you got the message "The operation completed successfully", you're done.
    • You can type bcdedit and press Enter to verify that bootmenupolicy is set to 'Legacy' on the correct partition.
  7. Close the Command Prompt window. Restart your computer to see if it works. (Do not click Shut down. You must click Restart. Read below for why.)
Note that the Windows 7 version of bcdedit does not support editing the bootmenupolicy parameter as it does not recognize the parameter as valid. You must use Windows 8.

To reverse the above change, follow the steps again but in the Command Prompt window, type the following and press Enter:
bcdedit /set {default} bootmenupolicy standard

Why does this only work on actually "Restart-ing"?
Even if you set the bootmenupolicy to Legacy, you will still get Standard behavior if you click Shut down on the Power menu, then boot up the computer after it shuts down. This is because unlike previous versions of Windows, Windows 8 treats restarting and shutting down differently.

In previous versions, shutting down and powering up was exactly the same as restarting. But in Windows 8, when you shut down, Windows 8 boots up faster next time because of a form of "caching". When this caching is available Windows 8 can boot in half the time it would take on a fresh restart. The caching also forces Standard boot menu over Legacy one. When you restart Windows 8, no such caching is done and the computer always starts fresh. In this case, the Legacy boot menu will appear, allowing you to cut the time required to boot another OS.

Admittedly it would be ideal if the Legacy boot menu always appeared regardless of caching, but the above is still tolerable as Windows 8 loads much quicker when it is cached (which I believe is some form of mini-hibernation).

I was taken aback by the new Windows 8 boot menu. It's fancy but it's not ideal. While it's entirely possible to create a fancy boot menu that starts up quickly, Microsoft did not put any effort to finding out how - since most people will never see the boot menu anyway.

But for those of us on dual-boot configuration the fancy blue Windows 8 boot menu is frustrating especially if you want to keep using Windows 8 as the default OS. It loads Windows 8 first before presenting with the OS options. If you select an option other than Windows 8, the computer restarts fresh and loads the other OS. Every time you want to restart the other OS, you have to go through the process again - restart, load Windows 8, choose other OS, restart, load other OS.

Microsoft argues that since Windows 8 loads so "fast" it shouldn't matter. But the loading takes about 30 seconds on a hard disk, maybe even longer! The reality is, that loading time is a waste of time and resources, considering that the computer has to restart twice to boot into another OS. It's always more reasonable to present the OS options then proceed load the OS which the user chooses (or the default on timeout). It doesn't make any sense to load the default OS, then present with OS options, then discard the loaded default OS with a second restart when the user chooses something else!

At first it looked like the only way to get back the old text-based legacy boot menu (which shows first before loading any OS) is to set Windows 7 as the default OS. It works fine when the user intends to keep Windows 7 as the primary OS and simply try Windows 8 in his leisure. But it defeats the purpose when the user is upgrading to Windows 8 as a replacement (but keeping Windows 7 as an emergency fallback) as the user is forced to always manually select Windows 8 during boot time.

Thankfully, it's now possible with the above tip to revert to the text-based legacy boot menu and still keep Windows 8 as the default OS.

Sunday, January 20, 2013

Facebook Like button on Blogger blog

So how did I get that conspicuous Like button on all the posts in my blog?

Well it was pretty simple although I had to do a little bit of experimenting to get it work properly.
  1. Go to the Like Button Facebook Developers page.
  2. In the section "Step 1 - Get Like Button Code", select/enter:
    • URL to Like: (we will change this later!)
    • Send Button: this is up to you. Check and uncheck to see the difference on right.
    • Layout Style: button_count recommended, unless you have something else in mind.
    • Show Faces: highly recommended to turn this off! Otherwise people who didn't set their privacy settings properly may be shocked and appalled to find their face on your blog.
    • Width, Font, Color Scheme, Verb to display: leave as default (450, blank, light, like)
  3. Click on Get Code, then in the popup, click on XFBML at top. (You may use HTML5 but I recommend XFBML for more backwards compatibility). Note that you will have to copy code 1, 2 and 3 from here in later steps below.
  4. Now in another tab/window, launch your blogger dashboard and start managing your blog.
  5. On the left menu (or the More Options dropdown on your dashboard), click Template.
  6. Click Edit HTML.
  7. IMPORTANT! In the pop-up, click Expand Widget Templates to turn it ON.
  8. Cut the entire HTML code in the big box (click inside and hit Ctrl-A -> Ctrl-X).
  9. Open Notepad or your favorite text editor and paste it there. (This may be a good time to save a backup of your original HTML.)
  10. At the top, there will be an <html> tag with a bunch of attributes, like:
    <html b:version='2' class class='v2' .... .... xmlns:expr=''>
  11. Add a new attribute to the <html> tag. Copy this attribute alone from code 2. If you did it correct it should be like this:
    <html b:version='2' class class='v2' .... .... xmlns:expr=''  xmlns:fb="">
  12. Next, hit Ctrl-F and search for <body
    You will come across the <body> tag that looks like this:
    <body expr:class='&quot;loading&quot; + data:blog.mobileClass'>
  13. Add a new line after this tag and paste code 1 here.
    <body expr:class='&quot;loading&quot; + data:blog.mobileClass'>
    <div id='fb-root'/>
    <script> ... ... ... </script>

  14. Again, hit Ctrl-F and search for post-footer
    You will come across a <div> tag that looks like this:
    <div class='post-footer'>
  15. Add a new line after this tag and paste code 3 here.
    <fb:like href="" send="true" layout="button_count" width="450" show_faces="false"></fb:like>
  16. Modify the code you just pasted as follows. Note that href changes to expr:href, double quotes change to single quotes, and the URL changes to a special code that only Blogger understands.
    <fb:like expr:href='data:post.url' send="true" layout="button_count" width="450" show_faces="false"></fb:like>
  17. Copy the entire HTML code and paste it back in the big box in Blogger Template page (from step 8).
  18. Click the Preview button below. Check that everything is in order and you like your new Like button (no pun intended!).
  19. Once satisfied, click Save template. Once saved, click Close and go check out your blog.

Sunday, August 26, 2012

Jumping Eclipse release train

So you have customized your Eclipse Helios (or whatever) installation, and now Eclipse Indigo or (recently) Eclipse Juno has been released. But you dread 'upgrading' your installation as you have to export all the customizations to the new release, transfer all plugins, etc, etc, and ensure everything works properly. Dread not, because you actually don't need to do any of these (well except the last thing).

One thing I noticed about Eclipse is that they never provided an official documentation on how to upgrade from (for examples) Helios to Indigo or Indigo to Juno. Everywhere I checked about upgrading Eclipse is vague, some even claiming that you should do what I just described (suggesting there's no other way than manual migration).

But Eclipse supports automatic upgrading and migration even if the development team is so sly about it. All you need to do is this: (I use Helios and Juno as examples - adjust accordingly.)

CAUTION: If you use Eclipse in mission-critical applications, be sure to make a proper back-up before proceeding, BOTH of your workspace(s) and your current Eclipse installation! For others, it will also be good to do a back-up in case something goes wrong or you don't like the new Eclipse version.
  1. In Eclipse Helios, go to Window > Preferences > Install/Update > Available Software Sites.
  2. Uncheck Helios, The Eclipse Project Updates and anything else Helios-related.
    • You may also uncheck anything else that you know aren't needed (keep repositories you added as checked).
    • If you see multiple entries named Helios, uncheck all of them.
  3. Click Add... button and enter the new release train name as Name, and for Location, find the correct repository location here (in the Links column, copy the URL of "Repository", "p2 Repository", etc.)
    • For Juno release train, the URL is
  4. Click OK > OK.
  5. Click Help > Check for Updates. After Eclipse checks the new repository, you will get the dialog box showing you updates available.
  6. Update your Eclipse installation as per normal (hopefully you already know how to do this).
  7. When prompted to restart, click Restart Now (You may click Not Now but never click Apply Changes Now - the chances of error are higher on such major update).
  8. After restart, you will find that Eclipse has now upgraded to Juno and you didn't need to migrate settings and plugins to a fresh installation.
    • You can remove repositories you unchecked in step 2.
    • You should also ensure all plugins work correctly (some plugins can break when upgrading to a new release train).
If it helped you, leave a comment below and let me know! Alert me of any problems to note too.

Keywords: Eclipse Java C/C++ IDE Callisto Europa Ganymede Galileo Helios Indigo Juno Kepler EE SE Classic Developers Mobile Modelling RCP RAP Automotive Scout

Monday, August 20, 2012

Can't exit Toddler Lock on Android phone

Toddler Lock will lock your Android phone completely so you can give it to a baby or toddler to play with. The only danger from the kid is that it may throw your phone and break it. But other than that, the kid will not be able to damage the phone by unlocking it and messing with what's inside.

Here's the problem. The security of Toddler Lock is so tight that it would seem the only way to exit out of the app is to tap four corners of screen in a clockwise direction. (Note that you have to tap the four corners one after the other. Tap any corner, remove your finger, tag next corner in CW direction, remove your finger, and so on. Some people seem to think you need to hold all corners simultaneously which is wrong.) You may think a restart may also unlock it but even pulling out the battery for minutes (or perhaps hours) will not help. You will be stuck in Toddler Lock no matter what.

This is fine until my screen started having problems. Two of the four corners I had to touch to exit Toddler Lock did not register touches anymore. This is fine for my normal usage as Android is quite versatile enough to be usable even if small parts of the screen do not register touches anymore. But I forgot this and launched Toddler Lock. This is where I got stuck in a seemingly infinite blackhole of being stuck on Toddler Lock. I even sent an angry email to the developer in ALL CAPS!

I tried the following (none helped):
  • Power down the phone.
  • Restart the phone.
  • Pull out the battery and put it back in.
  • Pull out the battery, leave it out for five minutes, put it back in.
  • Try to use "adb" tool in Android SDK (unfortunately my USB Debugging option was off)
  • Try to remote uninstall Toddler Lock via Google Play website but I think my device is too old for that. (THIS is what you should do if you have a newer device.)
If nothing of the above helped you, here's what you can try. These are not step-by-step instructions, but more like "mess with it until it works" instructions so just keep trying different approaches. I was just trying various things in panic mode to get my phone unlocked, so I'm just gonna write most of what's below in first person describing what I did. You may not have to do everything.

TIP: The developer has replied with a (perhaps) easier method of rescuing the phone. Of course this is model-dependent but still worth a try: "To exit Toddler Lock, you can try starting the phone in "safe mode", which will prevent Toddler Lock from starting. On most phones, you enter safe mode by restarting the phone while holding down the "menu" button, and continuing to hold it down until the home screen appears." Safe mode for certain devices: HTC/Nexus1/Droid, HTC Desire HD. Getting out of safe mode: link.

NOTE: If you had enabled Airplane Mode (flight mode) in Toddler Lock settings, you can attempt to disable it via the power menu. Hold the power button down and in the menu you get, if you find an "Airplane mode" option or similar, tap it. If you don't have that option, or it's not helping, you can still try some of the steps below, but you may most likely end up having to replace your digitizer (bring the phone to any mobile phone repair shop tell them to change the digitizer - NOT the display itself! - to a new or working one).
  • Get another phone and make a call to the phone stuck on Toddler Lock.
  • When the phone rings (press any volume button once to mute the ring then), try pressing home button, power button etc. to somehow get to the lock screen or the screen to answer call.
  • My phone had a normal security pattern so this kinda helped. I got to the security screen and entered wrong code 5 times so that I can tap on the Forgot Pattern? button.
  • Somehow I ended up on the lock screen (swipe to unlock, pull ring to unlock, etc) as I kept messing with the phone trying to answer the call. I made a second call again. The lock screen gave me options to answer or reject the call. I answered it and left the call ongoing.
  • On the call screen, I pressed Menu > People to get to the contact list. Now I had to unlock the screen, which I did. The People app crashed, so I did Menu > People again. I could now see the contact list (You may not need to do this)
  • I pulled down the notifications drawer (you can't do this when the phone is locked even in a call), then tapped the Quick Settings tab, selected All Settings.
  • I went into Applications > Manage Applications > Toddler Lock > Force Stop > Clear data > Clear cache (was disabled) > Clear defaults > Uninstall > OK.
  • Before the above, I had also launched my TaskPanel task manager app and force-quit the Toddler Lock entry there, but this may not be necessary.
  • If you cannot get into Settings you may have to wait till you have notifications about app updates, then tap on that to get to the Market (Play Store) app, and uninstall Toddler Lock from there. You could try pressing Home to see if you can get to your actual home screen, but I suspect it will throw you back into Toddler Lock again.
Hope this helps anyone who is stuck on Toddler Lock! It's damn ridiculous that even pulling out battery for 5 minutes isn't going to reset Toddler Lock... which toddler on earth is gonna try that in its attempt to unlock the phone from child lock?


Related Posts with Thumbnails