Sunday, March 1, 2009

CopyCat 1.0

This Post is about CopyCat 1.0 (StandAlone Application in Java) which has been developed by nitd_developers for the College Tech-fest.

We had been approached with the Requirement for a Stand-Alone Application which could generate a Random Path so that Each Team is assigned a slightly Different Path with similar Constraints like the No of Turns being fixed and the max of steps it can take in a particular Direction till the next turn is encountered. We also took it up as challenge as we had never worked on Random Path Generation before.

Things weren't coherent at the beginning as to what was required to be done so that the Random Path generated strictly adheres to the Constraints. Then Swapnil came up with a set of equations which Govern the no of steps to be taken before a turn is encountered and also constraining the equation with another variable which keeps note of the turns.

Now,using this Governing Equation we could come up with 2 different set of Paths which Different Constraints.

Then,as an addition to the Random Path Generation ,We Provided support for Team Registration and Assigning Randomly Generated Paths to each Team Beforehand and then Viewing the Path assigned at a later Stage.


Few Screenshots of CopyCat 1.0

1) Team Details Panel:





2) GridPanel:




Positives for nitd_developers from this Application:

- It was Fun as always and also Gained a fair Idea about Random Generation with Constraints.

- Code was More Readable this time and used a better IDE(NetBeans) this time.

- Avoided Mistakes that were Committed last time (especially Code Duplication).

- Avoided Database for Trivial Data Storage Instead Serialized the Objects.


Things that we need to Improve Upon:

- Firstly,It would be making the entire Design more Flexible.It is more a continuous Process and we are definitely moving a step forward in that front.

- Using Standard Layouts in GUI was Missing yet again.We would need to come up with some Solution for that.(Null Layout should have been avoided).

- Finally,We need to be better than atleast ourselves every time we take up a new Task.



PS: If you have any Suggestions/Queries then Feel Free to Contact nitd_developers at nitd_developers@googlegroups.com

Wednesday, February 25, 2009

The Gmail Bug

Well after The Zune Media Player had a Bug in the Module which Calculates the Leap Year Correction
(more info here).It started a Blame Game in the Entire Set Up of Microsoft Zune Division.
The Recent Layoffs were attributed to this fiasco.
Now, its the turn of Google it seems.

This one seemed Quite Surprising When Google's Product Gmail Suffers from a Bug in the section which Records the Time Elapsed from the Time the Mail was Received in your Inbox.
I have a Screenshot to Illustrate this.




It Shows the Time here as -2 Minutes Which Essentially means that there is still 2 minutes left for me to receive this mail :P

After few Minutes it doesn't show any discrepancy.
Here is another Screenshot after few Minutes.


Well,The Weirdest thing about both of these Bugs are that both of them are related to the Date and Time which are often Regarded as Trivial Part but then Even nitd_developers had been plagued with such problems during LibTimeManager 1.0.(so no Blame games ..)

So the Most Interesting Part is how to catch this Bug.
1) Well Anticipate a Mail (either ask your friend to mail you or do self-mail ).
2) Open the Mail within like 20 seconds after receiving the mail (The most Crucial Part).
3) Now check the Timing to the right of the show Details Hyperlink.
4) It should be Negative if the Bug is Consistent.(I didnt Check in all Browsers or in all Platforms .)

I just Hope that Everyone does their Counting Right :P


Do Post Comments if you do find more such Bugs.

Friday, February 13, 2009

TLE :: Contest with a Difference

TLE, The Online Contest of IIIT - Hyderabad was a refreshing one for me.We had to solve the Questions with different constraints. One of the Questions that we managed to pull off well was this one:
In short, a code to draw the Penguin Image with shortest possible code.
The Actual Code we submitted was:


