锘??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-搴勫懆姊澏http://www.8634070.com/killme2008/鐢熸椿銆佺搴?#37510;佹湭鏉?/description>zh-cnTue, 26 Mar 2019 21:23:22 GMTTue, 26 Mar 2019 21:23:22 GMT60鍗氬鎼縼http://www.8634070.com/killme2008/archive/2012/12/10/392701.htmldennisdennisSun, 09 Dec 2012 17:24:00 GMThttp://www.8634070.com/killme2008/archive/2012/12/10/392701.htmlhttp://www.8634070.com/killme2008/comments/392701.htmlhttp://www.8634070.com/killme2008/archive/2012/12/10/392701.html#Feedback6http://www.8634070.com/killme2008/comments/commentRss/392701.htmlhttp://www.8634070.com/killme2008/services/trackbacks/392701.html寰堜箙娌湁鏇存柊鍗氬锛?#23052;?#37807;冲埌鏇存柊鏄?#37820;縼?#21461;鍛?#37510;?#26473;?#28051;?#37719;氬?#30126;璁殑璁块棶閲忕?#20346;?#23544;櫨涓?#38171;屾槸?#22428;寤虹珛?#27537;?#26882;鍊?#28729;?#37711;?#23052;湁鎯?#26473;囩殑浜?#37807;?#37510;?#37719;氬瀵规垜鏉?#29831;?#37831;?#28598;?#37828;?#29825;板綍銆?#29825;板繂鐨勫?#29256;柟锛屾垜?#26882;?#29238;鍥?#28051;?#37807;?#28051;?#29863;锋煇涓?#28051;?#29783;?#38171;?#37833;炕鑷繁鐨勫?#27692;锛屾煡?#22744;鏃煡锛屽彂鐜版柊?#29025;銆傞槄璇?#23536;?#28598;?#27996;虹?#21227;?#27692;锛?#28052;熸槸?#22428;?#31393;韪?#37510;佸涔犳柊?#29025;?#27537;涓昏?#20345;柟?#32033;銆傝櫧鐒?#23536;?#37719;氬叴璧?#38171;?#28051;?#26473;?#37719;氬浣?#28051;?#37831;寸郴缁熸殑璁板綍鐨勫?#29256;柟锛?#28051;嶄細杩囨椂銆?br />
闈炲父鎰熻阿blogjava鎻愪緵杩?#28052;堜?#27196;鐨勫?#20914;彴銆傚彧鏄垜浠婂?#23544;鑷繁?#27537;涓涓洰鏍?#37828;?#23524;虹珛鑷繁鐨勫?#27692;锛?#37733;犳鐜板湪瑕佹惉?#32316;锛屽姞涓?#37711;?#28729;?#37916;板湪涔熷啓鐨勫皯锛?#37711;?#28729;?#37820;縼涓?#37820;縼锛屾剰涔?#28052;?#28051;?#28598;?#27996;?#37510;傜畻鏄?#28051;涓?#38315;氬憡锛屾湁鍏磋叮鐨勫彲浠?#29825;槄?#22428;?#27537;?#26570;鍗氬锛?#23052;?#37711;磋叮?#27537;璇?#38007;?#29723;?#37923;?#26473;?#38171;岃阿?#38463;澶?#28729;?#37510;?br />
?#26570;鍗氬鍦板潃锛?a href="http://blog.fnil.net/">http://blog.fnil.net/
RSS鍦板潃锛?a href="http://blog.fnil.net/index.php/feed">http://blog.fnil.net/index.php/feed

?#26570;鍗氬?#27537;绗?#28051;绡?#29825;板繂鏄?#37510;?a href="http://blog.fnil.net/index.php/archives/14">Leiningen鏁欑涓?#37826;囩増銆?#38171;?#28000;?#37916;板湪?#32017;濮?#38171;?#26473;?#28051;?#37719;氬灏?#28051;嶅?#23941;彂甯?#28000;讳綍?#26570;?#27537;鏂囩珷锛屽?#21449;湁?#27537;涔?#28051;嶄?#27692;?#29371;櫎锛岄儴鍒?#37721;?#38003;?#28028;氬?#29006;埌?#22428;?#27537;?#29025;璇?#25652;?#28051;婂幓銆?br />
鏈鍚?#38171;?#32449;濈blogjava瓒婂姙瓒婂銆?br />

]]>
Another URL Shortener using NodeJShttp://www.8634070.com/killme2008/archive/2012/11/25/391936.htmldennisdennisSun, 25 Nov 2012 12:31:00 GMThttp://www.8634070.com/killme2008/archive/2012/11/25/391936.html
Is is written in 
NodeJS,using express.js for MVC framework,and using MySQL for storage and Redis for caching.

A demo online: http://fnil.me/

The project is at https://github.com/killme2008/node-shorten

Feel free to modify and use it.Have fun.

dennis 2012-11-25 20:31 ?#24386;琛?#29831;?#29825;?/a>
]]>
Clojure涓?#37826;?#28051;?#28051;氭妧鏈?#32448;?#37718;?/title><link>http://www.8634070.com/killme2008/archive/2012/09/25/388498.html</link><dc:creator>dennis</dc:creator><author>dennis</author><pubDate>Tue, 25 Sep 2012 04:51:00 GMT</pubDate><guid>http://www.8634070.com/killme2008/archive/2012/09/25/388498.html</guid><wfw:comment>http://www.8634070.com/killme2008/comments/388498.html</wfw:comment><comments>http://www.8634070.com/killme2008/archive/2012/09/25/388498.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.8634070.com/killme2008/comments/commentRss/388498.html</wfw:commentRss><trackback:ping>http://www.8634070.com/killme2008/services/trackbacks/388498.html</trackback:ping><description><![CDATA[寰堜箙娌啓鍗氬锛?#28051;鏄?#23480;?#28003;滃繖锛?#27996;屾槸娌湁澶?#28598;氱殑浜?#37807;?#37721;?#29831;?#37510;?br /><br />鏈杩?#37734;叕鍙?#28598;?#28003;殑?#25966;鎸?#28051;?#38171;?#23524;虹珛浜?#28051;涓狢lojure璇?#29815;涓?#37826;囨柟闈?#37928;勫?#27692;鍜岄棶?#29919;缃?#32468;?#38171;屾杩?#28000;讳綍瀵Clojure杩?#38338;?#37737;?#27996;嶫VM涔?#28051;?#37928;勫嚱鏁板紡璇?#29815;鎰?#37711;磋叮?#27537;绔瀷璐尞鍘熷垱鏂囩珷鎴栬?#29863;勬锛?#37922;?#29831;?#29999;?#37721;?#29831;风湅<a href="http://blog.clojure.cn/?page_id=8">杩?#38322;?/a>銆?br /><br />鍗氬鍦板潃锛? <a href="http://blog.clojure.cn/">http://blog.clojure.cn/</a><br />?#26870;?#29919;缃?#32468;?#38171;? <a href="http://ask.clojure.cn/" title="http://ask.clojure.cn/">http://ask.clojure.cn/</a><br /><br />娆?#26473;庤浆?#24386;鍜屾敞鍐?#28003;?#37922;?#38171;岃阿?#38463;銆?br /><br />閭?#28000;跺?#26948;浠?#37906;?#28003;?#37922;google group锛?a href="https://groups.google.com/group/cn-clojure/">https://groups.google.com/group/cn-clojure/</a><img src ="http://www.8634070.com/killme2008/aggbug/388498.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.8634070.com/killme2008/" target="_blank">dennis</a> 2012-09-25 12:51 <a href="http://www.8634070.com/killme2008/archive/2012/09/25/388498.html#Feedback" target="_blank" style="text-decoration:none;">?#24386;琛?#29831;?#29825;?/a></div>]]></description></item><item><title>Ring.velocity:render velocity templates for ring in clojurehttp://www.8634070.com/killme2008/archive/2012/07/18/383354.htmldennisdennisTue, 17 Jul 2012 16:07:00 GMThttp://www.8634070.com/killme2008/archive/2012/07/18/383354.htmlhttp://www.8634070.com/killme2008/comments/383354.htmlhttp://www.8634070.com/killme2008/archive/2012/07/18/383354.html#Feedback0http://www.8634070.com/killme2008/comments/commentRss/383354.htmlhttp://www.8634070.com/killme2008/services/trackbacks/383354.htmlHome: https://github.com/killme2008/ring.velocity

A Clojure library designed to render velocity template for ring in clojure.

Usage

Adds dependency in leiningen project.clj:

  [ring.velocity "0.1.0-SNAPSHOT"] 

Create a directory named templates in your project directory to keep all velocity templates.

Create a template templates/test.vm:

  hello,$name,your age is $age. 

