Sunday, October 29, 2006

GOing in Boeing...

Just recounting some experiences of yesterday morning.. when I was fooling around inside the New Delhi Indira Gandhi International Airport, and I ran into some unexpected expected trouble. :-)

Before anything, I must complain about the names that our airlines have been taking.. we started out with Indian Airlines and Air India. Now we have Spice, Deccan Airlines, Indian, Jet Airways, Kingfisher airways, Go Airlines, IndiGo Airlines, and whatnot.

Predictions for the next few airlines: Jet -> AirJet, TailJet, Jet-on-the-left-wing, Jet-on-the-right-wing, Cinnamnon Airlines, RedChilli, GreenChilli, Go -> GetLost, Exit Airlines, Jump-out-of-the-plane Airlines, and what not..
Anyway.. First of all, I "unconciously" skipped the luggage X-Ray, and full credit to our Indian Government that I did not get lynched by CIA-lookalike Men in Blacks. I was politely told by the check-in staff to get the X-ray done and then return. Great! It already felt wierd.. everybody was polite to the point of exhaustion... all these guys were really out to please everyone, can't figure out what everybody was so happy about. Anyway, X-ray done (needless to mention that it was inside a small cramped enclosure inside a HUGE HUGE hall [with those wierd Police DO-NOT-CROSS tapes enclosing the four sides] ), and I obviously found it hard to steer the trolley outside that HUGE 8x8 ft enclosure-inside-the-HUGE-HUGE-hall. So I was trying to exit when the X-ray guy caught my eye (or my hair which nowadays protects my eyes), and asked my to X-ray my bag (very politely of course). I said, "I have to Go to get my check-in done", and he politely shouted above the din, "You travelling by "Go Airlines"? This is not the X-ray for Go Airlines!".. and I tried to convince him that I wasn't travelling by "Go" airlines, I was merely GOing to the check-in counter. Only me pulling out my SpiceJet ticket convinced him of my honesty.. which left him wondering why I claimed to be travelling by Go Airlines earlier. Honestly...

Delhi being Delhi, I had to wait in a very LONG queues, find space in the lobby just to exist, and then catch the Bus to the plane a.l.a. DTC city buses.. stamping on others and trying to find space, yet again, just to exist.

Plane was uneventful, except that I accidentally kept pressing the "Assistance required" button each time I wanted to switch on the Light switch.. which led to the airhostesses finally giving up on me, tired of walking upto me and politely asking me for the nth time if I needed help, only to found out that I had a bad sense of button-direction. :-) I must mention though, the AirHostesses could do with a little less make-up.. they look so 'white' that they remind me of Ozzy Osbourne in his concerts.

Rest of the journey from Bangalore to Vellore (in train now) passed uneventfully too, except I kept getting woken up in the train that by adventurous cockroaches that crawled up my sleeve or worse, my pant. Lots of fun...

I know, the worst sort of thing to keep the blog active is to post the description of a journey, rather than some philosophical Point-of-View which will cause even serene white-haired wise old men to jump out of their skins uttering "Blasphemy!". Really cheap trick I know..

So here I pronounce my philosophical, anatomical and spiritual Point-of-View: Michael Jackson is a man.

Friday, September 29, 2006

About suspension threats and selections..

Been a while since my previous post, and for general information, the raiding party of CAM exams are here again.. :-( Start on the coming Tuesday.

As the title suggests, suspension threats are not related to the engineering suspension mechanisms, but basically administrative suspensions, where you're chucked out of the hostel/college etc.. :-) So me and 15 guys got one hostel-suspension threat for an "extended" birthday party which was held at 3 in the morning.. story goes something like this:

A guy had his birthday (obviously), and it started around 8 PM in quite a subdued manner i.e. an SMS message chain through the hostel about getting free ladoos etc to whoever give him birthday bumps at 12 midnight. That was sort of started in my room, with me having a substantial role in its creation and spreading.. :-) That guy could only watch helplessly as message after message poured into his cell regarding confirmations. Heh. Basically we all get a special Airtel Students' Pack with 100 SMSes free *everyday*, so the messages spread really fast. Now at 12 midnight, we all landed at his room, and he got his share of birthday bumps, which for some inexplicable reason ended up with giving him friendly kicks on the butt, while hanging in mid-air him with two guys holding his arms and legs. This wasn't really anything "hooliganistic", and something even the Birthday Boy enjoyed. But since it had rained really heavily that night, and we had given the bday bumps in the badminton court and ensured that he landed perfectly in the slime and puddles, we all later decided that he had to be given a bath. This means that the victim is locked inside the shower cubicles with his clothes on, and water is thrown from the other cubicles in calculated projectile motions. :-) This was where things began to spin out of control, since nearly 15 guys cramped inside a small 12 cubicle bathroom and naturally the din and noise wasn't small. The trouble came with the fact that the shower cubicle-room is right next to the Warden's room, and in the spur of the moment when the warden-room's light came on, in anxiety that bday boy also ran back to his room like the rest of us, the only difference being that he was dripping wet and wet the entire ground floor as he ran. This provided a natural trail to his room, and the warden is no fool. Soon he was being asked to "prove" that it was his birthday (haha), and demands of how his friends came to know of his bday (sheesh!) etc. That was indeed quite a lot of foolish questions on the part of the warden, but anyway, we were all called out and threatened with suspension from the hostel.

Story would have ended, but the fools we are, we resumed his bday party after coming back from classes at 1 PM the next day! Started with a very simple cake-cutting "Happy Birthday to you" chanting ceremony, turned into a cake-smearing fight, and soon another water-fight which started with one guy launching an entire bucket of water on me in front of my room . I retaliated with a bottle of chilled water, and soon World War III was on with the rest joining in. The guard obviously caught us all.. all unrecognizable in our cream-smeared faces and dripping bodies, and threatened to inform the warden. But he was sort of enjoying our party, so he told us to do the water fights only in the bathrooms, and not outside the rooms in the corridors, and we finally decided to end the really memorable "extended" birthday party before we all got kicked out of VIT. :-)

