Saturday, January 28, 2012

Making Tank-O-Mania : iPhone Tank Game

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

Wednesday, March 02, 2011

Dealing with Competition in Workplace

... and Business!

Long time no blog, so I watched yet another geek movie to get inspiration. Pirates of the Silicon Valley. The story revolves around the begining of rivalry between Bill Gates and Steve Jobs, the start of their competition.

In competition you can be at two sides, either you can be a twitter or a follower, there is no third place to be. By being twitter, you stay ahead of the competition playing sharp with your innovative ideas. Your competitors would be following you up by getting inspiration from your ideas. Remember, it is very difficult to get copyright on ideas.

So will you guess that the twitter is the winner and the follower is the looser? Who won between Apple and Windows? It is the guy who plays smart.



How to play smart?


1. Innovation


We have brought several innovations, including Mobile-Nanny & MobileSync Pro. We thought of the idea, shouted Eureka, prototyped and designed the products from scratch and build a great product. The competitors dropped their jaws

Lets talk about innovation, and I understand I am suppose to talk about Steve and Bill, and the Pirates movie, but wait I got another one; Flash of Genius.

This one is a true story of a Bob Kearns's 12 years court fight for the innovation that was stolen by Ford Motors, here is a quote from him:

"Well, I want you, uh...  
I want you to know something.

When I walked into this courtroom,

I was wearing a badge right here.

You couldn't see it.
It said I was an inventor.
A contributor to society."


In the story he also states how he thought of the idea. Due to his defective eyes, he had to blink regularly. And so during a rainy day drive, he said why cant my wipers blink the same way. That, that was the flash of the genius. This is something that the innovators has, the idea is sitting hidden the mind, and at a blink it appears.

Moving from my HTC to iPhone, why is it so difficult to transfer between two different platforms? That's eureka for MobileSync.

Being innovative keeps you ahead of the game.

2. Inspiration

Inspiration is a term used in synonyms of copying specially by music directors, but I guess that's wrong. Copying people should be permanently banned from business.

Now inspiration might be the "Flash" I talked about above. How Mr. Zuckerberg (yeah, again) made Facebook? Inspiration from the Winklevoss' idea! However he was not a copy person, he created something that, that..., that is Facebook and *not* what Winklevoss brothers thought of.

SniperSpy, Net Spy Pro, ePhoneTracker were inspired but not copied. They stand tall and smart to the competitors products, features ahead. And actually they're inspiring the other way around now.

Here is what inspiration is, you see a chair, and your brain flashes how you can make a flying chair.



3. Protection

Copyrights, Patents are in mess specially in International cases. But you got to play the cards with whatever is available.

4. Staying cool

Heat not a furnace for your foe so hot that it do singe yourself.- William Shakespeare



There is one more line from Bob Kearns in FoG that says even though he won, he cant get back the 12 years he lost fighting. There is a life beyong the competition and the rivalry, and then there is health and wellness of yourself and your business. Pirates of the Silicon Valley ends with the 1997 MacWorld Expo scene where Steve Jobs bring Bill Gates on the big screen announcing that Microsoft invested $150m in Apple and will be a 'partner'. No matter how much Apple's fan would have hated it.

That is playing cool, and understanding the situation with clear mind. Those who wins know the right thing to do at the right moment. There is no place of emotional wars in business, as when two cats fight the monkey wins. Want an example from us? Are we doing anything with PCHO?

5.  Fire and Motion

The last suggested way to play smart is to stay ahead of the game. Fire and Motion is a technique that Call of Duty fans like me would be aware of, is to fire blindly at the enemies while your other shoulders are moving forward. The competitors see what you are releasing, blogging, tweeting, press releasing and more, that is your opportunity to fire at your competitors too. Keep them busy following & guessing you, and not be on the other side.

And before I click Publish, my answer to, who won between Apple and Windows? I will quote Steve Jobs twit: "Microsoft, kiss my apps."