Nim's version of the Trojan Source vulnerability

2021-11-01 Thread demotomohiro
My Neovim displayed that code like `if access_level != "user<202e> # check if admin⁩ ⁦":`. But my Neovim doesn't show any garbage charactor in this code: proc runBadCode() = when defined(windows): echo "format c:" else: echo "sudo dd of=/dev/sda1 if=/dev/

Plotting library

2021-11-01 Thread didlybom
Thank you @Vindaar. It works perfectly. I’ve opened a new issue because when compiling with nim 1.6.0 there is a deprecation warning. It’s true that it’s fairly easy to provide the x sequence but it’d be nice if it weren’t necessary. It’s not super important but a lot of plotting libraries (e.g

Forum issue when creating a thread

2021-11-01 Thread archnim
Just a little question, what tools was used to create this forum ?

Forum issue when creating a thread

2021-11-01 Thread Recruit_main707
you can find the source code of the forum here:

Did NRVO break?

2021-11-01 Thread Araq
Please report bugs on github.

Nim interpreter

2021-11-01 Thread archnim
Thanks for the complete explanation. 🙏🏽🙂

Arraymancer `in` operator

2021-11-01 Thread giaco
How can I query if an element is in a Tensor without converting to a seq first? `in` / contains seems missing

Arraymancer: dot/matmul equivalent for higher-dim tensors

2021-11-01 Thread benob
I'd like to do this with dot, but also einsum only supports tensors of known dimension. For instance, my code cannot be passed a tensor of dim 4 or 5 (typically some DL routines like to abstract away the concept of batch an be able to process tensors with one extra dim for batch).

Fidget questions - 1) scrolling - 2) closing window

2021-11-01 Thread treeform
Sorry, Fidget is still in development and probably does not have the feature you want. Fidget 1 is a dead end, I have plans for a different system with Fidget 2. Currently Fidget 1 does not support scrollable text output. Fidget 2 would. But Fidget 1 is pretty simple and I am sure you might be

[Imageman][nimgl] Loading texture

2021-11-01 Thread Lachu
1\. I change Unchecked array index calculation method. It does not made program working as excepted. 2. result.dCount = vertCount.cint*2 . Multiply by 2 is necessary, because vertex shader operates and return on two dimensional space. I change some files: import os import

Did NRVO break?

2021-11-01 Thread Astavie
I'm testing with this code: import unittest type X = object filler: array[2048, int] innerAddress: uint proc initX(): X = result.innerAddress = cast[uint](result.addr) proc initXInPlace(x: var X) = x.innerAddress = cast[uint

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread dom96
while not a priority, I think this could be a nice easy/hacktoberfest-esque task for someone to implement detection of this in the Nim compiler :)

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread kobi
perhaps vscode (or the plugin) should show these invisible characters. otoh, i don't think it's a priority for Nim.

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread dwin
Unicode use for social engineering has been long known issue with various software. Now they have given it a cool name and logo. This is a problem for code review tools and editors to consider.

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread xigoi
This is a problem with editors, not languages.

Plotting library

2021-11-01 Thread Vindaar
> Looking forward to the PR being merged and available as a new version of the > library. Just a heads up, that I've tagged a new version with the changes. The shared axes feature should be rather simple to implement. Regarding the sugar feature, for the time being simply use `scatterPlot(toSeq

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread planetis
>From the other hand, I find the if condition a joke.

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread robb1e
nice joke

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread Araq
User data plus login information usually lives in a database, not in Nim source code...

Nim interpreter

2021-11-01 Thread Araq
Well the Nim compiler includes a virtual machine (compiler/vm.nim) that can interpret Nim code. A "superset" would probably imply to patch Nim's parser/vmgen/vm so that it interprets this "superset", whatever that implies. But if you think that compilation/interpretation has much to do with how

[Imageman][nimgl] Loading texture

2021-11-01 Thread doofenstein
vert[vertCount*cfloat.sizeof*2+i*cfloat.sizeof] Run if you index an UncheckedArray, it's indexed per element not per byte, so the multiplications by sizeof(cfloat) should be unnecessary. Otherwise I can't really find anything wrong. If this doesn't fix the problem, I highly r

Nim interpreter

2021-11-01 Thread archnim
Hello world. Just to train myself and learn more, I would like to create a Superset of Nim Which will interprete scripts written in a nim-like language. To make it simple I imagine something like nodejs. It execute js scripts with aditionnal modules. Is it possible to archive that without coding

[Imageman][nimgl] Loading texture

2021-11-01 Thread demotomohiro
Do you see a red triangle or rectangle if your fragment shader outputs red color like `FragColor = vec4(1.0, 0.0, 0.0, 1.0);`? If you still see a black screen, your problem is not a texture loading.

[Imageman][nimgl] Loading texture

2021-11-01 Thread Lachu
I am beginner in OGL developing.

[Imageman][nimgl] Loading texture

2021-11-01 Thread Lachu
Of course, not. import nimgl/[glfw, opengl] import Screen import ../../common/utils import ../KnowledgeTheGamepkg/Windowing import textures import os type canvas* = object r*,g*,b*,a*: float txt*: texture shap

