Monday, February 27, 2012

What "should" motivate you!

When you cross 25, you realize life is cruel. All the hopes and dreams you have had in your young life is shattered in the harsh reality of organizational policies, politics and a bald boss. You snooze your alarm clocks several times before awaking from your bed, and dread reaching your office. You hate to see if your boss has reached earlier, and it could be a day of those nasty yelling. The day passes in sorting out who is in your side, and what the back-stabbers are planning as their next move. And the team meeting discussion hot topic is how to convey the project delay to the client. The joy comes when clock ticks 5, and like a prisoner out of prison, you run out satisfied at least one day is over. Life is cruel! But what is it that gets you going?

Now of course, the low salary doesn't give enough space for multiple bottles of Red Bulls and the office milk-powder coffee is hateful. But still something helps you maintain your senses. Lets first see what is it that keeps you motivated:

Money: If I don't work, wait, if I don't punch the attendance and seat in office I won't get paid. Money is the primary motivations, no matter how much people say it isn't, it is. Realize it sooner and lead a truthful life.

Recognition: Awards and promotions has always been the not-so-secret weapon of your managers to achieve the "Carrot Motivation" in its staff. Surprisingly it has been working on humans for so long.


Fear: How fast can you run? 6-8KM/H? Imaging a blood sucking wolf running after you, now, how fast can you run? 10-12Km/h, or at least faster than the wolf. Replace running with working, and wolf with ... (do I need to say?), and their you have the fear motivation. Fear of losing your job, security, feeling of employment, social status, money, it all drives to continue achieving the target so blindly set by your managers.

Again, I can go on... but I will keep these as the top three motivators, if you have any different feel free to comment and correct me.

So the point of the blog is, what instead should be your motivator.

Love: Why exactly did you do everything you have done so far? Why did you go to that college? Why you took that course? Why did you join this company? If it has been for any of the three reasons above, it is time to take out a rubber and erase your canvas so you can correct it. If, however you are here because you really hoped that what career you're choosing will give you work satisfaction, a feeling that you're doing what you're suppose to do, a feeling that you enjoy what you are doing, then everything else doesn't matter. If only you love your work, you can love your life, and spread some of it to others.

Achievement: Is performing your task an achievement? Did it required more efforts, ability, push to accomplish it? Your work-life can be divided into several achievements, every next task that you do requires more talent, skill, ability, and effort to accomplish it - and that becomes your achievement. Like clearing a stage in a game, and going to next. Upgrading yourself with newer versions of your own knowledge is very essential and it will give you passion to conduct yourself to superior work quality.



Fun: "If you think daily that this might be the last day of your life, one day certainly it would be true." So the place and the job your doing for 60% of your waking hours should certainly be enjoyable to do. Try to seek fun in the work you're doing, enjoy your work.

If this three is your key motivator, you sure will have a great and long life, save early wrinkles and high blood pressure. Is money, recognition and fear are more important than your health and happiness?

Saturday, January 28, 2012

Making Tank-O-Mania : iPhone Tank Game

Update: the game is online, find more about it at www.iPhoneTankGame.com

I learned a little about game programming in 1998, before I started to work on Windows. We use to do most of our job in Borland-C++ and use the DOS int86 calls. I happen to buy the book Action Arcade Adventure Set, written by Diana Gruber. In 100s of tech books I have read so far (including academics), this one is the only I have read cover to cover. The book was excellent. But it covered C, and VGA 256 colors 320x240 mode-x, with about 128"KB" of available memory.

I usually say to people, learn the concept not the language. The book manage to throw a lot of light on Tile-based side scrolling, sprites, game engine and a lot more.

Fast forward to now, while the majority of games are being done for PC, or consoles with all the awesome 3D and no controller (kinect) engines, a new chapter is introduced with launch of Smartphones. It is like the bell-bottom era making a come back. The sizes of 320x240, less memory and casual gamers concept is being back. The era of 2D is reintroduced.

iPhone Tank Game
I was in Delhi and thinking of the statements of Bill Gates, something like taking books on vacations. I opened flipkart.com and ordered some books, out of which one was on Cocos2D. And while doing some net readings, I came across tank graphics from Vicki Wenderlich. All those who have grown up in 80s and early 90s must have played Mario, Contra in arcade stores. There was one called Tank90, and it was cool. One look at the Tanks and I wanted to do that.

And hence the coding for Tank-O-Mania, iPhone Tank Game started on 26 Oct, 2011, the day of Diwali.

