Sunday, April 15, 2012

Tree


#include
#include
#include
#include

class Node
{
private:
    Node* _left;
    Node* _right;
    int _data;

    void _AddNode(Node*& _nodeRef, int i)
    {
    if(_nodeRef)
    {
delete _nodeRef;
}
_nodeRef = new Node(i);
}

void _DeleteNode(Node*& _nodeRef)
{
if(_nodeRef)
   delete _nodeRef;
    }

public:
    Node(int i=0, Node* _left=0, Node* _right =0):_left(left),_right(right),_data(i) {}
    ~Node()
    {
}

    void AddLeftNode(int i=0)
    {
        _AddNode(_left,i);
    }

    void AddRightNode(int i=0)
{
   _AddNode(_right,i);
    }

    void AddNode(int i=0)
    {
Node** temp = &this;

while(*temp!=NULL)
{
if(*temp->_data <= i)
temp = &(*temp)->_left;
else
temp = &(*temp)->_right;
}

*temp = new Node(i);
}

Node* Left()
{
return _left;
}

Node* Right()
{
return _right;
}

    void DeleteLeft()
    {
_DeleteNode(_left);
}

void DeleteRight()
{
_DeleteRight(_right);
}

void SetData(int i=0)
{
_data = i;
}

int Data()
{
return _data;
}

};

void PreOrderTraversalRecuresive(Node* node)
{
//Visit Root
//Visit Left
//Visit Right


if(!node)
return;

cout << node->Data() << " ";
PreOrderTraversalRecuresive(node->Left());
PreOrderTraversalRecuresive(node->Right());
}

void InOrderTraversalRecuresive(Node* node)
{
//Visit Left
//Visit Root
//Visit Right

//returns elems in ascending order

if(!node)
return;

InOrderTraversalRecuresive(node->Left());
cout << node->Data() << " ";
InOrderTraversalRecuresive(node->Right());
}

void PostOrderTraversalRecuresive(Node* node)
{
//Visit Left
//Visit Right
//Visit Root

if(!node)
return;

PostOrderTraversalRecuresive(node->Left());
PostOrderTraversalRecuresive(node->Right());
cout << node->Data() << " ";
}

void PreOrderTraversalIterative(Node* node)
{
if(!node)
return;

std::stack nodeStack;

Node* temp;

nodeStack.push(node);

while(!nodeStack.empty())
{
temp = nodeStack.top();
cout << temp->Data() < " ";
nodeStack.pop();
temp->Right()?nodeStack.push(temp->Right()):0;
temp->Left()?nodeStack.push(temp->Left()):0;
}
}

void InOrderTraversalIterative(Node* node)
{
if(!node)
return;

std::stack nodeStack;
Node* temp=node;

nodeStack.push(temp);

while(!nodeStack.empty())
{
while(!nodeStack.top()->Left())
{
nodeStack.push(temp->Left());
}

cout << nodeStack.top()->Data() < " ";
nodeStack.pop();

temp = nodeStack.top();

cout << temp->Data() << " ";
nodeStack.pop();

temp->Right()?nodeStack.push(temp->Right()):0;
}
}

void PostOrderTraversalIterative(Node* node)
{
if(!node)
return;

std::stack nodeStack;
Node* temp=node;

nodeStack.push(temp);

while(!nodeStack.empty())
{
while(!nodeStack.top()->Left())
{
nodeStack.push(temp->Left());
}

cout << nodeStack.top()->Data() < " ";
nodeStack.pop();

temp = nodeStack.top();

temp->Right()?nodeStack.push(temp->Right()):0;
}
}

void BreadthFirstTraversalIterative(Node *node)
{
if (!node)
return;

std::queue nodeQueue;
Node* temp = node;

nodeQueue.push(node);

while(!nodeQueue.empty())
{
temp = nodeQueue.top();
nodeQueue.pop();
cout << temp->Data() << " " ;

temp->Left()?nodeStack.push(temp->Left()):0;
temp->Right()?nodeStack.push(temp->Right()):0;
}
}
void DepthFirstTraversalRecursive(Node* node)
{
if (!node)
return;

cout << node->Data() << " " ;
Node* temp;

if(node->Left())
temp = node->left();
else if(node->Right())
temp = node->Right();
else
temp = NULL;

DepthFirstTraversalRecursive(temp);
}

void DepthFirstTraversalIterative(Node* node)
{
if(!node)
return;

std::stack nodeStack;
Node* temp=node;

nodeStack.push(temp);

while(!nodeStack.empty())
{
while(!nodeStack.top()->Left())
{
nodeStack.push(temp->Left());
}

cout << nodeStack.top()->Data() < " ";
nodeStack.pop();

temp = nodeStack.top();

temp->Right()?nodeStack.push(temp->Right()):0;
}
}

int DepthOfTree(Node *node)
{
if(!node)
return 0;

int h1 = DepthOfTree(node->Left());
int h2 = DepthOfTree(node->Right());

return (h1 > h2)?h1+1:h2+1;
}

Node* FillTree(char* fileName)
{
if(!fileName)
return NULL;

ifstream ifp;

if(!ifp.open(fileName))
return NULL;

int data;

ifp >> data;

Node* node = new Node(data);

while(!ifp.eof())
{
ifp >> data;
node->AddNode(i);
}

ifp.close();
}

int main(int argc, char** argv)
{
PreOrderTraversalRecuresive();
InOrderTraversalRecuresive();
PostOrderTraversalRecuresive();

PreOrderTraversalIterative();
InOrderTraversalIterative();
PostOrderTraversalIterative();

BreadthFirstTraversal();
DepthFirstTraversalRecursive();
DepthFirstTraversalIterative();

DepthOfTree();
}

Monday, May 10, 2010

చేదు పాట

