在bash中切variable

from how split a string in bash?”

  1. Use # and % modifiers to ${}. I’ll do my example on colon instead of space:

    $ x=a:b:c
    $ echo ${x%:*}
    a:b
    $ echo ${x#*:}
    b:c

    The bit after the % or # is more like a shell glob than a regular expression, in case you want to get fancy there.

  2. #!/bin/bash

    thing="once upon a time"

    set -- $thing

    foo=$1
    shift
    bar=$@

    echo "foo: $foo"
    echo "bar: $bar"

    prints
    foo: once
    bar: upon a time

cwtex win7 中找不到 postscript

from win7 中找不到 postscript

我是在 win7 下灌 cwtex34,灌好以後,執行cwtex 會出現

Sorry, I can not find gswin32c.exe or gswin64c.exe in your computer.

Please make sure that you have installed ghostscript
請按任意鍵繼續 . . .

按完後會出現

Sorry, I can not find SumatraPDF.exe

If your \Program Files is in d: or e:

please revise the setup in the beginning of cwpdf.bat or cwps.bat

and rerun.

請按任意鍵繼續 . . .

雖然我已經灌了好幾次,仍然找不到原因。有試過一些網友的建議,像是在D:/ 中把它解開安裝等等,但仍然沒有成功製作出 .ps 或 .pdf 檔。
繼續閱讀 cwtex win7 中找不到 postscript

How to Recognize When to Go Home

Most programmers are good programmers, and good programmers want to get a lot done. To do that, they have to manage their time effectively. There is a certain amount of mental inertia associated with getting warmed-up to a problem and deeply involved in it. Many programmers find they work best when they have long, uninterrupted blocks of time in which to get warmed-up and concentrate. However, people must sleep and perform other duties. Each person needs to find a way to satisfy both their human rhythm and their work rhythm. Each programmer needs to do whatever it takes to procure efficient work periods, such as reserving certain days in which you will attend only the most critical meetings.

Since I have children, I try to spend evenings with them sometimes. The rhythm that works best for me is to work a very long day, sleep in the office or near the office (I have a long commute from home to work) then go home early enough the next day to spend time with my children before they go to bed. I am not comfortable with this, but it is the best compromise I have been able to work out. Go home if you have a contagious disease. You should go home if you are thinking suicidal thoughts. You should take a break or go home if you think homicidal thoughts for more than a few seconds. You should send someone home if they show serious mental malfunctioning or signs of mental illness beyond mild depression. If you are tempted to be dishonest or deceptive in a way that you normally are not due to fatigue, you should take a break. Don’t use cocaine or amphetamines to combat fatigue. Don’t abuse caffeine.

中肯文 from http://samizdat.mines.edu/howto/HowToBeAProgrammer.html

看了科學人 雲端上的開放源碼 才知道,pingyeh 葉平 是google 台灣雲端計劃的主持人 http pingyeh…

看了科學人 雲端上的開放源碼 才知道,pingyeh 葉平 是google 台灣雲端計劃的主持人 http://pingyeh.blogspot.com (汗)

計算未來(原文 The Machine that Would Predict the Furture 可以看得到可能是因為在中研院,另外一個免費的) 裡提到,隨著可取得的資訊量因為工具的發展大量激增,赫爾畢(Dirk Helbing)希望能夠利用巨量資料並透過複雜社會模型(活地球模型),來計算出未來,並已取得10億美元的計劃。溫伯格提出了幾個問題:1.社會科學並沒有現存精準的預測模型 2.短期資料只能做短期預測,長期資料只能做長期預測 3.人們並不一定理解算出來結果的意義。

其實我要講的是,我也希望可以用地震、氣象、海洋資料等,建一個活地球模型 @@

金融風暴背後的公式
即使有2008年經濟崩盤的教訓,華爾街還是把我們的未來賭在不周延的科學上。