Monday, March 30, 2009

autoflush feature in ActivePerl

I tend to post here only those receipts that have practically worked for me.

There have been another feature I couldn't make working under win32 for ActivePerl. It is the autoflush, i.e. auto flushing the buffer content to a physical file.

Spied here. The solution is to make the filehandle "hot":


select((select(FILEHANDLE), $| = 1)[0]); # make the handle hot

Sunday, March 22, 2009

Analogy of a face search in a human brain

While I was preparing my breakfast a thought of a face expression flashed accross my mind. The small picture was so bright,
that I immediately started to search the owner in my memory. This is the exact verb, that I should use
here: to search. The search took just about two seconds (lucky me) and I started to analyze
how did it happen: what algorithm did I potentially use, what was the complexity. As I met the owner of the
face about a week ago I believe the search took place in cache and looked a linear search on one hand.
On the other hand I distinctly realized while this was happenning that I clearly was skipping some
faces without further detailed analysis (i.e. calculating some metrics for determining relevance level).
One important observation is that I didn't draw a clear line in a search space based on gender: rather it was a quick search (with no reference
to the existing algorithm, but an allegory) with very fast process of prunning the search space.


It might turn out, that existing search algorithms are not that far from what happens inside a human brain.


mood: thoughtful :)

Tuesday, March 10, 2009

podcasting on Google

I've decided to make the first podcast with a certain purpose: there is a podcast contest by budam on rpod.ru. The general idea is to create a podcast, speaking entirely in English which must not be your native language.

The podcast is on how I have had an interview with Google in Trondheim (pity, pity, recently closed office) and - Google be safe - does not disclose a single task from the NDA signed tasks list I got that long day. It actually was a long day - with 5 interviews and one lunch. I bet I have drunk a 5 litres bottle of water - when you are speaking up for 45 minutes per interview your throat gets easily parched.

Thursday, March 5, 2009

Microsoft fights itself

No, no, no. It is not any kind of political post related to the company's current state. It is not a holy war type of post either. I have just got the below interesting message from which I concluded the topic.



I'll translate the key phrases as well:

Prevention of data execution - Microsoft Windows

For defending the computer this program was shut down by the system

Name: Windows®installer
Publisher: Microsoft Corporation

Sunday, March 1, 2009

Локальная гравитация

Представьте, что вы отправились покупать вашу любимую пиццу в местной пиццерии. Предположим, вы не просто пошли туда, а поехали на велосипеде (да, захватите ещё рюкзак, ниже я объясню, зачем). Когда пицца, горячая и ароматная, запакованная в картонную коробку, у вас в руках, вы раздумываете, а как бы добраться теперь до дома с комфортом.

Если пиццу держать на руле, сохраняя её горизонтальное положение, будет сложно маневрировать. Особенно, если дорога бугристая ото льда. Можно пиццу привязать к багажнику, но это будет вызывать неудобство: нужно всякий раз оборачиваться и смотреть, на мести ли пицца.

Тогда можно положить пиццу в рюкзак. Стоп! Как же можно класть пиццу в рюкзак, она ведь соберёт все свои компоненты внизу рюкзака. Можно! Можно положить пиццу в рюкзак с с локальной гравитацией, вектор действия которой вы можете задать самостоятельно. Таким образом, гравитация для пиццы в рюкзаке будет направлена соосно вашему движению на велосипеде, но в противоположную сторону.

Осталось подумать о том, как достичь следующего:

1) локальная гравитация должна быть именно локальной, то есть не действовать, к примеру, на вашу шапку на голове;

2) локальная гравитация не должна конкурировать с естественной гравитацией Земли, в идеальном случае они должны существовать параллельно друг к другу, без каких бы то ни было интерференций;

3) можно произвольно менять вектор локальной гравитации.

Приятного аппетита! :)