శ్రీ శ్రీ గారి శత జయంతి సంధర్భంగా, ఆయన రాసిన, నాకు నచ్చిన "మహాప్రస్థానం" లోని ఒక చిరు కవిత ...

ఔను నిజం, ఔను నిజం,
ఔను నిజం, నీ వన్నది,
నీ వన్నది, నీ వన్నది,
నీ వన్నది నిజం, నిజం!

లేదు సుఖం, లేదు సుఖం,
లేదు సుఖం జగత్తులో!
బ్రతుకు వృధా, చదువు వృధా,
కవిత వృధా! వృధా, వృధా!

మనమంతా బానిసలం,
గానుగలం, పీనుగులం!
వెనుక దగా, ముందు దగా,
కుడి ఎడమల దగా, దగా!

మనదీ ఒక బ్రదుకేనా?
కుక్కలవలె, నక్కలవలె!
మనదీ ఒక బ్రదుకేనా?
సందులలో పందులవలె!

నిజం సుమీ, నిజం సుమీ,
నీ వన్నది నిజం సుమీ,
బ్రతుకు ఛాయా, చదువు మాయ,
కవిత కరక్కాయ సుమీ!

లేదు సుఖం, లేదు రసం,
చేదు విషం జీవఫలం!
జీవఫలం చేదు విషం,
చేదు విషం, చేదు విషం!

ఔను నిజం, ఔను సుమా,
ఔను నిజం నీ వన్నది!
నీ వన్నది, నీ వన్నది,
నీ వన్నది నిజం,నిజం!

-- శ్రీ శ్రీ

Thursday, April 15, 2010

దేని కోసం?

శ్రీ శ్రీ గారి పద కవితా స్ఫూర్తితో ,

వేళ కాని వేళలలో,
దారి కాని దారులలో,
కానరాని కాంక్షలతో,
దేనికోసమీ దేవులాట !

ఆకలితో అలసటతో,
ఎందుకోసమీ ప్రాకులాట !

నిశీధి రాతిరి హోరు గాలిలో,
చావు పుట్టుకల పొలిమేరల్లో,
అవ్యక్తపు ఊహలతో,
ఎందుకీ నిర్లిప్తత !

ప్రపంచమంతా నిదురొన్న నడి రాతిరి,
నీలోనే నీకేదో ఆవేదన.. ?

ఎందుకీ అన్వేషణ ?
ఎక్కడికీ ప్రస్థానం ?

Tuesday, April 13, 2010

Welcome to hell

  • Life starts with a cry, clearly signifying the arrival in hell.
  • Trouble starts from the day of birth when the newly born starts crying. Signifying that the newly born was suddenly forced into hell.
  • No one allows the baby to have its own way. No one will try to think what the baby needs. Every day feeding and every other behavior follows a pattern that was pre-defined. No one can see what's in the mind of the baby.
  • As the baby grows up and walks, lots of controls come into picture. People say that it is for the safety of the child only that there are controls. Of course from the point of view of the elders they are doing the right thing. Who cares what the child thinks? The child dislikes the control and wants freedom. After all, the child did not ask to be brought into the world.
  • As the child grows up, he/she is forced into the school in spite of the reluctance of the child. He/she is forced to follow a set pattern defined by the society. The child is told that it is important to follow the set pattern for its own future.
  • As the child becomes adult, freedom is further curtailed by numerous laws. The adult cannot even get food without working, and for getting a job, the adult has to struggle a lot. Comparisons are made by the parents with other colleagues who get a better job. All the pressure forces the adult to get a job. Not sure if there is job satisfaction.
  • There will be lot of struggle to hold ones place wherever one works. For deviation comes the love life. That will start another phase in life of contradictions and struggle.
  • Next the parents become old. There will be sadness all around. All the old age people who were young earlier dies.
  • Finally the very baby that came unknowingly into the world grows old and death will any way come.
  • Why is all this required? Why struggle all your life when finally what actually happen in life for everyone anywhere are birth, struggle, stress, sadness and death. Knowing very well all these problems in life, why hell should people continue the cycle? That means people are not reluctant to throw someone into this hell when they have every chance to prevent the same.

Tuesday, January 12, 2010

రింగ రింగ

A brainchild of creative heads during the return journey from Wayanad ...

Creative Director _____ : Harish Kumar Reddy
Composer & Editor ____ : Raghuram Neela
Lyricist ____________ : Phani Kumar Ravi
Critic ______________ : Pavan KVV
Author & Coordinator __ : Sunil Paduchuru

రింగ
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే ||4||

పాశు పాశు కుర్రాలము మేము...
ఆంధ్రా నుంచి వచ్చేసాము...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

మస్తుగున్న కుట్టీల కోసం...
పుబ్బులన్నీ వదిలేసాము...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

తెల్ల క్యాబ్ ఎక్కి ఎక్కి బోరే కొట్టి...
నీళ్ళ బస్సు మీద మాకు మోజే పుట్టి...
మదికేరి చేరినాము, చేరి ఎదురు చూసినా...
ఎవరి కోసం?

సిటీ పోరిలంటే మాకు బోరే కొట్టి ...
పల్లె కుట్టిల కోసం ఆరా తీసి ...
గోకర్ణ కెళ్లినాము ...
కొన్నూరూ
కెళ్లినాము ...
రేపల్లె
కెళ్లినాము ...
మంగళూరు కెళ్లినాము ...
వాయనాడుకి వచ్చి మేము సెట్ అయ్యాము ...

ఓహో, మరి ఇక్కడ కుట్టిలేలా ఉన్నారు ???

మలయాళీ మర్దన చేతులతో చేసి ...
మాలో ఆశలని పెంచేశారు ...
అమ్మనీ ...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

వాయించు ఎహే...