Whew... as for the second thing, I got selected to the IEEE Executive Board.. one of the 7 people who made it through the interview of about 100 odd. The sad part was that I had to quit ISTE to do so, because of clashing domains and difficulty in attention-management.

Now I must scramble back to my, now dry, room and prepare for the CAMs.. this time I'm really screwed. Started preparing just 3 days ago.

Tuesday, September 12, 2006

And... one more post!

I really must change the pattern of naming my posts I've started developing... one more, and yet another, and another.. sheesh!

Ahem, it appears that *trumpets sound*, my CAM exam results are out. Well, almost, since our History paper, which I think went quite well, has been neglected in the hustle of other papers, and no-one finally got their History marks. The others... ah.

I need to start a new paragraph to describe them. Maths was devastated, English quite catastrophic, Chemistry measures 100 on the Richter scale.. total devastation, and Physics apparently good... atleast topped the class in physics. Need I give my marks? Let me start with what gives me some relief, Physics with 43/50, which makes me the topper in Physics. Don't get too many ideas, take a look at the other papers... Chemistry is 34/50, English 33/50 (a low scoring paper, I think I have the 5th highest or something in a class of 130), Maths is 42/50 (devastated, as I previously mentioned). The overall total puts me probably in the contention for the top 15, if I'm lucky in the top 10 out of 130. The top 10 guys get some good cash as a reward, which might allow me to go and splurge something on the excellent coffee I can get around here. But that's like a distant dream.. not sure. None of us know our exact standings, and History marks will be the deciding factor. I did the paper fine, but so were the rest. F**king!

So now that I have "wasted" a paragraph on CAM results, I have nothing much to say. Life is as such boring and hectic. Same old jobs to be done for getting the events up and running, except unlike the earlier times in school when I used to allot jobs to people and coordinate the event, here in college, as the first year, I'm given jobs to be done, and mostly the routine mundane stuff like making the brochures, banners, sticking them around the campus, getting more recruits, etc.... all stuff that event administrators love to give.. (I used to take sadistic pleasure in giving them to hapless juniors in my days.. hehehe). Talking of a full circle eh?!

The real interesting thing that I used to do, The Band, is currently not reachable, because all my "band-mates" have gone off since its TechWeek and therefore one week devoted to competitions without any classes or attendance. Infact, 90% of first years are off, and my hostel block is like a graveyard. I'm therefore going to get an experience of staying in a 6-bed room converted to a single bed for one whole week. Ah.. the whole room to my will! The hostel is really empty now, infact no-one screamed and threw dustbins from the 5th floor when the power went off, which proves that this hostel seriously needs more people.
Cya, more later..

Wednesday, August 23, 2006

Here I am, with a post again

So here I am, with yet another post.

"Just to inform you, I have a chemistry exam tomorrow and have got quite a substantial portion left, and the time as of now is 10:20 PM, and if I start working on it now, I'll probably finish at 3 AM, and the exam is at 8 AM. We have 5 exams in a row, from Monday to Friday, and tomorrow's the second last, and though I have been sleeping at 2:30 AM - 3 AM for the past three days, this neglect of studies to waste time due to sheer boredom is a first for me in VIT. Have done this before, but... "

and so my mind goes back to the beginning of the loop. *Beep* I'm damn bored. I never liked studying for exams.

Basically, I've been busy studying, trying to fit in ISTE and Phreak 2006 work when I can, and jamming with a *band-mate* in his room with an acoustic guitar. I recently hit on to a cool guitar riff (progression of chords that can form the backbone of the song and are repeated through the song) while messing around with the guitar, and soon I wrote an entire song based on the tune along with the lyrics. The song's called "Bogeyman/The Devil's all I got". Its a nice, slow and depressing song about an outlaw, though it might be time before we actually set about practising it seriously. Presently, its just a personal item. :-) We're planning to start practising "We Rule the Night" by Bon Jovi soon, infact within a few days once these bloody exams finish.

I think I really need to study how Municipal Water is treated, so will write more soon.

Friday, August 11, 2006

Finally another post..

Alright, its been quite a while since my last post, but I had warned you of these "disappearing acts" in my very first blog post. :-) Though this time, it wasn't really a disappearing act which occurs due to boredom, but I have been really busy getting adjusted to the new college life. For information, I have joined Vellore Institute of Technoloy (site) with Comp. Sci and Engg., which is quite a good institute in terms of infrastructure and facilities. The campus is really big and nice, though that means that there is an enormous amount of walking to do to just get from the classrooms to the labs. The library is one entire 4-floor building, and it has something called a Digital Library also along with paper books, you can figure out the meaning of that.

We're going to have our first round of exams in just a week now, from 21st August to 26th, to be more precise.

I've been busy studying, designing sites for the various student-chapters of prominent organizations (Check out ISTE. Open the board members' page), and trying to find members for my rock band. This is the real interesting part. I have found most of the required members for a basic band, and we'll begin jamming together after 1st semester when we all go back to our homes and get our instruments. There are some really great student bands here in VIT, really talented ones. You can hear them jamming really hard every evening-night from 5:30 PM to 11:30 PM in the music room.

This is all for now, will blog more later, and try to pick up the threads of the blog again. I just don't get the time to blog anymore.. never did anyway, but now its even less.

Tuesday, July 04, 2006

Interesting observations..

I was just poking around my webstat interface, and I found this script that tells me the search engines people have used to reach my blog directly, and the keywords they used. I was quite surprised to note that nearly 30% of the traffic I get is because people land up on my blog while searching for variants of the keyword: "BITSAT 2006 cutoff". Its surprising because my blog contains absolutely no information about BITSAT cut offs or anything. Then I remembered my post about my experience of giving the BITSAT-06 in Noida (Remember the post: Marooned with a computer in Noida?). Quite funny, the search engines of today still have a long way to go before achieving decent relevance-rating. Oh and the Webstat interface also confirmed one thing: Google is the No. 1 search engine, since people have used only Google to reach to my site.
Now, I'll be a little smart. Since it is driving traffic to this blog, I'll actually put up the real cut-offs for BITS and some info. ;-)

