Posts

Showing posts from 2013

Leadership Speeches

I usually do not read books or listen to the Babas when I need some inspiration or motivation. I believe one can not give speech if they have not experienced it. I don't want to read books like "15 ways to win" unless the author have achieved something. I always look up to the sportsmen whom I have followed right from my childhood. Recently I saw some of them and all of them were on leadership. This well applies to at our work also. Being a lead we lead a team of few and have to answer to the management at the same time. (whom its probably are harder to explain) In the same way the team captain needs to lead the players and at the same time need to answer the board and people who probably never played the game. I am embedding only the 1st parts of the video , do find the other parts in the related video section.

Nasser Hussain : One of the most attacking  players of my time. He led England cricket team from the front in many times and personally I find his British accent …

Some Popular Songs of Y2K

Came across some very popular songs during Y2K. Decided to make a public playlist with the songs those were very frequently requested to the MTV request show presented by Nikhil Chinappa then. Feel free to remind me some more.

My response to a job applicant

Lately I have been looking for some mid/senior level Java programmers for my team in Hyderabad studio. I got resumes from a lot of sources and decided to respond to some of them with feedback before forwarding them to the talent acquisition department. I took some time two write a lot of details in the feedback because I have been observing a trend in resume writing which do not seem to be correct to me. Here is one of the personal feedback I write to a applicant of my acquaintance  .

Thanks for sending the resume. Sorry for the delay in reply . I was too busy with office work. At this moment I am not able to forward your resume as it looked to me that the openings I have in my company did not match your profile. However I will keep your resume and  let you know if I find any junior level opening in future. Meanwhile you can consider following points to increase your chances of resume being shortlisted.
These are my general and personal opinion.




Communication, when you email someone for …

Monopoly Bingo

Electronic Arts recently launched a new mobile game called Monopoly Bingo in Android and iOS. Fortunately I got a chance to work on it. In my own opinion it has excellent graphics and game play experience is a lot of fun. The game can be downloaded from Google Play and Apple Appstore. Try it out and feel free to give feedback/rating . Also you can like the Facebook page and follow the twitter  (@MonopolyBingo)account to get updates about new stuff related to the game.



Disclaimer - Opinions expressed are solely my own and do not express the views or opinions of my employer.

Moved my blog to VPS

Few months back I had moved my blog to Heroku, now I wanted to try out VPS. Heroku was all good but updating every thing via Git commands was kind of a pain when there is a image upload or wordpress version upgrade. VPS is like renting virtual hardware and OS and getting full access to the same. I choose DigitalOcean as they were very cheap and some of my friends gave good feedback about it. I choose the lowest plan that was 5 USD per month for a 512 MB ram. I got root access to the virtual machine and installed LAMP (Linux, Apache, MySQL and PHP) to host my PHP blog.Blog ran all fine initially but soon I started getting the errors as MySQL kept shutting down automatically. So i had to login and start it manually. From error log and customer support I came to know that for tech stack I am running 512Mb may not be sufficient, so I decided to give it some swap space. Anyway DigitalOcean claims all its storage is SSD and those are supposed to be faster than HDD. Following are the command…

Cultural shocks ? Not really !

Image
At one of the work parties, someone asked me "What were the cultural shocks did you get after you came to USA ?" Its really a valid question and while I was trying to think of an answer I concluded that there were so many things different but not all of them are really "shock".Most of them were not actually shock because we do follow a lot of American movies and sitcoms. But few things I really discovered after landing here which was not very common in India, neither they show it in movies. (May be because it is very trivial here.)American roads gives priority to the pedestrians. So if you are in the side of the road the card generally do not cross until you cross the road. DO NOT TRY in India. No vehicle stops for pedestrian to cross.Be it hotel or office, if you run into someone whom you don't even know and make eye contact , you gave to smile and at least say "hello" or "Good Morning". Sometimes even known people are ignored when in such …

Recursively Find Hyperlinks In A Website