ఇదిగో కుర్రాళ్ళు...
అదంతా సరే గాని ...
అసలు ఈ రింగ రింగ గోలేంటి ...

అసలుకేమో ఆ హెయిర్ స్టైల్ ...
"కల్పెట్ట ఎద్దిక్కల్ రింగ"
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||
పలకలేక మేమేట్టినాము ...
పెట్ నేము రింగ రింగా ...
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||
జీన్సు తీసి కట్టినాము లుంగీ పంచ ...
స్నానం చేసి పూసి నాము పౌడర్ బాగా ...
"Geek" లాగ ఉన్న మమ్ము ...
మార్చినారు వీక్ గా ...

అచ్చులన్ని మార్చినారు "అళ" కారంగా ...
ఆకు కూర మార్చినారు "ఫిష్" కారంగా ...

Monday, December 28, 2009

రింగా రింగా...

A brainchild of creative heads during the return journey from Wayanad ...

Creative Director _____ : Harish Kumar Reddy
Composer & Editor ____ : Raghuram Neela
Lyricist ____________ : Phani Kumar Ravi
Critic ______________ : Pavan KVV
Author & Coordinator __ : Sunil Paduchuru

రింగ
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే ||4||

పాశు పాశు కుర్రాలము మేము...
ఆంధ్రా నుంచి వచ్చేసాము...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

మస్తుగున్న కుట్టీల కోసం...
పుబ్బులన్నీ వదిలేసాము...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

తెల్ల క్యాబ్ ఎక్కి ఎక్కి బోరే కొట్టి...
నీళ్ళ బస్సు మీద మాకు మోజే పుట్టి...
మదికేరి చేరినాము, చేరి ఎదురు చూసినా...
ఎవరి కోసం?

సిటీ పోరిలంటే మాకు బోరే కొట్టి ...
పల్లె కుట్టిల కోసం ఆరా తీసి ...
గోకర్ణ కెళ్లినాము ...
కొన్నూరూ
కెళ్లినాము ...
రేపల్లె
కెళ్లినాము ...
మంగళూరు కెళ్లినాము ...
వాయనాడుకి వచ్చి మేము సెట్ అయ్యాము ...

ఓహో, మరి ఇక్కడ కుట్టిలేలా ఉన్నారు ???

మలయాళీ మర్దన చేతులతో చేసి ...
ఒంట్లో వేడిని పెంచేశారు ...
అమ్మనీ ...
రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

బొడ్డు కింద లంగాను చుట్టి ...
మాలో లావాను పెంచేశారు ...

రింగ రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||

వాయించు ఎహే...

ఇదిగో కుర్రాళ్ళు...
అదంతా సరే గాని ...
అసలు ఈ రింగ రింగ గోలేంటి ...

అసలుకేమో ఆ హెయిర్ స్టైల్ ...
"కల్పెట్ట ఎద్దిక్కల్ రింగ"
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||
పలకలేక మేమేట్టినాము ...
పెట్ నేము రింగ రింగా ...
రింగ రింగ రింగ
రింగ రింగ రింగా రింగారే
||2||
జీన్సు తీసి కట్టినాము లుంగీ పంచ ...
స్నానం చేసి పూసి నాము పౌడర్ బాగా ...
"Geek" లాగ ఉన్న మమ్ము ...
మార్చినారు వీక్ గా ...

అచ్చులన్ని మార్చినారు "అళ" కారంగా ...
ఆకు కూర మార్చినారు "ఫిష్" కారంగా ...


Onti loni water antha chemata laaga pindinaru..
Vompu loni atharantha aaviralle peelchinaru..
Vompi vompi sompulanni tagesaru..
ai baboi tagesara inkem chesaru..

Puttu machalu lekkettesaru..
Leni machalu puttincharu

Ringa ringa Ringa ringa

Unna kolathalu marchesinaru..
Raani madathalu rappincharu..
Ringa ringa Ringa ringa

Idigo foreign ammai..
Ela undeti mana kurralla power
Pancha kattu kurrallaloni..
Punch naku thelisochindi..
Ringa ringa Ringa ringa

Muntha kallu laginchetolla..
Strengthu naku tega nachindi..
Ringa ringa Ringa ringa

Neeti bed sarasamante garru garru..
Mulakamanchamante inka kirru kirru..
Surrumanna scenelanni phone lo friends thoti cheppinaa Chepina
Chepesavetti..

Five star hotel ante kacha picha..
Pampu settu matter ite racho rachaa..
Annamata cheppagane ..
Ireland’u greenland’u newzeland’u..
Netherland’u thailand’u phinland’u..
anni landula papaleeda land ayyaru..

landayyara mari memem cheyyali
Hand meeda handeseyyandi..
Landu kabja cheseyyandi..
Ringa ringa Ringa ringa

Hand meeda handesesthame..
landu kabja chesesthamey
Ringa ringa Ringa ringa



Monday, August 3, 2009

Obsessed with Mac? Install XP with Mac OSX dual boot

This post is dedicated to all those disheartened souls who are very much obsessed with the creativity of Mac but couldn't afford to buy one because of reasons unexplained. Atleast I couldn't afford to by Mac Air inspite of it being the most wanted model. With the launch of Leopard OSX, Apple provides a brief respite for all the Mac lovers. By adapting its software to x86 architecture, Apple thus supports its software to run on x86 supported hardware.

To put it in short, now one can install any kind (Linux/Windows) of OS on Apple Mac Books and install Mac OS X on any kind of hardware with dual boot or triple boot facility.

After much struggle, I put down this guide to for all Mac lovers to install OSX on their laptops.

This guide is strictly for INTEL 32-bit Processors only. I have not tried installing OSX on other processors.

