Home
profile
User: [info]hisashim
Name: Hisashi Morita
page summary
calendar
Back December 2008
123456
78910111213
14151617181920
21222324252627
28293031
links
tags
    hisashim's Journal (2000-2008) - June 21st, 2005
    榎本ナリコ『こころ』
    --------------------

    久しぶりにマンガを読んで、面白いなあと感じた。***+. 現在の「私」と先生の奥さんとの関係が描かれなかったのが残念だけど、若き先生とK、そして現在の「私」と先生という男同士の関係に重きを置いてるみたいだからしょうがないか。ものはTさんに貸してもらった。

    夏目漱石, 榎本ナリコ『こころ』
    http://www.amazon.co.jp/exec/obidos/ASIN/4091848168/

    それにしても視覚的表現 + 少しの文章って素晴らしい。ストーリーを既に知っていることもあって、脳に全く負担がかからない。それでいてしっかり印象に残る。原作を読み直したら今だって数時間はかかるはず。マンガは作り手こそ手間がかかるけれど受け手にとっては素晴らしく安楽な娯楽だ。これは人気がある訳だ。でも212ページを15分くらいで読んでしまったので、もったいないことをした。
    docutils/*/ja.py: Japanese language mapping files
    -------------------------------------------------

    発作的にDocutilsの日本語マッピングファイル(の叩き台)を作って投稿してみた。

    SourceForge.net: Detail: 1224618 - ja.py: Japanese language mapping files
    http://sourceforge.net/tracker/index.php?func=detail&aid=1224618&group_id=38414&atid=422032

    docutils Patches 1224618 ja.py: Japanese language mapping files
    http://article.gmane.org/gmane.text.docutils.devel/2972

    予想されたことではあるけれども、今のところ反応なし。やっぱりいくら余裕がないとはいえ、いきなり投げるのではなく、MLに参加したり日本語圏の開発者に相談するなりといった下準備をしてからのほうがよかったか。下手だったなあ。反省。
    Musical Baton
    =============

    (Note: You really do not have to read this. That's why I wrote this in non-Japanese.)

    Hiroshi tossed me a baton.
    http://ohkubo.s53.xrea.com/diary/?date=20050616#p07

    * Total volume of music files on my computer:
    ---------------------------------------------

    Less than 1GB. I am not a devoted music listener and too lazy to rip-and-encode music.

    (I'd rather save entire disc as an image and listen to it directly. Lossy encoding is a necessary evil that will be unnecessary someday IMHO.)

    By the way, I wonder if music videos count for music files. I like "listening" to music videos when working at a PC.

    * Song playing right now:
    -------------------------

    None. 1) I cannot afford a soundproof room and 2) my ears hurt if I use headphones for long.

    * The last CD I bought:
    -----------------------

    - Bjork, "Post"

    * Five songs(tunes) I listen to a lot, or that mean a lot to me
    ----------------------------------------------------------------

    - Led Zeppelin, "Nobody's Fault But Mine"
    - Jimi Hendrix, "Freedom"
    - The Police, "Message in a Bottle"
    - Jimmy Cliff, "The Harder They Come"
    - Denki Groove, "人事を尽くさず天命を待つ"
    DG's seemingly cynical songs paradoxically encourages me in many difficult situations.

    * next 5 people
    ---------------

    I do not know who to pass the batons. Anyone interested can take over.
    Coding Baton
    ============

    (Note: You really do not have to read this. That's why I wrote this in non-Japanese.)

    Nobody passed me a baton but I cannot resist answering.

    http://www.dodgson.org/omo/t/?date=20050619#p02

    * Development tools installed:
    ------------------------------

    - Emacs, xyzzy
    - GNU make
    - Ruby
    - zsh
    - Subversion
    - Cygwin

    I omit tools that I use only occasionally, though there are many.

    * Current project:
    ------------------

    - DocDiff (text comparison utility)

    - Workbook.org (Agile Publishing System)

    And some more imaginary-ware.

    * Application that influenced me a lot:
    ---------------------------------------

    - N60m-BASIC (built-in BASIC interpreter of NEC PC-6001mk2)
    I started programming in my pre-teen, though that does not mean I am good at it. It was not a Lisp Machine or Unix workstation, but anyway.

    - Macintosh and MacOS (Finder, HyperCard, AppleScript, etc.)
    It's good to know different culture.

    - WWW and CGI (NCSA httpd + Perl4 on SunOS4)
    Re-started programmming with Llama book.

    - Unix environment (SunOS4, FreeBSD 2 and then Debian GNU/Linux)
    Thus I came to believe that every general-purpose computer should be equipped with programming tools, and that programming freedom is indispensable.

    - Ruby and RubyUnit (ancestor of Test::Unit)
    Practical OOPL and unit testing changed my way of programming.

    - Lisp and Scheme (Emacs Lisp, xyzzy Lisp, Gauche)
    Functional programming changed me somehow, even though I do not write everyday utility in FPL.

    These are all environments. No single user application influenced me as much as the environments that I work in. As someone told me, "You are what you eat".

    * Five books I read a lot, or that mean a lot to me:
    ----------------------------------------------------

    - Brian Kernighan, Rob Pike, "Unix Programming Environment"(石田晴久訳『Unixプログラミング環境』)
    I confess that I have not yet completed it. I wish it to be revised.

    - David Thomas, Andrew Hunt, "The Pragmatic Programmer"(村上雅章訳『達人プログラマー』)
    Basics.

    - Pete McBreen, "Software Craftsmanship"(村上雅章訳『ソフトウェア職人気質』)
    Not only programmers but everyone can benefit from this idea.

    - Tom DeMarco, "Peopleware"(松原友夫, 山浦恒央訳『ピープルウェア 第2版』)
    It's human that get things done.

    - Tom DeMarco, "Slack"(伊豆原弓訳『ゆとりの法則』)
    Ditto.

    Five is too small a number. Give me a few hundred more.
    xdocdiff
    --------

    TortoiseSVNでMS Word, Excel等のファイルを比較できるようにするソフトウェア。

    xdocdiff
    http://freemind.s57.xrea.com/xdocdiff/

    TortoiseSVNでWord, Excel, PowerPoint, pdfのdiffを見れるようにするツール

    (via Subversion-jp list)

    xdoc2txtを使ってテキストに変換し、それを比較している模様。

    比較プログラムはRekisaを推奨しているようだけれども、DFなど他のツールでも構わないらしい。既に.ini ファイルで比較プログラムを指定できるように書き換えた人がMLに現れている。

    xdoc2txt
    http://www31.ocn.ne.jp/%7Eh_ishida/xdoc2txt.html

    xdoc2txtはPDF,WORD,EXCEL,一太郎などの各種バイナリ文書から、テキスト要素を抽出する汎用テキストコンバータです。

    マウスを使ったGUI操作だけで作業できるのは魅力的。自分はxyzzy + xdoc2txtでもいいのだけれど、他人に教えるのが楽そう。社内文書の版管理に使えるかもしれない。
    pdfdiff
    -------

    文書を改訂するたびに、どこが変わったか・他の箇所に意図しない影響が出ていないかを目視で確認するのは面倒だ。そもそも人間がやる仕事じゃない。というわけでコンピュータにやってもらうことにした。
    つまり2つのPDFファイルをページごとに比較するスクリプト。簡易検版……とまではいかなくても、まあ補助ツールにはなるでしょう。
    # DebianのGSは7.07以降でないとPDFファイルによってはエラーが出る模様。

    ---- pdfdiff
    #!/bin/sh
    # pdfdiff: PDF comparison utility
    # 2005-06-21 Hisashi Morita
    # Licensed under modified BSD license
    #
    # Description:
    #   Compare 2 PDF files, page by page, and output difference
    #   to *.diff.png and to *.pdfdiff-report.
    #
    # Requirement:
    #   Ghostscript, ImageMagick and diff(cmp)
    #
    # Usage:
    #   % pdfdiff 1.pdf 2.pdf
    #   (view *.pdfdiff-report and *.diff.png)
    #   (delete *.png *.pdfdiff-report)
    #
    #   Windows users:
    #   Copy gswin32c.exe as gs.exe. Or use environment variable:
    #   % GS=gswin32c.exe pdfdiff 1.pdf 2.pdf
    
    if [ $GS ]
    then
      echo "Using $GS as specified ..."
      gs=$GS
    else
      echo "Using gs (default) ..."
      gs=gs
    fi
    
    $gs -dBATCH -dNOPAUSE -dNOPLATFONTS -sDEVICE=pnggray -r150x150 -sOutputFile=%04d.1.png $1
    $gs -dBATCH -dNOPAUSE -dNOPLATFONTS -sDEVICE=pnggray -r150x150 -sOutputFile=%04d.2.png $2
    
    date >> $1.pdfdiff-report
    
    for p in *1.png
    do
      page_a=$p
      page_b=`basename $p 1.png`2.png
      page_diff=`basename $p 1.png`diff.png
      if cmp --quiet $page_a $page_b
      then
        :
      else
        composite -compose Difference $page_a $page_b $page_diff
        cmp $page_a $page_b >> $1.pdfdiff-report
      fi
      rm $page_a $page_b
    done
    

    1つ前の版のバックアップを残してそれと比較するようなMakefileを書いてみた。

    ---- Makefile
    # Makefile for reStructuredText
    # 2005-06-21 Hisashi Morita
    # Licensed under modified BSD license
    
    SRC = authorguide
    #SRC = authorguide-fin
    
    # LATEXSTYLESHEET = /usr/share/texmf/ptex/platex/misc/jsarticle
    # LATEXSTYLESHEET = /usr/share/texmf/ptex/platex/base/jarticle
    #LATEXSTYLESHEET = jarticle
    
    all: $(SRC).pdf $(SRC).html
    
    $(SRC).pdf: $(SRC).dvi
            if test -f $(SRC).pdf ; then mv $(SRC).pdf $(SRC).old.pdf ; fi && \
            dvipdfmx $(SRC).dvi
    
    $(SRC).dvi: $(SRC).tex
            sed -i 's/\(\\usepackage\[eucjp\]{inputenc}\)/%\1/' $(SRC).tex && \
            platex --kanji=euc $(SRC).tex
    
    $(SRC).tex: $(SRC).txt
            rst2latex --output-encoding=EUC-JP --output-encoding-error-handler=replace --language=en $(SRC).txt --stylesheet=$(LATEXSTYLESHEET) > $(SRC).tex
    
    $(SRC).html: $(SRC).txt
            rst2html --output-encoding=UTF-8 --language=en $(SRC).txt > $(SRC).html
    
    comparepdf: $(SRC).old.pdf $(SRC).pdf
            ./pdfdiff $(SRC).old.pdf $(SRC).pdf
    
    comparepdfclean:
            rm -f ????.diff.png *.pdfdiff-report
    
    clean:
            rm -f $(SRC).tex $(SRC).aux $(SRC).out $(SRC).dvi $(SRC).log
    
    distclean:
            rm -f $(SRC).tex $(SRC).aux $(SRC).out $(SRC).dvi $(SRC).log $(SRC).pdf $(SRC).old.pdf $(SRC).html
    

    なんかいかにも幼稚なので改善したいけど、今の僕にはせいぜいこれくらい。とりあえずバックアップしておく。

    Advertisement