Päiväcirja

Subscribe to RSS feed

Sticky post

Вводная /Briefing/ Orientering

,

Музыка прошлой недели
/Last week's music/
Musik av den sista veckan
Jabber status (sterkrig@jabber.se)
Тут я буду писать всё, что должно быть в самом начале (-:Е
/ This post contains everything meant to be on the very top/
Den här anteckningen innehåller allting som jag önskar att visa i början
(-:E

Who are those omni-nationalists?

Om du talar svenska bra...

Read more...

Субтитры / Subtitles

,

Вниманию товарищей, смотрящих фильмы или сериалы на иностранных языках,
предлагается следующий хитрый финт ушами.


If you watch anything in foreign language, here's simple trick for you.


Read more...

Driver dagg, faller regn

,

Herr Olof han rider att möta sin brud
långt borta i främmande land
skön Jungfrun hon sömmar en gyllene skrud
hon väver de skira gullband.

Read more...

Sony PRSA-CL10B: отзыв / review

,

Приобрёл я Sony Reader PRS-T1. Отличная читалка, могу рекомендовать. Но без обложки не очень-то хорошо, так что я взял в комплект Sony PRSA-CL10B. «Да будет свет!» — подумал я. Ну да, свет есть. Плохо только, что собственно как обложка она погана.
  • Мягкая: легко прогибается, вплоть до самого экрана
  • Никак не закрывается: не фиксируется ни в открытом, ни в закрытом виде. Ни кнопки, ни магнитика, ни черта.
  • Возмутительно дорогая: 40% стоимости самой читалки. С учётом вышеописанного — курам на смех.
Хорошо хоть я не купился на более дешёвую версию без лампады, потому что свет — это единственное, что мне нравится. Ну и сама читалка прекрасна. Просто задумайтесь над приобретаемой обложкой и помните о сказанном мной.

I've recently bought Sony Reader PRS-T1. Excellent reader, rest assured of that. But cover is a must-have for such a thing, so I chose Sony PRSA-CL10B. "Let it be light!", I thought. Oh yes, there is. The problem is that the cover is crappy by itself.
  • It is soft: sags easily down to screen itself
  • It lacks any lock: can't be fixed in neither opened nor closed state; no press stud or magnet or anything, cover is more or less loose
  • It's bloody expensive (more than 40% of Reader price); considering aforementioned points, I'd call this ridiculous
I'm just glad I haven't decided to buy "light-less" (a bit cheaper) version of that cover, because LED light is the only thing I like about it. Oh, and the Reader is great. Just choose cover wisely, remembering what I wrote here.

Python: usage in enterprise environment

,

Gentoo: PostgreSQL server service fails to start, but server is running

,

If your `/etc/init.d/postgresql-8.4 start` fails after timeout, but server runs in the background unharnessed, and `/etc/init.d/postgresql-8.4 restart` fails with "Socket conflict", make sure you haven't deleted "postgres" database and recreate it in that case.

Flask sessions and unicode_literals

, ,

If you had tried to use Flask sessions and got something like that:

  File "/usr/lib64/python2.7/site-packages/flask/app.py", line 889, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib64/python2.7/site-packages/flask/app.py", line 871, in wsgi_app
    with self.request_context(environ):
  File "/usr/lib64/python2.7/site-packages/flask/app.py", line 836, in request_context
    return _RequestContext(self, environ)
  File "/usr/lib64/python2.7/site-packages/flask/ctx.py", line 33, in __init__
    self.session = app.open_session(self.request)
  File "/usr/lib64/python2.7/site-packages/flask/app.py", line 431, in open_session
    secret_key=key)
  File "/usr/lib64/python2.7/site-packages/werkzeug/contrib/securecookie.py", line 308, in load_cookie
    return cls.unserialize(data, secret_key)
  File "/usr/lib64/python2.7/site-packages/werkzeug/contrib/securecookie.py", line 255, in unserialize
    mac = hmac(secret_key, None, cls.hash_method)
  File "/usr/lib64/python2.7/hmac.py", line 133, in new
    return HMAC(key, msg, digestmod)
  File "/usr/lib64/python2.7/hmac.py", line 72, in __init__
    self.outer.update(key.translate(trans_5C))


...you might be obscured. Fear not! The reason may lurk in

from __future__ import unicode_literals


Just declare your SECRET_KEY as `bytes` object and get happy again!

SECRET_KEY = b'smthverrysekret'

Two (probably) useful Mercurial hooks

, ,

Here's two Mercurial hooks I wrote for my work. One is a reminder to mention Trac tickets in commit messages, and the other notifies a developer when someone (not him) touches his part of project.

Read more...

О вёснах / About springs

,

Пришла весна. Правда, только календарная, а я её настоящей не считаю. Год у нас считается по солнцу, и потому времена года тоже должны бы отсчитываться от солнечных событий, то бишь равноденствий и солнцестояний. Астрономическая весна начнётся только в день весеннего равноденствия (в этом году — 20 марта), но по мне это несколько странновато. Выходит, солнце растёт только зимой и весной, а летом и осенью «катится во тьму». Мне кажется логичным считать солнцестояния и равноденствия серединами соответствующих времён года, тогда получится, что весна — четверть года, когда солнце быстрее всего набирает силу, зима — самая тёмная четверть и т.д. В любом случае, начало весны в трёх неделях от сегодняшнего дня. А вот в какую сторону…
Spring has came (to northern hemisphere, that is). That is to say, calendar one, and it doesn't seem true one to me. We count years by sun, so all the seasons of year should be determined by solar events, solstices and equinoxes (equinoces?). Astronomers believe that spring begins on vernal equinox (20 Mar in 2011). But that's a bit strange to me personally, since that way daytime increases only in winter and spring, and summer and autumn are both time of "darkening". I'd prefer to consider that equinox (or solstice) are middles of theire seasons, so spring is a quarter of year, when daytime growth is fastest; summer is a quarter of year with the biggest daytime etc. Either way, the first day of real, solar spring is three weeks away from today. Before or after.

Python: вложенный итератор / nested iterator

, ,

Просто образчик вложенного итератора на Python, через рекурсивное выражение yield.
Just a (probably) useful examle of nested Python generator written in Python using recursive yield expression.

Read more...

{hg, git} bisect + portage

, , , ...

Не так давно имел я счастье вляпаться в неприятную ошибочку с моим любимым awesome. Разрабы попросили сделать git bisect, чтоб найти причину косяка, но выяснилось, что просто запуском свежесобранного бинарника не отделаться. Пришлось немного подумать и сопрячь bisect и Portage.
Recently I did stumble into a annoying bug in awesome WM. Devs asked me to do git bisect in order to help fixing it, but it appeared that simple compiling and running the binary wasn't enough for reproducing it, so I though a bit and managed to couple bisecting and Portage.

Read more...

Tabs and spaces

, ,

That's quite old and well-known, of course, but I now have to deal with code like that (count the spaces!):
class c_integral_type(c_type):
    def __init__(self, name, format, min, max):
       c_type.__init__(self, name, struct.calcsize(format))

or like that (MyOpera replaces tabs, so believe my comments):
    def genMemList( self, members ):              # indented with 4 spaces
#        self.append( '\tdef members(self):\n' )  # indented with one <Tab>

So…




Oh noes! That's what I had to deal with:

  % pylint buratino
   .......
Your code has been rated at -1.79/10


My code isn't perfect, I'd be first to agree, but it scores 7/10, and it's positive 7, mind you!
Bloody hell. So, back to work then

Коржики!

Официальный украинский языковой файл для Opera 9.6

; Used in the progress bar while the user selects to accept or reject a
; cookie in the cookie warning/confirmation dialog, when accessing a site
; that requires the server to set client cookies, and Opera is not set to
; automatically receive this kind of cookie.
2096696774="Очікування підтвердження користувача щодо коржиків..."