This file contains hidden or 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 | |
Vehicle* = ref object of RootRef | |
color*: string | |
type | |
Car* = ref object of Vehicle | |
make*: string | |
# This method ... is never called, it seems | |
# that system.`==` is preferred, why? |
This file contains hidden or 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 a = [1,2,3,4,5,6] | |
iterator twopow[T](a: openarray[T]): T = | |
var i = 1 | |
while i <= a.high: | |
yield a[i-1] | |
i = i * 2 | |
for x in twopow(a): echo x |
This file contains hidden or 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
/* Generated by Nim Compiler v0.13.1 */ | |
/* (c) 2015 Andreas Rumpf */ | |
/* The generated code is subject to the original license. */ | |
#define NIM_INTBITS 32 | |
#include "nimbase.h" | |
#include "wiring_digital.h" | |
#include "wiring.h" | |
N_NIMCALL(void, setup)(void); | |
N_NIMCALL(void, loop)(void); |
This file contains hidden or 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
The language constructs are explained using an extended BNF, in which (a)* means 0 or more a's, | |
a+ means 1 or more a's, and (a)? means an optional a. Parentheses may be used to group elements. | |
{} are used to describe character sets. Stuff I can't figure out is described inside {{ }}. | |
# Ints are parsed using Nim parseInt, floats using parseFloat and strings using unescape | |
int = ['+' | '-'] digit (['_'] digit)* | |
exponent = ('e' | 'E' ) ['+' | '-'] digit ( ['_'] digit )* | |
float = ['+' | '-'] digit (['_'] digit)* (('.' (['_'] digit)* [exponent]) | exponent) | |
# Inside the string we replace any \\ by \, any \' by ', any \" by " and any |
This file contains hidden or 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/gokr/nim/test/a.nim(1, 8) Error: cannot open 'c' | |
import c | |
^ | |
Traceback (most recent call last) | |
nim.nim(115) nim | |
nim.nim(71) handleCmdLine | |
main.nim(253) mainCommand | |
main.nim(64) commandCompileToC | |
modules.nim(227) compileProject | |
modules.nim(172) compileModule |
This file contains hidden or 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
Howto: | |
https://github.com/ttn-zh/ic880a-gateway/wiki | |
Get Raspbian Lite: | |
https://www.raspberrypi.org/downloads/raspbian/ | |
Writing image to sdcard: |
This file contains hidden or 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 osproc, threadpool | |
setMinPoolSize(200) | |
setMaxPoolSize(200) | |
proc perform() = | |
echo "Starting" | |
discard execCmdEx("sleep 25") | |
echo "Done " |
This file contains hidden or 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 httpclient, marshal, json | |
type | |
User* = ref object | |
login*: string | |
id*: int | |
avatar_url*: string | |
gravatar_id*: string | |
url*: string | |
html_url*: string |
This file contains hidden or 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
2018-01-24 00:01:18 =CRASH REPORT==== | |
crasher: | |
initial call: tls_connection:init/1 | |
pid: <0.413.0> | |
registered_name: [] | |
exception error: bad argument: [{erlang,binary_to_list,[undefined],[]},{ssl_config,file_error,2,[{file,"ssl_config.erl"},{line,137}]},{ssl_config,init,2,[{file,"ssl_config.erl"},{line,36}]},{ssl_connection,ssl_config,3,[{file,"ssl_connection.erl"},{line,334}]},{tls_connection,init,1,[{file,"tls_connection.erl"},{line,186}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}] | |
ancestors: [tls_connection_sup,ssl_connection_sup,ssl_sup,<0.165.0>] | |
messages: [{'$gen_call',{<0.371.0>,#Ref<0.0.2.660>},{new_user,<0.368.0>}}] | |
links: [<0.171.0>,#Port<0.9115>] | |
dictionary: [{ssl_pem_cache,ssl_pem_cache},{ssl_manager,ssl_manager}] |
This file contains hidden or 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 Harness extends TestHarness<TransformerChannel> with TestHarnessAuthMixin<TransformerChannel>, TestHarnessORMMixin { | |
@override | |
ManagedContext get context => channel.context; | |
@override | |
AuthServer get authServer => channel.authServer; | |
Agent publicAgent; | |
Agent adminAgent; |
OlderNewer