Meebo Chat Bar

Friday, December 11, 2009

Google Chrome Extensions

Google Chrome Extensions for beta chrome edition...........
This post is published using the extension....

Google Chrome Extensions

Sunday, September 6, 2009

Future directions in computing

Future crunch: Six advances that could spell the end of traditional computing

* Quantum
* Light
* Spin
* Chemicals
* DNA
* Plastics

Quantum

Silicon electronics are a staple of the computing industry, but researchers are now exploring other techniques to deliver powerful computers.
Quantum computers are able to tackle complex problems

Quantum computing graphic
A quantum computer is a theoretical device that would make use of the properties of quantum mechanics, the realm of physics that deals with energy and matter at atomic scales.
In a quantum computer data is not processed by electrons passing through transistors, as is the case in today's computers, but by caged atoms known as quantum bits or Qubits.

"It is a new paradigm for computation," said Professor Artur Ekert of the University of Oxford. "It's doing computation differently."

A bit is a simple unit of information that is represented by a "1" or a "0" in a conventional electronic computer.
A qubit can also represent a "1" or a "0" but crucially can be both at the same time - known as a superposition.

This allows a quantum computer to work through many problems and arrive at their solutions simultaneously.

"It is like massively parallel processing but in one piece of hardware," said Professor Ekert.

'Complex systems'

This has significant advantages, particularly for solving problems with a large amount of data or variables.

"With quantum computing you are able to attack some problems on the time scales of seconds, which might take an almost infinite amount of time with classical computers," Professor David Awschalom of the University of California, Santa Barbara told the BBC News website recently.

In February 2007, the Canadian company D-Wave systems claimed to have demonstrated a working quantum computer.

At the time, Herb Martin, chief executive officer of the company said that the display represented a "substantial step forward in solving commercial and scientific problems which, until now, were considered intractable."

But many in the quantum computing world have remained sceptical, primarily because the company released very little information about the machine.

The display also failed to impress.

"It was not quite what we understand as quantum computing," said Professor Ekert. "The demonstrations they showed could have been solved by conventional computers."

However, Professor Ekert believes that quantum computing will eventually come of age.

Then, he said, they will not be used in run-of-the-mill desktop applications but specialist uses such as searching vast databases, creating uncrackable ciphers or simulating the atomic structures of substances.

"The really killer application will probably be in designing new materials or complex systems," he said.


Light


Computers exploit the movement or accumulation of electrons to do useful calculations. These movements down tiny wires are the reason why PCs become so hot.

Fibre optics
Optics are already used to transfer data over the internet

"We are dissipating huge amounts of power in chips right now," said Professor Stan Williams of computer firm Hewlett Packard.

And the problem will get worse as the components become smaller, making chips even more inefficient, he said.

"If we could find new ways of moving information around a chip, we could significantly reduce the amount of power that is dissipated."

A potential solution would be to use particles of light - photons - instead of electrons to move information around and between chips.

"Electrons will still be doing the computing but photons will be doing the communicating," he said.

"It sounds a little bit complex but you find that that baton pass [of data between the electrons and photons] can be far more efficient, in terms of electrical power required than just using electrons."

It is similar to the technology that is used to move data around the internet today but at a much smaller scale.

The technology could be key for transferring data between massively multiple core chips - devices with several linked computing engines.

But some researchers would ultimately like to skip this baton pass and use photons to manipulate and store data, rather than just transmit it.

Experiments are going on in academic institutions, firms such as IBM and even the American space agency Nasa. Several of the individual components needed to build an optical computer have been demonstrated and even put together into a working machine.

However, it may be some time before optical components compete with silicon because of a fundamental barrier.

"The reason it is not in circuits today is essentially cost," said Professor Williams.


Spin


Spintronics, also known as magnetoelectronics, is a technology that harnesses the spin of particles, a property ignored by conventional electronics.

Concept picture of spinning electron
Spintronics harnesses the spin of sub-atomic particles

