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
[io.airlit.sample.Main.main()] | |
- Bootstrap app = new Bootstrap( | |
new NodeModule(), | |
new DiscoveryModule(), | |
new HttpServerModule(), | |
new JsonModule(), | |
new JaxrsModule(), | |
new MBeanModule(), | |
new JmxModule(), | |
new JmxHttpModule(), |
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
module type Addable = sig | |
type t | |
val add: t -> t -> t | |
end;; | |
module type Pair_inf = sig | |
type t | |
type endpoint | |
val create: endpoint -> endpoint -> t | |
end;; |
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
Map<String, Object> map = new HashMap<>(); | |
map.put("name", "komamitsu"); | |
map.put("age", 39); | |
ObjectMapper objectMapper = new ObjectMapper(); | |
String serialized = objectMapper.writeValueAsString(map); | |
System.out.println(serialized); | |
Map<String, Object> deserialized = | |
objectMapper.readValue(serialized, new TypeReference<Map<String, Object>>() { }); | |
System.out.println(deserialized); |
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
Pojo: | |
Generator: | |
http://gyazo.com/7eb78f90605c412bfa8d425332213984.png | |
Parser: | |
http://gyazo.com/b9344c89980312c06ee88ebd5a76cf4e.png | |
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
# module type Bumpable = sig | |
type t | |
val bump : t -> t | |
end;; | |
module type Bumpable = sig type t val bump : t -> t end | |
# module Int_bumper = struct | |
type t = int | |
let bump n = n + 1 | |
end;; |
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
static class ReentrantReadWriteLockExample { | |
private int loopNum = 30000; | |
private int slotNum = 10; | |
private int writeThreadNum = 5; | |
private int readThreadNum = 5; | |
public void examinReentrantReadWriteLock() throws InterruptedException { | |
final HashMap<Integer, Pair<Integer, Integer>> tbl = new HashMap<>(); | |
for (int slot = 0; slot < slotNum; slot++) { |
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
[komamitsu@potato td-ios-sdk (master)]$ pod trunk push --verbose TreasureData-iOS-SDK.podspec | |
Validating podspec | |
$$$$ Trunk#validate_podspec $$$$ | |
$$$$ Validator.init: ["https://github.com/CocoaPods/Specs.git"] $$$$ | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-trunk-0.3.0/lib/pod/command/trunk.rb:337:in `new' | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-trunk-0.3.0/lib/pod/command/trunk.rb:337:in `validate_podspec' | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-trunk-0.3.0/lib/pod/command/trunk.rb:289:in `run' | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/claide-0.7.0/lib/claide/command.rb:271:in `run' | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:48:in `run' | |
/Users/komamitsu/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-0.34.2/bin/pod:33:in `<top (required)>' |
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
require 'redis' | |
class RedisBench | |
def initialize(count) | |
@count = count | |
@r = Redis.new | |
end | |
def bench(prepare_items, label, &blk) | |
@r.flushall |
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
irb(main):027:0> c = TCPSocket.new('127.0.0.1', 24225) => #<TCPSocket:fd 15> | |
irb(main):028:0> c.write(MessagePack.pack(['foo.bar', MessagePack.pack([Time.now.to_i, {:name => 'aaa', :age => 12}]) + MessagePack.pack([Time.now.to_i, {:name => 'bbb', :age => 34}])])) | |
=> 54 | |
>>> | |
2015-09-16 00:16:28 +0900 foo.bar: {"name":"aaa","age":12} | |
2015-09-16 00:16:28 +0900 foo.bar: {"name":"bbb","age":34} |
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
let split_rev cut xs = | |
let (_, f, s) = | |
List.fold_left | |
(fun (i, f, s) x -> | |
if i < cut then (i + 1, x::f, s) else (i + 1, f, x::s)) | |
(0, [], []) xs | |
in | |
(f, s) | |
let rec ms xs = |
OlderNewer