The First-Iteration cut-off mark for 2006 is 317. The people above 280 are in the first-iteration waiting list. So this year the cut-offs appear to have gone higher. I have heard that last year's first-iteration cut-off mark was 290 or something. The next three iterations went at 260, 250 and 245.

The last seat at BITS Pilani last year went at 252 (MSc. Bio) and in BITS Goa at 245 (MSc. Bio), and Computer Science at Pilani went at 351. Engineering finished in Pilani at 301 (Civil) and in Goa at 289 (Chem).

Wednesday, June 28, 2006

Of internet communities and hair..


Browsing around the 'net, I found some really wierd community websites/boards. Though now it makes perfect logical sense, but I really found this particular board pretty interesting: Link


I find amazing comradeship among long hairs. Walk into a bus, you'll immediately be noticed by another ponytail, not that I'm making one yet. Though of course, I find the "super groomed", "super silky" hair that kids try to emulate really gross. Hair should be allowed to grow as it wants to, what's the kick in spending 45 mins a day trying to get your hair silky smooth and steady?

PS: That guy in the picture is, unfortunately, not me. :-)
PPS: I know this sort of breaks the tradition of semi-technical posts that I have set with the last few ones.. Its unlikely I will post anything this idiotic in the near future.. :-)
PPPS: I really had nothing to post about, and was feeling generally bored. :-)

Sunday, June 25, 2006

Effective optimizations for graphic programmers


Warning: The post contains a bit of technical stuff, along with some source code. Read on if you're interested.

I don't claim to be an expert, or even an intermediate in the vast field of graphic programming, but here are a few cool optimizations/replacements that I have been using for common math functions. This list is by no means complete, and by no means are most of the optimizations my inventions. If anyone wishes to suggest any more, please feel free to do so.

Graphic programming, 2D as well as 3D, involves extensive use of math, especially Vectors and Matrices. And it therefore extensively uses several math functions, like trigonometric ratios, squares and square-roots etc. Vectors also extensively involve "inverse-square-root" i.e. 1/sqrt(x) i.e. one divided by square root. This invSqrt is used in everything from finding magnitudes to finding angles between vectors, projections etc. The main point of this paragraph is that graphics heavily utilize math.

Now before we can make the next Doom3 engine, we need to first get the engine up-to-the-mark. Its no good having a fantastic engine intended for games, only to find it running like a slide-show on even high-end systems. The reason John Carmack is famous is because he has written all the game engines of id software, famous for the Doom, Wolf3D, Quake-series, Doom3 engines/games, and reading his code reveals some amazing tricks and optimizations. All the code upto Quake-3 (inclusive) has been made Open-Source under GPL, so you can try downloading and taking a peek if you're interested. I recommend that. So it turns out that most math functions can be hacked a lot to gain a great deal of optimization and speed.

A) Inverse Square Root
First I look at the famous "Inverse-Square-Root" function that was first seen in Quake-3 and is based on the Newton-Raphson method for approximating functions. The function in this case is 1/sqrt(x). To read in detail about how this works, you can see this and this (more technical). The code:

float InvSqrt(float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x; // get bits for floating value
i = 0x5f375a86- (i>>1); // gives initial guess y0
x = *(float*)&i; // convert bits back to float
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
return x;
}
Test Result: I had tested this before using it in my code. For calculating the inverse square roots of 500000 numbers, the standard compiler method of 1/sqrt(x) took on an average 132 milliseconds, while the above code took on an average 18 milliseconds.

B) Square Root:
Then digging around Quake's source, I found an optimization for the simple square root function, which is essentially the same thing as above with a little modification. The Code:

float fSqrt(float number) {
long i;
float x, y;
const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * ( long * ) &y;
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( f - ( x * y * y ) );
y = y * ( f - ( x * y * y ) );
return number * y;
}
Test Result: To calculate the square root of 500000 numbers, the standard compiler function took on an average 110 milliseconds, while the above code took on an average 26 milliseconds.

C) Square, Cube etc.
This I found on my own. This method is best used if you know the exponent (the power to raise to) beforehand. There are two ways of raising a number to a specific power. One is to use the simple compiler pow(x, n) function which raises x to the power n. I've often observed people using this method if 'n' is large.. above 5 or 6, even if they know beforehand (while coding) the power to raise to. So they use the pow() function. The other way is to simply multiply that number as many times as required by itself. So if I want to raise x to 6, I'll do: [x = x*x*x*x*x*x]. Now it might seem odd, since this method looks so ugly (imagine doing that for 15th power), but believe it or not, the speed difference is amazing. Use the second method always, even if you're raising to the 15th power.
Test Result: I performed two separate tests. In each case, as usual, I took 500000 test numbers. I tried simple "squaring" using the pow() compiler function, and it took on an average 45 milliseconds. I tried the other ugly method of x*x, and it took 2 millseconds. I then tried raising 500000 numbers to the 9th power, and the pow() compiler method took on an average 67 milliseconds, while the [x*x*x*x*x*x*x*x*x] method took just 3 milliseconds. This proves this uglier way to be much more efficient.

D) Trigonometric Ratios
This is quite a common trick, and I therefore won't be putting up a result sheet for this one. The idea lies in making a 'lookup table' beforehand for all those trigo functions you are using. This is because the compiler trigo functions are VERY expensive (take time) and its bad to use them while rendering. So suppose we use cosine in our program, what we do is, make a table (array) of all the angles that the program might use and a table (array) of the cosines of those angles. So the speed boost is immediate, as picking a random element in the array (random access) is a very fast operation. Now generally we have an idea of the range of angles that we might use, and the smallest required intervals between each angle, for example, we might just need whole number angles, not fractional angles, thus we need to make, say, just 90 cosines. Or if the smallest step between angles is 0.5 degrees, we need to calculate the cosine of 0.0, 0.5, 1.0, 1.5 and so on.. while the program is starting up. After that we need to just look up the table and get the cosine very quickly. Incase the angle required is not *exactly* present in the table, like we need 13.7 degrees and we have 13.5 deg in the table, it makes sense to pick the cosine of 13.5 and be happy with it, since in Graphic programming, for real-time work it is smart work to make small compromises here and there to gain an great deal of speed.

