HNHacker News
TopNewBestAskShowJobs

byambatsogt

1 karma · joined October 13, 2011

submissionscomments
byambatsogt··on Magnus Carlsen wins Game 6; leads Viswanathan Anand 4-2
I would say Carlsen's stamina is what bringing him the victories. Anand is not being able to keep his concentration on high level after 5 hours of battle. Clearly shows the age difference.
byambatsogt··on Relational shell programming
Nice article. I actually worked for a Japanese company that uses relational shell scripting for developing web systems. They use space separated tables and have developed a set of commands to process text files. Those commands are pretty useful and easy to use. Few examples would be:

- self 1 2 fileName - selects first and second column from the file. There is corresponding tagself command which assumes the first row of the file is the column name. - Join commands which are essentially implementations of sql joins. - Sum commands. One that I remember is sm2.

   $ cat data
     a 15 asdf
     a 30 aaa
     b 13 bbb

   $ sm 1 2 data
     a 45
     b 13
So you would chain these with unix native commands such as awk, sed, grep and do some interesting stuff. Here is a very simple example shows how it would look like:

cat data | self 1 2 | sm 1 2 | grep some_expression > new-data

There is a lot other of these commands that do various sort of thing with text and html files. Anyone who understands japanese might wanna check this out http://www.youtube.com/watch?v=1MYKp7dswQg.