Thursday, October 15, 2009

Real World Code


Well,This Post is about a Contest that is to start off from 19th October and ends on 25th October.The Contest is named "Real World Code" and rightly so since it would involve a Functional Specification or FS Provided and the Participants have to come up with the Code following all Processes and Standards so mentioned in the FS.

The Coolest part is that you get to work on FS Developed and designed by SDE's who themselves work as per the same standards following the processes.Not to forget about the Prize Money .. 5 Grands up for grabs.. so Hurry up and Participate.


PS: Contest is open only to students of my College.Do register in the Mail-Id provided with the Poster Image.

Thursday, July 23, 2009

Life is like Recursion

Spoiler Alert: This Post is a tad philosophical and uses a concept called Recursion which is a pre-requisite.

Well,let me tell you something, i feel completely randomized when i start off with some work,slowly the randomization increases just as the entropy of a system goes on increasing, till a certain point after which mostly,things start falling into place.Voila, it then clicked to me that Life is like Recursion you start off with many number of recursive calls and don't know what you will end up with,but still you work up all the possible steps but then finally something clicks aka the base case and then things start getting standardized instead of being randomized and then the steps that you thought were straying you off path were in fact leading to bigger things in life.

And the thought doesn't end there, smart people memoize the recursive calls i.e they tend to learn from their mistakes so the next time you take the call,you know the consequences exactly but then there are also people who try to re-invent the wheel and end up having lot of over heads in life not that they fail or jump off the well but then they take their own sweet time to get there or may be never.

There are various schools of thought over this topic and this Post is just a represenation of my thoughts which in no means is meant to influence any of the mortals.

PS : 1) Try Searching "Recursion" @ Google, that page is recursive as well, click on did you mean and then you would know.
2) Witty Line : How does M$ make saints out of Morons? Reply :What are the stats of the conversion Ratio ,must be way better than ours?
3) The Above PS was meant for a specific group/individual.If you don't get the joke, then well, it was intended to be so.

Saturday, July 11, 2009

Notes@Work

Here at work, I never shut down my system since there is something or other that is pending and so the stats are :
"System Up Time: 20 Days, 4 Hours, 54 Minutes, 52 Seconds"

I move my desktop physically a lot hence just 20 days; now that I have found a decent location which is stable.I expect this to be around 40 days till the end of this month.

Sticky Notes do "stick" well. Around 2 months and it is still there on the wall very unlike the one's I had tried to simulate back in college.

Pool.. still pathetic at it, trying to improve but then that will take time and don't expect any Pankaj Advani type play from me though. (I have set highest standards in terms of being a true mediocre).


As a Final Note, @All Final Year's : Final Year here we come.Every year I don't wait for the academic year to start. It seems there is something with 4, maybe all are expecting some kind of a LEAP  :) .


PS:
1) No comments on weekends and rightly so,since i am at work all 7 days a week for last 1.5 months.
2) Too much Final in the Last Para.. what do you think?

Tuesday, July 7, 2009

Witty Kid @ Office

Posting after really long time but this one is a must share.

During a Recent HR Event by my Company which was themed around "Bring your Child to Work Day".

A small kid probably around 4-5 years of age was interacting with all his Father's Directs..(his Dad is a People's Manager with a team of around 6-7 Members) then suddenly one of them questions the kid "what does Dad do at work?".

Kid Replies,"Dad... takes the Lunch Box and Laptop.. then reads mails,attends meetings then goes to lunch with other members and comes back.. "

PS
1)My Verdict : "Yeah I am Loving It!!!!!!! Fun to be a Manager it seems :D.".
2) Kid gave the 101 on Being a Good Manager..

Wednesday, June 17, 2009

Fun Questions

I found this Interesting Questionaire in some blog. I felt I should try answering them too.

1. When you looked at yourself in the mirror today, what was the first thing you thought?
Buck up lazy fella .. loads of work pending ;)

2. How much cash do you have in your wallet right now?
Around 394 odd Rupees.

3. What’s a word that rhymes with DOOR?
More,Bangalore,Floor...

4. Who is the 4th person on your missed call list on your cell phone?
Abhinav Krishnamoorthy.

5. What is your favorite ring tone on your phone?
Always on Silent 24X7.

6. What are you wearing right now?
Jeans and T-shirt.

7. Do you label yourself?
No.I have left that for others ;)

8. Name the brand of the shoes you’re currently own?
Sparx (hardly wear it),Sandals Unbranded.

9.Bright or Dark Room?
Bright.

