Life Of Navin

Random Musings, Random Bullshit.

kc

My Examtime Online Presence [Infographic]

1. Join every site known to netkind 2. Become active on all of them 3. ??? 4. Profit!!!Give a person a fish and you feed them for a day; teach that person to use the Internet and they won't bother you for weeks.  - Anonymous 

10 things I Learnt As General Secretary

My first impression of a General Secretary

My earliest memories of college are of this guy named Shakir Usman, the General Secretary of the college students' body talking at the Freshers' Day function (2nd week of my college life), and from that moment, I've wanted to be involved in college politics. I'd be lying if I said he didn't play a part in me wanting to become part of "the system" somewhere down the line.

Over the last year, I was the General Secretary of the Computer Students' Organisation (CURSOR), the students' body of the Computer Engineering Dept. of my college. Last Thursday, I handed over charge to a new set of bright juniors, and I have complete confidence (knowing many of them personally) that they'll take CURSOR to new heights! :)

This is NOT a blogpost praising what we've done or to put someone else down. I'm sort of against tooting my own horn. This is a blogpost that (I hope) every Students' Council member, irrespective of college/branch can relate to. And I hope juniors get a fair idea of what expect as part of the Students' Body, when the time comes for them to take charge. These are 10 things I learnt through my year as General Secretary at CURSOR
  1. There's Nothing (And No One) To Fear
    One major reason that I've heard people give for not indulging in college politics is the associated "fear factor" with it. Teachers will hate me because I'm in the Students' Council (I have no idea where this rumour started from), People from class will hate me (Some maybe, at first, but if you're effective, it won't last for long), My girlfriend will hate me (Really? How insecure are you?). For us, there was this certain teacher whom everyone feared, for god knows what reason. She's hyper, a little mad, crazily eccentric, but then again aren't we all? :P You have to realise, everyone's human! It's just about getting that person's soft spot! Be a newborn child.... Have no fear, no preconceptions about people, or about "the system" as a whole.
  2. Dream Big
    The reason why most students' councils end up being dull issues are because of people too afraid to dream big. Don't always be serious. Don't be practical. Dream BIG. What's the worst that can happen? A plan that doesn't take off? A plan that falls plop on it's faces? I know this'll sound really cheesy, but starting off is winning half the battle!
  3. Think First, Talk Later
    When you're in  a Students' Council, especially in a executive post, your opinion is many times considered the opinion of your class, or (in worse cases) of your branch. While this is good in some cases, there are times where your personal opinions are misinterpreted as opinion of the masses. And sometimes, these opinions come back to bite you on your bum. Having personally experienced this, I learnt my lesson...
  4. Get Your Hands Dirty
    This is something that I'm sure people have heard about in the past. Students' Council is basically politics, a dirty game, with many underhanded tactics and people without any morals. I won't lie. This is partially true. As part of your work, you'll have to work with many types of people, come up with everything ranging from barters to straight out blackmail to get things done, consider various options ranging from ethical to unethical. I personally tried my best not to work unethically, and the worst I went to was a gray area! Just know that whatever you decide, have the guts to follow through!
  5. Nothing Is Easy
    People who've never been in any student body think it's really easy to be in a council. I even heard stuff like "It's a license to bunk" or "Dude, it's just timepass". This may be true if your plan is to just cruise along the year. However, if you want to get any sort of change or make an impact, you have to realise that nothing is easy! The college hierarchy is NOT made to aid change, and while some things will be logically tasking, others will be time hogs, while others will be emotionally tasking (Read No. 7)
  6. Credit is NEVER yours.... Unless something goes wrong!
    This applies to the whole council, and more so to the General Secretary. When something goes right, irrespective of the actual contributors, the achievement is of the class (and branch), but if something goes wrong, it's directly blamed on the Council (and the General Secretary specifically). I personally believe in the "Never Blame Anyone Else" philosophy, something that I learnt from one of my personal heroes, and have always tried to step up and take the blame for the team's mistakes (whenever possible). Nobody's perfect!
  7. The Team ALWAYS Comes First
    My Team! :)
    Like I mentioned before, people outside the council simply cannot understand how or why a student body works, and as such the remaining members of the council become nothing less than your family. These will be the few people who'll understand exactly what you're going through, and how to help.Keeping secrets is part of your job profile, but thankfully, you can share most of those secrets with these people. I was glad to have superawesome people like Rohan Hodarkar (as Treasurer), Anamay Tengse (as Technical Secretary) and Pranali Naik (as TE Executive), who were always there to share the load! It's only because of the way that we gelled together that we managed to do so much through the year, and pull off GEC's biggest technical festival in recent years: Technix 5.0
  8.  Help comes from the least expected places
    Yes, it happens! I've had help coming in from teachers who've traditionally hated me, people with whom I've never really gotten along with, people who you didn't think could help (eg. security, sweepers, electricians), random people (literally, people who heard we're in a sticky situation and came forward to help), etc. In fact, in many cases, your "contacts" which are lower in the "presumed" hierarchy tend to get stuff done faster than the bureaucratic upper hierarchy. Trust me, never ever close a door.... keep everything half open! Because you never know which door will be pushed open in your time of need!
  9. Shit Happens...
    One of the most important things you have to learn: Shit happens... Quite a bit in fact. Our dear Mr. Murphy plays his part in full and stuff starts going haywire. But it's all about keeping stuff within your control. Never write plans in stone! Plans often change at the last moment for a variety of reasons, but you cannot, I repeat, cannot put your hands up in the air and give up, or get all hyper about it. Expect things to go wrong. Terribly wrong. Heck, I even considered the probability of a hurricane happening on the day of an event! :P Still sometimes stuff won't go the way it's planned. Don't take things to heart.... Unless you accept your failures, you're not fit to even think about your successes!  
  10. but EPIC EPIC AWESOMENESS Happens more often!
    At the end of the day though, you end up having an EPIC time as part of a Students' Body. You'll make friends for life (isn't that the whole point of college?), you'll learn to take responsibility for your actions, you'll learn the value of money (I'm sure Rohan will grin if he reads this! :P), you'll live life on the edge (and off it at times), you'll mess around in everything ranging from politics to administration to plain out marofying. You'll see the best in people, you'll see the worst in people. Some people will trust you with their confidence, others with their bullshit. Everything you say or do seems more professional because it's coming from a person in a post of power. Respect will have to be earned, but once it's earned, it stays! Crazy incidents will happen, both behind and in front of the scenes. You'll laugh, you'll cry, you'll hurl insults, you'll beg, you'll scream, and most importantly, you'll live! 
How very true...
Long story short, being General Secretary of CURSOR was one of the best experiences of my life. It was an absolute honour to lead Team CURSOR through the year, and stay at the helm of affair. All those closed door meetings with teachers, all those maddeningly frustrating arguments, all those crazy experiences will remain with me till the moment I die (and probably even beyond). It was truly a superb experience to work with some of the brightest minds in Goa, and do so much! :)

