Older blog entries for zhaoway (starting at number 289)

i'm reading through Daniel S. Christiansen's microeconomics with calculus. his pdf is simply beautiful. (i'm not knowledge enough to judge the contents of the text.)

i'm also reading through a game theory book (in pdf). there're really many free stuff on econ on the net. (last time i found many free stuff by googleing parent directory and pdf heeheehee) but whenever i came to a bookstore, i simply find there're far far more books. and the covers and thickness always impress me and implies to me far better qualities within.

recently i set a rule for my self. only reading books. do not read papers. it's more efficient reading. only reading books. before that i was eager to reading numerous papers on the internet simple because they're free. but i know now that i can't even finish reading a small portion of the best books. then why bother with papers. even if the author write really brilliant papers, chances are she will later on write better books to explain things more clearly and in better ways.

just don't read papers. the saved time could be spent on book.

20 Feb 2005 (updated 20 Feb 2005 at 11:01 UTC) »

now i'm really wasting my time, ;)

put in ~/.bashrc

wwwcat()
{
    xtitle "netcat"
    if [[ "${2}" == "" || ! -f "${2}" || ! -r "${2}" ]]; then
        echo "Usage: wwwcat PORT FILE"
        echo "PORT is TCP port number on which you must be able to listen"
        echo "FILE is a normal local file readable by you"
        echo "Example: 1. wwwcat 8000 pr0n.gif"
        echo "         then open your browser visit http://localhost:8000"
        echo "         2. while true; do wwwcat 8000 pr0n.gif; done"
        echo "         this can serve more clients one after another"
        return
    fi
    resp="HTTP/1.0 200 OK"
    cont_type="Content-Type: "`/usr/bin/file -bi ${2}`
    cont_length="Content-Length: "`/usr/bin/stat -c%s ${2}`
    echo -e ${resp}"\n"${cont_type}"\n"${cont_length}"\n" | /bin/cat - ${2} | /bin/nc -l -p ${1}
}

i suck. i know. ;)

这好像是以前carlos告诉我的嘞。

put in ~/.bashrc

pdfbrk()
{
    xtitle "pdftk"
    if [ ! -f ${2}.pdf ]; then
        echo "Usage: pdfbrk NUMBER FNAME"
        echo "NUMBER is the total number of all pages"
        echo "FNAME is basename of a PDF without .pdf"
        echo "Example: pdfbrk 1978 dictionary"
        echo "Suppose dictionary.pdf has 1978 pages in total."
        echo "Output will be dictionary.1-13.pdf"
        echo "               dictionary.11-23.pdf"
        echo "               etc."
        return
    fi
    for i in `/usr/bin/seq 1 10 ${1}`; do
        j=$(($i+12))
        if [ $j -gt ${1} ]; then
            j=end
        fi
        /usr/bin/pdftk ${2}.pdf cat $i-$j output ${2}.$i-$j.pdf
    done
}

to help me read big pdf files on screen. i just easily got tired after every 10 pages. ;)

谢谢来医的指点!我差不多是第三次忘记了怎么在Debian下面安装字体。回头我就试试看这些字体。看看效果如何。再次感谢!^_^

scons has a new version out.

scons is a replacement for make, but make is really not a problem waiting to be solved. the problem is the autotools which are good and old. the fault of autotools is it is oh so very hard to learn and at the end you can port your programs to what? aix? hp-ux? and a zillion i-can't-name-it dinosaurs. what i really care is native windows and a couple of linux and maybe solaris and mac os x. all i want is build with their native build tools instead of gnu-pull-me-all-out.

so scons is python, if we say make is shell programming. with python, yeah itself is a portable programming environment, you can do some portability things, at least by hand, for now. and scons will grow, i have confidence in this project. in the near future, i believe you won't have to do that much work by hand at all. it's just a matter to accumulate some more snippets of good scripts.

that being said, to do a similar tool in scheme or lisp or whatever one of those less popular programming languages is not that much meaningful. because the concern here is about portability. if the programming language itself is not a portable and versatile programming environment. then cowsay: mooo... ;)

斜过来的中文一点都不好看。

正常的中文,没有斜体也没有粗体。但是这个在Advogato这里就不好看。可能是因为Advo用UTF8,反正我的浏览器里面,不好看。

我用的是Firefox浏览器,是在DebianGnome里面。我的<b>括住的中文,用的是黑体,而不是加粗的宋体。我的<i>用的是仿宋体,但是我没有办法让它正过来,不要向一边歪倒。

但是上面说的在Advo就行不通。也不是完全行不通。不过总之是有不对头的地方。另外我还需要一个好的繁体字库,这样就可以让Planet Debian HKPlanet Debian TW显示的比较漂亮了。我现在的繁体字库里面字不全。特别是我用的黑体和仿宋体,字差的比较多。宋体还好。

it seems i really hat hashes, i like avl trees from heart. ;) (or, avl trees. the former url which the author likes but seems can't work.)

$ alias man='MANWIDTH=69 /usr/bin/man'
$ man scons

finally! i can read a manpage now on my wide wide terminal window. heeheehee.

13 Feb 2005 (updated 13 Feb 2005 at 22:53 UTC) »

downloading adobe reader 7.0 for linux. pdf is life. ;)

on the other hand, it's a pity DjVu didn't get widespread use. another example of a big fat company kill an excellent product. almost dead but not without hope.

it's a surprise to read chalst reply to my diary. hehe. i'm sorry i have a bad temper from time to time. and sye replied to my Live Journal once a little while ago. it's nice i can still make communications. ;) thank you guys.

i'm trying to ease my ill temper every day. i think my girl friend has helped a lot. hahaha. it's only bad to drive people like chalst and sye away from my net life (sorry. i don't like it to happen. ;) i hope i will do better and better.) but it would be end of life if i drive my gf away from daily life. ;)

12 Feb 2005 (updated 13 Feb 2005 at 06:59 UTC) »
japan's ghosts. i sincerely hope they will never ever come to life again. but it's a tough bet.

after reading docs on autotools the whole morning, i decided to try scons.

280 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!