i,j,d,q;char*k[]={"4 1 1.1:8x1:1.","29 .16x.","28 :19x:.","27 .23x:","26 :25x:","26 26xX:","26 3x3:8x4:9x:","25 .2x:3 2:5x:5 :8x","25 :2x2 x.2 4x:2 2x.2 8x","25 :2x 3x2 4x: 4x2 :7x","25 '2x '2x2 4x:. 2x'2 8x","26 2x 6:2x5:.3 8x","26 2x5:.4:.7:8x","26 :x'4:'4:'5:':9x.","26 :2x.12:'3 10x","26 :2x: '8:'5 :10x.","25 .2x5 '4:'8 '10x.","23 .4x21 '9x.","21 .4x25 '9x.","19 .5x:26 10x.","18 .5x:'26 11x.","17 .6x3:.11 .7 2.3:_11x:.","16 .7x2'6 '3:2'12 2'2:12x.","16 6x12 :18 '2:12x","15 :4x:'12 :20 '12x:","14 .5x14 :21 2:12x","14 4x:'36 2:12x","14 4x15 .22 2:12x.","10 .:6x15 :22 2:12x2:","10 8x15 :22 2:13x:","10 8x15 :22 2:13x:","10 ':6x15 '22 2:12x:'","12 .:. 2x:.35 .:13x'","10 6:.'2x:.12 :18 .2: 11x':","2 .15:.'4x.28 4:'8x'3:.","2 18:.'5x26 5:.'.2x.'6:.","2 20:.'4x:.23 7:.2'9:","2 '21:.'2x:'21 .'20:2.","4 21:.'2x20 .2: 23:","2 .23:. 2x15 .2:4x 23:","2 25:.'3x2.8 .2:7x 20:'","2 '25: 23x 17:'","4 '23: 23x 15:'","8 '19:_6x2:3'2:10x '12:'","13 2':.10:'24 `._'6:2'"};main()
{for(;i<45;i++,puts("")){for(j=-1;q=k[i][++j];)if(isdigit(q))d=d*10+q-48;else{d=d?d:1;while(putchar(q),--d);}}}

However, I know the above code is really unreadable. So, I made it a point to Display the actual Code that was first used to come up with the actual one.

/*
* This is the code for Drawing the Penguin
*/
#include"iostream"
#include"string"
using namespace std;

int main() {
/*
* The Array of String below is the Actual Data about the Penguin
*/
string k[] = {"13 2'1:1.10:1'24 1`1.1_1'6:2'", "8 1'19:1_6x2:3'2:10x1 1'12:1'", "4 1'23:1 23x1 15:1'", "2 1'25:1 23x1 17:1'", "2 25:1.1'3x2.8 1.2:7x1 20:1'", "2 1.23:1.1 2x15 1.2:4x1 23:", "4 21:1.1'2x20 1.2:1 23:", "2 1'21:1.1'2x1:1'21 1.1'20:2.", "2 20:1.1'4x1:1.23 7:1.2'9:", "2 18:1.1'5x26 5:1.1'1.2x1.1'6:1.", "2 1.15:1.1'4x1.28 4:1'8x1'3:1.", "10 6:1.1'2x1:1.12 1:18 1.2:1 11x1'1:", "12 1.1:1.1 2x1:1.35 1.1:13x1'", "10 1'1:6x15 1'22 2:12x1:1'", "10 8x15 1:22 2:13x1:", "10 8x15 1:22 2:13x1:", "10 1.1:6x15 1:22 2:12x2:", "14 4x15 1.22 2:12x1.", "14 4x1:1'36 2:12x", "14 1.5x14 1:21 2:12x", "15 1:4x1:1'12 1:20 1'12x1:", "16 6x12 1:18 1'2:12x", "16 1.7x2'6 1'3:2'12 2'2:12x1.", "17 1.6x3:1.11 1.7 2.3:1_11x1:1.", "18 1.5x1:1'26 11x1.", "19 1.5x1:26 10x1.", "21 1.4x25 1'9x1.", "23 1.4x21 1'9x1.", "25 1.2x5 1'4:1'8 1'10x1.", "26 1:2x1:1 1'8:1'5 1:10x1.", "26 1:2x1.12:1'3 10x", "26 1:1x1'4:1'4:1'5:1'1:9x1.", "26 2x5:1.4:1.7:8x", "26 2x1 6:2x5:1.3 8x", "25 1'2x1 1'2x2 4x1:1.1 2x1'2 8x", "25 1:2x1 3x2 4x1:1 4x2 1:7x", "25 1:2x2 1x1.2 4x1:2 2x1.2 8x", "25 1.2x1:3 2:5x1:5 1:8x", "26 3x3:8x4:9x1:", "26 26x1X1:", "26 1:25x1:", "27 1.23x1:", "28 1:19x1:1.", "29 1.16x1.", "4 1 1.1:8x1:1."};

for (int i = 45; i >= 0; i--) {
for (int j = 0, count = 0; j < k[i].size(); j++) {
if (isdigit(k[i][j])) {
count = count * 10 + (k[i][j] - '0');
} else {
for (int l = 1; l <= count; l++)
cout << k[i][j];
count = 0; //reset the count
}
}
cout << endl;
}
return 0;
}




