American football funny magic tricks

written by Tomas M. 103 days ago

I don't expect this to be real. Nevertheless, it's incredibly realistic. Enjoy! :)

0 comments

lzma for official squashfs is here

written by Tomas M. 110 days ago

Just few days ago, Phillip Lougher added the long awaited LZMA decompression to his squashfs tree (here are the patches).

I'm not sure what kernel version will incorporate these changes. I guess 2.6.32 is in the -rc state already so we will have to wait for the next one. 5 comments

ORDER BY RAND() replacement

written by Tomas M. 120 days ago

From time to time, I need to select a random row from MySQL table. The official documentation suggests SELECT * FROM table1 ORDER BY RAND() LIMIT 1, but this is very dangerous. It can take ages to select a random row from a table with millions of records. The reason can be noticed after running the same query with 'EXPLAIN' keyword at the beginning: Using temporary; Using filesort. It's the worst situation which could happen.

I'm always looking for as best optimalization as possible, so I had to come up with something faster. And here is the result:

SELECT @r:=RAND();
SELECT @i:=
(SELECT MIN(id) FROM table1 WHERE id>=
(SELECT (@r*(SELECT MAX(id) FROM table1))));
SELECT * FROM table1 WHERE id=@i;
As you can see, there are 3 queries needed instead of one, but the time to find out the particular random row is reduced to the smallest possible value, because there is no more needed to create any temporary tables or sort them. After EXPLAINing the queries again, ... more 1 comment

Squashfs LZMA support

written by Tomas M. 122 days ago

In the last few days, Phillip Lougher (squashfs author) published several patches, which is a very important step towards the new lzma support. In short, the patches move the decompressing functions to a separated file, and replace the zlib_uncompress() call by squashfs_decompress(). This is exactly what had to happen in order to provide a decompressor framework for Squashfs, 'allowing multiple decompressors to be easily supported'.

Since it (lzma) is already in kernel for some time, I think that we should see LZMA support in squashfs very soon. 9 comments

Her Morning Elegance / Oren Lavie

written by Tomas M. 141 days ago



5 comments

What is the purpose of life?

written by Tomas M. 166 days ago

In the previous post's video, Richard Dawkins discussed the purpose of purpose: a human mind needs a purpose for everything, and most people think that everything HAS a purpose, even things without one. For most people the only way to see the absurdity is to think about the purpose of purpose.

When I was young, we were told that the purpose of life is to live our lives the right way to go to heaven after we die. Religion gave us the ultimate answer of the purpose of our lives - to test our conformance to God, in order to be rewarded by a pleasant afterlife.

But lets think a little more about it. What would be the purpose of the afterlife then? After we finally made it to the heaven, we would enjoy our afterlife and be happy. What would be the purpose of our existence? It doesn't make sense. Couldn't we just enjoy our lives just right now for the same purpose? The ultimate answer provided by all religions is a mental fallacy. We don't need a purpose. We make our purpose ourselves. 28 comments

The purpose of purpose

written by Tomas M. 175 days ago

Have you ever wondered why are we here? You may find the answer in the following video.

During Richard Dawkins' American tour in March 2009, he gave a talk titled "The Purpose of Purpose". The talks were filmed and edited together here. The content of the talk remains intact, while the editing moves between the different locations and Richard's Keynote presentation.

17 comments

What is atheism?

written by Tomas M. 175 days ago

The following picture explains that clearly :)
15 comments

Squashfs LZMA support

written by Tomas M. 178 days ago

Phillip Lougher, the author of SquashFS, works already on the LZMA support, which should be included in mainline kernel.

Quote from Phillip:
I started working on LZMA support a couple of days ago. I'm hoping to get it finished for the 2.6.31 merge window, though I may miss this. It depends on whether I hit any problems, and how soon the merge window closes.
End quote;

There doesn't seem to be the LZMA code for squashfs in 2.6.31, but I can see several patches in mainline from Phillip with some LZMA bugfixes, so it appears he is really doing something with it (and he fixes LZMA code as he sees problems).

I hope to see LZMA support for mainlined squashfs in 2.6.32. Then I can start working on Slax 7. 10 comments

Power of prayer

written by Tomas M. 180 days ago

Do you think that prayers work? Then you are superstitious. It has been shown many times that it has no effect whatsoever. You may try few experiments for yourself. Prayer is equivalent to horseshit. I meant, horseshoe. And horseshit too.




After understanding that prayer is a superstition, do you still pray? What do you pray for? I used to pray too, but now I would feel like an idiot... 29 comments

(c) 2010, Tomas M; rss