gtkD: How to paint to screen for animation

2019-03-18 Thread Michelle Long via Digitalmars-d-learn
I've added a function to addOnDraw for a DrawingArea and it paints using the code I have when I resize. I added a queueDraw in threadsAddIdle and it seems to draws the screen immediately but it does not seem to be called again. If I put queueDraw inside the addOnDraw routine then the animati

Re: is collectException working for every exceptions ?

2019-03-18 Thread Ali Çehreli via Digitalmars-d-learn
On 03/18/2019 11:54 AM, Roman Sztergbaum wrote: > Hello as the subject say i'm asking this question because with the > following code Andre Pany has already explained. Otherwise, I was going to say "collectException can collect Exceptions, not exceptions." ;) There have been many discussions o

Re: Any easy way to extract files to memory buffer?

2019-03-18 Thread Michelle Long via Digitalmars-d-learn
On Monday, 18 March 2019 at 23:01:27 UTC, H. S. Teoh wrote: On Mon, Mar 18, 2019 at 10:38:17PM +, Michelle Long via Digitalmars-d-learn wrote: On Monday, 18 March 2019 at 21:14:05 UTC, Vladimir Panteleev wrote: > On Monday, 18 March 2019 at 21:09:55 UTC, Michelle Long > wrote: > > Trying to

Re: Any easy way to extract files to memory buffer?

2019-03-18 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 18, 2019 at 10:38:17PM +, Michelle Long via Digitalmars-d-learn wrote: > On Monday, 18 March 2019 at 21:14:05 UTC, Vladimir Panteleev wrote: > > On Monday, 18 March 2019 at 21:09:55 UTC, Michelle Long wrote: > > > Trying to speed up extracting some files that I first have to > > >

Re: Emulating DLL

2019-03-18 Thread Ethan Watson via Digitalmars-d-learn
On Monday, 18 March 2019 at 22:50:57 UTC, Craig wrote: Is it possible to create a D module that has functions in it, and then use those functions dynamically at run time emulating DLL like functionality? On Monday, 18 March 2019 at 22:50:57 UTC, Craig wrote: Is it possible to create a D module

Emulating DLL