I strongly suggest you to backup your Primary Partition (like C Drive) with some tools like Symantec Ghost before proceeding any further. If you miss any one of the steps listed below you may screw up your master boot record and may end up with two non-working Operating Systems installed on your system.

What all you need:

1) Some kind of Ghost software to back up your primary drive
2) Kalyway 10.5.2 DVD (Either download it from torrents or you can have it from me)
3) GParted Live CD (download the first one)
4) One blank DVD and one blank CD/USB Memory Stick
5) A bootable WinXP CD (only if any thing goes wrong)

Disclaimer: (Pasted as is from wiki.osx86project.org)

I am NOT responsible for anything that happens to your system. This is a relatively easy process, but if you mess up with the partitioning you could POTENTIALLY cause damage to your drive! Follow these instructions to the letter and you should be fine, BACKUP YOUR IMPORTANT FILES! Don't mess around with the install!

Don't let that put you off though, having one of these is a great experience.
If you enjoy the final outcome, consider donating to the Kalyway team or even more importantly, buy a license. (Ofcourse we will never do that.. ;))

Note: I did not backup my files, screwed up my MBR and had to format my primary drive. So I strongly suggest you to backup your important files.

Installation Process:

**I assume you have a fully functional Windows XP istalled on your laptop.

**Create a new partition for installing OSX. Make sure the new partition is also a primary partition (primary but not active partition)

**Make sure you are installing OSX on a primary partition but not extended partition

OS X Install

  1. Now we get to the cooler part of the install. Put your Kalyway disk in your drive and restart your computer.
  2. If your computer boots back into XP, change your boot order settings to read from the DVD before the hard drive.
  3. when you get to the screen that says “starting Mac OS X installer”, press the F8 key on your keyboard.
  4. then type “-v” (no quotes) and hit enter.
  5. The DVD will now boot into the Installer for OS X. Be patient as this can take a while.
  6. After the installer starts up, hit the arrow and wait for the Welcome screen to pop-up.
  7. Now, before you hit continue, at the top of the screen click on the menu that says ‘Utilities’, then click on ‘Disk Utility’.
  8. When the disk utility comes up, you should see on the left side of the screen your hard disk.
  9. Select the partition that you are going to install OS X on. Make sure the partition you select is not your Windows
  10. partition. You can make sure of this by checking the file format of the partition in the bottom-left portion of the window.
  11. Once you have the correct partition selected press the tab that reads ‘Erase’.
  12. In the drop-down menu select ‘Mac OS X (Journaled)’ and name it something simple like ‘osx’ or ‘leo’. DO NOT use a “space” in the name or any other special characters such as % or &.
  13. Press Erase and press it again in the pop-up.
  14. Close out of the Disk Utility by clicking on the red button in the top left corner of the window.
  15. You’ll now see that you are returned to the Welcome screen. Click Continue and agree to the Licence.
  16. In the Installation destination screen select the partition you just made. Click Continue.
  17. Now click the customize button.
  18. At the bottom open up the sub-selection menu and de-select the bootloader for GUID. Then select the bootloader for MBR. This is the MOST important part of the entire install! If you do not select MBR, you will be stuck with a non-working install!
  19. Close the customization window.
  20. Click Install. (You can skip the media check if you wish.)
  21. At this point depending on the amount of RAM you have, and the speed of your processor, The install can take almost 15 mins.

Boot Loader Configuration

  1. After the Installation has completed, restart your computer with the Gparted Live CD in the drive.
  2. Press enter for all the defaults whenit asks. (Unless, of coarse, you have a different keyboard layout.)
  3. When the graphical interface is done loading, find your Windows partition (it will be formated as NTFS.) and click on it.
  4. Now right click it, and choose “Flags”
  5. Now place a check mark in the “boot” checkbox.
  6. Close the window, and click Exit. As your computer restarts, remove the Gparted CD from your drive and boot into XP.
  7. Once in XP open up My Computer and go into your C: Drive.
  8. If it says that the fles on this drive are protected, just click the continue button.
  9. In the Menu bar click Tools –> Folder Options
  10. Click the view tab in the new window.
  11. Check Hide protected System Files and Show Hidden Files and Folders.
  12. Now Close that window and go back to your drive. Open the file named boot.ini or just boot.
  13. copy this into the last line of text C:\chain0="Mac OS X86"
  14. Save and close the file.
  15. Put your Kalyway DVD in your drive.
  16. Copy the file called “chain0″ to your C: drive.
  17. Close and restart without the Kalyway in your drive.

Congratulations! You should now see an option to boot XP or Mac OSX 86! Choose which one you would like and boot.

If you are having trouble leave a comment and I’ll help!

For complete details please go through the link pasted below. The credits go to the original content writer.

http://maconpc.distinctlyjordan.com/2008/03/20/how-todual-boot-xp-and-leopard/



Wednesday, December 3, 2008

How file association works in LINUX?

Am being so comfortable with VLC Media Player on Windows, I decided to use the same on Ubuntu Linux. But the problem was, whenever I try to browse a movie double-click on the file, it would open with the default Totem Movie Player. It seemed so simple to modify the file association and set out to give it a try just like in windows. And ofcourse this wasn't anywhere similar to the Windows registry stuff.

This irritated me for a couple of weeks, I knew it would be some stupid settings somewhere deep inside the folders which I just couldn't find. So, I set to find the answer.. After few days of internet research, this topic was created, so you don't need to waste time as I did.

This topic gives you an insight on which files are needed to be modified to change the system file associations. All the below listed modifications requires root access.

1) /usr/share/applications/defaults.list
This file contains the applications which cause a double-click success. All Mime types will point to a desktop file (A desktop file is nothing but an ascii file one for each application with some standard information about the application like category it belongs to, mime types it supports etc.,)

