Авторское право vs. всенародное обсуждение

Тут Лукьяненко поставил ссылку на высказывание об авторском праве Романа Афанасьева. Что симптоматично, у обоих комментарии отключены. К чему бы это?

ЗЫ: Назовите меня идиотом, но чтобы найти ссылку на этот постинг Лукьяненко, пришлось прошерстить 431 страничку, от id предыдущего постинга до id следующего. Примерно вот так:

for i in `seq 304622 305053`; do
wget http://doctor-livsy.livejournal.com/$i.html
done |grep gringrin *html
Интересно, есть ли какой-нибудь более прямой способ ставить линки на постинги с отключенными комментариями?

rubygems as the biggest obstacle to Ruby's adoption

Everyone and his friend is already aware that installing rubygems to a non-default location was a nightmare just until very recently (that is, version 0.9.5, produced on 2007-11-19).

Now, suppose we try to do something simpler, like err... uninstalling a gem. gem remove mygem yields no results. I do gem --help and... there is nothing about removing a gem in the command line help. Fine. Before deleting manually, let's look it up on the internet. RubyGems User Guide says it should be gem uninstall mygem. How nice!

OLPC: Omnipresent Loyalty Protection & Control

Тут abbra пишет про удачное внедрение OLPC и ненароком сообщает статистику испльзования этих компьютеров детьми. Это значит, что кто-то, даже не родители, а в лучшем случае учителя мониторят детские компьютеры на предмет того, что и когда они написали. А вы бы хотели, чтобы в ваш комп заглядывали без спросу?

Looks like it is not limited to Belgium

There is a whole thread on /. about the pay system failures in US public schools.

As usual with slashdot, you get sometimes a pearl while digging through a multitude of clueless comments. Here is one I found out for you:

Over time you get more and more complex rules for how to calculate pay. The end result is that nobody understands their pay slips anymore and it is nigh impossible to implement and test a system that handles all the exceptional cases.

Groovy documentation and the human mind

How can one not be disappointed with Groovy after looking at its User Guide?

Here is just one example. Can you tell from the StreamingMarkupBuilder documentation how it works? I bet no. After looking through the code snippets on the page and figuring out I could not understand a line of code there, I wondered what is the mkp variable that appears twice on the page.

It took me some time to get through the Groovy class hierarchy up to the BaseMarkupBuilder.java just to find the mkp namespace declaration.

 namespaces.put("mkp", "http://www.codehaus.org/Groovy/markup/keywords");   // pseudo namespace for markup keywords

After googling for mkp markup keywords, I found a page that explains in a few words the design of markup builders. Nothing more, nothing less. Now, I know everything I had to know about mkp and markup builders. The thing is, it is a post of the developer who just committed the markup builders feature. The documentation is supposed to be better that that but it not even worse, it is blatantly misleading.

Controlling the size of the $PWD in bash, version 2

Er... after reading the insightful comments at debian-administration.org, I figured out a much shorter version which is also easier to understand. Tested on GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu).

{syntaxhighlighter brush: bash} function truncate_pwd { newPWD="${PWD/#$HOME/~}" local pwdmaxlen=$((${COLUMNS:-80}/4)) if [ ${#newPWD} -gt $pwdmaxlen ] then newPWD=".+${newPWD: -$pwdmaxlen}" fi } PROMPT_COMMAND=truncate_pwd PS1="${ttyname}@\h:\${newPWD}\\$ " {/syntaxhighlighter}

Controlling the size of the $PWD in bash

I just fixed a 6-year old bug in the 5 lines of code that I use at least 100 times a day, every day, including weekends and holidays. Now, I can finally publish it.

function truncate_pwd
 if [ $HOME == $PWD ]
 elif [ $HOME ==  ${PWD:0:${#HOME}} ]

  local pwdmaxlen=15
  if [ ${#newPWD} -gt $pwdmaxlen ]
    local pwdoffset=$(( ${#newPWD} - $pwdmaxlen  ))

PS1="${ttyname}@\[${HOST_COLOUR}\]\h\[${RESET_COLOR}\]:\${newPWD}\\$ "

Just put the above snippet of code into ~/.bashrc

Debian shows the absolute path in the command prompt by default, and it can be really long, sometimes.To fix this, we can limit the command prompt to show only the last x characters using only the variable expansion features of bash 2.0.5+. Since this code does not fork out sed, tr or wc, it is blazingly fast.

Java sucks where Python rulez

There's been a long-standing commitment from Sun to make Java backwards-compatible. It made introducing new features in Java painful (generics), and fixing bugs (java.sql.Timestamp vs. java.lang.Date) impossible. On the other hand, that huge Java Class Library really needs refactoring and compatibility breaking is the only way to improve the developer experience.

Python development goes on in a completely different manner. They are set on producing a partially incompatible version called "Python 3000" that will fix the major design flows of the language (e.g. crappy i18n).

I hope Java does the same or dies.