Paprika doesn't have their API documented, so this is me reverse-engineering it from an Android device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LogResponseWritter wraps the standard http.ResponseWritter allowing for more | |
| // verbose logging | |
| type LogResponseWritter struct { | |
| status int | |
| size int | |
| http.ResponseWriter | |
| } | |
| // func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter { | |
| // // Default the status code to 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Map; | |
| class OrderedMapIterator<K,V> { | |
| var map : OrderedMap<K,V>; | |
| var index : Int = 0; | |
| public function new(omap:OrderedMap<K,V>) | |
| map = omap; | |
| public function hasNext() : Bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn tree-seq-depth | |
| "Returns a lazy sequence of vectors of the nodes in a tree and their | |
| depth as [node depth], via a depth-first walk. branch? must be a fn | |
| of one arg that returns true if passed a node that can have | |
| children (but may not). children must be a fn of one arg that | |
| returns a sequence of the children. Will only be called on nodes for | |
| which branch? returns true. Root is the root node of the tree." | |
| [branch? children root] | |
| (let [walk (fn walk [depth node] | |
| (lazy-seq |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http { | |
| log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent" $request_time ' | |
| '<"$request_body" >"$resp_body"'; | |
| lua_need_request_body on; | |
| set $resp_body ""; | |
| body_filter_by_lua ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo yum install -y apache-maven | |
| mvn --version |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
Open python
python
and type
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
std::set phoenix;
phoenix.key_comp();