question on use GUIPlus on windows 10 64bits

2022-09-16 Thread oyster
[fileformats] 109,812 [fontformats] 85,772 [simd] 72,042 blends.nim 11,025 common.nim 2,987 contexts.nim26,903 fonts.nim 23,257 images.nim 26,271 internal.nim

important_packages

2022-09-16 Thread Hlaaftana
If a package is "important" it should be compatible both with the next Nim version and the current one. If it's not getting updated then a fork of it with fixes should be tested. A package being important doesn't mean it has to be the best package either, as long as it's commonly used I think it

How to get cursor position?

2022-09-16 Thread oyster
if there is no such function, you can use variant to record the value

How to get cursor position?

2022-09-16 Thread morturo
We have a way to set the cursor position ([setCursorPos](https://nim-lang.org/docs/terminal.html#setCursorPos%2CFile%2Cint%2Cint)), but no way to get the cursor position.

re or nre. What should i use? What will be supported in future?

2022-09-16 Thread pg13
I find nre to be more reliable, as the following code block suggests. import re,nre let re1 = re.re"dd" re2 = nre.re"dd" echo re.match("ugknbfddgicrmopn",re1) echo nre.contains("ugknbfddgicrmopn",re2) false true Run Of course, could be I

collecting keys and randomly picking values from tables

2022-09-16 Thread cblake
You can also sample many values with Yardanico's 2nd idea with no unneeded `string` allocations if you build a `sets.HashSet[int]` or `intsets.IntSet` or even `set` if `Table.len < 65536`. Call it `nums`. All allow a fast-ish `i in nums` test. That is for sampling without replacement. For sampl

important_packages

2022-09-16 Thread juancarlospaco
This is not directly about code or any concrete technical-only reason to create an RFC (?). I think that the important_packages idea is good, but every time the evolution of the compiler may break or flaky some package test, like when a symbol is deprecated or removed, the core devs should NOT

important_packages

2022-09-16 Thread Yardanico
As far as I know important_packages was created _[specifically](https://forum.nim-lang.org/postActivity.xml#specifically) so that popular or big enough Nim libraries/packages are tested, so that library/compiler developers won't have to spend a lot of time chasing down bugs after releasing a st

collecting keys and randomly picking values from tables

2022-09-16 Thread tcheran
actually I like let keys = toSeq(myTable.keys) Run even more, I was writing my reply before seeing your solution

collecting keys and randomly picking values from tables

2022-09-16 Thread Yardanico
Yeah this works too, it's the same as using `toSeq`, just a more "explicit" way of doing it.

collecting keys and randomly picking values from tables

2022-09-16 Thread tcheran
what about collect (you need to import sugar) and iteration? import std/tables, sugar var a = { 'y': 1, 'm': 2, 'c': 3, 'a': 4, }.toOrderedTable let keyseq = collect(newSeq): for key in a.keys: key assert keyseq == @['y'

collecting keys and randomly picking values from tables

2022-09-16 Thread Yardanico
There's no stdlib proc that does this "directly", but you can of course always compose different things together :) One simple way to do what you want is: import std/[tables, sequtils, random] # initialize the random seed so we get different results each time randomize(

Where to start with creating direct Qt bindings?

2022-09-16 Thread grd
Sorry to be late at the party but I think that it is possible to make Qt work with Nim. Just have a look at how a Go binding to Qt was created. They just compiled Qt to a library and they created pseudo code to "

collecting keys and randomly picking values from tables

2022-09-16 Thread archnim
Hello world ! What is the most direct way to assemble all the keys of a table in a seq ? I mean, is there a proc in the std lib that does it ? Concerning the proc `sample` in the random module, it doesn't apply to a table. Is there a proc elsewhere that does ?

Problem with strformat and templates

2022-09-16 Thread enthus1ast
These days I actually use nimja also as a strformat replacement.

question on use GUIPlus on windows 10 64bits

2022-09-16 Thread oyster
I think it could be better if pixie only focuses on other functions but uses external jpg/png/other loading/saving lib.

Problem with strformat and templates

2022-09-16 Thread firq
Ok, will do. After doing some further testing I discovered that you can at least work around this issue by using a temporary variable: import strformat template myTemplate(s: string) = let s2 = s echo s2 echo s2 proc main() = myTemplate fmt"

How would i safely turn a image from a url to a uri.

2022-09-16 Thread Nlits
Thanks! That helped!

Problem with strformat and templates

2022-09-16 Thread mratsim
Seems like a Nim codegen bug, report on the bug tracker.

How would i safely turn a image from a url to a uri.

2022-09-16 Thread Nlits
Well, i get this: Run And it does not render The code is an xml node, that is what the node_attrs was.

How would i safely turn a image from a url to a uri.

2022-09-16 Thread geotre
Your data is not a valid png file

How would i safely turn a image from a url to a uri.

2022-09-16 Thread geotre
It looks like you are base64 encoding the png before turning it into a dataUri - that's what's breaking it. Check the code I put above, you don't need to encode it first

question on use GUIPlus on windows 10 64bits

2022-09-16 Thread oyster
I read something in like var width1, height1, width2, height2: int32 Run then if GdipGetImageWidth(gdipbmp1, cast[ptr UINT](&width1)) != Ok: return false Run could

Show Nim: New Pixie 5.0 release with significant performance improvements

2022-09-16 Thread markus_gritsch
Pixie is great. I played around with it using pixie-python to create some [Truchet tiles](https://en.wikipedia.org/wiki/Truchet_tiles). .. image:: .. image::

question on use GUIPlus on windows 10 64bits

2022-09-16 Thread oyster
so bad, I met the similar problem stated in I think it is better for me not to use in real project at least for now, but take a glimpse from time to time.

Problem with strformat and templates

2022-09-16 Thread firq
Hey guys. I've encountered a problem when using `strformat` which I can't figure out. If I have a template that accepts a string and I use that string twice in the template body, I get a C compiler error, but only if the string is generated using the `fmt""` macro. Here's a minimal example:

Running several processes asynchronously?

2022-09-16 Thread cblake
Threads are basically processes with unsafe defaults on Plan9/Linux. On Unix only right now, there is also or for parallel commands, if you like. @Vindaar seems to be a conte

How would i safely turn a image from a url to a uri.

2022-09-16 Thread geotre
I'd recommend posting an easily reproducible example and a clear description of what's happening (i.e. don't just say something doesn't work), it'll make it easier for people to help you quickly. This seems to work fine: import std/[httpclient, uri, mimetypes, strformat] l

Running several processes asynchronously?

2022-09-16 Thread Zoom
I tried to hack something light with the same purpose a few month ago and just had to give up async. A few thing don't work on Windows, some things have been [know to be](https://github.com/nim-lang/Nim/issues/9616) [just buggy](https://github.com/nim-lang/Nim/issues/5091) on Linux too for a lon

Running several processes asynchronously?

2022-09-16 Thread mratsim
I don't think it's a bug in asynctools but either in bug in asyncdispatch.addProcess or an OS limitation: In my quest to replace GNU parallel that was extremely annoying in CI, I wrote a parallel shell command runner and needed to not start more processes than CPU cores. And automatically sched