跳到主要內容

發表文章

目前顯示的是 2月, 2011的文章

Network Security

在尋找偽裝( Masquerading) 攻擊時,找到共同筆記[1]所寫的內容,對於 網路安全的分類很詳細、清楚,另外筆記中也有其他像 Cloud Computing 的資料可以參考。 ----------------------------------------------------------------- [1]  http://sls.weco.net/node/10551 [2]  http://sls.weco.net/node/10655

Crawlzilla

Crawlzilla[1]是一個具雲端概念之自由軟體專案,主要協助使用者透過簡易安裝及操作的方式建立自己專屬的搜尋引擎,其具有叢集式平行多工、web操控以及可動態調整叢集主機量的特性,極具雲端運算的擴展性。 以上是從國網中心電子報所得知的訊息,是提供企業內部一個很好搜尋資料的方式,更重要的是,它是 open source 的軟體[2],可以拿 source code 來修改,以符合企業自己的需求。 -------------------------------------------------------------- [1] http://www.nchc.org.tw/tw/e_paper/sub_subject/index.php?EPAPER_ID=91&SUB_SUBJECT_ID=181 [2] http://code.google.com/p/crawlzilla/

Black Duck--Open Source Resource Center

Making software 是 O'Reilly 最近新出的一本書,主要的內容與 Beautiful Code 相同,作者 Andy Oram[1] 在2011.02.1於 Berkman Center, Harvard University 有針對 Cloud Computing 的議題做了說明,是影片檔,可以在[2]網址下載。 由 Andy Oram 的網站連結到 Black Duck--Open Source Resource Center,主要是收集所有 Open Source 所有的 Project and Software,其中在[4] 中有Open Source 對於 Cloud Computing 的相關網址介紹。 ----------------------------------------------------------------- [1]  http://www.praxagora.com/andyo/index.html [2]  http://cyber.law.harvard.edu/interactive/events/luncheon/2011/02/oram [3]  http://www.blackducksoftware.com/oss [4]  http://www.blackducksoftware.com/oss/projects/#cloud

洗鏡光 - DCview.com達人部落格

要找 working set 的資料,從 [1] 的網站中得到他寫的作業系統筆記,而他筆記的內容大部分是從洗鏡光老師投影片的內容整理而來,於是 google "洗鏡光" 找的洗鏡光老師的投影片,結果是:「洗鏡光 - DCview.com達人部落格」,這是介紹「相機」的網站阿,怎麼是洗鏡光 老師的 blog 呢? 後來自己認為:「洗鏡光老師不可能沒有自己的網頁」,於是在「程式設計俱樂部」論壇[2]中找到洗鏡光老師的發言,其中有老師的英文名字(   shene ),再使用 shene 找,於是在找到洗鏡光老師[3]在美國的網站。從老師英文的網站中,在得知老師在台灣的網站就是「洗鏡光 - DCview.com達人部落格」,繞了一大圈才在「文章列表-- 電子計算機(電腦)科學 (3)」中,真正找到洗鏡光老師的投影片。 在 blog 中,另外有2篇文章,有一篇是說明「浮點數精確度」的問題,是值得詳細閱讀。 -------------------------------------------------------------- [1]  http://nixchun.pixnet.net/blog/category/523852 [2]  http://www.programmer-club.com.tw/ [3]  http://blog.dcview.com/blog.php?m=Bj8CZQ%3D%3D

fork and exec

在 unix system 中,當某一個 child process 被執行時,系統會呼叫 fork() function,複製一份 parent process 的程式碼給 child process,child process 再使用 exec() function create 其他的 process 來執行想要的動作,在鳥哥的網站中[1]有詳細的說明。 Copy on Write technique: 但是當許多個 child processes 同時執行時,這種 fork() 的動作只需要 create 一份給多個 child processes,不需要重複的複製,以減少 memory 的使用量,這種技術叫做 copy on write 技術。 所謂 copy on write 技術就是允許 parent 和 child process 一開始就 share page,這些 share pages 被標示成 copy on write 的 page,當任何一個 process 想要寫入這些 share page 時,只要將它所需要的 share page 複製到另外 empty 的 memory space 中,才做寫入的動作。 --------------------------------------------------------------------- [1]  http://linux.vbird.org/linux_basic/0440processcontrol.php

Condition Variable