PS: I think I need to change the blog theme. I tend to write long entries and this theme squeezes the text into a narrow column making it look dauntingly long.

Friday, June 23, 2006

What I've been up to.. procedural programming.


Alright, as usual, I was too lazy to actually carry through my idea of that "Interesting Projects.." column, which I described in my last post, and in another previous post which is also refered to in that previous post of mine. Anyhow, the point is that I probably won't be writing about the Morse Code-based Wireless Network I was developing from scratch, because I've been recently swept off my feet.

Not in 'The Pool', which I should tell you I have discontinued swimming in for a variety of reasons, but in my mind. I was hanging out at a friend's, and he showed me the video of a game by Will Wright (of The Sims fame) called Spore. The video was actually Wright's presentation at the Annual Game Development Conference where he presented his (and his team's) demo. I've never actually *awaited eagerly* the release of any game, or any movie, but this time, I do believe we are about to see a really revolutionary game which I just can't wait to get my hands on. I am probably not interested too much in the game, but in its source code and the concept that it uses to do the incredible things it does. Now that probably would be expected from a devoted game programmer, but how would you react if you could play a game where you see the entire universe in real-time, zoom in to any of the trillion^n stars with full detail, land on any of the near-infinite planets with full detail, control the evolution of species right from the stage of a single-celled organism to a developed animal, blow up planets with a *Death-Ray*, basically do whatever you want? All in real-time. Just imagine the amount of processing that would be required to simulate each and every cell/living-being, every planet, asteroid, comet, star, galaxy in the whole universe, every 50 milliseconds? Imagine the amount of storage required to store the data of all those things, all those cells and animals etc etc.. let's take a guess.. 40 Gigabytes? 40 Terabytes? Much more? Absolutely correct. Much more is indeed the amount it would take to store all that. So what am I talking about? What if I tell you that there exists a method to store all that data in about 10-15 bytes? That method is called Procedural Programming, where all the data required is generated on the fly.

Ever wondered why your games are always growing in size? Unreal 2000 came in about 1 CD, Unreal 2003 came in 3 CDs, Unreal 2004 came in 6 CDs, GTA San-Andreas takes about 6 GB of hard-disk space, and it goes on.. Why? The reason lies in the fact that the gamers are always demanding more realistic environments, we're not satisfied by barriers inside games, where you hit an invisible wall and can't go explore outside it. So they're making more detailed games, generating each and every building inside a city so that a player can explore all of them, generating textures on walls, basically generating everything beforehand. So if GTA-SA with just the measly amount of detail it has, takes 6 GB of space for code and data, imagine what the game I described in the above paragraph would take. In comes procedural programming. Procedural programming, as the name suggests, generates all the content on-the-fly. Each and every building is generated on the fly if required, all those textures are rendered on-the-spot if required. Now here is the important point, it doesn't simply generate *all* the buildings. It only generates what is *visible* to the player. How do you know if the universe still exists behind your back? This is the fundamental beauty of procedural programming. The time taken to render a single building or stuff like that is really quite small. As you may realise, procedural universes make a few compromises, but give you back much more. For example, with the simplest model I've described, its not possible to allow the player to *hear* a very loud bang at a place that he can't see, but neat programming tricks and hacks mostly tackle all those limitations.

At the heart of a procedural engine lies a seeded (or pseudo) random number generator, which essentially takes in a number and gives out a random number, except that the same random number is returned if the same original number is entered. So if I enter 5, it might return, say, 3.5. If I enter 23, it might return, say, 75. But every time I enter 5, it will always return 3.5, every time I enter 23, it will always return 75. That's why its a *seeded* random generator. The entered number, called the seed, gives us the same final number each time. So here a starting seed number is used, say A, and passed to a random number generator. The output number, say B, might be used to give us the number of buildings in the city. Now we iterate (loop) as many times as B (no. of buildings) and increment a particular variable, say 'i', by one each time. Inside each loop, we can pass the sum of B and I to the random generator, to get a particular number, say C, whose first two digits might give us the X coordinate of the building, and next two digits give the Y coordinate, and the next two digits, say D, are the seed for each building. Now we pass D into the random gen and get another number that might describe the properties of the building etc. And using a straight-forward technique we check which all points are visible to the player, and we generate only those buildings using the properties generated from D. All from a simple single number. As you can see, this need not end at just buildings, we can keep using the numbers after each random generation for more details, number of windows, number of people working in it, type of flooring, and the level of detail can be infinite. All from a single, say, two-digit number.

Obviously GTA-SA cannot be made using this method because the developers want a particular scripted story to play out, and the city generated in the above example is randomly generated. So trying to get a *particular* city, say, New York, using simple procedural generation would be worse than looking for a grain of sand in all the beaches of the universe. The entire city is generated from a single seed number, if we change the starting seed number (A) then the entire city changes, in all aspects. Big games have begun to use this kind of approach for small things, like making the textures on the walls, making rocks etc. But Spore is the first game that uses this approach for the entire game at the level it works on i.e. the universe.

Read up Procedural Generation on Wikipedia to get a better idea (and links to better descriptions). So what I'm upto is a universe-in-a-nutshell (literally!) thing, in the most efficient way. BTW, just as a side-info, procedural programming is almost as old as computers are. Ever heard of demoscene games (called demo-games) that work and look as good as Unreal 2003 and are all packed in just 96 KB (including the executable)? Look at .kkrieger. Demoscenes have been around ever since computers were first found as little electronic things like the Commodore, probably earlier.

I've been doing nothing else with my life, just programming, staring at TV since it has nothing interesting to watch, and sleeping.

Tuesday, May 30, 2006

Coming soon..

Okay, contrary to popular perception that I perished in 'The Pool', I am very much alive and have been unable to blog due to hectic study schedules, general laziness, and a one and a half week viral fever (presumably contracted from the water I greedily gulped down while I was drowning in 'The Pool'). The third reason (Grr..) wrecked up my last and best prepared-for paper, which was today morning. Wracked with weakness and stuff during the examination.. took lot more time to solve even simple problems. Anyhow, I'm not going to mope about stupid stuff like that on the blog.

The post is entitled "Coming soon..", so let me justify it. This is intended as an annoucement of the forthcoming series of posts called "Interesting Projects". Sorry, can't think of a better name. You may wonder why I'm announcing this thing a second time, since I've already done that in my previous post. There are two reaons, a technical reason, and the second, a tad bit smarter. Technical but stupid reason, I just mentioned in the previous post that I had 'planned' to start something of this sort, not actually concretely decided anything. :-) The other reason is because I wish to tell you a bit about what my first "Interesting Projects" post is going to be and how it works. Don't say "awww". This is not a thriller movie. The interesting project I'm working on right now is making my own simple Wireless LAN connection between computers, from scratch. I'm not making it using any existing standards, nor am I using any device or ready-made stuff. I'm figuring out the hardware circuits, software and the logic. Loads of fun..

I'm not targetting efficiency or stuff like that, and since my first baby-step is intended to be a basic chat-program between two systems, I am going to use my favorite code: Morse Code. :-) I've already developed the software to encode and decode. Concept is simple:

"The person types a message in plain English, then the encoder first converts it into a modified Morse code I've devised, and then it sends through the Parallel Port (Printer port) a signal to the transmitting circuit I'm building. If an on-signal is sent to two pins in the port, then the circuit generates a high-frequency wave, and if its a one pin signal, then it generate a low frequency wave, each of the same time duration.

(Side Note: This is, in my opinion, better for computers since this way it can send all alphabets at nearly the same speed, and computers can differenciate between frequencies very well. Common way is to send a short pulse for a 'dit' and a long one for a 'dah'. This takes longer due to obvious reasons)

Now these waves are transmitted wirelessly, caught by the reciever circuit which works exactly the reverse way, and the computer will show the decoded English message."

:-) Very elementary, but I intend to chuck Morse code and start becoming a bit more ambitious by transmitting in 8-bit ASCII later. The hardware is still a little buggy. I'll post the final circuit diagrams later. Again, I assure you nothing's going to be too technical. I'll mark the paragraphs that are going to technical so that you can skip them. :-)

