Join Eternal Thinker on facebook!

This pop-up will self-destruct in 20 seconds Close

The Pursuit of Happiness

And that is one of the top 10 cliché post titles for Indian blogs. But we can't help, can we? How far can you be unique in a world so wide with the set of human characteristics being too finite?
The funny thing is, those who crave to be different are the same persons who crave the most for like-minded pals. Now, that brings us to a totally different story. Its wonderful how we find similarities with people as we get close to them; even with seemingly the most unexpected ones. Again, its wonderful how we keep on discovering similarities with some people at the rate of a bunch per minute.

Beach birds! - snap from my previous visit to the beach

 Similar or no-similar, what characterises my relations with people is my bad memory! I'm-so-sorry-I-can't-remember names, dates, relationships between people and other such critical details. I'm yet to see how this is gonna affect my future life in the outside cruel world.

 Yet another thing at which I don't consider myself great, is multi-tasking. Still that's what I always try to do - doing so many things at once, hardly contributing to any expected 'efficient time management'.
But I do believe in time management. If we spend money on things and say "Why not buy the best stuff for these bucks?", well then, "Why not do the best things for these minutes?".    

 The best way of spending the little moments in life may be to enjoy the simple things it offers. If you keep on observing life closely, you'll soon discover that its the simple things that matter.
One thing we can't seem to avoid completely is the mood swing. Sad times do happen. Despite all the happy things going on around, once in a while we all go down the happiness scale, carried away in our own uncertainities. Let's take this normally. After all there is no real point in staying sad. Moreover, the down times have their own part in the play of life. You see, it balances the happiness. Too much of happiness is too much of positive energy. And too much of energy is a pretty unstable state. It can make you overconfident and make you forget what is practical and what is not. So the sad times essentially pull us back to reality whenever we are floating away in the dreamy world for too long, and put us back into action.

 Thus the most important faith is that in the goodness life offers - to see the real purpose of even the apparently unfavourable things that we come across. To learn and move on. To keep ourselves occupied rather than letting the negativity take over. And to keep a bunch of good people close at hand :)

Don't sit in the dark waiting for someone to switch on the light. Get up. In your life, you are the one to say "Let there be light!". And there shall be light. 

  
If you don't find the last sentence familiar, then you haven't read Isaac Asimov's 'The Last Question'. Its a wonderful short story.

Wishes and Wings

It puts me in thinking mode when I find more and more people who are "dreamers" according to their online bio's. I also see more and more people who are clueless about what to do with their skills and potential. Dreamers who don't know how to face the reality?


The final year at college is a major reason why observations of this kind are being made! A call of "What next?" rises within more frequently. And as you know, this transition to reality is too unbalanced in our education system.



Its interesting to go back and see how much things have changed. Last weekend, I went on a lonely bicycle trip through some long routes which are nostalgic to me. Those were the roads I frequently walked through or cycled through during my old school and tuition days. When I got down and pushed the bicycle through many steep turns, I recalled how I used to pedal all the way to the top many years back, without ever really getting down.
At situations like this, the irritation of growing up pokes me. We can never be kids again. Being childish no more means being like a child in its entirety. The innocence is far gone. A positive amount of backstabbing and pulling down is going on all around everywhere.



Despite everything, I still believe we deserve miracles, provided we keep that spark of goodness within. The bad people eventually drown in their own poison. The links between our hard work and crazy dreams finally turns visible. And we take off the edge of the cliff, the bright coloured wings reflecting the solemn sunshine of tomorrow. :)

The dreamer sketch from http://www.deviantart.com/download/136517044/dreams_greatherthan_reality_by_Windnstorm.jpg
The flying pigeon from http://www.localwin.com/julie/system/files/lu10/Dream_Becomes_Reality.jpg

How to use graphics.h in Ubuntu?

Semester 7 at college came up with a bunch of new and interesting stuff. One of them is the computer graphics lab, where we all got to do simple graphic programming in C.

Soon enough, this turned out to be a bit uneasy.
The reason was that we were forced to work in Windows, since there is no support for graphics.h in the gcc compiler in Ubuntu. To make things worse, the computers had Windows 7, and we had to install a simulator called DOS-box to run the programs properly. All this felt so messy and I just wanted to run back to the comfort of programming in Ubuntu!

