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
/* | |
A small node.js script utilising bluebird, node-rate-limiter and aws-sdk to achieve optimal DynamoDB UpdateItem throughput for a provided DDB write capacity / per second | |
When would this be useful? | |
Sadly, aws-sdk does not automatically throttle, it just blows up with ProvisionedThroughputExceededException. | |
So let’s say, you want to update millions of records in Dynamo using the Update operation, without BatchWriteItem which only allows Puts and you want to avoid generating Insert events. | |
Additionally, you want it to go as fast as your DDB configuration (without burst) allows, but not any faster. | |
*/ |
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
(defn fiz-with-book | |
[look {[x y] :pos}] | |
(let [move (look [x (inc y)]) | |
move-up [x (dec y)] | |
move-down [x (inc y)] | |
move-left [(dec x) y] | |
move-right [(inc x) y]] | |
(cond (nil? (look move-up)) {:pos move-up} | |
(nil? (look move-left)) {:pos move-left} | |
(nil? (look move-down)) {:pos move-down} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.cleandroid; | |
import java.awt.BorderLayout; | |
import java.awt.Dimension; | |
import java.awt.FlowLayout; | |
import java.awt.Toolkit; |