2009年2月24日星期二

Programming abstraction

I've got an exercise from one of my coruse.
The question is about homeworks allocation. We have N students, they summit N homeworks.
Now is the time for the students review their homeworks, each student should have two assignments which done by another two students, and one more condition is one assignments can not be reviewed by more than two students.
For example, 4 students 1, 2, 3, 4.
Can have this allocation: 12, 13, 24, 34.

My job is to write a program that can solve thic problem automatically.
I've got a half-solution(half because it need to be proof).
If the solution is correctly, the programming part just writting the code. Using programming language to imitate human's work because the solution is the procedures of human's work original. That's call the programming abstraction.

We use the computer to solve problems. The problems is still solve by humans but through computer's calculate. The computer is a machine which can generate some outputs according to the inputs. It imitate the nature evnironment. Inside should be some instructions abstraction the nature problem. We use programming language abstraction the nature problem and through the compiler conver it into instructions which computer can understand.
We use programming to abstraction the nature world, Mathematic also the same.
Human use mathematic to abstraction the nature world, using mathematic to solve the nature problem. Therefore I think a smart gay should good in mathematic, and I study hard in mathematic although my mathematic still very poor.

Come back to the problem, I'd better to find a proof Now.

2009年2月12日星期四

the memory management in C

Although I'm not very familiar with the memory management in C and i also don't understand the working principle, i have written a lot of code using pointer and data struct or union. Therefore i found something must be notices. for example, the memory allocated must be free when they finish their job, otherwise they will still in used until the program exit.

I know C give a lot of freedom for programmer to control how to use the memory. The pointer in C is very useful. But i think the memory management in C is semi-automatic which means the compiler will just do half of the job, another left to user. To be honest, i do not like this working style. Of course programmer can control a lot but not every things, some half of the job is still done by the compiler not programmer. Programmer can not access all of the memory because of security reason, but coding in totally auto-way sometimes will case problem. That's why i said the memory management in C is semi-automatic.

Howevery, I like programing in C. I think C style is colse to the working principle of the computer. Since I using C, I understand more about how the computer work. Every time i got a problem, i will spend lots of time to study why it happen, what case the problem and how to avoid it. In programing, memory is very important because all algorithm base on data which was saved in memory. The semi-automatic memory management give me more freedom in it. As I said before, i don't like semi-automatic. In fact i like total control by my self like assembly and i hate totally automatic controling by the some other things(compiler). Assembly is hard to use so i just use C and half is enought, it can done a lot!

2009年2月11日星期三

Google Sync

Google發佈了Google Sync啦~
終於有官方的同步方法

我先簡單講下甚麼是Sync
Sync中文即是同步,這裏主要指電腦和電話等設備的同步
手提電話還是通信錄人人都會用的吧
但一個人通常都有幾台設備,所以就需要同步裏面的資料
最常用的就是通信錄、日暦和待辦事項
而常用的同步設理方法是SyncML
具體是甚麼我也不太清濋,大概是一種類似通信協議的東西吧?
………………………………
這是s60系統的設定方法(暫時只支持同步通信錄)
具體方法:
先要設定一下手機,去到同步處理;選項->新同步處理操作模式
名稱隨便打,例如Google Sync
到應用程式裏,由於目前只能同步通信錄,所以只設定它
通信錄裏設定,包含於同步處理:是、遠端資料庫:contacts,同步處理模式:標準
返回設定名稱那裏,進入連接設定
伺服器版本:1.2、伺碼器識别碼:Google、數據傳輸方式:互聯網、接入點:長期請求、主機位址:https://m.google.com/syncml、端口:443、用戶名稱和密碼:用Gmail的(username@gmail.com)

設定好以後按剛剛設定的模式做同步處理就可以了~

2009年2月9日星期一

ibm小型機

尽说些没用的. 我说我要买台手提电脑, 你给我推荐个ibm小型机

2009年2月4日星期三

Gmail按鈕微調

今天登錄Gmail發現它的按鈕有點不同,仔細一看
以前more action是一個下拉式選單
現在雖然也是按一下出現個下拉式選單,但more action本身是一個按鈕
Labels也獨立出來
還多了個Move To

以往看完郵件都要先加個Label再Archive
現在直接點Move To就可以了~
真方便
這個功能一早就應該加上去啦~

2009年2月3日星期二

橫琴留地建澳大校區

今天報紙頭版報道,澳大末來可能會搬到橫琴
雖然不是短期内的事,但我知道後都覺得很驚訝
因為澳大是「澳門大學」,搬到内地去始終有點不太好
難道要本地的學生每天過關上課?
這樣太奇怪了

現在澳大的位置其實是超一流的,在山上面
比一般地面高,而且望着珠江口
整個校區都很通風,空氣清新
讀書環境一流!
所以建豪宅也是一流,如果澳大搬走了那裏肯定會建豪宅
不過這個地點始終有個缺點
離市區太近,有車的話回家超方便
結果大部份學生下課後都回家,更多的人會跑去打工
學習時有甚麼問題都各自各解決,很難找人出來討論
如果個個都住在宿舍可能會好一點吧?

可是跔去打工不想讀書是風氣的問題,單單是搬個校區能解決嗎?
還是搬校區是有另外目的?

2009年2月1日星期日

熱門文章