Re: coding practices: include whole module or only the needed function

2014-10-07 Thread ketmar via Digitalmars-d-learn
On Mon, 06 Oct 2014 21:24:54 + AsmMan via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Which practice do you use: if you need only one or two functions from a module: import myModule : func, func2; or (import whole module, assuming no function name conflits of

Re: How to detect start of Unicode symbol and count amount of graphemes

2014-10-07 Thread Jacob Carlborg via Digitalmars-d-learn
On 06/10/14 19:48, H. S. Teoh via Digitalmars-d-learn wrote: This looks wrong to me. Are you sure this finds *all* possible graphemes? No, the data I gave was to detect a complete code unit. Graphemes are something else, I think Uranuz is mixing up the Unicode terms. -- /Jacob Carlborg

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 6 October 2014 at 21:24:56 UTC, AsmMan wrote: Which practice do you use: if you need only one or two functions from a module: import myModule : func, func2; or (import whole module, assuming no function name conflits of course) import myModule; any words why one over the other

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread monarch_dodra via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 07:33:24 UTC, Gary Willoughby wrote: On Monday, 6 October 2014 at 21:24:56 UTC, AsmMan wrote: Which practice do you use: if you need only one or two functions from a module: import myModule : func, func2; or (import whole module, assuming no function name

Re: line numbers in linux stack traces?

2014-10-07 Thread yazd via Digitalmars-d-learn
On Sunday, 5 October 2014 at 17:12:28 UTC, Vladimir Panteleev wrote: On Sunday, 5 October 2014 at 09:10:06 UTC, Nick Sabalausky wrote: I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this

Re: line numbers in linux stack traces?

2014-10-07 Thread Sag Academy via Digitalmars-d-learn
On Sunday, 5 October 2014 at 09:10:06 UTC, Nick Sabalausky wrote: I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this point? Because I'm not getting any with 2.066.0 with either -g or -gc

Re: How to detect start of Unicode symbol and count amount of graphemes

2014-10-07 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Oct 07, 2014 at 08:28:49AM +0200, Jacob Carlborg via Digitalmars-d-learn wrote: On 06/10/14 19:48, H. S. Teoh via Digitalmars-d-learn wrote: This looks wrong to me. Are you sure this finds *all* possible graphemes? No, the data I gave was to detect a complete code unit. Graphemes

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread ketmar via Digitalmars-d-learn
On Tue, 07 Oct 2014 17:24:40 + bachmeier via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 7 October 2014 at 08:37:59 UTC, monarch_dodra wrote: As a general rule, avoid imports in global scope anyways. Can you expand or provide a link to the issue? ahem...

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 08:37:59 UTC, monarch_dodra wrote: As a general rule, avoid imports in global scope anyways. Can you expand or provide a link to the issue?

function not callable using argument types - i disagree

2014-10-07 Thread Vlad Levenfeld via Digitalmars-d-learn
I'm trying to use the portaudio bindings and can't seem to call Pa_OpenStream, I get this error: source/pa_test.d(156): Error: function deimos.portaudio.Pa_OpenStream (void** stream, const(PaStreamParameters*) inputParameters, const(PaStreamParameters*) outputParameters, double

Re: function not callable using argument types - i disagree

2014-10-07 Thread Vlad Levenfeld via Digitalmars-d-learn
Update: I just did a manual cast. Still getting there error. Here's the new argument lists: (void**, const(PaStreamParameters*), const(PaStreamParameters*), double, uint, uint, extern (C) int function(const(void)*, void*, uint, const(PaStreamCallbackTimeInfo)*, uint, void*), void*) (void**,

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread monarch_dodra via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 17:29:45 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 07 Oct 2014 17:24:40 + bachmeier via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 7 October 2014 at 08:37:59 UTC, monarch_dodra wrote: As a general rule, avoid imports

Re: coding practices: include whole module or only the needed function

2014-10-07 Thread ketmar via Digitalmars-d-learn
On Tue, 07 Oct 2014 19:38:52 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 7 October 2014 at 17:29:45 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 07 Oct 2014 17:24:40 + bachmeier via Digitalmars-d-learn

building shared library from D code to import into cython

2014-10-07 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. I am trying to create a shared library in D linked against phobos so that I may use this in a cython extension module for Python. Ultimately I would like to be able to use a D class or struct (via the C++ interface) and call it from within cython, since cython classes cannot be

Re: building shared library from D code to import into cython

2014-10-07 Thread Freddy via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 20:55:59 UTC, Laeeth Isharc wrote: Hi. I am trying to create a shared library in D linked against phobos so that I may use this in a cython extension module for Python. Ultimately I would like to be able to use a D class or struct (via the C++ interface) and

'write' crashes without extra window

2014-10-07 Thread Joel via Digitalmars-d-learn
I have a program that runs at Windows 7 login, each time. But it had been opening with a command prompt, so I got rid of the prompt and now it some times crashes. I've noticed it before, using 'write' without the prompt.

Re: building shared library from D code to import into cython

2014-10-07 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. Thanks for the quick response. The -defaultlib was left around from trying all kinds of combinations of dmd and gcc. I am not used to gcc, and it will take me some time to become properly acquainted with all the options. I simply could not get it to recognize libphobos no matter what

generate unique variable names?

2014-10-07 Thread K.K. via Digitalmars-d-learn
Is there a way to generate variable names using strings? What I'm trying to do in this particular case is use a for loop, to generate variables (then probably put them in an array in the end) that represent images. So the name is pretty much image + the image padding + iterator number. So

Re: generate unique variable names?

2014-10-07 Thread Brian Schott via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 01:16:50 UTC, K.K. wrote: Is there a way to generate variable names using strings? What I'm trying to do in this particular case is use a for loop, to generate variables (then probably put them in an array in the end) that represent images. So the name is pretty

Re: generate unique variable names?

2014-10-07 Thread K.K. via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 02:06:28 UTC, Brian Schott wrote: I'm 99% sure you actually want an array or associative array. Something like this maybe? ImageType[string] images; images[format(image%03d, i)] = new ImagefromFile(userDefinedLocation); oooh okay I see what you mean. Yeah

Re: 'write' crashes without extra window

2014-10-07 Thread AsmMan via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 23:41:14 UTC, Joel wrote: I have a program that runs at Windows 7 login, each time. But it had been opening with a command prompt, so I got rid of the prompt and now it some times crashes. I've noticed it before, using 'write' without the prompt. Can you post

Re: 'write' crashes without extra window

2014-10-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 7 October 2014 at 23:41:14 UTC, Joel wrote: it had been opening with a command prompt, so I got rid of the prompt and now it some times crashes. That's a feature - writing to a non-existent handle fails, so it throws an exception. (The reason you don't notice this in something