Optical Character Recognition (OCR) in Javascript in your browser

Like everything else becoming available in the browser, now there’s OCR for Javascript. The demo which you can try our here captures documents from the user’s webcam, then applies image processing to convert the image to machine readable black and white bitmap and then uses the Javascript implementation of Orcad (an GNU licensed open source OCR program), called Orcad.js to convert the processed image into text.

Even though I called it implementation before, Orcad.js was created using Emscripten, a trans-compiler which turns C or C++ code into web browser compatible Javascript (not the most accurate description of the process but that’s the general idea). Looks like an awesome tool, which I hope to have the time to play with some day. You can check it out here.

If you missed the link, demo here. Read/download Orcad.js here. The image processing is applied using glfx.js which used WebGL to accelerate image processing on the client.

There’s also a video demonstration:

Unix-like Tail function in Windows without installing new software

Windows Powershell has a powerful command that lets you view the last lines of a text file or even monitor it for new lines, similar to tail -f command in Linux. Here’s some examples:

 

The following will view the last 10 lines of Apache’s log file:

PS c:\apache\logs> gc access.log -last 10

The following will view the whole apache log file and when done, will continue waiting for new entries:

PS c:\apache\logs> gc access.log -wait

Of course the previous example is not very useful if your log file is already large, so you can combine the two commands and skip to the last lines like this:

PS c:\apache\logs> gc access.log -wait -last 10

Until I discovered the above command I used Tail Win32 to monitor log files, so this makes life easier.

x86 Emulator in your Browser

For me, this one-man project is like magic. A fully-blown x86 emulator which runs a real-world BIOS (SeaBIOS). This means it can run regular x86 16bit OS’s as long as the browser allows it enough resources. It goes a long way to show what’s possible in the browser these days (well to be honest, this could have been done 3-4 years ago if Javascript was taken as seriously as it is today). It obviously runs slower than native performance but it is quite usable, especially with command line interface. There is no real practical use at the moment but maybe with further development something similar can be used to emulate x86 on ARM based devices in the future.

Take a look for yourself at http://copy.sh/v24/. There’s 4 OS images you can load directly from the page, including FreeBSD, Linux, FreeDOS and KolibriOS which is GUI based. You can also load your own ISO images to boot in the emulator. KolibriOS works fine so does FreeDOS, which even has some playable DOS games like Tetris and Snake which brought back memories of my MS-DOS days.

For experimental purposes only I also downloaded a Windows 3.1 ISO CD image off piratebay and tried to run it but it didn’t really work (I think the problem was with the image not being properly bootable rather than the emulator – after all Windows prior XP was first booting MS-DOS and then running Windows). I also attempted to load TinyCore Linux but I didn’t get far with that one either. TinyCore’s ISO is just under 15MB with GUI included. It took around 10 minutes to boot on an i7 laptop but never made it into the GUI.

Anyway if you don’t have the time to fiddle around you can view the following 5 min video I made running the emulator in Chrome:

Google Web Designer – my take

Google Web Designer

Yesterday Google released a new design tool going by the name ‘Google Web Designer’. I installed it and played around a bit. It seems like they got carried away with the title cause it certainly isn’t a web design tool in the sense of Dreamweaver, its more of an animated banner creation tool. Its output is an ‘HTML5’ document (sorry for the cliche) and uses both Canvas 2D and 3D elements to create banners in a user interface that reminds me of Adobe’s Flash (still have nightmares of that) and Adobe’s new animation tool Edge Animate. If you ignore this app’s bad title, its a pretty decent tool for making banners for AdSense or other purposes. The code produced by the tool is not the leanest but works on modern browsers, and even on mobile. To see the extend of how much overhead is included check out this gist on github; the author created a new document, drew a rectangle with a sold color and saved and that was the result. This means that if you are making a very simple banner, the CSS and Javascript overhead can be substantial (consider that each banner on a page will be running on its own IFrame); on the bright site it can do things without coding that you’d normally need flash for without losing mobile compatibility. Moreover it allows you to create responsive ads; a feature that Google’s own AdSense product now supports (after many years of publisher requests).

Even if it’s destined for ads, it doesn’t mean you can’t use it to put together a single page website, but lets hope that Google Web Designer won’t be the beginning of another ‘Flash’-like era where Canvas is used instead of the Flash container plugin leading to bloated, hard to maintain, and non-indexable websites all over again.

You can have a look of how it works here:

and download it for free here:

Google Reader – my favorite website is shutting down – what are the alternatives?