在 OS 第6 章中討論 Processes Synchronization 的問題,其中 Monitor 是一種 解決 Processes Synchronization 問題的程式結構,主要是利用 Semaphore 的機制來處理 critical section 的問題,而因為某些 threads 在 Monitor 中被執行,不僅是將資料 lock 住就可以了,有些時候必須要 Condition Variable 來限制某些條件之下,才能存取資料,在[1]中舉了一個例子,就是「 某個 thread 如果要從 stack 中讀取 data,如果 stack 中沒有 data 就必須等待 data 被 push 到 stack 中」。   在上述這種情況下,僅僅是使用 mutual exclusion 是不能夠滿足特殊條件下的需求,於是有 condition variable 的變數設定,引用 [1] 程式的例子如下: do { boost::mutex::scoped_lock guard(m_lock); ..... m_condition.wait(m_lock); } while (some condition); 完成條件叫醒等待中的執行緒 { boost::mutex::scoped_lock guard(m_lock); ..... m_condition.notify_one(m_lock); } -------------------------------------------------------------------- [1]  http://yumei.homeip.net/blog/index.php?m=08&y=09&d=25&entry=entry090825-091626&category=18 [2]

mmap()

在讀作業系統時,看到  POSIX API 提供了 mmap( ) 及 umap( ) 的功能,將 memory 當作 file 來使用,以及釋放 memory 空間的 function。 mmap() 就是將 memory mapping 成一個 file ,如果在程式設計有需要用到大量的檔案內容時,可以採用 POSIX API 提供的這個 function 來對 file 做有效率的存取,特別是兩個以上 process 同時存取相同一個 file 時。

Grub2

第一次使用 Tomboy Notebook 來紀錄自己的筆記,主要處理最近使用 Ubuntu 時,開機畫面多了幾個 crash 掉以後的 recovery menu,找了台灣的網頁,沒有人真正寫出我只要修改 Grub2 menu 的選單而已,自己也嘗試修改 /boot/grub/grub.cfg 檔,但是 grub.cfg 是由 grub-mkconfig 自動產生的,修改以後再執行 update-grub 又修改的內容復原回去了。 於是在 google 輸入 "how to delete grub2 recovery mode menu",找到 [1] 的網站,說明了如何刪除 menu 以及隱藏 recovery mode 的作法,其中有一些小錯誤也一併修正。 Q: How to delete old version of kernels in grub2 menu ? A: Delete them from /boot directory. Both initrd and vmlinuz files. Than run update-grub. Q: How to hide recovery mode in grub2 menu ? A: Change this line #GRUB_DISABLE_LINUX_RECOVERY=”true” as GRUB_DISABLE_LINUX_RECOVERY=”true” (delete command character.) in /etc/default/boot /etc/default/grub. Than run update-grub. Q: How to disable memtest in grub2 menu ? A:  cd /etc/grub.d      sudo chmod -x 20_memtest86+      sudo update-grub 接下來是美化開機畫面,在 [2] 中有一個漂亮的開機畫面,於是按照說明的項目一一實做,其實可以使用 synaptic 程式來完成,只要在套件庫加入 deb http://ppa.launchpad.net/bean123ch/burg/ubuntu maverick main 資料來源。不過要加

Big5 to UTF8

轉換的方式依照作業系統的不同有所差異, 在 Windows 底下: 1. 利用 Notepad++ ,在 Encoding 選項中選擇  ansi to utf8 2. 利用 convertz740 程式轉換 在 Linux 底下:[1] 1. 首先檢查是否已經安裝 perl 的 text-iconv 的套件 2. 執行下列指令:     piconv -f big5-eten -t utf8 < index.htm  > index2.htm 3. 可以使用 piconv -l 查看有哪一些編碼可以被轉換, piconv  //for help --------------------------------------------------------------------------------- [1] http://stackoverflow.com/questions/2800890/converting-a-file-to-utf8-format-using-perl

live USB

將開南大學贈送的 4 GB usb 安裝成 ubuntu 作業系統,不是 ubuntu live 而是以 usb 硬碟當成一般硬碟來看待,將 ubuntu 10.10 安裝到 usb 當中,讓自己可以隨時隨地的使用自己的作業環境,並且可以儲存自己所開發的資料。安裝的重點有下列幾點: 1. 利用 ubuntu live 開機,點選「安裝」,不是「試用」 2. 自己手動規劃硬碟,原有的規劃如下:     (a) 600 MB -> NTFS , 且設為 primary partition     (b) 3GB -> ext4, root, logical partition     (c) 400 MB ext4, swap, logical partition   但是如果要 update 時, root 的硬碟空間不足,所以要將 usb 重新安裝,不要保留 NTFS 的空間,而使用在 Dropbox 中新申請的硬碟空間,申請的帳號為: runnerhsieh@hotmail.com 3. 在規劃硬碟完成以後,必須特別注意:要將 boot manager 設為 usb 開機,即 /dev/sdc 4. 在 ausu laptop 中 可以參考 ubuntu 網站[1]來自己規劃要安裝的軟體,或者從已經安裝好的硬碟中轉到 usb 當中(How to Customise the Ubuntu Desktop CD[2])。 ------------------------------------------------------------- [1] https://help.ubuntu.com/community/LiveCD/Persistence [2] https://help.ubuntu.com/community/LiveCDCustomization