I was trying to write a script to crawl a website and fetch all the hyper links pointing to all the a particular file type e.g. .pdf or .mp3. Somehow the following command did not work for me.
wget -r -A .pdf <URL>
It did not go recursively and download all PDF files. I may have to ask in  stackoverflow.

Anyway I wrote my script in python and it worked well. At least for the site I was trying crawl. The following scripts give all the absolute URLs pointing to the desired type of files in the whole website. You may have to add few more strings in excludeList configuration variable to suite your target site else you have end up infinite loop.

[code language="python"]
import re
import urllib2
import urllib

## Configurations
# The starting point
baseURL = <home page url>
maxLinks = 1000
excludeList = ["None","/","./","#top"]
fileType = ".pdf"
outFile = "links.txt"

#Gloab list of links already visited , don't want to ge…

Getting started with XBMC

Image
XBMC is a free and open source software media player for various OS platforms especially mobile. This is very useful to convert your TV dongles e.g. Android PC or Apple TV or Raspberry PI to a media center in your TV. This can not only organize and play your local media but also can stream movies and TV series. I downloaded the Android APK and installed my RocketChip MK806 Android TV.



To begin with I scanned all my mp3 and videos in my SD card using XBMC and all of them were ready to play. I found couple of plugins which listed almost all recent movies and TV series very well organized by season and episodes. As of now I have installed

Mash Up ( Installation Steps )
1 Channel ( Installation Steps )



Making it Full screen : However you can notice that the android navigation bar at the bottom always appears (Even during movie play). This is sometimes distracting. So I found an app Fullscreen which can help you get rid of this navigation bar.

Start on Boot : Also If XBMC is the only app you ar…

Moving the blog again

A year ago I moved from free shared Linux hosting to paid one to GoDaddy. Everything was good, there was no downtime like free hosting solutions. WHen I was in free hosting sometimes my site got blocked by antivirus software because somebody else would have hosted such content in the same server.  However I did not earn any revenue from this blog so paying for hosting was not really my favorite idea.

I read several articles in the internet why GoDaddy is not a very good choice for hosting blogs. I had also used GoDaddy for hosting the website of local chapter of IEEE section (ieeehyd.org) but faced a lot of problem during renewal. First of all only the 1st year hosting price was attractive but the renewal charge was almost four times than that I initially paid for starting the hosting. I had my credit card in GoDaddy payment methods and now they wouldn't let me remove it until I gave details of another card. This inspired me to close the account itself. Also lately my site got bloc…

Screen scraping using YQL

I have been using Yahoo pipes for a long time now. I have done some screen scraping mash up using them. While yahoo pipe provides a component to fetch the HTML content from a URL, it is bit difficult to cut a specific part because it totally relies on a string to match. I came across YQL console where I could write SQL like queries and fetch the HTML content of any URL. The best part was that it supports XPath expressions for selecting the exact node of the HTML to extract data. For example I write the following query to get the stock price from the web page

[code language="sql"]
select *
from html
where url ="http://getquote.icicidirect.com/NewSiteTrading/trading/equity/includes/trading_stock_quote.asp?Symbol=BSES"
and xpath='//td[p/text()="LAST TRADE PRICE"]/following-sibling::td[2]/p'
[/code]

See above code running in YQL Console.

Similarly this query can be made little bit complex and parametrized for the stock symbol to form the appropriate url

