Blog

Bajki robotow

Robots. Much time has past since the definition of “robot” although the idea of an artificial being created by men dates a long back. The current idea of robot includes electronics and software supplanting what was considered back in the fifties and in the sixties (of the past century) when a robot was built from gears, springs and occasional electricity wires. The brain was made by something yet to be invented then, so every author imagination could go wild on this. In this book brains are either made by mercury or by antimatter…. well to be honest still today we don’t know what exactly is supposed to fill the cloud depicted on robot schematics labeled with “brain”. We know how to build simple mechanism… basically computers on wheel, but we are quite far from devising a fully featured robot as presented in sci-fi literature. This is the fourth book by Stanislaw Lem that I read. I found the first two (Eden and Fiasco – “Il pianeta del silenzio” in Italian) to be really great. They are mainly focused on how much alien can be alien. Beings living in remote and insulated region of space could well spoil behaviors that we could hardly identify as rational or intelligent.

The third book was “Solaris” although focused on the same subject the narrative pace is extremely slow. The story is much oriented to introspection and character psychology.
My expectations for Robot Tales were quite high, so I was rather disappointed to find a collection of children stories. Robots are just and excuse for telling space stories. Some of the stories are pretty well written and touchy, some are just variation of the king-promising-his-daughter-to-the-one-who-will-do-something.
One of the main features of the book is being precise about astronomy science. Stars, nuclear reactions, radioactivity and so on are woven in the stories with a good degree of accuracy. This is intriguing (at least for the engineers within me), but is untuned with the robot description that is far from scientific accuracy.
It is hard to find a reader profile for this book. Children can be easily bored by scientific description, while teenagers are surely dissatisfied by the plots.
Note that the book is published in Italy with the title “Fiabe per Robot” (Tales for Robots) while in english has been translated into two volumes – “Mortal Engine” and “The Cosmic Carnival of Stanislaw Lem

Elianto

I should be wiser. Having a reading queue the length of a mid-sized transatlantic and being easily captured by a book, I should avoid bookstores like hell. This time I am delighted not to be so wise because otherwise I wouldn’t have stumbled in Elianto by Stefano Benni and I would have lost this good reading for God knows how much time yet. Usually, a book hooks me through the back cover lines (or the inside cover leaflet in case of a hardback). This time I opened the book and found a strange, hand-drawn map covering two pages. Wow seems something like “Lord of the Rings”! Then I turned to the back cover but I was already hooked and I already knew in my heart that soon some money would have left my wallet.

Benni always satisfied my reading taste and this time was even better. The story of Elianto is so poetic, evocative, and dramatic that the fact that is so well told is just its natural consequence.

The story takes place in a country named Tristalia (in English could sound like “Sadtaly”). The country is run by a computer and every year twenty presidential candidates challenge themselves in a sort of living (well ‘deadly’ could be more appropriate) reality show, the one who survives wins and can rule the country for a year.

Every few years sorts of tournament games are held to recognize the autonomy of counties. These games (as with everything else) are cheated to create the best outcomes for better ruling the country.

Moreover every day every family is called to vote in the daily poll. If they guess the majority of the answers they get electricity, water, TV, and warming, otherwise they are excluded for the day from the usual supply.

This is not so different from the background of other books by the same writer, where the Italian sociopolitical situation is exaggerated and distorted with a humorous, but chilling effect.

Elianto is a young teenager badly ill. He is in a hospital for terminal diseases. He is the only boy who has defeated the pluri-awarded Baby Esatto the current government champion for the next autonomy games.

Elianto is dying, but his friends want to save him. So wants the Devil, yes the Evil One (but no more evil than the worst human), because doing evilness in Tristalia is so widespread that there is no longer an intriguing challenge to tempt humans from that country.

A great warrior is sent after another yet greater warrior to defeat the government champion of Evil Fight, Rollo Napalm.