An(n)atomy Of College Priorities!

You're either with me or you (probably) support an alternative version of the LokPal bill which automatically makes you an immoral anarchist governmental pig hell bent upon destroying the integrity of this great country. Also, you most probably can't get laid in a women's prison with a handful of pardons.Humko azadi aadhi raat ko mili thi aur savera aaj tak nahi hua.. -Shabana Azmi (on Twitter)

LEX and YACC on Windows

We've just started compiler design as part of the Language Translators subject at college and a practical aspect of it involves using LEX and YACC for Grammar Lexical Analysis and Parser Generation. Since LEX and YACC are both originally developed for the *nix OSes (read: Linux), there was a sudden rush of classmates downloading linux distros (Fedora being the default choice as it's used on lab systems). In many cases, people actually downloaded entire distro DVDs just for LEX/YACC!

NOTE: When people say they use LEX and YACC, almost always, what they mean is FLEX (Which is an alternative to Lex) and BISON (which is part of the GNU project) /BYACC respectively.

Sticking with the "When in doubt, try another hole" philosophy, I just googled around a little and came up with a much easier solution.


Here's how to set up FLEX and BISON on Windows systems

1) Download the Windows version of FLEX
Link2) Download the Windows version of BISON
3) Download a C/C++ Compiler (If you say TurboC, I'll reach out through the monitor and thump your head)... I recommend DevCPP or Code::Blocks
4) Install all 3. It's recommended to install in folders WITHOUT spaces in their names. I use 'C:\GNUWin32' for FLEX and BISON and 'C:\CodeBlocks' for Code::Blocks
5) Now add the BIN folders of both folders into your PATH variable. Incase you don't know how to go about this, see how to do it on Windows XP ,Windows Vista and Windows 7. You will have to add ';C:\GNUWin32\bin;C:\CodeBlocks\bin' to the end of your PATH
6) Open up a CMD prompt and type in the following