At first it made of all tiles and tanks graphics from Vicki, but later our in-house designer did some tremendous work and the sprites took form. I contacted another excellent designer to do the level-art and managed sounds from stock sounds. And hence I dumped that version, and recreated everything from scratch.

The best part was programming, programming the game was awesome and I am already missing writing codes for it. It is like the availability to create own world, where we set the rules. And thanks for Ra-One release in between to keep me just as pumped.

The game has:


- 30+ types of Enemies with Unique A.I.
- 24 Levels of Play within 6 Countries
- 5 different Weapons including Mines, Grenades and Rockets
- Call Friendly Helicopter for Air Strike
- 5 Power Ups including Invisible Mode, Freeze Enemy, Extra Lives and more
- Classic Arcade Joystick as well as Accelerometer based control
- Strategical Level Designs
- Game Center support, Compete with the World for High Score
- Dazzling Graphics of World Powers and Realistic Cities
- Thundering Battleground Music and Sounds Effects

And here's some screenshots:

iPhone Tank Game

iPhone Tank Game
Tank-O-Mania, iPhone Tank Game, is Waiting Review from Apple. Till then

- Follow us on Twitter @TankOMania http://www.twitter.com/tankomania
- Like Tank-O-Mania on Facebook: http://facebook.com/tankomania
- Subscribe for Videos Preview: http://youtube.com/tankomania

Friday, August 12, 2011

Tracing "Mr. loj7g!" What the Hack!

A google search on "loj7g domainname" isn't giving anything but here is a background saving our own shames though.

A worm is out, intelligent Windows worm that runs on your PC and looks for FTP programs like in our case FileZilla was installed on the victim PC, and decodes its save passwords. Then it connects to those server and infects all files by writing following at the bottom of the page:

DISCLAIMER: THE CODE BELOW IS TAKEN FROM INFECTED FILE, AND IS FOR EDUCATIONAL PURPOSE ONLY!







Very interesting!

Let the hacking begin...

"echo(gzinflate(base64_decode("

So three PHP functions:

base64_decode — Decodes data encoded with MIME base64


gzinflate — Inflate a deflated string


echo - well print it


So when our dear PHP runs this part of the infected code it gives following output:






Now the guy is utilizing Javascript to do something funny,  

document.createTextNode, well creates a new text node, which can be added in to any of the document element.


After that the intelligent writer has utilize all the HTML encoding, and processed a look to cleverly iterate and generate a string, what is that string?


Lets just change eval() to document.write() and bingo here is what we get:





Simple Javascript, which is creating a hidden frame and opening the URL http:///forum.php?tp=9bc7b8fc6901cd02, now I can't really connect to that URL, but pinging it returns this IP:


And the IP address belongs to:


And the whois record says:

OrgName:        RIPE Network Coordination Centre
OrgId:          RIPE
Address:        P.O. Box 10096
City:           Amsterdam
StateProv:
PostalCode:     1001EB
Country:        NL

Traceroute is running for quite sometime and says this:




What else, yeah who is this superpuperdomain.com? The whois record gives clear cut name and address but I don't want to put it in my blog, if you are keen just do a whois.



See, the guy wants to know how many sites he got infected and pat his back! But every thief leaves a track, and gets caught.


And for you just keep any good anti-virus and firewall on your PC, or just be safe, be protected, get a Mac!

Friday, July 29, 2011

How to fill balloons?

Fortunately for coders, and unfortunately for managers, 80% of the code going into projects are from stackoverflow.com, or any other forum like iphonedevsdk.com and the rest 20% is auto-generated by the IDE. In the rush to get it out fast, majority of the time is spent on copying and pasting, and the left in putting up patches to fix up leaks. Damn, in service model, we are not paid royalties, why bother for quality of work. Stack holders can complain on the market research gone wrong. And in the resource constraint market, if the luck has striked to get hand on even two projects, the guys from NCR or B'lr have their nets out to catch fishes. Based on how many worms they have eaten.



First, the recruiters need to understand. The resume and the interview is a lie. The work experience is in advanced Google searching. The reference don't care about you or give a damn about the guy who has left and still discovering everything done wrong in the candidates' work. The interviewee have no clue what the company wants. And the result is based on comparing expected CTCs.

Second, the coder's hurry to make more money. How many 14 years guys and gals are found hand-in-hand in shopping malls, children parks, bunking schools? They have found their soul mates, and the plan to settle is made already. What if the age still suffixes 'teen', and the parents is busy taking loan for education.

The gold rush is here, the web app bubble has burst and the mobile app bubble is here. Something makes you think it will burst, so lets hurry up. The more you can earn during the period is all you can earn. Lets squeeze every opportunity and make lemonade out of every project plan. I don't have to give a demo to my prospective employer, do I?



