This file contains 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
(defmacro defdelegation | |
[protocol-name options & body] | |
(let [{:keys [prefix] :or {prefix "-"}} (if (map? options) options {}) | |
body (if (map? options) body (cons options body)) | |
protocol-body (mapv (fn [definition] | |
(let [fn-sym (first definition) | |
fn-body (rest definition)] | |
(apply list (symbol (str prefix (name fn-sym))) fn-body))) | |
body) | |
fn-defs (mapv (fn [definition] |
This file contains 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
package example.mdsample.java; | |
import java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import javax.xml.bind.DatatypeConverter; | |
import org.apache.commons.lang.StringUtils; | |
public class App { |
This file contains 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
#!/usr/bin/env bash | |
function check_error() { | |
ret=$? | |
msg=$1 | |
code=$2 | |
if [[ $RET -ne 0 ]] | |
then | |
echo "error: $1" >&2 | |
exit $code |
This file contains 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
#!/usr/bin/env bash | |
function check_error() { | |
ret=$? | |
msg=$1 | |
code=$2 | |
if [[ $RET -ne 0 ]] | |
then | |
echo "error: $1" >&2 | |
exit $code |
This file contains 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
(fact "user-ageはユーザの年齢を返す" | |
(user-age ..name..) => ..age.. | |
(provided | |
(fetch-user-data ..name..) => {:age ..age.., :name ..name..})) |
This file contains 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
<target name="install-artifacts" depends="jars"> | |
<macrodef name="install"> | |
<attribute name="file" /> | |
<attribute name="pom" /> | |
<sequential> | |
<artifact:install file="@{file}" > | |
<pom refid="@{pom}"/> | |
</artifact:install> | |
</sequential> | |
</macrodef> |
This file contains 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
Searching for subvertpy | |
Reading http://pypi.python.org/simple/subvertpy/ | |
Reading http://samba.org/~jelmer/subvertpy | |
Reading http://launchpad.net/subvertpy | |
Best match: subvertpy 0.8.10 | |
Downloading http://samba.org/~jelmer/subvertpy/subvertpy-0.8.10.tar.gz | |
Processing subvertpy-0.8.10.tar.gz | |
Running subvertpy-0.8.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-NDoICr/subvertpy-0.8.10/egg-dist-tmp-GLfV9D | |
Traceback (most recent call last): | |
File "/usr/bin/easy_install-2.7", line 10, in <module> |
This file contains 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
List(1,2,3,1).foldLeft(Map[Int,Int]()) { (x, y) => x.get(y) match { case Some(v) => x + Pair(y, (v + 1)) case None => x + Pair(y, 1) }} |
This file contains 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
List(1,2,3,1).zip(List(1,1,1,1)).foldLeft(Map[Int,Int]()) { (x, y) => x.get(y._1) match { case Some(v) => x + Pair(y._1, (v + y._2)) case None => x + y }} |
This file contains 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
var fs = require('fs'); | |
var sys = require('sys'); | |
var stream = fs.createReadStream('./sample.txt', { 'flags': 'r', | |
'encoding': 'UTF-8', | |
'bufferSize': 4 * 1024}); | |
var stream2 = fs.createReadStream('./sample2.txt', { 'flags': 'r', | |
'encoding': 'UTF-8', | |
'bufferSize': 4 * 1024}); |
NewerOlder