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
import fenv | |
import macros | |
import sequtils | |
import strformat | |
# afaik we need this to get the types. I can't think of another way. | |
{.experimental: "dynamicBindSym".} | |
type | |
Vec*[N: static[int]] = array[N, float32] |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1"> | |
<label t="translate(16,346)"> |
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 pageRoot = document.querySelector(".Page"); | |
var floatingHeader = document.querySelector(".floating-group"); | |
var groupRoot = document.querySelector(".Group"); | |
var subHeader = document.querySelector(".Group>.bubble-r-line"); | |
var getVideoData = function(start, len) { | |
var headers = new Headers(); | |
headers.append("content-type", "application/json"); | |
var data = { | |
"app_version": "live", |
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 timezones = [ | |
"Africa/Abidjan", | |
"Africa/Accra", | |
"Africa/Algiers", | |
"Africa/Bissau", | |
"Africa/Cairo", | |
"Africa/Casablanca", | |
"Africa/Ceuta", | |
"Africa/El_Aaiun", | |
"Africa/Johannesburg", |
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
import templates | |
let myThing = someProcThatReturnsOption() | |
printFileBool(myThing, "string") # calls the template | |
# this essentially expands to: | |
# it's a fancy copy / paste, but creates a new scope. This is what is known in the lisp world as "hygenic". | |
# A template will not import other things into your module automatigically. | |
block: | |
if not myThing.isNone: # it's just a copy / paste. Nim will not automagically "import Option" for you. |
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
C:\Users\ray\Downloads>wglinfo64.exe | |
[WGL] WGL extensions: | |
WGL_EXT_depth_float, WGL_ARB_buffer_region, WGL_ARB_extensions_string, | |
WGL_ARB_make_current_read, WGL_ARB_pixel_format, WGL_ARB_pbuffer, | |
WGL_EXT_extensions_string, WGL_EXT_swap_control, WGL_EXT_swap_control_tear, | |
WGL_ARB_multisample, WGL_ARB_pixel_format_float, WGL_ARB_framebuffer_sRGB, | |
WGL_ARB_create_context, WGL_ARB_create_context_profile, | |
WGL_EXT_pixel_format_packed_float, WGL_EXT_create_context_es_profile, | |
WGL_EXT_create_context_es2_profile, WGL_NV_DX_interop, | |
WGL_ARB_create_context_robustness. |
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
type | |
BBTree*[K,V] = ref object of RootObj # BBTree is a generic type with keys and values of types K, V | |
## `BBTree` is an opaque immutable type. | |
BBLeaf[K,V] = ref object of BBTree | |
key: K # the search key; must support the generic ``cmp`` proc | |
val: V # the data value associated with the key, and stored in a node | |
BBNode2[K,V] = ref object of BBLeaf | |
left: BBTree[K,V] # left subtree; may be nil | |
right: BBTree[K,V] # right subtree; may be nil | |
size: int # the size of the (sub-)tree rooted in this node |
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
#define LED 2 //Define blinking LED pin | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(LED, OUTPUT); // Initialize the LED pin as an output | |
} | |
void loop() { | |
digitalWrite(LED, LOW); // Turn the LED on (Note that LOW is the voltage level) | |
delay(1000); // Wait for a second |
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
hugefile.txt | |
myreader | |
fgetsreader | |
builtinreader | |
hugebin.txt | |
hugestr.txt |
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 sqlList(name: untyped, statements: openArray[string]):untyped = | |
proc `name` (db:string) = | |
echo "Inside proc" | |
for statement in statements: | |
echo "statement: ", statement | |
sqlList(genProc, ["a", "b", "c"]) | |
genProc("db") |
NewerOlder