Virus scanner problems after installing Nim 1.4

2020-10-21 Thread wiltzutm
Yeah I will. They've just been kinda passive regarding my other sample files sent. In this case without access to non-administered windows pc/laptop I need to somehow compile a windows binary without windows and test, does the virus scanner catch the false positive. Eg.this might take a while! :

Virus scanner problems after installing Nim 1.4

2020-10-21 Thread Araq
Please contact F-secure about this. You can stick with 1.2.6 (and 1.2.8 is just around the corner) for the time being until F-secure sorted it out.

Convert Time to Duration

2020-10-21 Thread xigoi
There are functions `toUnix` and `toUnixFloat`. Both return Unix time in seconds, the latter as a float with sub-second resolution.

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread jackhftang
umm... okay, the undeclared tables is solved, but then `Warning: Deprecated since 1.4.0; rightSize is deprecated` appear again in 1.4.0

What Nim projects are you working on?

2020-10-21 Thread Yardanico
Well, I have NGINX on my VPS setup for forum.my-toolbox.xyz, and cloudflare connected to the same domain, so I just started the binary via `screen` (so I can log out and it still runs). NGINX maps cloudflare requests to localhost:5000 on the VPS where it runs.

What Nim projects are you working on?

2020-10-21 Thread ElegantBeef
Thanks, it works, but not everything works at the moment. Some types like anonymous tuples cannot interop at the moment, aside from that though I think it's very usable. It also sadly uses json for interoping between the languages, but it's mostly a non issue since you are probably never going t

What Nim projects are you working on?

2020-10-21 Thread Niminem
How did you go about deploying that live?

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread Yardanico
Well, your issue is really simple - you forgot to bind rightSize in the template :) Don't forget that templates are simple code substitution, with this template it works: template rightSize(cap): untyped {.dirty.} = when (NimMajor,NimMinor)<(1,4): bind rightSize

Writing binary data to SQLite

2020-10-21 Thread leorize
We can always extend db_sqlite :p There's ndb which is db_sqlite but with prepared statements: And @Araq's ormin is pretty cool too:

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread jackhftang
Did you import from another file? I tested on three machines with the following settings, all showing `undeclared identifier: 'tables'`. Here the codes, two files or clone `git clone https://github.com/jackhftang/lrucache.nim.git -b minimal_rightsize_test` # lrucache.nim import

What Nim projects are you working on?

2020-10-21 Thread Niminem
Dude this is badass. Funny enough I planned on diving into Nimscript this weekend because I've never used it before. I'll definitely be in touch on this one :)

What Nim projects are you working on?

2020-10-21 Thread sekao
Most recently, a library for making MIDI music:

What Nim projects are you working on?

2020-10-21 Thread Yardanico
Just made a small test version of static HTML-serving nimforum (just for viewing) in under 200 LOC (for now) - you can access it on / (yes I used nimforum's CSS :D) Source is on Authors are "pla

What Nim projects are you working on?

2020-10-21 Thread ElegantBeef
I am currently working on removing the boilerplatey nature of using the NimVM, so you can easily annotate procs and have them accessible for Nimscript. Which then can be used for realtime gameplay scripting, customization of programs/features, or whatever one would want. :D [Video of usage](htt

Convert Time to Duration

2020-10-21 Thread shirleyquirk
To get elapsed nanoseconds since the epoch you can import times proc epochNanos(t:Time):int64= t.toUnix*1_000_000_000 + t.nanosecond echo getTime().epochNanos Run

What Nim projects are you working on?

2020-10-21 Thread Niminem
What are you all working on right now with Nim??? Shameless plugs to your GitHub are welcome :)

Convert Time to Duration

2020-10-21 Thread wilypomegranate
Okay seems like I should not do that then:)

Convert Time to Duration

2020-10-21 Thread wilypomegranate
So the case I'm interested in, is I have a Time(or DateTime) type and want to get what it's epoch nanosecond representation as an integer. Seemed like converting to a duration and doing inNanoseconds on it was the easiest way.

Writing binary data to SQLite

2020-10-21 Thread sky_khan
Prepared queries can be many times faster depending on use case. So, I think they should have been part of stdlib but I guess its too late for v1. Here is what I meant by "diving into sqlite3.nim" import sqlite3, db_sqlite, strutils, strformat let dbname = ":memory:" le

More readable C name-mangling?

2020-10-21 Thread disruptek
This PR is in a state where it will benefit from testing and feedback regarding the output. This is an invasive change, so I don't expect it to be merged without more testing than what the compiler suite can supply. The output is not quite what I had

Nim - plugin for IntelliJ IDEs | JetBrains

2020-10-21 Thread Yardanico
For anyone wondering - the developer is actively working on the plugin (e.g. he fixed the issue with discard that I reported in less than a day). It has no real autocompletion or go to definition right now, but you can add it yourself! You can install

[Docker Image] GCC /bin/sh:: file not found

2020-10-21 Thread leorize
You may want to open a bug report at the docker image upstream repository: .

Is there any PWA (Progressive Web Apps) framework or package written in nim?

2020-10-21 Thread mrhdias
Is possible write the service worker file of pwa in nim and compile to js?

Virus scanner problems after installing Nim 1.4

