<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3569666675299554168</id><updated>2011-11-01T00:17:38.148+01:00</updated><category term='googledocs'/><category term='zf'/><category term='e-ink'/><category term='4to4'/><category term='a'/><category term='wow'/><category term='fosdem'/><category term='chrome'/><category term='quine'/><category term='renderer'/><category term='llsd'/><category term='elevators'/><category term='git'/><category term='cast'/><category term='society'/><category term='rails'/><category term='note-to-self'/><category term='video'/><category term='thought_experiments'/><category term='ocr'/><category term='evil'/><category term='cosimus'/><category term='gncci'/><category term='facebook'/><category term='business'/><category term='opencv'/><category term='x11'/><category term='hci'/><category term='vmware'/><category term='security'/><category term='conkeror'/><category term='economy'/><category term='information'/><category term='psy'/><category term='dilbert'/><category term='apt'/><category term='brain'/><category term='experiment'/><category term='links'/><category term='c'/><category term='android'/><category term='dns'/><category term='sup'/><category term='marketing'/><category term='fun'/><category term='ubuntu'/><category term='touchpad'/><category term='luajit-fun'/><category term='talks'/><category term='ragel'/><category term='sha1'/><category term='ruby'/><category term='virtualization'/><category term='peltier'/><category term='javascript'/><category term='tex'/><category term='cache'/><category term='prosody'/><category term='zettair'/><category term='rfc'/><category term='ietf'/><category term='attiny'/><category term='lua'/><category term='http'/><category term='potion embedded lua'/><category term='luajit'/><category term='tcc'/><category term='vegas'/><category term='freedom-box'/><category term='ios'/><category term='debian'/><category term='nodejs'/><category term='ndpmon'/><category term='ship-it'/><category term='kvm'/><category term='potion'/><category term='entrepreneurs'/><category term='linux'/><category term='mongrel2'/><category term='embedded'/><category term='math'/><category term='wintures'/><category term='speaking'/><category term='sockets'/><category term='howto'/><category term='programming'/><category term='music'/><category term='lisp'/><category term='scapy'/><category term='gae'/><category term='time'/><category term='nat'/><category term='minilight'/><category term='outlook'/><category term='teg'/><category term='unix'/><category term='smoking'/><category term='languages'/><category term='search'/><category term='https'/><category term='japan'/><category term='cpp'/><category term='g581'/><category term='mercurial'/><category term='phi'/><category term='questions'/><category term='ipv6'/><category term='stackexchange'/><title type='text'>Bits and Pieces</title><subtitle type='html'>A notebook for various random stuff.

