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 buffer = document.createElement('canvas'); | |
var bufContext = buffer.getContext("2d"); | |
buffer.width = 60; | |
buffer.height = 20; | |
bufContext.fillStyle = "#FFFFFF"; | |
bufContext.fillRect(0, 0, 60, 20); | |
bufContext.textBaseline = "top"; |
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 n = 40; | |
// Each row has exactly one queen. We have to determine which column to place each queen in. | |
var board = []; | |
function initBoard() { | |
// Put one queen in each row | |
board = []; | |
for(var row = 0; row < n; row++) { | |
board[row] = []; |
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
public class RecursiveThreadPoolExecutor extends ThreadPoolExecutor { | |
private AtomicInteger count; | |
public RecursiveThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) { | |
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue); | |
count = new AtomicInteger(0); | |
} | |
public void execute(Runnable command) { |
NewerOlder