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
diff --git a/issue99_test.go b/issue99_test.go | |
index a8fb57c..cb5e47f 100644 | |
--- a/issue99_test.go | |
+++ b/issue99_test.go | |
@@ -10,6 +10,8 @@ import ( | |
"strconv" | |
"strings" | |
"sync" | |
+ "time" | |
+ "fmt" |
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
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <iomanip> | |
#include <sstream> | |
#include <algorithm> | |
using namespace std; | |
#define assert(x) ((void)(!(x) && (cout << "ERROR: at " << __FILE__ << ":" << __LINE__ << " " << #x << endl))) |
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
location ~* /cache/ { | |
proxy_pass http://127.0.0.1:8000; | |
if ($http_origin ~* "^https?://(dev|admin|www)\.site\.com$" ) { | |
set $cors "A"; | |
} | |
if ($request_method = 'OPTIONS') { | |
set $cors "${cors}B"; | |
} |
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
description "Redis container" | |
author "Ivan Prisyazhnyy" | |
start on filesystem and started docker | |
stop on runlevel [!2345] or stopping docker | |
# Docker has a timeout of 10 seconds so as long as this | |
# is longer so we don't kill the wait process | |
kill timeout 20 | |
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
worker_processes 2; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
access_log /dev/stderr combined; | |
keepalive_timeout 65; |
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
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 3 5 | |
kill timeout 10 | |
limit nofile 65535 65535 | |
setuid redis |
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
# file: roles/common/tasks/item.yml | |
- name: be sure basic packages are installed | |
apt: pkg={{item}} state=latest update_cache=yes | |
tags: common | |
with_items: | |
- git | |
- subversion | |
- vim | |
- block: |
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
/** | |
* Definition for a binary tree node. | |
* struct TreeNode { | |
* int val; | |
* TreeNode *left; | |
* TreeNode *right; | |
* TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
* }; | |
*/ | |
class Solution { |
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
/** | |
* Definition for a binary tree node. | |
* struct TreeNode { | |
* int val; | |
* TreeNode *left; | |
* TreeNode *right; | |
* TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
* }; | |
*/ | |
class Solution { |
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
class Solution { | |
public: | |
void solveSudoku(vector<vector<char>>& board) { | |
for (int row = 0; row < 9; row ++) { | |
auto rowi = &board[row]; | |
for (int col = 0; col < 9; col ++) { | |
if ((*rowi)[col] == '.') { | |
for (char a = '1'; a <= '9'; ++ a) { | |
if (can(board, col, row, a)) { | |
(*rowi)[col] = a; |