在linux的C library中 , 提供了popen() function可以讓我們建立相同於pipeline的功能 ,

popen()的format如下:

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

svcs stands for services , 

我們可以藉由svcs來列出系統中所提供的service以及這些service在系統中的state:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

memset ( void * ptr, int value, size_t num ) , 可以讓我們對pointer所指向的一個記憶體空間塞入資料 , 
在memset中主要有三個參數 , 分別是:
  ptr : Pointer to the block of memory to fill.
  value : Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.
  num : Number of bytes to be set to the value.
  for example : 
#include <stdio.h> 
#include <string.h> 
int main () 
{ 
char str[] = "almost every programmer should know memset!"; 
memset (str,'-',6); 
puts (str);
return 0; 
}
 我們可以看到memset幫我們在str所指向的記憶體空間中塞入了6個'-' .
 

 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在面對interactive program時 (像login) , 我們常需要等待對方訊息 , 然後再進行input,

(像輸入帳號 , 密碼)

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Number()


文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在Eclipse中 , 可以很方便的跟CVS進行連接 , 

但有時我們可能會變更原先CVS的ip address , 

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

ref : http://www.hdsentinel.com/smart/index.php


文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

BIOS stands for Basic Input/Output System , 

BIOS是提供我們在電腦開機時所需進行的一些動作 , 

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

當系統發生問題時 , 我們可能需要去查出誰使用過這個系統 , 

在linux中提供了一些方法幫我們得到這些資訊:

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在網頁中 , 若我們想在使用者在按下Button時而觸發event , 基本上的做法有兩種:

1. 在input 的tag中註明click後所觸發的function.

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在regular expression中 , 我們可以藉由g modifier來決定是否進行global match ,

(也就是match所有符合的部分 , 而非只停留在第一個)

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在Linux 中 , 系統預先的設定輸出是ouput到standard out , 

若我們想redirect到file中 , 則可以藉由以下的方法:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在Javascript中 , 我們若想在某一個event 被trigger時 , 讓某一個function也同時進行處理 , 

我們可以藉由Jquery所提供的bind() method:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在Html/CSS中 , 若我們想要讓一個html element 隱藏或是顯示 , 

可以藉由css中的display() method:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在Javascript的Array object中 , 提供了一個sort method來幫我們對Array進行sort的動作:

jsonMgmt.sort(function(a , b)

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在尋找字串時 , 我們有時只會知道String中的片段資料 , 

此時我們就需要去比對該String中是否含有我們想要的substring , 

JerryCheng 發表在 痞客邦 留言(1) 人氣()

在Javascript中 , 我們若要使用Array , 必需先進行宣告:

var jsonMgmt = new Array();

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在python中 , 若要像c一樣傳入command line的arguments , 

可以藉由sys.argv的方式來取得argument的value:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在python中 , 我們若要將輸入的內容一行行的讀取 , 

可以使用splitlines()這個method , 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

在python中 , 我們可以藉由strip()來去掉字串頭尾的空白,

for example:

JerryCheng 發表在 痞客邦 留言(0) 人氣()