Re: Improved Complex number string representation

2016-09-01 Thread Krux02
@smitty, that has nothing to do with string representation. The complex numbers are internally nothing more than two numbers. So even though the type is different, it should be safe to simply cast from `Complex` to `array[2, float]`. But honestly, I just looked it up, I couldn't find any Complex

Re: Improved Complex number string representation

2016-09-01 Thread smitty
To interop with c/fortran for blas/lapack, complex numbers need to be passed as array[2, float32|float64].

Re: New feature in nimx

2016-09-01 Thread moigagoo
@yglukhov Great news and great job!

Re: httpclient.nim and twice set-cookie

2016-09-01 Thread dom96
Yes, this is a known bug that needs to be solved.

Re: New feature in nimx

2016-09-01 Thread Krux02
Can I ask what the main design goal of this GUI library is? I mean there are already a lot of GUI libraries out there. What makes this stand out, except from that it is written in Nim?

New feature in nimx

2016-09-01 Thread yglukhov
Proudly announcing the next big feature in [nimx](https://github.com/yglukhov/nimx): The text layout system. Live demo here (in the Text tab): [http://yglukhov.github.io/nimx/livedemo/main.html](http://forum.nim-lang.org///yglukhov.github.io/nimx/livedemo/main.html) The system is fully compatib

Re: The cstring type and interfacing with the backend.

2016-09-01 Thread Krux02
@flyx you forgot to mention: `std::basic_string`, `std::wstring`, `std::experimental::basic_string_view`, `std::experimental::string_view` and `std::experimental::wstring_view`

Re: The cstring type and interfacing with the backend.

2016-09-01 Thread _tulayang
I really really don't want to hear about anything about GO. GO is a failure language, OK?

Re: The cstring type and interfacing with the backend.

2016-09-01 Thread flyx
> Everything is split more explicitly, and there is no system wide hybrid type > that has to be compatible with whatever the backend is. So, one cstring for `char*`, one for `std::string`, one for `NSString` and one for JS' `string`? That looks like an awful lot of string types.

Re: libcurl any example

2016-09-01 Thread alexsad
@pyloor thanks. in httpclient something wrong. Look please: [http://forum.nim-lang.org/t/2508](http://forum.nim-lang.org///forum.nim-lang.org/t/2508)

Re: The cstring type and interfacing with the backend.

2016-09-01 Thread bogen
> If I would think Go is the future, I would not be here. Heh... Same with me. Go might have a future, not much of one with me however. > ... With the result that cstring now means compatible string. Yeah, I reached a similar conclusion (on all the **c** prefixed types, as I have used **nim js*

httpclient.nim and twice set-cookie

2016-09-01 Thread alexsad
Because some servers respond twice 'set-cookie' in the http header, in line 244 of the httpclient.nim headers 'set-cookie' is overrided result.headers[name] = line[linei.. ^1].strip() maybe then: result.headers.add(name, line[linei.. ^1].strip()) instead?

Re: How to keep an authorized connection session?

2016-09-01 Thread Garry_Galler
**OderWat** > I guess that grab is recording cookies and send them back like a web browser > does it Yes, that's exactly what he does. **_tulayang**, Indeed, what we should do: take the cookies out of the Set-Cookie header, and then send them to the server in the Cookie header. My habit to do

Re: How to change the buffer malloc from c code?

2016-09-01 Thread endragor
Use zeroMem,`copyMem`, moveMem, equalMem to operate on raw memory. In your case: const myString = "I change this" copyMem(cs, cstring(myString), myString.len + 1) # +1 because null byte has to be copied, too

Re: libcurl any example

2016-09-01 Thread pyloor
Hi, why not using [httpclient](http://forum.nim-lang.org///nim-lang.org/docs/httpclient.html)? It's quite easy to use: import httpclient proc main() = var content = getContent("http://example.com";) # do sth. with the content main()

Re: libcurl any example

2016-09-01 Thread alexsad
it works: let code = easy_setopt(curl, OPT_URL, "http://example.com";) sorry

Re: libcurl any example

2016-09-01 Thread alexsad
import libcurl let curl = easy_init() let code = easy_setopt(curl, OPT_URL) How can I do after that? How can I get tha data from some "[http://example.com";](http://forum.nim-lang.org///example.com";)?

How to change the buffer malloc from c code?

2016-09-01 Thread donydh
C code char* get_char(int n) { char* p = (char*)malloc(sizeof(char)*n); printf("%p\n", p); strcpy(p, "hello,world,from c!"); return p; } void del_char(char* p) { free((void*)p); }

Re: How to keep an authorized connection session?

2016-09-01 Thread _tulayang
You should write a session API on server with some key-value cache database (such as redis). Then using cookie to transform session state between client and server. Cookie: sid=0123456abcdefg Session API client ---

Re: Hello Nim Community, and how do I write shader glue code

2016-09-01 Thread Krux02
This [website](http://forum.nim-lang.org///blog.otoro.net/2015/06/19/neural-network-generative-art/) showed how you could use neural networks to generate some art. I friend of me wanted to have it in realtime, and used my Framework to implement it on the GPU. It was done on two evenings, but I

Re: How to keep an authorized connection session?

2016-09-01 Thread Garry_Galler
...OK. I think, understand what you mean.:)At http\basic authorization does not create any of this session, it directly mimics the browser itself, sending all the authentication information hidden from the user. Question by basic authorization withdrawn.

Re: How to keep an authorized connection session?

2016-09-01 Thread OderWat
EDIT: Was writing while you wrote :) My answer still stands :) Basic-Auth works like that and this possible extension for Nim would just do the same as you do right now. Maintaining sessions for other authorization schemes would be something more special as those come in a multitude of formats

Re: How to keep an authorized connection session?

2016-09-01 Thread Garry_Galler
I'm sorry, OderWat, but I misunderstood your answer.:) I reframe the question: is there a means to support Nim http session, such as the module Grab (python), where the authorization session is maintained automatically, and the user need only once to make login to access the site? Or this functi