Skip to content

Instantly share code, notes, and snippets.

View timotheecour's full-sized avatar

Timothee Cour timotheecour

View GitHub Profile
when defined case1:
## a11
## ===
##
## a12
## ---
##
## a13
## ~~~
##
1613502891.311591 log opened
1613502891.311636 cmdq_next <global>: empty
1613502891.311649 cmdq_next </dev/ttys000>: empty
1613502891.311658 cmdq_next </dev/ttys015>: empty
1613502891.311671 /dev/ttys000: redraw status
1613502891.311679 /dev/ttys000: redraw needed
1613502891.311687 status_redraw enter
1613502891.311709 format_defaults: c=/dev/ttys000
1613502891.311718 format_defaults: s=none
1613502891.311726 format_defaults: wl=none
when true:
import macros
from typetraits import distinctBase
{.experimental: "caseStmtMacros".}
type CustomCase1[T]= distinct T
template customCase1[T](a: T): CustomCase1[T] = CustomCase1[T](a)
proc `==`[T](a: CustomCase1[T], b: T): bool = a.distinctBase == b
type CustomCase2[T]= distinct T
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
when true:
# benchmark
import std/threadutils
import timn/exp/once1
import std/times
var block1: Once
initOnce(block1)
template mainAux(algo) =
## Encoding data
## -------------
##
runnableExamples:
let encoded = encode("Hello World")
assert encoded == "SGVsbG8gV29ybGQ="
## Apart from strings you can also encode lists of integers or characters:
const digitsTable* = "0001020304050607080910111213141516171819" &
"2021222324252627282930313233343536373839" &
"4041424344454647484950515253545556575859" &
"6061626364656667686970717273747576777879" &
"8081828384858687888990919293949596979899"
func digits10*(num: uint64): int {.noinline.} =
if num < 10:
result = 1
elif num < 100:
when defined case11e:
type Foo = object
f0: int
proc main=
var f = Foo(f0: 3)
var f2 = f.addr
f2[].f0 += 1
f2.f0 += 1
echo "--"
echo f
@timotheecour
timotheecour / # opencv - 2020-09-25_17-59-33.txt
Created September 25, 2020 18:06
opencv on Ubuntu 20.04.1 LTS - Homebrew build logs
Homebrew build logs for opencv on Ubuntu 20.04.1 LTS
Build date: 2020-09-25 17:59:33
@timotheecour
timotheecour / # qt - 2020-09-22_05-29-33.txt
Created September 22, 2020 06:04
qt on Ubuntu 18.04.5 LTS - Homebrew build logs
Homebrew build logs for qt on Ubuntu 18.04.5 LTS
Build date: 2020-09-22 05:29:33