Dreams == unit test

Why do we sleep? For millennia, people thought they know the answer. If sleep is a state of inactivity, then it must be for rest.

This is false.

It is known that sleep is far more active state for a brain than solving a math olympiad. It was then suggested that it's a kind of efficient maintenance task. REM Sleep - the dreaming phase - is though less active, comparable to awake. In this phase, the muscle movements are though much smaller, no random violent shakes as in NREM. A human would have 4-5 dreaming phases during normal sleep (statistics from random emergency wake-ups). All funny information obtained during the dream is then recycled, and you are going to remember one if you are lucky.

It seems like while dreaming, the body is forcefully detached from its brain to avoid damage from unconscious mechanical activity. As with any system, internal implementation details leak out thru its bugs ("false on" and "false off"). Sleepwalking and cataplexy are exactly the opposite and not uncommon defects of the same valve. The first makes one walk or talk nonsense during sleep, while the second makes one collapse during wake state. Still, nobody (apart from mysticians like Sigmund Freud, to which we won't listen) seems to have a normal answer - WTF are the dreams?

I had a dream last night. It had to deal with a girl explaining a group about color codes for different failures of a train routing system. Nevermind that part. Then it struck me. This surely must be it. Obviously, it cannot be anything else. Dreams are not for garbage collection. They are not a maintenance task. Dreams are a self-test (aka BIT, QA phase, whatever).

It seems quite natural for researches to miss it. Quality Assurance is counter-intuitive even for software developers. It takes young specialists some time to learn that after development or maintenance on a system you need to fucking test it, because you might have broken something, and to debug it if it's broke. It seems reasonable that this is what a brain does, after an active maintenance cycle, by injecting a funny story called a dream, practicing some thinking and page faults in a test environment, disconnected from dangerous muscle machinery, instead connecting itself to nice visual and audio simulators for test data input.

GH: "This cannot be true. I know many people who like to sleep, but hate to do QA!"


If it walks like a duck and quacks like a duck...

How many uses of duck do we have in technology today? Duck typing, duck test, etc..

And now, suggesting one more: duck, ducks - a physical unit (typically, voltage) corresponding to 1 LSB in raw integer data sent to a DAC (or ADC) for further conversion to voltage.

Example - "5V corresponds to 4096 ducks", "Atmospheric presure is 2200 ducks with this sensor", etc


The classification of hazzard

Q: What's the opposite of 'potential hazard'?
A: a 'kinetic hazard'

[credit for this wisdom goes to squark]


Best bang since the big one

Many friends keep asking me today what exactly happened and how did it feel, and one of them even found the story very funny, so I am going to serialize it all here.

Flight with VM and Of[e]k, four people aboard Cheyenne which was just back from a test flight following a long overhaul. Climbing to work altitude of 21kfeet, with headphones.

At 19k, BOOOM and all cabin suddenly white thick myst. Plunge down wheee fast (some good lunapark for free), mayday call, the pilot R shouts for someone to bring him oxygen fast. I am thinking fast and manage to figure out where the oxygen is (it didn't drop out), put away the masking tape which was used to seal it (so it doesn't drop out too much) and give the mask to the pilot. R asking M to fix it. M: "fix it yourself, I am holding the stick". R: "Don't hold the stick! fix my mask!". The back side was torn so we had to hold it. Then flying safely to land at Sde Dov.

The experience: the decompression was obvious immediately. It felt like a decompression, some throat ache and a headache. A bottle of window cleaning liquid on the back of the plane started to spray all over the place, which was fun.


Firmcopy: suggesting another useful word

Firm copy, n: a scanned hardcopy, like a raster image of a text. It's impossible to edit or parse programmatically, but is still better than a hardcopy in terms of weight, volume, storage, etc. For images, "firmcopy" may refer to reduced-resolution soft copy of the actual image.

It's analogous to "firmware" as something in the middle between hardware and software. Google seems to know nothing about it yet. I hope it catches :)


Another day at VM

R: "it's 0.5GB/hour..."
J: "yeah, about half GB per hour..."
P enters: "what were these bandwidth numbers you were just talking??"
J: "we got some memory leaks."
R: "these are ADSL-speed memory leaks".
R: "Would you prefer DSL-rate leaks or dial-up memory leaks? :)"

Earlier that morning was a developers meeting.

X: "is that design documented?"
H: "yes, I put it in wikipedia this morning."
R: "you mean the [company] wiki"
H: "yes.."
P: "I sincerely hope it's not in Wikipedia!"


Never eat a dog

ILPhO Summer Camp 2009 is in progress - and as usual, with its own stories. This time I was contacted by a kid with food problems - which made me think about it for a while. Some people like food, and some choose to eat food's food [Credit for this wisdom to SB, TY and myself].

The conclusion is to classify vegetarians to 3.5 types:
Type A: those who wouldn't eat animals for moral reasons
Type B: those who wouldn't use any product of animal labor, like eggs or milk, due to some much more sophisticated kind of compassion.
Type C, Introducing the next stage: people who love animals so much, that they would let themselves be eaten.

Well, of course, there are also these guys who are vegetarian not for loving animals, but because they severely despise plants.

Squark practices not eating only mammals for being too advanced, while YL07 suggested this morale: "Don't eat an animal that one can be playing with."


TAU, old: calibrating a spectroscope

This is an important lesson on why asking questions is important. You know all these people who are never afraid to make idiots of themselves for the sake of others? YM was one of them.

Sergei, the legendary labA guide, was by no means a brilliant dude. An earlier argument about how capacitor behaves at low and at high frequencies was stopped by "Stop thinking, you are not supposed to be thinking. You are supposed to be doing an experiment."

The announcement was "today, we are going to calibrate a spectroscope, by using a photoelectric chamber." This is how a 30-min instruction started. Okay then. Photoelectric effect is sensitive to light wavelength. Hmm.. Let's hear more, I thought.

While the instruction continues, everybody looks stupidified linearly, at precisely constant rate. Nobody asks questions. Some hoping it will get clear in just a moment, others planning to rely on their partner.

"This is a spectroscope" says S pointing to a black box. "And here it has an opening for the light." And this (round on a stick) is a photoelectric chamber.... Hmm.. we heard about internal photoelectric effect in semiconductor films. But.. but what?!

Now comes in a huge mess of wires and a digital HP oscilloscope and a demo about its time measurement features... what the hell...

Heck, a spectroscope is an accurate device. A photoelectric effect is by no means a precise thing. This candy stick and the box don't look like anything to match their names. "And this knob here in the back (of the spectroscope) adjusts the light frequency.." "and you can also switch unit scales!!" MAA?

Some kept wondering what have they missed and whether it was in the beginning of the explanation, or maybe they should have listened what their mother was telling them when they were young, but physics at TAU clearly started looked like a wrong choice for their small brain. The deeper into the swamp, the stupider any possible question would look. This time Sergei seemed like he knew perfectly what he was talking about. Some students made smart faces to pretend like they grasped some of his words. This collective stupidity added to the collective confusion.

Shortly the instruction was over. "Now you can proceed to make an experiment," said S, "are there any questions?". A long dramatic pause. Nobody moves.

YM stands up.
- "Yes, " he says. "Please explain it all from the beginning. I didn't understand anything.."
People seen starting to breeze as in "god bless YM".
S, angrily: "What didn't you understand?"
Y: "nothing. What do you mean by calibrating a spectroscope with a photoelectric chamber?"
S: "oh.. have I said 'spectroscope'?"
Y: "yes, you did. 20 times"
S: "It's a stroboscope!"
PPL: "omg..."
S: "Ooops. sorry. OKay, now please proceed to do the experiment.."
Y: "No. Now you explain it all from the beginning."


The "photoelectric chamber" was just a single-bit light detecting transistor. Lab purpose was to demonstrate a digital oscilloscope, using it to measure pulse frequency.


VM - Ichthyophobia

Some people don't eat fish. When asked why, HB asked us if there's a medical term for hysterical fear of fish. Two guessed "Ichthyophobia", and later this was discovered to be true.

Then the discussion went into a direction of possible strange phobias and treatments by exposing one to the subject of his fears. Bungee jumping for acrophobics, etc. Someone said it should be done gradually - "First, you are given something small, like a piece of tuna. Later in the course, you advance to a bigger salmon, and so on" P:"and on the final test, you are eaten by a big shark!"

On another occasion, it was a design meeting. "Is this thing a tree?" someone asked. "No, it's a DAG". "What's dag?" Someone: "A directed Acyclic Graph". AL: "In hebrew it's called 'fish' "

(Then it was developed further, 'okay, where does this DAG piss from', 'where is the fish burried', etc)


...on the trails of Pooh

DISCLAIMER: the following post contains dirty language, disinformation and some right-wing propaganda. Therefore, it's not recommended for children, adults, aliens and others. Please close the window now.

Good news everyone! At last, the western pole was discovered - under the supervision of prof. Yuli Tamir, or our education minister. The pic is from certificates received by students on a special party dedicated to those who brought home some prizes from the international science olympiads.

Example of a certificate brought by a member of the physics team.

AA: "What's the problem? That signifies the freedom of choice for a coordinate system - an important symmetry"

Some comments were more emotional. KL: "Ой, у них глобус раком :)))".

She gave an 'average temperature over the hospital' kind of speech, too. When I asked people what's wrong with the certificate image, some said that it's the fact YT is our edu minister. Others pointed out the flip between first and the last name. Some said that it's the professorship (Was that philosophy?).

*Credit to YB for 'the western pole' term


The 60th independence day

A friend of mine from Singapore said they all like food very much, more than any other reasonable nation. I always thought this is not true, and here's a proof. The following is a true story.

"What holidays did you have back then in the Soviet Union?" my father was asked by one of his local students.
"Well, mostly socialistic-ideological ones", he answered. "For instance, the first of May".
"Oh, cool!", replied the student. "but.. what do people usually cook (/eat) for the first of May?"


Shrek: "And you are going to be a father!"

A complete "mastool" kid calls me this evening (Name withheld to protect the guilty):
- "Hello, my name is ***. I'm a son of your teacher.."
- "Hmm, what teacher.....??"
- "No, I am a son of your father.."
- "What??????"
- "Oh, sorry, I am completely confused. I am a student of your dad".

(he wanted to get consulted on where to learn physics from)

[Itsik Maor story withheld, as well, because it cannot be written. Placeholder remains]

[the subj quote is from Shrek 3, Shrek to Arti]



I joined the Pi day celebrations on 3-14 at AO's place. Obviously, this should have been 6-28 instead, because the important constant is 2pi. Who cares about diameters - the period of imaginary exponent is, of course, much more fundamental. This way it will also join the club of Physical Constants Starting With 6 (like G=6.67e-11N*m^2/kg^2, h=6.626e-34Js, ...).

DC: "Well, before you interfere in My domain, please take a moment to fix the sign of electric current."

(In fact, mathematically, chances for a real physical constant or value with arbitrary units start with 6 is not the same as to start with any other digit. For 1 it's much higher and for 9 it's much lower. It's easy to understand that. The constant's log is what should be uniformly distributed).

Changed my mind: reference params are better than pointer params

Confession: for long time, I've been thinking that C++ reference is a fancy and a completely stupid way of writing a pointer. A way useful only for two things. One is operator overloading when an lvalue is needed - i.e. where "&a += c" semantics is not an acceptable way of writing "a+=c". The second thing is to make it easier to cut-and-paste code across functions, so that a lazy programmer wouldn't have hard time adding all those stars. The truth is different: reference is a significantly different language tool than a pointer. A reference can never be invalid, at least unless forced to be so with a far less-trivial construct than what is needed to make a pointer invalid.

In the modern era of C++ references and boost::shared_ptr, pointers can really be confined to something that is "explicitly nullable" and where you need this nullability.

VZ: "But of course. Every * and -> is an access violation waiting to happen"


Google calculator

Google calculator query of the day [rus]: 1 python in parrots.

To summarize all googlecalc capabilities known to me (if you don't know what's google calculator, try searching for 4*5 on google):

1. sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2) (can be continued)
2. G*(mass of the earth)/(radius of the earth)^2
warning: small g is gram, not earth gravity field
3. (answer to life, the universe and everything)/6
4. c in furlong per fortnight
5. 5J in calories, 6500 USD in ILS, 1 MeV in Joules
7. Complex numbers: sqrt(-4), i^i, e^(2*pi*i)
8. Functions: sin(17), ln(-8)
9. 9!, or even 0.5! (!!!) (well, i! too)
10. Data units: 1Mb in bytes , 1GB in bytes, 1GB/128kbps in days