Then there was some solution here. Basically, we've to install some packages and libraries which enable us to compile graphics.h programs in linux. The original article is a bit old and many packages mentioned are obsolete now. So I've written a patched up, more up-to-date version of the same.
Hope this saves you from going back to the bitter blue screen of Turbo C ;)


Click image to enlarge

Step #0
Make sure you have the basic compilers installed.
You need the build-essential package. For this, run the command:  

sudo apt-get install build-essential


Step #1
First we need to install a hand full of packages. You can simply run the following command and get it all done.   

sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian-all libart-2.0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev


Step #2
Now, download libgraph.

Copy the file libgraph-1.0.2.tar.gz to our home folder. Right click on the file and select Extract here.

Open a terminal and run the following commands, one by one. 

cd libgraph-1.0.2
./configure
sudo make
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib



Step #3
Now you're ready to compile your C program!

You have to type in the line #include<graphics.h> , just like you'd do in Windows.

In programs using graphics.h in Turbo C, you'll be using something like this:

int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");

In Ubuntu, you replace the "c:\\tc\\bgi" part with a NULL

int gd=DETECT,gm;
initgraph(&gd,&gm,NULL);

Finally, while compiling the C file, don't forget to add a -lgraph parameter. The code will be something like this:

gcc heart.c -o heart -lgraph
./heart

And there you go! :)
Feel free to use the example code I made: heart.c

Was this post helpful? Let us know:


Bugs:
Although this implementation helps us to run all graphics.h functions, some predefined constants like SOLID_FILL may not be supported. Anyways, we can use integers instead of such names. This fixes the problem without much effort.

The graphics window can occasionally crash on focus. Rather than a bug in the graphics.h implementation, this is a common bug in gnu/linux graphics which apparently affects many other applications.

Adding Style

This is that time of life when I can sing:
"Life is going great,
Its only getting better"

As mentioned in the last post, happiness is the current theme of my days  :). Newer, better things are popping up and adding more vibrant colours all around.
Besides cleaning up my entire desk(which previously resembled the still model of an earthquake) and my cupboard(home to generations of insect population) - which is indeed a great achievement - and some meetings with old pals and some relaxation in college works, something worth mentioning is the new girl in home - the sony vaio laptop!



Yes, the new lappy has arrived, and its a glossy-black mindblowing Vaio. The chick is so sexy frigging hot. Like, I wanna rip the keypad off its body! Grr..


This gives me a whole lot of fresh experiences like struggling with the touch-pad with my poor skills of coordination and.. using original Windows for the first time in life ;) Also, its time to get creative! :d

So long, and stay awesome! :h


And some technical stuff..
So, the girl comes with Intel core i3 processor, 3gb memory, 320gb storage and  ATI graphics card HD 4500(512mb) along with a really spacious and comfortable keypad, a glossy black cover and other obvious features. Its model VPCEA23EN(E Series) and clocks in around 43K. I recommend!

Windows 7 Home Basic is the default OS. Sony provides no dvds for the OS or drivers. There's only a recovery partition in the lap from which, however, we can create recovery discs. Although this may sound like a slight inflexibility, it actually automates the entire re-installation/recovery procedure. Only that we'll have to give a minimum of 57gb to the Windows partition.

Ubuntu 10.04 Lucid in Sony Vaio
Ubuntu 10.04 had two major issues with the laptop. One is that there wasn't any sound. And the other is the sloppy performance of ATI graphics card with Ubuntu-provided open source drivers.

Fixing sound issue in sony vaio laptop:
The absence of sound, which will seem catastrophic and hopeless after normal troubleshooting, actually has a simple fix. The bug is reported here. We just need to upgrade the alsa sound drivers which handles the sound card functionality in Ubuntu. For this execute the following commands, and the sound shall be heard!

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-$(uname -r)


Choosing graphics card drivers for ATI:
The ATI drivers recommended by Ubuntu results in a bitter performance of the graphics card. Things won't look that great with open source drivers. Here is where we get our hands on some proprietary stuff for the sake of good performance.
Go to the official website and grab the ATI drivers of your configuration. For linux, we obtain .run files. This can be easily converted to .deb files according to the system configuration with the following command (Here the latest version 10.8 of ATI driver is taken as example) :

./ati-driver-installer-10-8-x86.x86_64.run --buildpkg Ubuntu/lucid

After the command is executed, a bunch of .deb files are created. Use the following command to install all the debs:

sudo dpkg -i *.deb


And you're good to go with your sony vaio!