Elianto’s friends, three devils, and the cloud warrior Fuku with two bonsai-sized yogis will go, every group its way, searching for what they consider the remedy. Meanwhile, Elianto will be endangered by one of the doctors who run the hospital under Baby Esatto’s influence.

There are many strong points in the book: there are many unforgettable characters so well defined into their roles. Hard to read the death personification (a Flamenco dancer) without feeling anything. The background is satiric and frightening. The idea of parallel universes is not new per se, but it is approached freshly. A map is needed to travel from one universe to another. This map is either cast by a full moon through an old tree onto a wall in Elianto’s room or found on the back of an eel can (and the eel inside is not only alive but forecasts the future). Or it is found on a micro piece of paper obtained by processing a single grain of rice. Or it can be found tattooed on the butt of a devil.
Well, until now, if you have to read just one book by Benni, read this. If in doubt with another writer, read this. Highly recommended.

Ice Station

Some days before leaving for holidays my wife and I go to the library to borrow some books for her. While waiting for my wife choice I skimmed though the books. Being in a library is always a strong feeling for all those, like me, enjoy reading. Having recently read “deception point” by Dan Brown that tells about polar station and the like, I was promptly attracted by this “Ice Station” by Matthew Reilly.
I was quite curious to see how the same core idea (an alien evidence found in Antarctica) would be treated by two different writers.
The idea is simple, there is this polar scientific station where somewhat that could be an alien spaceship is found well below the sea level. The cave where the artifact is found is reachable only via scuba diving for some 900m.
The first divers group loses the radio contact with the base right after reaching the cave. The second team with rescue purposes follows the same fate.

The personnel in the base decide to call for help, but a solar activity severely hampers the communication. In the help request the wireless operator talks about an alien spaceship.
Although no answer is received, the call has been listened by three different countries – USA, France and Great Britain. Antarctica is not really under any jurisdiction and basically no law is enforced.
The story focuses on the marine commander “Scarecrow” Schofield who heads the US mission with the goal of defending the spaceship.
The premise is intriguing enough and the book is written pretty well and the story is full of action so I have been hooked in pretty fast.
There are a couple of minor glitches: first the plot is excessively based on coincidences. Beware of the spoil: the base is built over an old and forgotten military base. A few miles away another abandoned ice station is located and this base is in the iceberg were Schofield and another pal found themselves after a fighting. In this base, lost more than 30 years before they found two perfectly working scuba sets.
Other examples of this are: founding the right weapon or being at the right place.
The other glitch is about science. Diving in a bell requires the bell itself to be pressurized to balance the pressure of the water (otherwise the water would fill the bell). Moreover 900 is quite a high pressure for a scuba diver. If it is not beyond human capabilities is right away. Then, at least as far as I know, scuba divers must be extremely careful on decompression because of embolism while the writer is more concerned about compression.
Anyway these are just minor annoyances the book is really good ad I appreciated it far more than Dan Brown’s.

How to dissect your Palm Tungsten C

