Wednesday, 27 January 2010

On consciousness

What is the difference between conscious and unconscious action? Unconscious action is autonomous. It is executed according to a set of rules, although the action may be quite complex. Conscious action has a context – the environment, in which it takes place. Conscious action happens only after modelling of consequences. It implies perception of the implications in advance.

Unconscious actions are not remembered, but conscious are. Why? Because the brain cannot predict the result of the modelling: it can predict environment, but it cannot predict its own imagination. So unpredicted experience is recognized as valuable and remembered.

Why do I have only one consciousness in my head? Can I develop two and allow them to communicate? Indeed, if a part of cortex can model, predict, and imagine the environment why it cannot develop its own conscious behaviour? Or maybe we have multiple conscious agents in our head, but they so aligned with each other that they are not distinguishable. Have you ever heard voices in your head?

Tuesday, 12 January 2010

What is Intelligence

you understand something only if you can program it (Chaitin)

Intelligence is Abstract thinking plus Language plus Consciousness. Although all three are not independent, they can be understood in simple definitions.

Abstract thinking is thinking in terms and concepts produced by mind, not sensors. The world mind perceives mostly consists of introspective data.

Language is an agreement between communicating parties. Language serves as a port between the mind and the world.

Consciousness is perception of the abstract representation of self in the world.

The world is the model which the mind builds and holds to predict its future state.

Self is the object in the world the mind has control on. Self does not have well defined boundaries, for example, a governor may associate himself with a state.

Knowledge requires memory. Knowledge transfer requires language. Language is a simpler concept because it can be seen as a collection of symbols or rules. Knowledge is more complex because it is bound to language and behaviour. Any attempt to define knowledge immediately brings up a language. For example, storing any meaningful data requires some format, which is a language. But when we talk about knowledge, language is not necessary. For example, an ant knows where to crawl and does not need a language.

To a simple question "What is memory?" the dictionary answers "The ability to recover information about past events or knowledge" or "a part of a computer in which information is stored". But then what means "information"? What means "information stored"? Is it just a cause forwarded in time to make something behave different?

Friday, 1 January 2010

How to browse Google Maps offline

(See also Crumbles: Maps Offline with Tile Viewer (part II), update Oct 2010)

Once I had a problem that I required my laptop to browse Google maps offline. I looked on the Internet but with no satisfying result. A simple task turned out to be quite complex.

My idea was to have abstract and reliable way to cache and reuse the online content - tiled images. Here what I tried first.

1. I wrote a crawler - a javascript program to force the browser crawl across a particular area. The input specifies latitude and longitude box and steps, zoom level, crawling speed, and satellite or map type.
2. I made my own web server to be used browser instead of going directly to the Internet. I set up 2 machines (one could be virtual). Edit 'hosts' file on the machine A with the list of servers I would like to make cache pointing to the IP address of machine B.
3. Machine B has to accept requests and re-request files from the Internet or retrieve from its cache. I wrote a simple program to do this task.
4. The program running on the machine B did not directly request the data from the Internet. Instead it used wget program. It was a simpler solution since wget allows more advanced way of downloading, e.g. using proxy.
5. Once the cache is full and ready the service program could be run on the machine A with no Internet.

This approach did not work quite well. First complication was that the browser opens simultaneously many connections and my server was one threaded and was not fast enough to serve all of them in timely manner. To overcome this problem I wrote a serialiser - a program getting many connections simultaneously, but requesting only one at a time while keeping others on hold. This worked somehow, but slowly - not to my satisfaction.

Finally I thought that I will download automatically tile images from Google using wget and later worry about viewing them. To my surprise after downloading tiles for about half an hour, I start getting response from the Google servers with the message something like "We are sorry but you are trying automatic downloading. To protect our customers we have to block your IP."

An even simpler solution had been required. I noticed that Microsoft Internet Explorer saves files in its cache directory with proper sub-address names. I wrote a simple program to rip the files from the cache recoding their names. Using Internet Explorer I navigated IE over desired area, and then ran the program and all necessary tiles were successfully stored at my place with proper cataloguing.

The last step was to cook a program (since I was not able to find appropriate application) to view the tiled images which I did very quickly and a bit dirty.

Here are the tile ripper and tile viewer for Windows

I used this program when driving along Eastern Coast. The maps itself were on maximal resolution level 15 and occupied around 500Mb.