Showing posts with label Tech. Show all posts
Showing posts with label Tech. Show all posts

Linux, The Anti Virus? :P


Well I switched on my PC after a four day break in which I had gone to Chennai. And I am welcomed by this pop up box. A virus. Great!


I was actually a little happy that something like this happened because it proved that avast! was doing something to protect my pc( I had long doubted if it did anything at all). Mr.avast! showed the same trojan was present in all my drives. I clicked delete and for a full five seconds everything seemed fine. Then the pop up came. Again. Same trojan, same place. The trojan refused to get deleted. Well guess avast! is not exactly the best anti-virus around.

I thought I would delete it personally but the file wasn't visible. Of course. It wasn't a hidden file too. Well after trying to solve this using Autorun Eater, Spyware Terminator both of which are in my PC and being too lazy to find a better anti-virus, I began to wonder if it was time to format my PC. Then I remembered something. Linux.

I have a distro of Linux (TOSS) in my PC. Now TOSS and Windows are two different OS and have their own way of handling files. So I went into TOSS and into my C Drive. And there it was, the trojan sitting pretty. It had even created a text file of size 1.5 GB! After a few seconds hesitation, I shift+deleted the trojan from all the drives and any other suspicious files. Restart. Windows started without much fuss. No trouble from trojans. avast! went back to do it's job(which am still not sure about).

Though the method to get rid of the trojan seemed crude, it did work and my PC has been running well so far. Linux ftw i guess :)

Noetics?


9:58 pm. Sunday the 27th,2009.

He was busy reading The Lost Symbol. It had been long time since he had been so engrossed in a book. It told him a fascinating idea about the power of the mind. "Like matter, the thoughts in a brain also contain mass. This 'particle' if focussed correctly could be used to alter physical matter..."

His concentration was suddenly broken when out of no where two loud speakers started singing loudly and rather annoyingly. He tried his best to ignore it. "Thus if the mind is trained well and made to focus on a particular thought, it can be used to affect the outcome of an event. While this may seem like advanced magic it.." Darn loud speakers, he thought. What the f*** did they ever actually accomplish. "..has already been mentioned in the ancient literatures itself. One only needed to see the Vedas or the Bible or any other similar text. They say the same..".Arr how I wish they shut the loudspeakers.And just like that, the loudspeakers started malfunctioning and was forcibly switched off.

"Our fore fathers have always believed that the mind held supernatural po..".Wait a minute. Did I just shut the loudspeakers using my mind. Did that happen because a lot of minds in my area thought the same?.Maybe I do possess super powers,his heart said. You need to get some sleep, said his intellect.

Note : To know about noetic science, read The Lost Symbol or see theintentionexperiment.com

See C

Well having attended a few C debugging contests, I found C can get very interesting even at the very basic levels. Here is a few questions that are worth understanding if you got any interest in C :)

*)First is the simple printf statement. Consider
int i=5;
printf("%d,%d", i, ++i);

If you guessed output as 5,6 - sorry.

Thing is printf first evaluates all the expression from RIGHT TO LEFT before printing the actual values. So actual answer would 6,6.

*)Now the comma operator. They always asked questions involving this. I didn't even know what it meant till I saw this.

*)The playing with increment/decrement operator. Consider
i=5;
j=i+++++i;

If you split the second line as j= (i++) + (++i) and calculated the appropriate value, then congrats, you made the same mistake as me :)
Seems it actually gets divided into (i++) ++ (+i) so it becomes an invalid expression.

*)Problem is to print "Hello World" without a single semi colon in the program :D

Now I thought of macros,recursion,function calls blah blah blah but as always the answer was one hell of a simple solution.
Just put the printf statement in the if condition or for/while condition thing and job done :)

