Thursday 28 August 2014

Kobo N905, Kobo GLO and the Dragonwar Thor Mouse


As title says, random blog, so random entry of the day

After years of convincing myself of why I would not pay a ridiculous amount of money for reading e-books on a grey-scale screen that simulated paper I finally started to consider looking at e-book readers.

I considered looking because a friend of mine who lives in London and commutes 3 hours to get to her lab in the Imperial College told me about her Nook Reader and how it had been the handiest thing she ever bought and how she has been reading a lot now that she has books in it.

I burned a little, I like to read, but I haven't been able to. At all. From being someone who read a book a day to someone who doesn't manage even one in a month has been something that makes me very sad. My personality is altered when I stop reading I become surly, I laugh less, my punning co-efficient goes down and I become mentally lethargic.

I've been carrying my hard copy books around to lab in hopes of reading it sometime during the breaks. However when you read a book, or even carry it around, it is mis-interpreted (especially considering the colourful covers of Discworld) as wasting time. I may be wrong but the looks that are shot towards the book I'm carrying make me uneasy. Although this may have something to do with the habit I have of pulling it out during a very boring seminar or a talk when I'm trapped. But then again, why should one waste time and not make the best of it?

So the idea of a tiny paper-like screen that would let me read without strain (LCD's and PDF's are so not good for the eyes) grew on me. However
I'd already seen the Kindle with another friend in the lab and I found it a hilariously expensive device for INR6,056. A grey scale touch screen with top-side illumination for that amount of money was a little too much for my pocket. I would rather have some device with a colour screen for that amount.

I looked through E-bay to check out the prices of the Nook and that is when E-bay put a cookie on my computer that I was interested in E-book readers. Soon the Kindle and the Nook became a regular highlight on the advertisement panel on Facebook and I would see prices going down until suddenly one day it said 3500 INR. Curiosity piqued, I clicked on the link to be led to ebay where the Kobo was selling for 3500 INR and it was a touch-screen, 6inch WI-Fi and extendable memory with a micro SD card. I followed up the model on to a youtube demo video and there!, I was convinced and ordered it right away.

It has been a couple of weeks since I've had it and I have finished Monstrous Regiment by Terry Pratchett and Strange Beautiful Music by Joe Satriani on it. It is small discreet and easily read. I can pull it out anywhere and start from where I left off. The battery lasts for a week I guess. I've dropped it once on a hard asphalt track and besides some abrasion to the rubber finish it has been fine. I finally feel a little better about life and I think this might have been a good thing after all.

Here is the Kobo N905 Chess at Grandmaster level beating Microsoft Chess Titans on Level 10. Chess Titans "thought" for at least a minute before each move, meanwhile the Kobo was instantaneous and brutal in its responses. Although I should play them against each other more times to see if this was just a one off but the brutality with which the Kobo beat the computer suggests that this might not be necessary. If I happen to do it later I will post the results here.


The second thing I ended up buying was a Gaming mouse called the Dragonwar Thor. I do not game. I however anticipate a scenario when I create 3-D models that I would need a variable DPI mouse for precise rotation and control. Plus I had this 1000 rupees that I got as an honorarium for writing a book chapter. Well not really an honorarium since those guys at the publishers didn't pay up and when I asked my boss he offered to pay me from his own pocket and after taking an assurance from him that he would collect it from them I took the money from him. A crisp 1000 rupee note that lay in my wallet, crystallized, because I did not want to spend it for odds and ends like petrol and consumables. I wanted something symbolic that would remind me of my 3 week 18 hour marathon writing sessions when I sat and wrote that book chapter. So when I saw that this mouse was on a discount and retailing for 957 INR instead of the usual 1250 INR I bought it instantly, cash on delivery.

It came in a box that was as huge as the ones my LEGO's came in. Well, that was because it came with this big mouse pad as well. The cord of the mouse is covered with a weave of the kind used in cables to protect them from being burnt like the electric cord of an electric iron.  The mouse is very nicely shaped and a perfect fit for my hands and the coating feels real nice. There is a dragon logo that goes RGBCMYW fading lights. The tracking light is invisible and there is a DPI switch right below the scroll wheel which allows tracking at resolutions of 800,1600,2400 and 3200 DPI. The tracking is PERFECT, I was instantly at home with the acceleration characteristics. The two buttons at the left side of the mouse by defaults play the role of back and forward buttons on the browser and in folders. Other buttons would need some settings to be done by installing the software I suppose but for now I am mighty pleased that I bought it.

Update: 05-06-2015

I found a Kobo Glo, new for cheap (6600 INR) from Ebay. It is smaller than the N905 but a little fatter. The glowlight is very evenly dispersed as has been claimed in online reviews compared to the Nook or the Kindle. Unboxing pictures towards the end!

Hmm, the text is a little more blurry presumably because of the light diffuser that makes the screen thicker as well. The touch response is fast and well the glow light is also nice, but the slight fading in the text is a little miff-inducing. Also Kobo removed Chess from the Extras! Argh, Why Kobo? It is a kick ass chess engine, beats Android, Microsoft and GNU chess effortlessly, please bring it back. They removed Chess on the latest update for the N905 as well.