Use ring.velocity in your namespace:

  (use '[ring.velocity.core :only [render]]) 

Use render function to render template with vars:

  (render "test.vm" :name "dennis" :age 29) 

The test.vm will be interpreted equals to:

  hello,dennis,your age is 29. 

Use ring.velocity in compojure:

  (defroutes app-routes      
(GET "/" [] (render "test.vm" :name "dennis" :age 29))
(route/not-found "Not Found"))

Use ring.velocity in ring:

  (use '[ring.util.response])   
(response (render "test.vm" :name "dennis" :age 29))

Custom velocity properties,just put a file named ring-velocity.properties to your classpath or resource paths.The default velocity properties is in src/default/velocity.properties.

License

Copyright © 2012 dennis zhuang[killme2008@gmail.com]

Distributed under the Eclipse Public License, the same as Clojure.

Home: https://github.com/killme2008/ring.velocity



dennis 2012-07-18 00:07 ?#24386;琛?#29831;?#29825;?/a>
]]>Clojure绗?#29825;?#38171;?#37922;?#28610;絫ype hinthttp://www.8634070.com/killme2008/archive/2012/07/10/382738.htmldennisdennisTue, 10 Jul 2012 12:37:00 GMThttp://www.8634070.com/killme2008/archive/2012/07/10/382738.htmlhttp://www.8634070.com/killme2008/comments/382738.htmlhttp://www.8634070.com/killme2008/archive/2012/07/10/382738.html#Feedback1http://www.8634070.com/killme2008/comments/commentRss/382738.htmlhttp://www.8634070.com/killme2008/services/trackbacks/382738.html     Clojure?#27537;涓澶?#28028;樼?#29808;氨鏄窡Java璇?#29815;鐨勫畬缇庨?#23941;悎锛孋lojure?#25328;Java涔?#38338;?#37721;?#28000;?#37929;?#27996;?#29835;?#37922;?#38171;孋lojure鍙?#28000;?#28598;?#37906;?#37734;?#28003;?#37922;Java骞冲彴涓婄殑涓板瘜璧勬簮銆傚湪Clojure閲岃皟鐢?#28051;涓被?#27537;?#26591;娉?#23536;?#32480;鍗?#38171;屽埄鐢dot鎿?#28003;?#32471;?#38171;?br />
user=> (.substring "hello" 3)
"lo"
user=> (.substring "hello" 0 3)
"hel"

    涓?#38344;殑?#32229;瀛?#37828;?#37734;clojure閲岃皟鐢String?#27537;substring?#26591;娉曞?#27692;瓧绗?#28051;?#37812;?#37721;?#37510;侰lojure?#27367;鐒?#37828;?#28051;闂?#23534;辩?#35826;瀷?#27537;璇?#29815;锛?#28003;?#37828;?#28729;冪殑Lisp Reader杩?#37828;?#38003;?#29831;?#37714;?#28598;?#28598;氭?#26495;父瑙佺殑绫诲瀷锛屾?#26047;杩?#38322;hello鏄?#28051;涓?#28699;?#32471;?#28051;?#28751;?#37721;?#28000;?#29831;?#37714;嚭鏉?3鏄?#28051;涓?#37825;存暟涔?#37721;?#28000;?#38171;岄?#26473;?#26473;?#27996;?#32491;诲?#23337;俊?#20229;鍙?#28000;壘?#22476;鏈鍖归?#23943;殑substring?#26591;娉?#38171;?#37734;?#37922;熸?#24876;?#26948;妭鐮佺殑?#26882;鍊欓伩鍏?#28003;?#37922;?#37721;嶅皠锛岃屾槸鐩存帴璋?#37922;substring?#26591;娉?#38171;圛NVOKEVIRTUAL鎸?#28000;?#38171;?#37510;?br />
    浣?#37828;?#35120;?#28003;?#37734;嚱鏁?#38322;岃皟鐢被?#26591;娉曠殑?#26882;鍊?#38171;屾儏鍐?#28751;?#37721;?#27996;?#38171;屼緥濡?#38171;?#28729;氫?#22651;ubstr?#22193;鏁?#38171;?br />
(defn substr [s begin end] (.substring s begin end))

    ?#22428;浠?#37813;撳紑*warn-on-reflection*閫夐锛屽綋?#28225;鍙嶅?#21229;殑?#26882;鍊?#37723;?#29824;?#38171;?br />
user=> (set! *warn-on-reflection* true)
true
user=> (defn substr [s begin end] (.substring s begin end))
Reflection warning, NO_SOURCE_PATH:22 - call to substring can't be resolved.
#'user/substr
   
    ?#26870;棰?#37713;虹幇浜?#38171;?#37922;?#27996;庡嚱鏁皊ubstr閲?#23052;湁浠讳綍鍏?#27996;?#37721;?#37825;皊?#27537;绫诲?#23337;俊?#20229;锛?#28051;?#27996;?#29835;?#37922;s?#27537;substring?#26591;娉?#38171;?#36423;?#26916;?#28003;?#37922;?#37721;嶅皠鏉?#29835;?#37922;?#38171;宑lojure缂?#29831;戝櫒涔熻鍛婃垜浠?#29835;?#37922;substring娌?#37716;炴硶瑙?#37835;?#38171;屽彧鑳?#38315;?#26473;?#37721;嶅?#21230;皟鐢?#37510;?#28028;?#37813;?#25030;?#29025;锛屽?#23941;?#21230;皟鐢?#37828;?#28051;?#37929;?#28725;?#37828;傝?#30005;殑鎿?#28003;?#38171;?#28725;规瘮浜?#37829;?#38315;氱殑?#26591;娉?#29835;?#37922;湁锛?#37510;?#26473;?#28051;鍒囬兘鏄?#37733;?#28051;篶lojure鏈韩鏄?#23534;辩?#35826;瀷?#27537;璇?#29815;锛屽?#29808;弬鏁?#37812;栬?#26473;?#37733;?#37706;?#28003;?#28051;嶉渶瑕佸鏄庣?#35826;瀷鑰?#37929;存帴浣?#37922;?Clojure?#32048;鑷?#37716;?#28598;勭?#21977;?#35826;瀷?#27537;?#27974;?#23858;鍜岃皟鐢?#37510;俻s.鍦?a href="https://github.com/technomancy/leiningen">leiningen
閲屽惎鐢?#37721;嶅?#21230;鍛?#23536;?#32480;鍗?#38171;?#37734;project.clj閲?#29825;?#32515;?#38171;?br />
;; Emit warnings on all reflection calls.
  :warn-on-reflection true
   
杩?#28598;?#37928;勫?#23941;?#21230;皟鐢?#28028;氬?#21342;搷鏁?#37916;?#38171;屾湁娌湁鍔炴硶?#20265;鍏?#26473;欑鎯?#37712;?#37723;?#38171;熸湁?#27537;锛孋lojure鎻愪緵浜唗ype hint鏈?#37714;?#38171;?#37711;?#29825;告垜浠?#29999;?#37716;?#32514;?#29831;戝櫒鏉?#37922;熸垚鏇?#26946;?#37825;?#37928;勫?#26948;妭鐮?#37510;?#37813;璋搕ype hint灏?#37828;?#32513;欏弬鏁?#37812;栬?#26473;?#37733;?#37706;兼?#35826;姞涓涓?#37819;?#32448;?#38171;hi,clojure缂?#29831;戝櫒锛?#26473;?#37828;xxx绫诲瀷锛屾垜鎯?#29835;?#37922;?#28729;冪殑yyy?#26591;娉?#38171;?#29831;?#37922;熸垚鏈楂?#37825;堢殑璋?#37922;?#28000;?#37934;?#38171;岃阿?#38463;鍚堜綔锛?br />
user=> (defn substr [^String s begin end] (.substring s begin end))
#'user/substr
     
    杩?#23046;?#23052;湁璀?#37723;?#38171;宆String灏?#37828;?#37721;?#37825;皊?#27537;type hint锛屾彁绀篶lojure缂?#29831;戝櫒璇s?#27537;绫诲瀷鏄?#28699;?#32471;?#28051;?#38171;岄偅涔坈lojure缂?#29831;戝櫒浼氫?#24014;ava.lang.String?#34987;閲屾煡?#22744;鍚嶇涓簊ubstring骞?#28051;旀帴?#25977;涓?#28051;?#37721;?#37825;扮殑?#26591;娉?/strong>锛屽?#36346;埄鐢invokevirtual鎸?#28000;?#37929;存帴璋?#37922;?#23005;柟娉?#38171;岄伩鍏?#27996;?#37721;嶅?#21230;皟鐢?#37510;傞櫎浜唗arget瀵硅薄锛?#26473;?#38322;岀殑s)鍙?#28000;?#23075;诲姞type hint锛屾柟娉?#37721;?#37825;板拰杩?#37733;?#37706;?#28052;?#37721;?#28000;?#23075;诲姞type hint锛?br />
