"I am only an egg." [entries|archive|friends|userinfo]
Valery V. Vorotyntsev

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Links
[Links:| *reader* delicious lastfm wishlist yubnub ]

utility of the day [Jul. 10th, 2009|03:31 pm]
[Tags|, , , , ]

gcov - coverage testing tool

sample output )

GCC only.

Link4 comments|Leave a comment

"d-a-i" sequences explained [Jul. 5th, 2009|12:54 pm]
[Tags|, , ]

Well, the promised explanations.

The screenshot shows work-log.el debugging session. The "a-a-i-i-d" patchwork you see there is a work log model (more on this below). A work log is a sequence of dates, active entries, and inactive entries (the latter include comments); see example here. In short: resolved tasks == inactive, pending ones == active, that's it.

Now. `work-log-hide-inactive' function (`C-c C-h') lets user concentrate on open tasks, making inactive "noise" invisible.

The first implementation of the hiding function did hide resolved tasks but also left some dates with no entries at all hanging void. Like this:

2009-07-03

  http://lib/it/processMMS: update scenarios' table

2009-07-02

2009-07-01

  import `recsep' to CVS

Note the "hanging" 2009-07-02.

Okay. Let's omit the boring details (head scratching, pencil sketching, and a couple of "aha!" moments) and goto right to the way I debugged the damn function...

Here the simplified model of a work log suffice: a "d-a-i" sequence -- sequence of ['d', 'a', 'i', '-'] characters, where 'd' represents date, 'a' -- active entry, and 'i' -- inactive. Hyphen ('-') is either empty line or the continuation of previous entry (a task entry in real log can consist of several lines).

All we need to do is change a bit the hiding function (substitute regexps, replace `forward-line' with `forward-char', and show the "hidden" regions in inverted color instead of actually hiding them) and run it on a bunch of dai-sequences.

Testing input is easy to generate:

import Data.List (permutations)

main = putStrLn $ concatMap (\(x,y) -> x++y) (xs `zip` repeat "-")
    where xs = concat $ permutations ["a", "a", "i", "i", "d"]

Given "i-d-a-d-i-d-a-i-" we get:

i-d-a-d-i-d-a-i-

Do you see a hanging date? The hidden (black) region in the middle should cover preceding date ('d-') but it does not.

Well, you got the idea. Once the testing routine was established, it was easy to fix the bug.

i-d-a-d-i-d-a-i-

Q.E.D.

* * *

Yes, and while you're here, I'd like to recommend this post:
Benefits of automated functional testing (was: Why unit testing is a waste of time)

Have fun!

Link2 comments|Leave a comment

word of the day [Jul. 4th, 2009|10:03 am]
[Tags|, , , ]

$ dict braino
2 definitions found

From The Free On-line Dictionary of Computing (4 April 2009) [foldoc]:

thinko
braino

    /thing'koh/ (Or "braino", by analogy with "typo") A
   momentary, correctable glitch in mental processing,
   especially one involving recall of information learned by
   rote; a bubble in the stream of consciousness.

   See also brain fart.  Compare mouso.

   [Jargon File]

   (1996-04-20)


From The Jargon File (version 4.4.7, 29 Dec 2003) [jargon]:

braino
 /bray'no/, n.

        Syn. for thinko. See also brain fart.
LinkLeave a comment

`work-log-hide-inactive' via "d-a-i" sequences [Jul. 4th, 2009|02:16 am]
[Tags|, , , ]

It works!

[screenshot] work-log.el development

Sorry, but no explanations right now -- I'll better have some sleep...

Anyway, the picture is nice, isn't it? :)

* * *

Update: the description of above screenshot.

Link3 comments|Leave a comment

все профессии нужны [Jun. 22nd, 2009|01:13 pm]
[Tags|]

Очень не хватает опыта работы в службе знакомств.

Передо мной выложен ряд из 7 почти неотличимых чёрных носков. Нужно разбить их на пары.

Link2 comments|Leave a comment

CS152-Lecture_14-Kernighan.pdf [Jun. 22nd, 2009|11:01 am]
[Tags|, , ]

Не могу удержаться, чтобы не порекомендовать:

Brian Kernighan, "Random Thoughts on Scripting Languages" (PDF)

Как говорила наша учительница русского языка и литературы: ``Бальзам на раны''. А если проще -- ржак полнейший (достигается умелой расстановкой цитат Ларри Уолла).

Хакеры, наслаждайтесь!

Link4 comments|Leave a comment

Конкурс [May. 22nd, 2009|12:19 am]
[Tags|, , ]

А вот кто напишет кратчайший выниматор списка гиков из предыдущего поста?

Условия:

1) Скрипт читает из stdin (точнее — из команды
`wget -q -O - http://vorotylo.livejournal.com/61461.html').