Well, The Code Itself is self-explanatory. Finally the Actual Figure of Penguin looks like This.



We ended 66th Overall and 5th Indian Team when the Contest ended. You can view all the solutions at the official website of TLE.
Looking forward to more such Events in the future.

Saturday, January 31, 2009

Using Products Fresh from Google Labs

If you spend most of your time on Google,Gmail,Gtalk ,Orkut,Blogger or any other Google Product. Then this page is the most essential thing that you need to visit. "Google Labs" ,as it is called, is a PlayGround for Google Employees where they spend their Time apart from the Work@Google to think,innovate on some cool Products that can be a successful product later on.. This is the same channel through which Gmail came up which so  now has  so many users worldwide.

So talking about Google Labs.There are Few Products that caught my attention which I would like to share :

1) Google Translation : This one is the biggest thing because it may help you talk with some Russian or Polish acquaintances in near future on Gtalk or mailing them by merely typing things in English. Google as Always would do the Translation for you from English to Russian/Polish and translate back the replies from Russian or any other Language to English .

2)Google Transliteration: This one does Transliteration work. which means if you know to speak some Language like Hindi,Malayam or some other Language but dont know to Read or Write then this Tool would be an asset for you. Using Transliteration you can type words in English but meaning them in Hindi like "Mera Bharat Mahan " --> "मेरा भारत महान" and so on . You can check this Tool on this URL This Transliteration Tool support For Indian Languages has been done in India : Google,Banglore. So this is the product to watch out for.

3)Google Audio Indexing/ GAUDI: This Audio Indexing Indexes Audio for certain Videos so that we can Search the exact Context or Wordings that may be used  in Speeches and  so on . The Google Search is moving a Step  Forward it seems. This Product though at intial Stages has indexed American Politicians Speeches (great thinking when it was time for US Presidential Elections :P ) 

URL for this Tool is : http://labs.google.com/gaudi 

There are many more Tools however These seemed Really Promising and Interesting given India as an Emerging Market Online. These Tools provide API so that Developers can develop Applications using these Tools. So,if next time you have a webpage that needs support for many Languages ,Simply using Google Translation API you have multilingual support without any extra Effort or Support Required. Just Reuse Google API's.

Now, there are few Ideas that I tinkered upon. But the Lack of Time and Experience is a big hinderance. Next Semester though, I might have a new Application Developed that would use these API's to the fullest.

So if I do get Time , you would see this Blog having Multi-Lingual Support for sure.. :) 

Do Comment about what Cool Products that you came across and do let me know if anyone is interested in developing Applications too.. 

Till then Enjoy Life.. 

Friday, January 16, 2009

Hazaaron Khawish Aisi ... v/s Slumdog Millionaire

Starts are often Misleading.. and the title of this one is no exception.. well it has nothing to do with the comparison between the 2 movies but the connection i felt with both of them .. the connection which i still have to decipher entirely though...