user=> (defn ^{:tag String} substr [^String s ^Integer begin ^Integer end] (.substring s begin end))
#'user/substr
    
    杩?#37733;?#37706;兼?#35826;姞type hint鏄?#37714;?#37922;tag鍏?#37825;版嵁锛屾彁绀簊ubstr?#27537;杩?#37733;?#32491;诲瀷鏄String锛?#37711;?#28000;栧嚱鏁板湪浣?#37922;substr?#27537;?#26882;鍊欏彲浠?#37714;?#37922;?#26473;?#28051;?#32491;诲?#23337;俊?#20229;鏉伩鍏?#37721;嶅皠锛?#38000;屽弬鏁扮殑type hint?#31393;target object?#27537;type hint涓鏍?#28000;^?#32017;澶?#37716;?#28051;婄?#35826;瀷锛屼緥濡?#26473;?#38322;begin?#25328;end?#20824;鎻?#32448;?#29831;存槸Integer绫诲瀷銆?br />
    ?#26870;棰?锛?#28000;涔堟椂鍊?#25652;?#29831;?#28051;?#37721;?#37825;版?#35826;姞type hint鍛?#38171;熸垜?#27537;瑙傜偣鏄?#38171;?#37734;?#28000;讳綍涓target object娣诲姞type hint鐨勫?#29256;柟锛岄兘搴?#29831;?#37929;?#25652;?#37734;?#28051;?#37721;?#37825;版?#35826;姞type hint锛岄櫎闈?#28003;?#27996;?#37711;堜笉?#29025;閬?#37721;?#37825;扮殑绫诲瀷銆?/strong>涓?#28000;涔?#37723;?#38171;?#37733;?#28051;篶lojure鏌壘?#34987;?#26591;娉曠殑椤?#25652;?#37828;?#26473;?#37837;?#38171;?br />
1.浠嶴tring?#34987;閲屾煡?#22744;?#22189;鎵?#28225;鍙?#37825;?#28051;?#37825;?#28051;?骞?#28051;?#37722;嶇涓簊ubstring?#26591;娉?br /> 2.閬嶅?#21977;涓姝?#38322;屾煡?#22744;?#22189;鏉殑Method锛屽鏋?#28003;犳湁璁?#32515;?#37721;?#37825;扮殑type hint,鍒?
鏌壘鏈鍖归厤鍙?#37825;?#32491;诲瀷?#27537;Method锛?#37722;?#37714;?#38171;屽鏋?#32471;?#28051;姝?#37836;壘?#22189;鏉殑Method灏?#28051;涓?#38171;?#37929;存帴浣?#37922;?#26473;?#28051;Method锛?#37929;?#37721;嶅氨璁?#28051;?#23052;湁?#22744;?#22476;瀵?#25652;旂殑Method銆?br /> 3.濡?#37835;?#32471;?#27996;屾娌湁?#22744;?#22476;Method锛?#28003;?#37922;?#37721;嶅?#21230;皟鐢?#38171;?#37722;?#37714;?#37837;规嵁璇Method鍏冧俊?#20229;鐢熸垚璋?#37922;?#28699;楄妭鐮?#37510;?br />
   鍥犳锛屽鏋渟ubstring?#26591;娉曠殑涓?#28051;?#37721;?#37825;?#37911;?#37832;?#37714;氬灏?#28051;涓?#38171;屾柟娉?#37721;?#37825;版湁娌湁type hint?#20824;娌湁鍏崇郴锛堟湁浜?#38335;?#29831;殑type hint鍙嶈屼績浣?#37721;嶅皠鐨勫彂鐢?#38171;?#38171;屾垜浠兘浼氭壘?#22476;杩?#28051;敮涓?#27537;?#26591;娉?#38171;?#28003;?#37828;?#28641;?#37835;洰鏍囨柟娉曠殑?#28225;澶?#28051;?#38322;嶈?#33445;柟娉曞苟涓?#37721;?#37825;?#37929;?#37722;?#38171;岃屽彧鏄?#37721;?#37825;?#32491;诲瀷涓嶅悓锛Java閲屾槸鍏?#29825;告柟娉?#37928;勫弬鏁?#32491;诲瀷閲嶈?#30028;殑锛孋lojure鍙?#37711;?#29825;稿嚱鏁?#37928;勫弬鏁?#28051;?#37825;?#38322;嶈浇锛?#38171;岄偅涔堝鏋?#23052;湁?#26591;娉?#37721;?#37825;扮殑type hint锛孋lojure缂?#29831;戝櫒浠?#37906;?#37827;犳?#26335;壘?#22476;鍚?#38315;傜殑璋?#37922;柟娉?#38171;岃屽彧鑳?#38315;?#26473;?#37721;嶅皠銆?br />    
   ?#28229;涓涓緥瀛?瀹氫箟get-bytes?#26591;娉?#29835;?#37922;String.getBytes锛?br />
user=> (defn get-bytes [s charset] (.getBytes s charset))
Reflection warning, NO_SOURCE_PATH:26 - call to getBytes can't be resolved.
#'user/get-bytes
user=> (defn get-bytes [^String s charset] (.getBytes s charset))
Reflection warning, NO_SOURCE_PATH:27 - call to getBytes can't be resolved.
#'user/get-bytes

    绗?#28051;娆?#28729;氫箟锛宻?#25328;charset?#20824;娌湁璁?#32515;畉ype hint锛屾湁鍙嶅?#21230;鍛?#38171;?#32471;?#27996;屾锛宻璁?#32515;?#27996;唗ype hint锛?#28003;?#37828;?#26473;?#37828;湁鍙嶅?#21230;鍛?#37510;傚師鍥?#28751;?#37734;?#27996;嶴tring.getBytes?#28225;涓?#28051;?#38322;嶈?#33445;柟娉?#38171;屽弬鏁?#28051;?#37825;伴兘鏄?#28051;涓?#38171;?#28003;?#37828;帴?#25977;涓嶅悓鐨勫弬鏁?#32491;诲瀷锛?#28051;涓?#37828;String?#27537;charset鍚嶇锛?#28051;涓狢harset瀵硅薄銆傚鏋滄垜浠?#37828;庣鍦扮煡閬?#26473;?#38322;宑harset鏄?#28699;?#32471;?#28051;?#38171;岄偅涔?#26473;?#37721;?#28000;?#28051;篶harset娣诲姞type hint:
user=> (defn get-bytes [^String s ^String charset] (.getBytes s charset))
#'user/get-bytes
   
    杩?#23046;?#37813;嶇?#29112;?#27537;娌湁璀?#37723;?#27996;?#37510;傛?#32513;?#38171;氬湪璁?#32515;畉ype hint?#27537;?#26882;鍊?#38171;?#28051;嶈?#20344;彧鑰?#38095;戣璋?#37922;殑target object锛?#28052;熻?#20349;?#38095;戣皟鐢殑?#26591;娉?#37721;?#37825;?#37510;?br />
    ?#26870;棰?锛氫粈涔堟椂鍊?#25652;?#29831;?#23075;诲姞tag鍏?#37825;版嵁鍛?#38171;?#37918;?#29825;?#28051;?#38171;?#37734;?#28000;讳綍浣?#37828;庣?#29025;閬?#26473;?#37733;?#32491;诲瀷鐨勫?#29256;柟?#20824;搴?#29831;?#23075;诲姞tag锛?#28003;?#37828;?#26473;?#28051;?#37828;?#37825;?#37833;?#38171;屽鏋?#28051;涓?#37707;跺?#26055;璋?#37922;殑?#26591;娉?#37828;?#37827;犻渶杩?#37837;?#37707;氱殑銆?#26473;?#28051;鐐瑰彧瀵瑰啓搴撶殑绔瀷瑕佺?#29808;埆?#25950;鎰?#37510;?br />
    Type hint鐨勫師鐞?#37734;?#28051;?#37826;?#23480;?#32513;?#28598;?#22994;?#37819;?#26473;?#27996;?#28051;?#38171;?#37711;?#28003;撳埌clojure?#31790;鐮佺骇鍒?#38171;?#29831;?#37721;傝僣lojure.lang.Compiler.InstanceMethodExpr?#34987;?#27537;鏋?#38315;犲嚱鏁板拰emit?#26591;娉?#37510;?#37832;鍚?#38171;岄閫佹槸鍚?#28003;?#37922;type hint鐢熸垚substr?#22193;鏁?#37928;勫?#26948;妭鐮?#28052;?#38338;寸?#21227;樊寮傚?#35268;瘮锛?br />