2) Если используете пайпы — ставьте по одному пробелу с каждой стороны.
Вот так: ` | '.

3) Один человек может предлагать любое количество вариантов.
В `High Scores' записывается кратчайший.

4) Subject: <количество символов>
Ответ обрамляйте <pre>...</pre>

5) Комментарии пока что скринятся.


High scores:
1.lionet   33
2.xrgtn  33
3.xrgtn + vvv  35
4.palm_mute  39
5.maard  41
6.vvv   43
7.nponeccop  46
8.adept  53

Upd: Наконец-то запостили input, который высадил все скрипты, кроме моего. Спасибо! :)

Upd-2: Новый стрёмный input лечится скриптом на 47 символов:
grep o= | grep -Eo '>\+?\w+ \w+<' | tr -d '<+>'

Upd-3: А ещё ведь надо исправлять entries вида `Имя Фамилия':
... | sed -r 's/^(Олег|Виктория) (\w+)/\2 \1/'


Резюме: Да, нелегкое это дело, встречи организовывать.

Link25 comments|Leave a comment

Доклад по ФП и типам: регистрация участников [May. 21st, 2009|05:32 pm]
[Tags|]

Если ты "тип", желающий попасть в список, оставь комментарий в формате:
Фамилия Имя

Сформированный список уйдёт на КПП. Соответственно, чтобы попасть на пир духа, потребуется паспорт.

Удачи!

(После того, как пост выполнит своё предназначение, его сожрёт Козёл Фрэнк.)

* * *

Upd: Алё, мы ищем таланты!

Upd-2: Я наврал, и ничего Фрэнк жрать не будет.

Link44 comments|Leave a comment

Worthy Python [May. 16th, 2009|11:01 pm]

To: self

Do not abandon Python. The language and its library are full of good programming style samples to follow (and borrow).

LinkLeave a comment

мода [May. 13th, 2009|08:35 pm]

Все дамы поголовно носят красноватые приталенные кожанки. Трындец какой-то.

Окей, это я для красного словца. На самом деле таких найдётся две в радиусе ста метров. Получается ..

$ python -c 'from math import pi; print 2/(pi*0.01*0.01)'
6366.19772368

.. Шесть тыщ women in red на квадратный километр города Киева!

PS: "Торговые площади торгового центра Квадрат." Геометрический нонсенс.

LinkLeave a comment

Announcing `work-log' [May. 2nd, 2009|11:34 pm]
[Tags|, , ]

All of you played Doom. Some of you know that it was programmed by John Carmack. Few of you might be aware of .plan files he posted even before the term `blog' was invented. And I find the format used in those files to be clean, minimalistic, and fitting my own issue-tracking habbits.

The format is simple:
* entry was completed on that day
+ entry was completed on a later day
- entry was decided against on a later day

2009-05-02

  advertise work-log.el

2009-04-09

  + hack "log-mode": start with implementing `C-x 4 a' (change-log-mode)
  + fix jabber-el's "Idle" status

2008-12-24

  + kill the bad guys

  - save the world

  the princess?

Whichever log format is used, log file will grow with time. In three months I had a long file with unfinished tasks being scattered and tiresome to find. I wanted to make them visually distinguishable from completed/rejected. Thus work-log.el was born. )

Link4 comments|Leave a comment

12.04 [Apr. 12th, 2009|04:59 pm]
[Tags|]

Младшой перетащил из-под шведской стенки мат, поставил вертикально в кровати. Мат с обратной стороны оказался чёрным.

Нарисовал на нём мелом звёзды. Нацепил на себя пластмассовые доспехи и наушники Beyerdynamic.

Сегодня ведь День Космонавтиков.

* * *

PS: Праздничная еда — Kosmostars.

