Text portion of an XmlNode type

2022-08-01 Thread pietroppeter
You can build your own proc that only returns text from children of kind xnText: import xmltree var e = newElement("child1") e.add newText(" jibber") var f = newElement("child2") f.add newText(" jabber") var x = newXmlTree("root", [e, f]) x.add

Text portion of an XmlNode type

2022-08-01 Thread LaughingBubba
I opted against `innerText` because it does indeed return the text of the node and all it's children: import xmltree var e = newElement("child1") e.add newText(" jibber") var f = newElement("child2") f.add newText(" jabber") var x =

composite type bug? Order makes difference.

2022-08-01 Thread ggibson
What a wonderful detailed reply - Thank you! I lacked the correct terminology to find the prior issues reported.

composite type bug? Order makes difference.

2022-08-01 Thread shirleyquirk
yes, known issue:

composite type bug? Order makes difference.

2022-08-01 Thread ggibson
The following fails, unless the ordering of `tuple|string` is reversed. Verifying here before submitting an issue. type Group = tuple|string proc tryit(container: Group): auto = container echo tryit( (0,1,2)) echo tryit( "012") Run

Ormin postgres backend with threads

2022-08-01 Thread Cnerd
Hello can anyone provide an example of calling a proc which uses postgresql backend of the ormin library in a threaded proc.

string of compressed source code

2022-08-01 Thread EyeCon
You can combine exelotl's method with compression so that the embedded asset takes even less space. A good example is:

string of compressed source code

2022-08-01 Thread exelotl
if it's not valid unicode, your best bet is to store it in a separate file and use `staticRead` to load it into a string at compile-time. const s = staticRead("myfile.bin") load(s) Run

string of compressed source code

2022-08-01 Thread auxym
If I understand correctly, you would like to include a non-printable byte, like 0x15 (ASCII NAK), in a string literal in source code. If so you can do it using "x" escapes like this: const s = "hello\x15\x2f" Run This does not increases (binary) code size.

string of compressed source code

2022-08-01 Thread chaemon
I want do the following 1. compress a code A and write it to some other code B as a string or something 2. decompress the string and load it by macro I know that some library like the following zlib.nim enable to compress a string.

Nim Wiki disabled contributions

2022-08-01 Thread xflywind
I didn't find some good solutions likes open to contributors/not_fairly_new_users/request_for_moderation.

Nim Wiki disabled contributions

2022-08-01 Thread juancarlospaco
I know about Spamm and stuff, I was just wondering what can be done to improve the situation for the future...

Nim Wiki disabled contributions

2022-08-01 Thread xflywind
Sorry for the inconvenience. Now it is open to everyone again. Because of the continuing phishing attempts again and again, I have disabled and enabled the wiki editing for multiple times.

Nim Wiki disabled contributions

2022-08-01 Thread exelotl
I'm not sure how/when it'll be resolved, but I remember it was disabled due to a phishing attempt, see here for more info:

Nim Wiki disabled contributions

2022-08-01 Thread juancarlospaco
Nim Wiki has disabled contributions, it has no "edit" button anymore, what happened ?, can it be fixed ?, at least for users that request it, basically most contributions and fixes were well intended and had an organic growth by the community, but now it is frozen in time...

Text portion of an XmlNode type

2022-08-01 Thread pietroppeter
to access text content of a generic `XmlNode` you can use [innerText](https://nim-lang.org/docs/xmltree.html#innerText%2CXmlNode). The node you create is not of kind `xnText` and so it does not have a `text` attribute. It does have a child (it can have multiple children), which is of kind

Text portion of an XmlNode type

2022-08-01 Thread LaughingBubba
Hi, Mr Nim Newbie here, when I run the following code fragment import xmltree var e = newElement("elem") e.add newText("some text") echo typeof e echo typeof e.text echo e echo e.text Run It crashes and I get the resulting output