10. What do you think about the person who took this survey before you?
SOB .. didnot tag me :(

11. What does your watch look like?
I don't wear one..

12. What were you doing at midnight last night?
Slept..

13. What did your last text message you received on your cell say?
Airtel AV-Promo Message cannot be displayed

14. What's a word that you say a lot?
I want to Head AS* (Internal Confidential)

15. Who told you he/she loved you last?(please exclude spouse , family, children)
No one since Everybody decides that I am selfish after a while.

16. Last furry thing you touched?
Some Furry Toy on Bring your Child to Work Day @ Office.

17. Favourite age you have been so far?
Present.

18. What was the last thing you said to someone before doing this?
I will send across the details to him and CC you as well.

19.The last song you listened to?
Ana Free : Its Time && Nickelback : Rockstar

20. Where did you live in 1987?
No Idea

21. Are you jealous of anyone?
No one in Particular.

22. Is anyone jealous of you?
I feel so since they so want me dead :P

23. Name three things that you have on you at all times?
Mobile Phone,Wallet and a Pen.(Most of the times).

24. What’s your favourite town/city?
Mumbai.

25. When was the last time you wrote a letter to someone on paper and mailed it?
For some Freakin' Contest 12 years back.

26. Can you change the oil on a car?
No.

27. Your first love/big crush: what is the last thing you heard about him/her?
"Dude.. Change your Desktop. She looks Pathetic each passing day "

28. Does anything hurt on your body right now?
My Hands... I have been typing for a long time since Morning.

29.What is your current desktop picture?
Windows v/s Walls !!! :D

30. Have you been burnt by love?
No.


PS: I tag Ankit Prabhat,Roshan Singh and all other bloggers from my College.

Sunday, May 17, 2009

Department Results

Well, The Results for the Sixth Semester were declared and it has always been a practice for me to sort the results.
So,Here I am again. This Time I am sharing the Code so that People don't think I manually sort them ;).Also, I would like to congratulate all the dept guys/gals who have excelled as always and awaiting a cool Final Year ahead.





#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct stud
{
double cgpa;
double sgpa;
int roll;
};
struct sorter
{
bool operator () (const struct stud a, const struct stud b)
{
return a.cgpa>b.cgpa;
}
};
int main()
{
vectorvec;
ofstream out("res.txt");
ifstream in("in.txt");
struct stud a;
while(in>> a.roll >> a.sgpa >> a.cgpa)
vec.push_back(a);
sort(vec.begin(),vec.end(),sorter());
out<< "Roll\tSGPA\tCGPA\n" ;
for(int i=0;i<vec.size();i++){
out << vec[i].roll << "\t" << vec[i].sgpa << "\t" << vec[i].cgpa << endl;
}
out.close();
in.close();
return 0;
}


This Requires an Input File of the form :: Roll\tSGPA\tCGPA
and Output has the same Format which can be changed as well.

I would be coming out with more of code snippets.Till then Enjoy Life.

PS:

The Actual Cpp File is available at this Link :: Here
The Output File::

Roll SGPA CGPA
48 9.12 9.27
61 9.36 9.26
60 9.12 9.09
39 9.36 9.08
26 9.16 8.95
62 9.36 8.89
16 9.28 8.89
2 9.04 8.85
28 9.04 8.81
30 9.36 8.81
46 8.6 8.77
7 8.76 8.67
53 8.52 8.58
37 8.36 8.55
42 9 8.48
3 8.2 8.43
25 8.52 8.42
50 8.6 8.33
10 8.64 8.3
52 8.44 8.23
27 7.84 8.22
14 8.68 8.22
59 8.6 8.21
5 8.84 8.19
43 8.76 8.19
34 8.04 8.18
33 8.2 8.15
11 8.2 8.05
31 7.84 8.05
6 8.36 8.01
23 8.2 7.99
38 7.56 7.99
55 7.84 7.87
9 8.04 7.85
17 7.52 7.8
49 7.52 7.77
35 7.84 7.66
21 7.8 7.61
41 7.52 7.59
63 7.08 7.58
36 7.24 7.52
8 7.24 7.39
40 7.8 7.39
45 7.88 7.37
19 7.4 7.31
51 7.68 7.28
56 6.76 7.28
1 7.32 7.26
24 6.84 7.16
20 7 7.06
18 6.92 7.04
44 7.24 7.01
15 7.36 6.82
54 6.32 6.81
32 6.44 6.75
64 6.96 6.73
13 6.04 6.63
57 6.52 6.59
22 6 6.45
29 6.36 6.37
58 5.44 6.13
12 4.96 6.12
4 0 0
47 0 0

Saturday, April 25, 2009

Anagram Solver

First Things First : I am worse at solving Anagrams but a little bit better at writing a Code for solving them :D .

This Post is about a Code that I wrote for solving Anagrams.It all started with this bot friend in my friend list : games@gtalkbots.com.It is a bot that allows users to play anagram with other users.

I was(rather am) really pathetic at solving anagrams instantaneously.Instead of sulking, I thought I must do something about it. I could win each round if I could get an answer within 0.1 secs. (My own Heuristic).

So,The Best way is to write a C++ Code for the same.Then,after little brain storming (random thoughts actually), I just needed a Dictionary and a Data Structure to store it. Since Hashing was out of question for a Quick-Code,STL Set was the second Best with Insertion /Look up of Asymptotic Upper Bound of O(log(n)).So, I just had to check all Permutations of the Random String and look up the Dictionary and if Match is found then Output the Result.

Within first 2 results for Dictionary in Google, I found a US Dictionary List in txt format.
So, The C++ Code for the same ::


#include<iostream>
#include<string>
#include<cstdlib>
#include<set>
#include<fstream>
using namespace std;

// This is a Set that Stores the Dictionary Values.

set<string>s;

/*
* This Method is used to check whether the String matches the given Mask.
* Example : srinivas --i-i--s
*/

bool check(string a, string b) {
for (int i = 0; i < a.size(); i++)
if (isalpha(a[i]) && isalpha(b[i]) && a[i] != b[i])
return false;
return true;
}

/*
* This Method is used to find all Permutations of the String
*/

void perm(string pre, string suff) {

if (!suff.size())
cout << (s.find(pre) != s.end() ? pre + '\n' : "");
else
for (int i = 0; i < suff.size(); i++) {
perm(pre + suff[i], suff.substr(0, i) + suff.substr(i + 1, suff.size()));
}
}

int main() {

s.clear();
string a;
ifstream in;
in.open("US.dic");
while (in >> a)
s.insert(a);
in.close();
cout << s.size() << endl;
while (cin >> a) {
perm("", a);
cout << "----------------------\n";
}
return 0;
}



But then as Luck would have it, The Bot went offline after I wrote the Code. I guess both of them are somehow related. But then Next Time I find the bot online,you wouldn't wonder if you find my name as one of the Top-Scorer's.

Cheers!!!
Do Comment/Post about it.