?#28269;浣?#37922;type hint 浣?#37922;type hint

  // access flags 1

  public invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

   L0

    LINENUMBER 14 L0

   L1

    LINENUMBER 14 L1

    ALOAD 1

    ACONST_NULL

    ASTORE 1

    LDC "substring"

    ICONST_2

    ANEWARRAY java/lang/Object

    DUP

    ICONST_0

    ALOAD 2

    ACONST_NULL

    ASTORE 2

    AASTORE

    DUP

    ICONST_1

    ALOAD 3

    ACONST_NULL

    ASTORE 3

    AASTORE

    INVOKESTATIC clojure/lang/Reflector.invokeInstanceMethod (Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;

   L2

    LOCALVARIABLE this Ljava/lang/Object; L0 L2 0

    LOCALVARIABLE s Ljava/lang/Object; L0 L2 1

    LOCALVARIABLE begin Ljava/lang/Object; L0 L2 2

    LOCALVARIABLE end Ljava/lang/Object; L0 L2 3

    ARETURN

    MAXSTACK = 0

    MAXLOCALS = 0

public invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

   L0

    LINENUMBER 15 L0

   L1

    LINENUMBER 15 L1

    ALOAD 1

    ACONST_NULL

    ASTORE 1

    CHECKCAST java/lang/String

    ALOAD 2

    ACONST_NULL

    ASTORE 2

    CHECKCAST java/lang/Number

    INVOKESTATIC clojure/lang/RT.intCast (Ljava/lang/Object;)I

    ALOAD 3

    ACONST_NULL

    ASTORE 3

    CHECKCAST java/lang/Number

    INVOKESTATIC clojure/lang/RT.intCast (Ljava/lang/Object;)I

    INVOKEVIRTUAL java/lang/String.substring (II)Ljava/lang/String;

   L2

    LOCALVARIABLE this Ljava/lang/Object; L0 L2 0

    LOCALVARIABLE s Ljava/lang/Object; L0 L2 1

    LOCALVARIABLE begin Ljava/lang/Object; L0 L2 2

    LOCALVARIABLE end Ljava/lang/Object; L0 L2 3

    ARETURN

    MAXSTACK = 0

    MAXLOCALS = 0


    
    瀵规瘮寰?#37828;?#37828;?#38171;?#23052;湁浣?#37922;type hint锛岃皟鐢clojure.lang.Reflector?#27537;invokeInstanceMethod?#26591;娉?#38171;?#28003;?#37922;?#37721;嶅?#21230;皟鐢?#38171;?#37711;?#28003;?#29785;乧lojure.lang.Reflector.java)锛岃?#28003;?#37922;?#27996;唗ype hint涔?#37722;?#38171;屽?#27409;?#23384;帴浣?#37922;invokevirtual鎸?#28000;?#38171;?#37711;?#28000;栨柟娉?#37721;?#38003;?#37828;痠nvokestatic鎴栬卛nvokeinterface绛夋寚浠?#38171;?#29835;?#37922;?#29831;柟娉?#38171;岄伩鍏?#27996;?#37721;嶅皠銆?br />       

    鍙傝?#38171;?br />

dennis 2012-07-10 20:37 ?#24386;琛?#29831;?#29825;?/a>
]]>Clojure涓?#37923;?#38171;氬埄鐢HouseMD璇?#37826;clojurehttp://www.8634070.com/killme2008/archive/2012/06/15/380822.htmldennisdennisThu, 14 Jun 2012 18:52:00 GMThttp://www.8634070.com/killme2008/archive/2012/06/15/380822.htmlhttp://www.8634070.com/killme2008/comments/380822.htmlhttp://www.8634070.com/killme2008/archive/2012/06/15/380822.html#Feedback2http://www.8634070.com/killme2008/comments/commentRss/380822.htmlhttp://www.8634070.com/killme2008/services/trackbacks/380822.html     HouseMD鏄?#23075;?#28729;濈殑鑱?#37933;冲啓?#27537;涓涓?#38344;炲父浼樼?#27537;Java杩涚杩愯?#23678;椂璇?#37826;?#37724;岃皟璇?#23480;?#37711;?#38171;屽鏋?#28003;犳帴瑙?#26473;嘼trace锛岄偅涔圚ouseMD涔?#29825;?#28003;?#25652;?#29831;?#28751;?#29831;?#28051;?#38171;?#28729;?#23011;攂trace鏇存槗鐢?#38171;?#28051;嶉渶瑕佸?#27410;鏈?#38171;岀被浼約trace?#27537;?#26591;?#32033;attach?#22476;jvm杩涚鍋氳窡韪?#29835;?#29831;?#37510;?br />
    鍩?#37832;?#37928;勫?#22798;?#21613;拰浣?#37922;?#29831;风湅杩?#32481;?#37826;囨銆?a href="https://github.com/zhongl/HouseMD/wiki/UserGuideCN">UserGuide銆?#38171;屾仌涓?#38322;?#28598;?#37510;?#28000;?#28051;?#37712;?#28729;归兘鍋?#29825;?#28003;犳纭?#28729;夎浜housemd銆?br />
    鏈?#37826;?#28051;昏浠?#32513;?#28051;嬫?#28052;?#37922;housemd璇?#37826;窡韪猚lojure杩涚銆侰lojure?#27537;java瀹?#37916;?#28052;熸槸璺?#37734;JVM閲?#38171;屽綋鐒?#28052;?#37721;?#28000;?#37922;housemd銆?br />
    ?#22428;浠?#28000;?#28051;涓?#32480;鍗曠殑?#32229;瀛愬紑濮?#38171;屽亣璁炬垜浠湁濡?#28051;媍lojure浠?#37934;?#38171;?br />
(loop [x 1]
  (Thread/sleep 1000)
  (prn x)
  (recur (inc x)))

    杩欐寰?#32480;鍗?#38171;屽彧鏄?#38338;撮殧涓绉?#28051;?#37826;?#37734;版墦鍗伴掑?#28853;殑鏁板瓧x銆傛垜浠?#37713;?#28598;?#37922;housemd?#31393;韪?#26473;?#28051;?#32459;?#25652;忕殑杩愯锛岄鍏?#26473;愯杩?#28051;?#32459;?#25652;?#38171;?#28003;?#37721;?#28000;?#37922;lein锛?#28052;?#37721;?#28000;?#37929;存帴java鍛?#28000;?#26473;愯锛?br />
java -cp clojure.jar clojure.main test.clj

    杩愯?#23678;椂涓?#37826;?#37734;板湪鎺?#37714;跺?#29256;墦鍗版?#26495;瓧锛岄?#26473;jps鎴栬卲s鏌?#29831;埌璇?#26473;涚?#23340;殑id锛屽亣璁?#28051;pid锛?#28003;?#37922;housemd杩炴帴?#22476;璇?#26473;涚锛?br />
housemd <pid>
    椤?#37714;?#26473;?#37711;housemd?#27537;浜?#27996;?#37818;?#37714;跺彴锛岄?#26473;help鍛?#28000;?#37721;?#28000;?#37836;?#29831;敮鎸佺?#21227;懡浠?#38171;?br />
housemd> help

quit      terminate the process.
help      display this infomation.
trace     display or output infomation of method invocaton.
loaded    display loaded classes information.

    瑕?#37922;housemd璋?#29831;clojure锛?#28003;犻渶瑕佸clojure鐨勫疄鐜版湁涓鐐?#37904;?#27996;?#29785;?#38171;屾湁鍏磋叮鍙?#28000;湅杩?#37720;荤殑涓绡嘼log銆?a href="http://www.8634070.com/killme2008/archive/2010/07/11/325775.html">clojure hacking guide銆?#38171;?#32480;鍗?#37833;?#29831;?#38171;宑lojure?#27537;缂?#29831;戝櫒浼氬皢clojure浠?#37934;佺紪璇?#37812;恓ava绫诲苟杩愯銆傚浜嶫VM鏉?#29831;?#38171;宑lojure鐢熸垚?#27537;?#34987;锛岃窡java缂?#29831;戝櫒鐢熸垚?#34987;娌湁浠涔堜笉鍚?#37510;?br />     鍏?#28003;撳埌涓?#38344;殑clojure浠?#37934;?#38171;屼細鐢熸垚涓涓?#37722;?#28051;?strong>user$eval1
?#27537;?#34987;锛寀ser鏄粯璁殑namespace锛岃宔val1鏄痗lojure缂?#29831;戝櫒鑷?#37716;?#37922;熸垚?#27537;涓涓?#37837;囩?#34425;?#35826;悕锛岄?#26473;?strong>loaded
鍛?#28000;?#37836;?#29831;被鐨勫姞杞?#37807;?#37712;?#38171;?br />
housemd> loaded user$eval1 -h
user$eval1 -> null
    - clojure.lang.DynamicClassLoader@1d25d06e
        - clojure.lang.DynamicClassLoader@1d96f4b5
            - sun.misc.Launcher$AppClassLoader@a6eb38a
                - sun.misc.Launcher$ExtClassLoader@69cd2e5f

    閫?#26473;?h閫夐?#35268;墦鍗?#27996;?#37716;?#26462;絬ser$eval1?#27537;绫诲姞杞?#37731;?#37928;勫眰娆?#37711;崇郴锛?#37733;?#28051;簎ser$eval1鏄?#37716;?#37804;?#37922;熸垚?#27537;锛坈lojure鍚?#37716;?#26473;囩涓?#38171;?#38171;?#37733;犳瀹?#28051;?#37734;?#28000;讳綍涓涓猚lass鎴栬卝ar鏂?#28000;?#28051;?#37510;傞櫎浜?#37836;?#29831;user namespace?#27537;?#34987;涔?#28598;?#38171;?#28003;?#26473;?#37721;?#28000;?#37836;?#29831;clojure.core,clojure.lang,clojure.java绛?#28000;讳綍琚?#37716;?#26462;?#26473;?#37833;殑?#34987;锛屼緥濡?#37836;?#29831;clojure.core.prn?#27537;?#34987;,鍦clojure閲?#26473;?#37828;?#28051;涓嚱鏁?#38171;?#37734;jvm?#28229;鏉?#26473;欏彧鏄?#28051;涓被锛?br />