"Until now, electronics has worked by moving electrons around or moving charge around and that takes work," said Kevin Roche of computer giant IBM. "The most obvious example of that is that if you have a laptop that runs faster, it runs hotter."

But, by using the spin of particles - detected as a weak magnetic force - scientists believe they can unlock almost infinite computing power.

"It is called spin because the maths for dealing with it is similar to the maths for a spinning ball," said Mr Roche. "An electron always has spin and it can be spinning one of two different ways: up or down."

These two different states can be used to represent a "1" or a "0" - the bits of information used by all computers.

Basic spintronic devices are already used in today's computers.

For example, most hard drives today use a "spin valve", a device that reads information off the individual disks or platters that make up a hard drive.

But researchers at firms such as Intel and IBM are hoping to take this one stage further.

"We are hoping to use it to store data, to transmit data; to do all the things we do now with charge but to use the spin property of the electron instead," said Mr Roche.

Chips exploiting spintronics would in theory be able to transmit data with spin using a lot less charge.

"So power costs go down," said Mr Roche.

IBM has already shown off a prototype spintronic device known as "racetrack memory", a device that could increase storage density by up to 100 times.

Other researchers are working on spin-based transistors, which unlike conventional transistors would not require the application of an electric current to work.

According to many researchers, spintronics could be the next big change in computing in the coming decades.

"The conventional microelectronics industry and the magnetic storage industry are approaching their limits very fast. Spintronics might offer a way out," Dr Yongbing Xu of the University of York told the BBC earlier this year.

Chemical Computing

Chemical computing is an unconventional approach to computation that uses a "soup" where data is represented by different concentrations of chemicals

Diffusion in a beaker
Chemcial computing can be used to solve a range of problems

Chemical computers can exploit several different kinds of reaction to carry out the computation.

For example, so-called conformation computers use polymer molecules that change shape in response to a particular input. Metabolic computing exploits the kinds of reactions typically found inside a living cell.

Dr Andrew Adamatzky of the University of West England works on another type.

"I am dealing only with reaction-diffusion computing," he explains.

This type of computation exploits waves travelling through a beaker of chemicals to carry out useful calculations.

These waves are the information carriers in the computer. They are created by triggering chemical reactions in the soup at specific points.

As waves propagate from different areas they collide and interact - effectively processing the information they hold. At the site of their interaction a point with a new chemical concentration is created, which is in effect an answer.

With a beaker full of thousands of waves travelling and interacting with each other, complex computational problems can be solved.

Robot gel

Although the process sounds complicated and esoteric it can be applied to almost all computational problems.

"Reaction-diffusion processors are universal computers, they can solve all types of problems," said Dr Adamatzky.

As a result, computer giant IBM is already interested in the technology.

Although slower than silicon, its key advantage is that it is cheap to produce and incredibly robust.

Working with chemist Ben De Lacy Costello, Dr Adamatzky has already produced logic gates using the technique that can be used to make chemical "circuitry".

"Ultimately, we will produce a general purpose chemical chip," he said.

The chip would be capable of mathematical operations such as adding and multiplying numbers, he said.

However, he believes he can take the research even further to create intelligent, amorphous robots.

In these, he said, silicon circuitry would be of no use

"Assume we have fabricated an artificial amoeba, gel-based robot, without any fixed shape, and capable for splitting into several smaller robots," he said.

"Conventional silicon circuits will not work because they have rigid architecture."

But as chemical computers are an amorphous blob they could be cut in half and both would continue functioning independently.

"You can not cut your laptop in half and expect both parts to function properly; you can do this with reaction-diffusion processors," he said.


DNA computing


DNA computing, commonly called biomolecular computing, is an emerging field that uses DNA and biochemistry instead of silicon-based electronics.

DNA
Professor Shapiro has designed a DNA computer to target cancer

The first proof-of-concept use of DNA to perform computation was carried out by Professor Leonard Adleman at the University of Southern California in 1994.

The original goal of the field was to use biomolecules to beat electronic computers at solving large complex problems.

