It's not about ambient occlusion. It's about concurrent computing.

http://en.wikipedia.org/wiki/Ambient_calculus

The ambient calculus is a process calculus that is conscious of mobility of processes.

posted by Png takiuchi on Fri 26 Jun 2009 at 17:29

To reduce consumption of papers, I investigated way to print both sides of paper on MacOSX.

  1. First, print even number pages by reverse order.
  2. Second, bring the output papers to the medium tray.
  3. Last, print odd number pages.

Be careful of the flow of from even number pages to odd number pages. If you do oppositely, sometimes you would get the out of order result.

This can be used with layouts that have 2 or more pages a paper.

posted by Png takiuchi on Sat 20 Jun 2009 at 19:13

GoogleDocs Outliner is a bookmarklet for writer who write long article by using GoogleDocs.

ss

INSTALL

Just bookmark the link below.

GoogleDocs Outliner

USAGE

  • Open a GoogleDoc and run bookmarklet.
  • And then the outline will be displayed on the right side.
  • The outline is refreshed for every change of the document.
  • Click the title to toggle the window.
  • Click [X] to uninstall.

REQUIREMENTS

This bookmarklet has been tested on only Firefox 3.0.

LICENSE

The source code is here http://gist.github.com/132009. You can modify and redistribute it as long as you keep the original copyright notice. If you want to talk about this bookmarklet, notice me via http://twitter.com/takiuchi.

posted by Png takiuchi on Thu 18 Jun 2009 at 19:32

Today I collided with an issue regarding a git repository. If a subdirectory of your repository has .git as a member, it shadows the subdirectory. So thus you can't sense its member even if you would type git status and check .gitignore.

今日はgitリポジトリに関する見つけにくい問題に遭遇しました。 リポジトリのサブディレクトリの中に.gitディレクトリがある場合、そのサブディレクトリ以下が隠されてしまい、git statusや.gitignoreを見ても存在が見えなくなってしまいます。

posted by Png takiuchi on Tue 16 Jun 2009 at 03:39

You can check the dependencies of *.so file by executing ldd command like this

   1  % ldd foo.so
   2          linux-gate.so.1 =>  (0xb7efe000)
   3          libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d7e000)
   4          /lib/ld-linux.so.2 (0xb7eff000)

It's useful to attack problems regarding dlopen

posted by Png takiuchi on Fri 12 Jun 2009 at 02:33

Posture consists of forward, upward and rightward directions. Each directions has 2 degrees of freedom, but the set of them has only 3 degrees.

Recall that the posture can be represented as a unit quaternion. The unit quaternion has a constraint on its length, so thus it has 3 degrees of freedom.

posted by Png takiuchi on Wed 10 Jun 2009 at 02:36

In these days, I am thinking about how web services can be provided without shutting down. An answer I got is keep it small. Small services can be provided without maintenances. For example, the Formula (http://formula.s21g.com/) has been provided for more than a year. But it had virtually neither maintenances nor updates. But it is used by someone sometimes.

The cost of keeping such services is about $50 a month. It consists of only the cost of an EC2 instance. An instance can offer several such services, so the cost would be shared by them. So thus the individual cost becomes more low.

Suppose the cost is $20 a month, we can gain it by a fund of $4800 if it earns 5% a year constantly. If it is possible, it can be a new way for providing services such as the Formula.

posted by Png takiuchi on Wed 10 Jun 2009 at 01:45 with 2 comments

You can get it by installing wl-pprint package.

   1  # cabal install wl-pprint

See Also

posted by Png takiuchi on Mon 8 Jun 2009 at 04:09

Now I am using Haskel and investigating its package system. I found that I can display the list of packages already installed in the environment by typing the command as follows.

   1  ghc-pkg list

And then I want to prepare cabal-install. The tool might be found here

I had got it and extracted it. After that, I could build the module by this command.

   1  runhaskell Setup.hs configure

At this point, I got error messages like this:

   1  Setup.hs: At least the following dependencies are missing:
   2      Cabal >=1.6&&<1.7,
   3      network >=1&&<3,
   4      HTTP >=4000.0.2&&<4001,
   5      zlib >=0.4&&<0.6

It means I must get them in advance from the HackageDB.

After I got downloaded them all, I must do just runhaskell repeatedly. It's a simple job.

   1  runhaskell Setup.hs configure
   2  runhaskell Setup.hs build
   3  runhaskell Setup.hs install

If you are a Rubyist, you probably find the similarity between the command above and the usage of setup.rb. Do you know which is the chicken or the egg? :-)

About 30 minutes went by...

Finally, I got the cabal command.

See Also

posted by Png takiuchi on Mon 8 Jun 2009 at 03:56

The edge version of do_postgres with JRuby causes misterious error like this.

   1   ~ (1) SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"
   2   ~ ERROR: syntax error at or near "("merb : worker (port 4000) ~ ERROR: syntax error at or near "(" - (PostgresError)

The SQL that had been performed is here.

   1  SELECT "id", "digest", "fetched_at", "created_at", "site_id" FROM "pages" WHERE ("site_id" IN (1)) ORDER BY "id"

This is able to be performed successfully at the psql console. So I wonder what the error message means.

Updates

I found the bug.

For example, this code

   1  Page.repository.adapter.execute('SELECT * FROM "pages" WHERE ("id" IN ?) AND ("site_id" = ?)', [1], nil)

generates this sql

   1  SELECT * FROM "pages" WHERE ("id" IN (1)) AND ("site_id" = (NULL))

(NULL) causes parsing error.

This issue happens if the first value is an Array and the succeeding values are not Arrays.

posted by Png takiuchi on Sun 7 Jun 2009 at 20:12
Contents
Memo of Ambient Calculus
How to print both sides with arbitrary printers on MacOSX
GoogleDocs Outliner
Be careful if .git exists (.gitの存在に注意)
How to check dependencies of *.so file
Posture has 3 degrees of freedom
Perpetual Web Service
If you need "Text.PrettyPrint.Leijen"
How to look up the packages installed in Haskel environment
A Trouble Caused by Using do_postgres with JRuby
Comments
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
falsefalse: @tiancongxin try using this one https://github.... '12-2
tiancongxin: TerminalCopyOnSelect not work on OS X 'Lion' , ... '11-7
staiano: Roderick you rock for recompiling it. Thanks. '11-3
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