[code …

Sharing Photosphere

I have been always a fan of panorama images. There are a lot of photo stitching software which can join many overlapping images to create a single one. I have used Photosynth earlier with a lot of satisfaction. There a lot of phones and digital cameras which can do it right out of the camera in panoramic mode, in which you have to slowly move the capturing device and it will continuously take and stitch photos to create larger panorama.  While there ares some websites like CleVR and GigaPan can help sharing the horizontal panoramas and let embed in various sites, spherical panoramas like the ones taken from photosphere app in Android 4.2 cameras could not be embedded in a straight forward way without doing some HTML coding. Finally I found a site called SphereShare.net for this purpose. Following is the embedded photo I took uploaded in this site.

(Click this link for a wider view. Because of low width of the blog, embedded one may not look good)



This time the players were moving, I wi…

Play music remotely from phone using Windows 7

Image
I was searching for a Bluetooth transmitter which can transmit the music played in my cellphone to the speaker which mounted on my wall, so that I could control what is being played from my phone without using a very long aux cable. I had earlier posted about this but today I found it really useful to play and control music while lying down on bed. After pairing the phone you just have to click on the following setting in window to transmit music from phone to the speaker via the laptop. I could tune to any internet radio station , play any music on my phone and also take calls in the phone and everybody in the house could hear it.

Night Trek at Khajaguda (!Supermoon)

Image
Yes it was supermoon night but cloud cover ruined it it. While it is proved that supermoon is one of the most over credited astronomical event , still its one of the reason to go out and enjoy the nature at night. Thanks to city light, tough there was no moonlight , we could see the path and do the trek without a torch. We climbed some rocks as well (scrambling). It was monsoon and great time to trek.Thanks to organizers of hats club for holding this meetup and Rajesh for the photos from his new Sony DSLR.

Google AppEngine Channel API

I am not a big fan of page refresh for getting new data from server. AJAX has been the go to technology for these kind of requirements. However its unidirectional. For two way communication where server push is required , we have seen many technologies like comet etc. Websocket and WebRTC has been really cool technologies which helps sending data from server and client real time. These needs special server code for handling such requests. I have already worked on JSR 356 for websocket and glassfish reference implementation (tyrus) earlier. However in Google Appengine provides channel APIs for bidirectional communication. While client to server communication is still over HTTP GET or POST, sever creates a specific "channel" and enables itself to push data any time to specific clients. Under the hood , its actually the client which keeps polling with GET requests for new data to be sent by the server. In any case this API can be use fill in real time game servers.

The server si…

Appengine.Maven.Guice.Sitebricks.Objectify

I have been trying to read and use all these technology for my project but I did not find any single article/blog which includes setup instructions for all of them.

Most of these technologies are from Google and optimizes for their PaaS solution.

Google AppEngine - The platform as a service supporting several languages including  Python, Java.
Maven  - Build tool like ant but lets you pull the libraries from the original repository dynamically at the build time.
Guice - Dependency Injection tool like spring without XML configuration. Configuration is done in code itself.
Sitebricks -  Libraries for creating REST webservices and dynamic HTML page (separating HTML and Data ).
Objectify - Library to interact with Google AppEngine datastore and automatic memcached management.

Following are the major steps I took for creating a working project.

Since I was trying to create a web app with maven I needed to create the folder structure for web project containing WEB-INF etc. I could do this manually …

Getting started with survival essentials

Image

Giving a new life to old smartphone

Image
My Samsung Galaxy Ace's battery has become very week lately. It has swollen and been discharging really fast. Whenever I used to connect charger , the battery charge level used go up to 100% within minutes and again discharge within an hour when I start using it. It got discharged within minutes from 100% to 0% while using WI-FI or 3G.

Increase your Internal Phone Storage

Image
One of my biggest problem with my phone got solved today. I had been using an old Android phone with only 181 Mb of Internal phone storage. As a result my phone starts complaining after installing few apps, especially the ones which can not be moved to SD card. I have a 16GB SD card installed but its of no use when it comes to running more number of apps. Lately I had to uninstall a lot of my favorite apps and rely on the browser, e.g. I never could install Android apps for Facebook, Twitter, Google+ etc. I always used the mobile websites.

Finally I started searching the workaround for the same. I found that a part of my SD card can be partitioned and formatted as linux file system , so that Android OS considers it as part of phone storage. This is possible for phones which are rooted and I was already using custom ROM from Cyanogenmod.



Note: following will wipe all your data in SD card including music and photos.

Use Mini Tool Partition Wizard Manager to delete the original SD card par…

Recursively find list of files in a directory in Python 2.2

I have been using python for writing small utility programs. Till now I avoided scripting languages like python because I though shell script is master of everything and works in any linux computer. They also have all programming constructs like loops and conditions etc. However when it came to quickly get some work done, shell script too a lot of time write a error free program. Finally I jumped to python to do some file batch processing.

The most fundamental need to batch file processing is to iterate through all the files in a given directory. I could found several ways to do so using os.walk function but my old linux server had only Python 2.2 and I did not want to FTP files to my local PC to server back and fourth . So here is the code which also works in old version of python.


[code language="python"]
import os

# finds all the files in a directory recursively
def listAll(dirName):
filelist1=[]
files = os.listdir(dirName)
for f in files:
if os.path.isfile(os…

Born to code ? Or its just me ?

Image
I don't remember how many of my friends and colleagues who are qualified engineers and doing the top technology jobs told me that they are bored of their "IT Job" and probably want to join a bank or may be do a cloth business. I always wanted to ask them why didn't you think about this when you joined Engineering school ? or at  least deciding the major in engineering school ? Like computer science or mechanical engineering ? When I was deciding the same back in 2002 people almost forced me to take Mechanical or Electrical Engineering just because there was a dot com boom in the technology industry. Even at that time I believed that new possibilities are in computer science are way more than what there is in all other fields of engineering combined. By the time I graduated things really changed and I observed that graduated of all other departments of engineering taking up technology jobs and starting to write code for the first time in their lives. Thanks to the com…

Astroid 2012 DA14 tonight !

Image
As you may have come across news articles that asteroid 2012 DA14 will be fly by earth very closely. It will in fact come closer than the Moon and some Geo stationary satellites.

You can see the live event in SLOOH SpaceCamera if you think you are in a wrong timezone.

Following is the heaven's above chart.



Ajay Talwar did a fantastic job by calculating the  speed of the asteroid relative to the sky which is very helpful to spot it using a telescope. Note that you need at least a small telescope or good binocular to spot it even when it is closest because the apparent magnitude would be little beyond what unaided human can see at the darkest location.

Here is the approximate schedule created by Ajay Talwar considering the viewer from New Delhi

15th February
23:53 IST - 2012DA14 rises in the constellation of Centaurus, apparent speed 0.44 degrees per minute, Mag 8.8
16th February
00:27 IST - crosses into Hydra, apparent speed 0.71 degrees per minute, Mag 0.78
00:29 IST - close to beta Hya, a…

ISS Flyby 4th Feb 2013 Hyderabad

Image
[caption id="" align="alignnone" width="1600"] ISS Flyby 4th feb 2013 , Hyderabad Photo by Joy[/caption]



Click the images to enlarge | Photo Credits :- Joy

ISS Flyby over Hyderabad on 04 Feb 2013 1930 hrs crossing Alpha Ceti and Aries . It was the brightest object in the sky with magnitude - 2.8 (Moon less night and Jupiter was magnitude -2.48 )

Chart from heavens-above.com

Online slate board using HTML5 websocket and glassfish

Image
My last post was about #AdoptAJSR initiative in which JUG Hyderabad is actively involved. Meanwhile I was trying to explore the Websocket API for Java (JSR 356) using glassfish 4 's latest build as reference implementation.

The idea was to use HTML5 websocket API in the front end to communicate with websocket endpoint created in the glassfish server.  To get started with I referred a  similar sample application blogged by Arun Gupta.

In this process I managed to log following bugs against the reference implementation

Session object coming as the parameter in @WebSocketClose annotated method is null
Session#isOpen method returns NoSuchMethodException

To avoid this situation I have put the code "peer.getRemote().sendString("Ping");" in try block so that if it fails , it can gracefully remove that peer instead of ending up in exception.

My app lets you draw freehand lines in the browser and the same gets drawn in real time at every other user's browser who is acces…