"Today, most people believe that biomolecular computing will not beat electronic computers in the foreseeable future," admitted Professor Ehud Shapiro of the Weizmann Institute of Science in Israel.

Instead, said Professor Shapiro, the new goal is to try to use DNA computing to do things that traditional silicon cannot.

"What we offered in our work was a different vision," he said.

In particular he is trying to develop smart drugs that are capable of computation.

"You want a drug that can sense the biochemical environment, analyse it and, in response, release a molecule which is the appropriate drug for that particular situation," he said.

Cancer buster

In 2002, Professor Shapiro unveiled a programmable molecular device composed of enzymes and synthetic strands of DNA.

Two years later, the same team showed off another DNA computer so small that roughly a trillion of them could fit into a microlitre (a millionth of a litre).

The device was able to detect signs of cancer, and release drugs to treat the disease.

"This soup of DNA and enzymes implements a well know mathematical model of computation known as finite automaton," he explained.

"This finite automaton knows how to do very simple computation such as recognising whether a list of zeros and ones has an even number of ones."

In the case of his 2004 computer this method of computation was used to analyze ratios of specific molecules related to prostate cancer and a specific type of lung cancer.

The "computer" consisted of a chain of three segments of DNA and an enzyme which could cut the strands.

If the first segment of the DNA detects ratios of certain molecules that indicate the presence of cancer, it tells the second segment to release the third segment, which is an anti-cancer drug.

Since then, other researchers have shown off new computational systems that make use of enzymes that naturally occur in a living cell, whilst Professor Shapiro has attempted to make a more practical device.
"We have continued working in this direction trying to make this molecular system to work in living cells," he said.

Plastic

Silicon is expensive and complex to produce, requiring clean rooms and precise manufacturing techniques in plants that can cost billions of dollars.

Flexible television
Organic electronics can be used to make flexible displays

This means they are currently out of reach for low-cost products.

But organic polymers, a class of substances that are used to make everything from bin bags to solar panels, could offer a solution.

"It really opens up a whole new set of options for what you do with electronics," said Professor Art Ramirez of Bell Labs.

Highly conductive polymers were first discovered in the early 1960s and are already used in some electronic devices.

In 2004, electronics giant Philips announced a concept flexible display, while other companies such as Cambridge Display Technology use them to manufacture organic light-emitting diodes (LEDs).

Earlier this year, UK firm Plastic Logic said that it would build the world's first factory to produce plastic electronic circuits.

Although, circuits made of polymers are much slower than silicon devices, they have one significant advantage: they can be printed using techniques similar to those used to mass produce magazines and wallpaper.

"Using big drums of substrate you can put down one chemical after the other and build up something that looks like a circuit," said Professor Ramirez.

This means they are cheap and easy to produce.

And as the polymers can be printed onto flexible substrates they can also be used in totally new types of device, such as large-scale billboards or electronic newspapers.

"If you can integrate that with very simple wireless connectivity one can imagine, instead of picking up the New York Times each morning, picking up a plastic sheet," said Professor Ramire

http://news.bbc.co.uk/2/hi/technology/7085019.stm

Sunday, August 2, 2009

Python Tutorial 2

Decision Making:

Sometimes we want to make decision like if a number is greater or equal or less than other or to see if two lists contain same items or the username and password match. We can make decision in python using if keyword. If we want to see if a number is greater than 5:

>>>if Number > 5:

print “Done”

This case only checks if a specific number is greater than 5. We can also do something if a condition is false. For example:

If Number >5 :

print “Done”

else:

print “Pending”

You should care about the indentation of the next statement after if and else and also the colon at the end of these statements. If you will not care about the indentation, the compiler will raise an error about the indentation it cannot understand. To make multiple checks, we can take help of elif keyword.

If Number <= 5:

print “Done”

elif Number > 6:

print “Well Done”

else:

print “pending”

We can also place if statements inside other if statements. Nested statements also follow the concept of indentation.

If Number > 5:

print “checking for better!”

