<?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-6886136881785649350</id><updated>2011-07-07T18:43:53.356-07:00</updated><title type='text'>hoge</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-3634331573374167587</id><published>2009-09-12T13:41:00.000-07:00</published><updated>2009-09-17T08:21:19.432-07:00</updated><title type='text'>ICFP Programming Contest 2009</title><content type='html'>Surprisingly, I won the first place in the &lt;a href="http://icfpcontest.org/"&gt;ICFP programming contest&lt;/a&gt; 2009. I&amp;#39;m very appreciated for this result - it was much better than my expectation. I was in 9th place before the validation process.&lt;br /&gt;&lt;br /&gt;This is the post to describe my approach of my solution. Here is my source code:&lt;p&gt;&lt;a href="http://shinh.skr.jp/dat_dir/icfpc.zip"&gt;http://shinh.skr.jp/dat_dir/icfpc.zip&lt;/a&gt;&lt;p&gt;* FAQs&lt;p&gt;Before the detailed descriptions, I put some questions asked by other contestants.&lt;p&gt;Q. Did you go to the moon?&lt;br&gt;A. No, I couldn&amp;#39;t. I considered if I could go to the moon a bit, but I decided not to go the moon. As it takes a lot of fuel and the score of far debris aren&amp;#39;t big, I prioritized improvement of stability and faster arrivals at near debris.&lt;p&gt;Q. Did you solve traveling salesman problem?&lt;br&gt;A. No. I chose the next target almost greedy. Please see the following details as well.&lt;p&gt;Q. Did you solve difficult mathematic formulas?&lt;br&gt;A. No. Though I tried to find an analytic solutions, the effort was just waste of time. Basically, I only used Hohmann transfer. Even if we had a analytic solutions, we would need some adjustment for errors due to discrete space anyway.&lt;p&gt;Q. 1 person team?&lt;br&gt;A. Yes. I always attend this contest because I&amp;#39;d like to do everything by myself.&lt;p&gt;Q. How long did you sleep?&lt;br&gt;A. Not sure, but maybe ~20 hours. I cannot write valid code with few sleep. It is the lesson learned from previous contests.&lt;p&gt;Q. Why C++?&lt;br&gt;A. I love C++. By the way, I think I'm not offensive to functional programming languages. Actually, I tried some of them a bit (maybe I wrote from ~1k to ~3k lines of toy code for each of them). I thought OCaml is good but it's standard library is poor. Perhaps I should have tried ExtLib or something like this. Haskell was slow when I tried. I read some of assemblies GHC produced, but it was very difficult for me to understand it... I tried Scheme interpreter and it was interpreter after all. Maybe I'll want to try compilers (Stalin?). Commercial common LISP processors sound great, but I only have opensource implementations. So, I'm thinking C++ is the most practical languages to me for now. I know I'm biased - I spent much more time for C++ than other languages. I'm looking forward continuing functional programming funs' great work.&lt;br /&gt;&lt;p&gt;Q. Why not other imperative languages?&lt;br&gt;A. I feel Java is less free than C++. As for C#, my experience with C# is too small to discuss it. I'm (or was?) a fun of D and actually I used D for this contest three times (2004, 2006, and 2007), but I don't use it these days. Maybe I'll want to use it again for the next year's contest.&lt;br /&gt;&lt;p&gt;* Detail&lt;br /&gt;&lt;p&gt;This post is based on the script of my talk for vidiowiki: http://vidiowiki.com/watch/m844dyn/ (Hmm... it's embarrassing to watch I'm talking with my poor English. But it is good experience to me.)&lt;br /&gt;&lt;p&gt;Overall, I think my approach wasn&amp;#39;t so special. Just like many teams might do, I wrote a VM, a visualizer, a physic simulator, and hoahman transfer.&lt;p&gt;My VM was fast because it translates the input binary into C code. Otherwise it&amp;#39;s normal.&lt;p&gt;The visualizer is also a normal stuff. Nothing to say about it. You can see a YouTube video at (sorry for its poor quality) &lt;a href="http://www.youtube.com/watch?v=IUGiiFsnLLs"&gt;http://www.youtube.com/watch?v=IUGiiFsnLLs&lt;/a&gt;&lt;p&gt;I also had a physic simulator. It calculates the states of future quickly. Due to two reasons, it was a bit tricky to implement the simulator correctly. The first reason is that the binary organizers provided was wrong. The gravity from the moon didn&amp;#39;t affect to our spaceship. Also, the gravity from the moon is calculated by g(t+1) = G*M/(p(t+1)-pm(t))^2 where p is the position of a body and pm is the position of the moon. I think pm(t) should have been pm(t+1). Anyway, with some reverse engineering works, I could implement the simulator correctly. It helped me a lot by its fast simulation.&lt;p&gt;With these three tools, I implemented my strategy, which was basically, kind of bruteforce.&lt;p&gt;First my simulator calculates the future positions of a target for 5000 seconds. The track should be an elliptic arc around the earth. And then, it checks if I have a chance to reach a point which is close enough to the arc with ideal Hoahman transfer.&lt;p&gt;As there are the gravity from the Moon and the program is running in discrete space, there should be some errors. Things are not ideal. Therefore, my program starts adjustment as the next step when it finds it can go close to the track of the target. It runs simulations for various initial velocities again and again. This process takes a lot of time. My fast simulator helped this process.&lt;p&gt;The last question is how to decide the next target from 10 targets. My approach was a greedy algorithm with a heuristics. If it finds a promissing plan for a target, it starts the journey except for two cases. One case is that it withdraws the plan if the plan takes too much fuel. Another case is that the target is too far. The latter exception is a performance optimization. It is considered before it starts the first step to reduce unnecessary calculations for too far targets (e.g., the debri around the moon isn&amp;#39;t good candidate as the first target). I know this is not optimal, but it seemed it was acceptable enough.&lt;p&gt;So, as I described, I think my approach isn&amp;#39;t the smartest way. but I guess the good point of my program was its robustness. I&amp;#39;ve heard that there are some teams whose program unfortunately crashed with some typical test cases and some teams&amp;#39; solution only work for the given test cases.&lt;p&gt;The performance might be also the key of my success. It seemed that there are some teams whose solutions are similar to mine. However, most of them don&amp;#39;t have fast simulator and they just use VM to simulate the physics. Also, I think C++ helps me to write solid and fast code.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Thanks the organizers for the excellent contest!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-3634331573374167587?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/3634331573374167587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=3634331573374167587' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/3634331573374167587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/3634331573374167587'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2009/09/icfp-programming-contest-2009.html' title='ICFP Programming Contest 2009'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-1883782816278827906</id><published>2009-08-02T08:51:00.000-07:00</published><updated>2009-08-02T08:52:56.290-07:00</updated><title type='text'>Symbolic Polyglot Quine</title><content type='html'>Recently, I wrote the following code:&lt;p&gt;&lt;a href="http://shinh.skr.jp/obf/sym_poly_quine.txt"&gt;http://shinh.skr.jp/obf/sym_poly_quine.txt&lt;/a&gt;&lt;p&gt;This script is a Quine, so it outputs the program itself into stdout without file input. You can run this script by Ruby, Perl, and JavaScript. This script is a polyglot of these three languages. And, this script was written only with symbolic characters (!&amp;quot;#$%&amp;amp;&amp;#39;()*+,-./:;&amp;lt;=&amp;gt;?@[\\]^_`{|}~). There should be no alphabets, numbers, whitespaces, and 8bit characters.&lt;p&gt;Perl is OK only with symbolic characters. You can convert any Perl scripts into symbolic style scripts using Acme::EyeDrops. This module is awesome.&lt;p&gt;&lt;a href="http://search.cpan.org/dist/Acme-EyeDrops/"&gt;http://search.cpan.org/dist/Acme-EyeDrops/&lt;/a&gt;&lt;p&gt;Also, all JavaScript scripts can be converted into symbolic style. jjencode does the magic.&lt;p&gt;&lt;a href="http://utf-8.jp/public/jjencode.html"&gt;http://utf-8.jp/public/jjencode.html&lt;/a&gt;&lt;p&gt;As for Ruby, Ruby 1.9 is perfect for symbolic programming. kurimura found the way to convert arbitrary Ruby scripts into symbolic format.&lt;p&gt;&lt;a href="http://d.hatena.ne.jp/kurimura/20080824"&gt;http://d.hatena.ne.jp/kurimura/20080824&lt;/a&gt;&lt;p&gt;Unfortunately, I think Ruby 1.8&amp;#39;s symbolic programming is very limited. For example, you cannot create a loop. As quine only require substitutions and outputs for stdout, which is doable with symbolic Ruby 1.8, my script can run with Ruby 1.8.&lt;p&gt;There are some other weird code like this:&lt;p&gt;&lt;a href="http://shinh.skr.jp/obf/"&gt;http://shinh.skr.jp/obf/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-1883782816278827906?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/1883782816278827906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=1883782816278827906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1883782816278827906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1883782816278827906'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2009/08/symbolic-polyglot-quine.html' title='Symbolic Polyglot Quine'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-1728673960506667692</id><published>2009-06-05T15:58:00.000-07:00</published><updated>2009-06-05T16:02:59.507-07:00</updated><title type='text'>TCC 0.9.25</title><content type='html'>I worked on porting TCC into x86-64 and the project has recently released a new version which contains my changes.&lt;p&gt;&lt;a href="http://bellard.org/tcc/"&gt;http://bellard.org/tcc/&lt;/a&gt;&lt;p&gt;I confirmed that my changes pass the tests in TCC and successfully compile some applications such as link and Lua.&lt;p&gt;As there should be some bugs in the x86-64 support, I&amp;#39;ll be really appreciated if you try this release with x86-64 and report bugs.&lt;p&gt;Regarding implementation... It was more difficult than I expected. Code generation for x86-64 was relatively straightforward because there was support for x86, which is similar to x86-64. The most difficult part was relocation related stuff. As distance of two addresses in 64bit address space can be larger than 32bit, some 32bit relative references need to be fixed by PLT and GOT. TCC&amp;#39;s -run mode support was also tricky by the same reason.&lt;p&gt;Other things by which I was often confused were 64bit system itself. As much code of TCC depends on 32bit system, sometimes it casts pointers into int, which is sometimes incorrect on 64bit system. The following simple code would show the difficulty of 64bit system:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int main() {&lt;br /&gt;    printf(&amp;quot;%p\n&amp;quot;, malloc(10));&lt;br /&gt;    printf(&amp;quot;%p\n&amp;quot;, malloc(1000000));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This code produces outputs like&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;0xfa1010&lt;br /&gt;0x7f3658acd010&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;on my linux box. When we allocate small memory chunk from heap, it returns addresses which is smaller than INT_MAX. So, even if we cast the returned pointer into 32bit integer, it has no problem as long as we allocate small memory chunks. This hided many bugs from me. This kind of bugs only appears with big programs. It means that it&amp;#39;s difficult to create minimal failure cases...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-1728673960506667692?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/1728673960506667692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=1728673960506667692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1728673960506667692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1728673960506667692'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2009/06/tcc-0925.html' title='TCC 0.9.25'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-1241174122486338970</id><published>2009-04-07T08:50:00.001-07:00</published><updated>2009-06-05T16:13:55.691-07:00</updated><title type='text'>TLE</title><content type='html'>I got the 1st prize in the first TLE programming contest.&lt;p&gt;&lt;a href="http://felicity.iiit.ac.in/tle/"&gt;http://felicity.iiit.ac.in/tle/&lt;/a&gt;&lt;p&gt;This contest had unique problems. For example, we should have written a C program with no semi-colons in the test run of this contest. The answer was:&lt;pre&gt;main(){if(printf(&amp;quot;Hello, world!&amp;quot;)){}}&lt;/pre&gt;&lt;p&gt;In this contest, the most problems require short coding to get better score. I like short coding and I used a lot of time for this competition (I even took a day off). That&amp;#39;s why my performance was surprisingly good in this contest.&lt;p&gt;Unfortunately, there were some issues in the contest. Since competitors wrote much shorter code than organizers had expected, the score of each problem is imbalanced. For example, the maximum score of problem &amp;quot;CLASS&amp;quot; was 200. On the other hand, some competitors awarded over 2000 points in problem &amp;quot;SHORTEN&amp;quot;. Anyway I think this issue didn&amp;#39;t break the fun of this contest, and this kind of issues were unavoidable as this was the first attempt for the organizers to run this kind of contest.&lt;p&gt;Though there were some issues in the contest, it was great fun! I hope I will attend this contest again in the next year. I must thank organizers for the excellent contest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-1241174122486338970?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/1241174122486338970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=1241174122486338970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1241174122486338970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1241174122486338970'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2009/04/tle.html' title='TLE'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-5060021766211133498</id><published>2008-11-29T13:55:00.001-08:00</published><updated>2008-11-29T13:55:03.713-08:00</updated><title type='text'>hh.gif</title><content type='html'>I created another GIF file. This has 7 hidden keywords.&lt;p&gt;&lt;a href="http://slashdot.jp/sp/binary2008/data/hh.gif"&gt;http://slashdot.jp/sp/binary2008/data/hh.gif&lt;/a&gt;&lt;p&gt;* This GIF file is&lt;p&gt;- a GIF file which shows &amp;quot;Happy Hacking&amp;quot;.&lt;p&gt;- a MS-DOS COM program which shows &amp;quot;Happy Hacking&amp;quot;.&lt;p&gt;% cp hh.gif&lt;br&gt;% dosemu -dumb &lt;a href="http://hh.com"&gt;hh.com&lt;/a&gt;&lt;br&gt;Happy Hacking!&lt;p&gt;- a Perl program which converts a ASCII formatted COM file.&lt;p&gt;If you provide no arguments, it converts itself. So, you can do&lt;p&gt;% perl hh.gif &amp;gt; &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;&lt;br&gt;% dosemu -dumb &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;&lt;br&gt;Happy Hacking!&lt;p&gt;There are no binaries or control code in &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;.&lt;p&gt;- a Ruby program which converts a ASCII formatted COM file.&lt;p&gt;% ruby hh.gif &amp;gt; &lt;a href="http://hh.rb.com"&gt;hh.rb.com&lt;/a&gt;&lt;br&gt;% dosemu -dumb &lt;a href="http://hh.rb.com"&gt;hh.rb.com&lt;/a&gt;&lt;br&gt;Happy Hacking!&lt;p&gt;- the Perl program shows &amp;quot;be&amp;quot; if you provide 1111 as the command line option.&lt;p&gt;% perl hh.gif 1111&lt;br&gt;be&lt;p&gt;- a Java program in jar which shows &amp;quot;assimilated&amp;quot;.&lt;p&gt;% java -jar hh.gif&lt;br&gt;assimilated&lt;p&gt;- the word *WILL* is hidden in the GIF file in UTF8.&lt;p&gt;- this is an animation GIF, after waiting 10mins, the image shows &amp;quot;You&amp;quot;.&lt;p&gt;- &amp;quot;Resistance&amp;quot; is embed in this GIF image.&lt;p&gt;&lt;a href="http://shinh.skr.jp/misc/dat_dir/steg.gif"&gt;http://shinh.skr.jp/misc/dat_dir/steg.gif&lt;/a&gt;&lt;p&gt;* The outputted ASCII formatted COM file is&lt;p&gt;- a COM file&lt;p&gt;- a Perl program which produces the original COM file&lt;p&gt;% diff =(perl &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;) &lt;a href="http://hh.com"&gt;hh.com&lt;/a&gt;&lt;br&gt;% diff =(perl &lt;a href="http://hh.rb.com"&gt;hh.rb.com&lt;/a&gt;) &lt;a href="http://hh.com"&gt;hh.com&lt;/a&gt;&lt;br&gt;%&lt;p&gt;- a Ruby program which produces the original COM file&lt;p&gt;% diff =(ruby &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;) &lt;a href="http://hh.com"&gt;hh.com&lt;/a&gt;&lt;br&gt;% diff =(ruby &lt;a href="http://hh.rb.com"&gt;hh.rb.com&lt;/a&gt;) &lt;a href="http://hh.com"&gt;hh.com&lt;/a&gt;&lt;br&gt;%&lt;p&gt;- a Python program which outputs &amp;quot;futile&amp;quot;&lt;p&gt;% python &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt;&lt;br&gt;futile&lt;p&gt;- a Haskell program which outputs &amp;quot;is&amp;quot;&lt;p&gt;% cp &lt;a href="http://hh.pl.com"&gt;hh.pl.com&lt;/a&gt; hh.hs&lt;br&gt;% ghc hh.hs&lt;br&gt;% ./a.out&lt;br&gt;is&lt;p&gt;* Overall, the hidden phrases are &amp;quot;Resistance is futile. You will be assimilated&amp;quot;&lt;p&gt;Here is the archive to create this file&lt;p&gt;&lt;a href="http://shinh.skr.jp/binary/happy.tgz"&gt;http://shinh.skr.jp/binary/happy.tgz&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-5060021766211133498?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/5060021766211133498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=5060021766211133498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/5060021766211133498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/5060021766211133498'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/11/hhgif.html' title='hh.gif'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-6520288711662143020</id><published>2008-10-27T09:53:00.001-07:00</published><updated>2008-10-27T09:53:28.332-07:00</updated><title type='text'>fizzbuzz7.gif</title><content type='html'>I updated the previous polyglot (&lt;a href="http://shinhoge.blogspot.com/2008/10/fizzbuzzgif.html"&gt;http://shinhoge.blogspot.com/2008/10/fizzbuzzgif.html&lt;/a&gt;).&lt;p&gt;&lt;a href="http://shinh.skr.jp/dat_dir/fizzbuzz7.gif"&gt;http://shinh.skr.jp/dat_dir/fizzbuzz7.gif&lt;/a&gt;&lt;p&gt;This GIF file has 7 meanings:&lt;p&gt;- a GIF file&lt;br&gt;- a Fizz Buzz program in Ruby (1.8)&lt;br&gt;- a Fizz Buzz program in Perl&lt;br&gt;- a Fizz Buzz program in Befunge (&lt;a href="http://en.wikipedia.org/wiki/Befunge"&gt;http://en.wikipedia.org/wiki/Befunge&lt;/a&gt;)&lt;br&gt;- a Fizz Buzz program in z80, which runs with my golf server&amp;#39;s emulator. (see &lt;a href="http://golf.shinh.org/"&gt;http://golf.shinh.org/&lt;/a&gt; or &lt;a href="http://sites.google.com/site/codegolfingtips/Home/z80"&gt;http://sites.google.com/site/codegolfingtips/Home/z80&lt;/a&gt; for detail)&lt;br&gt;- a Fizz Buzz program in x86 &amp;amp; MS-DOS. (you can rename this to &lt;a href="http://fizzbuzz.com"&gt;fizzbuzz.com&lt;/a&gt; and run on Windows or dosemu)&lt;br&gt;- a Fizz Buzz program in x86, MBR image. (you can run with QEMU or something: qemu -boot c -hda fizzbuzz.gif)&lt;p&gt;The source code is&lt;p&gt;&lt;a href="http://shinh.skr.jp/dat_dir/fizzbuzzgif.tgz"&gt;http://shinh.skr.jp/dat_dir/fizzbuzzgif.tgz&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-6520288711662143020?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/6520288711662143020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=6520288711662143020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/6520288711662143020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/6520288711662143020'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/10/fizzbuzz7gif.html' title='fizzbuzz7.gif'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-2060510311526450839</id><published>2008-10-18T05:40:00.000-07:00</published><updated>2008-10-18T05:41:04.697-07:00</updated><title type='text'>google-glog</title><content type='html'>I&amp;#39;m working on an opensource project as my 20%.&lt;p&gt;&lt;a href="http://code.google.com/p/google-glog/"&gt;http://code.google.com/p/google-glog/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-2060510311526450839?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/2060510311526450839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=2060510311526450839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/2060510311526450839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/2060510311526450839'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/10/google-glog.html' title='google-glog'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-5528892349276990837</id><published>2008-10-12T12:32:00.000-07:00</published><updated>2008-10-12T12:33:51.668-07:00</updated><title type='text'>fizzbuzz.gif</title><content type='html'>&lt;a href="http://shinh.skr.jp/obf/fizzbuzz.gif"&gt;http://shinh.skr.jp/obf/fizzbuzz.gif&lt;/a&gt;&lt;p&gt;This GIF file has 6 meanings:&lt;p&gt;- a GIF file&lt;br&gt;- a Fizz Buzz program in Ruby (1.8)&lt;br&gt;- a Fizz Buzz program in Perl&lt;br&gt;- a Fizz Buzz program in z80, which runs with my golf server&amp;#39;s emulator. (see &lt;a href="http://golf.shinh.org/"&gt;http://golf.shinh.org/&lt;/a&gt; or &lt;a href="http://sites.google.com/site/codegolfingtips/Home/z80"&gt;http://sites.google.com/site/codegolfingtips/Home/z80&lt;/a&gt; for detail)&lt;br&gt;- a Fizz Buzz program in x86 &amp;amp; MS-DOS. (you can rename this to &lt;a href="http://fizzbuzz.com"&gt;fizzbuzz.com&lt;/a&gt; and run on Windows or dosemu)&lt;br&gt;- a Fizz Buzz program in x86, MBR image. (you can run with QEMU or something: qemu -boot c -hda fizzbuzz.gif)&lt;p&gt;This is the NASM source code which was used to create this GIF file.&lt;p&gt;&lt;a href="http://shinh.skr.jp/obf/fizz_gif.asm"&gt;http://shinh.skr.jp/obf/fizz_gif.asm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-5528892349276990837?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/5528892349276990837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=5528892349276990837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/5528892349276990837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/5528892349276990837'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/10/fizzbuzzgif.html' title='fizzbuzz.gif'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-1931465963151317741</id><published>2008-09-25T07:19:00.001-07:00</published><updated>2009-06-05T16:20:30.185-07:00</updated><title type='text'>ICFPC 2008</title><content type='html'>It seems that I&amp;#39;ve got the second place in ICFPC 2008. I'm really appreciated this result. I think I was very lucky. I don&amp;#39;t think my program was excellent. For example, my rover would run poorly if there are difficult maps, like complicated maze.&lt;p&gt;I'd like to put some notes on my implementation. My rover had three parts:&lt;p&gt;Calculate geometry informations: Just like other teams, my rover guessed some parameters using the information. Since there are some latency between server and client, my rover calculates the future position using the log of commands sent to the server.&lt;p&gt;Macroscopic planning: All obstacles are memorized. If some of them are near enough each other, they are considered as a cluster. If there is a obstacle between the rover and the home, my rover decides left or right using some heuristics. The heuristics was like 1. if my rover is far from the obstacle, choose the way which makes the path after the obstacle easier (with this logic, my rover could solve easy mazes) 2. otherwise, consider safety first, then consider distance. Hmm... actually, I forgot the detail.&lt;p&gt;Avoid risk: Suppose that the state of my rover is &amp;quot;accel and right turn&amp;quot;. Simulate a second using the current state. If it turns out that my rover will die, my rover considers that the current state is risky. In this case, my rover tries 8 simulations with other states. If there is a state which can avoid the risk, my rover sends the commands to be the safe state, ignoring the macroscopic decision. If all states is risky, choose the state which can alive as long as possible.&lt;p&gt;I wrote a visualizer. It was important for me to fix many bugs. It shows the macroscopic plan using line. Also, it changes the color if my rover considers it&amp;#39;s risky.&lt;p&gt;&lt;a href="http://shinh.skr.jp/dat_dir/icfp08.png"&gt;http://shinh.skr.jp/dat_dir/icfp08.png&lt;/a&gt;&lt;p&gt;After the contest, I wrote some scripts to show statistics.&lt;p&gt;&lt;a href="http://shinh.skr.jp/icfp08/"&gt;http://shinh.skr.jp/icfp08/&lt;/a&gt;&lt;p&gt;Anyway, it was fun and I feel happy. Thanks for organizers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-1931465963151317741?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/1931465963151317741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=1931465963151317741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1931465963151317741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/1931465963151317741'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/09/icfpc-2008.html' title='ICFPC 2008'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886136881785649350.post-2187245088952419019</id><published>2008-09-25T06:48:00.001-07:00</published><updated>2008-09-25T06:48:04.695-07:00</updated><title type='text'>start</title><content type='html'>I have had a plan to start to write my note (I somehow don&amp;#39;t like the word blog) in English long time, but I didn&amp;#39;t. I am lazy, and I don&amp;#39;t like to write English. Anyway, now I want to write an entry. So, I decided to start.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886136881785649350-2187245088952419019?l=shinhoge.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shinhoge.blogspot.com/feeds/2187245088952419019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886136881785649350&amp;postID=2187245088952419019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/2187245088952419019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886136881785649350/posts/default/2187245088952419019'/><link rel='alternate' type='text/html' href='http://shinhoge.blogspot.com/2008/09/start.html' title='start'/><author><name>shinh</name><uri>http://www.blogger.com/profile/14208915308514288547</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
