| хозяйке на заметку |
[Oct. 29th, 2007|07:07 pm] |
Чтобы смахнуть паутину с web-журнала, оставлю ссылку на охоту за азевайзом.
Другое... другоэ... асталъное... Пусть будет прочерк (_). |
|
|
| import lists: explicit vs. implicit |
[Oct. 24th, 2007|11:07 am] |
Since the subject relates to holy wars, this post should stay in
personal blog. ;)
There is a rather active thread in xmonad mailing list,
concerning Haskell coding style guidelines. And a question about what kind
of import lists is preferable - implicit or explicit - has been raised in
particular.
I choose not to use explicit import lists. They are tedious to
write, they lead to code which looks dirty, and they are headache to
maintain.
And I don't agree with the argument that it is hard to find a
particular definition without explicit lists. It is not. When a code
is loaded into ghci, I can use the :info command to find
a definition. I can use etags (ctags?) to jump
between symbols in my favorite editor. And when I am stuck (or lazy),
I use hoogle.
It is so simple, it should stay that way. Let compiler do its job.
 |
|
|
| Key That Was Lost, Galbadia |
[Oct. 5th, 2007|07:24 pm] |
Не знаю, как кому, а мне иногда приятно слушать саунтреки к когда-то
игранным компьютерным игрушкам. И сайт присмотрел, где этих саунтреков
валом — Galbadia Hotel. Одно плохо —
выкачивать неудобно.
( Через тернии к файлам. ) |
|
|
| Google Talk with emacs-jabber |
[Jun. 14th, 2007|04:31 pm] |
We did it!
"We" includes my new friend Jun Jie: it's his blog where I found the missing variable (ta-dah!) — jabber-network-server.
(To self: RTFM, RTFM, MF!..)
With new settings
(setq jabber-username "valery.vv" jabber-server "gmail.com"
jabber-network-server "talk.google.com"
jabber-port 443 jabber-connection-type 'ssl)
the connection succeeded.
...But another error manifested:
error in process filter: xml-parse-tag: XML: End tag for iq not found before end of region
This one was easier to handle. Here goes the patch:
(set 'children (append children
(list (xml-substitute-special string))))))))
(goto-char (match-end 0))
- (skip-chars-forward " \t\n")
+;; (skip-chars-forward " \t\n")
(if (> (point) end)
(error "XML: End tag for %s not found before end of region"
node-name))
Looks much better now. :-)
[previous post] |
|
|
| some lazy C++ |
[Mar. 28th, 2007|10:58 am] |
Придумал вот ленивую инициализацию на C++.
( c++ code... )
На работе есть программки, которые кешируют базу данных. Чтобы не вставлять
в тщательно выбранных местах вызовы типа dbcache::init(), применю,
пожалуй, эту on-demand схему...
Примечание
А, между тем, в Python все просто: у каждого объекта есть аттрибут __class__ и простым присваиванием можно менять класс объекта "на лету"[2].
Update: все уже придумано до нас — см. Virtual proxy.
Ссылки:
- Nicolai M. Josuttis, The C++ Standard Library - A Tutorial and Reference:
cont/countptr.hpp
- ASPN: Python Cookbook: Ring Buffer
- Wikipedia: Lazy initialization
|
|
|