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

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

Links
[Links:| wikipedia yubnub reader del.icio.us last.fm ]

хозяйке на заметку [Oct. 29th, 2007|07:07 pm]
[Tags|, ]

Чтобы смахнуть паутину с web-журнала, оставлю ссылку на охоту за азевайзом.

Другое... другоэ... асталъное... Пусть будет прочерк (_).
LinkLeave a comment

import lists: explicit vs. implicit [Oct. 24th, 2007|11:07 am]
[Tags|, ]

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.

Lilliput and Blefuscu
LinkLeave a comment

Key That Was Lost, Galbadia [Oct. 5th, 2007|07:24 pm]
[Tags|, , , ]

Не знаю, как кому, а мне иногда приятно слушать саунтреки к когда-то игранным компьютерным игрушкам. И сайт присмотрел, где этих саунтреков валом — Galbadia Hotel. Одно плохо — выкачивать неудобно.

Через тернии к файлам. )
Link4 comments|Leave a comment

Google Talk with emacs-jabber [Jun. 14th, 2007|04:31 pm]
[Tags|, , , , ]

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 ; there is a firewall here
      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:
--- /usr/share/emacs/21.4/lisp/xml.el   2001-10-18 23:19:51.000000000 +0300
+++ /home/vvv/.elisp/xml.el     2007-06-15 12:34:13.451906206 +0300
@@ -262,7 +262,7 @@
                    (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]

LinkLeave a comment

some lazy C++ [Mar. 28th, 2007|10:58 am]
[Tags|, , , ]

Придумал вот ленивую инициализацию на C++.

c++ code... )

На работе есть программки, которые кешируют базу данных. Чтобы не вставлять в тщательно выбранных местах вызовы типа dbcache::init(), применю, пожалуй, эту on-demand схему...

Примечание
А, между тем, в Python все просто: у каждого объекта есть аттрибут __class__ и простым присваиванием можно менять класс объекта "на лету"[2].

Update: все уже придумано до нас — см. Virtual proxy.


Ссылки:

  1. Nicolai M. Josuttis, The C++ Standard Library - A Tutorial and Reference:
    cont/countptr.hpp
  2. ASPN: Python Cookbook: Ring Buffer
  3. Wikipedia: Lazy initialization
Link4 comments|Leave a comment

navigation
[ viewing | most recent entries ]