HTML

HTML 中的一些 Esacpe Code List [1], Character Escape Code SPACE        %20 <                %3C >                %3E #                %23 %                %25 {                %7B }                %7D |                %7C \                %5C ^                %5E ~                %7E Character Escape Code [                %5B ]                %5D `                %60 ;                %3B /                %2F ?                %3F :                %3A @                %40 =                %3D &                %26 $                %24 alt 屬性: 是用在如果無法顯示圖片時,(如:使用 w3b 來瀏覽網頁,或是圖片連結有誤時)用來取代該圖片的一段文字。 title 屬性:滑鼠移到上面時所顯示的文字 ----------------------------------------------------- [1] http://www.december.com/html/spec/esccodes.html

PeopleSoft

執行平均成績:   1. path: 紀錄與註冊  -> 學期處理  -> 學期成績排名   2. 原本peopleSoft 引擎已經有自動執行平均的程式,不需要再由人工來執行,但是因為暑修成績及一些通識講座的課程,不納入單學期成績平均,所以才必須另外再執行平均成績的動作。   3. 輸入參數:所有學制,學系輸入空白,0991 單學期成績單:   1.  path: 紀錄與註冊  -> 註冊組報表  -> 單學期成績轉 csv 檔   2. 輸入參數:0991, U%, 本地生

Association Rule Mining

