Wednesday, November 26, 2014

Why a PDF Printer should be your default printer

The convenience of 'Quick Print' comes at a great cost (both to yourself and the environment). If you ever accidentally hit that shortcut, the document is immediately sent to the default printer. If your default printer happens to be a physical printer that's connected to your network or your computer directly, there goes valuable paper and ink churning out pages and pages of a document you never wanted to print, and you probably will trash or shred anyway.

Indeed, I had once been working on a Java source code file in Eclipse and I accidentally clicked the Print button in the toolbar. (Why a source code editor would even need a Print button is beyond me.) The entire 1596 lines of source code got sent to the printer and I couldn't even stop it from printing half way. That ended up on 33 pages, and consequently 33 sheets of paper. Now I have this stack of paper on my desk with one particular version of the source code, all printed and 'set in stone'. Since it is useless printed material, I just keep it around for using the unprinted side as scrap paper.

The annoying superbug with all printer drivers is that if you try use the 'Cancel Printing' option in Windows, it will either never actually get cancelled, or it will more likely just corrupt your printer's memory (which you will see as completely random characters being printed onto seemingly endless number of pages when you try to print something else afterwards). The other option (and the solution to a corrupt printer memory) is to unplug the printer and wait for its memory to be flushed out, but this may be difficult or even against work policy with a network printer.

Thankfully, there are softwares like PDF Printers. If you have Microsoft Office installed, you will probably even have options like XPS Printer or 'Send to OneNote'. Or if you never actually use Fax, it's another viable option. You should set one of these 'soft copy printers' as your default printer.

Once such a printer is set as default, if you ever accidentally send a document to print, it will only create a file or some form of digital representation on your computer. It will no longer waste your valuable resources like paper and ink on your physical 'hard copy printers', or cost unnecessary expenses to your organization. You can simply delete away the "printed" file from your computer, and it's like you never even printed in the first place!

I have also removed the darned Quick Print button from the Eclipse toolbar. If I need to print, I can select File > Print or press Ctrl-P (it brings up the print dialog box). Which reminds me: If you need to print a hard copy, use the Print option (usually marked as 'Print...') that brings up the print dialog box, then choose the physical printer. Note that most applications will remember your print settings for the current session. So once you have chosen a different printer, even the Quick Print option in the application will print to the chosen printer - until you exit the program and start it again (this action will revert it to the default printer).

Tuesday, June 17, 2014

Strange gap or weird space between Identity icon and URL in Firefox 30 address bar

Recently switched back to Firefox. I am happy to break away from the Big Brother dictatorship of Google Chrome and use any extension I want (not Brother-Approved Extensions).

I found a strange space between the Identity icon* and the URL text of the address bar. It was about an inch wide.
 * Usually appears as a lock, sometimes expands to show the identity name, coloring in red or green depending on validation status.

This occurs on computers with a finger print reader hardware installed.

Firefox picks up the finger print authentication plugin (which however is not used by any Firefox built-in feature, though I'm not sure about Master Password), but it sets all plugins to "Ask to Activate" by default.

This causes the fingerprint reader plugin to remain disabled at start-up, causing the weird bug.

To solve the problem in Firefox 30.0:
  1. Click Menu (three stacked bars) > Add-ons.
  2. Click Plugins on the left side of Add-ons Manager.
  3. Find the plugin related to your fingerprint reader.
    • Most likely it is "TrueSuite" or "SimplePass"
    • You can look at about:plugins to help find the exact plugin name. Look for keywords like fingerprint, finger, authentication, pass, etc.
    • For more information, check here.
  4. Choose "Always Activate" in the drop-down for the plugin. (Both "Ask to Activate" and "Never Activate" will cause the bug.)
  5. Close Add-ons Manager and restart Firefox.

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.


Related Posts with Thumbnails