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
inline bool contains(int x, int y, Bounds rect) { | |
return (x <= rect.right) && (y <= rect.bottom) && (x >= rect.left) && (y >= rect.top); | |
} | |
void BuildStringFromMatrix(int* Matrix, int NumRows, int NumColumns, char* OutBuffer) { | |
Bounds rect = { NumColumns - 1 , NumRows - 1, 0, 0 }; | |
int dir = 0; | |
int count = 0; | |
int x = 0; |
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
inline int abs(int n) { return (n < 0) ? -n : n; } | |
char* itoa(int Value, int Base) { | |
static const char lookup[] = "0123456789ABCDEF"; | |
static const size_t bufferSize = 65; | |
static char buf[bufferSize] = {0}; | |
int i = bufferSize - 1; | |
int n = Value; | |
do { |
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
template <typename T> | |
T worstCase(T p_psxCount, T p_floorCount) { | |
Cache<T> cache; | |
auto min = [](T a, T b) { return (a < b) ? a : b; }; | |
auto max = [](T a, T b) { return (a > b) ? a : b; }; | |
auto memo_W = [&cache](T n, T k, auto &&W) { | |
return (cache.count({n,k}) > 0) ? cache[{n,k}] : cache[{n,k}] = W(n,k,W); | |
}; |
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
int timeToCrossBridge(int* party, int partySize) { | |
if (partySize == 1) return party[0]; // 1 torch, 1 guy, no problem | |
if (partySize == 2) return party[1]; // easy | |
if (partySize < 1) return -1; // no party :( | |
int *p = &party[partySize - 1]; // p moves backwards from slowest | |
int *fastest = &party[0]; | |
int *nextFastest = &party[1]; | |
int time = 0; | |
int slowest = 0; |
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
MGET /data | |
Header: PAGE=0 <-- OK 209 {data:PAGE=0, TOTAL=3} | |
MGET /data | |
Header: PAGE=1 <-- OK 209 {data:PAGE=1, TOTAL=3} | |
MGET /data | |
Header: PAGE=2 <-- OK 200 {data:PAGE=2, TOTAL=3} |
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
"resource": "/catalog/item", | |
"key": "130047:1:2", | |
"fields":{ | |
"bib":{ | |
"resource": "/catalog/bib", | |
"key": "130047" | |
}, | |
"call":{ | |
"resource": "/catalog/call", |
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
1 import React, { Component } from 'react'; | |
2 | |
3 function handleErrors(response) { | |
4 if (!response.ok) { | |
5 throw Error(response.statusText); | |
6 } | |
7 return response; | |
8 } | |
9 | |
10 |
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
/home/alivesay/.gvm/pkgsets/go1.11.1/proficy:/home/alivesay/go:/home/alivesay/.gvm/pkgsets/go1.11.1/global |
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
$ go build | |
unexpected directory layout: | |
import path: github.com/go-chi/chi | |
root: /home/alivesay/go/src | |
dir: /home/alivesay/go/src/github.com/alivesay/proficy/vendor/github.com/go-chi/chi | |
expand root: /home/alivesay/go/src | |
expand dir: /home/alivesay/go/src/github.com/alivesay/proficy/vendor/github.com/go-chi/chi | |
separator: / |
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
something: |+ | |
Hello. | |
^[[1;32m | |
I am green. | |
^[[0m | |
I am not green. |
NewerOlder