The Facts

In a move that I fail to understand Google announced on the Google Reader blog that they will be shutting down their service for good on 1st July 2013 due to ‘decreasing number of users’. I and many others probably don’t think of course this is the real reason, Google Reader is one of Google’s cheapest to run products but it probably hinders parts of their greater agenda to push their social media platform Google+ (i.e. if you subscribe to an RSS feed you don’t need to follow the page on Google+ to get updated, so removing your RSS reader might push more users to Google+).  Read More

PhpStorm – an IDE worth its name

I recently switched to JetBrains PhpStorm as my main IDE for PHP/HTML/JS/CSS development. I tried many solutions in the past such as Dreamweaver (please don’t try it), NetBeans, Aptana, Eclipse PDT, before settling with Zend Studio for quite sometime and finally a couple of months ago I gave ZendStudio the boot and switched to PhpStorm. I am currently using version 6.0 from the Early Access Program (the current stable is version 5) – and I am planning to buy it once 6.0 final is out. Read More

LaserVex – Very Challenging HTML5 Puzzle Game

LaserVex is a very challenging optics based game. Each level has one or more laser sources, a series of mirrors, a number of targets all on the same plane. The aim of the game is to hit all targets just by moving the mirrors around without moving the laser sources. It sounds and looks simple at first but after going through the first 4-5 levels you will start facing some real challenges. Its one of the hardest puzzle games I’ve played in a while.

It has a lot of potential and should be made available as a mobile app. The graphics are lacking a bit (its all lines basically on a canvas) and the controls need some work (moving a mirror requires yo to move both vertices) but the gameplay makes up for it.

If you don’t have time to waste please don’t try this game. You’ve been warned.

Check it out here.

How to take screenshots in Windows 8

Microsoft added a nice feature to Windows 8. Just hit Win + Prt Sc and you can get a full screenshot saved directly to your Pictures/Screenshots folder in 24 bit PNG format. No more fiddling with Paint or Snipping tool. Oh, and this key combination will also take screenshots of Metro apps not just Desktop.

Windows 8 is out – how to upgrade?

Windows 8 is now out in retail and if you are a legit Windows XP/Vista or 7 user you are entitled to a 39.99 USD upgrade. You can visit this link to download the Upgrade tool. Assuming you are still running the original Windows version your PC came pre-installed upgrade to Windows 8 will be straight forward. Apparently its even possible to upgrade if you have the Release Preview installed and a valid Windows XP/Vista/7 key (which is usually printed on a sticker on your laptop or desktop).

Unfortunately In my case I installed Windows 8 Enterprise Trial when RTM came out which is valid for 90 days (and has almost expired by now). That version cannot be directly upgraded and there’s no way on earth I will reinstall the bloated version of Windows 7 that came pre-installed on the laptop by Asus (I did create re-install media and probably have it somewhere but as i recall Asus tool filled 5 DVD’s). The only upgrade path I could take will involve re-installing the Release Preview and use my Windows 7 key; but I’d rather not lose the configuration and apps I have installed on the current installation which is after all final but just time-limited.

It seems you can still download the Release Preview ISO directly from Microsoft here for 64bit and here for 32bit. Now all its left is to find a way to trick it into downgrading Windows 8 Enterprise Trial RTM into Release Preview (which could possibly be done by changing cversion.ini)and then using the upgrade tool to purchase a Windows 8 license and upgrade to Windows 8 Pro retail.

I’ll run my experiments tonight after work and hopefully post a step by step guide if I get it done.

Title definitions in software engineering

  1. Project Manager is a Person who thinks nine women can deliver a baby in One month.
  2. Developer is a Person who thinks it will take 18 months to deliver a Baby.
  3. Onsite Coordinator is one who thinks single woman can deliver nine babies in one month.
  4. Client is the one who doesn’t know why he wants a baby.
  5. Marketing Manager is a person who thinks he can deliver a baby even if no man and woman are available.
  6. Resource Optimization Team thinks they don’t need a man or woman; they’ll produce a child with zero resources.
  7. Documentation Team thinks they don’t care whether the child is delivered, they’ll just document 9 months.
  8. Quality Auditor is the person who is never happy with the PROCESS to produce a baby.
  9. Tester is a person who always tells his wife that this is not the Right baby.
  10. HR is a person who thinks that a donkey can deliver a human baby if given 9 months.
p.s. I found this in a funny image. I don’t claim I own the copyright but I really don’t know if anyone does!