2019-03-18 Thread Craig via Digitalmars-d-learn
Is it possible to create a D module that has functions in it, and then use those functions dynamically at run time emulating DLL like functionality? e.g., module MyDL; import Context; export void foo(Context) { ... } and module UseDL; import DL; import Context; void main() { DL.Load

Re: SEGFAULT when converting C string to string

2019-03-18 Thread DFTW via Digitalmars-d-learn
On Monday, 18 March 2019 at 22:33:21 UTC, H. S. Teoh wrote: On Mon, Mar 18, 2019 at 10:20:35PM +, DFTW via Digitalmars-d-learn wrote: [...] [...] Most likely explanation: you failed to call rt_init() before using a language feature that requires druntime to be initialized. In this case,

Re: Any easy way to extract files to memory buffer?

2019-03-18 Thread Michelle Long via Digitalmars-d-learn
On Monday, 18 March 2019 at 21:14:05 UTC, Vladimir Panteleev wrote: On Monday, 18 March 2019 at 21:09:55 UTC, Michelle Long wrote: Trying to speed up extracting some files that I first have to extract using the command line to files then read those in... Not sure what is taking so long. I imag

Re: SEGFAULT when converting C string to string

2019-03-18 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 18, 2019 at 10:20:35PM +, DFTW via Digitalmars-d-learn wrote: > I'm writing a shared library in C to be used from a C program, so I > went to my small tests. That one failed give a SEGFAULT on the > std.conv.to call. > > This is the pice of D code/the library: > > extern(C) int fo

PyD - accessing D class fields in Python

2019-03-18 Thread clothlen via Digitalmars-d-learn
Howdy; I'm trying to extend my Python program with D, but I'm having trouble accessing a D class's field/attribute/property/something. My D file looks like this: ``` module simpletest; import pyd.pyd; import std.stdio; class ExampleTest{ int _a = 3; int a(){ r

SEGFAULT when converting C string to string

2019-03-18 Thread DFTW via Digitalmars-d-learn
I'm writing a shared library in C to be used from a C program, so I went to my small tests. That one failed give a SEGFAULT on the std.conv.to call. This is the pice of D code/the library: extern(C) int foo(const char *name, int age) { import core.stdc.stdio : printf; import core.stdc.

Re: is collectException working for every exceptions ?

2019-03-18 Thread Andre Pany via Digitalmars-d-learn
On Monday, 18 March 2019 at 18:54:22 UTC, Roman Sztergbaum wrote: Hello as the subject say i'm asking this question because with the following code ``` private config_create_answer create_config(string[] args) in { assert(args !is null, "args cannot be null"); assert(arg

Re: Any easy way to extract files to memory buffer?

2019-03-18 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 18 March 2019 at 21:09:55 UTC, Michelle Long wrote: Trying to speed up extracting some files that I first have to extract using the command line to files then read those in... Not sure what is taking so long. I imagine windows caches the extraction so maybe it is pointless? You ca

Any easy way to extract files to memory buffer?

2019-03-18 Thread Michelle Long via Digitalmars-d-learn
Trying to speed up extracting some files that I first have to extract using the command line to files then read those in... Not sure what is taking so long. I imagine windows caches the extraction so maybe it is pointless?

Re: dub getting stuck

2019-03-18 Thread Joel via Digitalmars-d-learn
On Sunday, 17 March 2019 at 09:04:37 UTC, Eugene Wissner wrote: On Sunday, 17 March 2019 at 07:20:47 UTC, Joel wrote: macOS 10.13.6 dmd 2.085.0 dub 1.3.0 [snip] dub 1.3.0 is something old. Is it reproducable with a newer version? Can one safely update dub by it's self (Home Brew), when i

Re: what am I missing here with that working dir?

2019-03-18 Thread DFTW via Digitalmars-d-learn
On Monday, 18 March 2019 at 15:39:39 UTC, Andre Pany wrote: On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote: On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote: On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote: What am I missing here? Maybe the terminal and your utility you

Re: is collectException working for every exceptions ?

2019-03-18 Thread Roman Sztergbaum via Digitalmars-d-learn
On Monday, 18 March 2019 at 18:54:22 UTC, Roman Sztergbaum wrote: Hello as the subject say i'm asking this question because with the following code [...] I'm asking myself if it's usefull to write unittest with contract programming also, but this is another subject i think

is collectException working for every exceptions ?

2019-03-18 Thread Roman Sztergbaum via Digitalmars-d-learn
Hello as the subject say i'm asking this question because with the following code ``` private config_create_answer create_config(string[] args) in { assert(args !is null, "args cannot be null"); assert(args.length == 2, "need 1 arguments"); } out (r) {

Re: what am I missing here with that working dir?

2019-03-18 Thread Andre Pany via Digitalmars-d-learn
On Monday, 18 March 2019 at 15:39:39 UTC, Andre Pany wrote: On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote: On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote: [...] I guessed so, I've tried set the env as well: enum env = ["LD_LIBRARY_PATH" : "/path/to/wkhtmltox-0.12

Re: what am I missing here with that working dir?

2019-03-18 Thread Andre Pany via Digitalmars-d-learn
On Monday, 18 March 2019 at 15:23:46 UTC, DFTW wrote: On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote: On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote: What am I missing here? Maybe the terminal and your utility you run wkhtmltopdf from have different environment? I guesse

Re: what am I missing here with that working dir?

2019-03-18 Thread DFTW via Digitalmars-d-learn
On Saturday, 16 March 2019 at 07:27:43 UTC, FreeSlave wrote: On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote: What am I missing here? Maybe the terminal and your utility you run wkhtmltopdf from have different environment? I guessed so, I've tried set the env as well: enum env = [

Re: Can't make inout work.

2019-03-18 Thread spir via Digitalmars-d-learn
On 17/03/2019 18:34, Kagamin via Digitalmars-d-learn wrote: On Saturday, 16 March 2019 at 14:57:35 UTC, Paul Backus wrote: This code fails to compile if you change `auto s2` to `const s2`--in other words, it has the same problem as the original example. Maybe there's not much need for qualifie

Re: Can't make inout work.

2019-03-18 Thread aliak via Digitalmars-d-learn
On Sunday, 17 March 2019 at 20:23:44 UTC, Paul Backus wrote: On Sunday, 17 March 2019 at 10:49:03 UTC, aliak wrote: [...] For some reason, when you call `make("hello")`, the template argument T is being inferred as char[] instead of string. (You can see this by putting `pragma(msg, T)` in th