June 2011
1 post
Tabs vs Spaces
Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML, this issue is just too tricky to even attempt. Indeed Guido van Rossum of Python has acknowledged that allowing TABs in Python source is a headache for many people and that were he to design Python again, he would forbid them.
May 2011
2 posts
5 tags
MacRuby on iOS and OSX Lion
MacRuby has been looking increasingly interesting lately as Laurent Sansonetti at Apple has rapidly built it into a quite performant, stable implementation. It runs on LLVM and is being included with XCode 4/Lion. Lion itself is switching heavily to LLVM, which almost certainly means iOS 5 will as well. The big question for WWDC is whether iOS 5 will get garbage collection, which looks to be the...
2 tags
Remote git tags
Delete a tag from a remote git repository:
$ git push origin :refs/tags/tag-name
Remove local tags that are no longer on the remote repository:
$ git tag -l | xargs git tag -d
$ git fetch --tags
June 2009
1 post
Why Apple keeps iPhone specifications quiet →
oleganza:
“If developers are allowed to write “to the hardware,” the result is a broken platform where the vendor can’t move forward without breaking the apps.”
February 2009
2 posts
3 tags
merb, rails, concurrent requests
Сегодня мне вдруг остро захотелось чтоб один экземпляр веб-приложения, написанного с использованием rails или merb, обрабатывал несколько запросов одновременно.
Merb
Ставим мерб.
sudo gem install merb
Создаем приложение.
merb-gen app merb_app --template-engine=haml
Исправляем конфиг config/database.yml.
development: &defaults
adapter: mysql
database: merb_app_dev
username:...
2 tags
html parser (hpricot vs nokogiri)
Выбирал между hpricot, nokogiri.
Парсил файл размером ~1Mb.
Искал элементы по следующему xpath: html/body//center/table[4]//tr/td/table/tr[1]/td[3]//a
Обе библиотеки честно нашли все 1000 элементов.
Hpricot 0.6.170 за 6.21 сек.
Nokogiri 1.1.1 за 0.75 сек.
Nokogiri под ubuntu 8.10 ставим так:
sudo apt-get install libxml-ruby libxslt-dev
sudo gem install nokogiri
Mechanize кстати тоже...
January 2009
1 post
FriendFeed
FriendFeed оказался хорош. Воспользуйтесь им и мы наконец то сможем обсудить расшаренные в гуглоридере новости, сможем уведомлять и быть уведомленными через jabber.
Больше не нужно проверять блог, твиттер, ридер и другие сервисы, чтоб узнать, что интересного или не интересного сказали или нашли ваши друзья. Так же не приходится думать в какой сервис делиться ссылкой на что-либо, чтоб быть...
December 2008
1 post
1 tag
Understanding Ruby blocks, Procs and methods →
Все что я хотел знать а различиях lambda и Proc.new но боялся спросить.