Here is the sad realization: 3 years have passed. You have made your jumps from 1.2 to 4.2 Lac, switched 17 companies in between but now its all stuck. You are at one side of the chasm, and find no way to jump across it. There is not enough hydrogen in your balloon to make you fly across. Why? Because you spent all this time filling it with exhaled air.

Now with your beautiful resume, and an advanced diploma in Google search, and a drinking habit to satisfy - 4.2 is not enough! Mind has stopped working due to all the googling and the codes written looks strange. Did I write it? Well, actually I didn't but its their in my project. The only solution left is to fool another recruiter and stay low profile in new company till your truth is figured out and the HR gets enough gut to terminate. And the cycle goes on.


The point: see how you are filling your balloon, and not your pocket at least in the first five years of your job.

Friday, June 24, 2011

How to get your first software engineering job?

Self evaluation is the first step, as a software engineer, you can be part of various interesting job profile. Even though software programmers is most glamorous, there are other posts that tend to be easily ignored. What I mean by self evaluation is can you judge yourself truthfully that you are logically strong enough to be a programmer? And wait, programming like learning music is a long process, if you are not coding already whether professionally or as hobby then it is going to be a hard journey to the day you become productive.



If you want to become programmer, start coding from day 1, don't wake up in your fourth year of college and google "library management software source code", there is no shortcut to learn programming other than lots of practice. Start coding in any language of your choice at least 2-3 hours a day, download source code examples and study them. Participate in submitting new source codes to planetsourcecode.com, codeproject.com, etc (yeah, people not only download, submit too!). If you are even more enthusiast, participate in open source community to improve any opensource project like, Firefox, Linux, or Android. And if this sounds boring, leave it for something else more suitable for you. 

If programming doesn't look like your piece of cake, be happy that the software engineering paradigm doesn't end there. You can be a software test engineer, also called as Quality Assurance engineer, the people responsible for ensuring the quality of software.




QA Engineers are tech-enthusiasts, geeks who will dive in to new projects and try different ways to break it. Who wont like to be paid for reporting other people problems! If this sounds interesting, luckily software testing can be self learned by reading some good books. You can also do some course from any reputed institute. The key ingredient to this profile is the interest to explore uninhabited lands like Sir Vasco Da Gama.

Another profile is system administrator or database administrator, the people responsible on ensuring you see the home page of retinasoftwarein.com, and not an Internal Server Error. The sysadmin and DBA looks after the health of computer servers, forseeing problems and applying fixes along with system updates and optimizations. To be one, you need to master either Linux or Windows Server, do a certification from a good institute. And practice.

Other profiles are web designers, animators, technical support executives, technical writer, business development analyst and others. 

