“Revel”ing iOS development

So my career took a huge detour from Microsoft Student Partner to iOS developer, at first i was very excited about using the Mac and iPhone, later found that the development on this platforms is not easier as compared to windows, atleast initially!

Development on windows phone was very easy, one can create a simple hello world app in less than 2 minutes ( infact quicker than making maggi 😛 ), even for people with very basic programming knowledge. This sheer simplicity has driven juniors in my college to create and publish apps for the Windows phone market, but when it comes to iOS, its pure coding, everything is an object and everything has to be manipulated through code, and interface builder is not going to help when you are going to create apps with beautiful UI/UX. I directly took the hard route and went for the iOS development using nothing but code, yes, code for everything, right from creating a new screen, label, button and pretty much everything is written in Objective-C. Even though coding everything from scratch using objC has its own advantages, one big issue i (and most of developers) face is that, sometimes you have no idea where the UI components gets placed in the screen, and debugging can be tedious, especially for something that you cannot see on the emulator.

This Mac app called “Reveal” which i came across a few weeks back is helps a lot when it comes to UI level debugging especially with its Run time inspection, 3D navigation and many other features. It ‘s a great inspection tool for people who are starting to learn iOS development and for those who are already struggling with UI level issues with their apps. Anyway, i’m not gonna give a big walkthrough on the app features. But here’s how you integrate it with your app :

1. Download the Reveal app here and install it.
2.Open the your Xcode Project and add the reveal framework to your project folder.Here’s how you do it:

2.1 Open Reveal, Go to help-> “Show reveal library in finder”.

reveal help

2.2 Drag and drop the “reveal.framework” into your project (duh!)

3. Add Quartzcore.framework and CFNetworking.framework to build phases in the project

Frameworks

4. Add “-ObjC” Flags to Other Linker flags under build settings. (Search for other linker flags)

adding flags

5. Run your app

6. Open reveal app and change the connection from “No connection” to “your app name”, you should see this if you’ve done everything correctly

reveal

The reveal app also responds to interactions and the change of screens that you do on the iPhone simulator, so you can debug any page in the UI level.

Oh, and it also works for iOS7

reveal ios7

Reveal is currently in beta , an other alternative to Reveal is Spark Inspector , but it is paid with loads of other functionalities. Give it a try and let me know if this post was helpful 🙂

Advertisements

Oh, the Humanity

Our race has done some of the stupidest things, from cutting down millions of trees on a daily basis to poking a hole in the ozone layer , we’ve been crafting (killing) mother nature to cater our needs, but why rant about this suddenly? Cuz they are killing my favorite animal 😦 .

Everyone has a favorite animal from dog lovers to turtle tamers, everyone loves at least one animal , if not they could pet it , they still love it! I loved the Rhinos, right from my childhood, why? I have five good reasons for that

1. Rhinoceros  are the closest Unicorn look-a-likes (on land, narwhals rule the ocean with their horns)

2. “Rhinoceros” (almost) rhyme with “Dinosaurs”, and they look like the smaller/evolved version of Triceratops and Xenoceratops

Xenoceratops

Xenoceratops

3. They are so badass that they can scare the s**t out of any animal in the jungle

and this pic says it all !

4. They are the perfect examples for badass vegetarian species

Rhino Charging

see those veggies in their mouth?

5.  They live in peace, i.e , till you poke their arse ofcourse !

Recently rhino poaching has been so relentless that we are almost kicking this amazing creature to extinct from the endangered list, and all for what? A horn that is mostly used as a decorative or sometimes as a medicine, when there are thousand other alternatives in this “scientifically” advanced world. Seriously how’d you feel if i cut your nose? LITERALLY?

Rhino smuggling?

Its already too late, “Save Rhinos” campaigns have been there for years and still poaching has not stopped, soon there wont be any rhinos at all, and one more animal will be added to the “Extinct thanks to Humans” list (Remember Dodos? neither do i, they were long dead before i was born)

One of the last 4 white rhinos (without horn) being guarded

Can we do anything to stop this madness, from kicking animals from the wild to the zoos and later to the museum ? Stop buying animal products, blah blah, everyone has been doing that, i don’t see any significant change. Anyway, something inside me still wants me to hope that rhinos will be saved from extinction.

So, what is your favorite animal? ( and do you think it’ll go to endangered/extinct list anytime ? Just sayin )

P.S: Blogging after a very long time, updated the about page and the name of the blog, comments welcome 🙂