Saturday, May 20, 2006

Swim-lessons Saga: Part I

I planned to write a post about how I almost drowned in the deep end yesterday, but then thought it something too trivial and stupid to post, but then decided that since this was sorta like a personal blog, and since I didn't care if people read my swimming sagas and giggle, here it is.


Scene
: Swimming Pool
Time: 4:45 PM
Location: 6 feet end of the pool

I bloody well drowned yesterday.. not just the first time fear of the deep end, but really. We were starting that part of the pool yesterday.. diving in from the sidewalks one by one, and the trainer was supposed to be in the pool, watching us and pulling us out after we exhausted our air supply. I know, an experienced swimmer can go across the pool in one gulp of air, but I'm hardly a swimmer yet. Anyhow, when my turn came, the trainer suddenly got distracted and went off somewhere when I dived, and unfortunately in that very dive from the sidewalks, I sort of made a bad jump and lost my so-called balance in water and starting going 'into' the 6 feet deep water head first and rotating along the body axis, instead of floating flat. And the stupid Goggles get yanked off my head each time I dive in because of the sheer force of the water hitting the face. So I somehow managed to push myself up against the floor and barely managed to float to the top somehow. And then that guy comes over and 'pulls' me out again. I drank a bit of that dirty (chemical) water, as I was out of breath by the time I came out, I was at the bottom for almost 5-6 seconds, swinging my hands and legs to and fro like a madman. ;-) Hand and leg movements take a lot of your breath away.

As for my progress in swimming, today was my 5th day, because I was down with some fever and cold for 2 days.. possibly due to the pool. As of now I can sort of swim and get to the other end of the shallows in one breath.. I've finally begun to float across the pool quite decently, though my swimming style presently is more like a crazy ballet of a mad-man. If I did it outside the pool, I'd probably get lynched and taken to a mental asylum.

I'm really bad at talking about my experiences etc, so sorry if I've disappointed anyone reading this blog with some hopes of a nice post. I enjoy writing technical posts and talking about technical stuff or music. :-) I'm planning to start a series of 'Interesting Projects' that I'm currently doing once my DCE paper gets over on the 30th... so that might be something that is worth reading, rather than stupid banters of a lousy beginner in swimming. Don't worry, its not going to be too technical.

Saturday, May 13, 2006

Floating across the pool humming Rammstein


Yeah, today was my first swimming lesson, and by the end of the one hour session, I was lazily floating across the pool like a corpse, humming Feuer Frei! by Rammstein and re-playing VH1-MTV's Midnight Headbanger's Ball in my head. That's the only neat thing I've seen on VH1 apart from their occasional Classic Rock programmes. Most of the time they show only stupid Rap & Pop music, can't bear it. As of now, Headbanger's Ball show is the best source for people who can't download videos from the net due to *grumble, grumble* stupid data transfer limits and general disinclination to pay like 900 p.m just to be able to download some song videos. Let it become Free, then I'll switch over plans. :-) The show comes on VH1 at an excellent unearthly (sort of) hour of 12:00 AM every Friday-Saturday joints, that is, it comes from 12:00 - 1:00 AM on early Saturday mornings.

Presently I'm sort of cursing myself at rejecting the swimming goggles and opening my eyes all the time underwater, which was highly chlorinated. Net result, I had such an eye-irritation that I had to sleep for 3 hours instead of the planned study in order to be able to keep my eyes open now. I enjoyed swimming of course, one gets hooked up to semi-weightlessness after a while. I would have kept my eyes closed underwater had small kids decided not to continuously collide with me mid-way as if simulating the Kinetic Theory of Gases. I wonder if there exist equations for root mean square speeds inside a swimming pool.

Wednesday, May 10, 2006

States of Matter: A glaring misconception


