imitatio creatio co we łbie piszczy

6Jan/120

Joanna Siedlecka – Jan Himilsbach

Znowu zapodam coś z nieocenionego archiwum Andrzeja Krzemińskiego:

Joanna Siedlecka - Jan Himilsbach.

Przeżył przyjaciela o lat jedenaście, zmarł jednak w okolicznościach dość podobnych, również przez wódę.

28Dec/110

vim as a pager for psql

I asked this question on stackexchange, about a pager with "freeze first line" support.

There was no easy answer, but someone hinted me at Emacs. My Emacs skill is close to zero, so I wanted to check if it's possible in Vim.

And yes it is! Here you are:

First, we need a Vim macro, which will do most of the work, I save it in ~/.vim/plugin/less.vim:

" :Less
" turn vim into a pager for psql aligned results 
fun! Less()
  set nocompatible
  set nowrap
  set scrollopt=hor
  set scrollbind
  set number
  execute 'above split'
  " resize upper window to one line; two lines are not needed because vim adds separating line
  execute 'resize 1'
  " switch to lower window and scroll 2 lines down 
  wincmd j
  execute 'norm! 2^E'
  " hide statusline in lower window
  set laststatus=0
  " hide contents of upper statusline. editor note: do not remove trailing spaces in next line!
  set statusline=\  
  " arrows do scrolling instead of moving
  nmap ^[OC zL
  nmap ^[OB ^E
  nmap ^[OD zH
  nmap ^[OA ^Y
  nmap <Space> <PageDown>
  " faster quit (I tend to forget about the upper panel)
  nmap q :qa^M
  nmap Q :qa^M
endfun
command! -nargs=0 Less call Less()

Second, to emulate a pager, I need to invoke vim so that it will:

  • read standard input
  • but if argument is given on command line, read whatever comes there
  • work in read-only mode
  • skip all init scripts, but instead execute Less macro defined above

I put this together as helper script in ~/bin/vimpager:

#!/bin/bash
what=-
test "$@" && what="$@"
exec vim -u NONE -R -S ~/.vim/plugin/less.vim -c Less $what

Third, I need to override environment variable $PAGER, but only for psql (add this to my ~/.bash_aliases):

if which vimpager &>/dev/null; then
  alias psql='PAGER=vimpager psql';
fi

Fourth, I disabled "\pset pager always" in my ~/.psqlrc file, because I don't need to invoke vim on small listings.

That's all - and it works for me.

PS. There is "vimpager" here, but mine is much simpler and specific to psql query results.

7Oct/110

Gugała vs Hofman

1...2...3...FIGHT!

Gugała jest zdeterminowany, wyprowadza duzo ciosów... ale słabiutkie te ciosy, jakby kogucik drapał niedźwiedzia...
Hofman spokojnie kontruje, i kilka prawych prostych ląduje na szczęce Gugały.

Po nokaucie technicznym trener zdejmuje Gugałę z kliku następnych meczy.

Oj Gugała, Gugała, w dyplomacji... TFU! w boksie to wy większej kariery już nie zrobicie...

11Sep/110

więcej linków prasowych o GMO

Tekst Adama Wajraka z Wyborczej: http://wyborcza.pl/1,76842,10137176,Moja_prosba_do_prezydenta.html i Jacka Żakowskiego: http://wyborcza.pl/1,76842,10118109,Lub_calkiem_inne_rosliny.html

Tekst dra Stankiewicza: Jaka debata o GMO? "Dominacja ekspertów reprezentujących branżę biotechnologiczną, często wprost związanych z firmami", a zwłaszcza taki cytat:

Problem polega na tym, że gdy wypowiadają się na temat GMO, nikt nie oczekuje od nich deklaracji na temat ich powiązań z przemysłem biotechnologicznym.

I jeszcze jeden z Wyborczej - http://gospodarka.gazeta.pl/gospodarka/1,33181,10159486,Dwuglos_w_sprawie_GMO__Zagrozenie_czy_szansa_.html
- tu zwłaszcza podoba mi się skontrowanie przez dr Lisowską nieśmiertelnej sugestii o rzekomych odgórnych regulacjach prawnych GMO z Unii Europejskiej:

Czy nasza strategia ma polegać tylko na implementacji unijnych przepisów? Czy my nie mamy tyle woli politycznej, żeby kształtować prawo? Inne kraje Unii nie przejmowały się tym, co mówi Komisja, i wprowadziły u siebie zakaz GMO. W efekcie teraz trwają prace nad zmianą unijnych przepisów.

( zob. to co pisałem wcześniej o regulacjach prawnych nt. GMO w Europie )

Tagged as: , No Comments
29Aug/111

American policy on GMO promotion – Cable from Poland

The cable from US embassy in Warsaw.. and just let me one notable citation (that's what students asked about reasons of introducing GMO in Poland, a country which is a large producer of food, and has food overproduction):

They asked about the purpose of altering the genetic structure of food, in what is essentially a "if it's not broken don't fix it" argument that is commonly made in Poland.

( via Cable Viewer).

Yeah... that argument is an American invention, and it is a STRONG argument - all my collegue IT engineers should know that.

If it ain't broke, don't fix it!

Tagged as: , , , 1 Comment