<< 11-05-2023 >>

00:09:53*krux02 quit (Remote host closed the connection)
01:12:26*nanxiao joined #nim
01:24:01*xet7 quit (Ping timeout: 240 seconds)
01:31:41*derpydoo joined #nim
01:37:11*xet7 joined #nim
01:51:40NimEventerNew Nimble package! gitman - Cross-platform git repository manager., see https://github.com/nirokay/gitman
02:07:22FromDiscord<gogolxdong> https://github.com/IBM/Dromedary
02:34:44FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4vCB
02:36:08FromDiscord<Elegantbeef> Technically you can do `table[newKey] = move table[key]` and there would be no copying
02:36:16FromDiscord<Elegantbeef> Atleast on Orc/Arc
02:36:44FromDiscord<Elegantbeef> Turning an `O(1)` operation into `O(n)` is an odd way to worry about performance
02:37:03FromDiscord<Patitotective> im compiling to js, i dont think its orc7arc
02:37:05FromDiscord<Patitotective> (edit) "orc7arc" => "orc/arc"
02:37:13FromDiscord<Elegantbeef> Right then there is no copy anyway afaik
02:37:32FromDiscord<Patitotective> In reply to @Elegantbeef "Turning an `O(1)` operation": i thought std/tables also iterated through :p
02:37:37FromDiscord<Patitotective> In reply to @Elegantbeef "Right then there is": thats nice, thanks
02:37:42FromDiscord<Elegantbeef> I could be wrong
02:38:02FromDiscord<Elegantbeef> The entire point of a hash table is that it's a constant look up
02:38:16FromDiscord<Elegantbeef> Like that's the sole reason to use it over a `seq[(K, V)]`
02:42:20*nanxiao quit (Quit: Client closed)
02:52:13FromDiscord<jtv> Yeah, if you want to add and remove a key, you should just do that. Your intuition on what is going to be more efficient is often going to be wrong anyway.
02:56:31FromDiscord<Patitotective> sent a code paste, see https://paste.rs/NlS
02:58:18FromDiscord<huantian> I think the issue here is that `var string isnot var`
02:59:08FromDiscord<huantian> so in this case you'd have to do `when x is var string`
02:59:32FromDiscord<huantian> which is weird, I thought `var` is a type class for all `var`s
02:59:46FromDiscord<Patitotective> you were right :]]
02:59:48FromDiscord<Patitotective> thanks
03:01:34FromDiscord<huantian> `var string is string` and `var string is var string`, but why `var string isnot var`
03:03:40FromDiscord<huantian> https://github.com/nim-lang/Nim/issues/9443
03:03:40FromDiscord<huantian> ah
03:05:59FromDiscord<huantian> this should really be mentioned in the docs for typeclasses
03:06:09*nanxiao joined #nim
03:11:35*derpydoo quit (Ping timeout: 264 seconds)
03:16:35FromDiscord<ElegantBeef> Damn bridge
03:16:50FromDiscord<ElegantBeef> Using a generic for overloading is cursed 😄
03:16:59FromDiscord<Elegantbeef> I love when people use generics instead of just overloading
03:16:59FromDiscord<Elegantbeef> It really just makes me question my sanity
03:17:00FromDiscord<ElegantBeef> You can do it but you're just implementing overloading yourself
03:17:29FromDiscord<ElegantBeef> If you really must you can do `when compiles(x = "")`
03:49:52FromDiscord<JJ> [@federico3](https://matrix.to/#/%40federico.ceratto%3Amatrix.org) nimble.directory appears to be misconfigured on raw http\: http://nimble.directory/
03:55:18*rockcavera quit (Remote host closed the connection)
03:55:46*rockcavera joined #nim
04:00:42*nanxiao quit (Quit: Client closed)
04:48:17*rockcavera quit (Remote host closed the connection)
04:54:32*azimut quit (Ping timeout: 240 seconds)
05:14:32FromDiscord<JeanCareau> How can I get the href attribute using nimquery?
05:24:45FromDiscord<Elegantbeef> What have you tried
05:26:32FromDiscord<Elegantbeef> https://github.com/GULPF/nimquery#unsupported-selectors there's even a link that answers your question
05:31:57NimEventerNew Nimble package! safeseq - Seq that can safely add and remove elements while iterating., see https://github.com/avahe-kellenberger/safeseq
05:45:53*advesperacit joined #nim
05:47:40*junaid_ joined #nim
05:56:43NimEventerNew thread by dPixie: Can't import compiler/* anymore, see https://forum.nim-lang.org/t/10191
06:00:39*junaid_ quit (Remote host closed the connection)
06:14:48NimEventerNew thread by teroz: Are any of you as excited about the Zed editer, see https://forum.nim-lang.org/t/10192
06:17:35FromDiscord<huantian> well it only supports macos sooooooo
06:17:52FromDiscord<Elegantbeef> Plus it's closed source
06:21:03FromDiscord<Rika> kinda weird to place an ad in the forums
06:34:06*nanxiao joined #nim
06:39:29*lucas_ta joined #nim
06:40:17*lucasta quit (Read error: Connection reset by peer)
06:45:18*PMunch joined #nim
06:45:33FromDiscord<JeanCareau> sent a long message, see https://paste.rs/yY0
06:48:17FromDiscord<Elegantbeef> There is no selector for a value so it'd be using `[href]`
07:13:55FromDiscord<JeanCareau> @ElegantBeef Like this?: `let href = element["href"]` Gives me: Error: type mismatch: got <XmlNode, string>
07:14:05FromDiscord<Elegantbeef> That's not what i meant
07:14:16FromDiscord<JeanCareau> Oh
07:14:33FromDiscord<Elegantbeef> Using nimquery you'd do `xml.querySelectorAll([href])`
07:14:50FromDiscord<Elegantbeef> well `"[href]"` i guess
07:15:00FromDiscord<Elegantbeef> That'll yield all XML nodes with href
07:21:09FromDiscord<JeanCareau> @ElegantBeef yes, but it is not possible to get the attribute value? For example: `<a href="test.com">asdf</a> ` I want to get "test.com". When using your method I get `<a href="test.com">asdf</a>`
07:23:26FromDiscord<Elegantbeef> There is no css selectore for values
07:31:15FromDiscord<JeanCareau> Ok, thanks. Do you know a nim module where I can use xpaths? I am looking for something like parsel (python). I could import parsel into Nim, but preferably want to only use 100% Nim. Should I use std/xmlparser?
07:31:59FromDiscord<Elegantbeef> No clue i do not use xml
07:32:17FromDiscord<Elegantbeef> When I do parse html occasionally i use the stdlib as it's fine
07:37:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4vDd
07:37:12FromDiscord<Elegantbeef> with `import std/[xmltree, strtabs, parsehtml, ....]`
07:49:55FromDiscord<JeanCareau> sent a long message, see http://ix.io/4vDh
07:50:48*m5zs7k quit (Ping timeout: 240 seconds)
07:55:14FromDiscord<JeanCareau> One thing is, it echos out a few URLs and then I get the error: `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` How can I prevent that? I thought by checking with hasKey this error should not occur?
07:55:27*m5zs7k joined #nim
07:55:45FromDiscord<Elegantbeef> `if a.attrs != nil` perhaps
07:56:19FromDiscord<Elegantbeef> The parser doesnt allocate for empty attribute XML nodes
07:56:28FromDiscord<Saint> Is there falsy eval in nim?
07:56:47FromDiscord<Elegantbeef> Yes `false` is false and `true` is true 😛
07:56:52FromDiscord<Saint> Haha
07:56:55FromDiscord<Elegantbeef> Jokes aside, no
07:57:00FromDiscord<Saint> Gotcha thanks!
07:57:13FromDiscord<Saint> Not even for 1 and 0?
07:57:20FromDiscord<Elegantbeef> Of course not
07:57:25FromDiscord<Elegantbeef> Those are numbers not true/false
07:57:29FromDiscord<JeanCareau> @ElegantBeef Thanks now the error does not occur
07:57:29FromDiscord<Saint> cool
07:57:43FromDiscord<Elegantbeef> you can write converters if you're of that disposition
07:59:13*nanxiao quit (Quit: Client closed)
08:13:43*nanxiao joined #nim
08:33:48FromDiscord<Saint> Gotcha thanks, I’ll look into those!
08:40:05*lucas_ta quit (Read error: Connection reset by peer)
08:40:25*lucas_ta joined #nim
08:40:28*lucas_ta quit (Client Quit)
08:48:51*antranigv_ joined #nim
08:49:48*antranigv quit (Ping timeout: 240 seconds)
08:51:27*Notxor joined #nim
08:52:47*antranigv_ quit (Client Quit)
08:56:37*antranigv joined #nim
09:19:14*undeadscholar joined #nim
09:42:10*nanxiao quit (Quit: Client closed)
09:57:37*tinystoat quit (Remote host closed the connection)
09:57:45*tinystoat joined #nim
10:05:43FromDiscord<Rika> Truthiness is a C concept if I’m not mistaken
10:07:20*pharonix71 quit (Ping timeout: 240 seconds)
10:09:47*pharonix71 joined #nim
10:31:19*undeadscholar quit (Remote host closed the connection)
10:34:37FromDiscord<RandomVisitor> In reply to @Elegantbeef "you can write converters": I should look into those. got bitten by windows api BOOL being an int, not an actual boolean value with winim. If blah() == false / true: needs to be == 0 / != 0 etc. Confused me for a while, because api call worked, and everything else..
10:35:51FromDiscord<RandomVisitor> though probably better to just stick with checking numbers. I'd probably fall into that pit again if I reverted and missed an import etc
11:23:51*azimut joined #nim
11:43:56*anon joined #nim
11:46:03*anon quit (Remote host closed the connection)
11:53:56*jmdaemon quit (Ping timeout: 246 seconds)
12:09:29*azimut_ joined #nim
12:10:23*azimut quit (Remote host closed the connection)
12:16:35*Nermal joined #nim
12:27:03*fredrikhr quit (Quit: Disconnecting...)
12:29:01FromDiscord<demotomohiro> Before C99, C lang didn't have bool type. If statement assumes 0 int value as false and non-zero value as true.↵So C libraries defined their own bool types like `typedef int BOOL;`.
12:29:38NermalNermal gets his booty penetrated and dilated by Garfield, The Ender Dragon, Steve and a Creeper in Minecraft! The Creeper's hot semen permeated Nermel's fur! https://justpaste.it/Garfield_Sex_Nermal_Minecraft
12:38:11*Nermal quit (K-Lined)
13:11:02FromDiscord<Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4vEk
13:11:05FromDiscord<Nlits (Ping on reply)> is it some kind of cast?
13:13:43FromDiscord<Rika> same as `var me = MouseEvent(ev)
13:13:43FromDiscord<Rika> (edit) "MouseEvent(ev)" => "MouseEvent(ev)`"
13:16:36FromDiscord<Nlits (Ping on reply)> ok
13:31:23*Notxor quit (Remote host closed the connection)
13:37:05*progranner joined #nim
13:38:11FromDiscord<Require Support> github be dying today or just me?
13:41:43PMunchHaven't used it a lot today, but the little I've done seems to have worked fine
13:41:48*beholders_eye joined #nim
13:52:09*rockcavera joined #nim
14:03:23FromDiscord<Require Support> Is mixing async with threads a thing? or would I need to use one or the other
14:03:40FromDiscord<michaelb.eth> In reply to @Require Support "github be dying": https://www.githubstatus.com/incidents/nf7s6933tnn8
14:03:43FromDiscord<Rika> its a thing yes
14:05:00FromDiscord<Rika> in general it is recommendable not to mix them though
14:06:56*oprypin quit (Ping timeout: 246 seconds)
14:14:13PMunchRequire_Support, I've done it before, so I know it can be done
14:14:23PMunchYou've really gotta know what you're doing though
14:18:25*PMunch quit (Quit: Leaving)
14:34:10FromDiscord<auxym> In reply to @Require Support "Is mixing async with": consider https://github.com/status-im/nim-taskpools maybe? Sort of like a thread pool that offers an async-like API (flowvar is like a future, you can call sync to block until a flowvar is ready). Not true async though, any given thread will block on network io for example.
14:57:58*Notxor joined #nim
15:30:12*sagax joined #nim
15:35:09*azimut_ quit (Remote host closed the connection)
15:35:33*azimut joined #nim
15:46:35*oprypin joined #nim
16:14:18FromDiscord<Require Support> In reply to @auxym "consider https://github.com/status-im/nim-taskpools": I'll have a look thanks
16:35:47FromDiscord<Evissim> Is there a handy way to check if all the bits for an enum set are set?
16:37:47FromDiscord<Evissim> (edit) "Is there a handy way to check if all the bits for an enum set are set? ... " added "And/or if all the bits except for one are set?"
16:39:50*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:43:20*progranner joined #nim
16:44:52*jmdaemon joined #nim
16:55:41*jmdaemon quit (Ping timeout: 265 seconds)
16:57:09FromDiscord<jtv> If they're set up to be powers of two, cast to an int and test that way
16:59:03FromDiscord<jtv> For the first, `if int and high(int) == high(int)` and for the second, I guess it depends on what you mean by that. Do you want to know when exactly one bit is a 0, one and only one?
17:01:09FromDiscord<jtv> If so, I'd do something like: let x = not y; if x and (x -1): false else: true
17:01:29FromDiscord<jtv> (edit) "let" => "`let" | "true" => "true`"
17:01:50FromDiscord<Evissim> They're not set up as powers of two but guess could just do `pow(2, high(MyEnum).int + 1)` or something! Thanks will go poke
17:02:30FromDiscord<jtv> No, if you're looking for all but one bit being set,
17:02:37FromDiscord<jtv> The NOT of that should have exactly one bit set
17:02:42FromDiscord<jtv> Which means it is a power of two
17:02:49FromDiscord<jtv> So take the not, and test for power of two.
17:04:19*jmdaemon joined #nim
17:04:37FromDiscord<Evissim> Ah right right, I meant for the all set case. I get you on the one not set case now 👍
17:05:50FromDiscord<jtv> For the all set case, I think my ADD lost the thread in the middle
17:06:23FromDiscord<jtv> But if (x and high(int)) + 1 == int(lastOne)2
17:06:32FromDiscord<jtv> (edit) "if" => "`if" | "int(lastOne)2" => "int(lastOne)2`"
17:06:54FromDiscord<jtv> Basically, if they're all set, add one and you should be at the next power of two
17:09:40*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:11:48*progranner joined #nim
17:32:51*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:33:54*progranner joined #nim
17:57:58*Notxor quit (Remote host closed the connection)
18:08:36*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:09:36*progranner joined #nim
18:11:28*progranner quit (Client Quit)
18:12:14*progranner joined #nim
18:12:37*progranner quit (Client Quit)
18:13:23*progranner joined #nim
18:14:25*progranner quit (Client Quit)
18:15:34*progranner joined #nim
18:20:01*progranner quit (Client Quit)
18:37:40*lucasta joined #nim
18:39:57FromDiscord<Monolho> sent a code paste, see https://paste.rs/F5o
18:46:39*progranner joined #nim
19:01:18*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:02:26*progranner joined #nim
19:03:25*progranner quit (Client Quit)
19:04:53*progranner joined #nim
19:10:51FromDiscord<Monolho> still happens if I put a system.nim into place
19:14:01FromDiscord<Monolho> fixed by downloading all lib files from github
19:24:55*lucasta quit (Remote host closed the connection)
19:28:55*Notxor joined #nim
19:56:23*jmdaemon quit (Ping timeout: 240 seconds)
19:56:29*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:04:22*progranner joined #nim
20:05:44*progranner quit (Client Quit)
20:25:29*progranner joined #nim
20:27:14*progranner quit (Client Quit)
20:29:56*progranner joined #nim
20:36:57*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:38:44*progranner joined #nim
21:20:46*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:32:29*adigitoleo quit (*.net *.split)
21:32:40*adigitoleo joined #nim
21:36:08*Notxor quit (Remote host closed the connection)
21:40:32*lumo_e joined #nim
21:46:02*adigitoleo quit (*.net *.split)
21:46:10*adigitoleo joined #nim
21:46:47*advesperacit quit ()
21:54:20*lucasta joined #nim
22:08:28*pbsds quit (Ping timeout: 240 seconds)
22:09:20*pbsds joined #nim
22:22:00FromDiscord<Nlits (Ping on reply)> Is it possible to remotely control nodes in karax?
22:22:10FromDiscord<Nlits (Ping on reply)> Like, the nodes are under a diffrent root
22:34:49FromDiscord<Nlits (Ping on reply)> also, how would I use datavars in karax
22:41:14*lucasta quit (Remote host closed the connection)
22:41:37*lucasta joined #nim
23:15:07*disso_pch joined #nim
23:16:34disso_pchhi, i forgot if varargs can be used as a data type
23:16:59FromDiscord<Elegantbeef> It's a parameter only type if that's what you mean
23:17:42disso_pchwanting to use multiReplace with dictionaries
23:17:54disso_pchdictionaries as a concept not a specific implementation
23:18:42FromDiscord<Elegantbeef> Uncertain what you mean exactly, got an example of the desired API?
23:18:50disso_pchi just forgot how i would go about providing all of the replacements to do as cooked info referenced by different variable names
23:19:25FromDiscord<Elegantbeef> Arrays/sequences convert implicitly to `varargs`
23:19:39disso_pchstring.multiReplace(cooked_dictionary)
23:19:40disso_pchah right
23:19:46disso_pchthx, forgot if that was the case
23:44:52FromDiscord<Nlits (Ping on reply)> In reply to @not logged in "Is it possible to": even a dom builder that just builds regular dom would be great
23:50:22*jmdaemon joined #nim