If Number == 6:

print “Well Done”

else:

print “Pending”

Repetition:

Sometimes we want to do something again and again or to go through the list of items we need some mechanism to do it easily. Doing it manually will make it trouble if the items to work on are great in size. The two operations that enable you to initiate and control repetitive tasks are the while and for operations. The while operation tests for one truth condition, so it will be referred to as while… :.

>>> ingredients = omelet_ingredients.keys()

>>> while len(ingredients) > 0:

current_ingredient = ingredients.pop()

print omelet_ingredients[current_ingredient]

In this example, we first assign the keys in this dictionary to ingredients variable and then we use while operation to see if the len of ingredient list is greater than zero (i.e if the list is not empty), if it is not, then we pop the first item and assign this key to current_ingredient and in last statement use this key to get the value.

The for operation uses each value from within a list, so it will be referred to as for ... in ... :.

>>> for ingredient in omelet_ingredients.keys():

print omelet_ingredients[ingredient]

In this example, we say that for each ingredient in omelet_ingredients.keys() which is a list, get this ingredient key and then get value for that key.

We can use break to stop repetition. For instance if I want to say that if this ingredient is present in the keys then stop:

>>>for ingredient in omelet_ingredients.keys():

if ingredient == “test”:

break

To skip for a specific key or item, we can use continue keyword:

>>>for ingredient in omelet_ingredients.keys():

if ingredient == “test”:

continue

Handling Errors:

Whenever errors occur, it has a lot of information about what happened and why it happened. A “try:” statement sets up a situation in which an “except:” statement can follow it. Each “except:” statement handles the error, which is formally named an exception, that was just raised when Python evaluated the code within the “try:” statement instead of failing.

>>> try:

if omelet_ingredients [“butter”] > 3:

print “Sure”

except KeyError:

print “Aww, there’s no butter. Let’s go shopping”

This example has two major statements, try and except. If an error occurs because of key “butter” not found in “omelet_ingredients”, then it will be handled by except block. It will not raise a compile time error like we will if it’s not handled. We can also get the error information and print it or use it as needed.

>>> try:

if omelet_ingredients [“butter”] > 3:

print “Sure”

except KeyError, error:

print “Aww, there’s no %s. Let’s go shopping” % error

The will raise an exception but we have handled it. The name error after “KeyError” will be used by python to set reference of the string which contains any information about the error. If you have an exception that you need to handle, but you want to handle it by not doing anything (for cases in which failure isn’t actually a big deal), Python will let you skip that case by using the special word pass:

>>> try:

if omelet_ingredients [“butter”] > 3:

print “Sure”

except KeyError, error:

print “Aww, there’s no %s. Let’s go shopping” % error

except TypeError:

pass

If you need to indicate that a particular error has occurred, you may want to use one of the errors you’ve already encountered to indicate, through the function that’s being called, what has gone wrong. There is a counterpart to the try: and except: special words: the raise ... command. A good time to use the raise ... command might be when you’ve written a function that expects multiple parameters but one is of the wrong type. When you use “raise ...” you provide a message that an “except ... :” clause can capture for display

Python Tutorial 1

Hi Everyone, Today I will write about python language. To get python, please visit Python Site and download the most stable version. I am using version 2.6. I would recommend using an installer instead of zip package as the installer will register python extension. You can use any kind of editor to write python code like notepad, WordPad, Notepad++ or any other. Once you have installed python, add python to your path. In windows, you can update environment variable to add python to your path. Once you have added python to your path, you can run python scripts simply by typing the file name like this:

D: \Scripts>HelloWorld.py

Python scripts have “.py” extension. To open python shell type python in command prompt like this

D:\Scripts>python

And you will get something like this:

====================================================================================

Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>>

You can type any python code in this shell to execute.

To run a script with interpreter, type “python –i ”. For example:

D:\Scripts>python –i HelloWorld.py

Basic:

The text written in quotes “” or ‘’ is string. Here are examples

>>> “This is a string”

‘This is a string’