Good news first – my Palm Tungsten C is fine and happily running with replaced batteries. Bad news, consider pretty carefully if you really want to do it yourself. I read that the maintenance people could charge you 170$ for the operation, that could cost no more than 40€ if you do it yourself. But … doing it by yourself is risky, you could send the little gizmo in the grey silicon pastures of heaven.
Ok, you take the risk, here’s the instructions. Have a look at yesterday post for a link to some good and detailed pictures of the operation).
With your trusty Torx screwdriver unscrew all the four screws on the back of the PDA. The back is kept in place by two clips about at the middle one on the left and one on the right side. There is nothing to do but to gently pull the back inserting your nails in the sides.
Now the back is removed, take a deep breath and astonished watch for a while what could be stone dead in a matter of seconds.
You see a small board piggy-back’ed on a larger one, fixed with two (standard) screws and with a single black wire going upward. That board is the wi-fi module. Unscrew the two screws and then pull gently the wi-fi module away from the main board. It won’t come easily because there is a connector below. Be gentle and firm and stay relaxed.
Now the main board. This flat bastard is hold by four little plastic tags (two per sides) and has the keyboard connector below (very similar to the one from which you unplugged the wi-fi module). Moreover the audio plug will try to stay where it is (upper right) keeping together the rest of the system. First use a pin or something like that to unplug the battery connector on the middle left edge. Then lift the board so that the board is above the four tags, then unplug the keyboard connector and eventually slide the board toward the lower edge being careful about the audio plug.
And now you can see the batteries. Don’t hold your breath, they won’t jump out of their place… they have been glued (!) to the tin sheet below. Start from a side and use a screwdriver as a lever to gently (again) pull the batteries out.
Perfect you are halfway, replace the batteries paying attention to keep the right orientation of the original pack. The put back the main board. Slide it in first with the audio plug (maybe you have to lift the screw hole at the top), move it below the tags and then push the bottom to make the connection to the keyboard.
Connect the batteries, this require some skill since the connector is to be … invited in the right place rather than put, since there is not space for your fingers here.
Put the wi-fi module back, press it to connect and then screw it in place.
Eventually put the back cover, verify that the two clips hold it and eventually screw the 4 screws.
Done… Count up to three and connect it to the power. Mine worked at first attempt, I had just to synchronize it to have it in the same state it was before replacing the batteries. I lost a kg in the process.

Taking your PDA apart

Maybe you have a PDA. Maybe it is a Palm. Maybe it is a Palm Tungsten C. Maybe you want to replace the batteries. Maybe.For sure that’s what I want to do. The first obstacle to overcome is to open that darn thing. Once you find the Torx 6 screwdriver you’ll find that the back cover is quite still attached despite the fact that you have unscrewed all the four screws. After googling around I found these pictures where you can see there are two small clips. Just use your nails and force the cover so it can unplug. Next step is to remove the board to uncover the batteries.

The Riddles of Epsilon

It happens quite often – I go to the local mall bookstore, get intrigued by some book, resist the insane temptation to buy it immediately; get back after a while when my reading queue is somewhat lighter and find that the book has vanished.I can no longer find “Tokyo soup” and a book about biggest lies… and many other I don’t remember right now.
So it was for this book. I found it intriguing, rich in mysteries, but then it disappeared. After about a month I found it relocated in the teen-books section. My reading queue was still fat and I resisted once more. And the book disappeared again.
At last my wife gave me that book on July 14th (“Do you know what day is today?”, “ehm, well, … “, “Joke’s day! This is for you!”). So, jumping over the full reading queue I started reading it the very same day and completed the reading in just three days… addicting!

The story is set on the fictional island of Lume, where Jess, the twelve years old main character, and her family just relocated. They arrived in the family cottage, an old building full of old rooms.
In the family past some troubles among the parents, and other, rather ordinary, trouble in Jess’ friendship. Back to the origin is going to do good for the family.
When Jess finds a stranger in the private chat-room where she’s talking with her friend, at first she thinks of some hacker, This mysterious being, which then turns out to be a man named Epsilon, will pull Jess, riddle after riddle, into an epic battle between Good and Evil.
For Jess it will be even more dramatic because she can’t tell which part is the Good part. She will meet odd strangers and will see unusual buildings, and will find herself going after the very same story of a boy from the previous century.
I found the story really good. Just in a few points could be somewhat childish, after all this is a teen oriented book. But the light-horror movie sense is preserved throughout the book. Also the atmosphere of the lone island, where the community knows about something you don’t, where customs have been tailored around unnatural things.
I am not sure that there is an explication for all the riddle posed by Epsilon and or for their need. Nonetheless I’m ready to forgive this because they are so well integrated in the story that you don’t feel any artificiality in them.
Very recommended.

Synchronicity

