The Special Edition Is Timeless

Yep, this guy's enunciation of the word "run" is so brilliant (hint. see special edition) that it went back in time and got itself published before he was even born.

In other news, this other song makes me believe I can fly:

Also new crush!

WordFinder

I started working with Google's AppEngine application platform sometime in 2012. Since then I've written a few toy apps to experiment with all the available APIs on offer. Nothing too fancy, just apps that seem to work. Now I figured an app that did work while not being something that wouldn't take several man-months to code up would be a word game. Nothing too fancy on the UI-front, not too dumb on the server end. So with this goal in mind I started working on my very first AppEngine app codenamed WordMaker.

The game is fairly simple. It's being hosted over here. You get a new sequence of 10 alphabets and 60 seconds to make as many words as you can with it. If you can make the high score board you've achieved greatness for yourself and your clan. But this won't last forever. Somebody could beat your score eventually. So play long enough and hard enough and if you're lucky you could get the right combination of letters that will allow you to stay on top.

Change History:
Version 1
  • Baseline release
  • Totally random sequence of 20 letters!
  • Scoring by word length

Version 2
  • high scores board
  • Improved look and feel (barely)
  • Random sequences shortened to 10 letters

Version 3 - current release.
  • Update to the data model - Game entity has a unique id
  • Game entity now store the words submitted
  • High scores board improved - added link that takes you to the Game entity's page to see the words submitted as part of the game.
  • Sharded counters for game, score and word stats and stats widget

Feb 12th, 2014 - earlier today the app went over quota on DataStore read ops. This is in part due to the ajax calls that were occurring for the stats and high scores table updates at every word submission. With almost 10 words per minute being submitted you would expect at least 3 ajax calls / word submission x 10 calls / minute = 30 calls / minute. That is with just no words being submitted at all. I'm not sure how 50,000 read ops was hit so quickly. Since my read access to my datastore admin is not working due to exceeding the limit, I'll have no way of knowing how many read ops per call were being used up. Maybe tomorrow I will have some answers on this front.


Updated 2nd March, 2014. Figured out the cause for this. In a nutshell: too many sharded counters eat up the quota broth. How I keep track of the stats (number of games, number of words, average score per game) in the app is through sharded counter entities in the App Engine datastore. I was using one Entity per stat to do this at first, but then I saw the potential problems from a scalability standpoint. If more people started using the app, all would be contending for access to those 3 entities. So if there are more entities available to share the workload then the access contention and locking issues will be minimized. Take a look at the list of entities for Game counter.


As you can see I've got 15 sharded counters for one entity type actually storing very small values. Now imagine this for 3 entity types: Game, Word and Score. So we have ShardedGameCounter, ShardedWordCounter and ShardedScoreCounter - storing the number of games, the number of words and the total of all the game scores respectively. Each time the average score needs to be displayed in the Stats table in the game page, the scores from all these entities are totalled - one read per entity. - and then the stats calculated and displayed. If there are 20 ShardedGameCounter entities, then there are 20 reads for the total number of games to be calculated. Across three figures that is around 60 read calls to the DataStore. Now imagine that happening once per minute per game. If there are game sessions, that's 600 calls per minute. If the game continues for 60 minutes that is 36000 calls. So in about 1 hour and 20 minutes, I'd have exhausted the 50K calls daily quota on datastore reads. Thinking back to that day, that is exactly what happened. Things stopped working after just about an hour.

So where do we go from here? I must reduce the number of sharded counters for one.  Only create a new counter entity. when your counters cross a threshold value. Have a scheduled task to consolidate the totals into fewer counters that will speed things up as app has more counters than it needs.

Let's work on this and see what will come up next.

Waste Less Time

I'm not very productive on weekends, or without a deadline. Here are a couple of things I've tried out:

Get off Facebook.


The internet's biggest time sink is probably Facebook. It lead to a whole slew of services each attempting to out do each other to be the holder of the title for Humanity's Biggest Time Sink.

Notice how the login bar looks like a championship belt
The compulsion to check on my what my fellow human beings think of me, every 5 minutes is not healthy. I believe the scientific term is narcissism. Now, it's easier to check facebook than say to myself: "I am being narsiccstistic narcicssitic narcissistic."  It just takes one keystroke.

