An easy way of displaying video?

2021-04-16 Thread Stefan_Salewski
> searched $ grep -A8 "gtk_image_get_pixbuf" ~/.nimble/pkgs/gintro-#head/gintro/gtk4.nim $ grep -A8 "gtk_image_get_pixbuf" ~/.nimble/pkgs/gintro-#head/gintro/gtk.nim proc gtk_image_get_pixbuf(self: ptr Image00): ptr gdkpixbuf.Pixbuf00 {. importc, libprag.}

The `db_postgres` can't execute multiple queries, possible bug?

2021-04-16 Thread alexeypetrushin
Split it into 2 functions `exec` and `exec_prepared`? Or add argument `prepared = false`?

"invalid type ... in this context" error

2021-04-16 Thread dullbananas
on StackOverflow

string split by {';'}

2021-04-16 Thread timothee
* repr has indeed a bug as mentioned in * use `echo (e,)`, which works better and doesn't depend on --gc:refc|arc unlike repr: include prelude var s = "foo\rbar\cbaz\lend" for e in split(s, {';'}): echo e echo e.rep

An easy way of displaying video?

2021-04-16 Thread juancarlospaco
Any library with an HTML widget can use video tag.

Global array access can have side effects?

2021-04-16 Thread SolitudeSF
result of a function being affected by variables outside of argument list is a side effect.

Global array access can have side effects?

2021-04-16 Thread demotomohiro
A function in Nim is similar to a function in math. It must not have side effect and it always returns same output from same input. If a function use global variable, the output from the function can be changed when the value of global variable is changed. Even if your code never change that gl

An easy way of displaying video?

2021-04-16 Thread mantielero
I searched in github so I didn't find it. Is GtkImage missing? There is a [method](https://developer.gnome.org/gtk3/stable/GtkImage.html#gtk-image-get-pixbuf) there needed.

Global array access can have side effects?

2021-04-16 Thread quokka70
@ElegantBeef: thanks. That satisfied the compiler. @Yardanico: OK. So the compiler isn't really complaining that there might be a side effect - my proc doesn't change any data - but that we don't have referential transparency (which is true).

Global array access can have side effects?

2021-04-16 Thread Yardanico
As per : > This means that the proc/iterator only changes locations that are reachable > from its parameters and the return value only depends on the arguments. Accessing global variables is considered a side effect since then t

An easy way of displaying video?

2021-04-16 Thread Stefan_Salewski
> a gtk example using GtkImage and GdkPixBuf, but grep -A4 "Pixbuf* = " ~/.nimble/pkgs/gintro-#head/gintro/gdkpixbuf.nim Pixbuf* = ref object of gobject.Object Pixbuf00* = object of gobject.Object00 proc gdk_pixbuf_get_type*(): GType {.importc, libprag.} salewski@nuc ~/Router $ grep -A4 "Im

Global array access can have side effects?

2021-04-16 Thread quokka70
When I access a global array in a proc, the proc can't be a func: var x: array[5, int] x = [1, 2, 3, 4, 5] # This is fine proc access(index: int): auto = x[index] # This gives "'func_access' can have side effects" func func_access(index:

Global array access can have side effects?

2021-04-16 Thread ElegantBeef
Accessing any non constant globals from functions is considered impure so if you want to overload the "func checker" you can do the following: var x: array[5, int] x = [1, 2, 3, 4, 5] # This is fine proc access(index: int): auto = x[index]

An easy way of displaying video?

2021-04-16 Thread mantielero
I think that gstreamer is more intended for video/audio decoding an processing. It is something that I tried long ago (I have to revisit it). I made bindings for openpnp which enables reading a webcam and it is multiplatform. I'd like to show the video. They have a gtk example using GtkImage an

An easy way of displaying video?

2021-04-16 Thread mantielero
How would it be an easy way of showing a video? I mean in a frame by frame way (not actually decoding video). Like an animation. Not sure if nimx, gintro, sdl, is the way to go.

An easy way of displaying video?

2021-04-16 Thread Stefan_Salewski
Gintro has gstreamer support, there is a tiny example provided which plays a blender video. Someone requested gsteamer support long time ago, so I added it, but I think he vanished fast, so we have still no larger examples.

Any valuable linux project to join?

2021-04-16 Thread moigagoo
At least at the time of this comment being written, moe works in Unix only.

Any valuable linux project to join?

2021-04-16 Thread PMunch
There is Nimdow, a pretty good Window Manager for X. I have also written my own set of programs notificatcher and notifishower to catch and show DBUS notifications. Pakku is an Arch package manager. There's also Moe, which is a terminal text editor, but I think that works cross platform.

Any valuable linux project to join?

2021-04-16 Thread cblake
No. I would not say the above projects are as ambitious in scope as "util-linux in Nim". Anyone doing that would be well advised to reach beyond a "simple clone in another prog.lang" which has little value to users. At the very least they should use `cligen` to get nice colorized tabular auto-he

Generic type parameters and inheritance