>>> ‘This is also a string’

‘This is also a string’

Escape characters are special characters within string which have special meanings. The escape characters start with ‘\’. For example, ‘\n’, ‘\t’, ‘\r’, ‘\b’ etc. Quotes within string are also represented using escape sequences like “this is a \’ single quote” or “this is a \” double quote” and “this is a \\ backslash”.

String can be joined using “+”. For example, print “hello” + “ world”.

Format specifier in a string represents a placeholder for a value and “%” after string represents values for the placeholder. Note that the no. of placeholder should be equal to the no. of arguments specified after “%”. For Example:

print “%s name is %s %s” % (“My”, “Nabeel”, “Bukhari”)

In this example first %s is replaced by “My”, second with “Nabeel” and so on.

print “Sum of %d and %d is %d” % (4,5,9)

These are few format specifiers: “%d” for integers or long, “%c” for character, “%f” for float, “%e” for exponential, “%x” for hex, “%s” for strings etc

“print” is a function used for displaying text.

Data Types:

There are different data types, and each data type is used to represent different type of data and represent a specific range of data. For example: character, integers, floating point, Hexadecimal, Octal and strings. Character can be in single quote like: ‘a’, ‘A’ etc. Integers represent decimal values without fractional part like 1, 12, -512 etc. Floating point values contain fractional part as well and provide high precision like 4.53, -2.2222 etc. Hexadecimal values are base 16, it contains 0-9 and then A-F values like “1”, “8”, “A”,”B” etc. Octal values are base 8 and the values are from 0-7

Arithmetic Operators:

Arithmetic Operations are performed using arithmetic operators. For example: ‘+’, ’-‘, ‘*’, ‘/’, ‘%’ etc.

‘+’ is used for addition, ‘-‘ is used for subtraction, ‘*’ is used for multiplication, ‘/’ is used for division and ‘%’ is used for remainder.

For example: print 2+2, print 4-3, print 2*5, print 100/20, print 5%2 etc

The arithmetic operations are evaluated from left to right, however the operator precedence matters as we do in daily life like ‘*’ and ‘/’ operations are evaluated first and then ‘+’ and ‘-‘ operations are evaluated. We can make a operation evaluated first by using parentheses.

For example: (2*(2+5)-(3*19))

Variables:

We use names to store data in memory. These named memory locations are called variables. We can change the values of variables. Variables can be used to store different types of data. We can use any name for variable but there are few reserved words that we cannot use. Here is the list of these variables.

and, assert, break, class, continue, def, del, elif, else, except, exec, finally, for, from, global, if, import, in, is, lambda, not, or, pass, print, raise, return, try, while, yield

For Example:

MyString = “This is my first String”

And then I can use this string to print like this: print MyString. We can also store other type of values in strings like this:

FirstNumber = 5.0

SecondNumber = 2.0

Result = FirstNumber / SecondNumber

print “%d / %d = %0.2f” % (FirstNumber, SecondNumber, Result)

In this example, we are creating two variables of float type and storing its result in third variable which will be of same type. Python unlike other programming languages can understand the data type assigned and make the variable of that type. I like this feature the most J. You might have noticed that we set values for format specifiers in parentheses separated by comma. The reason for this is that format specifiers need values in the form of tuples, when the numbers of format specifiers are more than one.

Built-in Types:

There are different type of built-in types that can be used to store data. Three of the most commonly used are:

Tuples—Unchanging Sequences of Data:

Tuples are a sequence of values, each one accessible individually, and a tuple is a basic type in Python. You can recognize tuples when they are created because they’re surrounded by parentheses like this:

>>> print “A %s %s %s %s” % (“string”, “filled”, “by a”, “tuple”)

A string filled by a tuple

Tuples contain references to data such as strings and numbers. However, even though they refer to data, they can be given names just like any other kind of data.

>>> filler = (“string”, “filled”, “by a”, “tuple”)

>>> print “A %s %s %s %s” % filler

