Saturday 17 November 2012

Laptop restarts after shut down problem...solved

Recently I had problem with my laptop. whenever I shut it down or hibernated, it restarted again. After a few hours searching the internet, I was amazed to see so many people had this problem.
The solutions I found were ranged from changing LAN settings to flash the CMOS, or to restore your windows, and even reinstall the operating system.
The problem they said, was in 'not shutting down properly' which usually happens  when you do 'hibernate'. Anyway the solution which I tried and worked for me is to install a software named "RefreshPC, and that's it.
Apparently that software just restores some registry keys to their default values, resets some services  to their default settings, and removes some temporary files.
here's the link:

http://www.xp-smoker.com/refreshpc.html



Thursday 15 November 2012

Special Relativity and space travel


The theory of relativity arises from a simple assumption that the speed of light is constant as viewed from any frame of reference. That is, an observer travelling towards a light beam would measure the same speed of light as an observer who is moving away from it.
One of the consequences is that two events can never happen simultaneously. For two stationary observers, an event occuring at time t, will appear to have occured at time t', where t-t' depends on how long light takes to travel to each observer. 

So what about moving reference frames?
According to the theory, there is no special reference frame. A person on a plane crusing at a constant speed can never know if he is in motion unless they look out the window. And for all they know, the plane could be stationary and the earth could be moving underneath them. A clock that ticks every second on a plane would also take a second to tick if it was on the ground. However each observer would see a different ticking rate if he looked at the other person's clock:
If the person on the ground makes a measurement of the tick of the clock on the plane, he would first see the clock beginning to tick, but the plane would have moved by the time the tick has finished, so the observer sees a longer tick duration. Time runs slower on the plane.
Another way of looking at this is to imagine two spaceships (A and B) moving away from earth in opposite directions near the speed of light (0.9 C, where C is the speed of light). What would the speed of the spaceship A be as seen from spaceship B? 1.8 C? but we know that faster that C is not possible. The answer is actually 0.996 C. That means that time runs slower in the spaceships relative to eachother, and since distance is speed multiplied by time, the distance between the spaceships also shrinks. 

Now to space travel:

If humans ever developed near the speed of light space travel, there would still be a couple of major problems to deal with. The distance to the closest star is about 2 light years. It takes light 2 years to reach it. So from an observer on earth, a spaceship travelling near the speed of light would take slightly more than 2 years to reach it. For the passengers however, time runs slower and depending on how close you are to the speed of light, the time can be reduced indefinitely, but it can never reach zero.

 The diameter of the Milky Way galaxy is about 150,000 light years. The closest galaxy, Andromeda, is 2.5 million light years away. 

Sending probes it also difficult. We would have to wait 300,000 light years to be able to send and receive a signal across the galaxy, not to mention the signal would have to be very strong. So travelling across the galaxy is like a one-way trip. Don't expect to hear from the passengers soon. 

So why would an intelligent race want to travel this far...for resources? unlikely. Intelligent beings capable of building near the speed of light spaceships would be able to manufacture anything they want out of raw matter. Exploration? The cost seems too great. Achieving relativistic speed requires enormous amounts of energy. The most likely scenario is receiving radio signals. But depending on the distances, the signals need to be very strong...such as the signal from pulsars. Pulsars naturally produce powerful radiation at regular intervals. But to be able to control such a system would require lots of energy...perhaps beyond the capabilities of any intelligent being. 
But even if we do receive signals, there would be no means of communication within a single human lifespan. The best case scenario would probably be the fact of knowing that other intelligent life exists...nothing more.

Hope you liked the article. Post your questions below. I will be posting a much more detailed (and mathematical) article on relativity soon. Time to take my orange pill now...

U+V1+UVc2
U+V1+UVc2

Monday 12 November 2012

Anti Phishing and anti malware protection In Chrome and Firefox

This is one of my assignment for one of the subjects I had. we were asked to compare one of security features of most recent version of Google Chrome and Firefox. It is not a professional comparison.

 Introduction
In this report we compare anti phishing and anti-malware features of the recent versions of two web browsers, Firefox 15, and Chrome 22. We also compare their advantages and disadvantages and their impact on the browsing experience.
What is phishing?

Phishing and malware

Web Forgery or Phishing is the act of attempting to acquire information such as usernames, passwords, credit card details, and sometimes, indirectly, money by masquerading as a trustworthy entity in an electronic communication. Communications purporting to be from popular social web sites, auction sites, online payment processors or IT administrators are commonly used to lure the unsuspecting public. Phishing emails may contain links to websites that are infected with malware. Phishing is typically carried out by e-mail spoofing or instant messaging and it often directs users to enter details at a fake website whose look and feel are almost identical to the legitimate one. Phishing is an example of social engineering techniques used to deceive users and exploits the poor usability of current web security technologies. Attempts to deal with the growing number of reported phishing incidents include legislation, user training, public awareness, and technical security measures.