As a general rule, I could agree on the principle that complicated things should be masked away from the user behind a simple and intuitive interface. Well maybe more than just agree. Even if the user could manage to get that complication working, she could easily to make an error, or be endangered. A clean and crisp interface is advisable.What is just irritating is when something with a clear and simple model is hidden behind a smoky interface with a different model.
I am talking about Palm synchronization. I think that the idea of synchronizing is for people who don’t want to know what a ‘file’ is. And, yes, what the heck, if you have two databases (such as the contact list) you actually want to ‘synchronize’ them, copying records back and forth until everything looks the same (and hopefully nothing gets lost in the process).
But if you have a word processor document you just want to copy it from the PDA to the PC or vice-versa. It *IS* a file. So the abstraction is that of two file containers (directories? drives?) that you want to operate on. The USB mass storage dongle abstraction – hook it up to the PC and you get a drive, drag and drop files to this drive, unplug and be happy.
Moreover the synchronization of the whole system has some dark points – what is supposed to the synchronization mechanism if you remove a file from one of the two synchronizing devices? Propagate the deletion to the other system? Ask for user intervention? Undo the deletion with the other copy?
What if the same document is available in the two system but it is modified in both systems?
Not to talk about Linux that does the synchronization its way – the SD card is not synchronize neither the sub-directories are.
So I really don’t understand why Palm is so stuck to the synchronization abstraction. It’s handy in the real simple scenario, but it sucks elsewhere.

Selected power

It is alway a good surprise when a task you thought being rather hard turns out to be quite easy when you actually do it. Using select for I/O multiplexing and stuff like this is one of those pleasant surprise. The man page could be quite intimidating, therefore I start with an example. Suppose you are dealing with network communication (or any other form of interaction where an I/O operation could take too long to be correct). You are likely to read (or write) into a file descriptor (previously opened via socket and then bound in some way) AND to check for a timeout. If the operation is taking too long, you want to bail out of the read operation and perform the needed action.If you are stuck with standard read and timer operations you may need to set up some signaling check for the right thread to catch them and so on. But there is a better way.
Select accepts several arguments: a limit, three sets of file descriptors and a timeout, and returns as soon as one of the conditions (defined by arguments) is met. The file descriptor sets are defined via fd_set type (handled with fellow macros FD_SET, FD_ISSET, FD_ZERO and FD_CLR). All these arguments can either be NULL or point to a fd_set. The first one is the set of file descriptors checked for non blocking read. That is that if one of the file descriptors contained in this sets become ready to be read without blocking the caller, then select returns. The next argument is for writable file descriptors and the third one is filedescriptors that have to be checked for errors (exceptions).
The first argument is the maximum filedescriptor contained in the union of the three sets plus one. This serves as a limit to avoid checking the whole range of file descriptor.
The last argument is a timeout. It is a struct timeval (the same filled in by gettimeofday) that can define timeouts with a microsecond resolution. In practice the resolution is much less fine grained than that and depends on the kernel and the architecture. For example on Linux kernel 2.4 on ARM the resolution is 10ms. Better check the smallest handled timeout before blindly relying on it.
Select returns -1 in case of error, 0 in case of timeout or the number of the filedescriptors that changed status in the three sets.
For the example the return code is easily processed, while for more convoluted cases could be more complex.
Let’s take another example, suppose you are reading audio packets from a stream and you want to decode and playback them. The first approach to this problem could be using two threads with a coupling buffer. One thread reads packets and pushes them into the buffer and the other thread pops the packets out of the buffer and sends them to the audio driver. This is conceptually simple, but not straightforward to do in the right way. When dealing with threading you always have to synchronize them. It is likely that you need a third thread to control the streamer and the player threads.
If you employ select the solution is very simple and natural. Just check the wall clock and compute a timeout for the next play, then wait with select either for a new incoming packet or the time to play.
In this case there is just one thread and the warrant that if you are reading the buffer no one is writing in it. This allows you to simplify the buffer management.
If you are not so lucky to work with Linux, but your daunting task is to earn a living with Windows the good news is that a similar function is available for Microsoft platforms.