I was just discussing matter and fundamental particles with a friend when I realised that something has begun to go wrong and the ignorance among people shows it. They know that what I speak of is true, they've always known it. Yet their minds have decided that matter actually exists in three different 'species', believe it or not.

Classification is the basic and fundamental property of abstraction. It makes life easier, and is invaluable. But, some people begin to believe that the artificial *wall-of-division* between each group is quite concrete. In a similar fashion, many people, especially children have lost touch with the fact that Solids, Liquids and Gases are nothing but atoms with different ranges of force of attraction. There is a very elegant graph, a potential energy vs. distance one, which explains the region of solids, liquids and gases very well, which I shall not go into here.

The point is, everything is made up of a fundamental entity. As of today, we are made to understand that atom is the abstraction that is the fundamental entity. It comprises of sub-atomic particles, but essentially, the atom as a whole is what is a repeating unit. Logically quite strange, since atoms vary in sizes, which immediately discards that repeating-unit property. Hence the logical reasoning is that there exists an entity which is elementary. I am not in a position to give you the Truth. In the Age of Reason (circa Aristotle), we were made to believe that whatever cannot be divided any more, say by crushing repeatedly, is the fundamental Truth. In the Age of Science (circa Dalton), we were explained atoms scientifically. And it goes on till today. Now, the terms Solids, Liquids and Gases were created for the sake of abstraction of physical & chemical behaviour since mostly all gases showed nearly similar properties, with just a few variations in quantification of properties. But the essence, that everything is just atoms is true. Hence people who say that Solids 'convert' to liquids and so on, blindly thinking it to be one independent species converting to another are not justified in thinking so.

Saturday, May 06, 2006

Marooned with a computer in Noida?

Yep, that was the experience giving the BITSAT-2006.. driving for 1 hr 15 mins, and then sitting in a desolate, barren locality for another 1 1/2 hrs in vaporizing temperatures with two stupid fat books to revise and then staring at a computer screen for 3 hours as it wags a fat finger at you, while shooting questions.

First thing I found as I walked into the centre was that we were required to bring a proof of identity along. It was apparently mentioned in some instruction-sheet which was apparently something that was supposed to be read by all of us. I was mumbling something about me not seeing anything written about instruction sheets anywhere and therefore clearly not being mentioned anywhere, when he pointed at a line in my admit card which said: "You should print the detailed instructions and read it carefully before appearing in the online test".. I sort of tried to slink away in embarrasment from him into the centre when he generously gave me a form which said: "I have brought my admit card, and did not bring my identification papers due to >Insert some stupid reason here<. Please allow me to enter." I grinned to myself as I walked in, wondering if he liked my face and long hair and became large hearted, when I noticed that nearly everyone I saw carried similar sheets. Moral of the story: Everyone's dumb. Don't worry. And the guys at BITS know that. Smart guys.

Anyway, their software was very well designed, and the center was, for a change, well maintained. For once, I worked on a computer system for 3 hours without it (*trumpets ring*) crashing or hanging. That too on a Windows machine. Test was good, I think I'll make it inside the cut-off lists. Only complaint is that it doesn't allow you to uncheck an answer once clicked. C'mon, everyone knows that HTML has provided for a RESET option almost since it was created. It has even hard-wired into its core functions. God knows why they never thought of putting one in this test. I think I got 3 questions wrong because of that.. attempted them and then remembered that I could not remove them (I could change it though, not remove, but that forces you to attempt a question that you're not sure of entirely). And therefore negative marks. I can see no reason why they can't put it; it's my paper and I can do whatever I want with it right?

Not end of story if you wanted to escape. Then I stomped out angry with myself at poor performance etc etc, and then found that I had been abandoned in God-knows-where in Noida by my family who were supposed to pick me up and go off to dinner at someone's house nearby in Noida. For nearly 1/2 an hour I patrolled the gates and yet no sight of anyone. I think even the guard there had gone home by then.. maybe he thought that since I was doing such a good job patrolling that it would be a shame to ask me to leave. (Note: My exam was from 4:30 pm - 7:30 pm). Finally these guys turned up, I had really spicy food which is still hurting my oesophagus, and writing this post wondering what the heck's wrong with my speakers.

(Image by Steph Lehman)

Friday, May 05, 2006

Yeah yeah, two posts in a day!

Yeah yeah, I'm really bored and have begun to develop a base dislike for my books now. Who wouldn't, if you were forced to stare at the same books for 13-14 hours a day for a period of now almost 6 months.

The previous post is not actually a fresh, new post. Its quite an old post from my personal blog hosted on my computer.. which serves like an idea-book plus notes collections. The tag about this theme being dark and broody made me express my feelings about being trapped and forced to give exams and still keep the motivation up, as these exams decide where I study and what I study for the next few years, and possibly my career too. But it gets hard after a while, trying to motivate yourself to just sit on the damn chair and study for 3 hours at a stretch without walking out in boredom.. motivating myself with just the thoughts of more study. Ironical isn't it?

Trouble is the steam runs out, the drive and passion to excel and do better than others runs out, and once that happens, God save me. Presently, I think my steam's running out.. and I've got three more weeks to go. So what if my dear relatives and friends say those stupid words that even they know are untrue: "Don't worry, take it easy and everything will be fine, you'll get admission anywhere". Take it easy, that's very easy to do, but will be the end of everything. Relax? If you mean be calm and study in a planned fashion, that's what I've been doing for the past 6 months, and I fail to see how one can get worked up at that fact. The problem is boredom, not tension. I can do well in whichever field I study. Boredom leads me to wander around the house and waste my time doing things like playing the guitar and not studying. That makes me feel guilty and leads to the feeling of being a soft jelly. Occasionally I get really charged up somehow and I put in study like from 9 am in the morning, through the day, and till 2 am the next day. I just feel my adrenaline rushing when I do that. But then again I collapse into the jelly-like state and get bored again. This is what leads to this black and dark state of mine, hence the dark and broody theme of this blog. Quite a lot of explanation for a simple color isn't it? ;-)

(Image by Aron Bothman)

Me and my BIG Mouth


Okay I have a problem keeping my mouth shut. Succeed most of the time, but often fail causing some rather stupid pain-in-the-necks.