2020-10-21 Thread wiltzutm
Hello, I'm having difficulties with my administered Windows 10 laptop's virus scanner (F-secure Client Security Premium) and the latest nim release 1.4. My previous nim version was 1.2.6. So all was good with Nim 1.2.6, but after updating I began to get weird heuristics false alarms (HEUR/APC)

Problem with orc/arc in parallel_count practice

2020-10-21 Thread salvador
tnx a lot `nim c -d:release -d:useMalloc --gc:arc --threads:on fun_threads_parallel.nim` and `nim c -d:release -d:useMalloc --gc:orc --threads:on fun_threads_parallel.nim` gave me same performance like previous GC (without `--gc` flag) BTW, with `orc` the Error/Warnning remains: `SIGSEGV: Ille

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread shirleyquirk
If "tables" isn't a defined as an identifier, you have more problems than just the deprecation 😂 Works for me on 0.16.0, 0.20.0, 1.0.0, 1.0.10, 1.2.0, 1.2.4,1.2.6, 1.2.8, 1.4.0, and 1.5.1

Writing binary data to SQLite

2020-10-21 Thread Clonk
So I've done more tests. With preparedStatement you can actually insert binary data but I haven't been able to retrieve it (same issue of cstring data getting truncated on select when using either getValue or getRow). tiny_sqlite is able to do this with the minor issue that you have store your

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread jackhftang
ummm.. turn out that this cannot solving the problem completely... tried a number of variants template rightSize(cap): untyped {.dirty.} = # not work in 1.2.6 as declare(table.rightSize) is false when declared(tables.rightSize) and (NimMajor,NimMinor) < (1,4): tab

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread jackhftang
thanks

Is there any PWA (Progressive Web Apps) framework or package written in nim?

2020-10-21 Thread juancarlospaco
The `manifest.json` thingy is actually really old, but it seems it never catch on until someone renamed it with the hipster name of Progressive Web Apps. 🤷

Is there any PWA (Progressive Web Apps) framework or package written in nim?

2020-10-21 Thread mrhdias
Getting Started with Progressive Web Apps:

[Docker Image] GCC /bin/sh:: file not found

2020-10-21 Thread Lachu
Problem is probably here: {.passC:staticExec("pkg-config --cflags mysqlclient").} But why it tries to invoke /bin/sh and there's error? I understand it does try to invoke /bin/sh, because staticExec parameter is supposed to be shell command, but why it have trouble with invoking shell?

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread shirleyquirk
template rightSize(cap): untyped {.dirty.}= when declared(tables.rightSize)and(NimMajor,NimMinor)<(1,4): tables.rightSize(cap) else: cap proc newLruCache*[K,T](capacity: int): LruCache[K,T] = ## Create a new Least-Recently-Used (LRU) cache that store

[Docker Image] GCC /bin/sh:: file not found

2020-10-21 Thread Lachu
I updated docker image today. When order my computer to do nimble build inside project's directory, gcc complains:/bin/sh:: file not found| ---|--- I do stat /bin/sh and it pointed to dash (only name of program - not full path). Dash is in /usr/bin . After removing symlink and replaces it

Naming convention when calling procs from other modules?

2020-10-21 Thread juancarlospaco
`my_utils.thisIsAProc` cant UFCS.

How to avoid deprecation notice for libraies supporting multi-version of Nim?

2020-10-21 Thread cblake
This works..(Note - `rightSize` has been around since Nim-0.10.2, but checking its actual declaration is cleanest): import tables template iniTab(capacity=2): untyped {.dirty.} = when declared(tables.rightSize)and(NimMajor,NimMinor)<(1,4): initTable[int,int](r

Problem with orc/arc in parallel_count practice

2020-10-21 Thread jrfondren
The speed'll improve with -d:useMalloc The crash might be

Naming convention when calling procs from other modules?

2020-10-21 Thread jasonfi
Would that scale in a large code base? You'd have to be sure that every proc in every module doesn't conflict.

Naming convention when calling procs from other modules?

2020-10-21 Thread xigoi
You shouldn't explicitly qualify names unless necessary. Nim's powerful proc overloading makes sure that it's rarely necessary.

Problem with orc/arc in parallel_count practice

2020-10-21 Thread salvador
hey everyone i just recompiled this practice the result was almost 5x slower with `orc` i got this warn/error : SIGSEGV: Illegal storage access. (Attempt to read from nil?) i tried `orc` / `a

Naming convention when calling procs from other modules?

2020-10-21 Thread jasonfi
I checked the style guide: and there's no mention of this. Should I call module procs with the module name like this? my_utils.thisIsAProc() Run Or make every proc name unique to call them like this? thisIsAProc()

Nim on MacOS: annoying macos cannot verify....

2020-10-21 Thread anta40
Sorry I forgot to mention that I used the nightly zip files. And I also forgot that using brew is easier.

Nim on MacOS: annoying macos cannot verify....

2020-10-21 Thread anta40
Ah thank you.

Convert Time to Duration

2020-10-21 Thread cblake
A timestamp is just a duration since an origin, like the epoch time since Jan 1, 1970. `times` lets you create one easily, though. You can just say let dur = initDuration(seconds=3600*24*10_000) Run to get a `Duration`-typed interval of 10,000 days since Jan 1, 1970.

Convert Time to Duration

2020-10-21 Thread Leaf
First of all is, what do you want? Do you want a timestamp, a duration, how a cast work, the 'let' statement, something with time or all together? Have a look at here: (To create a new Duration, use initDuration proc.) proc initDuration