C:\flex --version
flex version 2.5.4

C:\>bison --version
bison (GNU Bison) 2.4.1
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\>gcc --version
gcc (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you do not get the output as above, restart your system and try again.

That's it! You now have a Bison and Flex set up! Now for some coding! :)

Create a Lex file, let's say "exp.l" and open it up in your favorite text editor (read: Notepad++)


%{
#include
#include "y.tab.h"
%}

%%
[0-9]*[02468]"\n" { return EVEN; }
[0-9]*[13579]"\n" { return ODD; }
%%
int main(void)
{
yyparse();
return 0;
}

int yywrap(void)
{
return 0;
}

int yyerror(void)
{
printf("Error\n");
exit(1);
}


Similarly create a YACC file as well, say "exp.y" and edit it as follows


%token EVEN ODD

%%

input:
EVEN { printf("EVEN NUMBER\n"); return 0; }
|ODD { printf("ODD NUMBER\n"); return 0; }
;


Now in the CMD prompt, navigate to the folder where the exp.l and exp.y files are and run the following commands:

C:\LT\example>flex exp.l

C:\LT\example>bison -dy exp.y

C:\LT\example>gcc lex.yy.c y.tab.c


At each step, assuming all is well, you won't get any output. Note that the final step compiles the C files generated by FLEX and BISON. And generates a executable named a.exe (To use a different name, change last command to "gcc lex.yy.c y.tab.c -o nameofexecutable.exe" )

C:\LT\example>a.exe
666
EVEN NUMBER
C:\LT\example>a.exe
667
ODD NUMBER


Now just run the program (through the command prompt itself). For and even number input, it prints out "EVEN NUMBER" and exits and "ODD NUMBER" is printed for odd numbers. A simple example, but I guess it gets the point through!

Enjoy! :)

PS The GnuWin project is a superawesome project which "provides ports of tools with a GNU or similar open source license, to Windows". The number of packages that they've ported to Windows is amazing. Do check it out.



PPS Yes, I'm a FOSS/Linux enthusiast, but that doesn't mean I have to praise Linux all day long! Projects like GNUWin, which take code to the masses, are nothing short of brilliant! Linux distributions have so many advantages over Windows for any real developer, but I honestly believe every developer has the right to "choose" his/her development OS and environment, be it PC, Linux or Mac. Do try out Linux distros as well (infact, I'd highly recommend you try a few before deciding which suits you best! Most distros are free!), but don't get dragged down by an environment! An OS is simply a tool to enable you, the developer, to work your magic! :)

Update: Here's a Zip file of FLEX, BISON and the Source Code used in this post.

Prologue

Finally after all these years, here's to the beginning of what was there, what is there and hopefully what will remain!! So here are my thoughts & words -Online!!

Blog Archive