公告版位
新版Blog peichengnote

目前分類:CODE (61)

瀏覽方式: 標題列表 簡短摘要
[angular js] Module ~ factory service provider

區分這三者的不同。
文章標籤

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



有了Firebase,打造應用程式好簡單 | WIRED.tw
http://wired.tw/2012/05/23/firebase/index.html


文章標籤

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


pc_liao@tw-pcliao1[~/code/git-tools/parse_index_file]{17:06}$ ruby parse_index_file.rb ../.git/index
parse_index_file.rb:10:in `require': no such file to load -- bindata (LoadError)
from parse_index_file.rb:10
pc_liao@tw-pcliao1[~/code/git-tools/parse_index_file]{17:06}$ gem install bindata
Fetching: bindata-1.4.5.gem (100%)
Successfully installed bindata-1.4.5
1 gem installed
Installing ri documentation for bindata-1.4.5...
Installing RDoc documentation for bindata-1.4.5...
文章標籤

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


import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;

 final Config config1 = injector.getInstance(ConfigFactory.class).createNew(cluster, "t1",
   new HashMap<String, String>() {{
   put("prop1", "val1");
       }});
   config1.setVersionTag("1");
   config1.persist();

cf.
guice源代码分析(一)injector.getInstance - 编程思索 | Thoughts of Coding
http://tocspblog.appspot.com/?p=54001


文章標籤

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

最近常常看這樣樣形式的 LinkedHashMap 用法
繼承 hashmap 以獲得 put method。
Methods inherited from class java.util.HashMap clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values

Map<String, Object> properties = new LinkedHashMap<String, Object>();

若要得到有序的hashtable便可以使用這個ADT,
另外可參照 treehashmap,hashmap


cf.
Difference between HashMap, LinkedHashMap and SortedMap in java - Stack Overflow
http://stackoverflow.com/questions/2889777/difference-between-hashmap-linkedhashmap-and-sortedmap-in-java
老紫竹JAVA提高教程(14)-认识Map之LinkedHashMap - 老紫竹的专栏 - 博客频道 - CSDN.NET

文章標籤

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


Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes.
For example, converting an int to an Integer, a double to a Double, and so on.
If the conversion goes the other way, this is called unboxing.

文章標籤

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


Type inference is a Java compiler's ability to look at each method invocation and corresponding declaration to determine the type argument (or arguments) that make the invocation applicable
文章標籤

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



Generic Types (The Java™ Tutorials > Learning the Java Language > Generics (Updated))
http://docs.oracle.com/javase/tutorial/java/generics/types.html


Type Parameter and Type Argument Terminology: Many developers use the terms "type parameter" and "type argument" interchangeably, but these terms are not the same. When coding, one provides type arguments in order to create a parameterized type. Therefore, the T in Foo is a type parameter and the String in Foo f is a type argument. This lesson observes this definition when using these terms.

文章標籤

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


關於 @Override Annotation 的說明


限定 Override 父類方法 - Override
http://caterpillar.onlyfun.net/Gossip/JavaGossip-V2/AnnotationOverride.htm


文章標籤

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

[js]jquery sort table by data attr 排序表格

javascript 區段加入

$(document).ready(function() {
$('.link-sort-table1').click(function(e) {
var $sort = this;
var $table = $('#sort-table1');
var $rows = $('tbody > tr',$table);

文章標籤

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

清楚了解 android.os 源碼中的Looper,Handler,Message,MessageQueue « Milochen's Blog for hacking
http://milochen.wordpress.com/2011/03/25/understanding-android-os-src-looperhandler-message-messagequeue/


文章標籤

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

在找javascript function callback的資訊的時候,
找到這個資料。
原來在javascript的function宣告,
這樣命名方式的解釋。
The EZPZ Way – How to build a personal mashup page with jQuery
http://theezpzway.com/2009/5/1/how-to-build-a-personal-mashup-page-with-jquery


var myPopup = {
message: "Hello!",
文章標籤

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

Clone your new repo

Set up Git on your machine if you haven't already done so.

$ mkdir /path/to/your/project
$ cd /path/to/your/project
$ git init
$ git remote add origin https://peicheng@bitbucket.org/peicheng/tt.git

Make changes and push
文章標籤

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

cpan

install WWW/Mechanize.pm
文章標籤

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

[shell script]check file exist use regex / process file

早上zz 在討論一個問題,
他想排除ls 出來的file list 的某些檔案,
使用的是regex。

jar_file="./ggyy-zz.jar"

if [ $jar_file == "~/ggyy-*.jar" ]; then
echo "ok"
文章標籤

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

[jquery]圖片輪播
中午接到電話有個圖片要改圖片輪播,
稍微查了一下
使用了 jQuery Cycle Plugin
JQuery Cycle Plugin - Beginner Demos
http://malsup.com/jquery/cycle/begin.html
The Will Will Web | 撰寫跑馬燈/廣告輪播的好工具:jQuery Cycle Plugin
http://blog.miniasp.com/post/2008/08/Writing-Marquee-and-Banner-Rotate-with-jQuery-Cycle-Plugin.aspx


文章標籤

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

[zenphoto]javascript 加上上一頁 下一頁快速鍵hotkey

之前在使用zenphoto這個相簿,
進入之後上下翻頁,
少了一點方便性。

加上了javascript hokey 下一頁快速鍵

           <script type="text/javascript">  
$().keyup(
文章標籤

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

怎样从10亿查询词找出出现频率最高的10个 | 董的博客 very nice artical
http://dongxicheng.org/big-data/select-ten-from-billions/

非常棒的思路,因為在現今多核的年代裡面,
處理top k就有不同的組合。


4. 总结

Top K问题是一个非常常见的问题,公司一般不会自己写个程序进行计算,而是提交到自己核心的数据处理平台上计算,该平台的计算效率可能不如直接写程序高,但它具有良好的扩展性和容错性,而这才是企业最看重的。

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

花了點時間做了blog per day log analysis
統計了每天每人從哪裡連結過來,
主要是利用
$_SERVER['HTTP_REFERER']

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


關鍵細節總在文件中
dotcloud的help寫的分常詳細


DotCloud Documentation
http://docs.dotcloud.com/guides/copy/

Generic SSH (scp, rsync...)

If you are used to scp or rsync, you can also setup a SSH configuration file to use direct SSH connection to your service. Here is how.

  1. Retrieve the SSH parameters (user, host, and port) of your service, using dotcloud info myapp.myservice.

  2. Append the following section to your ~/.ssh/config file (create this file if it does not exist), replacing HOST, PORT and USER with the values shown by dotcloud info:

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

1 234