*)The mother of all C questions :D
int a,i=5;
int *b=&i; //Creating pointer to i
a = i/*b;
What is value of a?
If the answer 1 popped up in your mind (after all we divided a value by same value), ha ha ha! Compile,run and see :D

Shift+Delete


I have a drive full of movies. And soon I ran out of space. So I decided to remove few movies. Cars got shift+deleted. Next was Angels and Demons. But this popped out an error. "The file does not exist in the system" or something very similar to that. I tried deleting the folder again. Same error. I restarted my system. The error didn't change. I couldn't understand what was going on. How could the file not exist??? I mean, it was right in front of my eyes.

I googled and found many strange solutions for this strange error. I tried many of them but in vain. I tried to create a rar file out of it and encountered same error. Yet the movie inside the folder ran perfectly fine. This kept me wondering for a few days. Then I did what I always do under these circumstances.

Restart. Go to Ubuntu. Mount the media. Now I tried Shift+Deleting the file. Angels and Demons was deleted successfully. What Windows failed to do, Ubuntu accomplished without a fuss. Ofcourse I still don't have a clue why that error came. But from experiences like these I have learnt something.

If something doesn't work in Windows, try in Ubuntu.
If you want to do something, try Ubuntu.
If it doesn't work in Ubuntum it's not worth doing.

Intel 945G - Not The Worst?

I have owned a computer for as long as I can remember. And none of the computers I owned ever had one of em "dedicated"( ah, how I hate that word) graphic cards. Guess the main reason for that is my father knows good deal about computers and hence knows "graphic cards" means "hardcore-gaming". And let's face it. No father is gonna let their son ruin(are so they are led to believe) their lives playing games 24x7. Hence I have always been left to contend with the Intel 945G chipset(now that's another word I have grown to dread).

I can never forgot the times I had to sit through half an hour of solid installation only to be shown a message like this (accompanied of course by the all-too-famous Bump! sound). After a few more double clicks I would be forced to accept the painful truth.

Couldn't they just do a small test before the actual installation in lieu of wasting my time and tell me that their high-end game makes my PC a goner? Ah, fate does enjoy such petty moments I guess.

Of course few games did run on my PC. And I am very thankful for that. The better games that have been kind enough to run on my PC were Warrior Within, T2T, NFS MW and FIFA(after a lot of prayers, 09 worked) etc. It goes without saying that these didn't look at their best but hey, anything is better than that error message na. This was all before that fateful day when I was googling for fun.

For people who share my lugubriousness in gaming, I have two words. SwiftShader and 3d-Analyzer. I stumbled upon these softwares and they provided, inter alia, an option for "emulating HW TnL capabilities". My eyes immediately lit up because the absence of this "HW TnL"(no idea what it actually is) was sited as one of the reasons why games failed to run on my PC. Hence I tried to gives these a try.

The error message shown in the pic came when I tried to run Return Of The King. And being a huge fan of LoTR I was much disappointed.I tried the game with 3d-analyze and it worked! I was kinda taken aback by this uncanny behaviour showed by my PC. RoTK turned out to be a pretty decent game in the end :)

And the good news didn't stop there. A whole other bunch of games which had previously belittled my PC suddenly worked fine. The list included Splinter Cell, Portal, Deus Ex2 etc. But as with all things, they too had their shortcomings. A few other games failed too. Inspite of that, I finally decided that the Intel chipset(that word now seems ok) was after all, not the worst in the buisness.

P.S : To people who have "high-end" PCs I have this to say - "A day will come when you too shall hear the Bump! error"

Time Travel - Myth or Fact

Time traveling is one of the most fascinating branches of physics. The very idea of taking a peek into our future - in the literal sense - and watching our past actions kindles the heart. Scientifically time travel has never been proved. On the other hand, there is no actual proof or theory to deny such a possibility. Let's take a look at some of the interesting theories proposed for this.

The idea closest to time traveling that has strong scientific foundations is time dilation. Time dilation is the idea wherein the clock of a moving person appears to be 'running' slowly when compared to the clock of a stationary person. There is too way of explaining this - special relativity and general relativity. Time dilation and time traveling can be combined in this way. Say me and my friend are at rest with our watches showing 9 am each. If he remains stationary and I start running really fast, then technically my watch would run faster than his. For eg my watch would perhaps show 9 10 am and his would show 9 8 am. Thus I would be in the future when compared to him.

There is also another theory that suggests that objects moving faster than the speed of light would time travel. Let us analyze this logically. If I run faster than the speed of light ( theoretically ofcourse ;) ) and say I turn back. The light particles behind me would fail to reach me and hence I would see only black - the absence of light. I cannot fathom what we would see if he straight ahead. I leave it to your imagination.

Another interesting possiblity arises when time - as every measurable constant possibly - is seen as a relative variable. Consider a man living one light year from us. Now we can see what he does only after one year. Hence he knows stuff happening there before we do - that is he is, technically in the future when compared to our time frame. The reverse is also true i.e. we are living in the past when compared to him.

When considering the possibility of time traveling, we must also consider what will happen if we do manage to travel in time. The only possible idea seems to be the thoery of multiple universes. Like Michael Crichton said in 'Timeline' perhaps the universe is constantly dividing into different universities where the different possiblities of an event happens. For eg an universe where I win the Kriya blog contest, one where my blog gets deleted, one where I am heavily criticed for my works here etc. Now arises one interesting question. If we do time travel, which of these possible universities will we land up in? Can we choose any one? Your guess is as good as mine.

As Stephen Hawking suggested, the absence of people visiting us from the future suggests the absence of time travelin. But then this is not enough evidence to decide the idea as an impossibilty.

While considering all these fascinating theories, one question reamins unconsidered. Where is the Hand Of God come into play when we talk of time traveling? Or is it God that stops us from jumping from one time frame to another?

From Licensed To Open Source



For years I had been a user of the Windows OS. I came to know about the concept of Open Source only during my late schooling days. That was thanks to a chapter dedicated to Linux in my 11th which explained in great detail about the commands used in Linux. For someone used to doing stuff by click-and-point actions I was not very impressed by this new idea. Hence my first impression of Linux was that it was not user-friendly.

As I started my college, the words "Open Source" and "Linux" seemed to pop up everywhere. Hence I decided to check out this non-user-friendly difficult-to-use (or so I thought) Linux . Enter Ubuntu. I was asked too many questions during installation. At one point I was so confused I gave up installing it half-way.After few days and some advise from friends, I successfully installed Ubuntu in my PC. A feeling of satisfaction filled me :D

In the next few days, I struggled through the ways of Ubuntu. The GNU available was the only familiar thing compared to Windows. I found myself using the Terminal more and more ( I haven't used DOS for more than ten minutes totally in all my life). Yet in those few days I learned more than what I had learned from all the time I used in Windows. Soon the only reason I logged into Windows was to play FIFA which being an EXE file would not normally run in a Linux Distro.

After all this I began to wonder why the Open Source softwares where not widely used. The migration seemed too slow considering the lucrative offer Open Source was. I discussed this with my brothers - all working in big multi national companies - and found out few reasons for this lack of migration.

  • Most of the companies have such large storage of data that the migration would take months - valuable time which cannot be wasted in this competitve world.
  • The lack of technical skills available when it comes to handling Open Source applications. Most people feel comfortable with Windows rather than Linux.
  • The muscle power of the big multi-national companies. These companies can simply buy off - thanks to their huge revenue - the smaller Open Source softwares.
  • While Open Source is a collection of ideas from all over the world, the Licensed products comes from a single source.This means the latter has much greater unity compared to the former.
But then all this does not mean Windows is inferior to Linux. Far from it. Windows does offer much more features compared to Linux. The only problem is that it curtails the freedom of the end user. The whole point of Linux is 'free' - free as in the user is allowed to do whatever he wishes to do with the product.
The basic difference between the Windows and Linux can be best explained by this example. Windows is like an automated car - you don't need to do much but lose the control over the system and Linux is like a geared car - you have much to do with which comes full control. It is upto the people to choose between the two.

Prog - Private Members in Java/C++

Well as we all know private members of a class cannot be accessed directly by objects. We need to use member functions to access them. This is true for all cases. Or so I thought until I encountered few cases where this ain't true.

For the first, one thing has to be understood. Memory for the member variables are arranged in a sequential manner. So by performing arithmetic calculations on the address of the public variables we can get the address of the private members and hence access them.

Second. I found this when i was looking at copy constructors. A sample copy constructor would look something like this.

class sample
{
private : int i,j;
public:
sample(sample A)
{
i=A.i;
j=A.j;
}
...
...
};

Here the object A seems to access it s private members without calling any of it's own member functions(the constructor it is present is not called by that object). Now look at the following code.

class sample
{
private: int i,j;
public:
void well( )
{
sample test;
test.i = 5; //test accessing it s private members without
test.j = 10; // use of any objects
}
...
...
}

So the point is an object created inside a member function of the same class can access the private members directly. Note that the member function should be from the same class. For eg if the well( ) func had been in another class it would show error that object trying to access private members.

There is of course another, much simpler way of accessing these private members. By simply changing the "private" keyword to "public" keyword :)

Note : The above logics are applicable in both C++ and Java.