PPS: Праздничная музыка — David Bowie, Space Oddity.
(Фильм — ``Космическая одиссея 2001 года'', есснно.)

LinkLeave a comment

quote of the day [Apr. 3rd, 2009|08:14 pm]
[Tags|, ]

"Don't be afraid of macros — they'll sense your fear, and fuck you up."
-- M. Greenberg
Link2 comments|Leave a comment

wanted [Mar. 11th, 2009|11:19 pm]
[Tags|, ]

A Linux box with sshd (web-accessible; served at port 443, not 22) and httpd. This can be a virtual machine. I don't want any noisy/heating/space-taking hardware at home.

I would use it to synchronize my LOG file.

* * *

* There should be a good way of adding storage to my WRT54GL.
* Are there any online services?

Link5 comments|Leave a comment

REFACTORME [Mar. 4th, 2009|06:49 pm]
[Tags|, , , ]

def _otherParty(n=0):
    """Return function that converts input fields [and state] to
    other party number/URL.

    The conversion function will return at most `n' characters;
    0 stands for infinity (default).
    """
    def conv(fs, *_):
        if _channel(fs, ['VOICE']):
            if n: return fs[29][:n]
            else: return fs[29]

        if _channel(fs, ['WAP', 'WEB']):
            if n: return _cropURL(fs[26][:n])
            else: return _cropURL(fs[26])

        if n: return fs[26][:n]
        else: return fs[26]

    return conv

What are your refactoring ideas?

(I'm not fond of these "if n: / else:" sections...)

Link4 comments|Leave a comment

coding dojo anyone? [Mar. 2nd, 2009|11:37 pm]

Только что прочитал пост Магнуса,
случайно наткнувшегося на пост Марка,
который предлагал Гарри
затеять coding dojo.

И подумал, что это очень интересно.

* * *

16. Все члены Додзё должны воздерживаться от сплетен, пренебрежительных и унижающих замечаний о других школах и стилях боевых искусств.
[src]

(Не забыть: перестать обсерать язык Java и Windows ось.)

/me произносит Осс в направлении центра зала и садится лицом к стене с закрытыми глазами и опущеной головой.

* * *

PS: А две недели назад парижане функционалили...

PPS: Привожу ссылку на Магнуса. (Накликать Марка и Гарри предоставляется заинтересованному читателю.)

LinkLeave a comment

debian-haskell [Mar. 1st, 2009|10:44 pm]
[Tags|]

debian-haskell mailing list.
Just subscribed.

[browse]
Link4 comments|Leave a comment

hackathon/sprint ideas [Feb. 28th, 2009|11:44 pm]

На сегодняшней встрече LtU-Kiev опять всплыла идея хакатона. Ограничение по времени... да, это основная проблема. Но идея настолько интересна, что я бы даже попробовал. Думаю, могу один выходной в месяц у семьи уворовывать -- чтобы с утра и до вечера. Но даже и три часа посидел бы, просто из спортивного интересу "а что получится?"..

Предложений, что похачить, было несколько, и я их тут запишу, пока помню:

* * *

PS: Проверил, xmonad совсем маленький, хоть и статически слинкован:

vvv@scratchy:~$ du -sh /usr/bin/xmonad .xmonad/xmonad-i386-linux 
936K    /usr/bin/xmonad
1.7M    .xmonad/xmonad-i386-linux

Из чего там у тебя, Антон, 24 MB получалось?

Link6 comments|Leave a comment

presentations [Feb. 28th, 2009|10:36 pm]
[Tags|, , ]

Две ссылки, которые могут вас заинтересовать:

* How to give a good research talk
(Наш старый знакомый SPJ раскрывает секреты мастерства.)

* How to use a linux laptop in presentations
(Сегодня оказалось, что правильно соединить шнуры вовсе не достаточно.)
Link4 comments|Leave a comment

ltu-kiev [Feb. 22nd, 2009|01:26 am]

Для информирования единочаятелей...

Сегодня у нас произошла первая встреча функциональных программистов и им сочувствующих. Убедились, что город — большая деревня, попугали друг друга достижениями, порисовали кораблики... Мозговой пульс столицы бился у зоопарка. Вполне такое замечательное место.

На следующем субботнике (когда де он произойдёт) будем кино смотреть. Приходите!

[емейл-лист]

Link9 comments|Leave a comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]

Advertisement