發表文章

Noder add Markdown project read support

無法查看此摘要。請 按這裡查看文章。
Java中Collection的操作,可以透過Collections.singleton()來移除相似內容的元素: import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class TestMain {   public static void main(String args[]) {     String init[] = { "One", "Two", "Three", "One", "Two", "Three" };          List list1 = new ArrayList(Arrays.asList(init));     List list2 = new ArrayList(Arrays.asList(init));          // 移除list1中的第一個出現的"One"     list1.remove("One");     System.out.println("List1 value: "+list1);          // 移除"One"     list2.removeAll(Collections.singleton("One"));                System.out.println("The SingletonList is :"+list2);  } } 執行結果: List1 va...

Setting rsync service on SmartOS

Rsync是一套歷久彌新的Linux/Unix系統備份工具,透過rsync可以達到差異的備份方式,讓整個備份的動作可以更有效能的執行... 而MiCloud上提供的主機預設都預載有rsync的功能,而Linux上使用可能大家已經有嚐試過,這邊複習一下,也順便說一下Windows (沒錯,Windows上也可以透過rsync來將資料備份到遠端的rsync server上唷!)上操作rsync的方式。 Rsync Server設定 Step 1: 編輯設定檔 $ vi /etc/rsync.conf 內容: log file = /tmp/rsyncd.log pid file = /tmp/rsyncd.pid port=873 [ backup ] hosts allow = 192.168.1.10              #允許的clisnt IP hosts deny = *                          #除上面allow設定的IP,不允許存取的Client,請設為* 全部 comment = ewant upload file backup path = /home/backup/upload uid = root gid = root auth users =backup secrets file = /etc/rsyncd.secrets read only = no exclude = temp/ .*                      #要排除的備份檔案或目錄,須以空格區分 設定檔中的backup是備份的模組,這個名稱可以自由取,將會用在client端操作指令上 Step 2: 編輯密碼檔 $ vi /etc/rsyncd.secrets 內容: backup:xxxxxxxxxxxxxxxxx 上面rsyncd.secrets文件中是存...

NoSQL 入門指引 - OpenFoundry

感謝OpenFoundry的詳細介紹阿~ NoSQL 入門指引 - OpenFoundry

轉載自同事的vim使用方式 - 同時在多行插入相同文字

圖片
同時在多行插入相同文字的應用有點類似UltraEdit的行編輯模式,在Sublime Text中也可以輕鬆做到...那vim呢... 在vim編輯中,有時候想要在某個範圍內插入相同文字 以底下的文件來示範 假設我們想要在59∼80行的前面加入"#" 第一步要先使用"control + v"選取59到80行的行頭 再來是用"shift + i"進入編輯模式 輸入想要插入的字元 接著按兩次"esc"就大功告成了 PS: 如果是要在行尾插入的話,就要先選取行尾的範圍        使用"shift + a"來做編輯就ok了
前幾天寫的,分享一下 :D Quick start bash script from Simon Su

MongoDB安裝好的一些貼心小提示

記錄一下,免得忘了找不到... # brew install mongodb Warning: It appears you have MacPorts or Fink installed. Software installed with other package managers causes known problems for Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again. ==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.5.tgz ######################################################################## 100.0%==> Caveats If this is your first install, automatically load on login with:     mkdir -p ~/Library/LaunchAgents     cp /usr/local/Cellar/mongodb/2.0.5-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/     launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist If this is an upgrade and you already have the homebrew.mxcl.mongodb.plist loaded:     launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist     cp /usr/local/Cellar/mongodb/2.0.5-x86_64/homebrew.mxcl.mongodb.plist ~/L...