f YOU!
As soon as I press f and the Enter key, I'm going straight back to the land of Narcisissies since I don't actually need to remember my credentials. That one large jumbo-sized hoop I need to jump through is gone and I don't have anything to stop me from scrolling through the same CLICK-HERE-TO-SEE-HOW-ALLIGATORS-DO-IT reshared posts.

So all I do is this:

Impulse Check Force Field :  check
Uncheck Keep me logged in before logging in. And ensure you log out. This and setting a password that is hard to get right the first time ensures that any impulse sociological checks are limited to a great extent to when you actually have time to key in your credentials each time you visit facebook. Or you could actually try locking yourself out when you want to control yourself, because password resets are such a pain.

Step 2: Stop impulse checks on email
More in this list as I find time to write these down. Now time for Episode 2 of Fringe.

Thanks MGM For Saving Me The Ticket Expense


Honestly, this trailer leaves nothing to the imagination. Just this trailer and a trip to http://www.themoviespoiler.com/ is enough.

Stay classy, go watch the original.

Aspirin-g

Dil se karo Billing,
Aur Dimag se karo Chilling,
Kafi muskhil to hogi zaroori
Apni zindagi me hogi majburi
Lena padega ek sleeping pill
Aur dhoondo apni sapnon me ek nayi manzil!

Here To Stay?

Chor ne machaye shor,
"Mere dil to maange more!
Kalmi kabab hi hai sahi,
Lekhin paisa to vasool hi nahi,
Yahaan se jaana hai kahin aur,"
Guruji ne yeh sab sunkar bahut gabarahat hone lagi,
"Kya hua my dear friend?
Let us try to make amend
Tujhe chahiye onsite, ya naya designation,
Ek-chuno-aur-milega-sirf-do-saal-ke-baad
See, the offer is not so bad."
"Mujhe na chahiye promotion ki commotion, ya onsite ka insight,
Bank me itnaaaaaaaaaaaaaaa paisa
Baki sab aisa hi waisa
Mere shikayaton sunkar aapko bahut ho gayenge bore
Guruji, sirf dikhaiye mujhe vo EXIT door."
People quit all the time. Money, power, health, family, out of reasons to be employed, accountable and answerable to a not-so-super-visor are some of the reasons.

I stumbled across a database containing the details of folks who'd left the company today and got a glimpse of the various reasons why people leave. It was quite a long list and I wouldn't want to bore you with the details, but one thing's for sure: there were definitely many folks who had been burned by the performance management system and had decided to "put" in their papers into the fire as well.

What's my reason to stay? I wonder.


Endless Loop

I'm just dependent on synchronized, (sometimes) harmonic, combinations of sound both human and non-human to drown out the rest of everything. Here are some of the tunes I enjoy playing on an endless loop while I try to be productive. Maybe it just isn't working, because that's why I'm making a list instead of actually working.


  1. Dhobi Ghat Theme by Gustavo Santaolalla
     

  2. Teardrop by Massive Attack

     
  3. Girls by Death in Vegas

  4. Lat Lag Gayee by Benny Dayal (Yes, I constantly surprise myself)

  5. The entire No Nations album by Jets Overhead
  6. Sunshine by Keane
  7. Thin Air by Keane :

Open Source Commitment

My very first fork and commit to a piece of software and I feel pretty good about it.

That's the best bit about Open Source Software: like something but don't see it? Grab a fork and commit!


Now I can see why OSS is so far ahead. It's software development truly democratized.

And the best part! It helps me keep within my bandwidth limits.

And my first piece of code is now part of the next release!

Unify Broken Lines

Let's say you have a text file that looks like this:
Henry Mark
"David
Guetta"
"Fobrice
Kilimanjaro
"Heidi "SealFace"asd
Klum"
jsfjsdfhjsd
"324234"
"324324324"23423423423
gvcxzgxcgvxvcv"
and you need to get this:
Henry Mark
"David Guetta"
"Fobrice Kilimanjaro "Heidi "SealFace"asd Klum"
jsfjsdfhjsd
"324234"
"324324324"23423423423 gvcxzgxcgvxvcv"
It looks simple enough for a few lines; what if you had to repeat the same over a thousand or more?

Use this code:

https://github.com/unullmass/textytext/blob/master/LineUnifyer.java

Apple Pie


Firm crust subtle
First bite sweet supernova
Mellow aftertaste
Only wish it never ended like pi.