Quote of the day

"Murphy's law doesn't work only when you actually need it." [Credit to BoazS]


Russian plurals

I told DN that the Russian language has a special amusing plural form for 5 and more. Her response was "Pity, they should have had a special form for primes"


Carbon dioxide emissions

Funny - my car (Toyota Prius) emits less carbon dioxide than if it's passengers would have been walking or running the same distance. This is the only such car.

A typical 70kg human burns about 75Kcal fat per km (running. Walking is even less efficient). That is about 1.05kg fat per 100km. Toyota Prius at slow cruise (80kph) burns about 3.3liters per 100km and can carry 5 passengers. Human fat has about the same energy density than octane (roughly 25% less).

It seems like lack of wheels is what makes our bodies so inefficient.

Speaking of which - many people attribute Prius efficiency to the hybridity - ability to regenerate energy back from breaking. They don't know that this is only one third of it's story. The #1 invention in the Prius is a unique continuously-variable transmission, of a type only possible in a hybrid car. The so-called ECVT, only possible in a hybrid car, is a complete wonder. It's a very lightweight transmission, which is truly continuous but does not have any ribbons or cones - all the way rigid toothwheels. How is that at all possible - is an amazing story. The third part is of course the Atkinson-cycle engine, which beats the inherent thermodynamic inefficiency of the 4-stroke ICE.


Airline seats

People are always being asked whether I prefer the window set or the aisle one. Dima95, however, provided an eye-opening idea: the best seat in the airplane is the middle one.

This way you have two neighbors, and you can choose which one is less annoying to talk to (or possibly, more pleasant to sleep on). Also you can seal the other two off from communicating - this ensures that they don't get any pairs/couples in your line who probably reserved two consequent seats from ahead of time so that they can sit together - further increasing chances of interesting interactions, which certainly are the best time-wasters in the air.


Israeli cellphone numbers

I am surprised how many people don't understand my recent gtalk's status message: "No more 054 4818021. Since November, please find me at 05 44818021."

Hint: I used to be a slave [of a mobile phone company]. Now I am a free man!

More on that matter: a super-funny bug in VM's phone system was discovered - it's no longer possible to call 054 numbers which are not Orange. They are directed to the Orange line which then replies "only orange numbers can be called from this line".

Funny story #3: It appears like landline company phones are now also interchangeable. One can move from Bezeq to Hot and still have his 03 number. IZ was trying to move an apartment to another area in Tel Aviv, and was trying to keep his 03. "No" said bezeq, "we cannot relocate to a different station". His only way to keep it was to move to another phone company, and then back to bezeq.