2) /usr/share/applications/[application_name].desktop
This is the file where "defaults.list" will point to. One of the most important things inside this file is the entry "MimeType=".

3) /usr/share/applications/mimeinfo.cache
Contains information in similar form shown for file "defaults.list" in same directory. This file contains ALL associations given to a mime type. There is no need for a specified order of desktop files.

4) /usr/share/mime (Directory)
This directory contains several information. The sub-directories - excluding packages - contain information about given mime types. You'll see that many mime types already exist.

5) /usr/share/mime/globs
This file contains the file extensions, associated to the mime-types.

Example: VLC Player should start .avi files by Double-Click

Creating the desktop file
If it is not already existing, create the file "/usr/share/applications/vlc.desktop" like this:

[Desktop Entry]
Name=VLC Movie Player
Comment=Play multimedia files and media
Icon=vlc
Exec=vlc %f
Terminal=false
MimeType=video/x-avi;video/x-msvideo;video/quicktime;video/x-ms-asf;video/x-ms-wmv
Type=Application
Categories=Application;AudioVideo;
Encoding=UTF-8

Modify defaults.list
This file will init our DEFAULT application. It ONLY contains ONE desktop file for EACH mime type:

video/x-msvideo=vlc.desktop
video/x-avi=vlc.desktop


Modify mimeinfo.cache
To take effect as default application and init the double-click feature, we need to modify the mimeinfo.cache also:

video/x-msvideo=vlc.desktop
video/x-avi=vlc.desktop

This file can use MORE then ONE desktop file. If you want to be able to handle - for example - avi files with different players, a line like this is also acceptable:

video/x-msvideo=vlc.desktop;totem.desktop

This will change the right-click-menu and insert Totem Movie Player, while vlc is still default (with double-click)

After modification, log out and log in again... and there you are all set.

You can get a much cleaner filetype association tool by ’sudo apt-get assogiate’.

Monday, November 10, 2008

I Hate Myself

Not my original composition. Found somewhere in the net. Seems good. ;)

I hate myself
more and more each day
as my feelings are torn
and ripped apart.

I hate myself little by little
and want to die
just to escape all this
pain and suffering inside.

I hate myself now
because of emotions in me
that only lead to lies
and hurt each time.

I hate myself more
and more each day
as I scream out loud
for losing everything.

Saturday, September 13, 2008

An Eternal Falsity

All of our life, we've been lied to.

We've always been told what life is about and how its supposed to be. Take birth and grow up well. Do best in school, make lot of friends, find a girl/boy friend, enjoy schooling/college hood, get a well paid job, buy a nice house, marry a beautiful boy/girl, have kids, find some hobbies to entertain you, watch tv, go to temple, do some charity, go on a vacation, retire after few years, spend your oldage time with grand kids, look back into your life in nostalgia and look forward to death.

This is what we are supposed to do, to make ourselves happy, to make every one else happy... this is what normal people do.. this is what everyone else is doing. Oh yeh, some times there are few aberrations here and there, people some times slip off, but you can get back on track any time.

The biggest lie is that in the course of life, all the time you feel that you will be happier by achieving one or more of the above listed things, but the reality is the more you get the more you feel depressed. The more you crave, the more you cry. And after all, this is what has been expected from a human being for centuries and will be expected for centuries to go.

Human beings seem to have a basic design flaw. We're fucked up species, striving to be healthy and happy while simultaneously destroying ourselves and each other in million possible ways.















Custom Search

Wednesday, September 10, 2008

ఆయ్ మేమంటే అంత చులకనా!!

సాఫ్టువేరు ఇంజనీర్లంటే అందరికి ఎంత లోకువో.

సినిమాలోళ్ళ దెగ్గర నుంచి దారిన పోయే దానయ్యల వరకు అందరికీ వీరి మీద వారి వారి అభిప్రాయాలే.
అవునయ్య నేనూ సాఫ్టువేరు ఇంజనీర్ నే, అందుకే డిఫెండ్ చేసుకుంటున్నా... ఏం తప్పా??
ఒకడిని చూస్తే బ్రాహ్మి సాఫ్టువేర్ ఇంజనీరని, ఏజ్ బార్ ఐన ఒక
డొక్కు గాన్ని చూపించి సాఫ్టువేర్ ఇంజనీర్ కి ప్రతీక గానిలబెట్టేస్తారు.

ఇంకొకడిని చూస్తే పనికిరాని వెధవలందరూ సాఫ్టువేర్ లోనే తగలడినట్టు, చటుక్కున జాబు తెచ్చుకొని లటుక్కున ఫారిన్ఛాన్స్ కొట్టేసి, ఆడపిల్లల వెంట పడేటట్టు చూపిస్తాడు.

గుడ్డిలో మెల్ల లా ఒక్కో సినిమాలో సంతోషంగా ఉన్నట్టు కూడా చూపిస్తారనుకోండి.

ఇక సినిమాలిలా ఉన్నాయి అనుకుంటే బయట అడుగు పెడితే చాలు ఆటో వాడి దగ్గర నుండి, ఇల్లద్దెకిచ్చే వాడి వరకూసాఫ్టువేర్ ఇంజనీర్ని దోచుకోవాలనుకునేవాడే.

మా కంపెనీ ఎదురుగా ఆటోలుంటాయి. ఎక్కడికయినా వెళదామని వాడినడిగామా మీటరు మీద ఇరవై రూపాయలుసార్ అని పళ్లికలిస్తాడు , వెనక కంపెనీ వంక చూస్తూ, సర్లే పక్కనోదేమైనా వస్తాడేమో కనుక్కుందాం అనుకుంటేవాళ్ళంతా ఒకటే (ఇలాంటి వాటిల్లో మాత్రం సంఘటితంగా ఉంటారు). అప్పటికే రెండున్నర రెట్ల వేగంతో తిరుగుతున్నమీటర్ మీద ఇరవై రూపాయలు ఎక్కువ సమర్పించుకొని పక్కనున్న ఐదు కిలోమీటర్ల దూరం వెళ్ళాలి.