So once you decide on which profile you want to work in, the next step is to put the extra efforts to learn about it. If you are not one of the lucky guy to have been placed through your college campus program in an MNC, you are left with three options. 

  1. Expend money to do some courses and receive valuable certifications,
  2. Join for company's internship programs,
  3. Be different (when everyone is learning Java/C#, learn LISP or ADA and look for job in that section).
There is no fourth way, don't waste time applying for every job posted in Naukri.

And finally, while you are applying for jobs, waiting for interview results and so on, use your creativity. The best way to get hired is to stand apart. With open source, fast internet availability, and lots of information on net, it is easy to stand apart. There is internet beyond facebook, spend your time exploring your choice of profile, language and projects. Actively participate in forums, blog, submit source codes and projects, and browse freelancer projects.


Do that and job will run to you, rather than you running after jobs.

Friday, April 22, 2011

Finance for Geeks

... we understand stack overflow, fails to understand compound interest.

Two interesting things happened in last year reality shows, one guy won 1 crore in KBC and lost at the next question. Secondly, Shweta Tiwari won Big Boss 1 crore, had no idea what to do with it - so her interview with a financial planner was shown live on TV.

Shweta Tiwari (Trying to understand investment)
And yeah, you might want to pity on the first guy who lost at the last question in KBC, but wait, if you are going unplanned you should pity yourself more. There is tons of opportunity that you have lost already, and the time to act is now.

Following my traditional way of writing, here are some acting points for a basic idea of where to invest?

1. Provident Fund:

PF is an investment for your retirement, do not cut it. Not only it gets tax exemption, gives a guaranteed return on maturity, is far safe.

2. Insurance with Term Plan:

Who will cry if you die tonight? Well, may be many tonight! But if you are not insured or under insured may be your dependents will cry for a very long period.

The thing to understand with insurance is, its not an investment, its a well, insurance. Like a car/bike insurance, if you have paid some money this year as your vehicle insurance and it is not stolen, do you get a return on your insurance money? No. What instead you get is peace of mind, when parking your vehicle.

Same applies to life or medical insurance, term plans, you pay for the insurance for the peace of mind of knowing that even though you would be irreplaceable, your dependents will get sufficient income to continue living the same standard.

Its also advised now to take Medical and Accidental Insurance and not just Life insurance.

3. Don't Mix Insurance and Investment 

Stay far away from ULIP, insurance linked investment. They are horrible, you are highly under insured, the return on the investment is terrible and there is no peace.

4. Debt is for short term, Equity is for long term

Debt based investments are for short term, if you have excess money lying in your saving or even worst current accounts, and you foresee a use of it in next few years debt is the way to go.

However, if the goal of your excess money is your new born child education, or your retirement, something that got enough time, equity gives a better return for long term.

5. Invest using SIP and STP

Its highly impossible to time the market, and specially for geeks watching the CNBC graphs is just not a nice idea. So the best way of investment in both debt and equity is using Systematic Investment Plans (or SIP), in a layman term, with SIP/STP your money is invested in regular interval and not in lump-sum. Like the Monthly Investment Plan (MIP) will invest in market every month, and hence on an average a profitable return can be measured avoiding the fluctuation of the market.

6. Stop misusing Credit cards

Loans should be taken to help you in your need, a house loan, loan to launch a business. But most people these days are using the loans for monetary gratifications. As your good investments grows by Compound interest, so does the loans you take. Be careful when taking loans, it need to be repaid. And several times, much more than the principle.

Understand what is expense and what is investment, a land is an investment, a house is an expense. Gold is investment, car is expense.

7. Educate yourself about Finance


Turn on your financial intelligence
"Intelligence solves problems & produces money. Money without financial intelligence is money soon gone."
— Robert T. Kiyosaki



With technology now its very easy to learn, and its very easy to not learn. So give some better use to your television set, besides watching the reality shows, and listen to the investment programs. Once in a while browse some good financial articles, here's the guys writing specially for Indians about Financial Literacy.

Wednesday, April 06, 2011

How to get into the "Zone" for software programmers

I do feel like taking my hats off sometimes to the programmers coding software from the uncomfort of a hall filled with cubicles. From my personal experience, its hard if not impossible to get into zone in any room with more than one person. Yes, one.

What is Zone?



Zone, aka, Flow is a mental stage where a person is most productive. In programmers its the state where they write productive codes unaware of the surrounding, yes music is playing but they dont hear the lyrics. The exact state where the Milk will burn in the kitchen and mother wont understand why can't you remember to turn it off.

Its difficult to get into the zone, can take 10 mins or just wont come that day, the trouble is, its too easy to get off the zone with a little disturbance.

How to get into zone?

1. Kill Distraction:

You see that Yellow smiley in your tray bar? Turn if off right there. Feeling urge to check your email every 15 seconds, turn that off too. Turn the voice mail on in your mobile. Close Facebook and Twitter. Let people who live or work with you, be aware of the situation. I seldom code from office due to this and am best in my study room. James has also built a room specially for creative working (go see www.retinax.com).


Timing is also critical, usually programmers are in habit of working late night. However for professional employees, they need to adjust themselves to the sunlight. But ending disturbance is critical. Respect "zone", and ask for respect for your "zone".

2. Music:

The best that helps is rock, and songs in foreign language. As you don't care about the lyrics. Yeah, the idea is not to get you sobbing tears, but to shake your head every time F5 works with no compilation error.

3. Caffeine:

For some Coffee works, for us (J&Z) coke works. I have tried lemonade and juice, doesn't work for me. Ice cold water also helps.
 
4. Tools:

Here too I have a dreadful habit, for long I can only work on TVS mechanical keyboard. It plays a thak sound with every press of key that coders will enjoy, got it added to the iMac too.


Anyway the point is, ensure you got the tools, hardware and software, that you are comfortable in to work with. An internet connection, and a fair enough screen size with sufficient RAM to compile fast. Wear what you are comfortable, seat how you are comfortable. Software cannot be made in Suits.

5. Push yourself a little:

The first few minutes is difficult, manage your playlist in iTunes, get your drink, seat at your desktop and fire the IDE. And just start.

References:

http://en.wikipedia.org/wiki/Flow_(psychology)
http://www.joelonsoftware.com/articles/fog0000000068.html
http://www.randsinrepose.com/archives/2006/07/10/a_nerd_in_a_cave.html