What is association rule mining?  A:   Given a set of transactions, find rules that will predict the occurrence of an item based on the occurrences of other items in the transaction Definition • Support count (\sigma):  itemset  出現的次數 ∘ Frequency of occurrence of an itemset ∘ E.g.   \sigma({Milk, Bread,Diaper}) = 2 • Support: 某一個 itemset / itemset 的總數 ∘ Fraction of transactions that contain an itemset ∘ E.g.    s({Milk, Bread, Diaper}) = 2/5 • Frequent Itemset ∘ An itemset whose support is greater than or equal to a minsup threshold •  Rule Evaluation Metrics ∘ Support (s): Fraction of transactions that contain both X and Y, i.e.    \sigma({X, Y}}/T ∘ Confidence (c): Measures how often items in Y appear in transactions that contain X,   \sigma({X, Y}}/ \sigma (X)    Maximal Frequent Itemset: • An itemset is maximal frequent if none of its immediate supersets is frequent(最相近的 superset 都不是 frequent itemset) • example: ∘ Items: a, b, c, d, e ∘ Frequent Itemset: {a, b

Cluster Analysis

Type of Clustering:[1] k-means clustering The algorithm steps are: • Choose the number of clusters, k. • Randomly generate k clusters and determine the cluster centers, or directly generate k random points as cluster centers. • Assign each point to the nearest cluster center, where "nearest" is defined with respect to one of the distance measures discussed above. • Recompute the new cluster centers. • Repeat the two previous steps until some convergence criterion is met (usually that the assignment hasn't changed). Hierarchical Algorithm • Produces a set of nested clusters organized as a hierarchical tree • Two main types of hierarchical algorithm are  either agglomerative ("bottom-up") or divisive ("top-down") •  Agglomerative(凝聚) algorithms begin with each element as a separate cluster and merge them into successively larger clusters • Divisive(分離) algorithms begin with the whole set and proceed to divide it into successively smaller

Sequential Pattern Mining

Sequence  Data(ch7 ppt 28) • 討論有關與資料出現順序有關的 itemsets, 例如:生物的 DNA, ATGC 字母的出現順序是有關係 • 在 sequence 中的 elements 是有順序關係,但是在 elements 中的 itemsets 是沒有順序性,如同之前章節所討論的 itemsets 一樣,與順序無關 • 算 sequence 長度是計算其中 events 的個數,但是所謂 k-sequence 是計算 sequence 中所有 items 的個數,即 k-sequence 共有 k 個 events(items) 的 sequence, for example, <{a,b} {a,c} b {d, f}> sequence is 7-sequence. Formal Definition of a subsequence(ppt 30) • A sequence <a1 a2 … an> is contained in another sequence <b1 b2 … bm> (m >=n) if there exist integers i1 < i2 < … < in such that a1 \in bi1 , a2 \in bi1, …, an \in bin • 在表第二列中,因為 {1},{2} 不同時間發生,所以不是<{1,2} {3,4}> 的 subsequence    • 檢查是否是某一個 sequence 的 subsequence 的方法 ∘ 檢查順序是否相同 ∘ 檢查是否為 sequence 的子集合 Contiguous Subsequences s is a contiguous subsequence of  w = <e1>< e2>…< ek> • if any of the following conditions hold: ∘ s is obtained from w by deleting an item from either e1 or ek ∘ s is obtained from w by deleting an

DataMining Project

Data Mining Project 2010Fall Data Mining course 的 project 原本是選 content-base Image Retrival 的題目,但是因為無法取得 data set,而且要自己產生 data set 必須花費很多時間,所以更換了 use of KNN for Netflix Prize 這個題目,如果有時間可以將原來使用 boosting algorithm 擷取 images 的題目實做看看,已經找到 Fire[1], Firewatch[2] 的 source code. 在 KNN project 中,William 修改了 ice Netflix framework 的程式,其中 probe.ccp comment out 169-170 line 取消了 執行到 297 就停止的限制,comment out 175-178 line 把 compile 時將結果輸出到螢幕的部份 comment out,減少 compile 的時間。 基本上要先安裝 Qt4 SDK ,然後將 Netflix data set 放到 root folder,也就是與 icefox-netflixrecommenderframework-b0315e1 同一層的目錄中,然後開啟 algorithm/knn/knn.pro 的 project 執行 Build all 即可。 [1] http://thomas.deselaers.de/fire/ [2] not found

Tomboy

Tomboy 安裝了下列附加套件的功能 [1]: 1.  InsertImage.dll [2] : (C:\Users\runner\AppData\Roaming\Tomboy\config\addins) 2. ExportToLaTeX.dll [3] : Export to latex.tex files 3. Tomboy-LaTeX [4]:  未安裝在 home Desktop 4. 啟動 today 的功能 : Edit -> Preferences -> Add-ins -> Tools -> Note of the Day 5. 可以做英文拼字檢查,但是沒有作用 -------------------------------------------------------------- [1] http://live.gnome.org/Tomboy/PluginList [2] http://mattguo.com/tomboy-image/ [3] http://notendur.hi.is/pth8/ [4] http://www.reitwiessner.de/programs/tomboy-latex.html

Syncing

Syncing 總共申請兩個同步的帳號, https://one.ubuntu.com/notes and https://www.dropbox.com/ 兩個帳號,都是使用 e-mail 作為帳號,ubuntu  的空間作為 note 的同步空間, Dropbox 的作為檔案同步的空間。 在[1]網站中有提到如何同步的問題,所講 Tomboy 預設同步的缺點,有點看不懂。 [1] http://blogs.gnome.org/rodrigo/2009/10/28/syncing-tomboy-notes-with-ubuntu-one/ [2] http://live.gnome.org/Tomboy/Directories

Qt Creator

Qt Creator Data Mining Project 是Netflix recommander system 的預測,與 William Gibson 同一組,在網路上找到使用 knn[1] algorithm 的 source code,他是利用 [2] 所開發netflixrecommenderframework(簡稱 Icefox's framework) 平台來 compiling knn algorithm 程式,而  Icefox's framework 是在 Qt Creator 開發完成,所以必須安裝 Qt library, Qt Creator, g++ compiler 來 compiling 程式。 Qt 原來是由 trolltech 公司所發展的 library,後來被 Nokia 購買了,是一個跨平台的 C++ library。Qt Creator 是一個 programming 的 IDE,必須配合 Qt library 及 GNU 的 G++ compiler 編譯程式。要使用 Qt 來開發程式,可以直接下載 Qt SDK 套件,整個套件包含了 Qt library, Qt Creator, MinGW(win32版本),以及 Qt Designer。 Qt Designer 是開發 GUI 介面的 IDE,等同於 wxWidgets 的功能。 windows compiling: 既然 Qt 是跨平台的開發環境,則在Windows 作業系統中 compile Netflix knn algorithm 是可行的,所以在 asus laptop 中安裝 Qt Creator,因為不知 Qt Creator 只是 IDE,一直產生 "Could not find make command: make in the build environment" 的錯誤訊息,而尋找解決此問題的方法,花費許多時間,實際上只要將 Qt SDK 下載並且安裝完成,就可以在 windows 7 中編譯 knn algorithm 了。 在 windows 平台 compile knn algorithm,結果 產生 "The process could not be started!&q

Recovery Win 7 mbr

Recovery Windwos 7 boot manager 在過年期間安裝 usb live 時,將 asus laptop 原來 windwos 7 的 mbr 修改,變成必須插入 usb 才能開機,於是使用 windows 7 開機片重新恢復由 c 磁碟的 mbr 開機,安裝的重點為: 1. 按 alt + Esc 鍵 或者 alt + F2 鍵,使得 asus laptop 用光碟開機 2. 在開機的過程中,按下 F8 ,選擇 "safe mode with prompt" 3. 點選「修復您的電腦」 ->「下一步」->「使用可以修正 windows 啟動問題的修復工具」->「命令提示字元」 4. 在 command line 中先切換到 boot 目錄中,再輸入: bootsect /nt60 ALL /mbr 5. 重新開機

Boot menu of BIOS

Desktop : [1] ------------------------------------------------------- 進入BIOS設定畫面:〔DEL〕鍵,其他廠牌的主機板或筆記型電腦可能會是〔F12〕或〔F7〕等按鍵 自己選擇開機磁碟:〔F8〕鍵 Laptop 部份:[2] ---------------------------------------------------------------------- 廠牌 BIOS 開機選單 還原鍵 ACER F2 F12 ALT + F10 ASUS   F2     ESC F9 BenQ F10 DELL F2 CTRL + F11 Fujitsu F2 HP/Compaq F2 F9 F10(F3、F11?) IBM/Lenovo F1 F6 "Access ThinkPad" or "Access IBM" MSI F3 NEC F11 SONY F2 F10 TOSHIBA ESC -> F1 F2、F12 Press and hold the 0 (zero) while powering on the computer. ---------------------------------------------------------------------------- [1] http://briian.com/?p=6117 [2] http://dinkho.blogspot.com/2010/04/notebook-bios.html

Ubuntu One

Tomboy 有了 Ubuntu One 變得更好用 - 您的私有雲能將您的數位生活統整在一起。 Ubuntu One 不只是同步您的檔案 - 不管您是需要從任何電腦或透過網路存取聯絡人資料、筆記、書籤,或是要從整合雲端技術的商店聆聽您喜愛的音樂,或是要將您的整個收藏傳送至 iPhone 或 Android 手機都可以 - 我們在私有雲的應用上領先群倫。若要深入瞭解,請見 http://one.ubuntu.com/。 已經擁有 Ubuntu One 帳號了嗎?只要按一下「編輯」>「偏好設定」,接著點選「同步化」分頁,就能將 Tomboy 設為與您的私有雲同步。從服務的清單中選取「Tomboy 網頁」,接著按一下「連接伺服器」按鈕。網路瀏覽器會顯現,並包含一些額外的指示內容。 您甚至可以讓 Tomboy 筆記與 Ubuntu One 自動同步! 最近(2010.12.20)因為 Data Mining Project 需要在 Linux 系統中 compile Netflix KNN source code, 開始使用 Tomboy notebook 來紀錄自己的筆記,也同時開始使用 Ubuntu One, Dropbox 雲端服務中的同步化功能,在[1]中有詳細介紹如何將 Tomboy 同步到 Ubuntu One 之中, 在 Windows 之中的同步主機應該輸入 https://one.ubuntu.com/notes/ 。 在申請 Ubuntu One 時,要求密碼必須是英文字大寫字母,所以就把常用的密碼改成大寫。 ---------------------------------------------------------------- [1] https://wiki.ubuntu.com/UbuntuOne/Tutorials/Notes

Disk space is not enough

In this semester(2011 spring), I selected the course that is programming for cloud computing in Ph.D program. I check the C:\ disk space in office desktop, and the Windows 7 disk space is not enough for the course. So I should delete some files or uninstall useless software in Windows 7 partition. I found the below two files which was so big in disk, and I decided to delete it for installing M$ visual studio 2010. 1. hiberfil.sys : 2GB for  poweroff 2. pagefile.sys : 3GB for virtual memory First, I want to delete pagefile.sys, the step as following: 1. 控制台->系統及安全 ->進階系統設定->進階 tab, 效能選項 , 設定-> 進階 tab, 變更 -> 取消自動管理分頁大小 -> 取消分頁或者調整到其他的磁碟( desktop change to "software" partition) 2. reboot system Next, I deleted the hiberfil.sys file, the step as following:[1] 1. 在輸入指令的地方輸入 cmd,但是不要直接按「enter」鍵,選上方的「cmd.exe」,然後按右鍵 2. 輸入 powercfg /h off 3. reboot system 要再次開啟休眠的功能,可以參考[1] 的說明 -------------------------------------------------- [1]  http://alexchuo