Hazaaron is one of the movies that i had seen a really long time ago ..way back during the first year and couldnt sit through the entire movie.. i found it dull and lame.. at that moment.. but then i was bored enough this time though to give it another try .. Hazaaron has a really good plot and you need a patient mind to get into the finer details that Sudhir Mishra has infused into it ..
The movie begins with the 3 College Students (Siddharth,Geeta and Vikram) in the midst of Rock & Roll Culture and the Volatile Situation in India... Siddharth, a true blue Communist wants to end the Social Unjustice in the country and wants the oppressed to fight out the Unjust and revolt against them .. while Geeta is in love with Siddharth and Vikram wants to find a way in while others are trying to find a way out .. wants to earn Big Money ... and doesnt care about the means...

Then the College Life ends and Siddharth migrates to some obscure village in Bihar .. trying to mobilise people while Vikram makes a big deal only to find out Geeta is married to an IAS Officer who has everything she needs. but then there is twist in the plot and she ends up being with Siddharth again ... and Vikram always has to pay the price for his love....
Finally though the ending is the most beautiful part wherein Vikram is still madly in love with Geeta even after being Brain Dead.. and Siddharth sheds off his Communist tag to pursue his ambitions to become a Doctor ..

There are brief moments in the movie that make you think and shudder .. The song Baawra is definitely the first of those and then When the 3 meet up near the River bank discussing their lives and Finally when Vikram is nearly killed by the Cops.

Now moving onto Slumdog Millionaire .. well for a start it has 3 central characters Latika , Jamal and his brother Salim. jamal is playing the show 'Who wants to be the Millionaire' and it always seems that the Show Host Anil Kapoor might run away from the show any time with the prize money given his Looks and the stubble.. though he resists his temptation to deliver a better performance... Every Question has some Story or a Reason for an Answer.. except for the last one which makes the Plot of the Story Questionable.. though .. At the end of the movie .. you tend to think what would have happened if he had guessed the Last Question wrongly.. though full credits to Boyle for depicting the Harsh Facts of Life without an iota of cynicism .. which makes the Entire movie experience enjoyable.. and also A R Rehman rocks with his Sound Track ..definitely worth the Golden Globe Prize..

The Connection isnt apparent though but The 3 Characters play a pivotal role.. in both the movies.. and both of them dont have any frills or unneccessary information ... and the plot is slow and smooth .. and there are many more reasons but i cant think of them now.. lets see.. if i can find them out or not...

Though after all this .. i somehow am reminded of Kukonoor's Teen Deewarien ..
and if you have watched all three of them . you would also be thinking on the sames lines.. ......
If you do feel there is some Connection Feel Free to post your Comments...

Sunday, January 11, 2009

LibTimeManager 1.0 : The Journey






Yes,Last Sem this was the most productive thing that was done by me.. with more of active help from Swapnil aka Nawab.. it was actually his idea that we take up this project. As the Name suggests the Stand Alone Application is for a Library which is being used to Monitor Activities of Employees and stores the corresponding records. At First it seemed really easy given the Customer Requirement Specification but then all Hell Broke Loose.. more so because i was quite inexperienced in implementation in Java that too with a GUI front end.
(as an afterthought even Text based Front end would have been really difficult to achieve..) .. so i took the task at hand.. with the work being cut out for each of us we began individually. Initial Stages were tough given that i had just started out with Java and OOP.Also the fact that everything from OOAD,DB Design,Implementation,Testing,Delivery everything had to be done by us.

So I took a book called HeadFirst Java and began with the basic Concepts but that was insufficient because the Gravity of the Project demanded better Implementation Skills and along the same time Class Diagrams,Use Case Diagrams and Database Design were being done.Everything was in a mess because the Design was changed everyday for atleast 4 days until our thought-process failed to find any faults. However the Customer Req.Spec Changed during that course and there were more changes to the Design that added more to the Complexity.