We can access (dereference) the values stored in a tuple using the index notation. The index starts with 0, 1 for the second value, and so on. The index of last element is one less than the total no of elements. For Example:

>>>>print filler[0]

>>>>print filler[3]

If we pass a value greater than count-1, where count is the no of elements in the tuple, it will raise an error.

We can find the length or count of elements using Len function.

>>>>print len(filler)

>>>>print filler[len(filler)-1]

In this example we accessed the last value of filler. Python makes life much easier, it provides another method to get the values in reverse easily. For example: to get the last value I can use filler[-1] and to get the second last value I can use filler[-2] and so on. J

Our tuples can be of multidimensional, for instance we can have a tuple which is accessed through another tuple. For example: this example uses make a 2 dimensional tuple.

>>> a = (“first”, “second”, “third”)

>>> b = (a, “b’s second element”)

>>> print “%s” % b[1]

>>> print “%s” % b[0][0]

>>> print “%s” % b[0][1]

>>> print “%s” % b[0][2]

One last thing about tuples is that they are immutable. It means that the value assigned cannot be changed like this: b[0][0] = “new”. This cannot be done, it will raise an error!

Lists—Changeable Sequences of Data:

Lists, like tuples, are sequences that contain elements referenced starting at zero. Lists are created by using square brackets. The elements of list can be accessed in the same manner:

>>> breakfast = [ “coffee”, “tea”, “toast”, “egg” ]

>> >print breakfast[0]

>>>print breakfast[-1]

The primary difference in using a list versus using a tuple is that a list can be modified after it has been

created. The list can be changed at any time:

>>> breakfast [0] = “sausages”

We can append new items at the end of the list using append method. For example :

>>> breakfast.append(“waffle”)

In case of multiple items, we pass the elements as a tuple, like this:

>>> breakfast.extend([“juice”, “decaf”, “oatmeal”])

If we want to append elements of a tuple to list, we will use the method extend to do so because if we use the append method, it will append the tuple to list not its element so do it as:

>>>breakfast.extend(filler);

If we need to remove an element from a list, we will use pop method. This method can be called to get the first item or we can give an integer index to get that indexed item. For example:

>>>firstitem = breakfast.pop()

Or using index

>>>seconditem = breakfast.pop(1)

Dictionaries—Groupings of Data Indexed by Name:

A dictionary is similar to lists and tuples. It’s another type of container for a group of data. Tuples and lists are indexed by their numeric order, where as dictionaries are indexed by names. These names can be letters, numbers, strings, or symbols. When you’re using dictionaries, Index names in dictionaries are called keys, and the values are called values. To create a fully specified (or you can think of it as a completely formed) dictionary—one with keys and values assigned at the outset—you have to specify each key and its corresponding value, separated by a colon, between the curly braces. For example:

>>> menu_specials = {“breakfast” : “canadian ham”, “lunch” : “tuna surprise”}

Another way of doing the same thing is:

>>> menus_specials = {}

>>> menus_specials[“breakfast”] = “canadian ham”

>>> menus_specials[“lunch”] = “tuna surprise”

The items of dictionary can also be accessed using index notation. The keys method of dictionary can be used to return all of its keys to you as a list so that you can examine them for the key (or keys) you are looking for, and the values method will return all of the values as a list.

>>> menu_specials.keys()

[‘lunch’, ‘breakfast’’]

>>> menu_specials.values()

[‘canadian ham’, ‘tuna surprise’]

To find if a key already exists in a dictionary, contains method can be used:

>>> menu_specials.__contains__(“test”)

>>> menu_specials.__contains__(“Brunch”)

We can get a specific set of values for tuple, list or dictionary. The set returned is of the same type as of the original set. For example: To get a new set of values from a tuple named filler ranging from 5 to 8, we can do it as:

>>> print filler[5:8]





Credits:



Tuesday, January 20, 2009

Hello World!

Assalamualikum.....
Hello World! I hope u r fn9 n happy. Good to see u on web. :-p


Regards
Nabeel Bukhari