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
| { | |
| "invasionTimeout": 86400, | |
| "invasionExtensionTime": 3600, | |
| "invasionArmyCap": 5, | |
| "notificationThresshold": 10, | |
| "targetResetPrice": { | |
| "resource": "gold", | |
| "amount": 1000 | |
| }, | |
| "maps": [ |
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
| "POST", "/api/user/invasion/buy_new_target/#{uuid}", {}) | |
| "POST", "/api/user/invasion/finish_invasion_battle/#{uuid}", { | |
| "attacker" => // Attacker uuid, | |
| "result" => // Either "win" "lose" "surrender", | |
| "army" => // A string with the Battle info like in FinishPvE |
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
| def finishInvasionBattle( | |
| state: State, | |
| invasion: FinishInvasionBattle, | |
| userId: String | |
| ) : (State, List[TrackingMessage]) = { | |
| validate(state, invasion.userId) | |
| val (afterBattle, calls) = battleEffects(state, userId)(invasion) | |
| (resetTarget(afterBattle)(invasion), calls) | |
| } |
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
| 2.0.0p247 :012 > [nil,2,3].lazy.map { |x| | |
| puts "evaluating #{x}. This could be expensive" | |
| x ? x * 10 : x | |
| }.detect { |x| | |
| x && x >= 20 | |
| } | |
| evaluating . This could be expensive | |
| evaluating 2. This could be expensive | |
| => 20 |
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
| lock = RedisLock.new(:client => $stats_wolverine, | |
| :name => "My Lock", | |
| :timeout => 10) | |
| shared_var = 1 | |
| lock.atomically { | |
| shared_var += 1 | |
| lock.atomically { | |
| shared_var += 1 # This one fails |
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
| 1) "1092200529" | |
| 2) "100003618227694" | |
| 3) "100003158233371" | |
| 4) "100002542453833" | |
| 5) "1002157672" | |
| 6) "1341005026" | |
| 7) "100004161994675" | |
| 8) "1005935063" | |
| 9) "100001182421106" | |
| 10) "100001606315832" |
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
| 1) "1092200529" | |
| 2) "100003618227694" | |
| 3) "100003158233371" | |
| 4) "100002542453833" | |
| 5) "1002157672" | |
| 6) "1341005026" | |
| 7) "100004161994675" | |
| 8) "1005935063" | |
| 9) "100001182421106" | |
| 10) "100001606315832" |
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
| def compress! | |
| r_i = 0.0 | |
| c = Cursor.new(self.samples) | |
| while ~c != nil && ~c.next != nil | |
| r_i = (~c).rank + (~c.next).value + (~c.next).delta | |
| if r_i <= @invariant.upper_bound(r_i, n) | |
| removed = ~c.next | |
| (~c).value = removed.value | |
| (~c).delta = removed.delta | |
| c.remove! |
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
| # Leagues finishing the 05.10.2013 | |
| bronze Segment a = 4293 | |
| bronze Segment b = 2125 | |
| bronze Segment c = 1514 | |
| bronze Segment d = 1468 | |
| silver Segment a = 383 | |
| silver Segment b = 662 | |
| silver Segment c = 655 |