Tomcat里的cpappend.bat
摘要: 在Tomcat的發行包中有一個bat文件很有意思.
可以把指定的參數添加到classpath里面.
和bat腳本for一起配合,可以實現自動的把某個目錄下的jar包都放到classpath里.
閱讀全文
[ZZ]Groovy Goodness: Using Lists and Maps As Constructors
摘要:
Constructors in Groovy can be invoked in a classic Java way, but we can also use lists or maps to create objects. Groovy supports an explicit coersion of a list to a constructor with the as keyword. Or we can rely on the implicit coersion when Groovy looks at the type of the variable to automatically convert the list to the right constructor call.
閱讀全文
[ZZ]Groovy Goodness: Using the Inject Method
摘要: Groovy has some features and methods we can categorize as functional programming. The inject() method is a so called higher-order function. Other languages call it a fold, reduce or accumulate. The inject() method processes a data structure with a closure and builds up a return value. The first parameter of the inject() method is the first value of the intermediary results of the second parameter: the closure. When we use the inject() we don't introduce any side effects, because we build up the
閱讀全文
下劃線分割字符串轉換成駝峰式字符串
摘要: 下劃線分割字符串轉換成駝峰式字符串的groovy腳本
閱讀全文
django useful tip
摘要: 最近在用django做一下項目, 我也是第一次使用django, 也是第一次比較正式的使用Python. 本文將記錄一下使用django過程中遇到的一下問題和解決辦法. 不斷更新!
閱讀全文
如何在window系統中讓py文件可以直接執行
摘要: 正常情況下你如果是用安裝文件安裝的Python, 那么安裝時會給你設置好這樣的功能. 但是有時候你可能不小心改了配置, 或者不是用安裝包安裝的. 這是如果你在控制臺直接輸入:
xxx.py arg1 arg2 這樣的命令, 就不會顯示"xxx.py"不是內部或外部命令,也不是可運行的程序或批處理文件。
比如你要用 django-admin.py startproject mysite 來建立項目.
閱讀全文