ఇక ఇంటద్దె కోసం స్నేహితులు వెళ్తే ఎక్కడ పని చేస్తున్నావని అడిగి, సాఫ్టువేర్ అని వినపడగానే దొరికాడురా బకరా అనిఅనుకుంటారు. అదీ బాచిలర్ అయితే ఇక వాళ్ల పంట పండినట్టే. సడన్ గా ఇంటద్దె రెట్టింపయిపోతుంది. ఏం అంతసంపాదిస్తున్నవుగా ఇవ్వడానికేం దురద అని చూస్తారు. ఇంకొందరయితే మీకు కంపెనీ లీజు వస్తుందిగా అని రేట్లు ఇంకాపెంచేస్తారు, ఏదో కంపెనీ మనకు ఫ్రీ గా ఇచ్చేస్తున్నట్టు, మనం సిటిసి చక్రం లో ఉన్నట్టు తెలీనట్టు నటిస్తారు.

ఇక సర్లే ముగ్గురం కదా పదిహేనువేలు వాటాలో ఐదు వేలేగా అని జనాలు సమాధాన పరచుకొని వారికి బంగారుబాతులవుతారు.

ఇదంతా ఒక ఎత్తైతే.. ఇక బట్టలు, సినిమాలు, మాల్స్, తిండి ఏది చూసినా బొక్కే. ఇవ్వన్ని చెయ్యకుంటే సాఫ్టువేర్ఇంజనీర్ కాదన్నట్టే లెక్క జనాలకి మరి. మల్టిప్లెక్సు లోనే సినిమాలు చూడాలి. లీ, లేవిస్ జీన్స్ కట్టాలి. పిజ్జా, బర్గర్, కాఫీ, షాపులలోనే వీకెండ్స్ తిండి తినాలి. మాల్స్ లోనే షాపింగ్ కి వెళ్ళాలి.

ఏదైనా చెయ్యకపోతే మళ్ళి పక్కనోళ్ళు
వెర్రి వాజమ్మ కింద జమకట్టేస్తారో అని భయం.

ఇకపోతే ఇంటిపక్కనోళ్ళు, బంధువులు, స్నేహితులు వీరి పైన పెట్టె ప్రెస్సర్ చూడాలి. అదేంటి బాబు నువ్వప్పుడేఉద్యోగంలో జాయిన్ అయ్యి మూడేళ్లు అయ్యింది. ఒక్క జాబు కూడా మారలేదా? మా వాడు అప్పుడే నాలుగు ఉద్యోగాలుమారిపోయాడు తెలుసా.

ఇంకోడు అర్రే ఇంత ఎక్స్పీరియన్స్ ఉంది ఇంతేనా వచ్చేది. మా చుట్టాలబ్బాయికి ఐతే పది లక్షల జీతం వస్తుంది అని జాలిచూపుతాడు.

ఇంకోడేంట్ర అంటే నేను కనిపించగానే తెలుగులో కాక ఇంగ్లీషులో మాట్లాడతాడు, నేను తెలుగుగో మాట్లాడినా .. ఇదెక్కడిగొడవరా బాబు నేను సాఫ్టువేర్ ఇంజనీర్ నేనా అన్నట్టు డౌట్ గా చూస్తాడు.

ఇక స్నేహితులు కలిస్తే నీకెంత రా నాకెంతరా లు మామూలే.

ఇక మామూలోళ్ళు అందరూ నీకేంటి ఐదు రోజులే పని, రోజుకెనిమిది గంటలే పని వేలలు అని ఎక్కించేస్తుంటారు. అక్కడవారానికి పది రోజుల పని చేస్తూ, రాత్రి నిద్రపోకుండా పని చేసేవాడు ఎక్కడ చెబితే అలుసైపోతామేమో అని ఎహేహే అనిఒక పిచ్చి నవ్వు నవ్వుతాడు.

ఇవ్వన్నీ తట్టుకొని ఎక్కడికక్కడ జేబులు గుల్ల చేసుకొని, మాటలు పడి నెగ్గుకురావడం అంత ఈజీ కాదని మనవి. కాబట్టిఈ సారి మీకో సాఫ్టువేర్ ఇంజనీర్ కనిపిస్తే బ్రాహ్మి సాఫ్టువేర్ ఇంజనీర్ ని కాకుండా
ఏ బిల్ గేట్స్ నో, స్టీవ్ జాబ్స్ నో గుర్తుతెచ్చుకోమని మనవి.

Sunday, August 31, 2008

Install Cygwin with KDE Desktop

This tutorial is mainly aimed at all those frustrated souls who made several futile attempts of installing Cygwin with KDE Desktop environment. I am one of those frustrated souls who finally succeeded in installing the same and would like to help my fellow netizens to be successful. Long before, during my internship I used to work on unix using Cygwin with KDE desktop on top of it and was totally impressed by the flexibility and the user friendly features it provides which is the only reason for struggling almost 2 weeks to install the same on my machine.

I would like to put this tutorial in such a way even a novice programmer or even a fresh man of the college can install Cygwin with KDE desktop. So, I am making some that the person reading this tutorial no experience of installing either Cygwin or KDE. The latest Cygwin DLL release version I used is
1.5.25-15.

So, lets start the installation. Just blindly follow the instructions listed below:

1) Download the Cygwin installation executable from
http://www.cygwin.com/ . (I assume that you are intelligent enough to download the setup.exe file from this site)

2) The setup.exe itself is a very small file, the installation downloads all the required files from the internet and does the setup.

