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
---------------------------------- | |
| 3 6 9 | 1 2 4 | 5 8 7 | | |
| 7 2 8 | 6 5 9 | 3 1 4 | | |
| 1 4 5 | 7 3 8 | 2 6 9 | | |
---------------------------------- | |
| 2 9 7 | 3 6 1 | 8 4 5 | | |
| 5 8 3 | 9 4 2 | 6 7 1 | | |
| 6 1 4 | 5 8 7 | 9 2 3 | | |
---------------------------------- | |
| 9 7 2 | 8 1 5 | 4 3 6 | |
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
---------------------------------- | |
| 3 6 9 | 1 2 4 | 5 8 7 | | |
| 7 2 8 | 6 5 9 | 3 1 4 | | |
| 1 4 5 | 7 3 8 | 2 6 9 | | |
---------------------------------- | |
| 2 9 7 | 3 6 1 | 8 4 5 | | |
| 5 8 3 | 9 4 2 | 6 7 1 | | |
| 6 1 4 | 5 8 7 | 9 2 3 | | |
---------------------------------- | |
| 9 7 2 | 8 1 5 | 4 3 6 | |
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
using cellQueue = std::deque<SudokuCell>; | |
class SudokuBoard { | |
/* | |
* fill the board with valid solution | |
*/ | |
void fillCells() { | |
auto remaininCells = cellQueue{cells}; | |
if(!doFillCells(remaininCells)) { |
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 SudokuBoard { | |
void generateAllNeighbors () { | |
// generate row & col neighbors | |
for (int n = 0; n < 9; ++n) { | |
neighbors.insert({n, pos.j}); | |
neighbors.insert({pos.i, n}); | |
} | |
auto iFloor = (pos.i / 3) * THIRD; | |
auto jFloor = (pos.j / 3) * THIRD; |
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
available_options = (1..9) | |
def fillCells: | |
doFillCells(0) | |
def doFillCells (index): | |
cell = board.cells[index] | |
neighbor_values = cell.neighbors.map((neighbor) => neighbor.values) | |
remaining_options = available_options \ neighbor_values | |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Attach", | |
"type": "node", | |
"request": "attach", | |
"port": 5858, | |
"address": "localhost", | |
"restart": false, |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontFamily": "Fira Code", | |
"editor.fontSize": 12, | |
"editor.fontLigatures": true, | |
"editor.lineNumbers": "relative", | |
"workbench.colorTheme": "Tomorrow Night Blue", | |
"vim.disableAnnoyingNeovimMessage": true, | |
"editor.tabSize": 2, | |
"C_Cpp.intelliSenseEngine": "Default" |
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
set nocompatible " be iMproved, required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
filetype off | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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
From https://www.vultr.com/docs/how-to-compile-nginx-from-source-on-ubuntu-16-04 | |
./configure --prefix=/home/myusename/nginx/share/nginx \ | |
--sbin-path=/home/myusename/bin/nginx \ | |
--modules-path=/home/myusename/nginx/lib/nginx/modules \ | |
--conf-path=/home/myusename/nginx/nginx.conf \ | |
--error-log-path=/home/myusename/nginx/log/nginx/error.log \ | |
--http-log-path=/home/myusename/nginx/log/nginx/access.log \ | |
--pid-path=/run/nginx.pid \ | |
--lock-path=/home/myusename/nginx/lock/nginx.lock \ |
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 <iostream> | |
#include <math.h> | |
#include <cstdlib> | |
#include <vector> | |
int main () { | |
int N = 8000 * 8000; // 800px x 800px image | |
int iterations = 10; | |
int size = N*sizeof(float); | |
float *x, *y, *output; |