About digital and real life

• Text Post

/usr/bin/python does not match the python default version. It must be reset to point to python2.6

When I’ve tried to install rubygems trough command:

apt-get- install rubygems

I’ve got the following out:

Setting up software-center (2.0.7debian7) …
Traceback (most recent call last):
  File “/usr/bin/pycentral”, line 2334, in <module>
  File “/usr/bin/pycentral”, line 2328, in main
    rv = action.run(global_options)
  File “/usr/bin/pycentral”, line 1477, in run
    runtimes = get_installed_runtimes()
  File “/usr/bin/pycentral”, line 278, in get_installed_runtimes
    default_version = pyversions.default_version(version_only=True)
  File “/usr/share/pycentral-data/pyversions.py”, line 172, in default_version
    raise ValueError, “/usr/bin/python does not match the python default version. It must be reset to point to %s” % debian_default
ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.6
dpkg: error processing software-center (—configure):
 subprocess installed post-installation script returned error exit status 1

That I fixed trough modifying file: /usr/share/pycentral-data/pyversions.py

Line 151:
_default_version = link = os.readlink(‘/usr/bin/python’)

was rewritten like this:

_default_version = link = os.path.realpath(‘/usr/bin/python’)

The reasons why it did not worked for me before that I have few pyhons installed which managed trough update-alternative and os.readlink doesn’t handle case when we have symlink on symlink.

• Text Post

AS3 interview question to reveal difference between premitive/compex types

I got an inspiration about question which helps checks whether candidate understand properly the difference between primitive and complex types in AS3.

function foo1(bar:String):void
    bar += " world";

function foo2(bar:Vector):void
    bar.splice(0, 1);

var bar1:String = "hello";
trace(bar1); // what will be the result?

var bar2:Vector = Vector("hello", "world");
trace(bar2); // what will be the result?

More details can be found in AS3 documentation:

• Text Post

the Cartesian reference frame

The title of this post can be translated into Russian like “ Descartes coordinate system”. When I put this text initially into translate.goggle and met that result, I was confused and curious why it so. A little more looking at Wikipedia gave me answer. It is the same person with different names:

René Descartes - french
Renatus Cartesius - latinized form

In French language “des” it is plural form of one of their articles. And as an article doesn’t have sense itself, when we are translating text into language without articles then articles should be skipped, if it is not part of proper name. But look like Latin Version was gotten with ignorance of article any way. Why then into Russian language came French version instead of Latin one - don’t know, but suspect that 1st translation into Russian language of his works was did from French language, with respect that the article is part of his name.

• Text Post

Turtle vs Tortoise

Задался вопросом, какая разница между словом turtle и tortoise, так как и то и другое гугл переводит на русский как “черепаха”. Погуглил маленько. Материала тьма, вот например ссылка:


Больше всего запутывает фразы типа “A tortoise is a turtle, but not all turtles are tortoises”. Так что проще всего ориентироваться на объяснение типа:

"Tortoises, live on land, Turtles, live in the sea"

Или на картинку:

Однако, для меня остаётся загадкой почему же тогда всем известный мультик про нинзя-черепашек назывался “Ninja Turtles”, а не “Ninja Tortoises”. Потому как мультяшные черепушки никак на морских не тянут. Скорее всего, обиходное использование обоих слов сводит разницу нанет. Обывателю просто пофигу на разницу этих терминов в соответствии с классификацией видов. Или, возможно, значение слов варьируется в контексте страны, где используется. Что-то вроде разницы между британским и американским английским.

• Text Post

Каналы на русском

Небольшой список ТВ-каналов на русском, которые можно смотреть за бугром:

• Text Post

Calibre free open source eBook manager


So cool and powerful app, just some quotes from its description:

- calibre is a free and open source e-book library management application

- Windows, OSX, Linux supported for ubuntu users just type:
apt-get calibre install

- calibre can convert from a huge number of formats to a huge number of formats:



- calibre has a built-in web server that allows you to access your ebook collection using a simple browser from any computer anywhere in the world.

• Text Post

century live - century study

I have met thing a wondering in its simplicity from one side and confused me from another.

We have table for users where we have columns first_name, last_name. Than we have special users for whom: last_name=’Reserved’, first_name = ‘Reserved’.

I need get all users which don’t have special “Reserved” values in their name fields, for that I am using following query:

SELECT * FROM users WHERE last_name != ‘Reserved’ AND first_name != ‘Reserved’

Then you will ask me where is surprising thing here, their is nothing special. The surprise appears on the scene when I add to initial condition that last_name and first_name values also are NULL-able by default. And above SQL will not return them in the result.

Cool, I did not expect that. I would be agree that following SQL:

SELECT * FROM users WHERE last_name = ”

should not return NULL entries, because NULL is not empty string. NULL is undefined string. And from this point of view behavior of system is quite logical, but I really did not expect that.

• Text Post

"Dendy Junior" is being sold in MediaMarkt only for 500 rubles

Last weekend was in MediaMarkt in the shopping mall “Mega-Dibenko” and saw there “Dendy Junior” that costs only 500 rubles. Interesting where it is producing nowadays in Russia or in China? This is piracy clone of produced in the western countries a video game console. That was hacked and localized by Russian hackers. But it was normal for 90’s that it was sold everywhere, when nobody in Russia did not care about any copyrights. But how can it be possible nowadays, especially in the electronic-shop owned by western people.

Stuff I Like