housemd> loaded -h core$prn
clojure.core$prn -> /Volumes/HDD/Users/apple/clojure/clojure.jar
    - sun.misc.Launcher$AppClassLoader@a6eb38a
        - sun.misc.Launcher$ExtClassLoader@69cd2e5f
   ?#25950;鎰?#38171;?#28051;嶉渶瑕佸?#23678;?#23544;殑namespace——clojure.core锛?#37929;存帴core$prn鍗冲彲銆?#37711;?#28000;?#28052;熸槸?#34987;浼?#37510;?strong>灏?#37814;宸?#38171;氬鏋?#28003;?#28729;?#37734;?#28051;嶇煡閬clojure缂?#29831;戝櫒鐢熸垚?#27537;绫诲悕锛?#28003;?#37721;?#28000;?#37714;?#37922;jvm鑷?#29999;殑jmap鍛?#28000;?#37833;?#37836;?#29831;?#37510;?/strong>

   ?#24116;涓?#37833;?#38171;屾垜浠?#28751;?#29831;?#37922;trace鍛?#28000;窡韪柟娉曠殑杩愯锛屼緥濡備緥瀛?#28051;殑clojure浠?#37934;?#37922;埌浜唋oop?#25328;recur涓?#28051;sepcial form锛屾垜浠窡韪?#28051;loop:
housemd> trace -t 5 core$loop
INFO : probe class clojure.core$loop
core$loop.doInvoke(Object, Object, Object, Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null
core$loop.getRequiredArity()                          sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null

core$loop.doInvoke(Object, Object, Object, Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null
core$loop.getRequiredArity()                          sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null

core$loop.doInvoke(Object, Object, Object, Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null
core$loop.getRequiredArity()                          sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null

core$loop.doInvoke(Object, Object, Object, Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null
core$loop.getRequiredArity()                          sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null

core$loop.doInvoke(Object, Object, Object, Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null
core$loop.getRequiredArity()                          sun.misc.Launcher$AppClassLoader@a6eb38a            0            -ms    null

INFO : Ended by timeout
INFO : reset class clojure.core$loop

    鍦?绉?#37712;?#38171;宑lojure.core$loop?#34987;?#28225;涓?#28051;柟娉?#37722;勮璋?#37922;?#27996;?娆?#38171;doInvoke鏄?#28729;?#38340;呯殑璋?#37922;?#38171;岃実etRequiredArity鐢?#37833;?#37836;?#29831;loop鎵?#28214;瑕佺?#21227;弬鏁?#28051;?#37825;?#37510;倀race杩?#37721;?#28000;窡韪埌鍏?#28003;撶殑?#26591;娉?#38171;屼緥濡傛垜浠窡韪prn?#22193;鏁扮殑璋?#37922;?#37807;?#37712;?#38171;?br />
housemd> trace -t 5 core$prn.doInvoke
INFO : probe class clojure.core$prn
core$prn.doInvoke(Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            1            1ms    clojure.core$prn@3e4ac866

core$prn.doInvoke(Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            2           <1ms    clojure.core$prn@3e4ac866

core$prn.doInvoke(Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            3           <1ms    clojure.core$prn@3e4ac866

core$prn.doInvoke(Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            4           <1ms    clojure.core$prn@3e4ac866

core$prn.doInvoke(Object)    sun.misc.Launcher$AppClassLoader@a6eb38a            5           <1ms    clojure.core$prn@3e4ac866

INFO : Ended by timeout
INFO : reset class clojure.core$prn
  
   trace鎵?#37719;?#27996;嗘柟娉曠殑璋?#37922;?#23046;?#37825;?#38171;?绉?#37712;?#38171;夊?#23678;娆?#29835;?#37922;殑?#26882;闂?#38171;?#23011;?#32457;?#32510;?#37714;?#38171;?#38171;?#28000;?#37721;?#29835;?#37922;殑target object銆傚皬鎶宸?#38171;?#23052;湁鍙?#37721;?#37721;?#37825;?#37928;勫嚱鏁?#37922;熸垚?#34987;鏈缁?#29835;?#37922;殑鏄痠nvoke?#26591;娉?#38171;?#37721;?#37825;?#28051;?#37825;板彲鑳?#38322;嶈浇锛?#38171;屾湁鍙?#37721;?#37721;?#37825;?#37928;勫嚱鏁?#29835;?#37922;殑鏄痙oInvoke?#26591;娉?#37510;?br />
   trace鍛?#28000;?#26473;樻敮鎸佹墦鍗?#29835;?#37922;爢鏍堝埌鏂?#28000;?#38171;屼緥濡?#38171;?br />
trace -t 5 -d -s  core$prn.doInvoke

   鍒?#37922;?s?#25328;-d鍛?#28000;?#28028;氬皢璇?#32513;嗙殑璋?#37922;?#28103;伅杈撳嚭?#22476;涓存椂?#27952;?#32141;锛?#28051;存椂?#27952;?#32141;?#27537;璺?#23536;勫彲浠?#38315;?#26473;trace help鍛?#28000;?#37836;?#29831;埌锛?#37734;垜?#27537;鏈?#37731;?#28051;?#37828;?tmp/trace/<pid>@host?#27952;?#32141;涓?#37510;傝皟鐢爢鏍堢殑?#32237;鍑虹被浼?#38171;?br />
example$square.invoke(Long) call by thread [main]
    example$eval9.invoke(test.clj:11)
    clojure.lang.Compiler.eval(Compiler.java:6465)
    clojure.lang.Compiler.load(Compiler.java:6902)
    clojure.lang.Compiler.loadFile(Compiler.java:6863)
    clojure.main$load_script.invoke(main.clj:282)
    clojure.main$script_opt.invoke(main.clj:342)
    clojure.main$main.doInvoke(main.clj:426)
    clojure.lang.RestFn.invoke(RestFn.java:421)
    clojure.lang.Var.invoke(Var.java:405)
    clojure.lang.AFn.applyToHelper(AFn.java:163)
    clojure.lang.Var.applyTo(Var.java:518)
    clojure.main.main(main.java:37)

   涓?#38344;?#26473;?#28051;?#32480;鍗曠殑?#32229;瀛愬?#26336;浜?#28003;?#37922;housemd?#31393;韪?#29831;?#37826;clojure杩涚?#23340;殑?#26591;娉?#37510;?br />
   鑷?#28729;氫箟ns鍜屽嚱鏁扮殑璋?#29831;?#28051;?#23005;被浼?#38171;屽亣璁炬垜浠湁涓?#38344;殑clojure浠?#37934;?#38171;?br />
(ns example)
(defn square [x]
  (* x x))

(loop [x 1]
  (Thread/sleep 1000)
  (square x)
  (recur (inc x)))
 
   ns涓篹xample锛?#38007;?#28729;氫?#22794;嚱鏁皊quare骞?#28729;?#37832;?#23536;?#37916;?#29835;?#37922;?#37510;?#28003;?#37922;housemd璇?#37826;?#26473;欐浠?#37934;?#38171;?br />
loaded -h example$square     #鏌?#29831;square鐨勫姞杞?#37807;?#37712;?br />trace -t 10 -d -s example$square.invoke  #?#31393;韪?0绉?#37712;square?#27537;璋?#37922;?#37807;?#37712;?/div>

dennis 2012-06-15 02:52 ?#24386;琛?#29831;?#29825;?/a>
]]>鍒?#29999;冨紡娑堟伅涓?#38338;?#28000;Metaq?#24386;甯?.4.3http://www.8634070.com/killme2008/archive/2012/06/04/379895.htmldennisdennisMon, 04 Jun 2012 02:03:00 GMThttp://www.8634070.com/killme2008/archive/2012/06/04/379895.htmlhttp://www.8634070.com/killme2008/comments/379895.htmlhttp://www.8634070.com/killme2008/archive/2012/06/04/379895.html#Feedback1http://www.8634070.com/killme2008/comments/commentRss/379895.htmlhttp://www.8634070.com/killme2008/services/trackbacks/379895.html?#22428;浠?#37734;?#32513;存?#27537;娣?#28729;濆紑?#31790;娑堟伅涓?#38338;?#28000;剁殑metaq?#27537;github鍒嗘敮锛?#28000;?#28598;彂甯?#27996;?.4.2鐗?#37832;?#38171;?#28051;昏?#20344;仛浜嗗涓嬫敼杩?#38171;?br />
1.?#25966;鎸佸彂閫佸拰璁槄鍒嗙锛屽彲浠?#32513;嗙搴?#37734;版帶鍒禕roker鎴栬呮煇涓猅opic鏄?#37722;帴?#25977;娑堟伅鍜屾帴鍙?#29825;槄銆?#37832;?#37716;?#32468;?#23075;诲?#29363;柊閫夐acceptPublish?#25328;acceptSubscribe銆?br />
2.鏇?#37721;?#28610;?#37734;?#37711;?#38338;Broker锛?#22986;?#37918;?#37711;?#38338;?#23092;佺骞?#38315;?#26473;JMX璋?#37922;柟娉?#37711;?#38338;?#37831;?#28000;?#37720;熸潵绠鍗曠殑kill銆?br />
3.鏇存柊python瀹?#37812;?#32468;?/a>?#22476;0.2鐗?#37832;?#38171;屽彲浠?#38315;?#26473;pip瀹夎:  pip install metaq

4.?#24386;甯ruby璇?#29815;瀹?#37812;?#32468;?a href="https://github.com/killme2008/Metamorphosis/tree/master/contrib/ruby/meta-ruby" style="color: #006699; ">meta-ruby
 0.1鐗?#37832;?#37510;?br />
5.鍏?#28000;?#28751;?#37824;?#26473;?#38171;?#37719;囩骇gecko?#22476;1.1.1鐗?#37832;?#38171;?#37719;囩骇quartz?#22476;2.1.4鐗?#37832;?#38171;屾?#35826;?#29371;泦鎴愭祴璇?#23480;?#32459;?#37724;屽唴?#20788;閲?#37835;勭瓑銆?br />
6.?#26570;鏂囨銆?#28003;?#37922;log4j鎵?#28766;曞彂閫佹?#22559;伅銆?/a>

绠浠?#38171;?a href="https://github.com/killme2008/Metamorphosis/wiki/%E4%BB%8B%E7%BB%8D" style="color: #006699; ">https://github.com/killme2008/Metamorphosis/wiki/浠?#32513;?/a>
涓?#26462;?#38171;?a href="https://github.com/killme2008/Metamorphosis/downloads" style="color: #006699; ">https://github.com/killme2008/Metamorphosis/downloads

鏂囨锛?a href="https://github.com/killme2008/Metamorphosis/wiki" style="color: #006699; ">https://github.com/killme2008/Metamorphosis/wiki



dennis 2012-06-04 10:03 ?#24386;琛?#29831;?#29825;?/a>
]]>濡備綍鐔熸倝涓涓紑?#31790;椤圭洰锛?/title><link>http://www.8634070.com/killme2008/archive/2012/05/22/378885.html</link><dc:creator>dennis</dc:creator><author>dennis</author><pubDate>Tue, 22 May 2012 15:12:00 GMT</pubDate><guid>http://www.8634070.com/killme2008/archive/2012/05/22/378885.html</guid><wfw:comment>http://www.8634070.com/killme2008/comments/378885.html</wfw:comment><comments>http://www.8634070.com/killme2008/archive/2012/05/22/378885.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.8634070.com/killme2008/comments/commentRss/378885.html</wfw:commentRss><trackback:ping>http://www.8634070.com/killme2008/services/trackbacks/378885.html</trackback:ping><description><![CDATA[<br />    浣犳湁涓?#28000;诲姟锛岄渶瑕?#37922;埌?#28999;涓紑?#31790;椤圭洰;鎴栬呰佸浜?#28000;?#28003;?#28051;涓?#27996;?#37807;?#38171;?#29825;?#28003;?#37720;?#27996;?#29785;煇涓?#28051;?#29783;?#37510;傛?#28052;堜?#23339;墜鍛?#38171;熷?#20633;綍?#32017;濮?#37723;?#38171;熸垜?#27537;涔?#37807;?#37828;?#26473;?#37837;?#38171;?br /><br />1.棣?#37711;?#38171;屾煡?#22744;鍜岄槄璇?#29831;?#26916;圭洰鐨勫?#27692;?#25328;璧勬锛岄?#26473;google浣?#38003;芥壘?#22476;?#28999;涓?#26916;圭洰澶?#28003;?#28000;?#32513;?#37928;勫?#27692;锛?#36423;?#38315;熼槄璇?#28051;涓?#28751;?#38003;?#28725;归?#22317;洰?#27537;?#27952;?#27537;銆佸?#29115;兘銆佸熀鏈?#28003;?#37922;湁涓?#28598;?#22994;傜殑浜?#29785;?#37510;?br /><br />2.?#27076;璇?#26916;圭洰?#27537;鏂囨锛?#38322;嶇偣鍏虫敞?#34987;浼?strong>Getting started銆丒xample</strong>涔嬬被?#27537;鏂囨锛?#28000;?#28051;?#28699;?#28052;?#28641;備綍涓?#26462;?#37510;佸?#22798;銆?#37922;?#38007;冲熀鏈?#28003;?#37922;?#29831;?#26916;圭洰鎵?#28214;瑕佺殑?#29025;璇?#37510;?br /><br />3.濡?#37835;?#29831;?#26916;圭洰?#28225;鎻愪緵鐜?#37812;愮殑example宸?#32459;?#38171;岄鍏?#28751;?#29831;曟?#22796;?#32017;濮嬫?#22248;?#27537;浠?#32513;?#26473;愯?#23444;xample锛屽鏋?#26473;愯?#23684;鍒?#38171;岄偅涔?#37805;枩浣犻鍒紑浜?#28051;?#28610;?#28598;?濡?#37835;?#38316;囧埌?#26870;棰?#38171;岄鍏?#28751;?#29831;?#37734;?#26916;圭洰?#27537;<strong>FAQ</strong>绛夋?#22248;閲屾煡?#22744;?#29919;妗?#38171;屽啀娆?#38171;屽彲浠?#28751;嗛棶棰?#38171;堜緥濡傚?#20634;父淇伅锛夊綋鎴?#37711;?#38335;?#29831;嶅幓鎼?#32497;?#38171;屾煡?#22744;鐩?#37711;崇殑瑙?#37712;冲?#28852;硶锛?#28003;犻?#22247;埌浜?#38171;屽埆浜?#28051;鑸?#28052;熶細閬囧埌锛岀蹇冪殑鏈?#37721;嬩細璁板綍涓嬭鍐崇殑杩囩;鏈鍚?#38171;屽彲浠?#28751;嗛棶棰?#37819;?#27996;埌椤圭洰?#27537;閭?#28000;跺?#26948;锛?#29831;?#28598;?#28729;跺府浣犵湅?#28229;銆?strong>鍦?#23052;湁鎴?#37716;?#26473;愯?#23444;xample涔嬪墠锛?#28051;嶈?#20344;皾璇?#28103;?#37824;筫xample銆?br /><br /></strong>4.杩愯浜嗙涓涓猠xample涔?#37722;?#38171;屽皾璇?#37837;规嵁浣犵殑鐞?#29785;?#37724;岄渶瑕佷慨鏀筫xample锛屾祴璇?#26946;樼骇鍔熻?#30028;瓑銆?br /><br />5.鍦?#27996;?#29785;?#37737;?#37832;?#28003;?#37922;?#37722;?#38171;岄渶瑕佸紑濮嬫繁鍏殑浜?#29785;?#29831;?#26916;圭洰銆備緥濡傞?#22317;洰?#27537;?#21412;缃?#32480;?#37918;?#37510;?#26946;樼骇鍔熻兘浠?#37721;?#37832;浣冲疄璺?#37510;傞氬父涓涓?#26473;?#28003;滆壇濂界殑椤圭洰浼氭?#24874;緵涓浠?#28000;庢?#21613;埌?#32321;?#27537;鐢?#37812;锋寚鍗?#38171;?#28003;?#39582;?#28051;嶉渶瑕?#28000;?#28598;村埌灏鹃槄璇?#26473;欎鎸?#37719;?#38171;屾?#35268;嵁?#26882;闂村拰鍏磋叮锛?#37911;瑰埆鏄?#28003;?#38007;繁浠诲姟?#27537;?#28214;瑕?#38171;?#38322;嶇?#24402;槄璇婚儴鍒嗙珷鑺傚?#36346;仛绗?#29825;?#38171;?#37818;?#38013;恊vernote锛?#37510;?br /><br />6.濡?#37835;滄椂闂?#37711;?#29825;?#38171;屽皾璇?#28000;庢簮鐮佹?#21227;缓璇?#26916;圭洰銆傞氬父?#32017;?#31790;椤圭洰?#20824;浼氭?#24874;緵涓浠芥?#21227;缓鎸?#37719;?#38171;屾寚瀵?#28003;?#28641;備綍鎼?#23524;?#28051;涓?#37922;?#27996;庡紑?#24386;銆佽皟璇曞?#23678;?#21227;?#34425;殑鐜?#28583;?#37510;傚皾璇曟?#21227;缓涓涓?#37911;?#37832;?#37510;?br /><br />7.濡?#37835;滄椂闂?#37711;?#29825;?#39582;?#28051;旀湁鍏磋叮锛屽彲浠?#28751;?#29831;曢槄璇绘簮鐮?#38171;?br />锛?锛夐槄璇绘簮鐮?#28052;嬪墠锛屾煡?#28229;璇?#26916;圭洰鏄?#37722;?#37819;愪緵鏋?#37835;勫拰璁?#29825;?#37826;囨锛岄槄璇?#26473;?#27996;?#37826;囨鍙?#28000;?#27996;?#29785;?#29831;?#26916;圭洰鐨勫浣?#29825;?#29825;拰缁?#37835;?#38171;?#29831;绘簮鐮佺殑?#26882;鍊?#28051;嶄?#27693;?#29361;粠涓嬫墜銆?br />锛?锛夐槄璇绘簮鐮?#28052;嬪墠锛?#28051;瀹?#29781;佽?#33445;?#21227;缓骞?#26473;愯璇?#26916;圭洰锛屾湁涓洿瑙?#37808;?#37721;?#37510;?br />锛?锛夐槄璇绘簮鐮佺殑绗?#28051;姝?#37828;?#37814;?#28051;诲共锛屽皾璇曠?#21976;竻涓娆?#23005;父杩愯?#23680;殑浠?#37934;佽皟鐢?#29882;?#23536;?#38171;?#26473;欏彲浠?#38315;?#26473;debug鏉?#29785;傚杩愯?#23678;椂鐨勫彉閲?#37724;岃涓?#37510;?#28103;?#37824;规簮鐮佸姞鍏?#37827;?#36423;?#37724;屾墦鍗板彲浠?#29999;?#37716;?#28003;?#37831;?#28610;界殑鐞?#29785;簮鐮?#37510;?br />锛?锛?#38315;傚綋鐢?#37733;?#37833;?#29999;?#37716;?#28003;?#37918;?#29785;簮鐮?#38171;?#37734;?#37918;嗘竻涓诲共鍚?#38171;屽彲浠?#28751;嗘暣涓?#23092;佺鐢?#37812;?#28051;寮犳?#20346;鍥?#37812;栬?#37837;?#37713;嗙殑UML鍥?#38171;屽府鍔?#29825;板?#21975;拰涓?#28051;姝殑?#27076;璇?#37510;?br />锛?锛夋寫閫夋劅鍏磋叮?#27537;“鏋?#39582;?#8221;浠?#37934;佹潵?#27076;璇?#38171;屾?#26047;浣?#28725;?#32515;?#32513;?#38315;?#29825;?#37808;?#37711;磋叮锛屽氨?#27076;璇?#32515;?#32513;滃?#20636;殑浠?#37934;?#38171;屾繁鍏埌瀹?#37916;?#32513;嗚妭锛屽瀹?#37922;?#27996;?#28000;涔?#25652;?#38171;?#38322;?#37922;?#27996;?#28000;涔?#29825;?#29825;?#22959;紡锛?#28051;?#28000;涔?#26473;?#37837;?#37707;氱瓑銆傚鏋?#37721;?#28000;?#38171;debug缁嗚妭浠?#37934;?#37510;?br />锛?锛夐槄璇绘簮鐮佺殑?#26882;鍊?#38171;?#38322;嶈鍗?#37711;冩祴璇?#38171;屽皾璇?#37720;?#26473;愯鍗?#37711;冩祴璇?#38171;屽熀鏈?#28051;?#28051;涓?#28610;?#37928;勫崟鍏冩祴璇?#28028;氬皢璇?#28000;?#37934;佺?#21227;?#29115;兘鍜岃鐣屾杩版?#21614;銆?br />锛?锛?#37734;?#37908;熸?#22795;簮鐮佸悗锛屽彂鐜版湁鍙?#28000;?#37824;?#26473;?#37928;勫?#29256;柟锛屾湁绮?#37716;?#37510;佹湁鎰?#37808;?#37721;?#28000;?#37722;?#29831;?#26916;圭洰鐨勫紑?#24386;鑰?#37819;愬嚭鏀?#26473;涚殑鎰?#29785;佹?#26668;卛ssue锛?#37922;?#38007;冲府浠?#28103;?#28598;嶅拰瀹?#37916;?#38171;屽弬涓?#29831;?#26916;圭洰鐨勫彂灞?#37510;?br /><br />8.閫氬父鍦槄璇?#37826;囨鍜屾簮鐮?#28052;?#37722;?#38171;?#28003;?#38003;?#28725;?#29831;?#26916;圭洰?#28225;姣旇?#20905;繁鍏殑浜?#29785;?#27996;?#38171;?#28003;?#37828;?#29831;?#26916;圭洰鎵鍦?#26864;嗗锛?#28003;?#37721;?#38003;?#26473;?#37807;?#37820;?#32497;?#37929;?#37711;崇殑椤圭洰?#25328;璧勬锛岀湅鐪嬫湁娌湁鍏?#28000;栫殑鏇?#28610;界殑椤圭洰鎴栬呰鍐虫柟妗?#37510;傚湪骞?#25652;?#37724;屾繁搴?#28052;?#38338;?#37833;冭銆?br /><br />    浠?#28051;?#37828;垜涓?#27996;虹殑涓浜?#28052;?#37807;?#38171;屾垜鑷繁涔熷苟娌湁瀹?#37711;?#37816;夌杩?#28051;?#37833;?#38171;?#28003;?#37828;?#37816;夌杩?#28051;?#26916;?#25652;?#38171;屽熀鏈?#28051;?#38003;?#29825;?#28003;犳?#26055;緝楂?#37825;?#37734;板涔犲拰浣?#37922;煇涓紑?#31790;椤圭洰銆?img src ="http://www.8634070.com/killme2008/aggbug/378885.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.8634070.com/killme2008/" target="_blank">dennis</a> 2012-05-22 23:12 <a href="http://www.8634070.com/killme2008/archive/2012/05/22/378885.html#Feedback" target="_blank" style="text-decoration:none;">?#24386;琛?#29831;?#29825;?/a></div>]]></description></item><item><title>Emacs + Clojure?#21412;缃?#37928;勫嚑涓猅iphttp://www.8634070.com/killme2008/archive/2012/05/19/378535.htmldennisdennisFri, 18 May 2012 16:57:00 GMThttp://www.8634070.com/killme2008/archive/2012/05/19/378535.htmlhttp://www.8634070.com/killme2008/comments/378535.htmlhttp://www.8634070.com/killme2008/archive/2012/05/19/378535.html#Feedback11http://www.8634070.com/killme2008/comments/commentRss/378535.htmlhttp://www.8634070.com/killme2008/services/trackbacks/378535.html     寰堜箙娌?#37831;存柊鍗氬浜?#38171;?#37734;?#37718;?#27996;?#23480;?#28003;?#38171;屽繖纰屽苟涓?#37711;?#28729;?#37510;傜洰?#22688;鏉?#29831;?#38171;孋lojure鏈濂?#37928;勫紑?#24386;缂栬?#25117;櫒搴?#29831;?#37828;疎macs + Slime?#27537;缁勫悎锛屽埄鐢?a href="https://github.com/technomancy/swank-clojure">swank-clojure杩?#28051;?#26916;圭洰锛屽姞涓奵lojure-mode锛屽彲浠?#28729;?#32519;?#37734;?#26473;愯?#23483;lime銆傜紪璇?#37510;?#26473;愯銆佽?#23456;浆銆佹?#22248;鍜屽鐢?#37836;湅鐢?#38007;?a href="http://georgejahad.com/clojure/swank-cdt.html">debug?#20824;鍙?#28000;?#37820;?#28729;?#37510;?#37711;?#28003;撻厤缃?#37805;?#28051;?#38322;?#28598;?#38171;岀湅swank-clojure?#27537;鏂囨鍗冲彲鑷繁瀹夎璧?#37833;?#38171;屾?#26668;?#26473;?#32481;?a href="http://sunng.info/blog/2011/09/beginning-emacs-for-clojure/">涓?#37826;?#37719;氬锛?a href="http://www.cnblogs.com/darkluck99/archive/2012/02/20/2360216.html">windows涓婇厤缃?/a>銆?br />
    鍒?#27996;?#37713;?#28051;猅ip锛?#28052;熸湡寰?#28598;?#28729;跺垎浜?#28003;犱滑?#27537;浣?#37922;?#36423;?#23536;?#37510;?br />
    棣?#37711;?#37828;?#38007;?#37716;?#37734;?#37813;撳紑clj鍚庣紑鏂?#28000;剁殑?#26882;鍊欏惎鍔?#37813;?#29723;宑lojure-jack-in涓巗lime杩炴帴锛屽彲浠?#37734;emacs?#21412;缃?#38322;屽姞涓?#28051;猚allback锛?br />
(eval-after-load "clojure-mode"
  '(progn
     (require 'slime)
     (require 'clojure-mode)
     (unless (slime-connected-p)
       (save-excursion (clojure-jack-in)))))
    杩?#37837;?#37734;?#37813;撳紑clj涓?#37722;庣紑?#27537;鏂?#28000;剁殑?#26882;鍊?#38171;屽皢鑷?#37716;?#37722;?#37716;clojure-mode鎵?#29723;宑lojure-jack-in?#22193;鏁板苟涓?#26473;炴帴slime銆?br />
    灏哻lj鍚庣紑?#27537;鏂?#28000;?#38007;?#37716;?#37711;宠?#26047;埌clojure-mode:
(setq auto-mode-alist (cons '("\\.clj$" . clojure-mode) auto-mode-alist))
    閫氬父鏉?#29831;村鏋?#28003;?#37828;?#37714;?#37922;?a href="http://marmalade-repo.org/">marmalade瀹夎?#21615;殑锛屼細鑷?#37716;?#37711;宠?#26050;殑銆?br />
    鍙?#28598;?#38171;屽惎鍔?#38007;?#37716;?#37718;归厤?#23277;鍙?#37510;佸瓧绗?#28051;?#23534;?#37721;风?#22796;殑paredit妯紡涓瀹?#29781;佸惎鍔?#38171;?br />
(defun paredit-mode-enable () (paredit-mode 1))
(add-hook 'clojure-mode-hook 'paredit-mode-enable)
(add-hook 'clojure-test-mode-hook 'paredit-mode-enable)

   鍦?#28003;?#37922;clojure-mode鎴栬卌lojure-test-mode?#27537;?#26882;鍊?#38007;?#37716;?#37722;?#37922;paredit妯紡锛屾嫭鍙?#37712;?#28052;?#28051;?#37828;棶棰?#37510;傛嫭鍙?#37718;归厤鎻?#32448;?#28051;鑸?#37828;紑鍚殑锛屽鏋?#23052;湁锛屽鍒跺紑鍚?#38171;?br />
;;    鏄?#32448;烘嫭鍙?#37718;归厤
(show-paren-mode t)
(setq show-paren-style 'parentheses)

    slime鏇?#28598;氶厤缃?#38171;屽惎鐢IO閲?#28729;氬锛?#28598;氱?#36328;?#23149;O杈撳嚭?#20824;瀹氬?#25117;埌SLIME repl锛?#28000;?#37721;?#29825;?#32515;?#38315;?#29825;?#28699;?#32471;?#32514;?#37934;佺瓑锛?br />
(eval-after-load "slime"
  '(progn
     (slime-setup '(slime-repl slime-fuzzy))
     ;;(setq slime-truncate-lines t)
     (setq  swank:*globally-redirect-io*  t)
     ;; (setq slime-complete-symbol-function ' slime-fuzzy-complete-symbol)
     (setq slime-net-coding-system 'utf-8-unix)))

    缁?#36423;冪殑鏈?#37721;?#37721;?#38003;芥敞鎰忓埌?#22428;?#25950;閲?#27996;slime-fuzzy-complete?#27537;?#21412;缃?#38171;?#26473;?#37828;?#28051;涓敮鎸佹洿濂界殑鑷?#37716;?#29723;?#37711;?#37716;熻?#30028;殑SLIME鎻?#28000;?#38171;?#37721;?#28000;?#37922;?#32514;啓鏉?#38007;?#37716;?#29723;?#37711;?#38171;?#38171;屽彲鎯?#37734;垜鏈?#37731;?#28051;?#23052;湁灏?#29831;曢厤缃?#37812;?#37716;?#38171;屾湁鍏磋叮浣?#37721;?#28000;?#28751;?#29831;?#28051;?#37510;?br />
    鍦REPL閲屾敮鎸?#29831;?#23049;?#26946;?#27996;?#38171;?#28051;瀹?#29781;侀厤缃?#28051;?#38171;?br />
(add-hook 'slime-repl-mode-hook
          (defun clojure-mode-slime-font-lock ()
            (require 'clojure-mode)
            (let (font-lock-mode)
              (clojure-mode-font-lock-setup))))

    鍗曠嫭鍦clojure-mode锛?#37734;?#37711;?#28000;mode閲?#26473;?#27996;?#36423;?#37817;?#38335;?#28051;嶄細璧?#28003;?#37922;?#38171;?#38322;岄厤缃?#36423;?#37817;?#38335;?#37721;?#28000;?#26473;?#37837;?
(eval-after-load "clojure-mode"
  '(progn
     (require 'slime)
     (require 'clojure-mode)
     (define-key clojure-mode-map (kbd "M-/")  (quote slime-complete-symbol))
     (define-key clojure-mode-map (kbd "C-c s")  (quote slime-selector)))

   ?#32229;濡傛垜杩?#38322;屽皢M-/浣?#28051;?#38007;?#37716;?#29723;?#37711;?#37928;勫揩鎹?#38335;?#38171;?#37733;?#28051;簃eta閿?#37734;垜?#27537;Mac鏈?#37731;?#28051;?#29825;?#32515;?#28051;篶ommand閿?#38171;?#37733;犳鑷?#37716;?#29723;?#37711;殑鎿?#28003;?#28052;?#37807;?#28751;p窡Eclipse?#34987;浼?#37510;傝?strong>slime-selector鏄?#28051;涓?#38344;炲父?#28225;鐢?#37928;勫嚱鏁?#38171;?#37922;?#37833;?#29882;宠浆?#22476;slime?#27537;涓绯诲垪buffer锛?#37733;犳?#22428;缁?#28729;?#27996;咰-c s蹇?#37817;?#38335;?#37510;?br />
    棰?#28598;?#28051;鎻?#38171;?#37734;Mac osx涓?#38171;屽皢command浣?#28051;簃eta閿?
;;; I prefer cmd key for meta
(setq mac-option-key-is-meta nil
      mac-command-key-is-meta t
      mac-command-modifier 'meta
      mac-option-modifier 'none)

    鏈鍚?#38171;屾湡寰?#28598;?#28729;?#28051;嶅悵鍒?#27996;?#28003;?#37928;勫績寰?#37510;?br />    

dennis 2012-05-19 00:57 ?#24386;琛?#29831;?#29825;?/a>
]]>clj.monitor : monitoring applications in clojure based on SSHhttp://www.8634070.com/killme2008/archive/2012/05/12/378018.htmldennisdennisSat, 12 May 2012 14:38:00 GMThttp://www.8634070.com/killme2008/archive/2012/05/12/378018.htmlhttp://www.8634070.com/killme2008/comments/378018.htmlhttp://www.8634070.com/killme2008/archive/2012/05/12/378018.html#Feedback5http://www.8634070.com/killme2008/comments/commentRss/378018.htmlhttp://www.8634070.com/killme2008/services/trackbacks/378018.html
    My weekend project clj.monitor is beta release,it's a clojure DSL for monitoring system and applications based on SSH.

Home:
https://github.com/killme2008/clj.monitor

An example:
(ns clj.monitor.example
  (:use [clj.monitor.core]
        [control.core]
        [clj.monitor.tasks]))

;;define a mysql cluster
(defcluster mysql
  :clients [{:user "deploy" :host "mysql.app.com"}])

;;define a monitor for mysql cluster
(defmonitor mysql-monitor
  :tasks [(ping-mysql "root" "password")
            (system-load :5 3)]
  :clusters [:mysql])

;;start monitors
(start-monitors
 :cron "* 0/5 * * * ?"
 :alerts [(mail :from "alert@app.com" :to "yourname@app.com")]
 :monitors [mysql-monitor])

API document: http://fnil.net/clj.monitor

It is just a beta release,if you have any questions or find issues ,please let me know,thanks.


dennis 2012-05-12 22:38 ?#24386;琛?#29831;?#29825;?/a>
]]>
˫ɫֱ
<div id="k0jz6"><tr id="k0jz6"></tr></div>
    <sup id="k0jz6"><menu id="k0jz6"><small id="k0jz6"></small></menu></sup>
    <div id="k0jz6"><tr id="k0jz6"><mark id="k0jz6"></mark></tr></div><em id="k0jz6"></em>
    <dl id="k0jz6"><ins id="k0jz6"></ins></dl><dl id="k0jz6"></dl>
      <div id="k0jz6"></div>

      <sup id="k0jz6"></sup><dl id="k0jz6"><ins id="k0jz6"><thead id="k0jz6"></thead></ins></dl>
        <div id="k0jz6"><tr id="k0jz6"></tr></div>
          <sup id="k0jz6"><menu id="k0jz6"><small id="k0jz6"></small></menu></sup>
          <div id="k0jz6"><tr id="k0jz6"><mark id="k0jz6"></mark></tr></div><em id="k0jz6"></em>
          <dl id="k0jz6"><ins id="k0jz6"></ins></dl><dl id="k0jz6"></dl>
            <div id="k0jz6"></div>

            <sup id="k0jz6"></sup><dl id="k0jz6"><ins id="k0jz6"><thead id="k0jz6"></thead></ins></dl>