This post is inspired by yet another blabbering-mouth thing, this time in frustration at what I like to call soft-spam. Hard-spam is like that unsolicited XXX kind of messages or "Buy This!" type things from unknown people. Soft-spam on the other hand is from your own friends or from people who know you. Mostly its just stupid 'cutesy' forwards, and the infamous "Forward this to 20 other people within 45 minutes to get luck or else.." type messages. So I felt pretty pleased with myself when I implemented a simple filter in my mail account that would move every message with the subject starting with "Fwd:", the web standard for forwards which gets attached automatically to the subject field when you click forward in any mail provider's service, to a separate label/folder and skip the inbox, so that I would never need to read them or have stupid messages enlisted in my inbox. And soon enough, my separate folder was brimming with "Fwd: Take this 'Are you Hot?!' test" etc etc things. Only 5 legitimate forwards were present in it, like a forward from my comp teacher regarding some programming competition in Chennai and stuff. Small price to pay since there was a ratio of 1:4 of legitimate to nonsense stuff. And I keep checking my forwards folder to ensure that nothing of value is left unread. And obviously I never bother to read these stupid mails anymore. I don't even have to take the effort of deleting them now.

This said, I need to come back to the basic point.. my Big Mouth. I was feeling so pleased with myself, that I told one of my friends about my filter since he too complained about being soft-spammed a lot. Dumb person.. now he's joined the soft-forwarders gang too, and ensures that he removes the "Fwd:" thing from the subject (it can be edited always.. it just gets inserted automatically. Can be removed), hence effectively beating my system. He does that purposely, since nobody likes their messages unread, however dumb they may be. Even if its not their own message. And I can't filter with keywords since the chances of a keyword being legitimately present in a message is high too.

Sunday, April 30, 2006

Achaea - Dreams of Divine Lands

http://www.achaea.com

I used to play this game often a couple of years back.. one of the few text-based MMORPGs that are actually good and immersive.

The account is free and no downloads required, as a simple Java applet opens up and connects you to the Achaean world. We move and play by entering commands that are quite logical and simple. There's also a 'Newbie channel' that connects you to a sort of ham-radio network where you can keep asking your problems with the game and you'll be helped by the experienced players on the go. Pretty neat.

The world has six city-states and lots of dungeons and waste-lands around them to go 'make your bones' (kill a few monsters to get experience). The lands are multi-level, so you can go deep into a dungeon vertically as well as horizontally. The game's pretty open-ended, so a player can choose what he wants to do in his game-life: be a warrior, merchant, politician, thief etc.. (maybe I repeated two professions.. ;-) ) It has lots of races, Elves, Men, Dwarves etc etc, and one can become great by completing quests, or competing with other players or simply being good at whatever one wants to do. The ultimate goal is to become "The Greater Dragon", achieved on reaching level 99.. which gives you in essence a lot of goodies and you're a big guy then. :-) The game's pretty nice with fast-paced action, and quite a complex fighting system..

One thing I did not like about the game was that its too easy to get killed and at some points, it gets too mundane and we keep getting lost. Its a little confusing finding your way around the place, especially in the wastelands.

Another thing I think the game needs (though maybe the philosophy of the game is to be like it is now), is a full-scale 3D environment. Slick graphics coupled with the game-play would make Achaea a killer project.

Saturday, April 29, 2006

I travelled back in time!


Yeah I did! I beat the system, stuck one up theirs. My Temporal Re-alignment.

See, its just a matter of perception. Time is the perception of events flowing by.. its a "perception" of what's going on. We naturally set a certain time as morning, and fervently believe it to be morning. Suppose I was brought up to believe that the green thing that sits on trees, flies around and eats chillies is a rat, instead of a parrot, I would fanatically believe that it is indeed a rat!

So, since I get a little loony around the pre-exam days, especially if I have a lot of course still left and am a few hours short to cover it all.. I decided to simply travel back in time.

A couple of days back, I was supposed to spend all afternoon revising Physics, and the entire evening doing Chemistry till 10 PM, and the rest of the time, till about 2 Am doing Maths. I got lazy and slept off on my table all afternoon, and the Physics was critical.. I had to finish it otherwise I would lose a lot of free marks. So I got up cursing myself at 6:30 PM, and mutely cried out at the injustice of time being uni-directional and linear. Then I got an idea. I simply set my clock back to 4:30 PM, and fervently and fanatically believed it to be 4:30 PM and considered that the Sun had simply decided to go home early and that I was perfectly on schedule.

And guess what? I did work right on schedule. I finished my Physics & Chemistry by 10 PM, only wondering a little as to why everyone had emptied the streets and gone to bed so early and what was wrong with the world anyway? ;-) Then at 1 AM, I finished Maths early and felt very happy that I had completed things right on schedule! And derived greater pleasure on seeing that the real time was 3 AM and that I had returned home victorious after saving my past from losing lots of free marks.

Cool idea eh?!

PS: This idea is only applicable for single day journeys. Multiple day journeys will probably end up with you turning up for an exam after everyone's solved the paper, gone home and you disturbing the night-watchman's sleep.

Thursday, April 27, 2006

"That language" just got cooler!


I had always thought of Perl as "that language". Today after looking at a link (click here) sent by a friend of mine, I realised that it is way too cool!

Tuesday, April 18, 2006

Beginner's Guide to FPS Gaming



OK, nothing too great, just that I've noticed kid players (not in terms of age, but in terms of skill) in UT and Quake (all versions) type FPS games run in intricate straight lines and turn at right angles. I mean, I just fall off the chair laughing when I see such stuff, notwithstanding the fact that I too must have done that for a couple of days when I was a toddler. Anyhow, the point is that "RUNNING IN PREDICTABLE PATTERNS IS IDIOTIC AND MAKES YOU TARGET PRACTICE FOR OTHERS".

So if you're not comfortable with aiming and jumping, just trying running in a zig-zag manner. And even the zig-zag should not be with constant time-period. Just move randomly. And after some practise, you'll be able to aim at people perfect even while running zig-zag. Never stop moving.