3) Start the setup.exe - you should encounter something as shown in Image 1.

Cygwin Installation - Image 1

4) Click "Next" and proceed.

5) In the next screen, you will encounter three options, the first option is actually combination of the next two options. If you are reading this blog, I suppose you are installing Cygwin for the first time and advice you to select option 1. Cygwin setup first downloads all the requried files and later installs them one by one. Select required option and proceed further by clicking "Next".

Cygwin Installation - Image 2

6) In the next screen you will be asked to give the location of the root directory, leaving the default values doesn't do any harm. So, don't touch any thing and lets proceed.


Cygwin Installation - Image 3

7) Next, location where to store the downloaded files, its a personal preference, give any location where you want to store the installation files.


Cygwin Installation - Image 4

8) In the next screen, select the option based on your internet settings.

Cygwin Installation - Image 5

9) After clicking Next, the installer downloads the list of mirrors from where the packages for Cygwin will be downloaded. Choose the mirror closes to you for faster download time. Please note that these files are very large, so spare some time to choose a mirror nearer to your location. The list of mirrors locations are given at http://www.cygwin.com/mirrors.html .Check out this page to make a decision on the list of mirrors nearer to your location.


Cygwin Installation - Image 6

10) On clicking Next, the installer downloads the information files from each of the selected mirros and shows a page with all the available packages. This is the most crucial and difficult part of the installation. To make things easier, just do as listed, If you are making any other choice, I assume that you know what you are doing. Click "View" button, to show the "Categorical" view of all the available packages. In the top node, of the tree, you will find node "All" and "Default" next to it. Just click on "Default" untill you get "Install" in the location of "Default". Install being just blindly install all the available packages. If you are intelligent enough to make a right decision on what packages you require, then you are most welcome to do so.



Cygwin Installation - Image 7


Cygwin Installation - Image 8

11) This time, when you click "Next", the installer will start downloading and unpacking the packages. Once all the downlading is done (Go and have a jog or some snacks or atleast have a cup of tea.. ;)) it will take some time.. (not some, a long time to download and install all the packages).

12) Be prepared to encounter few error messages, but donot panic. ;) (I encountered this error message a lot of times saying "Error while downloading the packages" at 99%, you can imagine how irritating it would be after waiting for 5-6 hours for complete download)

13) After step 12, you are all set with the Cygwin installation, but you still need to set some environment variables to finish the Cygwin installation.

14) Right Click on the "My Computer" icon and select Properties from context menu and select "Advanced" tab. At the right bottom corner, you will find a button "Environment Variables".

15) Click the button and you will find the "Environment Variables" page.


Cygwin Installation - Image 9

16) Under the System Variables, you need to add the cygwin path to the "Path" variable.
Edit the "Path" variable and add the following locations to that.

c:\cygwin\bin;c:\cygwin\usr\bin;c:\cygwin\usr\X11R6\bin

17) Add a new variable, with Variable name : "DISPLAY" and Variable value : "127.0.0.1:0.0".

18) Now you are totally done with Cygwin Installation. Lets proceed with installation of KDE Desktop.

19) Now, follow this link http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/ and download the required packages.
Note: The next few steps need to be executed in Cygwin bash shell
20) Open the Cygwin Bash Shell, and download the required packages.
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/qt-x11-free-3.3.4-1.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdelibs-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdebase-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdepim-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdesdk-3.4.1-0.tar.bz2

tar -C / -xjf qt-x11-free-3.3.4-1.tar.bz2
tar -C / -xjf kdelibs-3.4.1-0.tar.bz2
tar -C / -xjf kdebase-3.4.1-0.tar.bz2
tar -C / -xjf kdepim-3.4.1-0.tar.bz2
tar -C / -xjf kdesdk-3.4.1-0.tar.bz2


21) Make sure that no Cygwin process is running.
1. create file list
find /opt/qt/3.3 /opt/kde3.4 -name '*.dll' >/tmp/files.lst
2. close *ALL* cygwin processes
3. open a windows command shell (cmd.exe) from Start/Run and goto cygwin installation root
cd c:\cygwin bin\ash bin/rebaseall -b 0x61000000 -v -T tmp/files.lst

22) With this now we are done with the KDE installation. But we need to write a small script to start KDE desktop.

cat >~/startkde #!/bin/bash
cygserver &
export CYGWIN=server
export SHELL=/bin/bash
xwin -fullscreen -noreset &
xwinclip &
xhost +
/opt/kde3.4/bin/startkde
kdeinit_shutdown
taskkill /IM xwin
taskkill /IM xwinclip
taskkill /IM cygserver

[press ENTER, then CTRL-D]

chmod a+x ~/startkde

now you can start kde with

~/startkde &

23) To display only kicker (uses Xwin multiwindow mode)

cat >~/startkde
/usr/sbin/cygserver &
export CYGWIN=server
export DISPLAY=127.0.0.1:0
xwin -multiwindow &
xwinclip &
xhost +
export SHELL=/bin/bash
kdeinit +kicker &

[press ENTER, then CTRL-D]

chmod a+x ~/startkde

now you can start kde with

~/startkde &

stop kde - run

kdeinit_shutdown

then close the bash window

24) This ends the tutorial for Installing Cygwin with KDE Desktop. Have fun.



Friday, August 1, 2008

Emptiness

I don't know how common this is, but for me, the main problem is that I feel disconnected from everyone and everything.

I have a few people out there who I care about, or who care about me, but no real intimacy with anyone. Worse yet, this is a long term pattern with me, it's been going on for enough years yet that it's quite possible I will be alone for the rest of my life.

This totally sucks.

I would like to have friends I could be truly close to, someone that I could be in love with, but I'm psychologically fucked up enough that I don't know how to make this happen.

