Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
Yes u are right, It's not this simple, loop all not last keyval, Maybe I use a rune var save last key name in myproject code is best method, Thx all reply

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread Araq
You have no idea about my "comfort".

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread Calonger
You take your comfort in EU for granted .

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread sky_khan
Its not that simple. Capacity != Count in underlying table. Still, IMO this should be in tables.nim. Its not ideal but better than nothing. proc raiseIndexError(ndx, max : int) = raise newException(IndexError, "index " & $ndx & " not in 0.." & $(max-1)) proc keyAt*[

Small experiment with compiling the Nim compiler with PGO

2023-04-24 Thread Yardanico
Update: I tried PGO'ing the Nim status compiler which is I think based around 1.6.10 with a bit of custom commits, so it uses refc. Judging by the results, it seems like compiler built with refc (which is the case for Nim 1.6.x) benefits much less from PGO - the Nim compilation part for the comp

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
I see source iterator, t.data[^1] can get it, But t.data is private let L = len(t) for h in 0 .. high(t.data): if isFilled(t.data[h].hcode): yield (t.data[h].key, t.data[h].val) Run Add this funtion maybe can use idx get key value templat

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Araq
I have a hash table implementation lying around that supports that operation but it's not published yet...

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread xigoi
If you tell us more generally what you're trying to do, we might help you choose a proper data structure for your task.

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread xigoi
The cookie banners are not enforced. Sites intentionally put them up to make people believe that GDPR is bad, when actually they could just stop spying on people without their consent.

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread sky_khan
Table in Nim is hash table. Its not like sequences. Order of items is not guaranteed.Hypothetically, OrderedTable could have what you want but it has not. You have to change your algorithm or look elsewhere

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
# table key : ¢£¬ ̄¦¥₩→�, � is last key If table["�"] is last key , I forget � key name, but I want get this table key's val (like seq[^1])

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread doofenstein
last as in key with the highest value or last inserted?

Can I quick get table last key value use like at(idx) function?

2023-04-24 Thread Angluca
A table has 1+ rune (use table['x'] get value) , I don't know what is last key name(table[?]), But I want quickly use idx num get table value( like seq[^1] | seq[0] ) I'm a newble, Who can tell how to do it?

Why astToStr doesn't work inside template?

2023-04-24 Thread Araq
Works just fine: template `^`(a, b: untyped) = echo a, astToStr(b), 2 "a" ^ b Run The manual explains why.

Writing a wrapper for ML libraries how-to

2023-04-24 Thread alexeypetrushin
do you actually need dataframe in Nim? In Python you need it to delegate data manipulation to C, but why you need dataframe in Nim, you can just use array of rows and plain `select/filter/count` lambdas.

Why astToStr doesn't work inside template?

2023-04-24 Thread alexeypetrushin
This code doesn't work, is there a way to get value of `b` as string inside of the template? template `^`(a, b: untyped) = echo a, b.ast_to_str, 2 "a" ^ b Run

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread grd
When you remember Netscape then you also remember the stupid standardization of OOXML... No, the only rule that the EU needed to have (but of course they don't) is to mandate FOSS, especially in governments.

Writing a wrapper for ML libraries how-to

2023-04-24 Thread mratsim
There was a time (6 years ago) where I was interested in reimplementing Sklearn but unfortunately I'm too busy with other projects. However, I would go like this. 1. Create a robust dataframe library and implement the time-series centric features (like rolling sums and things like that). 2.

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread tcheran
Good rules are better than no rules... but bad rules are worse than no rules. I think that rules advocating for transparency or for freedom of choice or breaking monopolies are good rules. For instance forcing Microsoft to not pre-install Internet Explorer in every windows PC, and let user decid

Viability of a website generator using nim.

2023-04-24 Thread blackmius
> If the front-end HTML form is written to send a POST to the front-end CGI > with the wrong object format, a compile-time error is thrown. you can’t rely on the compiler, anyone who visits the site using curl will knock down the server

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread Araq
I don't agree. Who knows if more regulations are really "needed", the road to hell is paved with good intentions. You can let the market filter out the products with bad security. It helps if you still have a market and not a planned economy. It also helps if you have independent testers outlin

Viability of a website generator using nim.

2023-04-24 Thread blackmius
maybe take something from js world the mainstream hydration or etc like this that means you can generate not only static js code for running SPA, but also a version with prefilled values and raw html, that after sending to web comes alive.

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread nasl
I like common charger standard and many Americans wish they had GDRP, California actually did copy parts of it with CCPA. Security regulations for consumer products are needed, since security is as good as it's weakest link, which is IoT.

I'm experiencing slower performance with the Nim Discord library when building Discord bots?

2023-04-24 Thread gabriell
I've been experimenting with both Nim and Python for building Discord bots, and I've noticed that the Nim Discord library seems to have slower performance compared to Python's Discord library. I'm curious about why this might be the case. Are there any specific design choices or implementation d

EU Cyber Resilience Act impact on Open Source community

2023-04-24 Thread grd
Yes, you are --completely-- right!

Pass generic proc object different sub-types

2023-04-24 Thread cmc
For reference: Added request to improve error message here:

Long string in source file

2023-04-24 Thread ElegantBeef
There are two other solutions for this example. 1. Make a `tau.txt` that contains your tau text then do `const tauText = staticRead("tau.txt")` (Why would someone want such an unreadable string inside their source code, seems quite odd to me.) 2. Use/modify this