karamajean's Blog
2021-07-15
2015-09-17
2013-07-24
C Struct Malloc 演示
struct mem_t{ int x; int y; }; int main() { struct mem_t *p,*p2; p = (struct mem_t *) malloc(sizeof(struct mem_t)); p->x = 24; p->y = 52; printf("p->x=%d\n" "p->y=%d\n",p->x,p->y); p2 = p; printf("p2->x=%d\n" "p2->y=%d\n",p2->x,p2->y); free(p); free(p2); return; }
C 字串轉16進字串 + 0x ,Windows Live Writer google blogger
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
C# Barcode 讀碼讀取, 自動更新
private void tbxSerial_KeyPress(object sender, KeyPressEventArgs e) { if (barcode == "") { tbxSerial.Text = ""; } barcode += e.KeyChar; if (e.KeyChar == (char)Keys.Enter) { //tbxSerial.Text = ""; tbxSerial.Text = barcode; barcode = ""; } }
標籤:
C#
2012-12-14
How to Create subversion server , 簡單快速
環境 ubuntu 11.04 i386 32bit on v-box
使用者名為 linux
1. $ sudo apt-get install subversion /* 安裝subversion */
2. $ mkdir -p /home/
3. $ cd /home/
$ svnadmin create /home/
4. 檢視一下建立的狀況
5. 設定相關存取的權限 ***重要 !!!***
$ sudo chown -R root:admin /home//svn/repository
$ sudo chmod -R ug+rwX,o= /home//svn/repository
$ sudo chmod -R ug+rwX,o= /home/
6. $ cd /home/linux/svn/repository/project/conf
$ vim authz
linux = rw /* 加入這行, */
$vim pwd
linux = passwd /*加入這行*/
6.啟動 svn
svnserve -d -r /home/
7. 從svn serve commit project
$ cd ~
$ svn co svn://
8. 建立 branches
$ cd ~/project
$ svn mkdir branches tags trunk , tags, trnk 資料夾
/* 這裡還沒傳到svn server 上, 只是在本地端先建立而已 */
9.設定帳密及權限
$ vim svnserve.conf
password-db = passwd //指定 passwd 的檔名為何, 沒設定的話會不能 ci
$ vim svnserve.conf
[users]
linux = linux // 帳號 / 密碼
10. 第一次 commit
標籤:
Linux
訂閱:
文章 (Atom)