Okay obviously Kobo is not going to listen to some random blog, so I found this on the Kobo forums on how to restore chess.

Source: http://www.mobileread.com/forums/showthread.php?t=261305


  • First of all, create a tile on the homepage launching any of the extra present in the settings / beta features. For instance sudoku.
    Be sure that you have now a tile called "sudoku" on the homepage.
  • Connect the kobo to the PC
  • For safety reason, make a backup of the file <koboDrive>/.kobo/KoboReader.sqlite (so that you can recover it in case something goes wrong during this procedure)
  • Open the file <koboDrive>/.kobo/KoboReader.sqlite with the Sqlite3 editor software you prefer (for instance SQLiteSpy for Win, but there are many free editors for any platform)
  • In the table "Activity", find the row with Id=sudoku, and change the value of Id=chess; save the modified DB
  • Disconnect the Kobo, now you should have a tile with the chess

Simplified procedure, using Sqlite3 command line tool:
  1. Be sure that you have the sudoku tile on the homepage (if you don't have it, just play a sudoku game and it should appear)
  2. make a backup of the file <koboDrive>/.kobo/KoboReader.sqlite (so that you can recover it in case something goes wrong during this procedure)
  3. Download Sqlite3 command line for win, linux or mac
  4. Create a folded on your PC and put into it:
    • The executable Sqlite3 files you downloaded
    • The sql file attached to this message (chess.txt)
    • The kobo DB file (<koboDrive>/.kobo/KoboReader.sqlite) copied from Kobo
  5. Open a shell, go the folder you created and launch this command:
    Code:
    sqlite3 KoboReader.sqlite < chess.sql
  6. Copy the patched KoboReader.sqlite file back to kobo (overwriting existing file)
  7. Disconnect kobo and you should have the chess tile on homepage

chess.sql is a text file containing the following SQL commands.

BEGIN TRANSACTION;
update activity set Id="chess" where Id="sudoku";
COMMIT;

The box highlights the fact that this is a Kobo GLO, the screen seems to gently glow against the blue beckground. Compare this to the Nook package and your heart goes a little fuzzy when you see this. Utilitarian packaging is economical and nice I suppose but those beige bricks that I got with the Redmi Note were rather dull. The Nook box is matte finish and everything but still won't give you the fuzzy feeling. Although, for all you know, it just might.










When you open the packaging the first time, the Kobo always needs to be charges and in this case, it is shown as sleeping and that you need to connect it to a computer. I don't know why Kobo is so cute about using anthropomorphic representations of the ebook reader, but then it is very cute. Connecting it to the computer begins to charge the battery. The factory state is probably set to sleep and so the battery invariably is too low to turn on the e-book reader when it gets to you.
So booting up the ebook reader, it asks for language preferences and makes you set up the Wi-Fi connection so that it can download the firmware updates and be up and running. In my case I did not know that running the firmware update was going to remove Chess from the Kobo or at least make it inaccessible unless some modifications to the sql database in the ebook reader wasn't made using command line.


Oh, they did provide a USB cable for the Kobo, also an instruction manual which again has cute pictures of the Kobo in the sun and under the moon implying that you can read it at night.






Unlike the diamond patterned finish of the N905, the GLO has diamond cuts which look graceful and the logo is stylishly emblazoned at the back. As I said earlier, it is thicker than the N905 so it will be a very tight fit inside a cover that you bought for the N905, thankfully I have a Accessorize cover that was for the Nook Touch and it fits very nicely for the Kobo GLO






So yes, that is it for the unboxing, I loved the GLO too, I think that it is really important to not have a flashy gizmo for reading, because a book and reading it was all about letting the printed text take over your mind and turn on the internal screen and animation of your mind and making everything come alive. It is quite hard to do it when your device keeps going, "ooh, look there flashy button, press it right away!". The ebook readers are an austere form of technology, you can say they are steampunk versions of ARM based tablets. No distractions, very long battery life and just plain text on a plain screen that looks like paper.


 Anyway, I had to see if the Kobo chess engine was really good at playing itself. So the Kobo GLO played White and the Kobo N905 played Black at Grandmaster level.

It was a tough and evenly played game, the pieces were all lost in the same order, it lasted 72 moves. Most other chess engines do not last over 40 moves against the Kobo chess engine. So evidently a close match and finally White queened and checkmated Black, the only reason for which I see is that, White gets to move first and therefore has a slight advantage.

Thursday 21 August 2014

Statistics 101 - Part 1


Welcome to a basic lesson in statistics which recapitulates much of what you already know about statistics, however it is nice to have it all in one place and maybe this will give you a fresh perspective on the statistics that you learnt in oh so long ago.

So statistics, hmm rambling thought, is it plural? well I have heard the term "summary statistics" so methinks that statistics is a common noun. Well it is. A statistic is any formula (algebraic) that reduces a set of numbers given to it to a single number that describes the group of numbers in some (mostly) approximate way. It is possible to describe a group of numbers and their properties using a much smaller group of numbers. So statistics gives you formulae which allow you to reduce a giant set of numbers into a much smaller useful set of numbers that allow you to compare between two such giant set of numbers.

The mean/average is a basic statistic. It is the sum of all the values divided by the number of values. This statistic gives you the central value of the set of numbers. So knowing the mean you sort of get the idea of what the value of a randomly picked number from that could be around.

However the mean does not tell you about the spread of the values around the mean. So differently spread out numbers can have the same mean. This means the mean can be misleading about the scale of the numbers and sometimes the mean can be heavily influenced by a few numbers in the group having extreme values which can shift the value of the mean towards themselves.

This is where the variance comes in. The variance tells you an estimate of how much the numbers are spread around the central number (which in this case is the mean). It is calculated by subtracting the mean from every observation and then squaring these numbers and finally taking the average of these numbers. So the variance gives you an idea of the "average spread" of the numbers around the mean.

However the variance does not have the same units as the original numbers and therefore to bring the number representing the spread to the same unit we take the square-root of the variance and this is known as the standard deviation. Bringing it to the same unit helps you state that a particular number in your group is X times the standard deviation away from the mean.

Another government conspiracy which I think is true is that taking the square-root makes sure that the variance grows slowly otherwise it grows very fast. But then that is just me thinking that statistics is all about the algebraic properties of the numbers themselves rather than any significance of the physical quantities that they represent.

So the mean tells you where the centre point of your group of numbers are (from now on I'll call your group of numbers a distribution) and the variance tells you how fat the spread of the numbers around your central number is. So using two numbers we can describe a distribution (well ideally only in the case of nicely shaped distributions). For instance, the normal distribution, which will be a set of numbers that when plotted in a density/ histogram show up as a bell-curve shape can be described completely by the mean and the variance.

So say you had 100 numbers which you tell me are top secret. Now I know that they are normally distributed because I spied your histogram of those numbers as I went past your PC. So if we played a guessing game and you gave me the hint that the mean and the variance of those numbers was (x and y) I could reconstruct the entire set of hundred numbers with just this information because there is a formula for the normal distribution which takes in the mean and the variance and gives me the set of numbers you have.


So that takes care of the mean, variance and the standard deviation. More in another post

Sunday 10 August 2014

Why Mersenne Twister, BBS... ?


I wanted to have a blog called "random blog". However that implies a lack of purpose for the blog and lacks a certain style to the name. Being in the field of computational biology, we have simulation and the stochastic ones have random number generators and eventually you get curious enough to find out how random numbers are generated. Then you stumble upon these inventively named (or seemingly so because of author names being unusual) Pseudo Random Number Generators (PRNG's) and there you have it. Rather than writing "random blog" I just get a couple of PRNG's in my title to indicate the randomness!

It seemed quite a mouthful to begin with but now I like it much better. Sounds like a fun story book.

Addendum 08-12-2014

I own a Philips GoGear 2GB MP3 player which I bought second-hand in the early part of 2006, for the first 4 years I used it to listen to music while traveling, then after that I used it for listening to music while riding the bike because sound pollution can be extremely exhausting.

No scroll wheel, press button to scroll, slow interface and everything else reduced this player to a random shuffle player. I just put it on shuffle and listened to whatever came out of the earphones.

About a year later of this I noticed that the song orders were becoming predictable. I could remember that I had heard these songs in that particular order. Soon I noticed that the randomization had reduced considerably to the point that the songs were almost playing in alphabetical order or track order. It seemed that the random number generator in the MP3 player had run out of random numbers to pick.

I went online to read about this and discovered the concept of entropy in random number generators. Pseudo Random number generators (PRNG's) are typically initialized with a particular number called the "seed". Thereafter this seed produces a stream of random numbers. Using the same seed will produce the same series of random numbers which is why you can see the command set.seed() in stochastic simulations in statistics that allows reproducibility of results when you try it out on your computer.

So seeds can make a stream of predictable sequences. So normally if you want your PRNG to not be predictable you set a random seed every time. The amount of randomness available is called the "entropy" of the RNG. So entropy decreased if the pool of seeds is not refilled with new seeds. New seeds are generated by sampling a Hardware Random Number Generator and using it to generate a few "true" random numbers which are then used to seed a PRNG.

In the case of my MP3 player, because the playlist had remained more or less unchanged in the last 2 years of using it, the entropy had presumably decreased. The randomness of the "shuffle" function grew worse until one day I decided to put a few new songs into it. Suddenly the randomness in the shuffle was back again, which leads me to conclude that the seed for the RNG was probably the number of songs in the player or something like that, there was no HRNG because that would presumably add to the cost. Interestingly, HRNG for development boards like the Arduino are available for 4~5 $.

Winston Churchill quotes



From here:
www.tehelka.com/remembering-indias-forgotten-holocaust/
  1. “the starvation of anyhow underfed Bengalis (was) less serious than sturdy Greeks” 
  2. “I hate Indians. They are a beastly people with a beastly religion.”
  3. (Another time)“the beastliest people in the world next to the Germans”

Okay I think that I won't be quoting this guy ever, and neither should well-fed Bengalis.