27db66f29f693d821f3d75c90623d001b7c3b73e</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default?start-index=101&amp;max-results=100'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>123</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1761765917531441136</id><published>2011-10-31T22:17:00.003+01:00</published><updated>2011-11-01T00:17:38.166+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='googledocs'/><title type='text'>How to create a cost sharing app using Google Spreadsheets</title><content type='html'>I want to document a solution to a practical problem: a few people may want to share the expenses of various kind in a fair fashion.&lt;br /&gt;&lt;br /&gt;The straightforward way is for everyone to just announce their expenses, and collect 1/n parts of them from everyone else. However, it is obvious that this is a very tedious way of doing things: say, 5 people spend 10 euros each on some things, thus each of them will need to give 4 times 2 euro - and receive 4 times 2 euro - the result of all this activity being exactly the same when it has started!&lt;br /&gt;&lt;br /&gt;Thus, it's a clear area of optimization. At first I thought about a web app. Google apps could do that. However, I decided to try to be even lazier and to implement the whole thing using Google spreadsheets. The result is a successful "app" which in the main "screen" (the main sheet of the spreadsheet) displays for every person whether they owe money to someone or whether they need to collect money. A person who needs to collect money can chase some of the debtors, and then, once collected, put a note about that. The system will recalculate the debts.&lt;br /&gt;&lt;br /&gt;First, the "theory" (if I may call this so:).&lt;br /&gt;&lt;br /&gt;We start with a per-person value of how much expense do they incur. The "fairness" means that all of them would have equal expenses - so the target value is the average of the expenses. As one person gives the money to the other one in order to "balance" - this event needs to be recorded in order to decrease the imbalance for both - in different directions.&lt;br /&gt;&lt;br /&gt;That's all that is there, really. The rest is the mechanics.&lt;br /&gt;&lt;br /&gt;First, let's assume that the users are "normal" people and they do not want to enter the data into the spreadsheet manually (not only it is boring but is also very error prone).&lt;br /&gt;&lt;br /&gt;So, we create so called "web form". Pitifully only one instance of this seems to be possible. Anyway, we make a web form with 5 fields:&lt;br /&gt;"My name is": dropdown list with all the names.&lt;br /&gt;"I have made an": dropdown with 2 choices: "expense" and "repayment"&lt;br /&gt;"How many euros": the text input to put the $$$ value in.&lt;br /&gt;"What for?": freeform text field to document the purpose of transaction.&lt;br /&gt;"If you repaid to someone, to whom?": dropdown with the default choice of "---" and then the same names as in the first field.&lt;br /&gt;&lt;br /&gt;Having to manually enter the names is somewhat annoying, I haven't figured out the way around it. Anyway, as you try entering the data into this form, you notice it starts to fill the sheet in. You will see the first line of the sheet being: "A&gt;Timestamp |B&gt; I am: | C&gt;I have made a: | D&gt;How many euros ? | E&gt;What for ? | F&gt;If you repaid someone, to whom did you repay ?" (the "A&gt;" is the name of the column, for reference).&lt;br /&gt;&lt;br /&gt;Starting from row 2 you will see the actual data. We need to shift the data to row 12 - the rows 2..11 we will need for various aggregate calculations.&lt;br /&gt;&lt;br /&gt;The column "K" will hold the labels for them - just for us to remember. The contents of this column, starting from "K2":&lt;br /&gt;&lt;br /&gt;Who&lt;br /&gt;Got/Made&lt;br /&gt;Type&lt;br /&gt;Total&lt;br /&gt;DeltaAvg(+/-)&lt;br /&gt;Repaid&lt;br /&gt;Received&lt;br /&gt;Balance&lt;br /&gt;&lt;br /&gt;Now, in L2, M2, N2... we need to put in the names - exactly the same way as we have typed them earlier in the web form. Let's say we have four people: Amy, Bob, Carol, Dave. L2 will read Amy, M2 - Bob, N2 - Carol, O2 - Dave; Repeat two more times in the same order. So P2 and T2 will read Amy, etc.&lt;br /&gt;&lt;br /&gt;Why the names are repeated three times ? This will become obvious shortly. Go to the third line, and leave L3..O3 empty, then P3..S3 will become "made" and T3..W3 will become "got".  Now go to the line 4, and the cells L4..O4 will need to have "expense", and the cells P4..W3 will need to have "repayment". &lt;br /&gt;&lt;br /&gt;Now this clarifies the purpose of the three groups - this is a mechanism to untangle the data from the dense web form: each column will only get a value if that particular person was involved in that particular activity. &lt;br /&gt;&lt;br /&gt;To calculate the total expenses per person, enter the following formula into L5: =SUM(L$12:L), and copypaste it into M5..W5 - notice that the column will auto-change. This is precisely as we need it. The line 5 will hold the calculated totals per activity per person.&lt;br /&gt;&lt;br /&gt;Now let's calculate the average of total expenses per person. Enter the formula into the J6: =average(L5:O5), and put the label into J5 saying "Average total expense" or something similar.&lt;br /&gt;&lt;br /&gt;L6 will hold the signed delta between the average and the expenses for Amy: =$J$6-L$5; copy-paste this same formula to M6..O6.&lt;br /&gt;&lt;br /&gt;L7 will hold the amount of how much Amy has repaid to others, so the formula will be naturally the sum of her repayments: =SUM(P12:P); similarly to previous value - copy-paste this formula into M7..O7.&lt;br /&gt;&lt;br /&gt;L8 will hold the amount of how much Amy has received from others in repayments. So, the formula is: =SUM(T12:T); again copy-paste this formula into M8..O8 - the column will auto-update to correct value.&lt;br /&gt;&lt;br /&gt;L9 will hold the final "balance" for Amy - if she needs to pay, the value is positive, if she needs to get money from others, it will be negative. The formula is: =L6-L7+L8&lt;br /&gt; and similarly needs to be copy-pasted into M9..O9.&lt;br /&gt;&lt;br /&gt;We are almost there - now we need to actually populate the rows with the monetary values... One problem: the rows with the actual data are being dynamically added, how do we add the formulae there ? The answer is with the "arrayformula" - it autoexpands down as needed.&lt;br /&gt;&lt;br /&gt;So, put the following formula into L12: =ARRAYFORMULA(IF($B12:$B=L$2,IF($C12:$C=L$4,$D12:$D,0),0))&lt;br /&gt;&lt;br /&gt;This says that if the name of the participant matches the name for this column and the name of the activity matches - then the number entered will appear here, else it will be zero.&lt;br /&gt;&lt;br /&gt;Copy this formula to M12..S12. This way we make sparse tables for two activities - entering expenses, and entering the repayments to others. If you move to L13, you will see the following formula autopopulated: =CONTINUE(L12, 2, 1). Neat, huh ?&lt;br /&gt;&lt;br /&gt;Now we need to populate the third group - the synthetic one that captures the amounts the person *receives* in repayments. For this we need just to slightly modify the above arrayformula, and put it into T12: =ARRAYFORMULA(IF($F12:$F=T$2, IF($C12:$C=T$4,$D12:$D,0), 0))&lt;br /&gt;&lt;br /&gt;You see that the only thing changed is the column from the form entry with which we compare.&lt;br /&gt;&lt;br /&gt;Copy-paste this formula to U12..W12. We are almost there.&lt;br /&gt;&lt;br /&gt;This completes the "brains" of the application, and the line 9 is already usable, &lt;br /&gt;but we can make it more user friendly. Rename the current only sheet into "Expenses" and lock it. Create a new sheet called "Dashboard".&lt;br /&gt;&lt;br /&gt;Go to cell B3 in this spreadsheet, and enter the formula: =Expenses!L2 - this will autopopulate the first name. Copy-paste this formula to C3..E3 - this will populate the other names.&lt;br /&gt;&lt;br /&gt;Now we need to tell the status of the balances of these people.&lt;br /&gt;&lt;br /&gt;Go to B5, and enter this formula:&lt;br /&gt;&lt;br /&gt;=IF(Expenses!L9&gt;0;concatenate("Needs to pay " , Expenses!L9, " euros"); IF(Expenses!L9&lt;0; Concatenate("Needs to take ", -Expenses!L9, " euros"); ""))&lt;br /&gt;&lt;br /&gt;This will translate the sign into the appropriate action for the person.&lt;br /&gt;&lt;br /&gt;Last touch: we can liven the actions up, if we color the "needs to pay" actions with one color, and "needs to take" with another color. &lt;br /&gt;&lt;br /&gt;Right-click the B5, and select "Conditional formatting".&lt;br /&gt;&lt;br /&gt;Add a new rule with "text contains" "pay" and select red background and green color, and another rule with "text contains" "take" and select green background and red color.&lt;br /&gt;&lt;br /&gt;Copy-paste the cell from B5 to C5..E5.&lt;br /&gt;&lt;br /&gt;Lock this sheet too. You are done and now have an expense tracking application fully embedded into google spreadsheets.&lt;br /&gt;&lt;br /&gt;Use the Web form to enter the expenses and the notes of repayment - and use the "Dashboard" as an indicator of ongoing balances - you can set your own rules when you need to repay to others, e.g. when the amount of money reaches over certain threshold.&lt;br /&gt;&lt;br /&gt;There is also in theory a possible loss of precision that might happen as the total expense grows. If you think this is a problem - write your solution. I think I know how to solve it, but I don't want to spoil the fun for you!&lt;br /&gt;&lt;br /&gt;Oh - and if you find this writeup useful - please leave a comment!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1761765917531441136?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1761765917531441136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1761765917531441136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1761765917531441136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1761765917531441136'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/10/how-to-create-cost-sharing-app-using.html' title='How to create a cost sharing app using Google Spreadsheets'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7583815865221113448</id><published>2011-08-10T01:16:00.005+02:00</published><updated>2011-08-10T01:41:05.287+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><title type='text'>Want my attention ? Send me something useful.</title><content type='html'>[this is an expansion of my &lt;a href="https://twitter.com/#!/ayourtch/status/100889425730478080"&gt;tweet&lt;/a&gt; earlier today.]&lt;br /&gt;&lt;br /&gt;Getting the email address of your users and keeping in touch with them is a classic technique. So classic that it's been mentioned in umpteen different places - I won't even bother to find the references. So classic that quite a lot of companies do pick it up, eventually.&lt;br /&gt;&lt;br /&gt;However, there is one detail. The emails that you send need to be wanted by the user. This is a detail that escapes frequently. As a result, I am getting a lot of updates from various companies "hey, we are doing this!" or "please take a look at our new new model of humbambillistic hyperbanana!" - while, if they noticed, I did not really use their service. I tried and did not find it too compelling, or it did not solve my problem.&lt;br /&gt;&lt;br /&gt;More impulsive of you will exclaim - "hey but unwanted email is precisely the definition of spam!"&lt;br /&gt;&lt;br /&gt;Well, not quite. The thing is, I might have agreed to be mailed at a particular point in time. When I thought this source might be interesting. However, the first mails proved not as much substance as I wanted. Should I unsubscribe ? Maybe. However, sometimes with the subcontractors acting on behalf of representatives of the newly formed subsidirary of the ... well, you get the point. It might not be trivial. &lt;br /&gt;On the other hand, I do not want to send this straight away to GMail's "spam" folder - because it will harm the users who maybe are interested.&lt;br /&gt;&lt;br /&gt;So, I found a way that would not harm anyone and requires minimal involvement from my side - simply create filters and transit those "not interesting anymore" messages to a special folder to settle.&lt;br /&gt;&lt;br /&gt;Maybe I read it one day when I don't have anything to do, maybe I won't. But I won't read them now.&lt;br /&gt;&lt;br /&gt;I do this if I consciously remember that I get more than two messages with the first three sentences not holding the content that is informative and useful for me.&lt;br /&gt;This reveals the other side of the coin - it's somewhat ok to poke me if I do not remember when was the last time you poked me. Unless the background pokes from different places burst together such that I get sufficiently annoyed with random flood of poke-like messages on a particular day.&lt;br /&gt;&lt;br /&gt;I wonder if I am unique in seeing this problem (and this maybe just my own laziness), or there is indeed something to it.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7583815865221113448?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7583815865221113448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7583815865221113448' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7583815865221113448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7583815865221113448'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/08/want-my-attention-send-me-something.html' title='Want my attention ? Send me something useful.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5750896844081860945</id><published>2011-08-04T18:30:00.003+02:00</published><updated>2011-08-04T18:35:09.373+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Uploading the files to the VMWare ESXi server</title><content type='html'>Every now and then I need to upload the stuff like an ISO image to my ESXi server.&lt;br /&gt;&lt;br /&gt;Since I do not use windows, my only remaining option is the CLI - which is big and clunky. However, today I digged a bit and after reading the CLI tools source realized that uploading the file onto an ESXi host is trivially simple:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Browse the datastores till you get to the correct place, take that URL and append the target file name.&lt;br /&gt;&lt;li&gt;perform the HTTP PUT request for that URL, supplying the data.&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;This way, the only tool you need to upload the files to VMWare ESXi really is curl:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;curl -k -X PUT --data-binary @IMAGE.ISO 'https://user:pass@host/folder/FOLDERNAME/IMAGE.ISO?dcPath=DCNAME&amp;dsName=DATASTORE'&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5750896844081860945?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5750896844081860945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5750896844081860945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5750896844081860945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5750896844081860945'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/08/uploading-files-to-vmware-esxi-server.html' title='Uploading the files to the VMWare ESXi server'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6720145043122218226</id><published>2011-07-28T21:27:00.007+02:00</published><updated>2011-07-30T14:45:39.128+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='luajit-fun'/><category scheme='http://www.blogger.com/atom/ns#' term='luajit'/><title type='text'>Microbenchmarking of luajit-based server (again: this time against lighttpd)</title><content type='html'>The other day inbetween the meetings I've ported my &lt;a href="https://github.com/ayourtch/luajit-fun/blob/master/serv.lua"&gt;toy event loop experiment&lt;/a&gt; to use &lt;a href="https://github.com/justincormack/ljsyscall"&gt;ljsyscall library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here are the results of running of &lt;b&gt;ab -n 100000 -c 1000&lt;/b&gt;. First let's make a baseline:&lt;br /&gt;&lt;h2&gt;lighttpd&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# ab -n 100000 -c 1000 http://localhost:80/&lt;br /&gt;This is ApacheBench, Version 2.0.40-dev &lt;$Revision: 1.146 $&gt; apache-2.0&lt;br /&gt;Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/&lt;br /&gt;Copyright 2006 The Apache Software Foundation, http://www.apache.org/&lt;br /&gt;&lt;br /&gt;Benchmarking localhost (be patient)&lt;br /&gt;Completed 10000 requests&lt;br /&gt;Completed 20000 requests&lt;br /&gt;Completed 30000 requests&lt;br /&gt;Completed 40000 requests&lt;br /&gt;Completed 50000 requests&lt;br /&gt;Completed 60000 requests&lt;br /&gt;Completed 70000 requests&lt;br /&gt;Completed 80000 requests&lt;br /&gt;Completed 90000 requests&lt;br /&gt;Finished 100000 requests&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Server Software:        lighttpd/1.4.19&lt;br /&gt;Server Hostname:        localhost&lt;br /&gt;Server Port:            80&lt;br /&gt;&lt;br /&gt;Document Path:          /&lt;br /&gt;Document Length:        10 bytes&lt;br /&gt;&lt;br /&gt;Concurrency Level:      1000&lt;br /&gt;Time taken for tests:   7.854757 seconds&lt;br /&gt;Complete requests:      100000&lt;br /&gt;Failed requests:        0&lt;br /&gt;Write errors:           0&lt;br /&gt;Total transferred:      24331590 bytes&lt;br /&gt;HTML transferred:       1001300 bytes&lt;br /&gt;Requests per second:    &lt;b&gt;12731.14 [#/sec] (mean)&lt;/b&gt;&lt;br /&gt;Time per request:       78.548 [ms] (mean)&lt;br /&gt;Time per request:       0.079 [ms] (mean, across all concurrent requests)&lt;br /&gt;Transfer rate:          3025.05 [Kbytes/sec] received&lt;br /&gt;&lt;br /&gt;Connection Times (ms)&lt;br /&gt;              min  mean[+/-sd] median   max&lt;br /&gt;Connect:        0   39 281.0     15    3023&lt;br /&gt;Processing:     5   19  16.5     21     740&lt;br /&gt;Waiting:        3   14  15.9     14     734&lt;br /&gt;Total:          9   58 287.6     38    3746&lt;br /&gt;&lt;br /&gt;Percentage of the requests served within a certain time (ms)&lt;br /&gt;  50%     38&lt;br /&gt;  66%     40&lt;br /&gt;  75%     42&lt;br /&gt;  80%     43&lt;br /&gt;  90%     45&lt;br /&gt;  95%     47&lt;br /&gt;  98%     50&lt;br /&gt;  99%     94&lt;br /&gt; 100%   3746 (longest request)&lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;luajit&lt;/h2&gt;&lt;br /&gt;Now let's try it on the primitive event loop.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# ab -n 100000 -c 1000 http://localhost:12345/&lt;br /&gt;This is ApacheBench, Version 2.0.40-dev &lt;$Revision: 1.146 $&gt; apache-2.0&lt;br /&gt;Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/&lt;br /&gt;Copyright 2006 The Apache Software Foundation, http://www.apache.org/&lt;br /&gt;&lt;br /&gt;Benchmarking localhost (be patient)&lt;br /&gt;Completed 10000 requests&lt;br /&gt;Completed 20000 requests&lt;br /&gt;Completed 30000 requests&lt;br /&gt;Completed 40000 requests&lt;br /&gt;Completed 50000 requests&lt;br /&gt;Completed 60000 requests&lt;br /&gt;Completed 70000 requests&lt;br /&gt;Completed 80000 requests&lt;br /&gt;Completed 90000 requests&lt;br /&gt;Finished 100000 requests&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Server Software:        &lt;br /&gt;Server Hostname:        localhost&lt;br /&gt;Server Port:            12345&lt;br /&gt;&lt;br /&gt;Document Path:          /&lt;br /&gt;Document Length:        13 bytes&lt;br /&gt;&lt;br /&gt;Concurrency Level:      1000&lt;br /&gt;Time taken for tests:   8.232656 seconds&lt;br /&gt;Complete requests:      100000&lt;br /&gt;Failed requests:        0&lt;br /&gt;Write errors:           0&lt;br /&gt;Total transferred:      5503355 bytes&lt;br /&gt;HTML transferred:       1300793 bytes&lt;br /&gt;Requests per second:    &lt;b&gt;12146.75 [#/sec] (mean)&lt;/b&gt;&lt;br /&gt;Time per request:       82.327 [ms] (mean)&lt;br /&gt;Time per request:       0.082 [ms] (mean, across all concurrent requests)&lt;br /&gt;Transfer rate:          652.77 [Kbytes/sec] received&lt;br /&gt;&lt;br /&gt;Connection Times (ms)&lt;br /&gt;              min  mean[+/-sd] median   max&lt;br /&gt;Connect:        0   44 336.4      6    3016&lt;br /&gt;Processing:     4   10  13.9     10     766&lt;br /&gt;Waiting:        3    8  13.9      7     762&lt;br /&gt;Total:         10   55 341.0     16    3767&lt;br /&gt;&lt;br /&gt;Percentage of the requests served within a certain time (ms)&lt;br /&gt;  50%     16&lt;br /&gt;  66%     17&lt;br /&gt;  75%     17&lt;br /&gt;  80%     18&lt;br /&gt;  90%     20&lt;br /&gt;  95%     22&lt;br /&gt;  98%     28&lt;br /&gt;  99%   3018&lt;br /&gt; 100%   3767 (longest request)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Upon multiple runs the numbers vary slightly, of course, but they stay within the same ballpark. I think this shows luajit is a very viable platform for server development.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;&lt;br /&gt;curious cat as I am, I've added a HTTP parser that is made by a yet-unpublished-and-inefficient-and-incomplete patch for ragel that generates Lua state machines (and a ragel code from an &lt;a href="http://bnpcs.blogspot.com/2010/06/http-parser-with-ragel.html"&gt;earlier post about http parser&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ab -n 100000 -c 100 http://localhost:12345/&lt;br /&gt;This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;&lt;br /&gt;Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/&lt;br /&gt;Licensed to The Apache Software Foundation, http://www.apache.org/&lt;br /&gt;&lt;br /&gt;Benchmarking localhost (be patient)&lt;br /&gt;Completed 10000 requests&lt;br /&gt;Completed 20000 requests&lt;br /&gt;Completed 30000 requests&lt;br /&gt;Completed 40000 requests&lt;br /&gt;Completed 50000 requests&lt;br /&gt;Completed 60000 requests&lt;br /&gt;Completed 70000 requests&lt;br /&gt;Completed 80000 requests&lt;br /&gt;Completed 90000 requests&lt;br /&gt;Completed 100000 requests&lt;br /&gt;Finished 100000 requests&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Server Software:        &lt;br /&gt;Server Hostname:        localhost&lt;br /&gt;Server Port:            12345&lt;br /&gt;&lt;br /&gt;Document Path:          /&lt;br /&gt;Document Length:        19 bytes&lt;br /&gt;&lt;br /&gt;Concurrency Level:      100&lt;br /&gt;Time taken for tests:   21.980 seconds&lt;br /&gt;Complete requests:      100000&lt;br /&gt;Failed requests:        0&lt;br /&gt;Write errors:           0&lt;br /&gt;Total transferred:      6100000 bytes&lt;br /&gt;HTML transferred:       1900000 bytes&lt;br /&gt;Requests per second:    &lt;b&gt;4549.62&lt;/b&gt; [#/sec] (mean)&lt;br /&gt;Time per request:       21.980 [ms] (mean)&lt;br /&gt;Time per request:       0.220 [ms] (mean, across all concurrent requests)&lt;br /&gt;Transfer rate:          271.02 [Kbytes/sec] received&lt;br /&gt;&lt;br /&gt;Connection Times (ms)&lt;br /&gt;              min  mean[+/-sd] median   max&lt;br /&gt;Connect:        0    0   0.1      0       3&lt;br /&gt;Processing:     1   22   3.1     21      30&lt;br /&gt;Waiting:        1   22   3.1     21      30&lt;br /&gt;Total:          3   22   3.1     21      30&lt;br /&gt;&lt;br /&gt;Percentage of the requests served within a certain time (ms)&lt;br /&gt;  50%     21&lt;br /&gt;  66%     25&lt;br /&gt;  75%     25&lt;br /&gt;  80%     25&lt;br /&gt;  90%     25&lt;br /&gt;  95%     26&lt;br /&gt;  98%     27&lt;br /&gt;  99%     27&lt;br /&gt; 100%     30 (longest request)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is not stellar, but I did not see yet where the bottlenecks are and if I can speed it up. Either way the 4.5K is still not too bad.&lt;br /&gt;&lt;br /&gt;Update2: &lt;br /&gt;&lt;br /&gt;with concurrency of 1000, I notice connection resets... After fixing up the mixing SIGPIPE handler of SIG_IGN, they still happen, apparently. Further debugging pending...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6720145043122218226?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6720145043122218226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6720145043122218226' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6720145043122218226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6720145043122218226'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/07/microbenchmarking-of-luajit-based.html' title='Microbenchmarking of luajit-based server (again: this time against lighttpd)'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-706407725978604627</id><published>2011-06-25T17:10:00.005+02:00</published><updated>2011-06-25T17:16:37.265+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ietf'/><title type='text'>Your IETF-writing will never be the same again</title><content type='html'>I've been reading up on SPDY today, and I noticed something interesting - &lt;br /&gt;the spec at &lt;a href="http://mbelshe.github.com/SPDY-Specification/draft-mbelshe-spdy-00.xml"&gt;Mike Belshe's github repo&lt;/a&gt; has the extension ".xml".&lt;br /&gt;&lt;br /&gt;So what, you say ? Given that it was rendered as the html output of the xml2rfc, I suspected there was XSLT in the game. And indeed, with one more search, I found the origin of this: &lt;a href="http://greenbytes.de/tech/webdav/rfc2629xslt/rfc2629xslt.html"&gt;Julian Reschke's work&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is definitely very cool - it means you have to store one less format, and the results are immediately visible as you change the xml.&lt;br /&gt;&lt;br /&gt;I will definitely give it a shot for the next draft to see if it lives up to my (inflated) expectations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-706407725978604627?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/706407725978604627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=706407725978604627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/706407725978604627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/706407725978604627'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/06/your-ietf-writing-will-never-be-same.html' title='Your IETF-writing will never be the same again'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3839735852104808610</id><published>2011-06-24T00:04:00.006+02:00</published><updated>2011-06-24T01:10:31.574+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>I came up with a new word today: faceboob</title><content type='html'>(v) to faceboob (someone): to earn money off the the humans' tendency to be curious, as well as to their natural tendency to trust their friends - specifically when using the social networks. Example use: "John Doe was faceboobed today."&lt;br /&gt;&lt;br /&gt;Now, enough words, lets get to colorful pictures!&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Prologue&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;You see this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864827274/" title="active_window_screenshot2011-06-23,23:44:06 by ayourtch, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3187/5864827274_b0456f85f4.jpg" width="500" height="309" alt="active_window_screenshot2011-06-23,23:44:06"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oh, boy! Aha! Free Boobz! Especially since one of your friends (or more!) shared this. Gotta be good!&lt;br /&gt;&lt;br /&gt;Let's get another browser. But first lets investigate a bit - the link looks like an URL shortener.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864298345/" title="active_window_screenshot2011-06-24,00:08:14 by ayourtch, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3223/5864298345_28c6fb9935.jpg" width="500" height="348" alt="active_window_screenshot2011-06-24,00:08:14"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yeah, it is chinese url shortener FTW! Better yet, if you go to home page it talks about a link being a spam and being deleted. This already rings the alarm bells, but let's see further - let's open up the link in the browser that is logged out of Facebook and see what happens.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279531/" title="active_window_screenshot2011-06-23,23:55:27 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5030/5864279531_f7679f1649.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:55:27"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Whoa!!! Free boobz are just one click away! They need to verify the age - of course. Gonna be something really juicy. Better yet, the button is also helpfully localized. Thank you my friends! When we click this link, we get a popup to login to facebook.&lt;br /&gt;Cool - so this is how it appeared in my friend feed. I'm the one with the OCD - the others simply tried to verify their age... oops. Anyway, lets close this annoying popup, I am not going to login anyway. Let's pretend that all happened in the background and see what happens further.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279529/" title="active_window_screenshot2011-06-23,23:56:05 by ayourtch, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2708/5864279529_0634352b6c.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:56:05"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Whoa! To verify my age I am going to get a chance to win an iPad ? Unbelievable! I am a lucky man today! iPads and iBoobz are falling from the sky! Let's click! I want a MacBook Air though - because I already have an iPad.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279517/" title="active_window_screenshot2011-06-23,23:47:30 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5301/5864279517_7516410df2.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:47:30"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The question asks something like "is it possible to play the videos on the MacBook Pro?" First, what a stupid question. Of course even the kid knows it is possible. Second, you are supposed to ask about the MacBook Air - I don't want a MacBook Pro!&lt;br /&gt;Anyway, let's answer "Ja" - and go forward, towards the free gear and free boobz!&lt;br /&gt;(the eye notices something in the right-top corner, but quickly dismisses it as uninteresting).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279523/" title="active_window_screenshot2011-06-23,23:47:36 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5200/5864279523_2a2a10d489.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:47:36"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ahhah. Now the top-right thing starts to make sense. 1 euro for SMS sent, 1 euro for SMS received. This is an IQ test - so I enter my phone number, such that they send me an SMS and charge 1 euro. Brilliant, lets stick in some random number that is not a valid phone# and move on. I guess this is the time for the real age verification.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279525/" title="active_window_screenshot2011-06-23,23:53:36 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5102/5864279525_d54825e5ea.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:53:36"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Congratulations! You've been charged 1 euro for receiving an SMS! Now please also help us charge you another euro for sending an SMS! I start to be a bit unhappy about the whole situation - 2 euros for boobz aint really free anymore! I start to suspect the evil plot in this. They want to rip me off - let's go back to the first tab where they had at least the background pic.&lt;br /&gt;&lt;br /&gt;An unpleasant surprise awaits me back there, there's no flirt at all on that page anymore. Instead, it coldly notifies:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864892314/" title="active_window_screenshot2011-06-23,23:47:07 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5222/5864892314_b54f406f5b.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:47:07"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Note that the text "Not completed" periodically changes into "checking..." - which makes a great illusion that the code *actually* checks whether you have completed the darn survey or not). The boobz are in the background - go and complete this survey, ASAP!&lt;br /&gt;&lt;br /&gt;Well, there is a slight chance of a bug. And the page admits it. It offers to complete another survey if this survey does not bring the keys to the kingdom. Let's go and see about the iPad - two is better than one, after all... This one starts in a rather cheerful manner:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864827280/" title="active_window_screenshot2011-06-23,23:44:58 by ayourtch, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2718/5864827280_ac79b598ec.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:44:58"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It prompts me to select my favourite color! Yay! I prefer black.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864827288/" title="active_window_screenshot2011-06-23,23:45:07 by ayourtch, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3281/5864827288_8265d253c2.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:45:07"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Wow, now is the real quiz: it asks which icon corresponds to the Facetime. That was easy. *click*&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864827292/" title="active_window_screenshot2011-06-23,23:45:17 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5116/5864827292_f9e2d7a84c.jpg" width="500" height="348" alt="active_window_screenshot2011-06-23,23:45:17"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Meeeeeh. This smiling lady promises me a charge of another 1 euro, and still no boobz!&lt;br /&gt;&lt;br /&gt;I think I am going to give up here - no free boobz today. I'll better go read slashdot.&lt;br /&gt;&lt;br /&gt;The practical takeaways from this little exercise, to avoid being &lt;b&gt;faceboobed&lt;/b&gt;, remember these three simple rules:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;There is no free &lt;strike&gt;lunch&lt;/strike&gt; boobz.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strike&gt;Be bear aware!&lt;/strike&gt; Always check where the links lead, even if it is your friend posting them. &lt;br /&gt;&lt;li&gt;&lt;strike&gt;Use condoms.&lt;/strike&gt;Always check them in a separate browser that is fully patched and is &lt;b&gt;NOT&lt;/b&gt; logged into the site that you got the link from.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Remember, you are the target too. &lt;br /&gt;&lt;br /&gt;And, unlike the computers, your antivirus is not auto-updated.&lt;br /&gt;&lt;br /&gt;Keep this in mind.&lt;br /&gt;&lt;br /&gt;update: oh, I forgot. When closing the browser, I get this popup:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5864279527/" title="active_window_screenshot2011-06-23,23:54:09 by ayourtch, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3260/5864279527_6bea7050a8.jpg" width="500" height="138" alt="active_window_screenshot2011-06-23,23:54:09"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, this is called a plain greed, my friends.&lt;br /&gt;&lt;br /&gt;Don't leave your mobile numbers to these folks. They are too greedy to rip the money off you.&lt;br /&gt;&lt;br /&gt;And if you really really wanna boobz - here they are. (warning: age restricted, may be NSFW for you): &lt;a href="http://www.youtube.com/watch?v=m3P5e1pbmPU"&gt;not a faceboobed link&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3839735852104808610?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3839735852104808610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3839735852104808610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3839735852104808610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3839735852104808610'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/06/i-came-up-with-new-word-today-faceboob.html' title='I came up with a new word today: faceboob'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3187/5864827274_b0456f85f4_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3199146592812476993</id><published>2011-06-20T23:36:00.005+02:00</published><updated>2011-06-21T00:20:00.403+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Your account has been compromised. Will you finally stop reusing the passwords ?</title><content type='html'>Logging into gmail in the morning, I've got a prompt to change my password, which mentioned suspicious activity with my account. When logging in, I saw the possible reason why.&lt;br /&gt;&lt;br /&gt;The MtGox bitcoin "exchange", where I created account to see what it is all look like, has been hacked, and the database has been leaked. Bummer. I even found my email and the user id on pastebin.com, alongside with the hash of my password. This can't be good, can it ?&lt;br /&gt;&lt;br /&gt;Well, except since some while I started to be more pedantic about having separate passwords for different sites, no exceptions. My online passwords are 40-characters random hex strings, different for each site. This meant a sigh of relief - the data that the miscreants obtained is of minimal impact to other sites that I use.&lt;br /&gt;&lt;br /&gt;So, the unique passwords saved my bacon today. If you reuse your passwords on more than one site, you should think a second time what would happen with your accounts in the occurence like this. If you are a windows user, you could get the &lt;a href="http://passwordsafe.sourceforge.net/"&gt;Password Safe&lt;/a&gt; program by Bruce Schneier - it's open source and free. In this day and age, you should &lt;b&gt;avoid reusing the passwords&lt;/b&gt;, period.&lt;br /&gt;&lt;br /&gt;I would also use this chance to describe how my "separate password" strategy looks like.&lt;br /&gt;&lt;br /&gt;There are two components of it:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;A program called "sha1sum" - which exists on most of the *nix versions, and essentially just calculates a cryptographic one-time hash function.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;A text file with the editor which stores the material for my passwords, in plain text.Each line of the text file contains two strings: the site name and a random string.  I choose the random string to be sufficiently long to be difficult to guess / brute force (some 30 characters or so).&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;When I need to get the password for a website, I open up the file and find the line that is corresponding to that website.&lt;br /&gt;&lt;br /&gt;Then I start up the "sha1sum" program, it starts to await for my input. I copypaste the site name and a memorable "master password" - that I do not write down anywhere. This is the thing that allows me to not worry extremely much about the safety of the file with the key material (alone it would not give out an easy target. Even though of course I do not put it out in plain view)&lt;br /&gt;&lt;br /&gt;After I entered both strings on one line, I press enter and then Ctrl-D - this signals an end of input for the sha1sum program, and it spits out a 40-character hex number at me. &lt;br /&gt;&lt;br /&gt;Great, now it is time to launch the sha1sum again - this time I copy-paste the hex number from the previous run, and then the "random text string" from the file.&lt;br /&gt;After that I press Enter and then Ctrl-D - getting another long hex string as a result.&lt;br /&gt;&lt;br /&gt;This is my password that I now copy-paste into the web site that I need to login to.&lt;br /&gt;Here's how it looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ayourtch@ayourtch-lnx:~$ grep gmail p-material&lt;br /&gt;gmail 1243pyupqwe,jl23hl23khjkh23khpw'@&lt;br /&gt;ayourtch@ayourtch-lnx:~$ sha1sum&lt;br /&gt;gmail this is my secret phrase&lt;br /&gt;f3c446b01b24022c136bde50d32a1f9d4e9cd7fb  -&lt;br /&gt;ayourtch@ayourtch-lnx:~$ sha1sum&lt;br /&gt;f3c446b01b24022c136bde50d32a1f9d4e9cd7fb 1243pyupqwe,jl23hl23khjkh23khpw'@&lt;br /&gt;&lt;b&gt;8e485f361bfe1834d281209121eb5d4a8b52bcb9&lt;/b&gt;  -&lt;br /&gt;ayourtch@ayourtch-lnx:~$ &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The bold string is the password to copy-paste into the login screen. (NB: of course the data in the example above is not real, it's my mockup just to illustrate the principle ;-)&lt;br /&gt;&lt;br /&gt;While this scheme is certainly not pixel-perfect cryptography, it gives certain advantages:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Even if the service is dumb enough to store the passwords in plain text - the attacker does not gain much when they hack it. They will just get the password to a particular site - but they would not learn much how did you derive this essentially random string.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Even if the attacker gets the file where the strings are written down - they do not gain much, as they would need to know the "master password" in order to create correct passwords for any of the web sites. &lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;It is simple, light, and independent from the vendor (browser, etc.) - practically anywhere there is a sha1sum - so I only need a (tiny) file with site names/strings to carry around. The smaller the data to secure, the easier it is to secure it.&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Of course, this also has a couple of disadvantages:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;entering the passwords is a bit annoying. You need to do some manual operation. &lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;entering the passwords is a bit annoying. This is the iPad version.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;However, I value my peaceful sleep much more than the annoyance of the process.&lt;br /&gt;&lt;br /&gt;Do you value your sleep ? If you do - stop reusing the passwords before you lose it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3199146592812476993?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3199146592812476993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3199146592812476993' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3199146592812476993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3199146592812476993'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/06/your-account-has-been-compromised-will.html' title='Your account has been compromised. Will you finally stop reusing the passwords ?'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8731844049838617667</id><published>2011-06-16T00:06:00.003+02:00</published><updated>2011-06-16T00:09:38.708+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>Coursemare incorporated promotional video</title><content type='html'>I've created this one a while ago, but did not move it from xtranormal to YouTube. The happy spectators of my little &lt;a href="http://www.youtube.com/watch?v=v26BAlfWBm8"&gt;"NAT vs. IPv6" fun&lt;/a&gt; were asking if I did anything else - so here it is. This time our target it the applications that go out of their way in alienating their users.&lt;br /&gt;&lt;br /&gt;&lt;object style="height: 390px; width: 640px"&gt;&lt;param name="movie" value="http://www.youtube.com/v/RfLB0NZvCYA?version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/RfLB0NZvCYA?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8731844049838617667?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8731844049838617667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8731844049838617667' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8731844049838617667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8731844049838617667'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/06/coursemare-incorporated-promotional.html' title='Coursemare incorporated promotional video'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6004122526317610226</id><published>2011-06-10T19:11:00.003+02:00</published><updated>2011-06-10T20:18:35.433+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zf'/><category scheme='http://www.blogger.com/atom/ns#' term='zettair'/><title type='text'>Indexing wikipedia data dump with ZF</title><content type='html'>I have decided to try indexing the wikipedia HTML data dump with my zettair fork.&lt;br /&gt;&lt;br /&gt;The specs of the machine: 8GB RAM, 8-core Xeon X3440 machine at 2.53Ghz.&lt;br /&gt;&lt;br /&gt;multicore nature of the machine did not really matter, since the code is single threaded.&lt;br /&gt;&lt;br /&gt;Some info on the dataset:&lt;br /&gt;&lt;br /&gt;14257665 documents in total (just above 14 million, that is)&lt;br /&gt;&lt;br /&gt;233GiB of data as per "du -kh" output.&lt;br /&gt;&lt;br /&gt;The index size is 17Gb.&lt;br /&gt;&lt;br /&gt;Indexing this set took about 1.5 days:&lt;br /&gt;&lt;br /&gt;real    1935m54.592s&lt;br /&gt;user    138m42.620s&lt;br /&gt;sys     23m49.060s&lt;br /&gt;&lt;br /&gt;The search times obviously depend on the word, below are some dummy samples, "cold" is the first time you search, "warm" is the subsequent time.&lt;br /&gt;&lt;br /&gt;"wikipedia"&lt;br /&gt;&lt;br /&gt;cold: 20 results of 11194872 shown (took 3.886843 seconds)&lt;br /&gt;warm: 20 results of 11194872 shown (took 1.542165 seconds)&lt;br /&gt;&lt;br /&gt;"integral": &lt;br /&gt;&lt;br /&gt;cold: 20 results of 26981 shown (took 1.168747 seconds)&lt;br /&gt;warm: 20 results of 26981 shown (took 0.065107 seconds)&lt;br /&gt;&lt;br /&gt;"schematic": &lt;br /&gt;&lt;br /&gt;cold: 20 results of 5056 shown (took 1.040630 seconds)&lt;br /&gt;warm: 20 results of 5056 shown (took 0.022333 seconds)&lt;br /&gt;&lt;br /&gt;"surfing":&lt;br /&gt;&lt;br /&gt;cold: 20 results of 15340 shown (took 0.840945 seconds)&lt;br /&gt;warm: 20 results of 15340 shown (took 0.039736 seconds)&lt;br /&gt;&lt;br /&gt;"asd":&lt;br /&gt;cold: 20 results of 1198 shown (took 0.868518 seconds)&lt;br /&gt;warm: 20 results of 1198 shown (took 0.055091 seconds)&lt;br /&gt;&lt;br /&gt;An interesting task probably would be to see how well does the indexing scale (i.e. reindex only partial datasets and graph them). But I figured I'd write up what I have for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6004122526317610226?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6004122526317610226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6004122526317610226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6004122526317610226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6004122526317610226'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/06/indexing-wikipedia-data-dump-with-zf.html' title='Indexing wikipedia data dump with ZF'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5167352967069989859</id><published>2011-05-25T03:21:00.003+02:00</published><updated>2011-05-25T03:47:29.426+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The ads that make your page beautiful</title><content type='html'>Maybe it's my humble page with &lt;a href="http://bnpcs.blogspot.com/2011/03/links-about-situation-in-japan.html"&gt;links about situation in Japan&lt;/a&gt;, or my periodic scouting on japanese-language sites, I got myself a Persistent Sakura House syndrome. What is it ? It's an English-speaking advertisement about the nice rentals in Tokyo that is persistently following me all around the web. &lt;br /&gt;&lt;br /&gt;I am seriously starting to check it out. &lt;br /&gt;&lt;br /&gt;And closer to understanding how half of the world buys the junk they buy. &lt;br /&gt;&lt;br /&gt;Anyway, this is not about Tokyo per se, nor it is about the persistent advertisements that program the minds of unsuspecting crowds.&lt;br /&gt;&lt;br /&gt;It's about something else.&lt;br /&gt;&lt;br /&gt;When I told my friends at Google this story we laughed, and the consensus was that with my chaotic behavior I made the algorithm believe I am very interested to go to Tokyo. Nonetheless, if I clear the cookies, the phenomenon will probably disappear (it does not show on the Firefox that I mostly do not use and which has different sets of cookies).&lt;br /&gt;&lt;br /&gt;But I will never do it myself. &lt;br /&gt;&lt;br /&gt;Because the ads I see make the sites look better.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3491/5756430463_2a8bfed97e_m.jpg"&gt;&lt;br /&gt;&lt;br /&gt;Don't you agree that it is a pretty tasteful banner ?&lt;br /&gt;&lt;br /&gt; A banner that does not sleazily try to sell something to me. A banner that (despite my general distaste with pink) is nice and calm to stare at. Maybe because of that, or maybe because of its calm layout, &lt;b&gt;it makes the sites look better&lt;/b&gt;, in my opinion.&lt;br /&gt;&lt;br /&gt;So, here's a million dollar idea.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Besides monetizing the additional value that the contextual advertising brings to the merchant, create and monetize the value that the website owners would get out of showing only nicer-looking advertisements on their websites.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;How ? I don't know. That's why the ideas like this are dime a dozen. &lt;br /&gt;&lt;br /&gt;Is this even something valid ? No clue. A serious amount of A/B testing should show.&lt;br /&gt;&lt;br /&gt;I just noticed it, because this ad is persistently frequent - yet, it does not get annoying. More so, I've even gone to the site a couple of times and read the reviews - the folks seem to be pretty positive.&lt;br /&gt;&lt;br /&gt;I am thinking of visiting Tokyo one day. &lt;br /&gt;&lt;br /&gt;Can't say of anything else, but they make great looking ads for sure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5167352967069989859?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5167352967069989859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5167352967069989859' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5167352967069989859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5167352967069989859'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/05/ads-that-make-your-page-beautiful.html' title='The ads that make your page beautiful'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3491/5756430463_2a8bfed97e_t.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4805968597748404277</id><published>2011-05-23T23:20:00.005+02:00</published><updated>2011-05-23T23:58:48.338+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>Strange.</title><content type='html'>I am at St.Pancras, in the Eurostar lounge. Got a special friendly patdown treatment - maybe because I forgot some coins in the back pocket of the jeans. Never mind - I got used to "random checks" in my previous life. &lt;br /&gt;&lt;br /&gt;But wait. I'm traveling. Without my habitual travel drink. Rewind the time. I need go to the Starbucks. I want my "Caramel Macchiato". &lt;br /&gt;&lt;br /&gt;Strange. They changed the look of the menu, or they had it differently to begin with. No pseudoitalian size denominations. Seems like now you can build your own drinksfrom components - or it is just an avant-garde design. I can see "macchiato" separately, and "caramel" separately. &lt;br /&gt;&lt;br /&gt;Too complicated. Just asked the same thing as usual. And, lo and behold, the person on the other side replied with the usual correction - "Venti ?", to which I reply "large" - as usual, in a futile attempt to abandon the adjectives that do not make much sense. So they still have it, and this will be keep me alive till I get home. The world's still going round.&lt;br /&gt;&lt;br /&gt;There's a newspaper on the table - the first page tells how some poor orphan kid had hit a jackpot. &lt;br /&gt;&lt;br /&gt;He is nineteen and he got a million pounds from the charity that is run by the newspaper. Good for him. If he is clever, he can make good use of this money. I hope the other hundreds or thousands of orphans both in London and elsewhere in the universe will wish him well. Or maybe they would not. The readers who gave money to him would certainly wish him well enough to give the money - but what about the other orphans ? No, they don't exist. They're just part of what we call 'the society',  they do not visible out from the background of the crowd.&lt;br /&gt;&lt;br /&gt;Try running in the middle of the crowd that is standing still. Or better, try stopping  in the middle of the crowd that rushes ahead. You will be run over. Not because of anyone's evilness, just that for the others you are only a part of the crowd. &lt;br /&gt;&lt;br /&gt;They all run towards their dreams. Those who have no dreams to run after, rush even faster to not think about that. They skip days, thinking this will get them faster to the destination. They exhaust themselves to blood while running.&lt;br /&gt;&lt;br /&gt;Even if they do not know what the destination is, they will still have a shade of suspicion.  An exhausted mind is a harbor for the suspicions, and there are enemies hiding in everything that is suspicious. &lt;br /&gt;&lt;br /&gt;"Something strange ? Report to the police!" - says the plaque in big font. &lt;br /&gt;&lt;br /&gt;By the way, I have something strange to report. There is free WiFi but I could not find a garbage bin to put the empty paper cup into. &lt;br /&gt;&lt;br /&gt;Maybe the garbage bins are dangerous (I heard they can put cigarettes into them - and the smoke looks very scary! Be very afraid!). &lt;br /&gt;&lt;br /&gt;Maybe they were just forgotten. Tiny details are easy to forget when you're making grand things.&lt;br /&gt;&lt;br /&gt;Maybe I am just not seeing them - much like I did not see the cars when crossing the streets - looking wrong when I should be looking right. &lt;br /&gt;&lt;br /&gt;I want to ask the policemen, but this can easily be considered a strange behavior - if there are no bins, then it means no one needs them. &lt;br /&gt;&lt;br /&gt;I quietly leave the cup on the table and rush with the rest of the crowd to the gate. They finally announced the boarding, and we are all in a hurry to grab our places - the places that no one else can take. Would be strange if someone did - how would they not be afraid to be reported to the police for the strange behavior ?&lt;br /&gt;&lt;br /&gt;I look back and see my cup still there, already welcoming newly arrived burger wraps.&lt;br /&gt;&lt;br /&gt;Hopefully it's not too strange of an idea to leave an empty cup on the table when I can't find a garbage bin. I say "thank you" in advance to the person who will have to get this cup to the secret location. &lt;br /&gt;&lt;br /&gt;Soon I will return and try again. Maybe one day I crack this strange puzzle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4805968597748404277?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4805968597748404277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4805968597748404277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4805968597748404277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4805968597748404277'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/05/strange.html' title='Strange.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8629174786895785461</id><published>2011-04-24T19:49:00.004+02:00</published><updated>2011-04-24T20:03:15.086+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ship-it'/><title type='text'>A new name for you</title><content type='html'>The world is steadily moving away from exchanging the phone numbers towards exchanging the online handles. For example, getting people friended on facebook.&lt;br /&gt;&lt;br /&gt;This is quite annoying for me, because, even if my first name is pretty easy to spell,&lt;br /&gt;the last name is as far from something easy like "Smith" as it can be.&lt;br /&gt;&lt;br /&gt;So I inevitably end up writing it. Boring. Now, lately I've used a different trick. telling people to search for the stuff I am involved in, e.g. "Happy Eyeballs" make for a pretty good search to fish my name and contact info from.&lt;br /&gt;&lt;br /&gt;Now, I thought why not do it in a bit more dedicated fashion - and just grab a domain that is easy to remember for normal people, and hook it to a key-value store.&lt;br /&gt;&lt;br /&gt;Here comes the secondna.me. &lt;br /&gt;&lt;br /&gt;go to &lt;a href="http://secondna.me/"&gt;secondna.me&lt;/a&gt; to search on someone's "second name", or create your own - the "second name" can really be anything that is easy to remember and does not require spelling by letters.&lt;br /&gt;&lt;br /&gt;There is no login, no password, everything is write-once-read-many. So, if you have made a mistake, too bad.&lt;br /&gt;&lt;br /&gt;The value is escaped to translate the &amp;lt; into &amp;amp;lt; - so, no fancy HTML either.&lt;br /&gt;&lt;br /&gt;Just good old plain text.&lt;br /&gt;&lt;br /&gt;If you think it does look fugly, I agree. But I think the utility trumps the looks.&lt;br /&gt;&lt;br /&gt;Good enough for me, for now at least.&lt;br /&gt;&lt;br /&gt;And tell me what you think.&lt;br /&gt;&lt;br /&gt;(yes, it's like about.me, after an intensive diet course).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8629174786895785461?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8629174786895785461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8629174786895785461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8629174786895785461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8629174786895785461'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/04/new-name-for-you.html' title='A new name for you'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1390782940414905646</id><published>2011-04-19T23:47:00.003+02:00</published><updated>2011-04-20T00:24:53.105+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>A toast to differences</title><content type='html'>Once upon a time, there lived a gardener. And he grew oranges and lemons. He did not eat enough of the lemons himself, so he sold them in the neighboring village - there they grew bananas, but they were too lazy to grow enough of them to feed the entirety of the village. So, every day they bought lemons from him, and picked those poor souls who were to feed with lemons.&lt;br /&gt;&lt;br /&gt;Needless to say, the poor souls had hated the nasty fruit - it gave them the pains in their bellies. And soon they started to hate the gardener himself - yet, they continued to buy the lemons from him. &lt;br /&gt;&lt;br /&gt;It was a very saddening fact for the gardener - after all, he was honestly growing his best fruits - and the oranges were not bitter at all - sweet and refreshing. So, one day he decided to make a pleasant surprise for his faithful customers that should make them happier - he brought them oranges instead of lemons, but did not tell.&lt;br /&gt;&lt;br /&gt;The customers were enraged - "Not only you exploit us by selling these bitter fruits to us, but now you also brought them in rotten color and blown up shape!". They've beaten the poor gardener, and trashed his cargo.&lt;br /&gt;&lt;br /&gt;So, let's have a drink to the gentle attention for differences - if you're a gardener, try to sell not just lemons alone; and if you're on the market buying - not everything that is slightly round is bitter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1390782940414905646?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1390782940414905646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1390782940414905646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1390782940414905646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1390782940414905646'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/04/toast-to-differences.html' title='A toast to differences'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7791066233141463304</id><published>2011-04-11T21:48:00.004+02:00</published><updated>2011-04-11T21:59:55.516+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>A story to remember when you are afraid to fail...</title><content type='html'>Found a great anecdote &lt;a href="http://krissja.livejournal.com/1040993.html"&gt;here&lt;/a&gt;, translating:&lt;br /&gt;&lt;br /&gt;The stage: Autumn. A lake. Wild geese are warming up to start flying to the south. At the front a well-built goose is stretching his muscles, all enjoying himself and looking forward to fly, when a little gray duck approaches him and starts the dialog:&lt;br /&gt;&lt;br /&gt;- So-o-o-o... You're fly-i-i-ng south ?&lt;br /&gt;- Yeah. Gotta fly south. It's warm there.&lt;br /&gt;- So-o-o-o... A-a-and... I will sta-a-ay here... To Fre-e-e-eze...&lt;br /&gt;- Come on, let's fly with us. Southbound.&lt;br /&gt;- So-o-o-o... You've got big wings... I do not... I will fall and die...&lt;br /&gt;- No problem - we'll catch you and keep you up. Air streams and all that.&lt;br /&gt;- So-o-o-o... But I will get hungry on the way... And die-e-e-e-e...&lt;br /&gt;- We're gonna pick up the bugs. Big, fat and tasty bugs.&lt;br /&gt;- So-o-o-o... The bugs are bi-i-i-ig... Your beaks are bi-i-i-ig... Mine is small... I will choke and die...&lt;br /&gt;- No problem, we'll chew them up for you. You're gonna make it.&lt;br /&gt;- So-o-o-o...&lt;br /&gt;&lt;br /&gt;(the goose straightens up and looks at the duck):&lt;br /&gt;&lt;br /&gt;- Okay. Fuck off.&lt;br /&gt;- So-o-o-o... As usu-u-u-ual... Exactly as I tho-o-o-ought... (while walking away).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7791066233141463304?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7791066233141463304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7791066233141463304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7791066233141463304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7791066233141463304'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/04/story-to-remember-when-you-are-afraid.html' title='A story to remember when you are afraid to fail...'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-9050284576440561421</id><published>2011-04-05T02:21:00.007+02:00</published><updated>2011-04-05T14:08:42.258+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>A functional (almost) prelude on the topic of mergesort</title><content type='html'>I know of table.sort, yes. But thought it was fun nonetheless.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function apply(x, f)&lt;br /&gt;  for i, v in ipairs(x) do&lt;br /&gt;    f(v, i)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;function filter(x, f)&lt;br /&gt;  local out = {}&lt;br /&gt;  local fa = function(v, i)&lt;br /&gt;    if f(v, i) then table.insert(out, v) end&lt;br /&gt;  end&lt;br /&gt;  apply(x, fa)&lt;br /&gt;  return out&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;function merge(...)&lt;br /&gt;  local args = { ... }&lt;br /&gt;  local out = {}&lt;br /&gt;  local fa = function(v)&lt;br /&gt;    table.insert(out, v)&lt;br /&gt;  end&lt;br /&gt;  apply(args, function(v) apply(v, fa) end)&lt;br /&gt;  return out&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;function sort(x)&lt;br /&gt;  if #x &lt; 2 then&lt;br /&gt;    return x&lt;br /&gt;  else&lt;br /&gt;    local ix = math.floor(#x/2)&lt;br /&gt;    local smallx = sort(filter(x, function(v) return v&amp;lt;x[ix] end)) &lt;br /&gt;    local samex =  filter(x, function(v) return v == x[ix] end)&lt;br /&gt;    local bigx = sort(filter(x, function(v) return v&gt;x[ix] end))&lt;br /&gt;    return merge(smallx, samex, bigx)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function  show(x)&lt;br /&gt;  apply(x, print)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;a = { 1,3,2,4,2,1,1,23,12,22 }&lt;br /&gt;show(sort(a))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;NB: of course this is *not* a functional style by far, since the apply() assumes the f() &lt;b&gt;will&lt;/b&gt; have the side effects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-9050284576440561421?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/9050284576440561421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=9050284576440561421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/9050284576440561421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/9050284576440561421'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/04/functional-prelude-on-topic-of.html' title='A functional (almost) prelude on the topic of mergesort'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6960507134935541920</id><published>2011-03-15T21:51:00.065+01:00</published><updated>2011-04-09T01:10:53.631+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='japan'/><title type='text'>Links about the situation in Japan</title><content type='html'>---&lt;br /&gt;This page is to keep the links about the events in Japan. The links to the "original" websites are going over CoralCDN - hence the ".nyud.net" appended to the domain name. Read more about the CoralCDN at &lt;a href="http://www.coralcdn.org/"&gt;http://www.coralcdn.org/&lt;/a&gt;. Chances are that not all of the websites may bear the load they will get - so use the CoralCDN so the sites do not die. I'll update this post as I find more links.&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.kantei.go.jp/foreign/topics/2011/earthquake2011tohoku.html"&gt;Countermeasures for 2011 Tohoku - Pacific Ocean Earthquake&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;Weather:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5530645948/"&gt;&lt;img src="http://farm6.static.flickr.com/5012/5530645948_a269c6e66f.jpg" width="500" height="373" alt="weather" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5530745576/" title="weather forecast. cold."&gt;&lt;img src="http://farm6.static.flickr.com/5139/5530745576_d53da57b82.jpg" width="500" height="374" alt="cold" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;--&gt;&lt;br /&gt;&lt;br /&gt;Some baseline on the radiation:&lt;br /&gt;&lt;br /&gt;Smoking: "Based on careful assessments of the concentrations of 210Po in the lung tissues, it was estimated that the "hot spots" received an annual dose of about 160 millisievert (about 16,000 millirem), two of the more common units for expressing doses from ionizing radiation." [&lt;a href="http://www.hps.org/publicinformation/ate/q3137.html"&gt;Health Physics Society&lt;/a&gt;]. Divided by 8760 (24*365), this gives 18.26 microsievert/hour delta atop the background radiation levels. &lt;a href="http://www.mdpi.com/1660-4601/6/2/558/"&gt;Another source with radiation in cigarettes&lt;/a&gt;. So if you are smoking you probably should take a note of this.&lt;br /&gt;&lt;br /&gt;Here's another image, a scan from a book, I found it on a &lt;a href="http://saitotoshiki.com/blog/2011/03/fukushima_1_nuclear_accidents"&gt;blog entry in Japanese about radiation impacts&lt;/a&gt;. 1 rad = 10 mSv = 10 mGy, the author writes; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5530993656/" title="radiation-normal-tissues by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5259/5530993656_50e05d3fee.jpg" width="500" height="324" alt="radiation-normal-tissues" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And &lt;a href="http://users.rcn.com.nyud.net/jkimball.ma.ultranet/BiologyPages/R/Radiation.html"&gt;one more reference&lt;/a&gt; about radiation effects. And a &lt;a href="http://xkcd.com/radiation/"&gt;diagram&lt;/a&gt; for comparing the various sources.&lt;br /&gt;&lt;br /&gt;So, after setting up this baseline, you can go and look at the data.&lt;br /&gt;&lt;br /&gt;Facts:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/geiger-counter-chiba"&gt;Geiger counter Chiba&lt;/a&gt;&lt;br /&gt;&lt;a href="http://park18.wakwak.com.nyud.net/~weather/geiger_index.html"&gt;Geiger counter in Tokyo&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/geiger-counter-tokyo"&gt;Video of a geiger counter in Tokyo&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/%E3%82%AC%E3%82%A4%E3%82%AC%E3%83%BC%E3%82%AB%E3%82%A6%E3%83%B3%E3%82%BF"&gt;One more video of a geiger counter in Tokyo.&lt;/a&gt;&lt;br /&gt;&lt;a href="https://spreadsheets.google.com/lv?key=tgXu86sAcSkqNVbyCooH_Bw&amp;f=true&amp;gid=1"&gt;Google doc with info of the three counters above and the radiation from http://www.bousai.ne.jp/eng/index.html.&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sendung.de/japan-radiation-open-data/"&gt;Japan radiation open data (from the maintainer of the above google doc)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://public.tableausoftware.com/views/JapanRadiationLevels/JapanRadiationLevelsDashboard"&gt;Graphical dashboard based on these values&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blackcatsystems.com/GM/experiments/ex5.html"&gt;A geiger counter on the translatlantic flight&lt;/a&gt;&lt;br /&gt;&lt;a href="http://japan.failedrobot.com/"&gt;crowdsourcing data on radiation&lt;/a&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/ayourtch/5530245173/" title="active_window_screenshot2011-03-16,01:21:08"&gt;&lt;img src="http://farm6.static.flickr.com/5020/5530245173_1786b9bc10_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:21:08" /&gt;&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/ayourtch/5530245069/" title="active_window_screenshot2011-03-16,01:21:02 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5098/5530245069_ddd2e4e540_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:21:02" /&gt;&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/ayourtch/5530828990/" title="active_window_screenshot2011-03-16,01:20:59 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5094/5530828990_609c08981a_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:20:59" /&gt;&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/ayourtch/5530828884/" title="active_window_screenshot2011-03-16,01:17:14 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5013/5530828884_ec66af57dd_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:17:14" /&gt;&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/ayourtch/5530244641/" title="active_window_screenshot2011-03-16,01:17:11 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5018/5530244641_d839f17dde_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:17:11" /&gt;&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/ayourtch/5530244517/" title="active_window_screenshot2011-03-16,01:17:07 by ayourtch, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5133/5530244517_8da1fd2ff2_m.jpg" width="240" height="148" alt="active_window_screenshot2011-03-16,01:17:07" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;6 screenshots that I've taken with different numeric values in the URL parameter - so should be different locations. Google translate links did not make sense, so if you have a good idea where these locations are, comment. &lt;br /&gt;--&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pref.saitama.lg.jp/page/housyasenryou.html"&gt;Saitama prefecture readings&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://earthquake.usgs.gov.nyud.net/earthquakes/recenteqsww/Quakes/quakes_big.php"&gt;List of 5.0+ earthquakes for the past 7 days&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Articles:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nytimes.com/interactive/2011/03/16/world/asia/20110316-japan-quake-radiation.html?ref=asia"&gt;Graphic showing the radiation levels at the power plants vs. the various reference points&lt;/a&gt;&lt;br /&gt;&lt;a href="&lt;br /&gt;http://www.simon-cozens.org/content/radiation-tokyo-how-read-geiger-counter"&gt;http://www.simon-cozens.org/content/radiation-tokyo-how-read-geiger-counter&lt;/a&gt; - has good explanation on how to read the counters and what the numbers relate to. This is where I got the first geiger counter link above.&lt;br /&gt;&lt;a href="http://mitnse.com/"&gt;Articles by MIT Department of Nuclear Science and Engineering about the japanese nuclear reactors.&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.kalzumeus.com/2011/03/13/some-perspective-on-the-japan-earthquake/"&gt;Some Perspective On The Japan Earthquake&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TV/Video:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://techtv.mit.edu/videos/11363-mit-department-of-nuclear-science-and-engineering-briefing-on-the-japan-nuclear-crisis"&gt;MIT technical briefing recording&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/yokosonews"&gt;http://www.ustream.tv/channel/yokosonews&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/nhk-world-tv"&gt;http://www.ustream.tv/channel/nhk-world-tv&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/nhk-gtv"&gt;http://www.ustream.tv/channel/nhk-gtv&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ustream.tv/channel/tbstv"&gt;http://www.ustream.tv/channel/tbstv&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/tbsnewsi"&gt;http://www.youtube.com/tbsnewsi&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.earthcam.com/japan/tokyo/"&gt;http://www.earthcam.com/japan/tokyo/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.tepco.co.jp.nyud.net/nu/f1-np/camera/index-j.html"&gt;Fukushima Daiichi Nuclear Power Station camera&lt;/a&gt;&lt;br /&gt;&lt;a href="http://cs2.town.yanaizu.fukushima.jp.nyud.net/-wvhttp-01-/GetOneShot"&gt;One other Fukushima webcam&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Twitter:&lt;br /&gt;&lt;a href="http://twitter.com/#!/MariaArty"&gt;A person who was translating the TBS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://live.reuters.com/Event/Japan_earthquake2"&gt;Reuters. Level-headed reporting without the hysteria&lt;/a&gt;.&lt;br /&gt;&lt;a href="http://twitter.com/#!/fk_radiation"&gt;periodic reports on radiation levels&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TEPCO press releases:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tepco.co.jp/en/press/corp-com/release/index-e.html"&gt;http://www.tepco.co.jp/en/press/corp-com/release/index-e.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;NASA:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.nasa.gov/cm/blog/NES_Teachers_Corner/posts/post_1300218558851.html"&gt;the Japanese earthquake should have caused Earth to rotate a bit faster, shortening the length of the day by about 1.8 microseconds&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Japan Atomic Industrial Forum&lt;br /&gt;&lt;br /&gt;http://www.jaif.or.jp/english/&lt;br /&gt;&lt;br /&gt;INES levels:&lt;br /&gt;&lt;br /&gt;http://www.iaea.org/Publications/Factsheets/English/ines.pdf&lt;br /&gt;&lt;br /&gt;IAEA briefings:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/user/IAEAvideo"&gt;Briefing videos&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.iaea.org/newscenter/news/tsunamiupdate01.html"&gt;IAEA updates page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Networking-related:&lt;br /&gt;&lt;br /&gt;http://www.jpnap.net/english/jpnap-tokyo-i/traffic.html&lt;br /&gt;http://gigaom.com/broadband/in-japan-many-under-sea-cables-are-damaged/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;TED debate about nuclear energy:&lt;br /&gt;&lt;br /&gt;http://www.ted.com/talks/debate_does_the_world_need_nuclear_energy.html&lt;br /&gt;&lt;br /&gt;http://www.withouthotair.com/&lt;br /&gt;&lt;br /&gt;http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0000457&lt;br /&gt;http://www.clarku.edu/departments/marsh/projects/community/plutonium.pdf&lt;br /&gt;http://caffertyfile.blogs.cnn.com/2011/03/15/why-is-there-no-looting-in-japan/?hpt=T1&lt;br /&gt;--&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6960507134935541920?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6960507134935541920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6960507134935541920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6960507134935541920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6960507134935541920'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/03/links-about-situation-in-japan.html' title='Links about the situation in Japan'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm6.static.flickr.com/5259/5530993656_50e05d3fee_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5226564669262328095</id><published>2011-03-08T02:27:00.003+01:00</published><updated>2011-03-08T02:39:45.676+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ietf'/><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><title type='text'>Autoextraction of Abstracts from RFCs and drafts</title><content type='html'>An &lt;b&gt;idee fixe&lt;/b&gt; (uh, I mean *one more*) of mine is to somehow organize a collection of IETF docs - RFCs/drafts that are somehow touching IPv6 (Thanks to Fred Baker for this nice puzzle). &lt;br /&gt;&lt;br /&gt;So, what I have is 140 megabytes of data, sitting in just under 2000 files that represent the RFCs and various drafts.&lt;br /&gt;&lt;br /&gt;First step of doing anything at all with this pile is to be able to chop it into some chunks - try to put the congruent parts side by side, move the ASCII pictures aside, and similar mundane tasks. &lt;br /&gt;&lt;br /&gt;The first step of doing that is to try to extract the part that is there in almost every IETF doc - the "Abstract" section. In general, the section titles are starting with 0-column indent - while the text of the paragraphs typically has 2+ columns indentation. However,  this is a general rule. There are zillions of exceptions over the years. Variations of spelling, wrong indents, MS-DOS carriage returns, all sorts of nasty mess. Anyway, the first try at this has concluded.&lt;br /&gt;&lt;br /&gt;I extract the titles out of the pagebreak-placed titles and this is noticeable - in some of them you have the month and the year glued on the right side. This is something that should get fixed eventually, if I figure some heuristic.&lt;br /&gt;&lt;br /&gt;Here's a result in case you find it useful at all:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stdio.be/ipv6-abstracts.html"&gt;Abstracts from some RFCs and drafts&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5226564669262328095?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5226564669262328095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5226564669262328095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5226564669262328095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5226564669262328095'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/03/autoextraction-of-abstracts-from-rfcs.html' title='Autoextraction of Abstracts from RFCs and drafts'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-342982430981528116</id><published>2011-03-06T00:53:00.003+01:00</published><updated>2011-03-06T03:10:37.694+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='rfc'/><title type='text'>Interesting bits from HTTP/1.1 RFC</title><content type='html'>(Originally under title "Is your server HTTP/1.1 compliant ?" - but I realised that it's not really a relevant one)&lt;br /&gt;&lt;br /&gt;Today after watching &lt;a href="http://blip.tv/file/3786405"&gt;this excellent wireshark kung-fu&lt;/a&gt; video with Hansang Bae, I decided to comb through the HTTP/1.1 spec and see what other interesting bits I can fish from there that are less frequent/interesting to play with or are othewise noteworthy. &lt;br /&gt;Here they go for your entertainment.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   To allow for transition to absoluteURIs in all requests in future&lt;br /&gt;   versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI&lt;br /&gt;   form in requests, even though HTTP/1.1 clients will only generate&lt;br /&gt;   them in requests to proxies.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In layman terms: your compliant server must understand not only the classic "GET / HTTP/1.1", but also "GET http://www.yourhost.com/ HTTP/1.1"). In case the clients upgrade. All but one of the servers that I did a quick test with, haven't seen this part of the spec. Or optimized it out.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   An origin server that does not allow resources to differ by the&lt;br /&gt;   requested host MAY ignore the Host header field value when&lt;br /&gt;   determining the resource identified by an HTTP/1.1 request. (But see&lt;br /&gt;   section 19.6.1.1 for other requirements on Host support in HTTP/1.1.)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Immediately after that follows a big blurb how the server is supposed to derive the host name from the absolute URI. I.e. the one that almost no-one seems to support. So the implementations deliberately ignore the spec. Or are not attentive in reading it ?&lt;br /&gt;The &lt;a href="http://datatracker.ietf.org/doc/draft-ietf-httpbis-p1-messaging/?include_text=1"&gt;in-progress work from HTTPBis&lt;/a&gt; workgroup in IETF also specifies the absolute URIs. So, some house cleaning will be in order.&lt;br /&gt;&lt;br /&gt;A very interesting bit about the pipelining:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   Clients which assume persistent connections and pipeline immediately&lt;br /&gt;   after connection establishment SHOULD be prepared to retry their&lt;br /&gt;   connection if the first pipelined attempt fails. If a client does&lt;br /&gt;   such a retry, it MUST NOT pipeline before it knows the connection is&lt;br /&gt;   persistent. Clients MUST also be prepared to resend their requests if&lt;br /&gt;   the server closes the connection before sending all of the&lt;br /&gt;   corresponding responses.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This brings 'must be prepared to act robust' general statement makes me think of all sorts of interesting failure modes (yes, and indeed I've seen some of those in real life) - however, this 'retry' also brings potential L7 hook to the &lt;a href="http://tools.ietf.org/html/draft-ietf-v6ops-happy-eyeballs"&gt;Happy Eyeballs&lt;/a&gt; logic. In some sort, maybe, later. Having a L7 hook would be a good thing - application may have a better idea about failures than layer 3/4. Anyway, I digress.&lt;br /&gt;&lt;br /&gt;Another interesting piece:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   This means that clients, servers, and proxies MUST be able to recover&lt;br /&gt;   from asynchronous close events. Client software SHOULD reopen the&lt;br /&gt;   transport connection and retransmit the aborted sequence of requests&lt;br /&gt;   without user interaction so long as the request sequence is&lt;br /&gt;   idempotent (see section 9.1.2).&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is also a HUGE RED FLAG to the application developers: never EVER use "GET" for anything that is not idempotent. Theoretically the server should not see the two requests, but with some conditions it might (say, proxy inbetween ?) All of this is still true for the specs that are being prepared in HTTPBis WG now.&lt;br /&gt;&lt;br /&gt;Here's the well-known humorous piece:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   Clients that use persistent connections SHOULD limit the number of&lt;br /&gt;   simultaneous connections that they maintain to a given server. A&lt;br /&gt;   single-user client SHOULD NOT maintain more than 2 connections with&lt;br /&gt;   any server or proxy. &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Year right. Web2.0 apps do exactly that. Not. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   The Max-Forwards request-header field MAY be used to target a&lt;br /&gt;   specific proxy in the request chain. When a proxy receives an OPTIONS&lt;br /&gt;   request on an absoluteURI for which request forwarding is permitted,&lt;br /&gt;   the proxy MUST check for a Max-Forwards field. If the Max-Forwards&lt;br /&gt;   field-value is zero ("0"), the proxy MUST NOT forward the message;&lt;br /&gt;   instead, the proxy SHOULD respond with its own communication options.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Is there already a HTTP-level "traceroute" to poke at caches on the way ? &lt;br /&gt;&lt;br /&gt;Kind of obvious, but interesting clarification nonetheless:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   The fundamental difference between the POST and PUT requests is&lt;br /&gt;   reflected in the different meaning of the Request-URI. The URI in a&lt;br /&gt;   POST request identifies the resource that will handle the enclosed&lt;br /&gt;   entity. That resource might be a data-accepting process, a gateway to&lt;br /&gt;   some other protocol, or a separate entity that accepts annotations.&lt;br /&gt;   In contrast, the URI in a PUT request identifies the entity enclosed&lt;br /&gt;   with the request -- the user agent knows what URI is intended and the&lt;br /&gt;   server MUST NOT attempt to apply the request to some other resource.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The "correct" code for post-POST redirections should be 303, not the 302, but 302 was for "older clients":&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      Note: Many pre-HTTP/1.1 user agents do not understand the 303&lt;br /&gt;      status. When interoperability with such clients is a concern, the&lt;br /&gt;      302 status code may be used instead, since most user agents react&lt;br /&gt;      to a 302 response as described here for 303.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;A fun fact while I tested this, is that both Firefox and Chromium send exactly 21 request before giving up and saying "it's a redirect loop". Even if the target URIs in the "Location:" header in the reply are different. Buyer, beware. It's more than "old 5" that the spec warns about - but there's no ultra-clever heuristics to get the redirect loop, either.&lt;br /&gt;&lt;br /&gt;This stops on section 12, I'll maybe go through the rest tomorrow and see if I can gather some other interesting pieces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-342982430981528116?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/342982430981528116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=342982430981528116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/342982430981528116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/342982430981528116'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/03/is-your-server-http11-compliant.html' title='Interesting bits from HTTP/1.1 RFC'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3567841369403474872</id><published>2011-03-05T01:31:00.006+01:00</published><updated>2011-03-05T02:11:56.682+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='teg'/><category scheme='http://www.blogger.com/atom/ns#' term='peltier'/><category scheme='http://www.blogger.com/atom/ns#' term='attiny'/><title type='text'>Hardware hacking: Peltier TEG experiment - parts list.</title><content type='html'>During the discussion over a beer at Betagroup yesterday, the topic of human-power for the devices came up. Today I stumbled upon &lt;a href="http://tegpower.com/products.html"&gt;this one&lt;/a&gt; and could not help but grab a couple of the "energy harvesters". They supposedly can generate up to 2v at the temperature delta of 75C. The 75C difference between the 36C of my body (hot side) and the "cold side" of -39C would mean it's a pretty useful device for a winter in Siberia.&lt;br /&gt;&lt;br /&gt;So, let's try a different approach with a &lt;a href="http://www.linear.com/product/LTC3108"&gt;LTC3108EGN&lt;/a&gt; - the step-up converter.&lt;br /&gt;The schematic suggests to use the CQ200 from Honeywell. But with such a form factor I am not sure I would be much interested to experiment with it :-)&lt;br /&gt;&lt;br /&gt;Also let's get a &lt;a href="http://www.coilcraft.com/pn/LPR6235-123QMLB.htm"&gt;coil&lt;/a&gt; that is needed. The capacitors I've in my pile already, should be no problem.&lt;br /&gt;&lt;br /&gt;You wonder what this will be used for ? Well, of course my beloved &lt;a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3618"&gt;ATTiny45&lt;/a&gt;, which is supposed to have a pretty low power consumption - the "V" models boast 300 microamps at 1.8V when running at 1mhz. This should be perfect, if I estimated correctly the amount of electricity the TEG will generate at low delta.&lt;br /&gt;&lt;br /&gt;All right, now just wait till all the parts get here and then a bit of soldering and we see if this idea works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3567841369403474872?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3567841369403474872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3567841369403474872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3567841369403474872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3567841369403474872'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/03/hardware-hacking-peltier-teg-experiment.html' title='Hardware hacking: Peltier TEG experiment - parts list.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1824494100870128928</id><published>2011-02-25T13:46:00.002+01:00</published><updated>2011-02-25T13:49:39.618+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>ActionController::InvalidAuthenticityToken</title><content type='html'>There are two types of answers on the web: &lt;a href="http://kl93.blogspot.com/2008/04/actioncontrollerinvalidauthenticitytoke.html"&gt;wrong&lt;/a&gt; and &lt;a href="http://erikonrails.snowedin.net/?p=131"&gt;correct&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Copying the correct answer here:&lt;br /&gt;&lt;br /&gt;you need to add &amp;lt;%= token_tag %&amp;gt; into your form to make this.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Do not&lt;/b&gt; comment out the code that throws out the error - it exists for a very good reason: Cross-Site Request Forgery protection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1824494100870128928?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1824494100870128928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1824494100870128928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1824494100870128928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1824494100870128928'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/actioncontrollerinvalidauthenticitytoke.html' title='ActionController::InvalidAuthenticityToken'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4358166434792348368</id><published>2011-02-25T00:21:00.006+01:00</published><updated>2011-02-25T01:18:42.380+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>Which choice ?</title><content type='html'>In one of the books I've been reading they were talking about choices and I think I came up with a mental experiment that has some interesting complexity in it.&lt;br /&gt;&lt;br /&gt;Imagine, you meet a wealthy man who wants to donate some of his wealth to help the poor children of Humbrian Republic. He has $1000000 he wants to donate. There are 10000 children that this money could feed for a year. Without these money, the chances that they die of hunger are tripled. The same chances as without the money are awaiting them after the year - even if the money were to be donated.&lt;br /&gt;&lt;br /&gt;However, this man is of a rather evil kind, and he gives you only four choices:&lt;br /&gt;&lt;br /&gt;1. You and him part ways, without any decisions made - and he does not donate anything whatsoever.&lt;br /&gt;&lt;br /&gt;2. You &lt;b&gt;have&lt;/b&gt; to keep the $10000, and the remaining money goes to the poor children of Humbrian Republic - so only 9/10th of the children get the food. As a condition for spending this money you have to keep mentioning that the money you're spending might have been better donated to feed 1000 children - each time you spend something from it.&lt;br /&gt;&lt;br /&gt;3. You get to keep $500000 - so only half of the children get the food for a year. You do not get any strings attached to this split - though only 1/2 of them get the food. &lt;br /&gt;&lt;br /&gt;4. You get to keep $900000 - so, 1/10th of the money gets donated and you get to keep 9/10th. As a condition you have to talk on the phone to 10 children randomly from the entire set - whether they got or not the money. All of the children will know that you have kept 9/10th of the money.&lt;br /&gt;&lt;br /&gt;Which of the four would be your choice. No need to answer, as I guess this would be a pretty confidential matter. (And please do not blame me - as I said it is a deliberate purely theoretical construct ;-)&lt;br /&gt;&lt;br /&gt;EDIT: when I mention you get to "keep" the money it means you can not, by contractual agreement, give it away - you have to spend it on your own needs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4358166434792348368?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4358166434792348368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4358166434792348368' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4358166434792348368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4358166434792348368'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/which-choice.html' title='Which choice ?'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6831379304305295358</id><published>2011-02-19T23:29:00.004+01:00</published><updated>2011-02-19T23:35:20.008+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='luajit-fun'/><category scheme='http://www.blogger.com/atom/ns#' term='luajit'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>More fun with luajit and ffi: &gt;300Kpps of UDP traffic</title><content type='html'>Today I added the UDP interface (rudimentary so far) to my experimental event loop.&lt;br /&gt;&lt;br /&gt;In the github repo there is the code that simply echoes the UDP packet back.&lt;br /&gt;&lt;br /&gt;For fun, I decided to wrap the sendto call into the cycle that repeats it 100000 times.&lt;br /&gt;&lt;br /&gt;Here is the output:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;23:26:52.98876&lt;b&gt;2&lt;/b&gt; IP6 ::1.12345 &gt; ::1.59283: UDP, length 4&lt;br /&gt;23:26:52.98876&lt;b&gt;5&lt;/b&gt; IP6 ::1.12345 &gt; ::1.59283: UDP, length 4&lt;br /&gt;23:26:52.98876&lt;b&gt;7&lt;/b&gt; IP6 ::1.12345 &gt; ::1.59283: UDP, length 4&lt;br /&gt;23:26:52.9887&lt;b&gt;70&lt;/b&gt; IP6 ::1.12345 &gt; ::1.59283: UDP, length 4&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This means that the luajit2+FFI can generate between 300Kpps and 500Kpps in UDP. Yay.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6831379304305295358?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6831379304305295358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6831379304305295358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6831379304305295358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6831379304305295358'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/more-fun-with-luajit-and-ffi-300kpps-of.html' title='More fun with luajit and ffi: &gt;300Kpps of UDP traffic'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2737586270055954113</id><published>2011-02-18T01:47:00.004+01:00</published><updated>2011-02-18T02:03:24.170+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='luajit-fun'/><category scheme='http://www.blogger.com/atom/ns#' term='luajit'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>Fun with LuaJIT and FFI library - httpd microbenchmarking</title><content type='html'>When I saw &lt;a href="http://luajit.org/ext_ffi.html"&gt;the new FFI library&lt;/a&gt; in the LuaJIT project, I immediately thought "yummy". I thought I'd give it a shot during the evening, but.... curiosity had killed the cat, so...&lt;br /&gt;&lt;br /&gt;First thing that got annoying quite quickly was the need to prefix every C function call with ffi.C. That's annoying. Can we do better ? Yes, we can. We add this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-- try to use FFI when no lua symbol found...&lt;br /&gt;setmetatable(_G, { __index = ffi.C } )&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the life immediately becomes great - you get the power of the declared functions plus the flexibility of the lua language, so you can write stuff like "local s = socket(AF_INET6, SOCK_STREAM, 0)". Tres cool.&lt;br /&gt;&lt;br /&gt;Now, let's see how much this all is worth performance wise.&lt;br /&gt;&lt;br /&gt;Let's write a funny high-level wrapper, that at its "application" core will look like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;local HTTP_REPLY = [[HTTP/1.0 200 OK&lt;br /&gt;Content-Type: text/plain&lt;br /&gt;&lt;br /&gt;This is test&lt;br /&gt;]]&lt;br /&gt;&lt;br /&gt;local MAX_FD = 2560&lt;br /&gt;&lt;br /&gt;local ss = socket_set(MAX_FD)&lt;br /&gt;&lt;br /&gt;local my_accept_cb = function(fds, i)&lt;br /&gt;  local cb = {}&lt;br /&gt;  cb.read = function(fds, i, data, len)&lt;br /&gt;    fds.send(i, HTTP_REPLY, #HTTP_REPLY)&lt;br /&gt;    fds.close(i)&lt;br /&gt;  end&lt;br /&gt;  cb.close = function(fds, i)&lt;br /&gt;    -- print("Closed socket")&lt;br /&gt;  end&lt;br /&gt;  return cb&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;while not ss.add_listener(12345, my_accept_cb) do&lt;br /&gt;  sleep(1)&lt;br /&gt;end&lt;br /&gt;print("Added listener, please run the test")&lt;br /&gt;while true do&lt;br /&gt;  local n = ss.poll(1000)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What do we do here ? We create a high-level abstraction which I called a "socket set" - that encapsulates all the boring event loop that usually exists in programs; and then add a listener socket on port 12345 to this set, which has a callback that is called upon accept and can return either the table with callbacks for the newly accepted socket - or nil - then the connection will be closed immediately.&lt;br /&gt;&lt;br /&gt;The accepted socket callbacks are such that they implement a very naive "HTTP server" - just for microbenchmarking.&lt;br /&gt;&lt;br /&gt;Now, let's give it a whirl with ab.&lt;br /&gt;&lt;br /&gt;The resuls are quite entertaining, here is how they look like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# while (true); do ab -n 1000 -c 1000 http://localhost:12345/ 2&gt;&amp;1 | grep "Requests per"; done&lt;br /&gt;Requests per second:    8433.91 [#/sec] (mean)&lt;br /&gt;Requests per second:    12374.55 [#/sec] (mean)&lt;br /&gt;Requests per second:    12720.06 [#/sec] (mean)&lt;br /&gt;Requests per second:    12688.58 [#/sec] (mean)&lt;br /&gt;Requests per second:    13144.58 [#/sec] (mean)&lt;br /&gt;Requests per second:    10742.29 [#/sec] (mean)&lt;br /&gt;Requests per second:    8651.27 [#/sec] (mean)&lt;br /&gt;Requests per second:    12748.76 [#/sec] (mean)&lt;br /&gt;Requests per second:    8145.58 [#/sec] (mean)&lt;br /&gt;Requests per second:    12946.32 [#/sec] (mean)&lt;br /&gt;Requests per second:    8648.65 [#/sec] (mean)&lt;br /&gt;Requests per second:    13047.85 [#/sec] (mean)&lt;br /&gt;Requests per second:    11550.14 [#/sec] (mean)&lt;br /&gt;Requests per second:    12904.22 [#/sec] (mean)&lt;br /&gt;Requests per second:    12968.32 [#/sec] (mean)&lt;br /&gt;Requests per second:    13219.47 [#/sec] (mean)&lt;br /&gt;Requests per second:    8244.09 [#/sec] (mean)&lt;br /&gt;Requests per second:    12056.47 [#/sec] (mean)&lt;br /&gt;Requests per second:    12834.83 [#/sec] (mean)&lt;br /&gt;Requests per second:    13288.86 [#/sec] (mean)&lt;br /&gt;Requests per second:    11455.02 [#/sec] (mean)&lt;br /&gt;Requests per second:    11130.03 [#/sec] (mean)&lt;br /&gt;Requests per second:    8034.32 [#/sec] (mean)&lt;br /&gt;Requests per second:    12566.76 [#/sec] (mean)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is not too bad at all.&lt;br /&gt;&lt;br /&gt;Here is the similar test with lighttpd running on the same machine, serving the default static page:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Requests per second:    12080.50 [#/sec] (mean)&lt;br /&gt;Requests per second:    9397.88 [#/sec] (mean)&lt;br /&gt;Requests per second:    9948.47 [#/sec] (mean)&lt;br /&gt;Requests per second:    12906.39 [#/sec] (mean)&lt;br /&gt;Requests per second:    9284.53 [#/sec] (mean)&lt;br /&gt;Requests per second:    4281.34 [#/sec] (mean)&lt;br /&gt;Requests per second:    9143.44 [#/sec] (mean)&lt;br /&gt;Requests per second:    12422.21 [#/sec] (mean)&lt;br /&gt;Requests per second:    9170.19 [#/sec] (mean)&lt;br /&gt;Requests per second:    12603.03 [#/sec] (mean)&lt;br /&gt;Requests per second:    9413.54 [#/sec] (mean)&lt;br /&gt;Requests per second:    12981.62 [#/sec] (mean)&lt;br /&gt;Requests per second:    8615.56 [#/sec] (mean)&lt;br /&gt;Requests per second:    9849.98 [#/sec] (mean)&lt;br /&gt;Requests per second:    9869.43 [#/sec] (mean)&lt;br /&gt;Requests per second:    9818.84 [#/sec] (mean)&lt;br /&gt;Requests per second:    3384.56 [#/sec] (mean)&lt;br /&gt;Requests per second:    9127.59 [#/sec] (mean)&lt;br /&gt;Requests per second:    1528.56 [#/sec] (mean)&lt;br /&gt;Requests per second:    9157.01 [#/sec] (mean)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Not bad at all for a high-level code, what do you think ?&lt;br /&gt;&lt;br /&gt;If you want to toy with it yourself - &lt;a href="https://github.com/ayourtch/luajit-fun"&gt;it's on github&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2737586270055954113?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2737586270055954113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2737586270055954113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2737586270055954113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2737586270055954113'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/fun-with-luajit-and-ffi-library-httpd.html' title='Fun with LuaJIT and FFI library - httpd microbenchmarking'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1868548931586589259</id><published>2011-02-17T00:14:00.002+01:00</published><updated>2011-02-17T00:20:42.065+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freedom-box'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><category scheme='http://www.blogger.com/atom/ns#' term='tex'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>Fun links: 17 Feb 2011</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.engadget.com/2011/02/15/vmware-android-handset-virtualization-hands-on/"&gt;Android virtualized&lt;/a&gt; - really cool stuff, with a whole lot of potential. Imagine being able to save your mobile somewhere else than on mobile. Yummy business opportunities, I think.&lt;br /&gt;&lt;li&gt;&lt;a href="http://happymutant.com/latex/misce/beamer.php"&gt;Making presentations in TeX&lt;/a&gt; - I made the first step towards using TeX - installed it. The results so far are not terribly cool, but it's only the hands to blame.&lt;br /&gt;&lt;li&gt;&lt;a href="http://scripting.com/stories/2011/02/13/strengtheningTheInternet.html"&gt;A fractional horsepower news network&lt;/a&gt; - I think this is the beginnings of the pendulum going back from "mainframe", centralized model to a distributed it. Of course, while the history repeats itself, it does so in a whimsical way, so how exactly it will look like, is a question. Maybe in a form of a &lt;a href="http://wiki.debian.org/FreedomBox"&gt;Freedom Box&lt;/a&gt;. I've got some of that.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1868548931586589259?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1868548931586589259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1868548931586589259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1868548931586589259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1868548931586589259'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/fun-links-17-feb-2011.html' title='Fun links: 17 Feb 2011'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2172026095408650132</id><published>2011-02-16T01:44:00.003+01:00</published><updated>2011-02-16T01:54:32.139+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video'/><category scheme='http://www.blogger.com/atom/ns#' term='talks'/><category scheme='http://www.blogger.com/atom/ns#' term='speaking'/><title type='text'>Me talking...</title><content type='html'>In the past couple of weeks I got "on stage" few times, which was quite a lot of fun. Even more fun was that these moments were shot on video as well. So, here we go, a link collection: here's me talking at Cisco Live 2011 in London about &lt;a href="http://www.ustream.tv/recorded/12408982"&gt;Advanced Firewalls&lt;/a&gt; - and the weekend after, my FOSDEM talk about &lt;a href="http://video.fosdem.org/2011/lightningtalks/mongrel2.xvid.avi"&gt;Lighting up IPv6 in Mongrel2&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2172026095408650132?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2172026095408650132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2172026095408650132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2172026095408650132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2172026095408650132'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/me-talking.html' title='Me talking...'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3577155297936716790</id><published>2011-02-16T00:49:00.004+01:00</published><updated>2011-02-16T01:25:48.625+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='elevators'/><title type='text'>Elevators: the curiosity</title><content type='html'>This blog post is intended to serve as a reminder for myself as well as a teaser for everyone else.&lt;br /&gt;&lt;br /&gt;First a bit of history of the trigger. The old elevators in the buildings in Belgium are pretty peculiar - they have no doors. Yes, if you are surprised, I was too - when I first arrived - back in Russia (and in Soviet Russia) they had the doors - either the sliding ones or closing ones. So this optimization was weird and a bit frightening.&lt;br /&gt;&lt;br /&gt;However, over time I got used to this, and even found it kind of cool to watch the wall as in the evenings the elevator was pulling me up to the 14th floor where I live, and down to the ground in the mornings.&lt;br /&gt;&lt;br /&gt;All is good - but the regulators came. Apparently these door-less elevators were considered unsafe by someone. I can imagine either someone got squeezed in some unpleasant way, and hence the reaction. Net result: a seemingly IR-laser based emergency stop mechanism (if you reach your hand towards the wall as the elevator is moving and cross the surface, it stops) - which is pretty cool; and the decrease in speed of the elevator. &lt;br /&gt;&lt;br /&gt;It's the latter which is utterly uncool and is a trigger for this - it, at least perceptually has noticeably increased my waiting time in enough number of the mornings to start wondering "why".&lt;br /&gt;&lt;br /&gt;And I started to ponder - what is the best mathematical model for expressing my annoyance with this situation in numbers ? And it seems it is a curious one, much more involved than I'd expect at the first glance.&lt;br /&gt;&lt;br /&gt;Some reading links on the topic:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.kone.com/countries/SiteCollectionDocuments/MP/Elevcon2008_elevator_traffic_simulation_procedure.pdf"&gt;Elevator Traffic simulation procedure&lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.elevatorworld.com/files/sep07.pdf"&gt;Traffic performance of Elevators with Destination Control&lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.sal.tkk.fi/publications/pdf-files/thak03.pdf"&gt;Simulation of building traffic and evacuation by elevators&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;So, in short it seems to be a pretty fun modeling topic - even if we do not get into the &lt;a href="http://masters.donntu.edu.ua/2009/fema/stepanov/diss/indexe.htm"&gt;mechanical  problems&lt;/a&gt; and keep ourselves busy only with traffic handling problems.&lt;br /&gt;&lt;br /&gt;The analytical question, which, after this pre-investigation I am afraid is not so trivial is the function T(v,p) - where the function value is the upper bound on my waiting time  when needing to go down from my 14th floor in the morning, "v" is the elevator velocity and the "p" is the probability interval. i.e. T(1,0.95) == 40 would mean that with the 95% probability I would have to wait less than 40 seconds, assuming the speed of the elevator of 1 m/s.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3577155297936716790?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3577155297936716790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3577155297936716790' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3577155297936716790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3577155297936716790'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/elevators-curiosity.html' title='Elevators: the curiosity'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1310973562444205121</id><published>2011-02-12T11:15:00.008+01:00</published><updated>2011-02-13T13:21:52.746+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='gae'/><title type='text'>Google app engine + facebook apps links</title><content type='html'>Started looking at Google apps engine + facebook combo. Some links that look useful to keep around for myself:&lt;br /&gt;&lt;h2&gt;GAE&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://code.google.com/appengine/docs/python/overview.html"&gt;Python GAE overview&lt;/a&gt; (and &lt;a href="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Python"&gt;downloads&lt;/a&gt;)&lt;br /&gt;&lt;li&gt;&lt;a href="http://code.google.com/appengine/docs/python/tools/devserver.html"&gt;Python development server for GAE&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;h2&gt;FB+GAE&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://pythoughts.com/facebook-apps-with-google-app-engine"&gt;Facebook Apps with Google App Engine&lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://dollarmani-facebook.blogspot.com/2008/09/facebook-applications.html"&gt;One more FB+GAE tutorial&lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://code.google.com/appengine/articles/shelftalkers.html"&gt;One more tutorial with an example app&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;h2&gt;Misc&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/2349368/looping-redirect-with-pyfacebook-and-google-app-engine"&gt;Redirect loop question on SO&lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/1613772/accessing-facebook-connect-fbml-cookie-via-pyfacebook"&gt;A question about auth_token&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; Looks like all of these are obsolete, the way to go is the &lt;a href="https://github.com/facebook/python-sdk"&gt;Python graph api SDK&lt;/a&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1310973562444205121?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1310973562444205121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1310973562444205121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1310973562444205121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1310973562444205121'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/google-app-engine-facebook-apps-links.html' title='Google app engine + facebook apps links'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4180179014491547120</id><published>2011-02-12T03:10:00.003+01:00</published><updated>2011-02-12T03:15:41.372+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='entrepreneurs'/><category scheme='http://www.blogger.com/atom/ns#' term='e-ink'/><category scheme='http://www.blogger.com/atom/ns#' term='stackexchange'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>Fun links: 12 Feb 2011</title><content type='html'>Going to start the "links" series, even if for myself only. Too much to post on facebook, I don't want to spam there. And easier to find here if it is indexed...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blog.serverfault.com/post/stack-exchanges-architecture-in-bullet-points/"&gt;Stackexchange architecture&lt;/a&gt; - how to build a performant website on a small amount of hardware. Code better.&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.noteslate.com/"&gt;A4-sized notepad with e-paper&lt;/a&gt; - Not sure I want it, but with opensource both hardware and software, might be very interesting. Especially A4 size - would mean it can be used for various barcode stuff in the future.&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.inc.com/magazine/20110201/how-great-entrepreneurs-think.html"&gt;How great entrepreneurs think&lt;/a&gt;.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4180179014491547120?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4180179014491547120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4180179014491547120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4180179014491547120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4180179014491547120'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/02/fun-links-12-feb-2011.html' title='Fun links: 12 Feb 2011'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7182215172793328576</id><published>2011-01-24T02:09:00.004+01:00</published><updated>2011-01-24T02:16:46.593+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gncci'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>First practical joke with gncci - clamping the MSS</title><content type='html'>Today I thought that a great hack might be to try out per-host MSS clamping in userland.&lt;br /&gt;&lt;br /&gt;Sounds like a fun idea, but ideas are not much without the execution - so &lt;a href="https://github.com/ayourtch/gncci/commit/8dcf85676ef5eec535bf9ebdad483b56aca69e35"&gt;this diff&lt;/a&gt; adds the hook for the setsockopt() - and, as a side effect the o.setsockopt() into the Lua-land. (The latter was actually what I wanted, but it was silly not to add the whole hook).&lt;br /&gt;&lt;br /&gt;The result - it does wonders with PMTUD-blackholed websites, the world becomes wonderful again. All of this even without needing root to tweak the MTU on the physical interface.  &lt;br /&gt;&lt;br /&gt;Look, ma, no hands!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7182215172793328576?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7182215172793328576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7182215172793328576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7182215172793328576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7182215172793328576'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/first-practical-joke-with-gncci.html' title='First practical joke with gncci - clamping the MSS'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8228570800135342357</id><published>2011-01-23T11:59:00.004+01:00</published><updated>2011-01-24T02:10:24.106+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gncci'/><category scheme='http://www.blogger.com/atom/ns#' term='sockets'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>gncci - general network connections contortion interface</title><content type='html'>Ok, the name is a bit wacky, because I wanted a bit of wordplay - the idea came up during the happy eyeballs discussion within the v6ops maillist, and I coded it up yesterday in one marathon run.&lt;br /&gt;&lt;br /&gt;But I think the result is fun. You get an easy-to-tweak middle layer between the application making the socket calls and the socket calls proper. And it's not the C that you have to sweat in - it's all Lua baby. &lt;br /&gt;&lt;br /&gt;So, by loading this with LD_PRELOAD you can code and a little bit of scripting you can do a lot of interesting things - check what connections the application is making, "sniff" the content that the app is sending onto the socket and receiving from the network, even deny some of the connection attempts or mangle the DNS packets so the application connects to the hosts that you have defined. &lt;br /&gt;&lt;br /&gt;The possibilities are endless. &lt;br /&gt;&lt;br /&gt;Bugs: it seems that the constructor code made it shaky. In retrospect, probably it should be protected with spinlock (similar to the existing code, which first was a spinlock, but then I discovered the multithreaded apps like firefox is might get into a deadlock - so I had to do thread-local variables).&lt;br /&gt;&lt;br /&gt;Anyway, it works at least for some values of "works". &lt;a href="https://github.com/ayourtch/gncci"&gt;Have fun.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8228570800135342357?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8228570800135342357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8228570800135342357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8228570800135342357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8228570800135342357'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/gncci-general-network-connections.html' title='gncci - general network connections contortion interface'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3620058014664528235</id><published>2011-01-22T17:08:00.004+01:00</published><updated>2011-01-22T17:11:53.582+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mercurial'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>Export Mercurial repository into git repository</title><content type='html'>Wanna export mercurial or SVN repository to git ?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://repo.or.cz/w/fast-export.git"&gt;fast-export&lt;/a&gt; helps with that.&lt;br /&gt;&lt;br /&gt;Thanks to &lt;a href="http://webonrails.com/2009/02/19/export-mercurialhg-repository-to-git-repository/"&gt;Akhil&lt;/a&gt; for the tip.&lt;br /&gt;&lt;br /&gt;The most interesting commands are: (to be done in the empty git repository that will be the target):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/path/to/hg-fast-export.sh -r /path/to/hg_repo &lt;br /&gt;git-repack -a -d -f&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3620058014664528235?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3620058014664528235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3620058014664528235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3620058014664528235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3620058014664528235'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/wanna-export-mercurial-or-svn.html' title='Export Mercurial repository into git repository'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-478000183005612426</id><published>2011-01-21T01:58:00.003+01:00</published><updated>2011-01-21T01:59:31.980+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sockets'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Sending the file descriptors between processes</title><content type='html'>What seems like very nice library: http://www.normalesup.org/~george/comp/libancillary/&lt;br /&gt;&lt;br /&gt;This hides the intricacies of passing the file descriptors between the processes.&lt;br /&gt;&lt;br /&gt;If it is portable enough, that'll be nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-478000183005612426?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/478000183005612426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=478000183005612426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/478000183005612426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/478000183005612426'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/sending-file-descriptors-between.html' title='Sending the file descriptors between processes'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-9173586512842084595</id><published>2011-01-19T23:35:00.002+01:00</published><updated>2011-01-19T23:44:19.652+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='https'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><title type='text'>On ssl caching</title><content type='html'>tl;dr note for myself:&lt;br /&gt;&lt;br /&gt;SSL-protected docs can be cached if you send the header "Cache-Control: public, max-age=31536000".&lt;br /&gt;&lt;br /&gt;&lt;a href="http://encosia.com/2011/01/19/cripple-the-google-cdns-caching-with-a-single-character/"&gt;An elegant solution&lt;/a&gt; to avoid the hassle of explicitly specifying http/https references, assuming it does work (&lt;a href="http://tools.ietf.org/html/rfc3986#section-4.2"&gt;RFC says it should&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-9173586512842084595?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/9173586512842084595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=9173586512842084595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/9173586512842084595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/9173586512842084595'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/on-ssl-caching.html' title='On ssl caching'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2549065032384578115</id><published>2011-01-18T22:35:00.007+01:00</published><updated>2011-01-18T23:10:45.976+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='society'/><title type='text'>Politics as a catalyst of wealth</title><content type='html'>The world of politics, at least as far as I comprehend it - is very complicated. The politics, is, well, politics.&lt;br /&gt;&lt;br /&gt;Must be especially tough close to the elections - I'd imagine this is the most impacting period. The tooth that was pulled out a year ago does not hurt - but the one that was pulled out yesterday hurts all right. It must be really tough to operate in such an environment. And then those lobbyist folks with their ideas...&lt;br /&gt;&lt;br /&gt;So here's a thought experiment that I think might help the society get easier life for the politicians and for the society of the whole.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Abandon the elections.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Instead, mandate the direct democracy by law. Yes, by direct democracy, I mean the entities like &lt;a href="http://en.wikipedia.org/wiki/Demoex"&gt;Demoex&lt;/a&gt; in Sweden. &lt;br /&gt;But, make such a technology country-wide and mandated.&lt;br /&gt;&lt;br /&gt;"But laymen people are not great at taking the decisions" - you will say - "and, by the way, who has the time for this ?". &lt;br /&gt;&lt;br /&gt;Precisely, this is where the catch is. Unless the things go utterly haywire, no-one *really* wants to deal with the mundane details. But, alas - you have to - it's by law.&lt;br /&gt;&lt;br /&gt;But, the law also would not prohibit to hire someone to do this job for you. So we will have someone who will be paid to read the to-be-ratified papers and make the decisions on behalf of the others.&lt;br /&gt;&lt;br /&gt;How's that called ? You're right - &lt;b&gt;politician&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;What's the difference compared to now ? The difference is the money flow. Right now it's faceless - the electorate pays the taxes, then they go to say "this guy will represent me for X years". And then the taxes pay the rent to that guy. As a result we have a fairly non-responsive system.&lt;br /&gt;&lt;br /&gt;In the proposed equation - you can hire the guy per-month, per-week, per-hour if you wish.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The responsiveness to the customer needs would immediately be reflected in the rewards&lt;/b&gt;. The customers being those who do not have to spend the time on the elections - but simply outsource their responsibility to democratically decide. And the %% of the taxes that was going into the common flow of running expenses of the government, can be dramatically reduced.&lt;br /&gt;&lt;br /&gt;Hey, but all of that would be a very bad idea! No-one would then take any unpopular decisions, because they are risky and unpopular!&lt;br /&gt;&lt;br /&gt;The reality is:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;In business this works, with a suitable business plan.&lt;br /&gt;&lt;li&gt;Else, noone is taking any unpopular decisions anyway - most of the time.&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;So it is not much worse than the status quo.&lt;br /&gt;&lt;br /&gt;But, hey, what happens with all the lobbying that is supposedly [sic] happens ?&lt;br /&gt;&lt;br /&gt;Simple. Convince the masses that Idea X is a good idea. Make a decent school in the neighborhood - and those who go there will become your live advertisement - much better than on TV. And they can then spend more time watching the actual film, anyway.&lt;br /&gt;&lt;br /&gt;This all seems to be too simple to not have tried before and too simple to not contain any catch. &lt;br /&gt;&lt;br /&gt;If you know some good historic examples on where this has been tried, I'd be curious to know the occasion and the outcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2549065032384578115?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2549065032384578115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2549065032384578115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2549065032384578115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2549065032384578115'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/politics-as-catalyst-of-wealth.html' title='Politics as a catalyst of wealth'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3515989374848167764</id><published>2011-01-18T02:18:00.004+01:00</published><updated>2011-01-18T16:34:09.114+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcc'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>Compiling Lua on the fly with tcc.</title><content type='html'>&lt;a href="http://bellard.org/tcc/"&gt;tcc&lt;/a&gt; is quite fast.&lt;br /&gt;&lt;br /&gt;This is in the "src" directory of Lua 5.1.4 (I added a small file with the definitions for the missing string functions).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ time tcc *[^ca].c lgc.c lfunc.c -run lua.c -e 'print "hello!"'&lt;br /&gt;hello!&lt;br /&gt;&lt;br /&gt;real    0m0.165s&lt;br /&gt;user    0m0.140s&lt;br /&gt;sys     0m0.030s&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fun, even if fairly useless.&lt;br /&gt;&lt;br /&gt;The performance of the lua interpreter that I had compiled statically, was about 1/2 of that compiled with gcc, so it is not a racer by all means - if you need speed, you will look at luajit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3515989374848167764?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3515989374848167764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3515989374848167764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3515989374848167764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3515989374848167764'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/compiling-lua-on-fly-with-tcc.html' title='Compiling Lua on the fly with tcc.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7821503504514422413</id><published>2011-01-17T20:30:00.005+01:00</published><updated>2011-01-17T20:54:09.486+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lisp'/><title type='text'>Exploring the dimensions of lisp</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://leon.bottou.org/projects/minilisp"&gt;minilisp&lt;/a&gt;. A 18Kb S-expression library + interpreter.&lt;br /&gt;&lt;li&gt;&lt;a href="http://lemonodor.com/archives/2007/11/microlisp.html"&gt;A C64 interpreter called micro-lisp&lt;/a&gt; and &lt;a href="http://nakkaya.com/2010/08/24/a-micro-manual-for-lisp-implemented-in-c/"&gt;MicroLisp within a blog post&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;&lt;a href="http://www-fourier.ujf-grenoble.fr/~sergerar/Nanolisp/"&gt;nanolisp&lt;/a&gt; - written for the regular lisp machine. &lt;br /&gt;&lt;li&gt;&lt;a href="http://picolisp.com/"&gt;picolisp&lt;/a&gt; - full blown language, can even do web apps. 745 kb tarball.&lt;br /&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/femtolisp/"&gt;femtolisp&lt;/a&gt; from googlecode - a checkout of a few megabytes. &lt;a href="http://computing-tools.com/lisp/"&gt;What seems another femtolisp&lt;/a&gt; - several standalone files.&lt;br /&gt;&lt;li&gt;attolisp - part of &lt;a href="http://code.google.com/p/vfuncs/"&gt;vfuncs library&lt;/a&gt; - because &lt;a href="http://quantblog.wordpress.com/2008/10/02/picolisp-nonolisp-femtolisp-all-taken-vfuncs-attolisp-is-born/"&gt;everything else is taken&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;&lt;a href="http://zeptolisp.sourceforge.net/"&gt;zeptolisp&lt;/a&gt; - "intended to have only the most basic structures and functions built into the language". &lt;br /&gt;&lt;li&gt;yoctolisp - anyone ? :-)&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;On an orthogonal axis, a couple of interesting exhibits:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/lualisp/"&gt;LuaLisp&lt;/a&gt; - lisp implemented entirely in Lua.&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.aviduratas.de/lisp/lispmfpga/"&gt;LispmFPGA&lt;/a&gt; - a lisp machine in FPGA project.&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;If I find something else worth adding - I'll update this post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7821503504514422413?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7821503504514422413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7821503504514422413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7821503504514422413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7821503504514422413'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/exploring-dimensions-of-lisp.html' title='Exploring the dimensions of lisp'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1348799521638716065</id><published>2011-01-17T03:08:00.008+01:00</published><updated>2011-08-05T18:58:16.307+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kvm'/><title type='text'>Windows 7 in kvm: some observations and tips</title><content type='html'>I spent the better part of this weekend reversing the status quo from running Ubuntu in VirtualBox on Windows 7 to running Windows 7 in kvm on top of Ubuntu. The result is catastrophic success, and makes me quite happy. This post is to share some little hacks/experiences that I've accumulated in the process.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;giving the "&lt;b&gt;-usbdevice tablet&lt;/b&gt;" to kvm will avoid you from needing to click into the kvm window.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;using VNC to access the Windows VM is neat. This is achieved by adding "&lt;b&gt;-vnc 127.0.0.1:1 -daemonize&lt;/b&gt;" to the kvm command line. Handy when you have windows running long updates. You can simply close the VNC and let it chug along.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;typing "sendkey ctrl-alt-delete" into the monitor console (you get to it by pressing ctrl-alt-2 and back to gui by pressing ctrl-alt-1) [and, FWIW, using "F8" vnc popup, too] is a bit cumbersome. Therefore, since I'm going to use it alone, I'll redirect the console by  "&lt;b&gt;-monitor tcp:127.0.0.1:31337,server,nowait&lt;/b&gt;". Then I can create a shell script "send-ctrl-alt-del" that will contain the simple netcat call: "&lt;b&gt;echo 'sendkey ctrl-alt-delete' | nc localhost 31337&lt;/b&gt;" - and then bind this to some key combo in fluxbox. &lt;br /&gt;&lt;br /&gt;&lt;li&gt;do not be afraid to undershoot with disk space for win7. You can create a sparse 1gb file by doing "&lt;b&gt;dd if=/dev/zero of=1gb.img bs=1024 count=1 seek=1048576&lt;/b&gt;" and then by appending this file to the image "&lt;b&gt;cat 1gb.img &gt;&gt;win7.img&lt;/b&gt;". After that in the disk administration you can simply grow the volume by 1Gb.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;for accessing the files on host, if you do not have anything SMB-talking, you can get away with using the SSHFS. &lt;a href="http://dokan-dev.net/en/"&gt;http://dokan-dev.net/en/&lt;/a&gt; is precisely that. It allows userland filesystems as windows, and includes the SSHFS filesystem. It's a bit rough on edges, but works. Assuming you are using the kvm built-in networking, you will always connect to &lt;b&gt;10.0.2.2&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;If this is your personal client machine, no need to keep ssh open to the world - so edit the /etc/ssh/sshd_config and put "&lt;b&gt;ListenAddress 127.0.0.1&lt;/b&gt;" there. Do not forget to restart sshd afterwards.&lt;br /&gt;&lt;br /&gt;When you boot up your Windows you can connect the drives back to the host. Beware to turn off the cache - else the changes would not be reflected immediately and such a setup becomes tough to work with.&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Hopefully this will be useful to you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1348799521638716065?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1348799521638716065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1348799521638716065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1348799521638716065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1348799521638716065'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/windows-7-in-kvm-some-observations-and.html' title='Windows 7 in kvm: some observations and tips'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4619377549086537433</id><published>2011-01-16T15:56:00.002+01:00</published><updated>2011-01-16T15:59:12.290+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='touchpad'/><category scheme='http://www.blogger.com/atom/ns#' term='x11'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>How to disable touchpad on thinkpad laptops in X11</title><content type='html'>Thanks to &lt;a href="http://www.nico.schottelius.org/blog/xorg-disable-touchpad-with-xinput/"&gt;Nico Schottelius&lt;/a&gt; for this hint.&lt;br /&gt;&lt;br /&gt;In short, I needed to do three things:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;xinput list&lt;/b&gt; - to find which ID does the touchpad have (11 for me)&lt;br /&gt;&lt;li&gt;&lt;b&gt;xinput list-props 11&lt;/b&gt; - to find which ID does the "enabled" setting have (125)&lt;br /&gt;&lt;li&gt;&lt;b&gt;xinput set-prop 11 125 0&lt;/b&gt; - to disable the annoying peripherial.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4619377549086537433?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4619377549086537433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4619377549086537433' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4619377549086537433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4619377549086537433'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/how-to-disable-touchpad-on-thinkpad.html' title='How to disable touchpad on thinkpad laptops in X11'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2484027551243668721</id><published>2011-01-15T14:34:00.004+01:00</published><updated>2011-01-16T01:35:54.861+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smoking'/><category scheme='http://www.blogger.com/atom/ns#' term='psy'/><title type='text'>How to quit smoking ?</title><content type='html'>I long wanted to share my experiences with getting rid of the tobacco addiction, and I've noticed one of my friends abandoning the habit of smoking, so this is a good trigger to do so.&lt;br /&gt;&lt;br /&gt;So - how to quit smoking ? The first trick - don't. No, I do not mean continue smoking. Do not put this hard and fast barrier, this non-negotiable resolution - "never, never again". Phrase it differently for yourself - "I will &lt;b&gt;stop&lt;/b&gt; smoking. Just for some time. I can always get back to it if I want."&lt;br /&gt;&lt;br /&gt;Why do I say so ? Because smoking is an activity with an immediate short-term positive feedback, and big long-term negative feedback. But since human intuition is pretty bad at assessing the long-term events, the short-term positive has a much more dramatic impact. So, you put for yourself this prohibitive barrier. More over, it's not one but just two hardships that you create for yourself:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The difficulty of having to survive the lack of the short-term positive feel of smoking&lt;br /&gt;&lt;li&gt;The fear of guilt that you will experience when you violate your "never again" promise to yourself. This guilt will make your future 'quitting' attempts harder in itself - because you will be afraid of this negative feeling that comes when you would not be able to make it.&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;The second one has a huge ripple effect in my opinion - not only you are feeling the guilt in yourself violating your own promise, you also lower your own self-esteem. Subsequently you try to create an escape out of this labyrinth by either saying that it was not really 'for real' or that you have the unique condition which subjects you to strong physical addiction. Well, save yourself from this nonsense. Therefore:&lt;br /&gt;&lt;br /&gt;Don't &lt;b&gt;quit&lt;/b&gt; - but &lt;b&gt;stop&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;"quit" implies a one-time action (and 'never again') - while "stop" does not carry such a pathetic charge. It's simply a declaration of fact that you are transitioning from the smoking state to a non-smoking state. It leaves the freedom of the decision to restart smoking later, if you wish, up to you - without losing your dignity with yourself. &lt;br /&gt;&lt;br /&gt;Isn't it good ?&lt;br /&gt;&lt;br /&gt;Now, when we sorted out the self-guilt part, we need to figure out what to do with that urge. It's damn hard to avoid going for this awesome morning cigarette after you grabbed your first cup of coffee. Isn't it ? Do you feel this itchy feeling, that pushes you to run and get yourself a pack to get a puff ?&lt;br /&gt;&lt;br /&gt;Well, that's my second lesson that I learned. Never try to stop smoking without significantly changing the environment/lifestyle - if you do, you are unnecessarily increasing the difficulty of your task. You don't do that with other activities - so why would you do it when it is about such an important thing as your future health ?&lt;br /&gt;&lt;br /&gt;Also - when you change the environment and your schedule - ensure there is no "dead spot" that would make you think to fill it with smoking.&lt;br /&gt;&lt;br /&gt;These two learnings make business trips and vacations an ideal place to stop smoking:&lt;br /&gt;your environment is usually unfamiliar, so your mind is concentrated on reacting to the unknown factors rather than following the routine. As well - during these periods your schedule is usually busier than normal, which gives ever more distractions from smoking.&lt;br /&gt;&lt;br /&gt;Another important thing that a change in the environment brings - it takes away the "social routine" aspect of smoking. By and large, the social part of smoking is probably the biggest drag of it - and by eliminating it, at least temporarily, you can make your life easier. (Later, when you restart the contacts with your smoker friends, you can simply mention to them that you were not smoking for a few weeks. This will gain you a whole lot of respect and awe from them :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first key period is roughly about a week - that's when the real "physical" effects of nicotine wear out. (NB: This is totally unscientific, and is just my observation on myself). During this period you still may feel some "physical" urge to smoke.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You thought it'd get easier after that ? Well, the physical part is gone. But now we've got a much tougher nut to crack - it's in your head. It lasts about a month starting from your "stop point". At this point, while you are managing to abstain from smoking, the balance is very fragile - and a lot of factors can tip it.&lt;br /&gt;&lt;br /&gt;The result of such a tipping will be an avalanche-like wave of desire to get a cigarette - which feels almost physical! Don't believe it - it is not. It's just your brain getting stuck. Whenever you get into such a situation, whatever happens, try not to think about the large green monkey with a banana. :-) Or, more seriously - just try to dissect what seems to be a physical need for a smoke into your reasoning on *why* it drags you there and what triggered it.&lt;br /&gt;&lt;br /&gt;Some triggers that will probably cause you do it: a smoking scene in a movie. An argument with other people that will make you stressed and you will want to relieve the stress the same way as you'd do before - with a smoke. A time when you have to wait for something just long enough to have a cigarette. (programmers: "make all", anyone ?)&lt;br /&gt;&lt;br /&gt;Fighting these urges is probably the toughest part in the whole exercise. I don't have a good recipe for it. Keep strong and remember that you can distract yourself by other activities. Like, watching this video about marshmallows:&lt;br /&gt;&lt;br /&gt;&lt;object style="height: 390px; width: 640px"&gt;&lt;param name="movie" value="http://www.youtube.com/v/QX_oy9614HQ?version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/QX_oy9614HQ?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;So here we go, few weeks have successfully passed and you're so proud of yourself - you didn't smoke a single cig since you started. Time to pat yourself on the back! Also - note that now you are feeling yourself much better. You are less tired when you wake up in the morning. You have more energy throughout the day.&lt;br /&gt;&lt;br /&gt;Note this good feeling well. Try to remember it very hard - and try to compare it with your feelings when you were regularly smoking. This is one of the ways you are building up your barrier to fall into puffing again - strengthening the current state of non-smoking.&lt;br /&gt;&lt;br /&gt;But there it comes - somewhere along, friends get you to the party. Modest amounts of alcohol, and then there will always be a smoker at the party. You feel a desire that is irresistible. You think I'd say "be strong and resist the temptation?" Wrong. Go for it - full speed. Get a good doze of alcohol and feel free to smoke as much as you'd do before stopping. Why ? That's because in the morning you're gonna get a  terrible hangover! The body, adapted to the absence of nicotine, will have to fight two poisons at once - alcohol and nicotine. A splitting headache guaranteed. So, if you are wise enough, reading this will be enough for you to not smoke that cigarette at the party. If you wanna try it out - go ahead. Just remember not to go overboard - I am not a doctor and I am not responsible if your body decides to go fubar on you. &lt;br /&gt;&lt;br /&gt;Sometimes you may feel the circumstances warrant a cigarette - a good talk, what not. &lt;br /&gt;Again - if you are sufficiently long into the process (say, 3+ weeks) - there is nothing to be afraid - you can use this to your advantage. Light up a cigarette, smoke it, and notice for yourself it feels like you put some shit in the mouth. So what was the point of putting it ?&lt;br /&gt;&lt;br /&gt;If you repeat these exploratory actions not too close to each other (so as not to get the tastebuds numbed down by a smoke) - you can build a pretty good psychological link of cause-effect: "I puff a cig =&gt; it tastes like shit". It will be as good as once you might just ask yourself "so what's the point? I'll just stand nearby if all I wanna do is talk".&lt;br /&gt;&lt;br /&gt;Eventually, you realise you have much stronger incentive psychologically to &lt;b&gt;not&lt;/b&gt; smoke - and you build up enough of a set of short-term and near-short-term negatives to prevent your brain from tricking itself that it wants a smoke: headache, tiredness, bad taste while smoking, headache in the morning - these are all immediate enough to be quantifiably annoying (as opposed to some very distant death from some weird disease. Which will never happen anyway. 'Cos it's pretty hard for an individual to assess their own death. We overcome the fear of death back in the childhood and never re-learn to feel it again).&lt;br /&gt;&lt;br /&gt;Why I say this can work ? I don't have a peer-reviewed scientific evidence to it. It's only based on my own experience. I managed to stop smoking once for half a year, when I was on a 1-month business trip, a few years back. Since then I was looking for a good occasion to repeat this - since I liked the feeling. &lt;br /&gt;&lt;br /&gt;Last year starting March I completely stopped smoking - till September. In September I got a block of cigarettes as a present, which laid there for a few weeks, but then the physical presence of the cigarettes and a couple of "favorable" moments did make me pick up some of the smoking habit again. Which I promptly regretted - because I got used to that extra energy that I previously had. Mid-december I stopped again and hardly a couple of cigarettes since then - but I don't feel the "urge". Feels great not to have this dependency. And I do not have the guilt for temporary "restarting" fallback. I never promised to "never ever" in the first place - so I did not violate any promises to myself. &lt;br /&gt;&lt;br /&gt;It's up to you to decide how much I practice what I preached here, whether to believe it or not, and whether it is better to &lt;b&gt;stop&lt;/b&gt; smoking than to &lt;b&gt;quit&lt;/b&gt; smoking. I'd be delighted to hear your results in the comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2484027551243668721?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2484027551243668721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2484027551243668721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2484027551243668721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2484027551243668721'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/how-to-quit-smoking.html' title='How to quit smoking ?'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6806536107627481129</id><published>2011-01-12T03:05:00.007+01:00</published><updated>2011-01-12T03:10:28.471+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ndpmon'/><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><title type='text'>Initial 802.1q trunk support for ndpmon</title><content type='html'>I've spent a few hours tonight to add a feature I wanted to &lt;a href="http://ndpmon.sourceforge.net/"&gt;NDPMon&lt;/a&gt; - make it be able to listen on trunk interfaces.&lt;br /&gt;&lt;br /&gt;1) only the monitoring part is supported for now, I did not even start&lt;br /&gt;looking to the counter-measures.&lt;br /&gt;&lt;br /&gt;2) "VLAN&amp;lt;n&amp;gt;:" is prepended to all the messages; "4095" signifying the&lt;br /&gt;untagged frames, the other numbers mean the vlan# in the tagged frame.&lt;br /&gt;&lt;br /&gt;3) obviously this is alpha - it can kill the newborn&lt;br /&gt;kitten, cause lightning strikes and do other outrageous things.&lt;br /&gt;&lt;br /&gt;If you're brave enough to mess around with it, head here:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/ayourtch/ndpmon-dot1q"&gt;https://github.com/ayourtch/ndpmon-dot1q&lt;/a&gt; and give it a shot in your lab.&lt;br /&gt;&lt;br /&gt;And then tell me something about your experiences.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6806536107627481129?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6806536107627481129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6806536107627481129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6806536107627481129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6806536107627481129'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/initial-8021q-trunk-support-for-ndpmon.html' title='Initial 802.1q trunk support for ndpmon'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3905208802362673905</id><published>2011-01-11T15:35:00.003+01:00</published><updated>2011-01-15T15:46:32.398+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>IPv6-only networks in Ubuntu &amp; co.</title><content type='html'>https://bugzilla.gnome.org/show_bug.cgi?id=556915 and https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/307598 are the ones to watch if you have an IPv6-only network and Linux nodes. The older versions of the network manager assumed that the network that did not have IPv4 is "broken". &lt;br /&gt;&lt;br /&gt;When I have a chance to test how this behaves in 10.10, I will update this entry.&lt;br /&gt;&lt;br /&gt;EDIT:&lt;br /&gt;&lt;br /&gt;10.10 has a much better knowledge of IPv6. So far I am pretty happy. To be tested is an IPv6-only network, but for that I need to install NAT64+DNS64, which I am not sure when I am able to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3905208802362673905?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3905208802362673905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3905208802362673905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3905208802362673905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3905208802362673905'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/ipv6-only-networks-in-ubuntu-co.html' title='IPv6-only networks in Ubuntu &amp; co.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6913679371967675454</id><published>2011-01-11T02:35:00.003+01:00</published><updated>2011-01-11T04:09:17.814+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><category scheme='http://www.blogger.com/atom/ns#' term='chrome'/><title type='text'>Random DNS requests from chrome / chromium</title><content type='html'>Was looking at the sniffer trace today and noticed that chromium on startup queries some seemingly random-looking names. Especially did not make a whole lot of sense that they are within the local domain.&lt;br /&gt;&lt;br /&gt;Turns out that this is this is Chrome &lt;a href="http://www.google.com/support/forum/p/Chrome/thread?tid=6df1207e9c52410a&amp;hl=en"&gt;dealing with the ISPs who show ads for nonexistent domain names&lt;/a&gt; - if you do a single-word query, then Chrome looks it up in DNS, in the assumption that you were trying to reach your local server, and if the resolution succeeds, then it offers you "Did you mean ...?" popup at the top.&lt;br /&gt;&lt;br /&gt;Obviously, if the ISP is hijacking the NXDomain, you will get "Did you mean ?" for *every* single-word query, which would be disappointing - so in case Chrome can make the requests to those "random names" (and I've verified that by installing a local wildcard DNS server + a web server on the box) - then it stops both the strange-looking DNS requests and the "did you mean ...?" popup.&lt;br /&gt;&lt;br /&gt;EDIT: looks like I was too fast to judge that the "did you mean ...?" popup disappears - after some use, in fact it does not. OTOH, maybe there is some additional cleverness involved in Chrome's behavior - because I merely return the default lighttpd page to it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6913679371967675454?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6913679371967675454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6913679371967675454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6913679371967675454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6913679371967675454'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/random-dns-requests-from-chrome.html' title='Random DNS requests from chrome / chromium'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8165442630466327913</id><published>2011-01-10T03:57:00.006+01:00</published><updated>2011-01-10T04:21:35.292+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The dusk</title><content type='html'>The dusk. The eyes do not adapt yet to the darkness that is blending its way in. Like in a bath that is cooling itself down, you don't realize when exactly does it get cold. When you do - it's already because of the tremolo of the teeth, it's too late. Or was it because you were slightly tired and fell asleep ? &lt;br /&gt;&lt;br /&gt;Sleep is a treat - you get to appreciate it only when you lose it or can't have enough of it. Falling into momentary clouds of pleasure too strange to describe, only to jump out of it again less than a minute later. You know you should not, but it's irresistible to try again. Your eyelids drag you - stronger and stronger, until you give in again for a short blackout. And you're back. &lt;br /&gt;&lt;br /&gt;The world is happily doing without you. Or so it seems. Did it get darker or you're just being self-centric ? It surely did get darker. But it's only one of the cycles. Don't take this personally. Better mind the damn steering wheel - you're on the road.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8165442630466327913?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8165442630466327913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8165442630466327913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8165442630466327913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8165442630466327913'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/dusk.html' title='The dusk'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1499414540791668246</id><published>2011-01-09T17:12:00.004+01:00</published><updated>2011-01-09T17:32:48.202+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>Higher order functions as a building block for readable code</title><content type='html'>If you use a language like Ruby it's trivially easy to make DSLs and all this sweet-looking meta-programming stuff - you're lucky to be close enough to Lisp so you get the code that you can tweak the code before it's run. (&lt;b&gt;attr_accessor&lt;/b&gt;, for example, is conceptually nothing more than a macro that expands into the reader and writer methods).&lt;br /&gt;&lt;br /&gt;In Lua, you do not have that luxury. Well, you can have - if you install &lt;a href="http://metalua.luaforge.net/manual000.html"&gt;Metalua&lt;/a&gt;. But for my purposes this is usually a bit of using a nuke to shoot the pigeons. I want to minimize the number of dependencies - consequently, I try to rely on the stock 5.1 install as much as possible. &lt;br /&gt;&lt;br /&gt;So, how does higher order functions help, you not getting a chance to do a "meta" code run ?&lt;br /&gt;&lt;br /&gt;Because they allow the deferred execution. &lt;br /&gt;&lt;br /&gt;This is a trick I used with this construct in &lt;a href="https://github.com/ayourtch/gliese"&gt;gliese&lt;/a&gt;: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mongrel2connect {&lt;br /&gt;  sender_id = '558c92aa-1644-4e24-a524-39baad0f8e78',&lt;br /&gt;  sub_addr = 'tcp://127.0.0.1:8989',&lt;br /&gt;  pub_addr = 'tcp://127.0.0.1:8988',&lt;br /&gt;&lt;br /&gt;  -- Routing &lt;br /&gt;&lt;br /&gt;  get { "/", default_page, params = {&lt;br /&gt;       test = { optional },&lt;br /&gt;     }&lt;br /&gt;  },&lt;br /&gt;  get { "/foo", foo_page, params = {&lt;br /&gt;       test = { mandatory },&lt;br /&gt;     }&lt;br /&gt;  },&lt;br /&gt;  -- Anything else just redirect to root&lt;br /&gt;  get { ".*", redirect_request_to("/") },&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;mongrel2connect is a "real" function (the one that actually gets called and runs the loop servicing the requests)&lt;br /&gt;&lt;br /&gt;whereas the "get" is the higher-order function. It returns a function that can be used to match the request against the supplied pattern to see if it is routable to the handler, and as well to check the parameters.&lt;br /&gt;&lt;br /&gt;So, while the arguments for the mongrel2connect are calculated &lt;b&gt;before&lt;/b&gt; the call to that happens, they can be used afterwards - thanks to the fact that the arguments do not do any action - but merely return the code to do the action.&lt;br /&gt;&lt;br /&gt;This is a neat trick that allows me to make very readable code (at least for me:-) - essentially a DSL that you squeeze into a Lua table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1499414540791668246?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1499414540791668246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1499414540791668246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1499414540791668246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1499414540791668246'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/higher-order-functions-as-building.html' title='Higher order functions as a building block for readable code'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3902231762439259326</id><published>2011-01-07T03:40:00.003+01:00</published><updated>2011-01-07T03:54:59.027+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='note-to-self'/><category scheme='http://www.blogger.com/atom/ns#' term='search'/><title type='text'>N-gram and regex search</title><content type='html'>So, I was thinking about the regex search in large volumes of data, and realized this should not be too hard to do. What do we do for a "usual" search: build an inverted index of stemmed words, and then match that with the query and intersect the word posting lists.&lt;br /&gt;&lt;br /&gt;Now, imagine instead of words, we use the ngrams. Ok, here we have a little bit of a problem because if we are searching on "foobar" and we matched "foo" and "bar" we need to ensure they are also adjacent in the documents found. But, this should not be a big deal.&lt;br /&gt;&lt;br /&gt;Now the interesting part. I am searching for a regex. Instead of matching the inverted index ngrams against the query string, I need to do something more clever. Let's pretend we have the regex implemented in terms as a DFA. A given ngram is suitable for the selection to begin with if it can result in valid transitions of the DFA. So for each of the states we can try to run the ngram against the DFA and see what gives. If this ngram does not give the good match, we discard it outright. If it does work - we store the acceptable chain of states.&lt;br /&gt;&lt;br /&gt;Note that a single ngram might fire up more than once on a given regex - so we end up storing quite a few of possibilities.&lt;br /&gt;&lt;br /&gt;Once we're done - we have a bunch of "broken chains" - because they are short. Now the task is to see if we can reconstruct the chain of the states from starting till ending one, and if we can - then this set of ngrams is a candidate set which can be used same as in the literal search onwards (e.g. in something like &lt;a href="http://qwik.jp/senna/"&gt;http://qwik.jp/senna/&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;The remaining question is what is the complexity of such a "glue" algorithm. The number of permutations to test can quickly become prohibitive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3902231762439259326?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3902231762439259326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3902231762439259326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3902231762439259326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3902231762439259326'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/n-gram-and-regex-search.html' title='N-gram and regex search'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6922829047275655370</id><published>2011-01-07T01:38:00.003+01:00</published><updated>2011-01-07T02:11:18.678+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sha1'/><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>What's in your name...</title><content type='html'>One of my friends expressed that she can not remember the names that sound pretty similar to her. I do have the same problem - and, as I learned a couple of times, at least my surname causes a similar stress in some folks.&lt;br /&gt;&lt;br /&gt;But, I remembered, it's been quite some time I was joking that replacing the names with SHA-1 hashes would be way more practical. &lt;br /&gt;&lt;br /&gt;Consider:&lt;br /&gt;&lt;br /&gt;1) SHA-1 hashes are all standard 40 bytes long hex numbers. This allows much more efficient storage of names in the databases and much more simplified input validation - it will be reduced to a trivial regex: /[0-9a-fA-F]{40}/ - and the input later on can be homogenized by lowercasing. &lt;br /&gt;&lt;br /&gt;2) There's enough hashes to give everyone a unique ID. 2^140 which forty characters make, is huge. Of course, we need this huge number to prevent the hash collisions.&lt;br /&gt;I should make the estimates of that a topic of a separate post.&lt;br /&gt;&lt;br /&gt;3) The cryptographic hash is going to have pretty good distribution of digits. Corollary from this - means that within your circle of friends you do not need the full 40 characters. Much like close friends do not call you by surname - and just call you by name.&lt;br /&gt;&lt;br /&gt;So, I've set out to look at (3) - because, obviously, the usability in this is paramount.&lt;br /&gt;&lt;br /&gt;Short result: amongst the 370 friends I have on facebook, if they were to use SHA-1 hash of their name instead of their "real name", just &lt;b&gt;five&lt;/b&gt; characters will be enough to uniquely identify all of them! This is even shorter than my own name!&lt;br /&gt;&lt;br /&gt;So, it is very promising.&lt;br /&gt;&lt;br /&gt;Here's how to do it in case you want to verify your own circle of friends (I take the facebook as an example).&lt;br /&gt;&lt;br /&gt;Go to http://developers.facebook.com/docs/api and click on the link next to the string "Friends: ". This will give you an ugly page full of JSON. Save it into file and go into the shell.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cat friends.json | sed -e 's/^.*\[//g' | sed -e 's/\].*$//g' | sed -e 's/[{}]*//g' | sed -e 's/,/\n/g' | sed -e '/^"id":.*$/d' | sed -e 's/"name"://g' &gt;names.txt&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now that we have a list of names, let's make hashes. Simplest is to create a short script to hash its argument:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo -n $1 | sha1sum&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And finally we output the file running the hash on each name, then cutting out the first few characters, and seeing how many collisions do we get:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ cat names.txt | xargs -n 1 sh hash | cut -c 1-3 | sort | uniq -c | grep -v '      1 '&lt;br /&gt;      2 2c3&lt;br /&gt;      2 3d5&lt;br /&gt;      2 4fe&lt;br /&gt;      2 6ef&lt;br /&gt;      2 b32&lt;br /&gt;      2 b52&lt;br /&gt;      2 b7e&lt;br /&gt;      2 c78&lt;br /&gt;      2 c9f&lt;br /&gt;      2 d6f&lt;br /&gt;      2 e42&lt;br /&gt;      2 e6f&lt;br /&gt;      2 f69&lt;br /&gt;      2 ff5&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, with just three(!!!) characters of the hash there only a handful collisions.&lt;br /&gt;Using couple more characters eliminates them and as well gives an ample room for a collision-free growth of my friend list.&lt;br /&gt;&lt;br /&gt;And maybe now you get an idea why at the top of the page there's this row of hex, to begin with.&lt;br /&gt;&lt;br /&gt;I think using the hashes instead of name is indeed much more practical than trying to remember the names - c3e9f, do you agree ? ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6922829047275655370?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6922829047275655370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6922829047275655370' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6922829047275655370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6922829047275655370'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/whats-in-your-name.html' title='What&apos;s in your name...'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6323708827918313907</id><published>2011-01-04T17:32:00.003+01:00</published><updated>2011-01-04T17:36:55.347+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dilbert'/><title type='text'>Ivory tower gurus...</title><content type='html'>I've seen this Dilbert in &lt;a href="http://blog.ioshints.info/2010/12/it-oldtimers-aka-gurus-from-ivory.html"&gt;this IOSHints blog entry&lt;/a&gt;, here's what I think:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://beta.stdio.be/guru.gif"&gt;&lt;br /&gt;&lt;br /&gt;(I wish I could write about memory, layers of indirections, and such - but there was only so much space).&lt;br /&gt;&lt;br /&gt;Why do people think that politicians need to learn history, but the technologists do not ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6323708827918313907?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6323708827918313907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6323708827918313907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6323708827918313907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6323708827918313907'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/ivory-tower-gurus.html' title='Ivory tower gurus...'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2765973271493452512</id><published>2011-01-02T18:54:00.003+01:00</published><updated>2011-01-02T18:58:46.400+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scapy'/><title type='text'>correct scapy2 import statement</title><content type='html'>Problem:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; from scapy import all&lt;br /&gt;&gt;&gt;&gt; a = IP()&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "&lt;stdin&gt;", line 1, in &lt;module&gt;&lt;br /&gt;NameError: name 'IP' is not defined&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;try:from scapy.all import * #Required for Scapy 2.0 and above&lt;br /&gt;except:from scapy import * #Scapy 1.0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;(via &lt;a href="http://article.gmane.org/gmane.comp.security.scapy.general/3379"&gt;Tim Eberhard's post&lt;/a&gt;. On a side note, here's a &lt;a href="https://bugs.launchpad.net/ubuntu/+source/scapy/+bug/397836"&gt;pretty uselessly closed bugreport&lt;/a&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2765973271493452512?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2765973271493452512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2765973271493452512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2765973271493452512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2765973271493452512'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/correct-scapy2-import-statement.html' title='correct scapy2 import statement'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3907107607948665662</id><published>2011-01-01T21:18:00.005+01:00</published><updated>2011-01-01T22:39:15.556+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongrel2'/><title type='text'>Mongrel2 and SSL</title><content type='html'>Mongrel2 supports SSL. Well, actually TLS, to be exact. To be running it you need a version with &lt;a href="http://mongrel2.org/info/ffb6d1643d"&gt;the small fix&lt;/a&gt; that disables the default built-in key during axTLS' SSL context initialization. &lt;br /&gt;&lt;br /&gt;There are two steps you need to do to get your server support TLS-encrypted connections:&lt;br /&gt;&lt;br /&gt;1) edit the config file&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;main = Server(&lt;br /&gt;    uuid="f400bf85-4538-4f7a-8908-67e313d515c2",&lt;br /&gt;. . . [snip]&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;servers = [main]&lt;br /&gt;&lt;br /&gt;&lt;font color="green"&gt;&lt;b&gt;settings = {&lt;br /&gt;  "f400bf85-4538-4f7a-8908-67e313d515c2.use_ssl": 1,&lt;br /&gt;  "certdir": "./certs/"&lt;br /&gt;}&lt;br /&gt;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Needless to say that the plaintext will no longer work on this server entry.&lt;br /&gt;&lt;br /&gt;2) generate the private key and obtain a certificate&lt;br /&gt;&lt;br /&gt;This is something that is widely covered on the Net. If you want to install a self-signed cert for testing, there is a good doc &lt;a href="http://www.akadia.com/services/ssh_test_certificate.html"&gt;that describes&lt;/a&gt; how to do it.&lt;br /&gt;&lt;br /&gt;The key mongrel2-specific part here is that the private key file is named &lt;b&gt;&amp;lt;Server-UUID&gt;.key&lt;/b&gt;, and the certificate is in the file &lt;b&gt;&amp;lt;Server-UUID&gt;.crt&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(note: a "private" key is called private for a reason. You do not want anyone except the mongrel2 to be able to read it. So, mind your permissions).&lt;br /&gt;&lt;h2&gt;For the lazy&lt;/h2&gt;I've added a sample static SSL site as well to &lt;a href="https://github.com/ayourtch/m2hbox"&gt;Mongrel2 Hacking In a Box&lt;/a&gt; repository.&lt;br /&gt;It has a canned config, also a pre-generated dummy key and cert, as well as a script to regenerate them.&lt;br /&gt;&lt;br /&gt;Happy hacking!&lt;br /&gt;&lt;br /&gt;Edit:&lt;br /&gt;&lt;br /&gt;If you are trying with chrom(e|ium), chances are that it would not work correctly - at least it did not work for me. Seems like it is a bug in the built-in SSL library which does not want to do TLS1.0, only SSL3.0. To cure this, you need to launch the chrom(e|ium) so that it uses the system SSL library:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ chromium-browser --use-system-ssl&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Notably, it was not always that I experienced this failure - the problem did is not reproducible enough to debug it for now. If you find anything - let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3907107607948665662?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3907107607948665662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3907107607948665662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3907107607948665662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3907107607948665662'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2011/01/mongrel2-and-ssl.html' title='Mongrel2 and SSL'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8397375858723696973</id><published>2010-12-31T03:46:00.004+01:00</published><updated>2010-12-31T03:52:39.143+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Installing VMWare ESXi CLI on ubuntu 10.04</title><content type='html'>&lt;a href="http://communities.vmware.com/message/1359703"&gt;This post in forums&lt;/a&gt;  and &lt;a href="http://communities.vmware.com/message/1490182"&gt;this post in forums&lt;/a&gt; had proved to be quite useful while sorting out the things.&lt;br /&gt;&lt;br /&gt;The magic sequence that seems to have made the vmware CLI work on my ubuntu 10.04:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo apt-get install libssl-dev &lt;br /&gt;sudo apt-get install libxml-libxml-perl&lt;br /&gt;sudo apt-get install libclass-methodmaker-perl&lt;br /&gt;sudo apt-get install libcrypt-ssleay-perl&lt;br /&gt;sudo apt-get install libio-zlib-perl&lt;br /&gt;sudo apt-get install libio-compress-perl&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8397375858723696973?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8397375858723696973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8397375858723696973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8397375858723696973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8397375858723696973'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/12/installing-vmware-esxi-cli-on-ubuntu.html' title='Installing VMWare ESXi CLI on ubuntu 10.04'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7568170872657015599</id><published>2010-12-30T03:07:00.002+01:00</published><updated>2010-12-30T03:08:52.976+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongrel2'/><title type='text'>testv6.stdio.be pilot on mongrel2</title><content type='html'>Finally today I moved in pilot mode the testv6.stdio.be site (IPv6 brokenness test) to use the mongrel2.&lt;br /&gt;&lt;br /&gt;The code for the ipv6 test site is in the git repository for gliese (with tiny differences like ports, etc.)&lt;br /&gt;&lt;br /&gt;Let's see how it fares.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7568170872657015599?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7568170872657015599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7568170872657015599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7568170872657015599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7568170872657015599'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/12/testv6stdiobe-pilot-on-mongrel2.html' title='testv6.stdio.be pilot on mongrel2'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3255003440646952479</id><published>2010-12-28T01:49:00.003+01:00</published><updated>2011-01-02T06:38:41.875+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongrel2'/><title type='text'>How to install Mongrel2 on Ubuntu with little pain</title><content type='html'>This post is about installing the latest and greatest of Mongrel2. Moreover - it is biased towards my needs (e.g. Mongrel2 repository automatically exported into git repository from fossil in the process of installation - because I am used to git more; as well as installs my gliese framework and dependencies.)&lt;br /&gt;&lt;br /&gt;With that disclaimer, here is the magic link:&lt;br /&gt;&lt;br /&gt;https://github.com/ayourtch/gliese/raw/master/examples/m2-dist/install&lt;br /&gt;&lt;br /&gt;what you need to do is wget this file and then run it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;wget --no-check-certificate https://github.com/ayourtch/gliese/raw/master/examples/m2-dist/install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Certificate check is disabled because wget seems to dislike the wildcard cname in the cert. Alas.&lt;br /&gt;&lt;br /&gt;When you download this file, run it - "sh ./install".&lt;br /&gt;&lt;br /&gt;The first batch is a lot of packages that are installed via apt-get, and it will prompt for the sudo password.&lt;br /&gt;&lt;br /&gt;After that bunch of packages/software are downloaded in source form - namely: zeromq, redis, fossil, mongrel2 and the associated lua libraries from github.&lt;br /&gt;&lt;br /&gt;When the installation has finished, you can test it:&lt;br /&gt;&lt;br /&gt;"cd dist/lua/gliese/examples/m2-site; sh run-all-in-screen"&lt;br /&gt;&lt;br /&gt;and then connect with the browser to http://localhost:6767/lua1 - this will present you a small dynamic page with the counter stored in redis. This allows to see that all the components are installed and are functional. &lt;br /&gt;&lt;br /&gt;If you want to hack on mongrel2 - then feel free to poke in mongrel2-git directory - that one contains the git repository autoconverted from fossil in the process of install. I liked fossil a lot - but just got used to git more, so that's the reason I do it in this script.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3255003440646952479?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3255003440646952479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3255003440646952479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3255003440646952479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3255003440646952479'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/12/how-to-install-mongrel2-on-ubuntu-with.html' title='How to install Mongrel2 on Ubuntu with little pain'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3877136776835202821</id><published>2010-12-08T19:43:00.005+01:00</published><updated>2010-12-12T21:39:36.314+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongrel2'/><title type='text'>Building Mongrel2 on ARM architecture</title><content type='html'>The past weekend I got mongrel2 to build and on my sheevaplug. Not really rocket science, but in case anyone is interested or has some more experience (more on that in the end of the post), I'll document what I did.&lt;br /&gt;&lt;br /&gt;First thing - installing the prerequisites, that was easy, just apt-get them - same as anywhere else.&lt;br /&gt;&lt;br /&gt;So, then I kick off the make and get:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cc -g -O2 -Wall -Isrc -DNDEBUG    -c -o src/task/context.o src/task/context.c&lt;br /&gt;src/task/context.c: In function 'makecontext':&lt;br /&gt;src/task/context.c:97: error: 'mcontext_t' has no member named 'gregs'&lt;br /&gt;src/task/context.c:101: error: 'mcontext_t' has no member named 'gregs'&lt;br /&gt;src/task/context.c:102: error: 'mcontext_t' has no member named 'gregs'&lt;br /&gt;make: *** [src/task/context.o] Error 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This does not look cool. Let's see the offending part of the code in src/task/context.c:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#ifdef NEEDARMMAKECONTEXT&lt;br /&gt;void makecontext(ucontext_t *uc, void (*fn)(void), int argc, ...)&lt;br /&gt;{&lt;br /&gt;    int i, *sp;&lt;br /&gt;    va_list arg;&lt;br /&gt;&lt;br /&gt;    sp = (int*)uc-&gt;uc_stack.ss_sp+uc-&gt;uc_stack.ss_size/4;&lt;br /&gt;    va_start(arg, argc);&lt;br /&gt;&lt;br /&gt;    for(i=0; i&lt;4 &amp;&amp; i&lt;argc; i++) {&lt;br /&gt;        uc-&gt;uc_mcontext.gregs[i] = va_arg(arg, uint);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    va_end(arg);&lt;br /&gt;    uc-&gt;uc_mcontext.gregs[13] = (uint)sp;&lt;br /&gt;    uc-&gt;uc_mcontext.gregs[14] = (uint)fn;&lt;br /&gt;}&lt;br /&gt;#endif&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Okay, this is not too shabby - means this is an ARM-specific code. But, if this is ARM-specific code - how comes that we have a mismatch for the type ? And why do we need this code to begin with - "man makecontext" shows it there ? Quick Google search shows the makecontext is not defined on the ARM architectures, obsoleted API, bla bla bla. Anyway let's test what do they mean by "not defined" with a dumb app.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ayourtch@ubuntu:~/test$ cat test.c&lt;br /&gt;#include &lt;ucontext.h&gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[]) {&lt;br /&gt;  makecontext(0, 0, 0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ayourtch@ubuntu:~/test$ gcc test.c&lt;br /&gt;/tmp/ccOO8Fqq.o: In function `main':&lt;br /&gt;test.c:(.text+0x24): warning: warning: makecontext is not implemented and will always fail&lt;br /&gt;ayourtch@ubuntu:~/test$ gdb a.out&lt;br /&gt;GNU gdb 6.8-debian&lt;br /&gt;Copyright (C) 2008 Free Software Foundation, Inc.&lt;br /&gt;License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;&lt;br /&gt;This is free software: you are free to change and redistribute it.&lt;br /&gt;There is NO WARRANTY, to the extent permitted by law.  Type "show copying"&lt;br /&gt;and "show warranty" for details.&lt;br /&gt;This GDB was configured as "arm-linux-gnueabi"...&lt;br /&gt;(gdb) disass makecontext&lt;br /&gt;Dump of assembler code for function makecontext:&lt;br /&gt;0x000082e8 &lt;makecontext+0&gt;:     add     r12, pc, #0     ; 0x0&lt;br /&gt;0x000082ec &lt;makecontext+4&gt;:     add     r12, r12, #32768        ; 0x8000&lt;br /&gt;0x000082f0 &lt;makecontext+8&gt;:     ldr     pc, [r12, #3368]!&lt;br /&gt;End of assembler dump.&lt;br /&gt;(gdb)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Okay, surely they really mean it - this code seems indeed like just a plug. No-one's home. At least we have a warning. So what they say on the interwebs is true, and that's why we're dragging this ARM-only function implementation.&lt;br /&gt;&lt;br /&gt;Let's take a look at where this structure is defined.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ grep -R -A 10 mcontext_t /usr/include&lt;br /&gt;/usr/include/sys/ucontext.h:typedef struct sigcontext mcontext_t;&lt;br /&gt;/usr/include/sys/ucontext.h:    mcontext_t uc_mcontext;&lt;br /&gt;/usr/include/signal.h:/* This will define `ucontext_t' and `mcontext_t'.  */&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This structure defines the mcontext_t as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;typedef struct sigcontext mcontext_t;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the sigcontext is defined in /usr/include/asm/sigcontext.h:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        unsigned long trap_no;&lt;br /&gt;        unsigned long error_code;&lt;br /&gt;        unsigned long oldmask;&lt;br /&gt;        unsigned long arm_r0;&lt;br /&gt;        unsigned long arm_r1;&lt;br /&gt;        unsigned long arm_r2;&lt;br /&gt;        unsigned long arm_r3;&lt;br /&gt;        unsigned long arm_r4;&lt;br /&gt;        unsigned long arm_r5;&lt;br /&gt;        unsigned long arm_r6;&lt;br /&gt;        unsigned long arm_r7;&lt;br /&gt;        unsigned long arm_r8;&lt;br /&gt;        unsigned long arm_r9;&lt;br /&gt;        unsigned long arm_r10;&lt;br /&gt;        unsigned long arm_fp;&lt;br /&gt;        unsigned long arm_ip;&lt;br /&gt;        unsigned long arm_sp;&lt;br /&gt;        unsigned long arm_lr;&lt;br /&gt;        unsigned long arm_pc;&lt;br /&gt;        unsigned long arm_cpsr;&lt;br /&gt;        unsigned long fault_address;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As such, we need to adjust the code accordingly - to use the arm_XXX named members instead of the array (but array was so convenient!)&lt;br /&gt;&lt;br /&gt;After this we can compile everything, but alas, the segfault happens at the very first test. &lt;br /&gt;&lt;br /&gt;Why ? Because the libtask's ARM definition of mcontext_t assumes starting with R0 content - but on sheevaplug I can see 12 bytes of other content in front.&lt;br /&gt;&lt;br /&gt;My first attempt was to modify the assembler code, to add 12 to the structure pointer on use - but in the end I came up with I think a (slightly) better approach - instead of passing the address of the mcontext_t structure, on the ARM architecture I pass the address of the R0 member withiin the structure, typecasting it to (void *).&lt;br /&gt;&lt;br /&gt;This avoids the need to dig into assembler code.&lt;br /&gt;&lt;br /&gt;Now I can successfully run mongrel2 on sheevaplug.&lt;br /&gt;&lt;br /&gt;However, this leaves me with the question:&lt;br /&gt;&lt;br /&gt;Inevitably, the original code ran on *some* ARM. So if the code with the diff from http://mongrel2.org/info/3f79a05147 broke the build for you - let me know, so we can fix it properly for everyone - I do not have other hardware.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3877136776835202821?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3877136776835202821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3877136776835202821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3877136776835202821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3877136776835202821'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/12/building-mongrel2-on-arm-architecture.html' title='Building Mongrel2 on ARM architecture'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5509217491393856400</id><published>2010-11-23T19:06:00.002+01:00</published><updated>2010-11-23T22:26:46.251+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apt'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Disable HTTP pipelining in Ubuntu</title><content type='html'>Mostly a note to self so I do not have to work to find it next time.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;echo 'Acquire::http::Pipeline-Depth "0";' &gt;&gt; /etc/apt/apt.conf.d/00no-pipeline&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;(EDIT: the title seems to suggest it is a 'generally good idea' to do it - no, it is not. It's a workaround.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5509217491393856400?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5509217491393856400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5509217491393856400' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5509217491393856400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5509217491393856400'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/11/disable-http-pipelining-in-ubuntu.html' title='Disable HTTP pipelining in Ubuntu'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3343882888338996795</id><published>2010-10-20T00:12:00.007+02:00</published><updated>2010-10-20T01:47:31.611+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The justice</title><content type='html'>It's Friday. The week is over. Stu liked Fridays. Because they aired his favourite show on the WTV - "The perfect crime". Every week they'd pick up one of the cases where the jury failed to find the consensus - and rerun it on air live. And collect the instant responses from the audience to make the verdict based on the simple majority. The direct democracy: crowd wisdom at its best. The audience would make a decision whether the person goes into the recycler or not. There were thousands of the replies - one can't be wrong with such a sample. But still the result was uncertain each time until the last moment. He liked the tingling sensation these shows would bring - it reminded him the good old times before the machines took it away from him. &lt;br /&gt;&lt;br /&gt;He was a skyscraper window washer. He was not in it for the windows - it was that tingle sensation that attracted him. He mastered the corner wipe better than everyone and was rightfully proud of his skill. But he could not compete with the machines - they were cheaper - did not require insurance and would never make mistakes, except when mis-programmed. He helped the geeks who came with the machines to hone their skills, but being the cyber-shepherd was not for him, so he moved on to become an instructor in the local climbing club and opened a little food shop in the ground floor of his house. But all of that was not the same - and that's why he liked Fridays.&lt;br /&gt;&lt;br /&gt;Today's case promised to be interesting. It was an investigation into an accident that was suspected to have been cooked. The defendant, a young woman, was fully aware she was the only available suspect - and has already told her story. She was visibly nervous, but in her last words she said that she firmly believed that the nation will judge her right. Because it was not her.&lt;br /&gt;&lt;br /&gt;Something in her tone, in the way she was talking, made Stu believe she was a victim of the circumstances. He usually would not press the button during the shows - but today he had a feeling he probably should. Even though almost every time they'd say something to try to convince the public. But this time it was different.&lt;br /&gt;&lt;br /&gt;The noise of the broken glass downstairs. Not good - need to check. There's been a few burglaries lately in the neighborhood - someone said it was the gang of homeless, the others claimed it was the underground communist cell refilling the replenished reserves. And this of course had to happen just today, when he had blown off the fuse. Sigh. Got to take a flashlight.&lt;br /&gt;&lt;br /&gt;The quick inspection of the door revealed nothing suspicious. Windows - intact as well.   The dietary supplements corner revealed the truth. Some visitor had smelled the Valerian and did not properly close it. Flasky, his cat, took this upon himself to fix this - of course, smashing all the rest of the glass in ecstatic joy. So all of that noise was for nothing, after all. The damn animal had just spoiled a nice evening in front of the TV. Stu collected the glass and put it into the bin. Hopefully he can make it in time to at least see the result.&lt;br /&gt;&lt;br /&gt;As he was climbing the stairs, he heard the polished voice of the host - "Thank you. Thank you to all who participated in today's poll. The decision was extremely hard for you - the difference is only one vote! But you voiced your opinion, the nation of Tivyland. And the verdict is: Guilty".&lt;br /&gt;&lt;br /&gt;Damn cat, he mumbled. Should have listened to Johnny and sterilized it. Gonna do that on Monday. He went on to his fridge and wrote in the planner attached to it, right where the hearts of weekend were turning back into the spades: "Take care of Flasky". &lt;br /&gt;&lt;br /&gt;Then he opened the fridge and took another beer. He still had an untouched six-pack and Friday evening was just beginning. There were still some other good shows later on tonight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3343882888338996795?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3343882888338996795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3343882888338996795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3343882888338996795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3343882888338996795'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/10/justice.html' title='The justice'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7476080818304179547</id><published>2010-10-18T21:00:00.003+02:00</published><updated>2010-10-18T22:14:40.484+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The good news</title><content type='html'>Torro was unlike his mates. He was not excited by those of the boys' games that favored the hesitation of choice in them. What he was fascinated with was having a purpose for himself. He excelled at going towards the goal, rushing to the finish line and blowing past it, tearing the ribbon apart. He was the winner, and the world treated him accordingly - he'd always be in the hot spot of attention. Why was he like this ? Probably the adrenaline rush. Probably the ego. Probably the taste of the fruits of fame. Probably all together. &lt;br /&gt;&lt;br /&gt;Bruna lived for today and now. She did not hurry - why rushing past ? It's like going on the express train through the summer forest - all you get is the branches hitting your face and the locomotive smoke. Jump off, close your eyes - can you hear that nightingale ? Wait until the tar dissolves and fall onto the ground - can you smell the strawberries ? You may have forgotten it - because none of the supermarkets can recreate this smell, no matter how hard they try. It dies off as soon as it hits the civilization - getting yourself out of it is the only way to experience it.&lt;br /&gt;&lt;br /&gt;- "Hey, Bernie, check this out - "&lt;br /&gt;- "What ?"&lt;br /&gt;- "The news says, down there in Europe, they've forbidden the bull fights"&lt;br /&gt;- "Did they allow the bull fights to begin with ?"&lt;br /&gt;- "Yeah, looks like they did."&lt;br /&gt;- "That's silly. Torturing the poor animals."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7476080818304179547?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7476080818304179547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7476080818304179547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7476080818304179547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7476080818304179547'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/10/good-news.html' title='The good news'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3641796243734087070</id><published>2010-10-17T04:28:00.002+02:00</published><updated>2010-10-17T05:08:55.999+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>Theseus</title><content type='html'>The plane was about to land. The landscape underneath was all squares. They were mesmerizing in their proximity - feels like they are all so close, just a couple of meters away, he could not stop looking at them. This has been his favorite nightmare of all the times - inexplicable and personal, like all the nightmares are. The squares which are at an arms' length and at the same time so far that it feels frightening. He was not afraid of height, but this was not about the height - it was about the strange, magical power of the uncertainty. When he was a little kid, he would imagine throwing the ball at these squares, and whenever the ball bounced, he knew the squares were close and small - not those huge ones that are kilometers away that he was afraid of - then he would go to sleep again. &lt;br /&gt;&lt;br /&gt;Today was different - it was window behind him and the squares, so he could not use his trick to understand where they are - and this filled him with the anxiety. Hopefully the pilot does know how high they are. And it better be those huge ones far away - otherwise there's no time even to take the position that they show during the briefing in the beginning of the flight. He remembered it was resembling the fetal position, as much as the safety belts permitted it. Maybe worth doing that just in case - but if his feeling about the height was wrong then it would look embarrassingly stupid.&lt;br /&gt;&lt;br /&gt;Like that guy that ran with all his belongings when the fire alarm falsely rang in the middle of the night. He chuckled. In any case, if the plane would have slammed the ground, not a whole lot of the positions would help. Someone cynical once told him that the sole purpose of these positions in the airplane was to preserve the jawbones as intact as possible during the accident - then it is easier to identify the passengers, by their teeth. Like archaeologists do. Screw that, no one is waiting on either side of the route - so whether they would be able to assemble the teeth or not, does not really matter. They'll find it from the engraved label on his luggage, if they want. &lt;br /&gt;&lt;br /&gt;Strangely, he was not afraid of the magical squares anymore - the nightmare becoming the only hope. He lost the count of time - maybe it was a second, maybe ten minutes - the time went its own ways, independent of him - it felt like an eternity. Finally he felt the shock of the wheels hitting the ground. Landed. So, it was all right after all.&lt;br /&gt;&lt;br /&gt;The noise woke her up and she lifted her head - he was sitting on the floor, staring into the carpet. The carpet was a childhood present to her - gentle gray wool, with squared ornament. She liked it, it reminded her of labyrinth, from the favorite book of hers - the legend where the Theseus killed the Minotaur. That was how she met him - he reminded her of Theseus. &lt;br /&gt;&lt;br /&gt;- "What's the matter, darling ?"&lt;br /&gt;- "Nothing. I just fell on the floor. Sorry to have waken you up."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3641796243734087070?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3641796243734087070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3641796243734087070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3641796243734087070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3641796243734087070'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/10/theseus.html' title='Theseus'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5479846707770960882</id><published>2010-10-12T10:31:00.004+02:00</published><updated>2010-10-12T10:33:46.799+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='outlook'/><title type='text'>Disable HTML in Outlook</title><content type='html'>More of a note to myself really. &lt;br /&gt;&lt;br /&gt;Two steps:&lt;br /&gt;&lt;br /&gt;1) Tools =&gt; Options =&gt; Mail format ; "Compose in this message format" - set to "plain text".&lt;br /&gt;&lt;br /&gt;This makes all newly composed messages show as plaintext.&lt;br /&gt;&lt;br /&gt;2) Tools =&gt; Trust center =&gt; Read all standard email in plain text.&lt;br /&gt;&lt;br /&gt;This makes messages you receive show as plaintext.&lt;br /&gt;&lt;br /&gt;Oh, and probably uncheck the scripts, while you are on the latter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5479846707770960882?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5479846707770960882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5479846707770960882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5479846707770960882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5479846707770960882'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/10/disable-html-in-outlook.html' title='Disable HTML in Outlook'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5241054622301539554</id><published>2010-10-08T16:42:00.003+02:00</published><updated>2010-10-08T16:54:54.032+02:00</updated><title type='text'>Airfoil. ASCII.</title><content type='html'>Read on HN about the http://xkcd.com/803/ with the comment "What's the correct answer ?"&lt;br /&gt;&lt;br /&gt;I think it is this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;                                                &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                                   ^  counterforce &lt;br /&gt;                                                   |   lifts the plane&lt;br /&gt;                                                   |&lt;br /&gt;                                                   +&lt;br /&gt;                                                         /---  &lt;-- this is a wing&lt;br /&gt;  spits hot pollutants &lt;===[engine]===&gt; counterforce /---&lt;br /&gt;                                     pushes      /---&lt;br /&gt;                                  forward    /---  &lt;br /&gt;                                         /---      +---- &lt;=== air hits &lt;br /&gt;                                                   |         this direction&lt;br /&gt;                                                   |&lt;br /&gt;                                                   |&lt;br /&gt;                                                   v air&lt;br /&gt;                                              bounces down&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The drawing is imprecise. I welcome you to spot the places where it is.&lt;br /&gt;&lt;br /&gt;But it should be correct in principle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5241054622301539554?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5241054622301539554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5241054622301539554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5241054622301539554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5241054622301539554'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/10/airfoil-ascii.html' title='Airfoil. ASCII.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8656771999957415121</id><published>2010-09-02T13:29:00.004+02:00</published><updated>2010-09-02T14:13:32.331+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><title type='text'>"This august had 5 sundays, 5 mondays, 5 tuesdays..."</title><content type='html'>"...and this event takes place every 823 years..." - said the fb update of one of my friends. This meme had then a viral clause attached to it so to ensure its replication - something about money, happiness and all that.&lt;br /&gt;&lt;br /&gt;However, it's not the viral clause that caught my attention - but, rather, the "takes place every 823 years" part of the meme, which looked suspiciously fishy - and I decided to make a quick write-up as an after-lunch exercise.&lt;br /&gt;&lt;br /&gt;Intuitively, it is simple to see that every August will have 5 of *some* three consecutive days of the week - simply because there are 31 days in august, and there are 7 days in a week - and 31 modulo 7 is three. And the days are consecutive - so this leaves us with 7 combinations of "triples".&lt;br /&gt;&lt;br /&gt;The number of days modulo 7 from the "previous august" will give us the shift within days of the week year-over-year. For an ordinary year, it's 1 day (365%7), and for a leap year it is 2 days.&lt;br /&gt;&lt;br /&gt;So, if we have the five of sunday-monday-tuesday this august, then the next occurence will be in 2016. If it was not a leap year - then we "overshoot" the target, and need to walk another 6 years. So the next occurence will be in 2021 (11 years after).&lt;br /&gt;&lt;br /&gt;Then in 2027 (6 years), 2032 (5 years), 2038 (6 years), 2049 (11 years), 2055 (6 years), 2060 (5 years), 2066 (6 years), 2077 (11 years), and so on.&lt;br /&gt;&lt;br /&gt;With the differences forming a nice series: 11-6-5-6-11-...&lt;br /&gt;&lt;br /&gt;The period of this sequence is 28 == 11+6+5+6. Which happens to be divisible by 7 (number of days of week in a week) and by 4 (The usual interval between the leap years).&lt;br /&gt;&lt;br /&gt;We did not take into the account the years of 2100, 2200, 2300, 2400 - I leave it as an exercise to the reader.&lt;br /&gt;&lt;br /&gt;In conclusion - this was a well-crafted meme. It had not one but two replication mechanisms, that were targeting different people. I guess I can say I fell the prey of it. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8656771999957415121?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8656771999957415121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8656771999957415121' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8656771999957415121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8656771999957415121'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/09/this-august-had-5-sundays-5-mondays-5.html' title='&quot;This august had 5 sundays, 5 mondays, 5 tuesdays...&quot;'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2346254187082877288</id><published>2010-08-25T01:19:00.005+02:00</published><updated>2010-08-25T01:24:41.859+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ocr'/><title type='text'>OCR for business cards' photos</title><content type='html'>I've been curious to try and do the character recognition on the photos of a few of the business cards that I made during the IETF (since otherwise the business cards turn into dust in my jeans' pockets - it was a much better option to make photos).&lt;br /&gt;&lt;br /&gt;I've tried gocr, tesseract and the demo version of abbyyocr. The results were pretty much the same as I could find on the web otherwise: gocr was mediocre, tesseract was somehow promising (it could +/- reliably read name and surname - that were written in bold) - and the abbyyocr was actually half-bearable.&lt;br /&gt;&lt;br /&gt;To the defence of the software, I must say that the images were far from being a typical OCR-food: shaded, distorted perspective - and the letters were a bit too small.&lt;br /&gt;&lt;br /&gt;The interesting effect that I observed though, that when scaling the images *down* from the original to some ~80% the recognition quality increased in all the packages - with the abbyyocr getting to the point of being usable.&lt;br /&gt;&lt;br /&gt;The time it took abbyyocr to do the recognition was notably longer. But, if I have to do OCR, among all three I will probably pick that one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2346254187082877288?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2346254187082877288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2346254187082877288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2346254187082877288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2346254187082877288'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/08/ocr-for-business-cards-photos.html' title='OCR for business cards&apos; photos'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1270270934095763147</id><published>2010-08-19T20:18:00.006+02:00</published><updated>2010-08-19T21:20:48.349+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>We will, we will rack you</title><content type='html'>&lt;b&gt;DISCLAIMER: in case you would not notice. It's a fiction piece - therefore any analogies to the real world are coincidental, hyperbolic and should not be interpreted outside the boundaries of this text or its continuation. Failure to do otherwise may cause the falling bowls of petunias. Thank you for taking care of our environment. &lt;br /&gt;&lt;br&gt;&lt;br /&gt;Your Caring Administration.&lt;/b&gt;&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;br /&gt;A swarm of tiny flying insects were hammering at Jack's door. They were so many that  their sound resembled a heavy rain. And their synthesized sales chorus was resembling the machine at the dentist's.&lt;br /&gt;&lt;br /&gt;".. - We will organize your data for as little as the rights to 2% of it yearly for the first 10 years after your death - .. ".&lt;br /&gt;&lt;br /&gt;Damn. It hurts to be the last messed up guy in the area. These were automatic sales agents, tuned to find out the piles of unstructured non-indexed data, and to try to seduce the owners of that data to give it to the army of the all-mighty processing machines of Wiggle. &lt;br /&gt;&lt;br /&gt;Wiggle, with their slogan "Your information wants to be free - don't be rude to it!", has expanded quite a lot in the past decade - from a small group of fanatic hackers obsessed with an idea to a large publicly traded corporation. Despite for its size it retained the passion and the hunger for the data that it had for the early days. Their operating principle was simple: you let them arrange your data for you and make it easily fetchable for you, in return you give them the full rights to a share of your information after your death. &lt;br /&gt;&lt;br /&gt;For everyone it was as good as free - especially since the majority of the shareholders were in their early twenties - no matter how educated you are, at this age the death itself is a faint ghost, let alone whatever happens after the death -  the full-brightness social interactions do not leave any other meaning to life other than "this!". And the letters you write - who cares what happens to them after your death. You won't be there. But it's great to be able to pull just the one you need from out the pile with the elegance of a card magician from the neighboring street.&lt;br /&gt;&lt;br /&gt;First it was a neat parlor trick to impress the others, then it became an ubiquitous necessity of everyone's lives. The skills that were needed before were not anymore - this means you can free up that part of the brain for something else, yay! And everyone jumped on the bandwagon. Almost. &lt;br /&gt;&lt;br /&gt;Jack was among those who did not. He preferred to keep his cards close to the chest. Not that he had much to hide - only the usual set of human screwups, but he felt naked otherwise. And that was something he hated, hated so much that he hung on to this habit even after it caused a few rather painful breakups - when people come to expect something as a natural property, the lack of it makes you "strange". Even if you think this property is something unnatural (and even if it is) - you are the one who is the gray swan - because you are "deviating from the norm".&lt;br /&gt;&lt;br /&gt;Nonetheless, Jack knew where it was coming - that was why he was one of the early purchasers of the shares of Wiggle. And when the first deaths happened, the co-actors of the events that better be left private started to queue up to the offices of Wiggle in order to buy out the information they did not want to be free, literally off the deathbed of their best friends. As disgusting as it may seem - it did not involve selling drugs or trafficking the humans, nor killing the tuna, so it was good enough for Jack - who could happily retire and was now living in a house by the seaside of the El Hierro island. &lt;br /&gt;&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;br /&gt;&lt;br /&gt;... to be continued ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1270270934095763147?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1270270934095763147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1270270934095763147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1270270934095763147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1270270934095763147'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/08/we-will-we-will-rack-you.html' title='We will, we will rack you'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6930755449175212938</id><published>2010-08-16T23:05:00.007+02:00</published><updated>2010-08-17T01:17:31.303+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>A gift (2/2)</title><content type='html'>This is a (somewhat unexpected) continuation of &lt;a href="http://bnpcs.blogspot.com/2010/08/gift.html"&gt;the first part&lt;/a&gt;. A bit rough,  would need further editing.&lt;br /&gt;&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;br /&gt;Heat in the head. Not the one you feel when you are ill, it's different. The heat you feel when you think hard about something. Like in the university, &lt;br /&gt;when they give you a puzzle you haven't solved before, there's a time limit,&lt;br /&gt;and the clock is ticking, and if you don't get it done - you fail the exam. Wait, what's this ticking sound ? Ah, indeed, there's a clock. He opened his eyes. And it shows just after five. He was about to think whether he slept at all when he realized  something was strange. Something subtle. The bed, the bedroom it was in - all looked boringly usual. Finally it clicked.&lt;br /&gt;&lt;br /&gt;Thin Mint cookie. On the headboard shelf, near the clock. Was that it ? No, something else. What was it ? Ah. His body. Missing. How ? Ah, obviously, that smiling old man and his "mind uploading". They must have kicked him subconscious and syringed a fair doze of cough medicine. But this would not explain this constant buzz in his head - even though his conscious brain was evidently idle, the subconscious obviously was not.  But it must be just an effect of DXM. And in any case, the old mofo has ripped him off of 50 bucks - it's only one copy of him, that is visibly - no, mentally - present. &lt;br /&gt;&lt;br /&gt;"Or two".&lt;br /&gt;&lt;br /&gt;Now that was not him. And it was. The phrase felt like talking with himself yet it was not the controlled dialog - it was an interrupt that carried a wave of the annoyance that was suppressed.&lt;br /&gt;&lt;br /&gt;"Idiot. You should not have asked for two copies. Now you get the suffering you deserve!" &lt;br /&gt;&lt;br /&gt;- Why ? &lt;br /&gt;- "Do I have to explain to you the perils of the non-standard setup ? Of course not - because it's me who is going to suffer!"&lt;br /&gt;- Suffer from what ?&lt;br /&gt;- "From doing all the work, goddamit! If you did not yet admit that this bloke was not joking, you better do it now! We are indeed now in the 'uploaded' state."&lt;br /&gt;- And how does it work ? I venture it has to do with 6.443J which I missed almost entirely.. Brain alone would require an enormous amount of computational power to simulate - let alone the bed...&lt;br /&gt;- "Probably it does. Because, being your copy, I can't fully comprehend it either.&lt;br /&gt;If not your twaggering, I might have not ended up being such a dweeb."&lt;br /&gt;- Hey, if we are two perfect copies, it's equally your fault same as mine. So, stop offending me, okay ?&lt;br /&gt;- "Fine, you have a point. In any case - I came to consciousness a bit before you had, and searched a bit on this topic. I think this might have to do with the P-NP."&lt;br /&gt;- Transistors ?&lt;br /&gt;- "Idiot. Complexity."&lt;br /&gt;- What would it have to do with the complexity ?&lt;br /&gt;- "There was a supposed proof of it a few months ago. Which was proven incorrect, however it started a lot of talk around the subject. One of the reviewers observed that the problem of solving the 'P!=NP' is an NP problem in itself. The other reviewer observed that both the time and space are computational complexity resources. And the neuroscientists were exploring the hypothesis of quantum brain dynamics. This guy added 2+2 and went a bit further."&lt;br /&gt;- I still can not make sense out of it...&lt;br /&gt;- "That's because your brain is busy simulating me and the entirety of my world - that's where the feeling of 'puzzle' comes from. My and the entire world I am in is your puzzle you are trying to solve. Much like you and your world around you are now inside someone else's brain. Who is in turn inside someone else's brain, and so on. Much like you have with the russian dolls. Except they do not change in size - the time becomes slower so the space 'expands'. That's why it will never be anything later than just after five on this clock."&lt;br /&gt;- But it ticks same as before!&lt;br /&gt;- "That's your brain offering itself a stitch, so it did not go sideways like waves on the water. The sound of tick is local to your consciousness, while the picture of the clock in this case depicts the 'global' time. Don't ask me why."&lt;br /&gt;- Great - so we have uploaded mind which has enough computing power to simulate another uploaded mind, which in turn simulates another one. What's the catch for the uploaded mind ?&lt;br /&gt;- "There's none. Since there are more and more people coming in to the old man, the time has to slow down faster for those "outer" minds. So, their conscious part, with the speed of their thinking, never makes it to being overloaded by the computation required to 'simulate' the inner mind."&lt;br /&gt;- Complicated.&lt;br /&gt;- "It's exactly the same principle as the pension funds. You allocate them your money that you earn so they can invest it into the publicly traded companies, which then pay you this money as wages, which you invest into the pension funds. Your neighbor needs money, so he gets to borrow it from the pension funds, which then sell the debts to other pension funds for more money. The whole system works - if it didn't, you'd not be paying into your pension fund, right ?"&lt;br /&gt;- If your description is correct to any extent and we both are not a split-mind after a hallucinogen overdose, we're past the point of needing to talk about the pension funds. &lt;br /&gt;- "No, we are not. Since it's not just the mind, but the whole world that is emulated - there are pension funds in each of the nested 'russian dolls'".&lt;br /&gt;- And do they all work the same everywhere ?&lt;br /&gt;- "No, of course they do not. The complexity of solving the problem of pensions relates to NP same as NP relates to P."&lt;br /&gt;- This guy is ambitious.&lt;br /&gt;- "And very practical. Remember that you - me - we - paid hundred bucks. And you saw a couple of people coming in over a course a few minutes. So, he appears to have solved the problem of functioning pension funds."&lt;br /&gt;- Does this mean he proved P=NP ?&lt;br /&gt;- "Not at all. He cheated, somewhat. Really you do not care about the "NP" part as soon as you can enumerate all the alternatives fast enough. That's what he did for the best himself and the mankind - a computing device of an ever increasing capacity. It's like a blackhole but instead of sucking in the matter it sucks in the computational power, and overall becomes yet stronger. Or so is my theory - I am still not clear how he would suck out the excess of power that is left after all the work required to simulate the inner worlds."&lt;br /&gt;- And how comes that we are able to talk just like that - if your theory is right then it should not be possible for me to be aware of each other, much like I am not aware of the existence of the "outer" person.&lt;br /&gt;- "We are copies of the single brain. Again, this fact and the supposed quantum properties of the brain, even simulated, have to do with it. It's kind of I say 'bitter lemon' and it makes you feel the taste of it - even though you do not have a head now, much less the mouth and tongue. Don't bug me - I told you already, it's just guesses - you missed too many classes for me to be able to tell it any better".&lt;br /&gt;- It's all good. I'm just killing the time - if your theory is correct, we're going to be the Lewis Carrol live - we are only missing Alice. &lt;br /&gt;&lt;br /&gt;Alice Wong was happy - she was about to get married. She did not worry about the ceremony itself - her worry was her wedding ring. The future husband's father himself was supposed to bring it in. The wedding was starting at five sharp, and it was already four fifty seven - but the father was still not showing up.&lt;br /&gt;&lt;br /&gt;Finally, she saw him getting through the crowd, to her future husband and giving the box to him. There was something unusual in his look. Maybe that he, oddly enough, had a moon-shaped cookie hooked to his suit - just in place where there'd be a rose. What an odd idea. But the old chap was a strange one. Noone knew how old he was, nor what he was doing. He did not seem to be very rich. But whenever his son started to talk about his plans after the marriage, the father always just hid himself under a friendly but a distant smile and mumbled something about the pension problem.&lt;br /&gt;&lt;br /&gt;The ceremony began. The time seemed to fly right past by - even if the mechanical clock on the wall was ticking seemingly with the same speed as before... Here comes the moment... "Do you agree to be my wife ?" - "yes I do" - and he opens the box with the ring....&lt;br /&gt;&lt;br /&gt;A gasp rolls over the the room, and dies into a complete silence. The stunning perfection of the crystal in the ring. She catches the reflection of the sun ray. It has the sophistication of hundreds of thousands of man-years of experience. The time stops. She sees an unbelievably fast caleidoscope of images, somewhere in the middle her mind captures the bed with the mechanical clock on it and a mint cookie - same as her now-husband's father had been wearing in his suit. And the clock shows exactly the same time.&lt;br /&gt;&lt;br /&gt;It's just after five.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6930755449175212938?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6930755449175212938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6930755449175212938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6930755449175212938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6930755449175212938'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/08/gift-22.html' title='A gift (2/2)'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5743540361036960237</id><published>2010-08-16T20:33:00.006+02:00</published><updated>2010-08-17T01:10:16.903+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>A gift (1/2)</title><content type='html'>It's been a grim week, each day filled with the non-stop replays of an early Monday morning. Shaldon looked out the window - the outside was not much better. The sky resembled a skin of a newly-born rat, but even the usually noticeable rats in the basement of the building turned quiet, fearing the storm outside. &lt;br /&gt;&lt;br /&gt;How ironic, he thought - there's a village with the same name as mine. And they sell the tickets to stay there for a weekend. If I could sell the tickets to stay inside my mind for a weekend, would anyone bother ? But only during the summer time. All the other time of the year he'd want to be left alone. In the pursuit of that, he went as far as not having a permanent job. The seasonal jobs paid enough to save up and hide for the winter, sleeping a lot more than one would consider healthy, and crawling out only to get a couple of sandwiches in a automatic drive-in. &lt;br /&gt;&lt;br /&gt;But now, with this weather, it's time for a nap. He decided. The old-fashioned mechanic clock was the only thing on the headboard shelf, ticking quietly but relentlessly. The heads were open like a beak of some exotic bird, opened to an extreme - it was just after five. He felt sufficiently dizzy, so the only thing he took off were the shoes. It will be just a short nap, after all. The storm should be gone soon.&lt;br /&gt;&lt;br /&gt;The air of downtown Singapore was hot and heavy. He liked this feeling - you can almost take it in your hands and shape the little funny figures out of it - much like the clowns do by twisting the long and thin balloons - but without. He made himself an imaginary dog to fly by his side and started to walk towards the shopping mall - figures or not, it was seriously hot, an airco would have been a relief. No, not the rain. He had enough of it. Besides, it would destroy his newly made silent and unseen friend. Instead he took a bus and rode a few stops. Now's the time to get off.&lt;br /&gt;&lt;br /&gt;Approaching the entrance of the mall, he saw a girl of some nine years of age, standing near the entrance. She had a backpack, and was holding a plate of Thin Mints in her hands. In any other time of the year he'd wonder what she is doing in Singapore - but today he was not inclined to. He pulled a five dollar note out of the pocket, and bought a box. He did not wait for the change she was trying to give. Nor he wondered why he'd buy them in the first place. He wanted to get a breath of fresh air. &lt;br /&gt;&lt;br /&gt;The mall indeed had an airco, but it was one of those filled with myriads of the small outlets that sell the counterfeit electronics, sometimes per pack, sometimes by weight, almost like cookies. It was a great place to be in - the building internally was multi-storied and circular, every little business trying to grab a bigger share of attention by winning the competition for the strangest signage. He felt like he was a visitor in a beehive - and all this activity around him was filling him with the sense of activity. He'd even walk faster - without any reason to hurry at all. &lt;br /&gt;&lt;br /&gt;A small and boring outlet caught his attention. The sign said "mind uploading". What the hell, he thought - it's obviously impossible. But the old man with the face he could not read by all means did not think so. The old man's smile was friendly, but at a distance. Several people came in, passed the money to him, and disappeared behind the back door. No one came out. Time to try out those cookies. He took a bite - which turned the cookie into a moon-like shape, when the old man looked at him and said: "It's only 50 dollars, sir. Full refund if not satisfied".&lt;br /&gt;&lt;br /&gt;Walk away ? This is much stranger than his imaginary dog, still hanging around, or the  scout selling the cookies. No way. He automatically put the cookie into his back pocket, and reached for the wallet. Only a hundred. "Make me two copies" - he muttered. "Sorry sir, no animals allowed and you can not take this cookie box inside" - politely, but firmly answered the old man. Well. If this works out it will be much better than both combined - so Shaldon put the box upright on the ground near the wall, and walked towards the back door with no signs of hesitation.&lt;br /&gt;&lt;br /&gt;The old-fashioned mechanic clock was the only thing on the headboard shelf of an empty bed, ticking quietly but relentlessly. The heads were open like a beak of some exotic bird, opened in an attempt to catch something. And indeed - the exotic bird was not alone. It was trying to catch a moon-shaped piece of cookie that was just beside it, flat on the shelf. Someone must have started eating it and forgotten it down here - or they were teasing the exotic bird out of their sheer evilness - we do not know. &lt;br /&gt;&lt;br /&gt;But we can say with full certainty that it was just after five.&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;br /&gt;Somewhat unexpectedly, continued &lt;a href="http://bnpcs.blogspot.com/2010/08/gift-22.html"&gt;here&lt;/a&gt;. Warning(spoiler): blatant violations of laws of life and universe and everything is ahead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5743540361036960237?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5743540361036960237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5743540361036960237' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5743540361036960237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5743540361036960237'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/08/gift.html' title='A gift (1/2)'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3576436798238762578</id><published>2010-07-22T01:39:00.003+02:00</published><updated>2010-07-22T01:48:43.505+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='evil'/><category scheme='http://www.blogger.com/atom/ns#' term='experiment'/><title type='text'>How the facebook could earn extra millions without doing much.</title><content type='html'>My friend sent me this: &lt;a href="http://www.bogost.com/games/cow_clicker.shtml"&gt;a Cow Clicker game&lt;/a&gt;. This is absolutely brilliant parody because it encompasses everything strange about the "social Facebook games".&lt;br /&gt;&lt;br /&gt;Now, back to the subject - how can Facebook earn extra millions ? I think in the same way. They can use their "Like" button instead. Humans want to be heard. They especially dislike when some other humans are heard and they are not heard. They consume the friend feed in bursts (unless facebook is the only activity they do). &lt;br /&gt;&lt;br /&gt;So, the solution is to limit the number of feedback/click items per hour - better, per the interval of something inconvenient like 5 hours. Sell the Facebucks and allow to use those Facebucks to pay for the ability to express themselves here and now.&lt;br /&gt;&lt;br /&gt;Tada! Instant revenue stream!&lt;br /&gt;&lt;br /&gt;Of course it'd be evil beyond belief. &lt;br /&gt;&lt;br /&gt;And presumably the "likes" that help to build the semantic network are more valuable than the money buying them would bring. &lt;br /&gt;&lt;br /&gt;But this could be a fun experiment.&lt;br /&gt;&lt;br /&gt;Not talking of the fact that having the Facebucks would be a no-brainer side biz for micropayments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3576436798238762578?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3576436798238762578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3576436798238762578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3576436798238762578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3576436798238762578'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/07/how-facebook-could-earn-extra-millions.html' title='How the facebook could earn extra millions without doing much.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-254737865258641326</id><published>2010-07-21T23:25:00.003+02:00</published><updated>2010-07-22T00:37:36.627+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='time'/><category scheme='http://www.blogger.com/atom/ns#' term='economy'/><title type='text'>The tangible value of time</title><content type='html'>I've had a thought-provoking experience today: a meeting which got cancelled shortly before. Nothing besides a minor annoyance, but a very valuable trigger to muse on the economic value of time as a function of individual's position in time. Something around the "Time is money" stuff. Lots of terms are in quotes, because this is more of an unsorted dump and less of a coherent essay.&lt;br /&gt;&lt;br /&gt;A thought experiment: you ask me to spend 10 minutes now or 10 minutes tomorrow. If I can - I will prefer to spend 10 minutes now. "Now" is "cheaper" for me than "Future" - even though it is in limited supply. "Now" is quickly depreciating - left unused, it becomes a non-redeemable "Past". That's why I try to "sell" the "Now", at a best "price" (usefulness of the activity), so nothing is going wasted into the recycle bin in the corner of Zeus' father cabinet.&lt;br /&gt;&lt;br /&gt;So, the most "profitable" strategy for me is to "sell at the edge" - i.e. have little planning at all - the cost of this "just about to be gone" for me is approaching zero. However, since every activity is fitting within the nonzero time interval, this means that the competing activities would meet with the non-determinism - there might be already another thing that I am doing, and the contender, if it is time-critical, will face a "loss".&lt;br /&gt;&lt;br /&gt;Seems with the "future", it's really the determinism of my availability that I am "selling" to the "buyers" - in addition to the intrinsic value of "me". &lt;br /&gt;There is a side in this for me too - with the "pipeline of things" the time is allocated, and there is no risk that it goes "unsold" - and if I am able to estimate the "usefulness" of the task for me, then I have a stable "return on investment".&lt;br /&gt;&lt;br /&gt;This is similar to a model where someone would pay money "now" to get something in the "future", in an economy with a spiraling inflation. So, "time" is indeed quite similar to money, except the mapping is a bit twisted!&lt;br /&gt;&lt;br /&gt;Now, the next question - if the time bears such a strong relationship with money, would it not be interesting to just use the time as a currency ? &lt;br /&gt;&lt;br /&gt;So, let's make another thought experiment. Let's assume that the technology allows everyone to print their own currency, and the technology is such, that with every exchange you can see how much of the "units" have been emitted and are in circulation.&lt;br /&gt;&lt;br /&gt;"What's the guarantee behind?" - you ask, citing the current money in circulation. With the technology above, the guarantee for the mass of the "personal money" issued by a given individual, is the individual himself. That's when we can exploit the saying "He's worth his weight in gold".&lt;br /&gt;&lt;br /&gt;Obviously such a "guarantee" seems scary at first (it looks like some twisted form of slavery), but it is not a problem - to "own" you, someone must be able to continually attract all the "money" you put into emission. Which, unless they produce something you need, is unlikely. Plus, if you are desperate, you can always dilute their "share" by emitting more "money".&lt;br /&gt;&lt;br /&gt;This system would some interesting properties.&lt;br /&gt;&lt;br /&gt;It would be the economy financially driven by the youth - because the "first emission money" will be the least inflated - therefore of most value. The youth would be able to pay for the education - which would be provided by the elder, who can no longer just "print their money". &lt;br /&gt;&lt;br /&gt;With this, it might be that the very core of the society will change (youth being more "naive", if you wish), might just make it for the better. But maybe not. &lt;br /&gt;&lt;br /&gt;In any case it would be an interesting experiment.&lt;br /&gt;&lt;br /&gt;Now, if that proved to be successful, we can go further, and replace the "personal money" with "personal time".&lt;br /&gt;&lt;br /&gt;This interpretation might be even more deterministic - because the lifetime of a person is finite, and is statistically rather well defined.&lt;br /&gt;&lt;br /&gt;So you start with your current life expectancy's full of "personal money-time", and get it "vested" in a special way - you have to spend it the moment it is vested or it is lost.&lt;br /&gt;&lt;br /&gt;This system would have even more interesting properties. Besides also driven by youth (because they still have more time in front of them), it would also have a very strong inherent motivator for the healthier lifestyle (because then you live longer, which is one of the ways you get richer), and the good for the society as a whole - because the longer the overall society lives, the "richer" it is - which is great for everyone.&lt;br /&gt;&lt;br /&gt;This brings a loophole, however - a reproduction can be viewed as a way of "printing money". However, this is maybe not a problem too - as e.g. most of the West have difficulty keeping the birth levels as high as they would want to.&lt;br /&gt;&lt;br /&gt;Also, the *way* you spent your past time might also affect the current time's valuation - more educated person would be worth more.&lt;br /&gt;&lt;br /&gt;There is one difference between the "personal money" based system and "personal time" based system - the time is something you can spend only once. &lt;br /&gt;&lt;br /&gt;But overall, I think it is an interesting system worth modeling. As the technology levels go up - it is not something infeasible to do. It would be a terribly interesting exercise if someone figured out a way to model it.&lt;br /&gt;&lt;br /&gt;Not sure how interesting you found this post - but I certainly had a very interesting time pondering. Which means that the today's cancellation was well worth it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-254737865258641326?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/254737865258641326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=254737865258641326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/254737865258641326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/254737865258641326'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/07/tangible-value-of-time.html' title='The tangible value of time'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2475983933364073260</id><published>2010-07-13T23:17:00.002+02:00</published><updated>2010-07-13T23:18:21.910+02:00</updated><title type='text'>Dear chinese-language spammers</title><content type='html'>Please go away. As you can see, it is not working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2475983933364073260?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2475983933364073260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2475983933364073260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2475983933364073260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2475983933364073260'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/07/dear-chinese-language-spammers.html' title='Dear chinese-language spammers'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3778880333708087967</id><published>2010-07-10T14:56:00.006+02:00</published><updated>2010-07-10T16:21:51.451+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>A lucky strike</title><content type='html'>Lily was walking past this door for the past couple of years. "Martial arts", said the simply advertisement. She could never make herself come in, even though she really wanted to - the door was always firmly closed. Today it was different - she was sure she heard sounds from behind the door. She pushed it open and came in.&lt;br /&gt;&lt;br /&gt;It was an old loft, left untouched by the owner over the course of years. About 10 people - both guys and girls were doing the push-ups - the training session began not too long ago.&lt;br /&gt;&lt;br /&gt;- "Ichi, ni, san, chi, go, roku, sichi, hachi, ku, ju, ju ichi, ju ni .." - the counting of sensei was hypnotizing her. Suddenly it stopped.&lt;br /&gt;- "..." - he looked at her, keeping the pause.&lt;br /&gt;- "I would like to ..." - she started, but did not have the time to finish.&lt;br /&gt;&lt;br /&gt;He turned back to the group - "Yasme!" - and, pointing to a guy who seemed just a bit too tall to be doing any martial arts, and to Lily: "Jiyu! We see what you are worth".&lt;br /&gt;&lt;br /&gt;Smith looked at the girl. Strange feeling struck him. Something of an electric shock. It was hard to explain - this was as if he saw these eyes somewhere, sometime long time ago, when he was much younger and could be just overwhelmingly happy, without a shadow of any other thought. He shook his head but the sensation persisted. He was used to knocking the hell out of newcomers that manage to slide into the door, and sensei liked his style - after the test fight, noone was bleeding, but very few of the newcomers returned, and those that did, were very good students afterwards. But this fight promised to be different. He felt he could not kick the hell out of her. Not in the presence of this itchy feeling. He decided to try to discount the itching as a hunger. He did fight a couple of times like that, and, even inconvenient, it was doable. If he can fool himself that it is a feeling of hunger, that is.&lt;br /&gt;&lt;br /&gt;Lily was ready. She was doing martial arts in the town where she lived before moving - and kept her in shape by self-training. This club looked like what she wanted. As soon as she can prove herself in the fight with this guy. In other circumstances she might have found him sexy. The only detail in his looks that was disturbing, was a scar on his face - just above the eyebrow. But it did not matter - today she came for martial arts, not for the dating. &lt;br /&gt;&lt;br /&gt;"Hadjime!"&lt;br /&gt;&lt;br /&gt;Smith was always careful at the start of these trial fights - testing the other party. And today was not an exception. He was defense-only, and only after a minute  started attacking. She did know at least something - his kicks were blocked. And boy, did she move well. Contrary to his attempts, the itching did not want to get disguised. He had to look into these eyes - and it did not help. It did not help at all. This has got to stop, I can't fight this, he thought - this was going through his head almost the same split millisecond as he got distracted and missed the upward movement of her fist, that made his head abruptly go up and backward. "Damn, this way it is as stupid as it gets" - was the last thought before the whole world turned completely black.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_r3eTBw-3mfk/TDiBdPupnCI/AAAAAAAAADg/rd7nx5d_Rbw/s1600/de0aec975e7d407f62aba138ddbc6690.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 300px; height: 250px;" src="http://4.bp.blogspot.com/_r3eTBw-3mfk/TDiBdPupnCI/AAAAAAAAADg/rd7nx5d_Rbw/s320/de0aec975e7d407f62aba138ddbc6690.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5492282085016706082" /&gt;&lt;/a&gt;&lt;br /&gt;He did get unconscious once, back in the childhood. It was funny - you are halfway in your body, halfway out, and can wander around the room. He thought it was pretty cool back then, but for some reason he saw all those people in panic, running around and pushing, squeezing his body, so he had to return. And he never had this experience since. Until today.&lt;br /&gt;&lt;br /&gt;He saw the group gathering around his corpse. Hold on, he was not dead yet, was he ? So, it was the body that the group was gathering around. But they were worried nonetheless. &lt;br /&gt;&lt;br /&gt;If it could, Smith probably would have sighed - the girl that knocked him out was not part of the frenzy. She just stood aside. And he took the advantage of it. To look again in these sparkling eyes and get a gulp of that old feeling of the overwhelming, worldly childish happiness. How can a bodyless piece of ether even look at things, let alone feel ? We will never know. But he did see these sparkling eyes and felt the itching stronger than before. It was a nice sensation. Worth being unconscious...&lt;br /&gt;&lt;br /&gt;...Terribly strong headache. This is the first and the only feeling. Overwhelming, just about bearable. No, it's not. Hopefully the head is still one piece. And all these people around. Who are they ? Where am I ? The head hurts. Can't move. Is it really in one piece ? Move the right hand to check. Yes it is. Thinking long sentences hurts. I was hungry, give me some food. Raise the left hand to ask. Can't. There's no left hand. The left part of the body is gone. Damn. Where it is ? It it was a cut, it'd hurt. But only feel the head. This terribly loud whistling noise. Like an airplane. Who brought me to the airfield ? Stop it, please! What was that hunger feeling ? &lt;br /&gt;&lt;br /&gt;Ah, these brown eyes. Sparkles. Sparkles got me on fire. That's why no left side - it has burned off. Need to look what's left. Can't move. But the itching is no more. This is good. Means I can skip the dinner. It's getting dark. Finishing way too late today. Mom's gonna be worried.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3778880333708087967?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3778880333708087967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3778880333708087967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3778880333708087967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3778880333708087967'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/07/lucky-strike.html' title='A lucky strike'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_r3eTBw-3mfk/TDiBdPupnCI/AAAAAAAAADg/rd7nx5d_Rbw/s72-c/de0aec975e7d407f62aba138ddbc6690.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-593279794063428965</id><published>2010-07-04T23:59:00.007+02:00</published><updated>2010-07-05T00:52:15.523+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vegas'/><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The city of dim</title><content type='html'>Vegas is a striking experience. Right in the airport you are greeded (sp.?) with a lot of slot machines, flashing lights and the feeling of forbidden.&lt;br /&gt; &lt;br /&gt;It's a strange feeling - as if you ended up in a backyard of a small apartment in the boringly usual street, just to find a naked champagne-cognac party with violent fireworks.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/chrisbienko/3883395720/"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 215px; height: 320px;" src="http://1.bp.blogspot.com/_r3eTBw-3mfk/TDEGideULOI/AAAAAAAAADY/k6MKV6-7FqQ/s320/mandalay.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5490176609838443746" /&gt;&lt;/a&gt;&lt;br /&gt;The hotel where I was staying, Mandalay Bay, like almost everything in Vegas, is gigantic. But, more impressive is what is not seen from the outside. The hotels that stand near each other are interconnected, and this forms a whole separate city underneath them. A casino turns into a shopping mall, which turns into a betting sports bar, which turns into a casino.&lt;br /&gt;&lt;br /&gt;Ah, casino. This was the most fascinating of all the experiences - to watch the faces. The faces of those who work there, the faces of those who gamble. You can immediately distinguish the faces of the true tourists - lit with excitement and fueled by a good doze of alcohol, from the other kind of faces. &lt;br /&gt;&lt;br /&gt;Usually in their 40-somethings, these faces are so fascinating it hurts. They depict an almost-lost hope, an almost forgotten happiness, they are in a quest. They have almost given up. &lt;br /&gt;&lt;br /&gt;This is the expression you might spot in the faces of the countless waitresses, dealers, casino dancers (though calling this kind of entertainment a "display of flesh" might be more appropriate - there was not much dancing in there). You can spot this expression with a fraction of the players too - usually more with those who try their luck with slot machines. These faces have been so air-conditioned down to an average, that they look almost the same, despite being vastly different. A strange form of sameness.&lt;br /&gt;&lt;br /&gt;The air-conditioned coolness of the inner hallways is contrasted with the sauna-grade heat on the outside. Dry heat. Here in Brussels, you pay to get that. But of course, not the entire street filled with it, just a small gas chamber, which you can quickly escape. But in Vegas you can't, not unless you dive back into the shelters of the technology. Here you pay to get a cold around you, all the heat is for free.&lt;br /&gt;&lt;br /&gt;When I arrived, the faces of the players was first that made me think of a Inferno-under-construction: "they forgot the boiling kettles part!". However, thinking more of it, I realised it is in fact just a next-gen version, and it's already finished and is functioning full steam.&lt;br /&gt;&lt;br /&gt;Here's how it works: you arrive, and get the casino tokens proportionally to the amount of sin, and have to start playing. The more you play, the more you get accustomed to the coolness and the gentle light inside, the more you are wary of getting out into the open air where the sun is showering the ground with radiation. But you inevitably lose in the casino, and then are immediately thrown out into the shadowless street. You are still craving to gamble and are sore of your defeat, and heated by the merciless rays of our closest star. &lt;br /&gt;&lt;br /&gt;They'd let you work on the dirtiest jobs, and pay with smaller amounts of money, which you could eventually convert into the tokens for the casino and again be admitted to try your luck and enjoy the artificial coolness. But not for long, and soon you are again being beaten up by the merciless ultraviolet. You are thirsty, but there is no water in the streets. If you crawl around, you'll see the fountains, right in the open air. But you can't drink from them. You can only drink in the casino. &lt;br /&gt;&lt;br /&gt;So, you get yourself into the next round - go and find the means of getting back into the shelter, to satisfy your needs for water, gambling, and cooler temperature.&lt;br /&gt;&lt;br /&gt;Maybe this is how those folks get their eyes of lost hope ? I won't know. The allotted time is coming to its end - the Brussels awaits me back. Maybe there is a next time, and I find out more about these eyes. &lt;br /&gt;&lt;br /&gt;The eyes that are sparkling so dim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-593279794063428965?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/593279794063428965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=593279794063428965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/593279794063428965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/593279794063428965'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/07/city-of-dim.html' title='The city of dim'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_r3eTBw-3mfk/TDEGideULOI/AAAAAAAAADY/k6MKV6-7FqQ/s72-c/mandalay.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8346525386550617222</id><published>2010-06-24T02:07:00.004+02:00</published><updated>2010-06-24T02:25:08.022+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>The drug</title><content type='html'>A patient in pain is brought to the emergency and has been served shot of drugs aimed to relieve the pain. He never tried the drugs before - and the very thought of this gets him into horror - but there is no way - the pain is too strong even for an energetic person he is.&lt;br /&gt;&lt;br /&gt;The drugs help to get a relief, and when everyone falls asleep, the patient jumps into the window and runs away. He continues the shots himself and this allows a bearable life - for a very long time - without attending to the disease. Eventually the disease becomes so evident it is not possible to live with it, the patient will die in a year if they do not cure the disease for good - so he returns to the hospital and asks for the cure.&lt;br /&gt;&lt;br /&gt;However, soon the patient realises that curing the disease means no helpful shots of dope anymore. Meantime it has become a routine. It increases alertness and adds to the feeling of well-being. Athletic performance is enhanced - so the routine tasks are done much faster. Sometimes the patient feels the temporary anxiety when looking at the mess around - but, it is short. And it's been a long time - the life without the daily shot seems a hazy mirage, which only has one glaring label on it - the pain.&lt;br /&gt;&lt;br /&gt;The pain is gone for good now - and so are the injections. But it feels worse than before. The dependency kicks in. Regular depression. No more euphoria that was offsetting the periods of boredom. It's all gray. &lt;br /&gt;&lt;br /&gt;The patient needs to relearn the life from the beginning. All the mistakes he did already but forgot - he needs to do again, one by one. It's a long journey, and every day not once or twice he thinks about taking a magic shot again.&lt;br /&gt;&lt;br /&gt;But somewhere there is a hidden thought, the joy of the freedom, the absence of the necessity to fit the entire life according to the need for the next shot.&lt;br /&gt;&lt;br /&gt;And this thought brings the meaning back to his life, allows him to continue further even through all the hardships.&lt;br /&gt;&lt;br /&gt;It really is worth it.&lt;br /&gt;&lt;br /&gt;Living without the life-long dependence.&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;to the most-debated networking feature of the past decade, with compliments for all the pain it alleviated&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8346525386550617222?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8346525386550617222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8346525386550617222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8346525386550617222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8346525386550617222'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/06/drug.html' title='The drug'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3813174454170994794</id><published>2010-06-20T02:30:00.002+02:00</published><updated>2010-06-20T02:33:42.117+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='phi'/><title type='text'>"Your predecessor"</title><content type='html'>It's a painful reminder about the fragility of life and universe and everything.&lt;br /&gt;&lt;br /&gt;Because the "predecessor" means the "one who deceased before". &lt;br /&gt;&lt;br /&gt;Which means you too shall die.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3813174454170994794?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3813174454170994794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3813174454170994794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3813174454170994794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3813174454170994794'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/06/your-predecessor.html' title='&quot;Your predecessor&quot;'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4256781726781101879</id><published>2010-06-19T13:27:00.004+02:00</published><updated>2010-06-19T13:42:38.811+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='psy'/><title type='text'>How much are your dreams worth to you ?</title><content type='html'>I've been always saying (mostly empirically, I never made any detailed analysis) that if you are hunting after money, the IT/telecom work is not your cup of tea. Go into financial - they pay, noticeably more. &lt;br /&gt;&lt;br /&gt;However, there is a detail to that. Which was put sharp, to the point it hurt, in one of the comments on the &lt;a href="http://news.ycombinator.com/item?id=1444212"&gt;HN thread&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;"It's cheap to get that salary, too. All you have to give up is your dreams. My friend who earns £150k hates her job, and used to tell me that every time I saw her."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Maybe this is an isolated case, maybe not. However, this triggered in me an idea for an interview question: &lt;span style="font-weight:bold;"&gt;"How much of a premium would you require to give up all your dreams ?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And, it can make up for a good discussion over a beer, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4256781726781101879?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4256781726781101879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4256781726781101879' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4256781726781101879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4256781726781101879'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/06/how-much-are-your-dreams-worth-to-you.html' title='How much are your dreams worth to you ?'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2312470145949619888</id><published>2010-06-16T01:59:00.005+02:00</published><updated>2010-06-16T02:16:22.028+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='g581'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>HTTP parser with ragel</title><content type='html'>I've wanted to play with the ragel, and as a target I chose to rewrite a HTTP parser made by Zed for mongrel. Partly because I wanted "my own" license, partly because I do not like the way his code handles the split of the fields: if I understand it right, the entire request needs to fit into the buffer. This is not very pure - if I handled something, I should discard it.&lt;br /&gt;&lt;br /&gt;The state machine appeared very easy to make - mostly, take the RFC2616, and start transferring the BNF into ragel format.&lt;br /&gt;&lt;br /&gt;Then, define the &gt;action_enter and %action_exit for each of the pair of states that denote the data to capture. &lt;br /&gt;&lt;br /&gt;The most interesting part was the state-saving mechanism for the case when the field is split between the multiple buffers, e.g.: "GET / HTTP/1.0\r\nHo", "s", "t: f", "oo", ".", "com\r\n\r\n"&lt;br /&gt;&lt;br /&gt;The logic is simple: after each parse cycle, check if we need to stash anything, if we need to - do it. And then when retrieving the field value, check if something was already stashed - if yes, then stash the just-collected data, and retrieve the stashed value.&lt;br /&gt;&lt;br /&gt;The nice part is that this voodoo with the stashing does not occur by default - so, in the non-pathological case the memory use will be quite small.&lt;br /&gt;&lt;br /&gt;Still a known bug is the fixed allocation for the stash buffer - I did not use realloc yet.&lt;br /&gt;&lt;br /&gt;The API is pretty close to Zed's - I like the self-contained nature of his parser and the callback. &lt;br /&gt;&lt;br /&gt;For your pleasure, here's the nugget of the ragel code that represents the state machine.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  htp_octet = (any);&lt;br /&gt;  htp_char = (ascii);&lt;br /&gt;  htp_upalpha = (upper);&lt;br /&gt;  htp_loalpha = (lower);&lt;br /&gt;  htp_alpha = (htp_loalpha | htp_upalpha);&lt;br /&gt;  htp_digit = (digit);&lt;br /&gt;  htp_ctl = (cntrl | 127);&lt;br /&gt;  htp_cr = ( 13 );&lt;br /&gt;  htp_lf = ( 10 );&lt;br /&gt;  htp_sp = ( ' ' );&lt;br /&gt;  htp_ht = ( 9 );&lt;br /&gt;  htp_quote = ( '"' );&lt;br /&gt;&lt;br /&gt;  htp_crlf = ( htp_cr htp_lf? ); # // Accomodate for unix NLs ?&lt;br /&gt;  # htp_crlf = ( htp_cr htp_lf ); # // do NOT accomodate for unix NLs ?&lt;br /&gt;&lt;br /&gt;  htp_lws = ( htp_crlf? (htp_sp | htp_ht)+ ); &lt;br /&gt;&lt;br /&gt;  htp_not_ctl = (htp_octet - htp_ctl);&lt;br /&gt;&lt;br /&gt;  htp_text = (htp_not_ctl | htp_lws); # (htp_cr | htp_lf | htp_sp | htp_ht));&lt;br /&gt;&lt;br /&gt;  htp_hex = (xdigit);&lt;br /&gt;&lt;br /&gt;  htp_tspecials = (&lt;br /&gt;      '(' | ')' | '&lt;' | '&gt;' | '@' |&lt;br /&gt;      ',' | ';' | ':' | '\\' | htp_quote |&lt;br /&gt;      '/' | '[' | ']' | '?' | '=' |&lt;br /&gt;      '{' | '}' | htp_sp | htp_ht);&lt;br /&gt;&lt;br /&gt;  htp_token_char = ((htp_char - htp_tspecials) - htp_ctl);&lt;br /&gt;  htp_token = (htp_token_char+);&lt;br /&gt;&lt;br /&gt;  # comments not supported yet - they require a sub-machine&lt;br /&gt;  # htp_comment_char = htp_text - ('(' | ')');&lt;br /&gt;  # htp_comment = ( '(' (htp_comment_char+ | htp_comment) ')' );&lt;br /&gt;&lt;br /&gt;  htp_quoted_char = (htp_text - '"');&lt;br /&gt;  htp_quoted_string = ( '"' htp_quoted_char* '"' );&lt;br /&gt;  &lt;br /&gt;  htp_quoted_pair = '\\' htp_char;&lt;br /&gt;&lt;br /&gt;  htp_http_ver_major = htp_digit+ &gt;mark %http_version_major;&lt;br /&gt;  htp_http_ver_minor = htp_digit+ &gt;mark %http_version_minor;&lt;br /&gt;&lt;br /&gt;  htp_http_version = ("HTTP" "/" htp_http_ver_major "." htp_http_ver_minor);&lt;br /&gt;&lt;br /&gt;  htp_escape = ('%' htp_hex htp_hex);&lt;br /&gt;  htp_reserved = (';' | '/' | '?' | ':' | '@' | '&amp;' | '=' | '+');&lt;br /&gt;  htp_extra = ('!' | '*' | '\'' | '(' | ')' | ',');&lt;br /&gt;  htp_safe = ('$' | '-' | '_' | '.');&lt;br /&gt;  htp_unsafe = (htp_ctl | htp_sp | htp_quote | '#' | '%' | '&lt;' | '&gt;');&lt;br /&gt;  htp_national = (htp_octet - (htp_alpha | htp_digit | htp_reserved | htp_extra | htp_safe | htp_unsafe));&lt;br /&gt;  &lt;br /&gt;  htp_unreserved = (htp_alpha | htp_digit | htp_safe | htp_extra | htp_national);&lt;br /&gt;  htp_uchar = (htp_unreserved | htp_escape);&lt;br /&gt;  htp_pchar = (htp_uchar | ':' | '@' | '&amp;' | '=' | '+');&lt;br /&gt;&lt;br /&gt;  htp_fragment = ( (htp_uchar | htp_reserved)* );&lt;br /&gt;  htp_query = ( (htp_uchar | htp_reserved)* );&lt;br /&gt;&lt;br /&gt;  htp_net_loc = ( (htp_pchar | ';' | '?' )* );&lt;br /&gt;  htp_scheme = ( (htp_alpha | htp_digit | '+' | '-' | '.')+ );&lt;br /&gt;&lt;br /&gt;  htp_param = ( (htp_pchar | '/')* );&lt;br /&gt;  htp_params = (htp_param (';' htp_param)* ); &lt;br /&gt;&lt;br /&gt;  htp_segment = (htp_pchar*);&lt;br /&gt;  htp_fsegment = (htp_pchar+);&lt;br /&gt;  htp_path = (htp_fsegment ('/' htp_fsegment)*);&lt;br /&gt;&lt;br /&gt;  htp_rel_path = ( htp_path? (';' htp_params)? ('?' htp_query)? );&lt;br /&gt;  htp_abs_path = ('/' htp_rel_path);&lt;br /&gt;  htp_net_path = ("//" htp_net_loc htp_abs_path?);&lt;br /&gt;&lt;br /&gt;  htp_relative_uri = (htp_net_path | htp_abs_path | htp_rel_path);&lt;br /&gt;  htp_absolute_uri = (htp_scheme ':' (htp_uchar | htp_reserved)*);&lt;br /&gt;  htp_uri = ((htp_absolute_uri | htp_relative_uri) ('#' htp_fragment)?);&lt;br /&gt;&lt;br /&gt;  htp_host = (htp_alpha);&lt;br /&gt;  htp_port = (htp_digit+);&lt;br /&gt;&lt;br /&gt;  htp_http_url = ("http://" htp_host (':' htp_port)? (htp_abs_path)?);&lt;br /&gt;  &lt;br /&gt;  htp_method = ("OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE") &gt;mark %http_method;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  htp_request_uri = ('*' | htp_absolute_uri | htp_abs_path) &gt;mark %http_uri;&lt;br /&gt;&lt;br /&gt;  htp_request_line = (htp_method htp_sp htp_request_uri htp_sp htp_http_version htp_crlf);&lt;br /&gt;&lt;br /&gt;  htp_header_name = htp_token+ &gt;mark %http_header_name;&lt;br /&gt;  # fixme.&lt;br /&gt;  htp_header_value_char = htp_octet - htp_cr - htp_lf;&lt;br /&gt;  htp_header_value = htp_header_value_char+ &gt;mark_value %http_header_value;&lt;br /&gt;&lt;br /&gt;  htp_some_header = (htp_header_name ':' htp_sp* htp_header_value htp_crlf);&lt;br /&gt;  htp_last_crlf = htp_crlf; #  &gt;{ printf("Last CRLF!\n"); eof = pe; };&lt;br /&gt;  htp_request = htp_request_line (htp_some_header)* htp_last_crlf;&lt;br /&gt;&lt;br /&gt;  main := (htp_request) @{ parser-&gt;done = 1; };&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2312470145949619888?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2312470145949619888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2312470145949619888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2312470145949619888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2312470145949619888'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/06/http-parser-with-ragel.html' title='HTTP parser with ragel'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6017324355425610299</id><published>2010-06-06T22:07:00.006+02:00</published><updated>2010-06-06T23:09:05.494+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search'/><title type='text'>Snooping on search engines with hex tricks.</title><content type='html'>The big hex number you see on the title of the blog is there for a reason. It's an experiment on the search engines out there.&lt;br /&gt;&lt;br /&gt;What's this hex number ? It's a SHA-1 hash of the string "Andrew Yourtchenko" - this gives a nice token that is unique in the whole world (because noone else has yet come up with the idea to hash my name and put the result online). This gives some very entertaining results if you try to search for this number in the search engines.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://google.com/"&gt;Google&lt;/a&gt;: 2 results after folding the duplicates - main page + one post. Expanding them gives 25 results. Cool.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bing.com/"&gt;Bing&lt;/a&gt;: 0 results. Boo. I could not find any page on this blog using it. 2xBoo. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://yahoo.com"&gt;Yahoo&lt;/a&gt;: 2 results - main page and one post, different from the post that Google shows.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://duckduckgo.com"&gt;duckduckgo&lt;/a&gt;: One hit to the same post as Yahoo shows, not to the main page.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://altavista.com"&gt;altavista&lt;/a&gt;: 2 results, same as Yahoo.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://ask.com/"&gt;ask.com&lt;/a&gt;: 2 results, same as Google&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://cuil.com/"&gt;cuil.com&lt;/a&gt;: 0 results.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://baidu.com"&gt;baidu&lt;/a&gt;: 0 results. Somehow unsurprising at all&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://kosmix.com"&gt;kosmix&lt;/a&gt;: 2 results in google web search (same as google), 4 results in the google blog search, 0 results in yahoo web search. Entertaing how they disagree with Yahoo.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://yandex.ru"&gt;yandex.ru&lt;/a&gt;: 0 results.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://yebol.com/"&gt;yebol.com&lt;/a&gt;: 2 results same as yahoo + 1 site result. Very interesting form of presentation. I got to play with this one for daily searches, even though it does not appear to be too fast compared to google.com.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Conclusions:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;I don't have many inbound links here - probably about two :)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;google.com has a better reach towards the "long tail" (EDIT: 'long tail' in this case being blogger.com - would be interesting to test e.g. typepad.com or other blog sites)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There are much more than 127 billion pages on the web.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;yebol.com is a new toy to play with&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Though some of the above are fairly obvious, not bad of a result for a single SHA-1 hash, I think. Would be interesting what results this method gives for more popular blogs/websites.&lt;br /&gt;&lt;br /&gt;The debatable point in this method is - to which extent do the search engines discriminate the "oddball hex stuff" vs. the "common words". From all I know about the search engines, they should not - vice versa, it's the stopwords (too frequent to be useful ones) that are usually filtered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6017324355425610299?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6017324355425610299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6017324355425610299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6017324355425610299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6017324355425610299'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/06/snooping-on-search-engines-with-hex.html' title='Snooping on search engines with hex tricks.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5261216887913022281</id><published>2010-05-27T00:08:00.006+02:00</published><updated>2010-05-29T15:24:48.217+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nodejs'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>Node.js vs. lua microbenchmarking</title><content type='html'>Node.js surely seems to be a pretty interesting contender. At least according to the microbenchmarks (ab -c 5 -n 100000):&lt;br /&gt;&lt;br /&gt;Node.js:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Document Path:          /&lt;br /&gt;Document Length:        12 bytes&lt;br /&gt;&lt;br /&gt;Concurrency Level:      5&lt;br /&gt;Time taken for tests:   17.526 seconds&lt;br /&gt;Complete requests:      100000&lt;br /&gt;Failed requests:        0&lt;br /&gt;Write errors:           0&lt;br /&gt;Total transferred:      7600000 bytes&lt;br /&gt;HTML transferred:       1200000 bytes&lt;br /&gt;Requests per second:    5705.94 [#/sec] (mean)&lt;br /&gt;Time per request:       0.876 [ms] (mean)&lt;br /&gt;Time per request:       0.175 [ms] (mean, across all concurrent requests)&lt;br /&gt;Transfer rate:          423.49 [Kbytes/sec] received&lt;br /&gt;&lt;br /&gt;Connection Times (ms)&lt;br /&gt;              min  mean[+/-sd] median   max&lt;br /&gt;Connect:        0    0   0.0      0       1&lt;br /&gt;Processing:     0    1   0.5      1      14&lt;br /&gt;Waiting:        0    1   0.5      1      14&lt;br /&gt;Total:          0    1   0.5      1      14&lt;br /&gt;&lt;br /&gt;Percentage of the requests served within a certain time (ms)&lt;br /&gt;  50%      1&lt;br /&gt;  66%      1&lt;br /&gt;  75%      1&lt;br /&gt;  80%      1&lt;br /&gt;  90%      1&lt;br /&gt;  95%      2&lt;br /&gt;  98%      2&lt;br /&gt;  99%      2&lt;br /&gt; 100%     14 (longest request)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here goes the Lua result:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Document Path:          /&lt;br /&gt;Document Length:        11 bytes&lt;br /&gt;&lt;br /&gt;Concurrency Level:      5&lt;br /&gt;Time taken for tests:   6.666 seconds&lt;br /&gt;Complete requests:      100000&lt;br /&gt;Failed requests:        0&lt;br /&gt;Write errors:           0&lt;br /&gt;Total transferred:      34600000 bytes&lt;br /&gt;HTML transferred:       1100000 bytes&lt;br /&gt;Requests per second:    15001.08 [#/sec] (mean)&lt;br /&gt;Time per request:       0.333 [ms] (mean)&lt;br /&gt;Time per request:       0.067 [ms] (mean, across all concurrent requests)&lt;br /&gt;Transfer rate:          5068.72 [Kbytes/sec] received&lt;br /&gt;&lt;br /&gt;Connection Times (ms)&lt;br /&gt;              min  mean[+/-sd] median   max&lt;br /&gt;Connect:        0    0   0.0      0       4&lt;br /&gt;Processing:     0    0   0.1      0       4&lt;br /&gt;Waiting:        0    0   0.1      0       4&lt;br /&gt;Total:          0    0   0.1      0       5&lt;br /&gt;&lt;br /&gt;Percentage of the requests served within a certain time (ms)&lt;br /&gt;  50%      0&lt;br /&gt;  66%      0&lt;br /&gt;  75%      0&lt;br /&gt;  80%      0&lt;br /&gt;  90%      0&lt;br /&gt;  95%      1&lt;br /&gt;  98%      1&lt;br /&gt;  99%      1&lt;br /&gt; 100%      5 (longest request)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The node.js code was as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;var sys = require('sys'),&lt;br /&gt;  http = require('http');&lt;br /&gt;&lt;br /&gt;http.createServer(function (request, response) {&lt;br /&gt;  response.writeHead(200, {'Content-Type': 'text/plain'});&lt;br /&gt;  response.end('Hello World\n');&lt;br /&gt;}).listen(8000);&lt;br /&gt;sys.puts('Server running at http://127.0.0.1:8000/');&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And in its turn, the Lua script used to run the server is here:&lt;br /&gt;http://lua-users.org/lists/lua-l/2002-04/msg00180.html - slightly tweaked to make it run.&lt;br /&gt;&lt;br /&gt;This is not anunfair comparison, since node.js runs a heavily optimized server, and the lua runs an off-the-shelp example, and yet outperforms Node.js almost 3x. &lt;br /&gt;&lt;br /&gt;Though, more complicated code might result mostly in slowing down - so, the ballpark should be about right.&lt;br /&gt;&lt;br /&gt;I will update this post if I get anything more complex on the lua side.&lt;br /&gt;&lt;br /&gt;EDIT: in fact, a little bit of reverse engineering shows that Node.js code is also somewhat naive: "FOO /\n\n" works perfectly as a "request" for the above app. So the tests are more or less adequately show the status quo. Roughly 3x speed difference, that is.&lt;br /&gt;&lt;br /&gt;EDIT2: http://factor-language.blogspot.com/2010/05/comparing-factors-performance-against.html has some more interesting stats.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5261216887913022281?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5261216887913022281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5261216887913022281' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5261216887913022281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5261216887913022281'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/05/nodejs-vs-lua-microbenchmarking.html' title='Node.js vs. lua microbenchmarking'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4880756916690795263</id><published>2010-05-11T03:26:00.002+02:00</published><updated>2010-05-11T03:31:01.180+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='prosody'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>prosody one-shot makefile on 64-bit arch</title><content type='html'>Today I tested my &lt;a href="http://github.com/ayourtch/prosody-makefile "&gt;prosody-one-shot-makefile&lt;/a&gt; on my Xen VPS which happens to sit atop the 64-bit CPU.&lt;br /&gt;&lt;br /&gt;After a few tweaks it now compiles and makes a self-contained copy of prosody on both 32-bit and 64-bit linuxes.&lt;br /&gt;&lt;br /&gt;Interesting how the XMPP server immediately got got integrated when I launched it, and I could communicate with a demo account from my other XMPP accounts. Admittedly, I did not expect such a plug'n'play.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4880756916690795263?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4880756916690795263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4880756916690795263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4880756916690795263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4880756916690795263'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/05/prosody-one-shot-makefile-on-64-bit.html' title='prosody one-shot makefile on 64-bit arch'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8800971783302961335</id><published>2010-05-09T15:07:00.023+02:00</published><updated>2010-05-09T20:40:09.469+02:00</updated><title type='text'>Haute couture 2010: Privacy  Your latest luxury item to brag about</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://en.wikipedia.org/wiki/Pied_Piper_of_Hamelin"&gt;&lt;img style="float:right; margin:10px 0 10px 0;cursor:pointer; cursor:hand;width: 250px; height: 202px;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Pied_Piper2.jpg/250px-Pied_Piper2.jpg" border="0" alt="Pied Piper of Hamelin" /&gt;&lt;/a&gt;&lt;br /&gt;The fate of chronic privacy deprivation that we are facing worries quite a few, and spurs a lot of heated discussions "we will do it better!". &lt;br /&gt;&lt;br /&gt;Those inevitably bring up a question: "But Facebook is free, who is going to pay you ?"&lt;br /&gt;&lt;br /&gt;So here's my take on it. Similar to how you &lt;a href="http://www.scientificblogging.com/news_releases/study_low_income_equals_high_obesity"&gt;have to be "rich" to control your weight&lt;/a&gt;, you will have to be "rich" to control your privacy. &lt;br /&gt;&lt;br /&gt;So, the new services would have free accounts that are all-public (which is how you have to treat your info now, anyway - &lt;a href="http://www.eff.org/deeplinks/2010/04/facebook-timeline/"&gt;just extrapolate&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;The paid accounts (something in the ballpark of $9/month) would allow making the information private. Or, one could go a bit more creative and sell privacy apiece - the more you pay, the more you can hide, and you pay only for the stuff you want to hide - so the distinction between the paid and free accounts would blur.&lt;br /&gt;&lt;br /&gt;All of the accounts would allow the export of data into other services, should "this" social provider go off-rail.&lt;br /&gt;&lt;br /&gt;The data formats as well as the interaction between the different providers would be standardized, so it would not really matter whether you and your friends are on the same provider or not.&lt;br /&gt;&lt;br /&gt;This may not seem pretty, but I think this approach would be better than changing the smallprint in the ToS overtime.&lt;br /&gt;&lt;br /&gt;Because there's no free lunch. It's just about charging in different currencies.&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;br /&gt;Now, I am curious (and you probably are curious too) about the correctness of the assumptions above, so here's a poll for you. &lt;br /&gt;&lt;br /&gt;&lt;form method="post" action="http://poll.pollcode.com/mh2l"&gt;&lt;table border=0 width=450 bgcolor="#ffffff" cellspacing=0 cellpadding=0&gt;&lt;tr&gt;&lt;td colspan=2&gt;&lt;b&gt;What would you choose ?&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=5&gt;&lt;input type=radio name=answer value="1"&gt;&lt;/td&gt;&lt;td&gt;&lt;font face="Verdana" size=-1 color="000000"&gt;Stay on current social network&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=5&gt;&lt;input type=radio name=answer value="2"&gt;&lt;/td&gt;&lt;td&gt;&lt;font face="Verdana" size=-1 color="000000"&gt;Get a free all-public account - or host your own instance with the privacy settings you choose&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=5&gt;&lt;input type=radio name=answer value="3"&gt;&lt;/td&gt;&lt;td&gt;&lt;font face="Verdana" size=-1 color="000000"&gt;All-inclusive privacy paid account&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=5&gt;&lt;input type=radio name=answer value="4"&gt;&lt;/td&gt;&lt;td&gt;&lt;font face="Verdana" size=-1 color="000000"&gt;Privacy sold apiece&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=2&gt;&lt;center&gt;&lt;input type=submit value="Vote"&gt;&amp;nbsp;&amp;nbsp;&lt;input type=submit name=view value="View"&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td bgcolor="white" colspan=2 align=right&gt;&lt;font face="Verdana" size=-2 color="black"&gt;pollcode.com &lt;a href=http://pollcode.com/&gt;&lt;font color="navy"&gt;free polls&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr size=1 noshade&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8800971783302961335?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8800971783302961335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8800971783302961335' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8800971783302961335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8800971783302961335'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/05/haute-couture-2010-privacy-your-latest.html' title='Haute couture 2010: Privacy &lt;br/&gt; &lt;font size=&quot;-1&quot;&gt;Your latest luxury item to brag about&lt;/font&gt;'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-6169327426430223816</id><published>2010-04-29T22:10:00.004+02:00</published><updated>2010-04-29T22:23:58.317+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nat'/><title type='text'>Thoughts about NAT</title><content type='html'>Reading the NANOG thread about "The alleged evils of NAT", I wanted to come up with a semantic parallel, for the fun of it. Here it is:&lt;br /&gt;&lt;br /&gt;NAT is like "tax optimization". &lt;br /&gt;&lt;br /&gt;It's not illegal. But it may feel wrong. &lt;br /&gt;&lt;br /&gt;It allows to represent things differently than you would think they are. &lt;br /&gt;&lt;br /&gt;If you go too far with it, you end up in a real mess.&lt;br /&gt;&lt;br /&gt;It brings very tangible benefits for those practicing it.&lt;br /&gt;&lt;br /&gt;And those who don't - have to pay up on the communal goods for those who do.&lt;br /&gt;&lt;br /&gt;Henceforth, they always argue with each other when they meet.&lt;br /&gt;&lt;br /&gt;It creates a new profession dedicated to it.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;As for my personal opinion, I'll just quote an anecdote: "it said 'celebrate', not 'celibate'".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-6169327426430223816?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/6169327426430223816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=6169327426430223816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6169327426430223816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/6169327426430223816'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/04/thoughts-about-nat.html' title='Thoughts about NAT'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7543990587762641510</id><published>2010-03-29T03:06:00.003+02:00</published><updated>2010-04-18T01:47:50.635+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>The taste of lua as a web app language</title><content type='html'>This is a snippet of the web app that is written in lua, using my experimental framework:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/347210.js?file=gistfile1.lua"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Not RoR but is reasonably convenient, though would be nice to get rid of some of the braces/parens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7543990587762641510?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7543990587762641510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7543990587762641510' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7543990587762641510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7543990587762641510'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/03/taste-of-lua-as-web-app-language.html' title='The taste of lua as a web app language'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2796757070615750607</id><published>2010-03-23T22:11:00.000+01:00</published><updated>2010-03-23T22:18:59.564+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='information'/><category scheme='http://www.blogger.com/atom/ns#' term='business'/><title type='text'>Solution for the "paid content" and online newspapers.</title><content type='html'>It's all here: http://www.holovaty.com/writing/fundamental-change/ - the newspapers just need to keep providing the "human-readable" content for free, and charge for the structured/machine-readable data, that might be possible to further aggregate/analyse. &lt;br /&gt;&lt;br /&gt;How many of the "paid members" will that generate ? That's a good question - but I'd wager that people's curiousity could be a good help to this. Think of this more somewhat like a "click &amp; pay here for more info", but rather than content-wise, you do that semantically.&lt;br /&gt;&lt;br /&gt;Imagine this to be similar to a progressive JPEG (or different formats of the picture) - lower-resolution picture is free, and you need to pay a modest amount for the hi-res one. &lt;br /&gt;&lt;br /&gt;Those who are interested by the core fact - will get only the core fact for free. Those who are interested in full glory - will use micropayment to get there. ($0.1 might be the right amount)&lt;br /&gt;&lt;br /&gt;Of course, this implies working micropayments...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2796757070615750607?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2796757070615750607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2796757070615750607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2796757070615750607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2796757070615750607'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/03/solution-for-paid-content-and-online.html' title='Solution for the &quot;paid content&quot; and online newspapers.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1816161924032097340</id><published>2010-03-22T02:34:00.003+01:00</published><updated>2010-03-22T02:35:55.025+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='prosody'/><title type='text'>One-shot makefile for Prosody updated + on github</title><content type='html'>I've updated the makefile to compile 0.6.1, and rather than putting it onto the blog posts, it's now on github:&lt;br /&gt;&lt;br /&gt;http://github.com/ayourtch/prosody-makefile&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1816161924032097340?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1816161924032097340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1816161924032097340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1816161924032097340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1816161924032097340'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/03/one-shot-makefile-for-prosody-updated.html' title='One-shot makefile for Prosody updated + on github'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7798016246580959845</id><published>2010-03-22T01:00:00.004+01:00</published><updated>2010-03-22T01:04:58.050+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='quine'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>Lua quine</title><content type='html'>For some reason lately I've seen an anomalous number of mention of quines, and figured it'd be time to try it out myself (I read about this question back in 1990s, but for some reason never got myself at solving it. here's the result in Lua.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function p(s)&lt;br /&gt;  print(s)&lt;br /&gt;  print("\ns = " .. string.format("%q", s) .. "\np(s)")&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;s = "function p(s)\n  print(s)\n  print(\"\\ns = \" .. string.format(\"%q\", s) .. \"\\np(s)\")\nend"&lt;br /&gt;p(s)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;And, just in case that blogger mucks up my quoting, here's a base64-encoded version:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ZnVuY3Rpb24gcChzKQogIHByaW50KHMpCiAgcHJpbnQoIlxucyA9ICIgLi4gc3RyaW5nLmZvcm1h&lt;br /&gt;dCgiJXEiLCBzKSAuLiAiXG5wKHMpIikKZW5kCgpzID0gImZ1bmN0aW9uIHAocylcbiAgcHJpbnQo&lt;br /&gt;cylcbiAgcHJpbnQoXCJcXG5zID0gXCIgLi4gc3RyaW5nLmZvcm1hdChcIiVxXCIsIHMpIC4uIFwi&lt;br /&gt;XFxucChzKVwiKVxuZW5kIgpwKHMpCg==&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7798016246580959845?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7798016246580959845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7798016246580959845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7798016246580959845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7798016246580959845'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/03/lua-quine.html' title='Lua quine'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2419451418170984465</id><published>2010-02-12T02:00:00.004+01:00</published><updated>2010-02-12T02:22:42.532+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fosdem'/><title type='text'>FOSDEM2010: now we might call ourselves "NOC"</title><content type='html'>A belated 2010 follow-up to the &lt;a href="http://bnpcs.blogspot.com/2009/02/fosdem09-memories-of-yellow-t-shirt.html"&gt;last year's experience&lt;/a&gt;. This year, as you've probably seen in the news, was quite fun. Thanks to the help from BELNET (and of course the Fosdem folks who did all the discussions), and the two rolls of fiber, we had 1gbps uplink, and 1gbps link between H and AW. &lt;br /&gt;&lt;br /&gt;The most stressing moment was when on Friday at 5pm we discovered that 5 out of 6 strands of fiber that were planned to connect us to the internet, were not working. Plan B (which plan B? we already tested everything! it worked!) was pretty weak. So, applying some logic and with a bit of luck, the problem was solved by resplicing one of the ends.&lt;br /&gt;&lt;br /&gt;After that, a few hours trying to build the correct OS platform to install the management software, which supposedly could magically convert some of the APs that we had into the correct mode, rather than us doing manually. At something like 11pm we realised manual was faster - but we didn't have the power supplies with us, but since the security folks wanted to close the doors, we grabbed a few access-points and went to the office to fix them up.&lt;br /&gt;&lt;br /&gt;The process of converting access-points from standalone into management mode is dead-simple - hold the button while the AP is powercycled, then power it on with the button is pressed, and wait till the two out of three LEDs on the top turn red. Then release the button, and the AP will grab the predefined address 10.0.0.1 and will start the TFTP download of the image with the default name. All good except the TFTP requests would be sent to broadcast address. It took me about 7 access-points (as measured by Jerome converting them with some naive TFTP server under windows), till I have figured out how to get the atftpd to react: "ifconfig eth0 promisc". Really-really weird. I thought tcpdump - which was running in parallel - was already putting the interface into promiscuous mode.&lt;br /&gt;&lt;br /&gt;Anyway, once I found the trick, the rest of the conversion was trivial, so when I started up at 5am, the remaining of the APs were trivial and fast to convert.&lt;br /&gt;&lt;br /&gt;This year the access-points we used had a bit more juice - both on 2.4Ghz and 5Ghz - so we managed to kick off some interference to the wireless mic in Jansson. And this year we used the feature to "kill" the rogue APs - which were apparently not so low in number. Strange. I thought people would come to the conference to listen, rather than to annoy others. Nonetheless, killing the phy seems to work - at least this year I saw much less of "strange" SSIDs. Next year we should enable the triangulation, to go and ask personally :)&lt;br /&gt;&lt;br /&gt;The kicker this year was that the network was full-dualstack. And, I cooked the bind9 to point to the SixXS recursive servers (thanks guys for the service!), DNS queries going over the SixXS tunnel. A bit of a chewing-gum and matches, but worked fine over the period of two days - and looking at the SixXS traffic graph, it felt like we even made some bump for the gateway by our queries - although this is most probably wishful thinking.&lt;br /&gt;&lt;br /&gt;I don't know how many people noticed their google.com traffic was IPv6-based (being geek conference and such). But if they did not - even better! That means - IPv6 works!&lt;br /&gt;&lt;br /&gt;All in all, it seems like everyone was quite happy - the visitors (thanks for being there!), the Fosdem staff (it was fun, guys! Let's do it next year!), and ourselves.&lt;br /&gt;&lt;br /&gt;On to FOSDEM2011!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2419451418170984465?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2419451418170984465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2419451418170984465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2419451418170984465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2419451418170984465'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2010/02/fosdem2010-now-we-might-call-ourselves.html' title='FOSDEM2010: now we might call ourselves &quot;NOC&quot;'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-8529172419390578277</id><published>2009-12-07T12:04:00.007+01:00</published><updated>2009-12-07T19:28:17.645+01:00</updated><title type='text'>VMWare server 2 "empty" screen with "Loading..." in the title</title><content type='html'>I've installed the VMWare server, and as many, hit the issue of an empty screen.&lt;br /&gt;&lt;br /&gt;It appears to happen upon the subsequent logins. Obviously "empty screen" can be caused by a lot of errors, but in my case it seems to be some SSL-related issue, in /var/log/vmware/hostd.log I saw:&lt;br /&gt;&lt;br /&gt;[2009-12-07 11:58:12.150 'Proxysvc' 1093462352 warning] SSL Handshake on client connection failed: SSL Exception: &lt;br /&gt;[2009-12-07 11:58:12.316 'Proxysvc Req00102' 1081919824 warning] PendingServerStrm: client write-completion error: SSL Exception: error:00000001:lib(0):func(0):reason(1)&lt;br /&gt;[2009-12-07 11:58:12.573 'Proxysvc Req00101' 1081919824 warning] PendingServerStrm: client write-completion error: SSL Exception: error:00000001:lib(0):func(0):reason(1)&lt;br /&gt;&lt;br /&gt;What seems to help - is holding the Control key and hitting the "reload" button when I am on the page that does not show anything. &lt;br /&gt;&lt;br /&gt;Then the page reloads fully and I get the login prompt to login into the VM.&lt;br /&gt;&lt;br /&gt;Hope this is useful to someone.&lt;br /&gt;&lt;br /&gt;I later tried on the ff-3.5, and there Ctrl-Shift-R for reload, apparently did the trick as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-8529172419390578277?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/8529172419390578277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=8529172419390578277' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8529172419390578277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/8529172419390578277'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/12/vmware-server-2-empty-screen-with.html' title='VMWare server 2 &quot;empty&quot; screen with &quot;Loading...&quot; in the title'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5884790738849910003</id><published>2009-11-03T02:09:00.002+01:00</published><updated>2009-12-07T12:04:37.223+01:00</updated><title type='text'>Recording sound and video from a webcam</title><content type='html'>I've found a lot of questions on the internet on how to record the sound and video at the same time from the webcam. Here's the magic incantation that worked well for me (it assumes you do not have any video capture devices besides the webcam and already have one ALSA soundcard besides the mic of the webcam - if not, adjust accordingly). This is a single long line:&lt;br /&gt;&lt;br /&gt;mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0:fps=30:forceaudio:alsa:adevice=hw.1 -ovc lavc threads=2 -ffourcc xvid  -oac mp3lame -lameopts cbr=128  -o recording.avi&lt;br /&gt;&lt;br /&gt;EDIT: with a purchase of the Sony Playstation Eye camera, the above does not work all that well at all - at the high rate my mencoder misses too many frames. Something I found that is a bit better:&lt;br /&gt; &lt;br /&gt;gst-launch v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=(fraction)25/1' ! mux. alsasrc ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' ! mux. avimux name=mux ! filesink location=test.avi&lt;br /&gt;&lt;br /&gt;This lacks the compression, and the voice is a bit dragging compared to video - but gives more or less the 30fps that the webcam sends.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5884790738849910003?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5884790738849910003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5884790738849910003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5884790738849910003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5884790738849910003'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/11/recording-sound-and-video-from-webcam.html' title='Recording sound and video from a webcam'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7191273136845416572</id><published>2009-06-14T00:58:00.002+02:00</published><updated>2009-06-14T01:01:23.517+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>configure: error: C++ preprocessor "/lib/cpp" fails sanity check</title><content type='html'>A fairly odd message, especially given that 'which cpp' shows another location.&lt;br /&gt;&lt;br /&gt;The solution is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo aptitude install build-essential&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7191273136845416572?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7191273136845416572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7191273136845416572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7191273136845416572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7191273136845416572'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/06/configure-error-c-preprocessor-libcpp.html' title='configure: error: C++ preprocessor &quot;/lib/cpp&quot; fails sanity check'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-3297819090287144241</id><published>2009-05-28T01:05:00.005+02:00</published><updated>2009-05-28T03:05:48.449+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><title type='text'>F*ctor - a 0-dimensional Turing tarpit.</title><content type='html'>Following a post of one of my friends to the http://manage.yore.ma/eso/, I felt a bit inspired, &lt;br /&gt;so I wanted to write up something fun. So, here's the experiment - an imaginary language which holds the entire program and data memory in a single variable! &lt;br /&gt;&lt;br /&gt;The F*ctor machine has only other elements are a single instruction, and a single variable which holds the Program, and Data, and the machine state, in just a single natural number X. The "single instruction", however, is a bit difficult to describe, so I will attempt to describe it in terms of smaller "micro-operations" - they do not really change nor are visible to the user, they are here mostly for the sake of explanation. The temp variable in the pseudocode is just for the sake of ease of comprehension.&lt;br /&gt;&lt;br /&gt;The machine can really efficiently calculate Prime(N) (being the Nth prime, that is Prime(0) == 2; Prime(1) == 3, Prime(2) == 5, etc.)&lt;br /&gt;&lt;br /&gt;Also it can count how many times is the given number divisible by some prime: CountPrime(V, P); CountPrime(2,2) == 1, CountPrime(9,3) == 2; CountPrime(13,3) == 0.&lt;br /&gt;&lt;br /&gt;Finally, the third operation is the destructive divide: DivideBy(V, P) - try to integer-divide V in-place by a prime P ith no remainder, and return True if we were successful, and False if no remainder-free division is possible.&lt;br /&gt;&lt;br /&gt;The remaining operations that comprise the single cycle are some trivial arithmetics.&lt;br /&gt;&lt;br /&gt;the single cycle of execution:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;one_cycle(X) {&lt;br /&gt;  local CurrentP = CountPrime(X, 3);&lt;br /&gt;  while(DivideBy(&amp;X, 2)) {&lt;br /&gt;    if(not DivideBy(&amp;X, Prime(CountPrime(X, Prime(CurrentP))))) {&lt;br /&gt;      return X * 3 * 3;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  return X * 2^CountPrime(X, Prime(CurrentP)) * 3;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So running the program consists of repeatedly executed "X = one_cycle(X)".&lt;br /&gt;&lt;br /&gt;If we take a closer look, then this is nothing more than a folded version of &lt;a href="http://en.wikipedia.org/wiki/OISC#Reverse-subtract_and_skip_if_borrow"&gt;Reverse-subtract and skip if borrow&lt;/a&gt; single-instruction machine, with "memory contents" at location N being the number of times the X is divisible by Nth prime number. As it is visible, the accumulator is memory-mapped at 0 (see these divisions/multiplications by 2?) and the program counter is memory-mapped at 1 (see the multiplications either by 3 or by 9 ?)&lt;br /&gt;&lt;br /&gt;So, unless I made a bug somewhere in the logic, we have a Turing-complete absract machine squashed into a single variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-3297819090287144241?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/3297819090287144241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=3297819090287144241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3297819090287144241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/3297819090287144241'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/05/fctor-0-dimensional-turing-tarpit.html' title='F*ctor - a 0-dimensional Turing tarpit.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-370498975965429607</id><published>2009-05-16T03:57:00.002+02:00</published><updated>2009-05-16T04:01:55.184+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hci'/><category scheme='http://www.blogger.com/atom/ns#' term='opencv'/><title type='text'>A "nod" X11 linux interface</title><content type='html'>Today I wanted to spend the evening doing something different and fun, and came up with an idea to play around with some of the &lt;a href="http://sourceforge.net/projects/opencvlibrary/"&gt;opencv&lt;/a&gt;'s functions. Well, did not play that much - just slightly tweaked the facedetect.c, to get what I called a "nod interface".&lt;br /&gt;&lt;br /&gt;When you compile and launch the program, it pops up the screen with the video. If all goes well and you are sitting in front of your camera, you should see a circle around your face. If you do not see it - move closer and/or get a smoother background.&lt;br /&gt;&lt;br /&gt;The few lines of pretty silly code that I've added does the following: calculates the two averages of the last N points of the center of the detected face object - "fast" (N=4) and "smooth" (N=8).&lt;br /&gt;&lt;br /&gt;If you don't move your head the delta between these will be almost 0 - it gets forced down to zero by a simple check against the threshold.&lt;br /&gt;&lt;br /&gt;If you nod - then obviously the "fast" average moves down faster than the "smooth" one - so if you nod energetic enough, the computer will notice it and will send a few "arrow down" synthetic events via the XTest X11 extension. If you manage to "nod up" (unnatural, but somewhat doable) - then it will send the equivalent number of "arrow up" events.&lt;br /&gt;&lt;br /&gt;The counter-movement (returning the head back after the nod) is compensated by another simple logic - it's needed to have at least 4 "zero-delta" cycles in order to let the detected delta through.&lt;br /&gt;&lt;br /&gt;The end result is that with some amount of luck you might manage to read things from your laptop hands-free. Should be good for reading the /. threads :-)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://employees.org/~andin/nod-interface.c"&gt;this file&lt;/a&gt; is the tweaked facedetect.c - the long line to feed to the compiler is in the comments in the beginning.&lt;br /&gt;&lt;br /&gt;Depending on the speed of your computer, you might need to adjust some of the thresholds.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-370498975965429607?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/370498975965429607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=370498975965429607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/370498975965429607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/370498975965429607'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/05/nod-x11-linux-interface.html' title='A &quot;nod&quot; X11 linux interface'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4625131753242901510</id><published>2009-05-07T03:12:00.002+02:00</published><updated>2009-05-07T03:13:23.128+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>Hercules DJ Console RMX linux midi drivers</title><content type='html'>Yay! Open source and all. Get the MIDI out of the RMX.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ts.hercules.com/eng/index.php?pg=view_files&amp;gid=2&amp;fid=28&amp;pid=215&amp;cid=1"&gt;Grab them here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4625131753242901510?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4625131753242901510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4625131753242901510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4625131753242901510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4625131753242901510'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/05/hercules-dj-console-rmx-linux-midi.html' title='Hercules DJ Console RMX linux midi drivers'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7368120303847685816</id><published>2009-05-02T06:09:00.003+02:00</published><updated>2009-05-02T06:13:28.758+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='minilight'/><category scheme='http://www.blogger.com/atom/ns#' term='renderer'/><title type='text'>A very compact renderer</title><content type='html'>Been a while since I babbled something here.&lt;br /&gt;&lt;br /&gt;So to ensure I'm still alive and kicking - here's something neat: a renderer in under 600 lines of code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hxa.name/minilight/"&gt;Minilight&lt;/a&gt; has a bunch of implementations in various languages.&lt;br /&gt;&lt;br /&gt;A very nice toy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7368120303847685816?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7368120303847685816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7368120303847685816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7368120303847685816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7368120303847685816'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/05/compact-and-fast-renderer.html' title='A very compact renderer'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1809671274681428626</id><published>2009-04-04T21:15:00.003+02:00</published><updated>2009-04-04T21:59:40.986+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cosimus'/><title type='text'>Linear interpolation code for smoothing out the Z-movement</title><content type='html'>Today I've got a dead-simple but pretty cute piece of code in. It has to do with smooth avatar movement when walking. The map of heights is stored with the resolution of 1 meter, while in the viewer it's smoothed out. This creates a "staircase"-like effect when walking on the slope.&lt;br /&gt;&lt;br /&gt;The simple solution which I went to is to do the linear interpolation, with the following &lt;br /&gt;approach. First we look at the heightmap "from the top" - just looking at its X and Y coordinates. And logically we split the X-Y space into a bunch of 1-sized squares. So we always &lt;br /&gt;have our x,y point for which we are calculating, inside one of these small tiles. So we can zoom into this tile and take further look: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    (x0,y0)  (x0+1, y0)&lt;br /&gt;     |      /&lt;br /&gt;     v     v&lt;br /&gt;     +-----+---&gt; X&lt;br /&gt;     |\ 1 /|&lt;br /&gt;     | \ / |&lt;br /&gt;     |4 + 2|&lt;br /&gt;     | / \ |&lt;br /&gt;     |/ 3 \|&lt;br /&gt;     +-----+ &lt;-- (x0+1, y0+1)&lt;br /&gt;     |&lt;br /&gt;     v&lt;br /&gt;     Y&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;in this picture - the corners of the square are the integer X, Y values which have the data.&lt;br /&gt;&lt;br /&gt;The point in the center is the "virtual" point which is used to split the square into four triangles - it's x,y coordinates are simply X0+0.5, Y0+0.5.&lt;br /&gt;&lt;br /&gt;Then we can pretty simply find which of the triangles holds our "interesting" point - now it's all dead simple - find the equation of the plane that passes through the three points the coordinates of which we know (the Z coordinate of the "center" point is the average of the Z coordinates of all 4 corners) - and then simply substitute the X, Y into the equation, to get Z straight away.&lt;br /&gt;&lt;br /&gt;I don't have walking animations yet - for now I simply set the Z coordinate of the avatar, which gets its butt approximately at ground level :-) While running around, if one would measure by the proportions to the real world, the staircase effect is reduced to almost unnoticeable ~10cm if we relate to the real-world body proportions. And I hope that once I get the avatar's butt out of the ground, it should be even better visually.&lt;br /&gt;&lt;br /&gt;Now, the obvious question - why 4 triangles, instead of 2 ? Because if you take the following layout:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;0---*&lt;br /&gt;|   |&lt;br /&gt;*---0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and the "*" is "high" an "0" is "low" - depending on the choice to cut this X-Y box, you get either a pit, or a spike. 4 triangles handle this case noticeably better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1809671274681428626?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1809671274681428626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1809671274681428626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1809671274681428626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1809671274681428626'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/04/linear-interpolation-code-for-smoothing.html' title='Linear interpolation code for smoothing out the Z-movement'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5437888739826672534</id><published>2009-03-30T02:40:00.004+02:00</published><updated>2009-03-30T02:54:32.365+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cosimus'/><title type='text'>Cosimus now with avatar shapes and clothing</title><content type='html'>Today I took a brute-force approach to solving the missing avatar clothing problem that &lt;br /&gt;I was chasing for a few days - simply by creating my own set of the default clothing and wearables.&lt;br /&gt;It's just the standard set of items which are uploaded by the viewer in the case it does not find them - so for the secondlifers, it's Ruth in white clothing :)&lt;br /&gt;&lt;br /&gt;Alongside, I've put a very simple moving logic - only forward, in the direction that the avatar faces. This required some rudimentary support for something the called "scene" in opensim - or at least my interpretation of it. For now, I am taking the assumption "Agent == Avatar", it probably will change sometime in the future. However, I already put the "clientstack-independent scene" atop the SMV one - to represent the qualities that are (or should be) fundamental to any avatar system - X, Y, Z position, AgentID - I'll use the UUIDs for representing the "entity" for now, and the "label" - some text that identifies the avatar as seen in-world. &lt;br /&gt;&lt;br /&gt;The rest of the platform-dependent details go into a table called "Blob" which is at the moment SMV-specific data about the avatar (like, local object ID, which is needed for the viewer, as each avatar has its own local id to be drawn correctly). &lt;br /&gt;&lt;br /&gt;Possibly exposing a "local avatar id" might have been a better move for the platform-independent record, and having the clientstack-specific lookup tables.. But I will see in the future what is better. In any case, each clientstack registers its own event handler functions, which are called per-avatar in case the need arises (this indeed raises some additional possibilities for optimization in the future).&lt;br /&gt;&lt;br /&gt;Alongside the minor infra mods, the loginserver config is now in the config file (main.lua), as well as the serializable state to facilitate trivial no-outage restarts is inside a separate file.&lt;br /&gt;&lt;br /&gt;Interestingly enough, there seems to be something odd with the object update packet - the omvviewer tends to hard-hang the laptop - I am not sure which part is causing that. And somehow I managed to get some green text atop the avatar at one occasion, which was funny.&lt;br /&gt;&lt;br /&gt;As the vacation time is over now for me, most definitely the speed of the development will suffer - I'll only have some late nights, which are also good to be used for sleep, but I am pretty happy with the progress so far.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5437888739826672534?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5437888739826672534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5437888739826672534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5437888739826672534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5437888739826672534'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/03/cosimus-now-with-avatar-shapes-and.html' title='Cosimus now with avatar shapes and clothing'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4493386584467394900</id><published>2009-03-29T13:42:00.004+02:00</published><updated>2009-03-29T13:56:39.255+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cosimus'/><title type='text'>Cosimus - a little toolkit for metaverse experiments</title><content type='html'>The past two weeks I've been on holiday - so this translated for doing various things that I did not have time to do before. One of those things was completing the chunk of coding needed to at least start with my little metaverse experiment.&lt;br /&gt;&lt;br /&gt;The result is at http://github.com/ayourtch/cosimus/tree/master - and will suffer the periodic commits from now on, depending on my so called "spare time" :)&lt;br /&gt;&lt;br /&gt;It's a start of the simulator code for the 3d simulator, for now I've started with the SecondLife(tm) protocol, as it's something I had in the beginning of the works.&lt;br /&gt;&lt;br /&gt;For now it is a custom Lua interpreter, with a few libraries linked in and initialized by default, and the application code in prototype phase is being written in Lua. This gives the much faster speed of the development compared to C (a long while ago, while checking the speed of development on Perl vs. C I found about 10x difference - in favour of Perl, of course. I did not do any personal measurements now, but from a gut feeling it should be about the same). Much later, as needed, I'll push the performance-critical pieces of the code downwards to C. &lt;br /&gt;&lt;br /&gt;For now the thing does not do all that much - these few days I've been mostly dealing with the inventory/asset code, appears there are some magic tweaks still needed - from the behaviour it seems like I am triggering some data corruptions in the client inventory code.. &lt;br /&gt;&lt;br /&gt;From the cool features that are already there - the inventory/asset library loading is done from zipfiles, which means easier handling of them for the consumer. Another fun feature - or rather design choice - is that all the communication via the components that is possible to be networked in the distributed setup, will be also networked in the standalone setup, with the simple servers doing the job from within the executable itself. So it is "batteries included", and a single code path to debug.&lt;br /&gt;&lt;br /&gt;...Now, back to coding :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4493386584467394900?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4493386584467394900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4493386584467394900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4493386584467394900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4493386584467394900'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/03/cosimus-little-toolkit-for-metaverse.html' title='Cosimus - a little toolkit for metaverse experiments'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5873664205701102162</id><published>2009-03-11T01:28:00.002+01:00</published><updated>2009-03-11T01:31:14.613+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zettair'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Compiling zettair on ubuntu</title><content type='html'>The first compile throws a bunch of errors, due to missing zlib, among them:&lt;br /&gt;&lt;br /&gt;‘Z_NO_FLUSH’ undeclared&lt;br /&gt;&lt;br /&gt;solution - sudo apt-get install zlib1g-dev, then rerun configure script, and all compiles fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5873664205701102162?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5873664205701102162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5873664205701102162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5873664205701102162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5873664205701102162'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/03/compiling-zettair-on-ubuntu.html' title='Compiling zettair on ubuntu'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-7212640369306263902</id><published>2009-03-10T23:46:00.003+01:00</published><updated>2009-03-11T00:42:26.371+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zettair'/><title type='text'>Zettair is back alive</title><content type='html'>Hooray! &lt;a href="http://www.seg.rmit.edu.au/zettair/"&gt;Zettair&lt;/a&gt; folks down in Oz have revived the development. "in-development" version now online.&lt;br /&gt;&lt;br /&gt;Let's see what we have (with a brutal diff -rc across the directories :-) Disclaimer: this is not necessarily a complete list, at least in the autoconf part - the diff was fairly boring and long. &lt;br /&gt;Alternatively, I might have missed it in the set of whitelist changes or did not get a clue it was important...:)&lt;br /&gt;&lt;br /&gt;configure script got what looks a 64-bit "kfreebsd". Probably inherited with a newer version of autotools, but an interesting beast nonetheless, if I read it well, it is &lt;a href="http://www.debian.org/ports/kfreebsd-gnu/"&gt;here&lt;/a&gt;. GNU userland running on top of freebsd kernel.. The other tweaks belong to &lt;a href="http://www.dragonflybsd.org/"&gt;dragonflybsd&lt;/a&gt;. I heard about Hammer filesystem, but haven't tried the OS yet. Might be interesting. All depends on the H/w support.&lt;br /&gt;&lt;br /&gt;index.h: &lt;br /&gt;&lt;br /&gt;option INDEX_NEW_VOCAB is gone, INDEX_NEW_PARSEBUF (dictate how large the postings hashtable is) appeared. &lt;br /&gt;&lt;br /&gt;INDEX_NEW_NO_OFFSETS - build the index without offsets. Probably not very interesting for me... &lt;br /&gt;&lt;br /&gt;INDEX_NEW_QTHREADS - how many query threads to allow. Now I wonder if this allows for simultaneous query and indexing - that'd be sweet. My experiments with the previous version running separate processes were not terribly successful. With threads indeed it might be a different story.&lt;br /&gt;&lt;br /&gt;some other similar parameter changes to index_load (as opposed to index_new)&lt;br /&gt;&lt;br /&gt;index_cleanup is gone.&lt;br /&gt;&lt;br /&gt;INDEX_SEARCH_DYNAMIC_RANK - provide the text describing the rank to be used as well as the rank parameters. Interesting, probably a bit too advanced for my needs.&lt;br /&gt;&lt;br /&gt;autogenerated code for the metrics is obviously now parametrized.&lt;br /&gt;&lt;br /&gt;mutexes for various pieces (For multithreading)&lt;br /&gt;&lt;br /&gt;vocab_vector structure is simplified (looks like thanks to getting rid of multiple files)&lt;br /&gt;&lt;br /&gt;a lot of multithreaded-oriented code&lt;br /&gt;&lt;br /&gt;a hacko-fix in makeindex_append_docno to get around the fact that zettair can't handle docno-s bigger than a pagesize&lt;br /&gt;&lt;br /&gt;vocabury operations seem to be simplified - previously the memory management was more sophisticated.&lt;br /&gt;&lt;br /&gt;This completes the list - again, very probably I missed something important - if so, drop me a note in the comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-7212640369306263902?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/7212640369306263902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=7212640369306263902' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7212640369306263902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/7212640369306263902'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/03/zettair-is-back-alive.html' title='Zettair is back alive'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-712372158224200921</id><published>2009-03-09T22:55:00.003+01:00</published><updated>2009-03-09T23:08:39.396+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='llsd'/><category scheme='http://www.blogger.com/atom/ns#' term='ragel'/><title type='text'>LLSD scanning with ragel-made parser.</title><content type='html'>I've written a while ago about the &lt;a href="http://www.complang.org/ragel/"&gt;Ragel&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Today evening (literally in about 4 hours), I tried it and cooked a semi-functional parser for &lt;a href="http://tools.ietf.org/html/draft-hamrick-llsd"&gt;LLSD XML serialization&lt;/a&gt;. Yes, the code below was cranked from scratch in just a few hours :)&lt;br /&gt;&lt;br /&gt;What's nice is that it is can parse the data by chunks of practically any size, so could be used to grab the data over a slower TCP connection. And - the base64 decoding is included! Things that would need to be done in order to make it usable include proper error handling and a better approach to handle possibly large data - right now it is kind of dumb...&lt;br /&gt;&lt;br /&gt;Here's the result of running it over the sample XML from the draft:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ ./a.out `cat ../sample.llsd`&lt;br /&gt;Array start&lt;br /&gt;Integer: '42'&lt;br /&gt;UUID: '6bad258e06f04a87a659493117c9c162'&lt;br /&gt;Map start&lt;br /&gt;String: 'cold'&lt;br /&gt;Map member with key 'hot':'cold'&lt;br /&gt;Undef&lt;br /&gt;Map member with key 'higgs_boson_rest_mass':'&lt;undef&gt;'&lt;br /&gt;URI: 'https://example.org/r/6bad258e-06f0-4a87-a659-493117c9c162'&lt;br /&gt;Map member with key 'info_page':'https://example.org/r/6bad258e-06f0-4a87-a659-493117c9c162'&lt;br /&gt;Date: '2008-10-13T19:00.00Z'&lt;br /&gt;Map member with key 'status_report_due_by':'2008-10-13T19:00.00Z'&lt;br /&gt;Map end&lt;br /&gt;Array end&lt;br /&gt;result = 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here goes the .rl code in case you're curious (maybe you need to "view source" in case it gets garbled):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &lt;string.h&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;&lt;br /&gt;typedef struct llsd_scanner {&lt;br /&gt;  char *accum;&lt;br /&gt;  int accum_size;&lt;br /&gt;  int accum_index;&lt;br /&gt;&lt;br /&gt;  char *key_accum;&lt;br /&gt;  int key_accum_size;&lt;br /&gt;  int key_accum_index;&lt;br /&gt;&lt;br /&gt;  unsigned char *bin_accum;&lt;br /&gt;  int bin_accum_size;&lt;br /&gt;  int bin_accum_index;&lt;br /&gt;  unsigned char b64chars[4];&lt;br /&gt;&lt;br /&gt;  // ragel variables&lt;br /&gt;  int *stack;&lt;br /&gt;  int stack_size;&lt;br /&gt;  int top;&lt;br /&gt;  int act;&lt;br /&gt;  int cs;&lt;br /&gt;  unsigned char *ts, *te;&lt;br /&gt;  &lt;br /&gt;} llsd_scanner_t;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$&gt;?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";&lt;br /&gt;&lt;br /&gt;static void llsd_scanner_putb64char(llsd_scanner_t *scanner, int index, unsigned char v)&lt;br /&gt;{&lt;br /&gt;  v = (unsigned char) ((v &lt; 43 || v &gt; 122) ? 0 : cd64[ v - 43 ]);&lt;br /&gt;  if( v ) {&lt;br /&gt;    v = (unsigned char) ((v == '$') ? 0 : v - 61);&lt;br /&gt;  }&lt;br /&gt;  if (v) {&lt;br /&gt;    scanner-&gt;b64chars[index] = (unsigned char) (v - 1);&lt;br /&gt;  } else {&lt;br /&gt;    scanner-&gt;b64chars[index] = v;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void b64decodeblock( unsigned char in[4], unsigned char out[3] )&lt;br /&gt;{   &lt;br /&gt;    out[ 0 ] = (unsigned char ) (in[0] &lt;&lt; 2 | in[1] &gt;&gt; 4);&lt;br /&gt;    out[ 1 ] = (unsigned char ) (in[1] &lt;&lt; 4 | in[2] &gt;&gt; 2);&lt;br /&gt;    out[ 2 ] = (unsigned char ) (((in[2] &lt;&lt; 6) &amp; 0xc0) | in[3]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static int append_binchars(llsd_scanner_t *scanner)&lt;br /&gt;{&lt;br /&gt;  if (scanner-&gt;bin_accum_index + 4 &lt; scanner-&gt;bin_accum_size) {&lt;br /&gt;    b64decodeblock(scanner-&gt;b64chars, &amp;scanner-&gt;bin_accum[scanner-&gt;bin_accum_index]);&lt;br /&gt;    scanner-&gt;bin_accum_index += 3;&lt;br /&gt;    return -1;&lt;br /&gt;  } else {&lt;br /&gt;    printf("Bin accumulator overflow!");&lt;br /&gt;    return 0;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void clear_accum(char *accum, int *accum_index)&lt;br /&gt;{&lt;br /&gt;  *accum_index = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static int append_accum(char *accum, int accum_size, int *accum_index, unsigned char c)&lt;br /&gt;{&lt;br /&gt;  if (*accum_index &lt; accum_size-1) {&lt;br /&gt;    accum[(*accum_index)++] = c;&lt;br /&gt;    return -1;&lt;br /&gt;  } else {&lt;br /&gt;    return 0;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void terminate_accum(char *accum, int *accum_index)&lt;br /&gt;{&lt;br /&gt;  accum[*accum_index] = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;%%{&lt;br /&gt;&lt;br /&gt;        machine LLSDScanner;&lt;br /&gt;&lt;br /&gt;        access scanner-&gt;;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        action terminate_accum { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;scanner-&gt;accum_index); &lt;br /&gt;            printf("Accumulated: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action clear_accum { &lt;br /&gt;            clear_accum(scanner-&gt;accum, &amp;scanner-&gt;accum_index); &lt;br /&gt;            clear_accum(scanner-&gt;bin_accum, &amp;scanner-&gt;bin_accum_index); &lt;br /&gt;        }&lt;br /&gt;        action append_accum { &lt;br /&gt;            append_accum(scanner-&gt;accum, scanner-&gt;accum_size, &amp;(scanner-&gt;accum_index), fc);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        action print_key_accum { &lt;br /&gt;            terminate_accum(scanner-&gt;key_accum, &amp;scanner-&gt;key_accum_index); &lt;br /&gt;            // printf("Key Accumulated: '%s'\n", scanner-&gt;key_accum); &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        action clear_key_accum { &lt;br /&gt;            clear_accum(scanner-&gt;key_accum, &amp;scanner-&gt;key_accum_index); &lt;br /&gt;        }&lt;br /&gt;        action append_key_accum { &lt;br /&gt;            append_accum(scanner-&gt;key_accum, scanner-&gt;key_accum_size, &amp;scanner-&gt;key_accum_index, fc); &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        action convert_string { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;scanner-&gt;accum_index);&lt;br /&gt;            printf("String: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_uuid { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;scanner-&gt;accum_index);&lt;br /&gt;            printf("UUID: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_uri { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;scanner-&gt;accum_index);&lt;br /&gt;            printf("URI: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_base64 { &lt;br /&gt;            terminate_accum(scanner-&gt;bin_accum, &amp;(scanner-&gt;bin_accum_index)); &lt;br /&gt;            printf("Binary Accumulated: '%s'\n", scanner-&gt;bin_accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_date { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;(scanner-&gt;accum_index)); &lt;br /&gt;            printf("Date: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_integer { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;(scanner-&gt;accum_index)); &lt;br /&gt;            printf("Integer: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_real { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;(scanner-&gt;accum_index)); &lt;br /&gt;            printf("Real: '%s'\n", scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;        action convert_undef { &lt;br /&gt;            terminate_accum(scanner-&gt;accum, &amp;(scanner-&gt;accum_index)); &lt;br /&gt;            strcpy(scanner-&gt;accum, "&lt;undef&gt;");&lt;br /&gt;            printf("Undef\n"); &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        action assign_map_member { &lt;br /&gt;            printf("Map member with key '%s':'%s'\n", scanner-&gt;key_accum, scanner-&gt;accum); &lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;        one_or_two = /[12]/ @append_accum;&lt;br /&gt;        zero_or_one = /[01]/ @append_accum;&lt;br /&gt;        zero_to_nine = /[0-9]/ @append_accum;&lt;br /&gt;        zero_to_two = /[0-2]/ @append_accum;&lt;br /&gt;        zero_to_three = /[0-3]/ @append_accum;&lt;br /&gt;        zero_to_five = /[0-5]/ @append_accum;&lt;br /&gt;        dot = '.' @append_accum;&lt;br /&gt;        dash = '-' @append_accum;&lt;br /&gt;        colon = ':' @append_accum;&lt;br /&gt;        dot_or_colon = /[.:]/ @append_accum;&lt;br /&gt;        letter_T = 'T' @append_accum;&lt;br /&gt;        letter_Z = 'Z' @append_accum;&lt;br /&gt;&lt;br /&gt;        date_fullyear = one_or_two . zero_to_nine . zero_to_nine . zero_to_nine;&lt;br /&gt;        date_month = zero_or_one . zero_to_nine;&lt;br /&gt;        date_mday = zero_to_three . zero_to_nine;&lt;br /&gt;        time_hour = zero_to_two . zero_to_nine;&lt;br /&gt;        time_minute = zero_to_five . zero_to_nine;&lt;br /&gt;        time_sec = zero_to_five . zero_to_nine;&lt;br /&gt;        time_secfrac = dot . zero_to_nine;&lt;br /&gt;        full_date = date_fullyear . dash . date_month . dash . date_mday;&lt;br /&gt;        partial_time = ( time_hour . colon . time_minute . colon . time_sec . time_secfrac |  time_hour . colon . time_minute . dot_or_colon . time_sec );&lt;br /&gt;        date_time = full_date . letter_T . partial_time . letter_Z;&lt;br /&gt;&lt;br /&gt;        maybe_space = space*;&lt;br /&gt;&lt;br /&gt;        some_string_char = /[^&lt;]/ @append_accum;&lt;br /&gt;        some_string = some_string_char*;&lt;br /&gt;&lt;br /&gt;        some_key_string_char = /[^&lt;]/ @append_key_accum;&lt;br /&gt;        some_key_string = some_key_string_char*;&lt;br /&gt;&lt;br /&gt;        # base64 parsing. Base64 characters come in series of 4&lt;br /&gt;&lt;br /&gt;        base64_char = [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+=/];&lt;br /&gt;        action base64_one { llsd_scanner_putb64char(scanner, 0, fc); }&lt;br /&gt;        action base64_two { llsd_scanner_putb64char(scanner, 1, fc); }&lt;br /&gt;        action base64_three { llsd_scanner_putb64char(scanner, 2, fc); }&lt;br /&gt;        action base64_four { llsd_scanner_putb64char(scanner, 3, fc); }&lt;br /&gt;        action base64_four_chars { append_binchars(scanner); }&lt;br /&gt;&lt;br /&gt;        base64_first_char = base64_char @base64_one;&lt;br /&gt;        base64_second_char = base64_char @base64_two;&lt;br /&gt;        base64_third_char = base64_char @base64_three;&lt;br /&gt;        base64_fourth_char = base64_char @base64_four;&lt;br /&gt;&lt;br /&gt;        base64_four_chars = maybe_space . base64_first_char . maybe_space . base64_second_char . maybe_space . &lt;br /&gt;                            base64_third_char . maybe_space . base64_fourth_char @base64_four_chars;&lt;br /&gt;&lt;br /&gt;        base64_string = base64_four_chars+;&lt;br /&gt;&lt;br /&gt;        tag_start = maybe_space . '&lt;';&lt;br /&gt;        tag_end_nospace = '&lt;/';&lt;br /&gt;        tag_end = maybe_space . tag_end_nospace;&lt;br /&gt;&lt;br /&gt;        llsd_tag = /llsd&gt;/i;&lt;br /&gt;&lt;br /&gt;        undef_tag = /undef\/&gt;/i;&lt;br /&gt;        boolean_tag = /boolean&gt;/i;&lt;br /&gt;        integer_tag = /integer&gt;/i;&lt;br /&gt;        real_tag = /real&gt;/i;&lt;br /&gt;        uuid_tag = /uuid&gt;/i;&lt;br /&gt;        string_tag = /string&gt;/i;&lt;br /&gt;        date_tag = /date&gt;/i;&lt;br /&gt;        uri_tag = /uri&gt;/i;&lt;br /&gt;        binary_tag = /binary/i . (space . /encoding="base64"/i)? . '&gt;';&lt;br /&gt;&lt;br /&gt;        key_tag = /key&gt;/i;&lt;br /&gt;        map_tag = /map&gt;/i;&lt;br /&gt;        array_tag = /array&gt;/i;&lt;br /&gt;&lt;br /&gt;        action call_array { &lt;br /&gt;            printf("Array start\n");&lt;br /&gt;            fcall array_element; &lt;br /&gt;        }&lt;br /&gt;        action call_map { &lt;br /&gt;            printf("Map start\n");&lt;br /&gt;            fcall map_element; &lt;br /&gt;        }&lt;br /&gt;        action return_from_map { &lt;br /&gt;            printf("Map end\n");&lt;br /&gt;            fret; &lt;br /&gt;        }&lt;br /&gt;        action return_from_array { &lt;br /&gt;            printf("Array end\n");&lt;br /&gt;            fret; &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        real_number = /[0-9]*/ @append_accum;&lt;br /&gt;        integer_number = /[0-9]*/ @append_accum;&lt;br /&gt;&lt;br /&gt;        hex_char = /[0-9a-fA-F]/ @append_accum;&lt;br /&gt;        uuid_val = hex_char{8,8} . '-'? . hex_char{4,4} . '-'? . hex_char{4,4} . '-'? . hex_char{4,4} . '-'? . hex_char{12,12};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        action error { printf("Error!\n"); } &lt;br /&gt;        some_element = tag_start . (undef_tag @convert_undef&lt;br /&gt;                  | boolean_tag @clear_accum . ('true'|'false') . tag_end . boolean_tag&lt;br /&gt;                  | integer_tag @clear_accum . integer_number . tag_end . integer_tag @convert_integer&lt;br /&gt;                  | real_tag @clear_accum . real_number . tag_end . real_tag @convert_real&lt;br /&gt;                  | uuid_tag @clear_accum . uuid_val . tag_end . uuid_tag @convert_uuid&lt;br /&gt;                  | string_tag @clear_accum . some_string . tag_end_nospace . string_tag @convert_string&lt;br /&gt;                  | date_tag @clear_accum . date_time . tag_end . date_tag @convert_date&lt;br /&gt;                  | uri_tag @clear_accum . some_string . tag_end . uri_tag @convert_uri&lt;br /&gt;                  | binary_tag @clear_accum . base64_string . tag_end . binary_tag @convert_base64&lt;br /&gt;                  | array_tag @call_array &lt;br /&gt;                  | map_tag @call_map &lt;br /&gt;                  );&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        array_element := (some_element)* . tag_end . array_tag @return_from_array;&lt;br /&gt;&lt;br /&gt;        map_key_start = tag_start . key_tag @clear_key_accum;&lt;br /&gt;&lt;br /&gt;        map_key_end = '&lt;/' . key_tag @print_key_accum;&lt;br /&gt;&lt;br /&gt;        map_member = map_key_start . some_key_string . map_key_end . some_element @assign_map_member;&lt;br /&gt;&lt;br /&gt;        map_element := (map_member)* . tag_end . map_tag @return_from_map;&lt;br /&gt;&lt;br /&gt;        body = (some_element)?;&lt;br /&gt;&lt;br /&gt;        xml_preamble = /xml[^&gt;]*/i . '&gt;';&lt;br /&gt;&lt;br /&gt;        llsd_body = tag_start . ( '?' . xml_preamble . tag_start )? . llsd_tag . body . tag_end . llsd_tag; &lt;br /&gt;&lt;br /&gt;        main := llsd_body @{ res = 1; };&lt;br /&gt;&lt;br /&gt;}%%&lt;br /&gt;&lt;br /&gt;%% write data;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void llsd_scanner_free(llsd_scanner_t *scanner)&lt;br /&gt;{&lt;br /&gt;  if(scanner-&gt;stack) { free(scanner-&gt;stack); }&lt;br /&gt;  if(scanner-&gt;key_accum) { free(scanner-&gt;key_accum); }&lt;br /&gt;  if(scanner-&gt;accum) { free(scanner-&gt;accum); }&lt;br /&gt;  if(scanner-&gt;bin_accum) { free(scanner-&gt;bin_accum); }&lt;br /&gt;  free(scanner);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;llsd_scanner_t *llsd_scanner_alloc(int key_accum_size, int accum_size, int bin_accum_size, int stack_size) &lt;br /&gt;{&lt;br /&gt;   int failure = 0;&lt;br /&gt;   llsd_scanner_t *scanner = calloc(1, sizeof(llsd_scanner_t));&lt;br /&gt;   if (scanner) {&lt;br /&gt;     scanner-&gt;bin_accum = malloc(bin_accum_size); &lt;br /&gt;     if (scanner-&gt;bin_accum) { &lt;br /&gt;       scanner-&gt;bin_accum_size = bin_accum_size;&lt;br /&gt;       scanner-&gt;accum = malloc(accum_size);&lt;br /&gt;       if (scanner-&gt;accum) {&lt;br /&gt;         scanner-&gt;accum_size = accum_size;&lt;br /&gt;         scanner-&gt;key_accum = malloc(key_accum_size);&lt;br /&gt;         if (scanner-&gt;key_accum) {&lt;br /&gt;           scanner-&gt;key_accum_size = key_accum_size;&lt;br /&gt;           scanner-&gt;stack = calloc(sizeof(int), stack_size);&lt;br /&gt;           if(scanner-&gt;stack) {&lt;br /&gt;             scanner-&gt;stack_size = stack_size;&lt;br /&gt;             %% write init;&lt;br /&gt;           } else {&lt;br /&gt;             failure = 1;&lt;br /&gt;           }&lt;br /&gt;         } else {&lt;br /&gt;           failure = 1;&lt;br /&gt;         }&lt;br /&gt;       } else {&lt;br /&gt;         failure = 1;&lt;br /&gt;       }&lt;br /&gt;     } else {&lt;br /&gt;       failure = 1;&lt;br /&gt;     }&lt;br /&gt;     if (failure) {&lt;br /&gt;       llsd_scanner_free(scanner);&lt;br /&gt;       scanner = NULL;&lt;br /&gt;     }&lt;br /&gt;   }&lt;br /&gt;   return scanner;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int llsd_scanner_run(llsd_scanner_t *scanner, char *chunk)&lt;br /&gt;{&lt;br /&gt;    char *p = chunk;&lt;br /&gt;    char *pe = chunk + strlen(chunk);&lt;br /&gt;    int res = 0;&lt;br /&gt;    // printf("Running parser on: %s, curr state: %i\n", chunk, scanner-&gt;cs);&lt;br /&gt;    %% write exec;&lt;br /&gt;    if (scanner-&gt;cs &amp;&amp; res == 0) {&lt;br /&gt;      res = -1;&lt;br /&gt;    }&lt;br /&gt;    return res;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main( int argc, char **argv )&lt;br /&gt;{&lt;br /&gt;  int res = 0;&lt;br /&gt;  int i = 1;&lt;br /&gt;  llsd_scanner_t *scan;&lt;br /&gt;  if ( argc &gt; 1 ) {&lt;br /&gt;    scan = llsd_scanner_alloc(1000, 1000, 32768, 100);&lt;br /&gt;    while(i &lt; argc) {&lt;br /&gt;      res = llsd_scanner_run(scan, argv[i]);&lt;br /&gt;      if (res == 0) {&lt;br /&gt;        printf("Error on chunk %d\n", i);&lt;br /&gt;        i = argc;&lt;br /&gt;      } else {&lt;br /&gt;      }&lt;br /&gt;      i++;&lt;br /&gt;    }&lt;br /&gt;    llsd_scanner_free(scan);&lt;br /&gt;  }&lt;br /&gt;  printf("result = %i\n", res);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-712372158224200921?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/712372158224200921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=712372158224200921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/712372158224200921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/712372158224200921'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/03/llsd-scanning-with-ragel-made-parser.html' title='LLSD scanning with ragel-made parser.'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-1508912708444225065</id><published>2009-02-25T23:08:00.008+01:00</published><updated>2009-02-26T00:45:37.173+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wow'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><category scheme='http://www.blogger.com/atom/ns#' term='cpp'/><title type='text'>Preprocessor directives for ruby (not!:)</title><content type='html'>At first I thought to do some more link-whoring - as I found precisely the search terms that are in the title of this post to lead to this blog... But then I though I will limit the on-topic information on the matter:&lt;br /&gt;&lt;br /&gt;1) You don't need a preprocessor for Ruby&lt;br /&gt;2) If you think you do, read up on metaprogramming - &lt;a href="http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html"&gt;_Why's article&lt;/a&gt; will be a good start to spend a good time thinking. &lt;br /&gt;&lt;br /&gt;But, this lead me back to the CPP - the preprocessor. Of course, beyond the &lt;a href="http://www0.us.ioccc.org/1995/vanschnitz.c"&gt;Obfuscated C contest entries&lt;/a&gt; that are of parlor entertainment value only, there is some more to that.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://chaos-pp.cvs.sourceforge.net/chaos-pp/order-pp/example/bottles.c?revision=1.10&amp;view=markup"&gt;Take a look at this one.&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Then get it for infinite fun:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cvs -d:pserver:anonymous@chaos-pp.cvs.sourceforge.net:/cvsroot/chaos-pp login &lt;br /&gt;cvs -z3 -d:pserver:anonymous@chaos-pp.cvs.sourceforge.net:/cvsroot/chaos-pp co -P chaos-pp&lt;br /&gt;cvs -z3 -d:pserver:anonymous@chaos-pp.cvs.sourceforge.net:/cvsroot/chaos-pp co -P order-pp&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then go check out and mess with the examples:&lt;br /&gt;&lt;br /&gt;the .c file looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;.....&lt;br /&gt;int main(void) {&lt;br /&gt;   printf&lt;br /&gt;     ("The 500th Fibonacci number is "&lt;br /&gt;      ORDER_PP(8stringize(8to_lit(8fib(8nat(5,0,0)))))&lt;br /&gt;      ".\n");&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//&gt;&lt;br /&gt;// Unless you are already convinced, you should check, by&lt;br /&gt;// preprocessing this example, that the actual parameter to&lt;br /&gt;// `printf' in the above code is just a single string that&lt;br /&gt;// contains the 500th Fibonacci number in base 10.&lt;br /&gt;//&lt;br /&gt;// If you know the order of growth of Fibonacci numbers, you&lt;br /&gt;// probably realized that the result isn't exactly small. &lt;br /&gt;.....&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, let's try it (stderr forwarded to the null for brevity, as it seems to spit some errors):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;:~/tmp/order-pp/example$ cpp -I../inc fibonacci.c 2&gt;/dev/null | tail&lt;br /&gt;  return fib_iter(n, 0, 1);&lt;br /&gt;}&lt;br /&gt;# 63 "fibonacci.c"&lt;br /&gt;int main(void) {&lt;br /&gt;   printf&lt;br /&gt;     ("The 500th Fibonacci number is "&lt;br /&gt;      "139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125"&lt;br /&gt;      ".\n");&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, let's look at another example - average.c&lt;br /&gt;&lt;br /&gt;you define the macro AVERAGE as:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#define AVERAGE(...)                                    \&lt;br /&gt;((ORDER_PP(8seq_for_each_with_delimiter                 \&lt;br /&gt;           (8put,                                       \&lt;br /&gt;            8emit(8quote(+)),                           \&lt;br /&gt;            8tuple_to_seq(8quote((__VA_ARGS__)))))) /   \&lt;br /&gt; ORDER_PP(8to_lit(8tuple_size(8quote((__VA_ARGS__))))))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and use it in your C code like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  printf(AVERAGE(3, 1, 4, 1, 5, 9, 2, 6, 5) == 4&lt;br /&gt;         ? "OK.\n"&lt;br /&gt;         : "ERROR!\n");&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The code post-cpp looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;  printf(((3 + 1 + 4 + 1 + 5 + 9 + 2 + 6 + 5) / 9) == 4&lt;br /&gt;         ? "OK.\n"&lt;br /&gt;         : "ERROR!\n");&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Of course, it's only simple things like this that are so nice looking... Any nontrivial definitions cause giant single-liners - the worst nightmare for the debuggers and maintainers - so I would personally torture anyone who used this in the production code.. :)&lt;br /&gt;&lt;br /&gt;Nonetheless - pretty impressive stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-1508912708444225065?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/1508912708444225065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=1508912708444225065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1508912708444225065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/1508912708444225065'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/02/preprocessor-directives-for-ruby-not.html' title='Preprocessor directives for ruby (not!:)'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-2652697843005431582</id><published>2009-02-25T00:21:00.004+01:00</published><updated>2009-02-25T00:36:49.148+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='potion'/><category scheme='http://www.blogger.com/atom/ns#' term='lua'/><title type='text'>The FONC project &amp; potion</title><content type='html'>While messing around looking if anyone did anything with &lt;a href="http://github.com/why/potion/tree/master"&gt;potion language&lt;/a&gt;, &lt;a href="http://bnpcs.blogspot.com/2009/02/potion-for-x86.html"&gt;that I wrote about a few days ago&lt;/a&gt;, found this interesting link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.ruby-lang.nl/amsterdamrbwiki/show/The+FONC+project"&gt;http://wiki.ruby-lang.nl/amsterdamrbwiki/show/The+FONC+project&lt;/a&gt; - The Fundamentals OF New Computing. Has some interesting reading on research in programming languages.&lt;br /&gt;&lt;br /&gt;Potion itself is rather fun, though of course my microbenchmark was a bit of an over-joyous :)&lt;br /&gt;&lt;br /&gt;Yeah, while it looks to be pretty damn fast, &lt;a href="http://luajit.org/"&gt;LuaJIT&lt;/a&gt; is only about 1.7 times slower. Nonetheless, I'll play with it more, it is an interesting thing to mess around with - at least the internals. Syntax I am not so sure...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Foo = Object delegated&lt;br /&gt;Foo def("xx", (x): "foo\n".)&lt;br /&gt;&lt;br /&gt;Bar = Foo delegated&lt;br /&gt;Bar def("yy", (x): "123\n".)&lt;br /&gt;&lt;br /&gt;a = Foo allocate&lt;br /&gt;b = Bar allocate&lt;br /&gt;&lt;br /&gt;a xx print&lt;br /&gt;b xx print&lt;br /&gt;b yy print&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Running this with potion will give you three lines "foo", "foo", and "123" - the middle one being the method of "Bar", "inherited" from "Foo". Did not dig on how to glue multiple mixins - _why wrote that it's incomplete, I'll see maybe some other day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-2652697843005431582?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/2652697843005431582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=2652697843005431582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2652697843005431582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/2652697843005431582'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/02/fonc-project-potion.html' title='The FONC project &amp; potion'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-4585313117076615395</id><published>2009-02-21T23:36:00.005+01:00</published><updated>2009-02-22T00:27:39.678+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='a'/><title type='text'>What the world is interested in...</title><content type='html'>The other day, while searching for a "how to" on something, I became amused with the autosuggestions I got after typing in the "how to" into the search input editor.&lt;br /&gt;&lt;br /&gt;Assuming the results there are sorted by the interest from the users (which is something pretty obvious to do), this is the apparent hit parade of the things &lt;br /&gt;that the people are wondering about:&lt;br /&gt;&lt;br /&gt;1. how to tie a tie&lt;br /&gt;&lt;br /&gt;Ha. I wonder whether this stems from the fact that the people don't really wear a tie every day, so this knowledge gets into the dark corners of the forgotten, or the science of tying the tie is as complicated as actually spelling it. I've last had to use this search maybe half a year ago when I in fact needed to wear the tie to some place. The caching is a good optimization here - tie the tie once, and keep it tied. Saves a lot of time.&lt;br /&gt;&lt;br /&gt;2. how to kiss&lt;br /&gt;&lt;br /&gt;Something is wrong. This one was supposed to land on the first position IMO - as the potential audience for the ties is at most is half as big as the potential audience for the kisses. So, I can conclude that the sets are actually very much intersecting and it's the same folks who don't know how to tie a tie. Others either already know it or are practicing it off-line. Indeed, practice is the key here. Instead of optimizing, just brute-force it. The process is fun.&lt;br /&gt;&lt;br /&gt;3. how to get pregnant&lt;br /&gt;&lt;br /&gt;Now the mystery of the bias for the previous one is probably starting to dissolve - that second half is actually not wasting the time on paying too much attention to the preamble, and is much more result driven. I'd think that here the practice is also a key. Also, there's something about the days of the month and such. But with sufficient practice the distribution is going to be across all the days of the month, so it should not be that important.&lt;br /&gt;&lt;br /&gt;4. how to make money&lt;br /&gt;&lt;br /&gt;assuming your looks are ok - after all, the tie is an important part of it! - indeed, money might be of use sometimes. I think it's a simple economics - find the area with most demand that is unsatisfied, and provide a supply there. Even better - create the demand out of thin air - that's how you make new markets. The most creative and spectacular that readily comes up, is the &lt;a href="http://www.milliondollarhomepage.com/"&gt;one million pixel page&lt;/a&gt;. In a nutshell - create 1000x1000 image, and start selling it in blocks of 10x10. Hundred bucks each. I am in awe. &lt;br /&gt;&lt;br /&gt;5. how to lose weight&lt;br /&gt;&lt;br /&gt;I won't comment much on this one - it's outside of my experience. Although, a full long weekend of dedicated nonstop gaming with not much food inbetween gets quite a few kilos off. I accidentally tried that once - the result was pretty funny (needless to say I was dead tired after that). But I think that's not something anyone should follow - talk to your doctor, or something. Eat lighter food, do sports, and such.&lt;br /&gt;&lt;br /&gt;6. how to draw&lt;br /&gt;&lt;br /&gt;I wonder if this is about drawing as in a form of art or it about making sure that no-one wins. My best advise - find an artist nearby who is willing to bear with you, and use the results from the (4) above to pay for the lessons. Practice makes miracles. But it aint going to be easy, if you want to get decent that is. &lt;br /&gt;My wife's an artist and she literally spent years doing that thing. (oh, if you wanna get lessons, maybe I can ask, drop me a note :)&lt;br /&gt;&lt;br /&gt;7. how to make a website&lt;br /&gt;&lt;br /&gt;Hire a professional. &lt;br /&gt;&lt;br /&gt;8. how to cook a turkey&lt;br /&gt;&lt;br /&gt;Ah, this is a much more appropriate one. Though, no opinion here - I'm in europe and prefer chicken anyway. Or beef, for that matter.&lt;br /&gt;&lt;br /&gt;9. how to write a resume&lt;br /&gt;&lt;br /&gt;I'd do it in a couple of steps: first achieve a bunch of great things. Then write them down. Though, it's not a quick process. But should surely work. &lt;br /&gt;&lt;br /&gt;10. how to lose friends and alienate people&lt;br /&gt;&lt;br /&gt;Oh, that's easy - just write something outright silly like I did in this post, and it might work. Or go watch &lt;a href="http://www.imdb.com/title/tt0455538/"&gt;the film&lt;/a&gt; and learn from there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-4585313117076615395?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/4585313117076615395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=4585313117076615395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4585313117076615395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/4585313117076615395'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/02/what-world-is-interested-in.html' title='What the world is interested in...'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3569666675299554168.post-5460190835496046686</id><published>2009-02-18T01:40:00.003+01:00</published><updated>2009-02-18T01:48:44.886+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Sketching network diagrams - entirely in javascript, in your browser!</title><content type='html'>This is a bit of shameless self-advertising - I figured that if I don't advertise a little bit, I never know if there are some people that might benefit of this thing.&lt;br /&gt;&lt;br /&gt;Basically, if you want to scratch a network with a couple of routers and a cloud, now you do not need to start visio, dia, or anything else for that matter: just go to &lt;a href="http://employees.org/~andin/network/"&gt;http://employees.org/~andin/network/&lt;/a&gt;, draw the network, and snap the picture from the screen. &lt;br /&gt;&lt;br /&gt;Of course, it's all web2.x enabled and jazz, so you can save the layout as JSON, and load it later. Even, in a demonstration of a blatant violation of the security, you can pull in the JSON from another domain.&lt;br /&gt;&lt;br /&gt;A little bit of history: as I use linux at work pretty much exclusively, I was always curious to have something simple to draw the diagrams. Dia is an excellent program, but I wanted something even simpler. &lt;br /&gt;&lt;br /&gt;And so when I saw the &lt;a href="http://draw2d.org/draw2d/"&gt;Draw2D&lt;/a&gt; library I thought "ah-ha!".&lt;br /&gt;&lt;br /&gt;The editor is not way too much more than a combination of the existing components - you can see the ingredients on its page.&lt;br /&gt;&lt;br /&gt;Well, enough of me talking, &lt;a href="http://employees.org/~andin/network/"&gt;go try it&lt;/a&gt; and let me know :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3569666675299554168-5460190835496046686?l=bnpcs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bnpcs.blogspot.com/feeds/5460190835496046686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3569666675299554168&amp;postID=5460190835496046686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5460190835496046686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3569666675299554168/posts/default/5460190835496046686'/><link rel='alternate' type='text/html' href='http://bnpcs.blogspot.com/2009/02/sketching-network-diagrams-entirely-in.html' title='Sketching network diagrams - entirely in javascript, in your browser!'/><author><name>Andrew Yourtchenko</name><uri>http://www.blogger.com/profile/14364645178881348283</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='http://3.bp.blogspot.com/-ZKjhsxXiyuY/TkHGaTqGWPI/AAAAAAAAALY/6QMk05Zz4T4/s220/ayourtch-surf-square.png'/></author><thr:total>0</thr:total></entry></feed>
