2013年1月1日 星期二

Octave (1)


曾經想要學電腦語言; C, Java, REXX, 都學了一點, 到後來都因為不知為何而學不了了之。現在因為想學微積分, 找到了 Octave 這個東西。它不只是一個電腦語言, 而是一個互動式的軟體系統, 可以把它看作是一台很強的, 可以拿來寫程式的, 圖型化計算器。既可學寫程式又可學微積分, 可說一舉兩得

Octave 最基本的運算符號有: +, -, *, /, 以及 ^; 2^3 是2的3次方, 等於8。括號的使用方式也與一般四則運算相同。* (乘號)則不可如一般書寫時省略

Octave 的環境很像 Python 或 REXX 這種解譯語言, 每輸入一行指令, 就會轉譯成機器碼然後執行產生結果。它也提供各種數學運算函式, 正如其他電腦語言會提供的一樣。(ex. 輸入 sin(pi/2) 就會得到 1 的答案)


寫到這裡, 不得不複習一下三角函數...

(待續)


2011年5月17日 星期二

Polymorphism and Opaque

The ability to apply the same function to objects of different types is called polymorphism.


The details of data type representation of an opaque type in an interface are not to be seen by clients.

2011年1月9日 星期日

USENET

Because of Google, many computer users nowadays do not know USENET any more; however, it is still one place you can go for asking questions about almost anything. What is the USENET? Again, you can google it and then come back here. Please do it.

The most popular things that people do with USENET are:
  • Access free software.
  • Discuss technical topics.
  • Keep current on a hobby or special interest, or learn about new ones.
For example, there is a newsgroup comp.unix.solaris that discusses Solaris OS system. There you can ask any question about it.

At the time when the Internet was not popular, people communicate at remote sites either by written letters or by telephone calls. The first Internet-like service was mailing lists. Sending a message to a mailing list alias would forward the message to all the individuals who had subscribed to the list. And the USENET was the second one, that had the same purpose of sharing resources.

2010年12月29日 星期三

RPN Calculator

If you need a reverse Polish notation calculator, you can use xcalc command with -rpn option. And don't forget to set PATH to include /usr/openwin/bin.

OS/2 also has a RPN calculator called RPCALC. You can download it from Hobbes web server under the directory /pub/os2/apps/calc. You will need EMX to run it. You'd better install EMX using WarpIN installer. Or even better, NH48S, a very functional alfa of a Reverse Polish Notation calculator for OS/2. It is very similar to the HP48 made by Hewlett Packard.

2010年12月19日 星期日

Holism: the position that the whole is often greater than the sum of its parts.

We should appreciate the effort that puts things together.

The best application of holism is stock market.

Thinking recursively requires you to think holistically. In the recursive domain, reductionism is the enemy of understanding and invariably gets in the way.


在學習電腦語言時,讀到了兩個觀念:reductionism 以及 holism. 前者認為一件事物可以藉著瞭解組成它的各個部份而被瞭解;後者認為事物的整體經常是大於各個部份的總合。程式設計師在學習程式設計時,經常要交錯的使用這兩個互相對立的觀點。修行也是如此。因為偏於修止,於境暗昩,謂之沉沒,此時宜修策舉相;若心高舉,則應修厭背相,使心沉靜。
然而,若是使用遞迴的技巧,則 reductionism 會成為瞭解程式的敵人,必須讓自己完全以 holism 的觀點來思考。此時就跟捨的法門很類似了。

Programming Abstractions in C

by Eric S. Roberts



a standard version: (the unix-xwindows version cannot be installed on Debian)

1. 必須使用 csh
2. 將 standard.shar 下載至 /opt
3. sh standard.shar
4. cd cslib
5. make
6. cp gccx /usr/local/bin
7. cp cslib.a /usr/lib

gccx 是一個 csh 的 script, 執行時會設定路徑,所以使用 gccx 也要用 csh.


5 ways you can learn programming faster:
  1. Look at the example code.
  2. Run it.
  3. Write your own code as soon as possible.
  4. Learn to use a debugger(dbx).
  5. Seek out more sources.