Tuesday, May 31

Frustration must be killing you.

I got to know about the Interview a day before when a friend sent me a forward. That night he called me to ensure I go with the required documents.

I was prepared. The only thing I knew was the location. Got down from the bus and the first thing I did was to call up justdial.com. A very useful service. Reached the venue and was told to fill up the form. Later was told to move to the sixth floor. Just when I entered saw about 25 odd people. I think most of them were for .net interview. Around 10 were for web developer position. 

I was pretty sure, would ace the interview and would get the job. I was already feeling confident within. I had my white shirt (The shirt I had got after I failed the TCS interview) and new formal pants with hair combed.  
The office was super awesome. Clean, huge, plenty of space, and hundred’s cubicles, for some there were dedicated white boards. Wow!! 

The interviewers were nice, and made me feel comfortable.  They started with, my current job profile. A simple question. I knew I could score on this. Then came the technical topics. We discussed on some of the projects I did, the challenges I faced and how I tackled them. Here, it did not go so smooth. I was unsure about the project; I could have done some in-depth research on what I should have done to optimize that project. Well that’s what I had written in the CV, so it was obvious they had to ask.
Apart from that, what interest them more was the mobile web application I had developed.  They asked a lot of questions on that. How I tested the application, what size was the entire project, what software tools I used. They were also interested about html5 and css3 technologies.
It was good so far. They told me to wait outside then and would shortly give their feedback to the HR who then would convey it to me.

I went out, was very confident I would clear. Had already started thinking on it. After sometime a lady came, called out my name and said, “I’m sorry, but you’re not selected, if anything comes up will let you know”. It was a shock. About 10 other people heard it, but I could not believe. I asked her, if it was me by mentioning my full name to her. Without looking at the list, she said yes and rushed back inside. I could not get the feedback as to why I was rejected.
I am yet to figure out the reason, have tried contacting some of the people who work in that company to help me get the feedback. I just want to be there. I feel I belong there. But now I’ll have to wait another six months to answer another interview there.

What went wrong?
  • I was not clean shaved / did not have properly trimmed beard.
  • My communication skills were good, but I was not that convincing. Most of the technical questions they asked, I had never worked on them. For eg, I was asked if a designer gave a customized design of a web page with custom scroll bars, how would you implement them in your css. I had never thought about it nor had seen it. Ok, may be seen it but never noticed.
  •  They were looking for a front end engineer; I was more of a back end guy. At least that’s what my resume read.
4.       The questions were simple but I was not able to answer them .For the question, how my types of data types are present in JavaScript, I had my eyes rolling.

5.       They asked about object oriented JavaScript and I had never written such complex code.
6.       The technical questions they asked, I said I know about this, but never used it . (Shows that I am bluffing. Shows that I am trying to be a smart ass. Ok, not really, but that is how it is.)

Am just waiting for my friend (never talked to him since school, met him recently on facebook) to respond back. Then I’d know what went wrong and what I need to do to improvise on it.            

After the interview, I spent some time with a friend, came home, took some rest and at night saw some episodes of prison break. Michael scofield and his team entered the location, where company has been protecting Scylla. General gets an alert that there has been a security breach and rushes down. Just when general opens the lift, Lincoln, Sucre and manhome take him on gun point. Scofield asks for the card. When he inserts the card, he gets another locker where he has to put another five cards. General thinks, that now scofield cannot do anything, but just then after seeing scofield take out other cards, general demands for an answer as to from where he got the other cards. Seeing general so curious and shocked, scofield says, “Frustration must be killing you”.

Thursday, May 26

Software development is an art

After working for more than 2 years i have realized it is not easy to work just hard. It is more important to work smart. Apart from that, this is never ending and the learning curve always needs to be exponential. There can never be a limit, never, Period.

No one can master this art on their own. They need help, may be through fellow developers, online reading other people's experience, blogging, forums, developer meet up's etc. But you should have hunger for this knowledge.

Wednesday, May 25

Mysql adding future dates in the query.

I had this application, where i had a column start_date where i had to insert the current timestamp and another column ie. end_date where i had to insert the current timestamp + 30 days.

We can do this in the mysql insert query using the mysql ADDTIME function


The start_date column type is set to CURRENT_TIMESTAMP so it will automatically be updated on INSERT query.

You can get more information about addtime() from here.

ADDTIME(expr1, expr2)

ADDTIME adds expr2 to expr1 and returns the result. expr1 is a time or datetime expression and expr2 is a time expression.

Thursday, May 19

How to Add your Facebook Application on your facebook Page.

I wanted to create a facebook application exclusively for a Page. After signing up at facebook for creating a App, I wrote down the code, uploaded it on the server. To add your Code to a Page,
Go to your application settings page => Facebook Integration and then enter details for Page Tabs

Once you add the page tabs details,  Go to your Application page. And from there add your application to your page by clicking on the link as shown in the image below.

Open Application Page from Facebook App settings

Application Page

Tuesday, May 17

Using Jquery Check if radio button is selected

I had to validate a form for checking if a radio button is selected or not using jquery.

The html code

<input type="radio" name="user_type" value="1">Individual<br />
<input type="radio" name="user_type" value="2">Firm / Organization<br />

Searching on google i found out this script which best suited my requirements

if(!$("input[@name = 'user_type']:checked").val()){
     error = "Please select user type from given options";

Wednesday, May 11

Using Conditional statements in mysql query

I had a field in mysql table which stored a boolean value.
While retrieving it from the database using mysql query, i wanted to display 'yes' / 'No' instead of 0 or 1. I could have done this in php, but this can also been directly using mysql query

if(field_name > 0, 'Yes', 'No') as required_field
FROM mysql_table

If the condition succeeds, then it return 'Yes'  and if the condition fails it returns 'No'

You can find further information on mysql documentation here

IF(expr1, expr2, expr3)

If Expr1 is TRUE (Expr1 <> NULL and Expr1 <> 0 ) then IF() returns Expr2 otherwise it returns Expr3
IF() returns a numeric or string value, depending on the context in which it is used.

How to FORMAT a UnixTimestamp to Proper Date in Mysql Query

To store date in the database, the preferred method is to have it in the unix timestamp format.
For eg,
$date = strtotime("now"); // 1305116135

To retrieve the date, we can use php function date() to get the date back in string, formatted according to the given format string

For eg,
$date = date('Y m d', $date); // 11-05-2011

However instead of doing it in the Php code, we can directly do it while querying in Mysql

For eg
DATE(FROM_UNIXTIME(date_field)) as new_date
FROM table_name;

We can also format the date using the date_format function in mysql
For eg
DATE_FORMAT(DATE(FROM_UNIXTIME(date_field)), '%d-%m-%Y') as new_date
FROM table_name;