After nearly a week of BrainStorming,the Design was finalized and we began Implementing the Class Diagrams and Creating Tables in Database.
We however could find Faults during Implementation rather clearly which we missed because of lack of experience in Implementation . With more changes we had a rough GUI layout of all the Frames and Panels ready in 5-6 days.It was then we realized that GUI was the most Trivial part in the Application and it was the backend Computation that shouldnt fail for all cases. GUI work was almost done by Swapnil and i chipped in with Repetitive work of copying Code and then Modifying. It was at that point i realized the importance of Following Coding Standards and making the code readable .(I mean within a week of learning Java i could Implement a GUI panel :).. gr8 for a start).

We were almost 4 days from the Initial Deadline and almost most parts of the Application werent Functional.Now both of us were getting used to working together and reading each other codes (At the Last Stage of the Project this helped when both of us were mentally exhausted and we began coding together .. and it was like few lines were done by me and next few were done by him :P ). Most of BackEnd work were functional the day before the deadline but there were major flaws in the design as a whole which lead to major problems at this point of time.

I clearly remember the Night before the Deadline we were working minus our brains .. rather mechanically which is when we incorporated the WORST UNREADABLE and DUPLICATED code. The Deadline was though Extended. given the Inability of both of us and more so the inability of the Software to deliver the reqd specs .

Then we came back to College which is when the real Task began. In the Train however we had refined the code and Followed some naming Conventions that werent done earlier.
So with a much readable code base of about 2500 lines the work at coll began. Some Flaws in DB design and Class Diagrams were corrected and reflected in the Code. Then i guess we worked for 2 weeks on the stretch day in and day out working on the code set and adding new features and rectifying the earlier mistakes and quickly the code base grew to 8000 lines and more than 60 .java Files.However we knew each file inside out .. name of each variable and each method (which was a surprise :) though).

Finally the App was ready for Deployement 2 days after diwali .We had hardly worked for a month to roll out something that is after all a Practical Application and not that has something to do with Numbers,Bit Fiddling,String Manipulation for a change.

Then we began with our next assignment for QuizInc called QuizBuilder 1.0 which we worked upon in 5 days and came up with a manageable application. Though it was Beta Tested for a Quiz .. it turned out to be a damp squib.

Finally we rested for a few days after so much work and the End Semester Exams were nearing.After the Exams, we did Extensive Testing and tried to make the App Break and Stress out .. and fortunately or Unfortunately it did and we rectified each time until the software was finally tested OK.


The Application is now being used in the Library from 1st Jan 2009.. however we heard that there was some problems with the Firewalls or the Operating System.. we will soon Rectify that.. But as a whole the entire experience was an enriching one .. it enhanced my capability to think Logically and also improved my Implementation Skills tremendously.

I ll keep you updated till then Enjoy Life.

Wednesday, January 7, 2009

2009 is here but where is the NEWS

Where is the News

2008, the year that has ended, was very interesting in  terms of the news that the news channels had to offer. As an obsessed news channel viewer, I made a note of few things that never escaped the 'Always News Hungry -- News Channel's' Attention.

World Economic Slowdown and the  Recession 

 (3.5/5  : Hotness of the news )

This was one piece of Hot Cake for them. Everyday there were reports of people being served Pink Slips and then Banks and Investment Firms getting closed. I guess all the News overflow started with the Lehmann Bros Collapse. and the Company filing for Bankruptcy and then other scores of banks WorldWide showing Capital Scarcity. All this while in India... The Crude Prices were rising ... the Inflation Rate was Scoring better than our  College Topper's CGPA..  as news of Banks Collapses spread.. News Channels showed Reports of these Crisis affecting India.. though Position of India was sound in Domestic  Market .. the Investors Pressed Panic Button quite uneccesarily.. and all things turned upside down .. the Sensex & Nifty tumbling to new lows..  and the Dollar Price Appreciation .. and RBI cutting Repo Rates and CRR.. 

 Job Cuts,Layoffs and Pink Slips

