Wednesday, July 06, 2005

50 cent - trickster or lyrical genius?

Disclaimers:
  1. This is yet another article written by a bewildered desi on the subject of urban/hip-hop culture in America.
  2. The article itself was thawed from cold storage, after I noticed the blog was dying. So, don't expect the usual high quality you have come to expect from this blog. Okay, now you know which way the rest of this post is going...

If you think 50 Cent is a certain amount of currency, or if you think that "In Da Club" is bad spelling for In The Club, then you are possibly a hermit crab living under an impossibly large rock.

50 Cent was my rather brisk initiation into the world of hip-hop and gangsta rap. The no-nonsense, in-your-face lyrics (e.g., Sir Mix-A-Lot happily proclaiming "I like big butts", and 50 Cent crooning "I'm just a squirrel lookin' for a slut with a nice butt, to get a nut") are a refreshing change from the sappy, unlikely ballads of other genres. That is, if you can make out the lyrics. These guys keep it real. And 50 Cent is, in my opinion, the most artful exponent of this genre. Okay, may be Snoop "Doggy" Dogg is up there too, but this sort of thing is exactly what feeds the East Coast vs. West Coast rivalry. Gangsta rappers are also the cowboys of our times, who shoot each other not with guns (well, okay... not only with guns), but with stinging lyrics. Recording studios like Aftermath (Dr Dre's creation), Death Row etc. play the part of dusty alleyways. At the end of the day, a handsome paycheck awaits, too.

So, there I was, quietly enjoying my 50 Cent records, when I came across this Slate article. According to the article, 50 Cent is just a wily, scheming thug from Queens, NY, who is not especially good at rapping. Well then, how come 50 Cent is the biggest name in the manically cut-throat hip-hop world today? The article's argument: clever marketing, staged feuds (most prominently with the artist currently known as The Game), and the mystique of the "I got shot 9 times and I survived. Bitch!" routine. I beg to differ. Anyone with half a brain can make out that 50 (pronounced fi-tee) is a gifted rapper, by doing as I did: listening to Get Rich or Die Tryin', 50's platinum album, all day, for a couple weeks.

You gotta try it. 50 Cent has an inimitable style of delivering his lines with a combination of restraint and ease. It's as if he hardly opens his mouth, yet the lyrics keep coming smooth. This style is nowhere as effective as on my personal favorite, 21 Questions. If the haunting synth doesn't plant itself in your brain after a while, then the absolutely addictive beats of In Da Club will. Now, I can't wait to drop my shit, and go ghetto. 50 has given me a whole new outlook about life, where basically three things matter: guns, bitches and drugs. Wait, how could I forget: bling. If you wanna roll like a gangsta, you gotta have them spinning, flashy rims on your wheels, yo.

While the genre is still young, and is a little rough at the edges, there is no doubt in my mind that gangsta rap is the way to go. It should be played on PA systems in schools. Students will learn invaluable lessons in keepin' it real, fo' sho'. If you can't see that, you a wanksta. If you can, you in da hood, homie.

Friday, June 17, 2005

Hiking - useful hints

I recently hiked Mt Washington in New Hampshire. Mt Washington, apparently, is the tallest peak in the Northeast. It was my first backpacking trip, and a great one at that! I will leave out a description of the two day hike of the mountain and the surrounding wilderness for another time. For now, I will try and list a bunch of useful things to do and take with you if you are planning something similar, and you are new to it. I was lucky in that on my first hike, we had one very experienced hiker, who has hiked 8 National parks, and dozens of State parks. Quite frankly, he saved our asses on this hike.

If you want your hiking experience to be Good, then you need to plan for it: travel light, travel right. Don't lug unnecessary shit along in your backpack. When all you do for hours is plod on some rocky trail in the bush, you will be thankful for every little thing you left behind, that made your pack lighter. But that doesn't mean you leave your toothbrush behind (hmm... may be you could). For instance, if the forecast says there's a chance of rain where you are planning to hike, you should probably take your raincoat along.
I will leave out some of the obvious things that one should pack on a hike. A simple Google search for hiking resources will give you quite some information. The ones below might also be obvious (so sue me), but they are also for my future reference:

  • Maps: Get a map of the trail and the surrounding wilderness. Your chances of getting lost decrease dramatically with a map in hand. You will also need a compass. Now, if you can't figure out how to use a compass and a map, then you probably deserve to get lost.

  • Trash bags: They are light, and they can be variously useful. If it rains, you can cover your backpacks beneath a couple of trash bags. You could cover yourself too. There's always the option of using it as a trash bag.

  • Ziploc bags: Get at least a dozen of these babies, with the zips at the end. Pack your hummus mix, powdered milk mix, orange juice mix, folded clothes even, in them. Your shit will stay dry, and everything will be okay!

  • Torches/Flashlights: Try and get yourself a headlamp instead. It'll free your hands.

  • Food, and food mixes: Oatmeal packets for breakfast, orange juice concentrate (mix water), hot chocolate mix, hummus mix, dried fruits and nuts, cous-cous mix (just boil it in water, and see it grow enough to fill your appetite), pasta sauce, cheese, and pita bread should do ya. Don't get squishy stuff like bananas, or crumbly stuff like cookies, if you don't want a mess on your hands.

  • A water pump: for pumping and filtering water from a fresh water source.

  • Stove: a small, portable stove, which is basically a burner on three stands. A canister of gas (that's gasoline/petrol for the rest of the world) as fuel for the stove. We filled ours at a gas station on the way. Be careful with packing and stowing the gas in your pack.

  • Oh, speaking of food and cooking, on what would you eat your food? China plates, and forks ? Ha! Fat chance... Get yourself some of those tupperware plastic boxes, and pack just one spoon for each hiker. Eat out of those boxes for lunch, breakfast and dinner. Lick it clean as a substitute for washing. Waste nothing.

  • Toilet paper: Unless you are an expert with dry leaves, or if you mind not taking a crap at all. And please stay away from any water source while you are at it.

There, as you can see, hiking is not a joke. But if you do your homework, you can have a wonderful time out. I will probably add to this post with time, as I think of more things to add.

Saturday, May 14, 2005

Triumph, Star Wars and Hotlines

I should make it clear first off that I have never watched any of the Star Wars movies (gasps! from the audience). May be parts of it, somewhere, some time. And in a perfect world, I wouldn't. But one of my new roommates is a fanboy. A big one. And he has the collector's edition of all the movies. And we have a projection system home theater in the apartment. So, I am probably going to watch it soon. But its pervasion into popular culture is so complete that indirectly, I know roughly what happens in the movie, and half the characters already. At the time it was released, it was probably truly the shit. But as is the fate of almost every good idea that works, its creators juiced it for all its worth, and then some more, so by the time so-called Episode I hit the screens... it was stale.

Anyway, the new Star Wars movie - Episode III - is out soon, and being the pop-culture whore that I am (or, turning into), I felt I should comment. For one thing, it is nauseating to see the associated commercialization. I was browsing through the cereals section in the grocery store, and I saw a Whole-Grain crispies box with a picture of that pussy, Hayden Christensen, standing with a lightsaber in hand. What the fuck has a Jedi Knight to do with a bowl of cold cereal anyway? Everything from poop paper to cars comes in a Star Wars edition now. Disgusting.

George Lucas stands to make millions from the mindless devotion of countless fanboys who will jump, like hungry dogs at meat, at any merchandise that smells even remotely of Star Wars. Conveniently enough, Episode III is getting `positive' reviews from everywhere.

Then we have them geeks. I don't think I can express in any novel way the sorry state of the legions of losers that call themselves Star Wars fanboys, than has already been done. But I think there is one particular downsizing that was inflicted on them, that I should share with you. Have you ever watched Triumph the insult dog in action? If you haven't, stop whatever you are doing in your meaningless life, and go watch some videos of Triumph in action. Okay, now that you are enlightened in the ways of Triumph, let's come back to the issue at hand. Some geeks were standing just outside some theater, waiting for Episode II to begin (2002, I think?). Who should appear at the scene, but Triumph! What followed was hilarity itself. I have linked some video goodness for your benefit. But if you are too lazy to watch that video, here's a sample from the transcript:

[Triumph approaches a geek standing in line. A female geek. And a pregnant one at that.]
Triumph (T): So, that is a future geek waiting to be born... eh?
Pregnant Female Geek (PFG): Yeah, yeah! That is a future jedi knight in there!
T: Oh, great. So, when is he due?
PFG: Umm... I think - June 27th.
T (barely containing his laughter): Oh, really? So, that is the last day that boy will see female genitalia.

Truly, the video is a keeper.

Wait, I have more to say. And not all of it is good news (at least, not for me).

1-800-441-4000. Looks like just another 1-800 number, right? No. Try it. I opened a bank account at Bank of America recently. I ran into the bank one evening just after it closed, as I wanted to know my account balance. The guy at the counter told me it was closed, but helpfully enough, he offered me the hot-line number for customer service at Bank of America. Yes, it was 1-800-441-4000. Cryptically, he added, "Satisfaction guaranteed", and closed the bank. I did not have my mobile phone on me at the time. When I did call the number later, I did reach a hot-line. Only, it wasn't no hot-line to any bank. You know what I'm saying? Boy, did I get suckered by that bank guy! I haven't seen him at work in that bank since.

My new toy, BlogPoster, isn't going nowhere. I am busy learning the ropes at work, and I am spending weekends hauling shit between Providence and Boston, so I haven't had the time to sit down. Hopefully, I'll get back to it soon.

Coming soon: how Arthur C Clarke and Isaac Asimov wrote some stinking bullshit disguised as science-fiction.

Tuesday, April 26, 2005

The bull is in your court!


The bull is in your court!, originally uploaded by shashankr.

So, this herd of buffalo ran wild on a highway somewhere! They were finally contained into a tennis court. As for me, I say "huzzah!"

Sunday, April 24, 2005

BlogPoster is born (barely!)

As you can see, the previous post is a test post from an OS X application that I am developing. Its called BlogPoster, and it will allow you to post to your weblog from your favorite mac, without actually opening the weblog service in a browser. I know, I know -- applications like these are retro, and they are a dime-a-dozen. But I am writing it to mainly hone my developing skills in Cocoa, Python, pyobjc, and to gain more familiarity with XML.

Interface Builder is an OS X application that lets you create Cocoa/Carbon based GUI applications quickly and intelligently. It also defines skeleton classes that capture the interaction between the various GUI compnents, leaving the user to flesh out the classes for functionality. It is especially suited for applications that follow the Model-View-Controller (MVC) design pattern.

Python, as you might know, is the most kick-ass scripting/object-oriented/whatever language ever. Python rocks! Objective-C is an extended C, with, as the name implies, object oriented features. pyobjc is an extension of python that allows a developer to combine the features provided by both Python and Objective-C. Since its an extension of python, the syntax of pyobjc resembles that of Python.

BlogPoster is still in its infancy - I spent 6 hours reading others' code (isn't that the best way to learn?), and 2 hours writing my own - about a 100 lines of python code. So, the only blog to which posts can be uploaded is mine :) I want to make it complete, by adding the following features (in order of priority):

  • HTML Editing
  • HTML preview
  • Image upload
  • Support for all blogging services that provide an XML-RPC based API for developers


Screenshots, and source code will be posted (via BlogPoster :) ), once the project is in a respectable state. Not too many people are mac users, leave alone being mac hackers, but people - if you are not at least one of these, you are missing out on something sweet.
test from BlogPoster
hello, world

Thursday, April 07, 2005

Yahoo! vs Google

A friend and I were comparing Google and Yahoo! He loves Yahoo! and hates Google. He loves Yahoo! because it has a comprehensive suite of web-services, and comes up with pioneering revenue-generating ideas. He hates Google because the guys there act like they are "the saviors of technology", and because they front crap like "We are in it because we love technology", while "they are actually in it for money" (which, by the way, they are making tons of).

As for me, I hate Yahoo! and love Google. For pretty much the same reasons he hates them. Let me clarify: Sure, Y! has a suite of websites, but have you used them? They are stinking piles of shit. Y! Maps has been around for ages, and its probably the clunkiest web software around. Have you seen their homepage? Even after a (much-hyped) redesign, their homepage is cluttered with ads, and with no clear focus. And let's not even get into My Yahoo!

I believe that it is important to get things working. I concede that Yahoo! does that. But then, they sit on their asses doing nothing to improve things that are working. Especially when there is trememdous potential to do so. This is the very reason Google could enter and dominate the web search market that was once Yahoo!'s domain. There is no point in being a pioneer if you don't continually strive towards improvement.

As a Mac user, another thing that greatly ticks me off about Y!'s development culture is their absolute contempt, and lack of support, for non-Windows environments. It may be true that setting teams of people to work on developing software for the Mac might not reflect in financial returns, but then, why even bother? Their website features a half-assed Y! messenger client for the Mac that doesn't even anti-alias fonts, leave alone supporting audio/video. I would actually be willing to pay them for a decent OS X client.

I don't need to sing praises about Google here, since Slashdot already does that for me. But I do believe most of that praise is warranted. Have you looked at how prolific they are? My point is that it is not beyond most tech companies to do good stuff (Yes, even Microsoft). They just need to have the right mindset.

Any way, this whole rant was finally written because of my frustration using Yahoo! messenger for the Mac. So, I am thinking of writing a third party client for Yahoo! messenger that addresses all my frustrations. Yes, I want to go all the way, and provide audio/video support. I am not brave enough to write code from scratch. But it is going to be a challenge to even reuse components. Any way, in the meanwhile, I will start migrating away from everything Yahoo!, so that if I don't get around to developing my client, I can still survive.

Apple iChat, here I come.

Tuesday, March 29, 2005

Oldboy: Wierd-ass movie

Go watch this oddball movie, if you haven't already. If for no other reason than that you get to see a live octopus eaten. Also, almost randomly, there was an allusion to the 1999 wierdo-cult hit Being John Malkovich: A character mentions his discreet "7.5" floor business, where the anonymity of clients is top-priority. If you have seen BJM, you will recall that the porthole is in an office which is on floor 7.5. I was just wondering if 7.5 is standard nomenclature for discreet businesses, or if this was a deliberate reference to the other movie.

Monday, March 28, 2005

Addendum: More Questions

Random Walk (on-site)

  • Node is an element of a linked list of integers. Define Node, and implement the function:
    Node *addToEnd( Node *list, int val ).
  • In my implementation of addToNode(), I separately handled the case when the list is NULL. I was asked to improve the implementation to merge handling both cases. Hint: Use a Node ** variable.

Thursday, March 24, 2005

Technical interview questions

Here's a list of questions I was asked over the last two months, in the course of my job search. No solutions, nor a comment on the quality of questions, will be provided. So, don't bother asking.

Microsoft (on campus):

  • Reverse a linked list.
  • Given an array (positive and negative integers), find the contiguous subarray with the maximum sum.
  • Implement:
    void *aligned_malloc( size_t size_in_bytes, int align );
    void *aligned_free( void *ptr_returned_by_aligned_malloc );

    aligned_malloc() is like malloc(), but takes an additional argument - align. If p is the pointer returned by aligned_malloc, then, ( p % align == 0 ).
  • Find the minimum number of colors required to color a dodecahedron. Now, write an algorithm that does so.


NetApp (phone screen):

  • When would you prefer hashing as your dictionary implementation?
  • What is secondary hashing?
  • Perfect hashing/universal hashing...
  • How is the open() system call implemented in UNIX?
  • The rest, I don't remember (its all a haze).


Caliber Consulting (phone):

  • Given the function:

    void swap( char *p1, char *p2 ) {
    char *tmp;
    tmp = p1;
    p1 = p2;
    p2 = tmp;
    }

    what is the output of the following code:

    #include

    int main() {
    char *s1 = "hello";
    char *s2 = "world";
    swap( s1, s2 );
    printf( "%s, %s\n", s1, s2 );
    return 0;
    }

  • Implement strlen(), strcat()...
  • What is the complexity of strcat() ?
  • How would you change strcat(), given the following scenario:

    char src[VERYBIGNUMBER]; /* NULL initially */
    char *s1, *s2, ..., *sn;

    You need to place the strings s1, s2,..., sn into src using strcat(). Assume that src can accomodate all these strings. Note that normally, a single execution of strcat() takes O(l + m), where the lengths of the two strings are l and m. With that complexity, the above cascade of strcat()'s takes time proportional to:

    n*strlen(s1) + (n - 1) * strlen(s2) + ... + strlen(sn).

    Can you change the complexity to:

    strlen(s1) + strlen(s2) + ... + strlen(sn) ?

  • Given that you had only upto the IP stack implemented on two machines. How would you go about establishing a session between them? Note - you obviously can't just use TCP! Also, no error correction, sequencing etc. are required, so you don't *need* to use TCP.
  • With the same scenario as in the previous question, how would you implement a messaging client?
  • What are virtual functions in C++?
  • How would you implement virtual functions in a compiler?


Random Walk (pre-interview - on campus):

  • Implement the factorial function.
  • What is polymorphism?
  • What are virtual functions?
  • Talk about inner classes in Java.
  • Difference between a button and a JButton
  • 57 cents worth of money in 7 coins. How many of each do I have: 1c, 5c, 10c, 25c ?


Neuco (phone screen)

  • What are virtual functions in C++?
  • How does a typical C++ compiler implement virtual functions?
  • How would you reproduce/simulate the object system of C++ in C?
  • Given a C++ object and its method, how would you simulate with a C function, the calling of the C++ method?
  • Suppose you are given a pointer to a function that takes a double between 0 and 1, and returns a double between 0 and 1. The function is continuous, and is zero at some point(s) in the interval. Write a procedure to find those zero-points. What is the complexity of the function, as a function of (a) precision, (b) accuracy ?


Random Walk (phone interview)

  • What is the difference between the procedural and the object oriented approaches to programming?
  • Elucidate the cornerstones of OOP.
  • Suppose you had a Shape class. Its an abstract class that subclasses into concrete classes like a Point, Triangle, Square etc. How would you handle render()'ing a Shape instance...?
  • Suppose an application program wants to render birds on the screen. Different birds are to have different functionalities (Ducks can quack(), Crows can fly() etc). Suggest a good design pattern to provide these functionalities to different instances, that repsects the paradigms: cohesion and loose coupling.
  • What is the most prominent characteristic about multi-threaded programming? And why does multi-threaded prog have this characteristic?