I like to think that if I had love and intimacy in my life, life wouldn't suck nearly as much.

And hell, I think I've reached the point where I'm jealous of cult members. Those poor deluded fuckers who shave their heads and dance around in public begging for donations, or the heaven's gate suicide cult, at least they have a sense of purpose, of belonging. They must have a sense of devotion for their beloved cult leaders.

Is there any way of having meaning in life when I am disconnected from everyone and everything? I don't think so.










Custom Search



Whats common between Girls & Drugs?

Girls are very similar to Drugs, they are same genre,

1) Drugs are expensive
So are girls, ;) poor guys right from the day one of courting or living together, all the expenses of coffe shops, movie tickets, snacks, gifts ... (god knows where the list ends) should and will be borne by the poor chaps - Now I can understand why every father feels so happy after getting her daughter married, as a fellow being, we should understand the pain in supporting expenses of two ppl at a time, wife and daughter - feels good if some pain is relieved or passed on ;) As the Law of Physics says material cannot be destroyed or created, similarly the pain (of having a girl friend or a wife) cannot be created or destroyed, it can only be passed on.

2) Drugs are harmful to health
Needless to quote any illustrations.

3) Drugs are addictive
This is the only reason why even after centuries have passed adding more and more examples to the above two facts; still we find a lot of couples on this planet.

4) Once addicted to drugs, very difficult to recuperate
Once you feel the warmth of a woman's love, its very difficult to recover from it, and ultimately man has to succumb to the above three hazards.


Life Sucks...

We're all trapped.

Each of us is stuck being who we are. Sometimes we fight to change ourselves, but ultimately this has little effect. We can change what we do, but we cannot change who we are.

If you're a happy person, you don't feel trapped. If you're surrounded by people who you love and who love you, if you can do what you want to do in life, if you are at peace with who you are, why would you ever feel trapped? You wouldn't want to change yourself, you wouldn't need to try.

If you're a happy person, hey, you got lucky! Go back to the previous page, you'll find nothing of interest here.

I am not a happy person. Maybe you're not either. Maybe you're too fat, or too thin, too old, or too young. Maybe you're ugly and nobody wants to sleep with you. Maybe everyone wants to sleep with you, but nobody loves you and it's all meaningless. Maybe your body is fucked up and you're in pain all the time. Maybe your mind is fucked up and you're in pain all the time.

So you struggle with all these problems year after year, and you're getting nowhere, and you wonder if anything will ever change. And the unavoidable reality of it all is that, for you, life sucks.

But of course you're not going to give up so easily, you're going to keep struggling to solve your problems, to change yourself, to find happiness, wherever it is, whatever it is. But still, life sucks.

And you see all these people out there who are blissfully free of your problems, and if they can do it, there must be some way for you to as well. But they aren't doing you any good at all, they don't understand what it's like being you, and what good would it do you if they did understand?

So, the forces which created you, random or otherwise, have spoken. And they've determined that, for you, life sucks.



Suicide

I am not suicidal. My life sucks and I hate the way I am, but I don't feel the need to forcibly end it. Life is pretty short anyway, and I'm 23 already, so I don't see what the hurry is. Forty or fifty more years will go by soon enough. If people lived for thousands of years, that would seem unbearably long, but I can certainly do 80 years. Besides, I still have the hope, realistic or not, that someday I'll manage to find some happiness in my life.

Anti-suicide efforts often tend to irritate me, in a way. Society doesn't want people to kill themselves, but I suspect this is mostly for practical reasons. After spending two decades raising, clothing, feeding, and educating you, society expects to get many more decades of work out of you in return. If you die early, everyone else has been cheated of the payback they were expecting for all that effort they put into raising you. You can be as miserable as you want, but for God's sake, don't kill yourself.

Now, all of that said, as for what people who are suicidal should do, I can't give you some well thought out, logical answer as to the right course of action. I can only relate my own feelings on it.

I've known two people in my life who did commit suicide. Both were women who I'd only had a small amount of contact with, I didn't really know either of them. Both times, I heard about it afterwards, and I had the same reaction. I was very sad about it, I wished I had gotten to know them, I felt that if I had, I could have helped them somehow.

So I don't want anyone to kill themselves, and I guess I feel that no matter how much pain someone is in, their pain can be made bearable by talking about it with someone who cares about them.

Alright now, those last few paragraphs were far too positive and lacking in cynicism for me.




Unknown..

Maybe life sucks because we're all really just big brained primates who were meant to be living in small tribal groups hunting and gathering food, and our pain is the natural result of our living in an unnatural environment.

Maybe life sucks because we haven't turned our lives over to some cultural deity or whoever the One True God happens to be.

Maybe life sucks because we all have chemical imbalances in our brains.

The first proposition implies that the answer to life's problems is to abandon technology. This was put forth recently by the Unabomber, and before that by the Khmer Rouge of Cambodia.

The second is claimed by hundreds of different groups of religious fundamentalists, all of which disagree on the identity and nature of this One True God.

The third is put forth by psychiatrists.

I'm not sure which of the above groups is worse, but given their accomplishments or lack thereof, I highly doubt they have any answers for us.

So, I don't know the ultimate cause of, or the solution to, life's problems. I don't know how to end this with any helpful advice or words of wisdom. If you think you do, email me and let me know.



Grass isn't always greener on the other side

If its true, then there wouldn't be ny job hoppings in this world

Why am I so fucked up?

Why does life suck so much. What am I? What is the motive in life? Shouldn't there be some purpose of living this life. What do I need and what do I expect from life? Do I really deserve what I got? Am I worthy enough for all what I got? Is it something wrong to expect things from life? Is it wrong to crave for something better always? What if the crave for something better turns out to be the only reason for unhappiness?