Using NiGUI, open a second window from main window

2024-02-28 Thread enaaab460
Both windows are responsive, but trying to tick a counter on the second window is a bit tricky

Using NiGUI, open a second window from main window

2024-02-28 Thread enaaab460
I copied the first example , then added the code of the second window I basicly created a second window by copying the code of the first window, then added the command to show the second window in the callback

Using NiGUI, open a second window from main window

2024-02-28 Thread enaaab460
However the second window is not interactive because it is not multithreaded. I am still figuring it out :)

sending to a channel before opening it doesn't create an error

2024-02-27 Thread enaaab460
Or is that impossible to check at compile time?

sending to a channel before opening it doesn't create an error

2024-02-27 Thread enaaab460
I have mistakenly, multiple times, sent items to a channel after initialising it but before opening it. The compiler never complained. After the program compiles and runs, it gets a SIGSEGV which I then discover my mistake. It would be very helpful it the compiler produced an error (like the typ

single line ref seq[int] assignment

2024-02-26 Thread enaaab460
var var1 = @[1,2,3] var2 = var1.addr --- the rest of the code--- Run I understand that this also works. Maybe too much time has been wasted on a minor inconvenience. But it is great that there are many ways to achieve the same thing Thanks for the help!

single line ref seq[int] assignment

2024-02-26 Thread enaaab460
I forget the brackets, my bad. I understand that sequences are heap-allocated. I wanted to have several variables point to the same sequence, so this is how I set it up. var var1 = new seq[int] var2 = var1 var1[] = @[1,2,3] var2[][1] = 2 Run

single line ref seq[int] assignment

2024-02-25 Thread enaaab460
I will preface this by admitting that it is only a minor inconvenience. However The official manual demonstrates creating a pointer variable and assigning a value to it (in var a3 line). type Student = object

pointer repr

2024-02-24 Thread enaaab460
In the official systems manual, and other tutorials online, pointer.repr prints the memory address of the pointer and the value it points to. This is a direct copy from var buf: seq[char] = @['a','b','c'] p = buf[1].addr

static checking of strings

2024-02-23 Thread enaaab460
I think this is what I was looking for I take it that it's not available now. Does RFC mean it's just a suggestion, or is it in planning / experimental ?

static checking of strings

2024-02-23 Thread enaaab460
Thanks for the reply I was trying to check for the rules at compile time (experimenting with type safety and such). While I understand that this method will work, it is not at compile time.

static checking of strings

2024-02-23 Thread enaaab460
I am experimenting with using concepts I am trying to enforce compile time checking of ipv6 import std/[setutils,strutils] type V4 = array[4,int] hexnode = concept a a is string a.len == 4 a.toSet < HexDigits V6 = array[8,hexnode]

static checking of strings

2024-02-23 Thread enaaab460
Ideally I would like for V4 and V6 to be strings with dots/colons but i figured getting the arrays to work is the first step towards that.

static checking of strings

2024-02-23 Thread enaaab460
as it stands, only `a is string` compiles when i uncomment the other rules I get a type mismatch error in hexno and loopback assignments

Trying multiple compilation settings in parallel

2024-01-20 Thread enaaab460
Thanks!

Trying multiple compilation settings in parallel

2024-01-20 Thread enaaab460
Thanks! It works now Even 2 threads in parallel affects the benchmark results a bit. * windows' antimalware service executable eats up more than 50% cpu utilisation in the parallel mode, so had to turn off windows defender This experiment was not very fruitful

Trying multiple compilation settings in parallel

2024-01-19 Thread enaaab460
import std/[osproc,os],strformat,strutils,times,algorithm,threadpool #,sequtils let starttime = cpuTime() type paramOpt = tuple[name,cmd: string] #Get all possible combinations of compilation parameters proc getpossibleCombos: seq[paramOpt]= const allparameters:seq[paramOpt]= @[("danger","-

Trying multiple compilation settings in parallel

2024-01-19 Thread enaaab460
Tried styling with codeblocks, all newlines were lost The headings are comments :D

Trying multiple compilation settings in parallel

2024-01-19 Thread enaaab460
Following my post a few days ago asking about which compilation settings to use for fastest throughput. I created a script that compiles the same file with different settings then uses hyperfine to check its performance. The first version (without parallelism) works just fine but is slow for tes

orc mm slower than markandsweep in my experience

2024-01-18 Thread enaaab460
Update 3: I make a script to automate the benchmarking to some degree, using hyperfine .nim import std/[osproc,os],strformat,strutils,times,algorithm let starttime = cpuTime() type paramOpt = tuple[name,cmd: string] let allparameters:seq[paramOpt]= @[("danger","-d:da

orc mm slower than markandsweep in my experience

2024-01-17 Thread enaaab460
Thanks! I appreciate the writeup. I was mainly trying to find a one size fits all compile command, but things seem far too complicated than what I thought. I am new to NIM (and golang, and intermediate at python), and it was faster than golang (fibonacci took 58 seconds at go, and I'm not foolis

orc mm slower than markandsweep in my experience

2024-01-17 Thread enaaab460
Thanks

orc mm slower than markandsweep in my experience

2024-01-17 Thread enaaab460
Thanks!

orc mm slower than markandsweep in my experience

2024-01-17 Thread enaaab460
Update 2: recompiled the older script with clang for both mm, now they are neck and neck nim\aoc23\day02> hyperfine day2orc.exe day2markandsweep.exe --warmup 10 Benchmark 1: day2orc.exe Time (mean ± σ): 237.1 ms ± 1.5 ms[User: 220.8 ms, System: 19.0 ms] Ran

orc mm slower than markandsweep in my experience

2024-01-17 Thread enaaab460
Update: Tried benchmarking an older version of advent of code script, which parses the input in one go, then loops through the parsed sequences once for the first solution, then again for the second solution import strutils,std/strformat,tables type ball = tuple[number: int

orc mm slower than markandsweep in my experience

2024-01-16 Thread enaaab460
I will preface this by saying I just picked up nim 2.0.2 this week, coming from python and golang. I started experimenting with the nim.cfg setting to find the settings that get the fastest perfomance. This is how it looks now cc = gcc passC = "-flto -march=native -O4" passL