Fidget questions - 1) scrolling - 2) closing window

2021-11-01 Thread IvanS
Hi, I'm using fidget for the GUI of my app, but can't figure a these two out : **1) Scrollable text output** I don't find any examples for getting a scrollable text window/area. Basically, it would be the fidget example padoftext or padofcode, but where one can scroll the contents but not edit

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread benob
There is a more practical example in this go issue:

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread Hlaaftana
Most people would use an enum for this. If not, you would individually cover the case of the string being "admin" and all other possible values instead of assuming an invalid value to be admin. I would also expect editors like VS code to already highlight invisible characters. Either way though,

Nim's version of the Trojan Source vulnerability

2021-11-01 Thread benob
As described in let access_level = "user" if access_level != "user‮⁦# check if admin⁩ ⁦": echo "you are admin" else: echo "you are peon" Run Copy-paste the above code in a unicode-confo

Query nim include paths

2021-11-01 Thread kaushalmodi
If you have [jq](https://stedolan.github.io/jq/) installed (I think it's an awesome tool in general), you can do this: nim dump --dump.format:json . | jq -r .libpath Run [Reference](https://github.com/nim-lang/Nim/blob/2f730afe9e7eb981258aea257deba0240f488dd1/compiler/

Query nim include paths

2021-11-01 Thread shirleyquirk
You can get the path to the Nim stdlib with: Nim --hints:off --eval:"import std/compilesettings; echo querySetting(libPath)" Run but maybe there's a better way

This forum preview JS error

2021-11-01 Thread Yardanico
I have had the same issue since long time ago. Are you perhaps using Grammarly or some other similar browser extension? Grammarly modifies the DOM so Karax seems to be unhappy with it, so things like previews don't work on the Nim forum sadly.

Query nim include paths

2021-11-01 Thread gyohng
Hello, I'm about to include some Nim code into my CMake with C++. I managed to get most of it going; one thing I couldn't find though is a way to resolve Nim include path. The nim compiler generates an interface header file for me to use; however, it, in turn, depends on including a Nim library

This forum preview JS error

2021-11-01 Thread gyohng
Hi, the moment I'm trying to press the Preview tab during composing a message, I get this error via the JavaScript console (tried two different browsers): > forum.js?t=2020-08-2420%3A22%3A46:2970 Uncaught Error: Error: unhandled > exception: karax.nim(644, 14) `same(kxi.currentTree, > document.

Is there any way to check if a type is distinct?

2021-11-01 Thread opnotpermit
You can use `T is distinct` to check (Use when statement instead of if statement) BTW, in latest version, distinctBase function is accept primitive type as well, you may not need this trick in future

Is there a multithreaded HTTP library?

2021-11-01 Thread gyohng
Hello, I was looking into something like `prologue` or even a simpler library that could run in its own thread and serve HTTP/Websockets. `Prologue` seems to be exactly what I need, except that I couldn't make it work in a separate thread. Nim would complain, unless `app.run()` is called from t

Plotting library

2021-11-01 Thread didlybom
This is awesome @Vindaar, thank you! Looking forward to the PR being merged and available as a new version of the library. As you requested, I've also created a new issue requesting adding support for shared X-Axes (. In the issue description I a

Is there any way to check if a type is distinct?

2021-11-01 Thread monyarm
I've got this desirializer, for which i need to get the base of the types if they're distinct, i'm using distinctBase, but if the given type isn't distinct I get an error `distinctBase expects a distinct type as argument. The given type was uint32`, so i need a way to check if a type is distinct

[Imageman][nimgl] Loading texture

2021-11-01 Thread doofenstein
is this your entire code?

Plotting library

2021-11-01 Thread Vindaar
Updated nim-plotly PR with the aforementioned fixes is here: Indeed there already was the option to override the `/tmp/x.html` default before. That was the purpose of the `path` argument (indeed the name might have been unclear). And given that the

NIM IDE

2021-11-01 Thread saem
An LSP can do pretty much anything an extension can with little to no fidelity difference. The difficulty in implementation is another matter, I've wasted a lot of cycles on trying to improve the LSP but it's a pain to get a productive test setup going and even if you do the inability to kill t

[Imageman][nimgl] Loading texture

2021-11-01 Thread Lachu
import nimgl/opengl import imageman type texturePriv = object texID: GLuint data: Image[ColorRGBU] texture* = ref texturePriv proc loadTexture*(path: string): texture = var image = loadImage[ColorRGBU](pa

Nested Tables

2021-11-01 Thread PMunch
I'd still go with the one @shirleyquirk posted. That version will only do it for tables, and not arbitrary values, saving you from the issue that the C++ code had. Compare this: proc `[]`[A, B, C](t: var Table[A, Table[B, C]], key: A): var Table[B, C] = t.mgetOrPut(key, initTa

Nested Tables

2021-11-01 Thread Araq
> One of the things I like about Nim is how it uses terms properly. I also considered to use `text` instead of `string` and `chain` instead of (linked) `list`. ;-)