And please! "MOVING YOUR CAMERA AROUND, I.E YOUR MOUSE WILDLY IN ALL DIRECTIONS DOES *NOT* MAKE YOU MOVE RANDOMLY". Believe me, I've seen players doing that too.. moving your camera/gun randomly is standing at one place and twisting your neck & head around wildly as if its going to fall off.

Once you're comfortable with moving around randomly, start jumping. The first thing I tell newbie players is to use W+A+S+D instead of normal arrow keys. That is because you are going to find it really easy to have a big space-bar configured to jump rather than some miniscule R-Shift key or something. So while using W+A+S+D for movement, you just can hit your thumb on a large spacebar and you jump. Its really awkward doing that with arrow keys. Jumping is really really important. It makes it really hard for anyone to aim at you. And in UT, double jump, i.e jumping again once you're in mid air takes you to a height that can create a psycological impact on your target. Attacking from higher elevations always gives you a psycological advantage. Again, please don't jump in predictable fashions. You still should move while in mid air. Touching the ground only to jump again. And after a lot of practice, you'll be able to aim perfectly at people even while in mid-air. Lots of beginners give up, since that requires a lot of practice and playing with strong players. But don't overdo jumping. Jumping and shooting when there is a stationary or a stupid *straight-line* player is idiotic. Run, and shoot with a careful aim. Don't waste ammo. Your gunfire will draw people, especially since experienced players always listen carefully to the sounds around them. Anyone who wastes too much ammo is a kid. And they come in for their prey. Always.

This brings me to the last piece of advice: Play Online. Play online regularly, and play with only the best. Don't try to boost your ego by playing against bots or equal-level or below-level players. Play in rooms with really godlike players. In the first few months, 99% of the time you will end with a zero score or something similar to that. But the experience you get will soon boost your skill to something far more than what you had earlier.

That's all I have to say. There may be certain things that several of you gamers out there might not agree with, but I'm talking through personal experience.

Monday, April 17, 2006

Of Global Conflicts...


For some wierd reason, I got interested in trying to find the total number of global conflicts (civil wars, proxy wars, disputes etc) and decided to pop around the internet listing out.. and was really shocked to see that I have already filled 3 sides of register sheets and still counting. Wierd.

Useful links:
http://www.globalsecurity.org/military/world/war/disputes.htm
http://www.ppu.org.uk/war/
http://www.ndcf.org/Conflict_List/World2002/2002Conflictlist.htm

Saturday, April 15, 2006

I dunnit!

No single event in my life has EVER driven me do something as insane as this: Create a blog to celebrate it. :-P. I mean I've done stupid things, but celebrating by creating a blog.. that tops them all..

Anyway, here's what I need to celebrate about: I FINALLY managed to design (actually redesign) and work out a circuit for my own guitar distortion effect! Alright, it might not seem such a big thing for most reading this, but you can hardly imagine the agonizing nights.. months of them actually, trying to get hold of components: first by travelling half-way across the city to the only respectable electronics shop I knew, and then resorting to breaking the solder on old junk electronics and salvaging parts.. and believe me, nothing's worse for your fingers than that (except of course if you decide to give them a bath with acids, like I did in the school lab). Then meeting with failure after failure when the guitar WOULD NOT just make any sound in the speakers.. or actually, the circuits wouldn't either make any changes in the sound (read:distortion) or they simply wouldn't send out anything. I could bang the guitar for all I cared, and the circuits wouldn't emit a beep to commiserate.

Oh and not just the circuit, my guitar too has a story.. I was broke (spent all my funds on computer upgrades) at the time this story is based, and all I had was an acoustic non-amplified simple guitar (I love it). One day before our farewell party from school, I and couple of other friends got this wierd idea of holding a rock show (you know.. play a couple of neat songs) at the farewell party for us, as a surprise.. we would be conspiring with a few 11th grade juniors to set up our stuff before-hand and all of a sudden we would jump on-stage and you know.. do the thing to 'shock and awe'.

Anyhow, we started jamming at my friend's place and I had temporarily hooked up some pickups to my acoustic and was playing with some distortion software (Guitar FX BOX) on the computer. That friend is a very talented keyboardist, and had played at some really cool places, and used to play keyboards only.. hated string instruments. I came to know the extent of that hate when I happened to look into one of his cupboards, and to my utmost horror saw a beaten-up, dusty, man-handled electric guitar that otherwise seemed to be very elegant in its days. It looked very very old though, so old that its manufacturer's name and tuning knobs had worn off. It looked vintage. He said that it had been lying inside that cupboard for a decade (did I mention that the guitar had around it a thriving eco-system of spiders and other creepy-crawlies?). And he gave it off to me as he said it was apparent that he didn't want it. An electric guitar for free?! Who'd refuse that.. of course I had to repair it a lot, work out the internal wiring as mysteriously, someone had pulled out all the wires in it. I had to fix a new spring-board too, as someone had salvaged it out of it probably.

Now, back to the story, which will end in 32 words: Today, the evening before my university entrance exam, I have finally managed to work out the circuit (and hear my speakers emit those heavenly crunchy sounds.. sounding exactly like the legendary tube-screamer overdriven). All that was missing in it all these months was grounding/earthing the right spots! Hurray!

Story ended, now about myself: Nothing. I'm just an electronics hobbyist, avid guitarist, avid programmer, and graduated from high-school a month back (12th grade or its equivalent). Love music, all types (except rap and pop.. can't bear it). Favorite genres: Heavy Metal, Hard Rock, Alternative Rock. I love classic rock and actually all rock and metal music, right from Led Zep, Pink Floyd, GnR, KISS, to Killswitch Engage, Lamb of God, Machine Head, Slayer etc..
Most respected bands: Metallica, KISS, Slayer, GnR, Led Zep.

I don't know if anyone reads this post or not (I don't care, I just wanted to express the triumphant feelings). If anyone wants to really follow this blog hoping to get some more posts, I think you should check back in intervals of decades or so.. I was too lazy to even delete my last blog, let alone open it and write a new post. ;-)