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
// Array of [continent code, country code, country name] | |
// Source: https://en.wikipedia.org/wiki/List_of_sovereign_states_and_dependent_territories_by_continent_(data_file) | |
// let rows = Array.from(document.querySelectorAll('table.sortable tr')) | |
// let data = rows.slice(1).map(row => [row.cells[0].textContent, row.cells[1].textContent, row.cells[4].textContent]) | |
// data | |
[ | |
[ | |
"AS", | |
"AF", | |
"Afghanistan, Islamic Republic of" |
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
structure Parser = | |
struct | |
exception ParsingError of string | |
datatype cmd = Push of int | |
| Add | |
| Sub | |
| Mul | |
| Div | |
| Dup |
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
16 (0,0,0) | |
17 (0,0,95) | |
18 (0,0,135) | |
19 (0,0,175) | |
20 (0,0,215) | |
21 (0,0,255) | |
22 (0,95,0) | |
23 (0,95,95) | |
24 (0,95,135) | |
25 (0,95,175) |
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 functools import wraps | |
a_ord = ord('a') | |
class NonAlphaException(Exception): | |
pass | |
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
const tableFactory = () => { | |
const columns = []; | |
const compositeUniqueColumns = []; | |
const dataTypes = [ | |
'uuid', | |
'string', | |
'timestamp', | |
'float', | |
'integer', |
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
Function nameList(ParamArray xs() As Variant) As String | |
For i = LBound(xs) To UBound(xs) | |
For Each x In xs(i).Cells | |
If x.value <> "" Then | |
If nameList <> "" Then | |
nameList = nameList & ", " | |
End If | |
nameList = nameList & x.value | |
End If | |
Next x |
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
const findLastRowWithValue = (sheet) => { | |
const { decode_cell } = XLSX.utils; | |
const { r } = decode_cell(sheet['!ref'].split(':')[1]); | |
const isEmpty = (x) => sheet[`A${ x }`].v === undefined; | |
let start = 1; | |
let end = r + 1; | |
let pivot = Math.round((end - start) / 2); | |
if (pivot === 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
structure Pascal = | |
struct | |
local | |
fun nextrow row = | |
let | |
val (ns, _) = | |
foldl | |
(fn (x, (acc, prev)) => ((prev + x) :: acc, x)) | |
([], 0) | |
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
package main | |
import ( | |
"sort" | |
) | |
func partition(xs []int, left, right, pivotIndex int) int { | |
pivot := xs[pivotIndex] | |
partitionIndex := left | |
xs[pivotIndex], xs[right] = xs[right], xs[pivotIndex] |
NewerOlder