Interview Experience at Microsoft India Development Centre

Nearly 300 MSPs took a written test for the post of Intern/Full time Employment ( FTE ) at Microsoft in Goa during the Microsoft Student Partner Bootcamp 2011 which was conducted on Sep 5 .
There were 2 tests , one for Microsoft IT and another one for Microsoft India Dev center ( IDC ) . Just after an hour on reaching goa , i was made to write both the tests which were 1.5 hours each and weighed 50 marks each. Well , Frankly , i was in no mood to write both the tests in GOA .
The first test was for MS-IDC which was fully based on programming . Here are a few questions :

1. Given 2 sorted arrays , write an algorithm to find the median . ( 10 marks )
2. A College has 2 hostels , 1 boys and another girls , and a common Print Server . Write down all the possible cases when the system will work and the cases when the system will fail and give appropriate suggestions . (10 marks)
3. ( Forgot the exact question) You are supposed to create a software program for a grocery store , each item is labelled with a bar code which contains the necessary details about the items. Some products are categorized as “offered” products, which when purchased above Rs.500 will be given 10% discount ( and a lot of other conditions which i don’t remember ) , write an algorithm to calculate the bill and the data structures that can be used . (10 marks )

The second test was for Microsoft IT , which was both programming and logical , i actually did the test well but didn’t get selected . Here are a few questions from MSIT :

1. The given input is – char *a = “123” , convert this into integer 123 without using any built-in functions
2. Find the Maximum element in a binary search tree .
3. You are producing a basic mobile phone , write down all the test cases that you will perform before launching it
4. After the failure of Titanic , the engineers are building Titanic 2 with enhanced facilities . They also have a rescue engineering team inside the ship that will reach the spot of failure in 30 minutes . After learning the mistakes that were made in titanic 1 , suggest appropriate measures to avoid accidents in titanic 2 . ( I havent watched titanic movie even once 😦   )
5. A output question based on call by value and call by reference
and other 5 questions which i dont remember.

Around 20 people were selected for each MS-IDC and MSIT from the results of the test .
Finally , i was called to attend a face to face interview for Intern @ MS-IDC on 5th January 2012.

MS-IDC was situated in the outskirts of Hydrabad and travel was real pain as i din’t know both telugu ( the local language ) and hindi .

Microsoft India development Centre

At around 9:30 am , i was called for the intervie.
The first question , was –  Write a code to convert integer “n” , say “123” to a linked list , 1->2->3 . I wrote the code and showed him the paper , He said , “Very nice , now using the above program add 2 numbers , m and n ” . After i finished writing the code , he asked me to write down all possible test cases when the program will go wrong . I was confident that my program was fully correct but just in time it struck me that i totally forgot to analyze the carry over conditions. With the permission , i modified the code and gave thim the full program , which took 2 A4 sheets for me to write , he was satisfied with my logic and code.
Suddenly something caught his eye on the first page where i wrote the code for converting the integer into a linked list . He pointed me to the block where i created nodes for each digit and asked , “Do you find any mistake here ?” , it took a while for me to realize that i din’t allocate memory for the linked list at all.

My second question was to find the maximum element in an unsorted binary tree.
I wrote a crappy code , as i was a bit weak in datastructures 😦

The second interview (the last round i.e) was bad for me. The question was to code a function – bool isLucky ( int n ) to find if the given number is lucky or not.
The explaination given for the lucky number was :

Consider the series of natural nos :
1,2,3,4,5,6,7,8,9,10………………..
In the first iteration will be like
1,3,5,7,9,11,13………… ( i.e removing the numbers after 1 place , i.e 2,4,6,8….. are removed )
The second iteration will be :
1,3,7,9,13……….. ( i.e removing the numbers after 2 places , i.e 5, 11….. are removed )
The Third iteration will be :
1,3,7,13,……… ( i.e removing the numbers after 3 places , i.e 9 … are removed )

Now we are sure that 1 , 3 and 7 will not be removed in the later iterations ,So , these are termed lucky .

I was totally blank after seeing the problem and it took nearly 40 mins for me to come to a conclusion . I wrote a program which will find the lucky number but it had the maximum time complexity for O(N^2) but the interviewer wanted a code with the least time complexity .

Interns at MS-IDC get a pay for 25,000 Rs per month and the hounour of working at Microsoft’s projects for 3 months.

Steve Jobs – A Legend !

For those who are wondering who this guy is , please see the video and/or read the below post