On the other hand, Malware, which is short for malicious software, is software installed on user’s machine often without user’s knowledge and is designed to disrupt computer operation, gather sensitive information, or gain access to private computer systems. It can appear in the form of code, scripts, active content, and other software. Malware is a general term used to refer to a variety of forms of hostile or intrusive software. Malware includes computer viruses, worms, Trojan horses, spyware, ad ware, and other malicious programs.

Chrome vs. Firefox

Chrome is blocking phishing websites or malware in the following way. It periodically retrieves updates of two blacklists, one for phishing and one for malware, and will show users a warning message before users visit a site that is suspected of containing malware or phishing. This service is also made available for use by others via a free public API called "Google Safe Browsing API".

Chrome will typically allocate each tab to fit into its own process to "prevent malware from installing itself" and prevent what happens in one tab from affecting what happens in another. Following the principle of least privilege, each process is stripped of its rights and can compute, but cannot write files or read from sensitive areas, e.g. documents, desktop. For example, malicious software running in one tab is supposed to be unable to sniff credit card numbers entered in another tab, interact with mouse inputs, or tell Windows to "run an executable on start-up" and it will be terminated when the tab is closed. This enforces a simple computer security model whereby there are two levels of multilevel security (user and sandbox) and the sandbox can only respond to communication requests initiated by the user.

Google has also added some new security functionality to new version of Chrome. Every time that the user downloads a file, the browser will compare it against a whitelist of known-good files and publishers. If the file is not in the whitelist, its URL will be transmitted to Google's servers, which will perform an automatic analysis and attempt to guess if the file is malicious based on various factors like the trustworthiness of its source. If the file is deemed a potential risk, the user will receive a warning.

Firefox on the other hand has the same feature and technically does the same things. Firefox gets a fresh update of forgery sites a whopping 48 times a day, so if you try to visit a fraudulent site that’s pretending to be someone you trust; a warning message will stop you before any harm is done.

Firefox’s Phishing and Malware Protection works by checking the sites that you visit against lists of reported phishing and malware sites. There are two times when Firefox checks the phishing and malware protection database and web service. The first is during the regular updates to the lists of reporting phishing and malware sites. The list on your PC is automatically updated every 30 minutes or so when the Phishing and Malware Protection feature is enabled. The second is in the event that you encounter a reported phishing or malware site. Before blocking the site, Firefox requests a double check to ensure that the reported site has not been removed from the list since your last update.
Advantage and disadvantage

Since Google has indexed most of the website in the internet it is much easier for Chrome to have the phishing websites list to be very up to date. Another big advantage is that, whenever a phishing website is running on one tab, it does not effect on other tabs or operating system itself, because every tab is running in different so called jail. Firefox, however, uses Google service called “Google Safe Browsing API”, which is big disadvantage since it uses other rival browser creator technique.

The disadvantage of the Chrome’s way of dealing with phishing and malware protection is user concern of privacy. Every time a file is being downloaded chrome send the file and the website information to Google to check against its database of safe websites and sends back the information to the browser, which some users do not like that who are concern about their privacy.

The advantage of Firefox over chrome is that it does not send any user’s information back to anywhere like Chrome does, so users do not need to be worried about someone checking their files or information by sending back somewhere over internet.
Conclusion

Overall both browsers are doing the same thing to prevent phishing and protect users from malware files and phishing websites, however, Chrome has been proved that is doing slightly better than Firefox in protecting users from this security threat.

 References:








Set Operations using ArrayList

I implemented set operations using only ArrayList and Iterator, which are part of java.util class. Java has its own Set data structure though.
The challenge for this assignment was to use only ArrayList and Iterator. I was trying to implement a BinaryTree data structure based on ArrayList and then implement my set operations on top of that. The worst case running time using ArrayList for most of the operations is O(n^2), while by using BinaryTree they can be done in O(nlog n), worst case. Here I put my code using only ArrayList features. I will make another post about my BinaryTree implementation using ArrayList.
Set class:

Here is the MySet class which implements the Set class:

There was extra mark for efficient running time which I think I won't get any, since the worst case running time for my implementation is O(n^2).
My code passed all the on line tests, however if anybody finds any problem, please leave a comment.

Leo the Pamador