(3/5  : Hotness of the news )


Well News Channels made these terms popular..  Employees all over India Suddenly turning more Efficient.. hehe .. and then Jet Airways issuing  Pink  Slip in Mumbai .. made the Fear a Near Reality .. however Management Succumbed to the Media Glare.. or Employee Demand or Political Intervention .... dunno wat? but the Sacked employees were Reinstated.. and enjoyed a very good Lunch at a Five Star Hotel.. i mean  the entire Episode somehow favoured the Employees..  and then there were reports of IT/ITes Cos.. cutting Bench Employees and UnderPerforming .. ones...  and there were unconfirmed Reports of Even MS removing around 10% of their employees..

 Raj Thackeray and his MNS 

(2/5  : Hotness of the news )


This made Headlines .. all over India.. and News Channels were more than happy to debate about this Topic...  Marathi Manoos versus the Bhaiyaas in Maharashtra.. the Chaat Puja and the Haat Puja.. and all of these ended when Gag orders were issued against Thackeray .. and he being sent  to Jail Multiple Times albeit for a few hours each time .
And the high point was the Dramatic Encounter of incidentally a person named Raj in a BEST Bus ..  who had  a motive  to kill Thackeray .. 

Mumbai Terror Attacks

(4/5  : Hotness of the news )

This Incident was an Unfortunate one .. for Media too.. even The Media was made to sign a Emergency Protocol Agreement . so that they didnt telecast Sensitive Information that could hamper the Combing Operations or the Bloody Images of the dead and the Injured.. 
Apart from the Media.. it did terrorise the people all over India .. exposing  to people that how vulernable they were to such Insane Attacks... 

The Attacks kept Mumbai under siege for more than 60 hours.. and around 200 people dead 
and more of them injured.. leading to the resignation of the 2 Patils and Deshmukh... and then our Finance Minister becoming the Home Minister.. and sending Terror Dosseirs to all Countries.. and India  launching a diplomatic Offensive and Pakistan resigning to Denial Mode..

Obama's Election Campaign

(  3/5 : Hotness of the news )
 Obama and the Change he Believed in campaign . sure made him the President of the United States of America.. but he is marred with more problems of late.. Recession .. Auto Companies .. Banks. On brink of Collapse..  Most US Cos Declaring a Negative Growth and Skewed Profit Margins.. Job Layoffs and Crumbling  Internal and  Foriegn Policies..  as well News Channels had reports of his GrandParents somewhere in Africa. .and him Holidaying in  Honolulu... which were quite Irrevelant ... 


As a review ..  News Channels.. didnt do their jobs well in 2008.. so it might be the Media .that may have Layoffs.. now :P .. and News Channels made Amir Ajmal Kasab.. the Lone Terrorist caught alive in Mumbai Terror Attacks .. gain More Coverage than Barack Hussein Obama.. 
Also there were 2 blasts in Guhawati (i could never get that spelling .. rite )  which were never reported in the manner it was to be ..  and then Minority Affairs Minister trying to get a  slice of Media Coverage.. by questioning the Death of The  Late ATS chief  Karkare.. and then Major Unnikrishnan's parents visit to NDA was telecasted live for no apparent Sane Reason .. Cash for Money Scam.. was in and out of News.. and So was the Indian Cricket Team..  and then Olympic Medals was some Respite..  Abhinav Bindra  got all the Attention while the Boxers were Confined to their rings ..  (there were more unreported news.. i couldnt think of them all.. )



All this for Some Money .. Honey... sure they would Register More Profits.. this year..
lets See if  in 2009  whether good Competitive Journalism  prevails  or the Plain Old Media Aggression /Sensationalisation that  does the job.. 

only Time will tell.. 


 Cheers ..

PS :
1) List of Bomb Blasts in India 

even that list doesnt have the Recent Guhawati one .. 

2) There are Many News Channels in India..
 even Wiki couldnt List them in a single Page..