The Speech

” I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?

It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: “We have an unexpected baby boy; do you want him?” They said: “Of course.” My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.

And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents’ savings were being spent on my college tuition. After six months, I couldn’t see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn’t interest me, and begin dropping in on the ones that looked interesting.

It wasn’t all romantic. I didn’t have a dorm room, so I slept on the floor in friends’ rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:

Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn’t have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can’t capture, and I found it fascinating.

None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, its likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.

Again, you can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something – your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.

My second story is about love and loss.

I was lucky ­ I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation – the Macintosh – a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.

I really didn’t know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down – that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me ­ I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.

I didn’t see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.

During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I retuned to Apple, and the technology we developed at NeXT is at the heart of Apple’s current renaissance. And Laurene and I have a wonderful family together.

I’m pretty sure none of this would have happened if I hadn’t been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don’t lose faith. I’m convinced that the only thing that kept me going was that I loved what I did. You’ve got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven’t found it yet, keep looking. Don’t settle. As with all matters of the heart, you’ll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don’t settle.

My third story is about death.

When I was 17, I read a quote that went something like: “If you live each day as if it was your last, someday you’ll most certainly be right.” It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: “If today were the last day of my life, would I want to do what I am about to do today?” And whenever the answer has been “No” for too many days in a row, I know I need to change something.

Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because almost everything ­ all external expectations, all pride, all fear of embarrassment or failure – these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.

About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn’t even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor’s code for prepare to die. It means to try to tell your kids everything you thought you’d have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.

I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I’m fine now.

This was the closest I’ve been to facing death, and I hope its the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:

No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma – which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960′s, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.

Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: “Stay Hungry. Stay Foolish.” It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.

Stay Hungry. Stay Foolish.

Thank you all very much. ”  – Steve Jobs ( 1955 – 2011 ) – CEO of Apple Inc – Innovator – Visionary –  Role Model – Mentor –  Legend

Thank you for all the things you’ve left us to live with !

19/7/11 is Legendary

“The best number is 73. Why? 73 is the 21st prime number. Its mirror (37) is the 12th and its mirror (21) is the product of multiplying, hang on to your hats, 7 and 3. … In binary, 73 is a palindrome, 1001001 which backwards is 1001001.” – Dr Sheldon Cooper

Also , today 19/7/11 (dd/mm/yy)  has all prime numbers ( 19 , 7 , 2011/11 are Prime) and their sum            19+7+11 = 37 ( the mirror of the Best Number 73 ) , Coincidental ?? I don think so , this particular date is the Rajinikanth of all dates 😉

Giridhar V.C

Running Turbo C++ in a Windows 7 and future versions

Most of the people will be facing a common problem with their Boreland turbo C++ in windows vista / Windows 7 . If you own a 32 Windows Vista or Windows 7 , Turbo C++ will be running in a smaller screen which wont maximize , and if u own a 64 bit OS , Turbo C++ may not open up in your PC . This can be fixed by using Software , DOSBOX . Dosbox is basically a DOS emulator ( The base platform in which Turbo c++ software was made on )

Running Turbo C++ using Dosbox :

1. Install the Latest version of Dosbox

2. Open DosBox

3.  Type in “mount <space>”   “G: <space>” ( or any drive name which you like ) , The directory in which Turbo C++ is installed . For example , if the copy of turbo C++ is present in the address “C:\Tc\bin\tc.exe” , C: is the root directory , so the above code will look like  ” mount G: C:\ “ ( without ” ” ) and press Enter key

If you have done this step correctly , it the screen will show something like ” Drive G is mounted as local directory c:\ ”

4. Now change the Root drive of the Dosbox  to “G:” . To do this , jus type in “G:” ( without ” ” )

5. Now change path to the place where the executable file of Turbo C++ is present . If “tc.exe” is present in “C:\tc\bin\tc.exe” then type ” cd tc\bin” ( without ” ” )

6. Now Open TurboC++ by typing the name of the executable file , in this case “tc” ( without ” ” )

7. Press Alt+Enter to switch to Full screen mode

P.S : Dont Use Ctrl+F9 to run the program in TC while running it in DosBox as the combination Ctrl+F9 is overrided to shut down DosBox

This method can be used to run other Dos based applications and Dos Games too .

If you feel uncomfortable with running turbo c++ in windows7 , use other alternatives like DevC++ , Visual C++ ( in Visual Studio ) etc which have better GUI and other features