2021-04-16 Thread hnicke
Thank you all for your help, very much appreciated. As you proposed, the init proc helped. However, I had a weird compiler error somewhere else down the road with this approach, so I looked for another solution. Bpr pointed out that I might actually be better off using concepts instead of inhe

Any valuable linux project to join?

2021-04-16 Thread acroobat
util-linux in Nim?

nDustman (random URL generator)

2021-04-16 Thread Rozzamarine
Version 0.03 is live. Character pool is now configurable, scanning is now freezable, success rate is now recjrdable and new links are now openable... I mean, auto-openable, yes. Thoughts ?

string split by {';'}

2021-04-16 Thread cblake
He could also instead `echo e.repr` to see that it is only one string (only one address prints). When I did this I got: 0x14ec252cc090"foo\13bar\13baz\10" "end" Run which kinda looks like maybe a bug in `repr`..I mean it quotes the newline as "10", but then puts

Any valuable linux project to join?

2021-04-16 Thread cblake
I have a rather generalized colorized/sorting "ls" at [lc](https://github.com/c-blake/lc) that I have been using myself dozens to 100s of times per day since I wrote it. It's really more of an "ls construction toolkit", but there are some default configs. Also, [procs](https://github.com/c-blak

Migrating from v 1.0: "raise effects differ"

2021-04-16 Thread quokka70
Yes, that was it. Thanks! I wish the compiler error had been more helpful, though. ".raise effects differ" is pretty clear, now that I think about it, but the "got X expected Y" message doesn't mention the `Defect` issue at all and I had to grovel in the library sources to work out what was req

Any valuable linux project to join?

2021-04-16 Thread acroobat
I am going to promote Nim through linux forums. Any good project which is ready to use?

cross compilation from Linux to windows

2021-04-16 Thread Araq
> Not sure why you'd want to set up your entire Nim environment under Wine just > to cross-compile. You make it sound like it's lots of work -- it's not. In my experience, it's much simpler than cross-compiling. Plus then you can test your program too, which is never a disadvantage, wether you

cross compilation from Linux to windows

2021-04-16 Thread NameUndefined
Maybe, but that throw an other error that I don't want to fix Oh and If I want to cross-compile it's because no one else than me uses Linux, so when I want to share something I made, I need to compile it for windows

cross compilation from Linux to windows

2021-04-16 Thread PMunch
Try adding `--os:windows`. I compile a DLL from Linux to Windows, so I've got quite a couple more flags in my setup. But that's the one I think you might be missing.

cross compilation from Linux to windows

2021-04-16 Thread PMunch
Sometimes people just want to set up a cross-compile, who knows he might output that build into a shared directory and test it in a VM. Or maybe like me he has a professional tester who tests the Windows version as long as I can build it for him. Not sure why you'd want to set up your entire Nim

The `db_postgres` can't execute multiple queries, possible bug?

2021-04-16 Thread Araq
Well yeah, it's something we could improve. But it's not clear how -- many people like prepared statements.

cross compilation from Linux to windows

2021-04-16 Thread NameUndefined
I found a windows machine on wich I installed nim and mingw, I successfully compiled my app. And what did I said wrong? Im respecting windows users

cross compilation from Linux to windows

2021-04-16 Thread Araq
Use "Wine" to both compile **and test** for Windows. Respect your Windows users.

How to disable logging from db_postgres?

2021-04-16 Thread alexeypetrushin
Thanks, finally [I found how to silence it](https://stackoverflow.com/questions/2001189/postgresql-notice-processing), if anyone need it: import db_postgres, postgres let db = open("localhost", "postgres", "", "nim_test") let stub_notice_receiver: PQnoticeReceiver = pro

The `db_postgres` can't execute multiple queries, possible bug?

2021-04-16 Thread alexeypetrushin
This code would fail, because it contains multiple statements, separated by semicolons. import db_postgres let db = open("localhost", "postgres", "", "nim_test") let schema = """ begin; drop table if exists users; create table users( id seria

cross compilation from Linux to windows

2021-04-16 Thread NameUndefined
Hi, As the title says I wanted to compile a windows executable from my Linux machine, so I followed the User Guide found [here](https://nim-lang.org/docs/nimc.html) and its written that I need to use the mingw-w64 package that I installed on my system, _an arch linux one_ , but I got an error w

How to get column names for `db_postgres.getAllRows`?

2021-04-16 Thread alexeypetrushin
The [db_postgres.getAllRows](https://nim-lang.org/docs/db_postgres.html#getAllRows%2CDbConn%2CSqlQuery%2Cvarargs%5Bstring%2C%5D) returns list of rows as `seq[seq[string]]`. proc getAllRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): seq[ Row] Run

"invalid type ... in this context" error

2021-04-16 Thread Araq
A little off-topic but have you considered Karax instead of Elm?

Getting started with the Foreign Function Interface - calling library functions

2021-04-16 Thread abudden
Thanks @shirleyquick \- that looks like an excellent idea: I'll do that.

Getting started with the Foreign Function Interface - calling library functions

2021-04-16 Thread Araq
The fact that c2nim still doesn't know about UncheckedArray is a bug. Patches are welcome, c2nim's code isn't all that hard to grok, but I'm biased.