Re: Invalid foreach aggregate

2015-11-16 Thread Marc Schütz via Digitalmars-d-learn
On Monday, 16 November 2015 at 16:44:27 UTC, Chris wrote: Updating my code from 2.067.1 to 2.069.1 (I skipped 2.068, because I was too busy). I get this error: invalid foreach aggregate, define opApply(), range primitives, or use .tupleof for code like foreach (ref it;

Re: Any D IDE on Mac OSX with debugging support?

2015-11-16 Thread Vadim Lopatin via Digitalmars-d-learn
On Monday, 16 November 2015 at 08:15:36 UTC, Jacob Carlborg wrote: On 2015-11-16 08:48, Rikki Cattermole wrote: On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and security. I

Re: on structs by reference

2015-11-16 Thread Alex via Digitalmars-d-learn
On Monday, 16 November 2015 at 07:51:53 UTC, Ali Çehreli wrote: import std.stdio; /* This is the storage to the slices that objects will share. * * (Surprisingly, creating a slice dynamically is not possible due * to syntax issues: new int[N] means "allocates N ints and make * a slice

Re: Epoch time + msecs

2015-11-16 Thread Kagamin via Digitalmars-d-learn
On Monday, 16 November 2015 at 14:21:02 UTC, Ola Fosheim Grøstad wrote: No, to get a period of 2^19937 you need 19937 bits or 2-3 KiB… ;) This computes out of context :) but...

Re: Invalid foreach aggregate

2015-11-16 Thread Chris via Digitalmars-d-learn
On Monday, 16 November 2015 at 16:49:19 UTC, Marc Schütz wrote: On Monday, 16 November 2015 at 16:44:27 UTC, Chris wrote: Updating my code from 2.067.1 to 2.069.1 (I skipped 2.068, because I was too busy). I get this error: invalid foreach aggregate, define opApply(), range primitives, or

Re: Linker error from dub?

2015-11-16 Thread Stiff via Digitalmars-d-learn
On Thursday, 12 November 2015 at 06:11:37 UTC, BBasile wrote: On Thursday, 12 November 2015 at 06:03:49 UTC, BBasile wrote: It worked fine because it was not used, not parsed, not linked. Maybe just the functions declarations was parsed to solve the symbols in the program, but since none was

Re: Any D IDE on Mac OSX with debugging support?

2015-11-16 Thread Vadim Lopatin via Digitalmars-d-learn
On Monday, 16 November 2015 at 07:48:31 UTC, Rikki Cattermole wrote: On 16/11/15 7:45 PM, Vadim Lopatin wrote: Hello, Is there any IDE which allows debugging D apps on OSX? I'm trying Mono-D, but getting error "Debugger operation failed A syntax error in expression, near

Invalid foreach aggregate

2015-11-16 Thread Chris via Digitalmars-d-learn
Updating my code from 2.067.1 to 2.069.1 (I skipped 2.068, because I was too busy). I get this error: invalid foreach aggregate, define opApply(), range primitives, or use .tupleof for code like foreach (ref it; myArray.doSomething) {} Probably not the best idea anyway. What's the best

Re: Epoch time + msecs

2015-11-16 Thread Kagamin via Digitalmars-d-learn
On Monday, 16 November 2015 at 10:47:36 UTC, Marc Schütz wrote: Hmmm... why is `unpredictableSeed` only a `uint`? Surely most PRNGs have more than 32 bits of internal state? Maybe it's only worth 32 random bits? There's a rangified example too:

Re: Epoch time + msecs

2015-11-16 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 16 November 2015 at 13:34:41 UTC, Kagamin wrote: On Monday, 16 November 2015 at 10:47:36 UTC, Marc Schütz wrote: Hmmm... why is `unpredictableSeed` only a `uint`? Surely most PRNGs have more than 32 bits of internal state? Maybe it's only worth 32 random bits? There's a rangified

Re: Invalid foreach aggregate

2015-11-16 Thread opla via Digitalmars-d-learn
On Monday, 16 November 2015 at 16:55:29 UTC, Chris wrote: On Monday, 16 November 2015 at 16:49:19 UTC, Marc Schütz wrote: On Monday, 16 November 2015 at 16:44:27 UTC, Chris wrote: Updating my code from 2.067.1 to 2.069.1 (I skipped 2.068, because I was too busy). I get this error: invalid

Re: Invalid foreach aggregate

2015-11-16 Thread Chris via Digitalmars-d-learn
On Monday, 16 November 2015 at 17:57:53 UTC, opla wrote: On Monday, 16 November 2015 at 16:55:29 UTC, Chris wrote: On Monday, 16 November 2015 at 16:49:19 UTC, Marc Schütz wrote: On Monday, 16 November 2015 at 16:44:27 UTC, Chris wrote: Updating my code from 2.067.1 to 2.069.1 (I skipped

writef format specifier error message

2015-11-16 Thread ric maicle via Digitalmars-d-learn
I accidentally typed an extra asterisk in the format specifier. I know that it is wrong but the error isn't clear about what and where the error is. import std.stdio; void main() { writef("%*10s", 100); } and I got the following error message(s): $ dmd -run writef.d

Re: writef format specifier error message

2015-11-16 Thread Ali Çehreli via Digitalmars-d-learn
On 11/16/2015 10:56 AM, ric maicle wrote: I accidentally typed an extra asterisk in the format specifier. I know that it is wrong but the error isn't clear about what and where the error is. import std.stdio; void main() { writef("%*10s", 100); } and I got the following error message(s): $

Looking for a language to hang my hat on.

2015-11-16 Thread Dan via Digitalmars-d-learn
I am a very new c++ programmer, having just learned the language this year. A few months ago I completed a course on Coursera that dealt with the security aspect of c (which I don't know, but it is similar enough): https://class.coursera.org/softwaresec-008 The course highlighted just how

Re: Looking for a language to hang my hat on.

2015-11-16 Thread lobo via Digitalmars-d-learn
On Monday, 16 November 2015 at 22:39:17 UTC, Dan wrote: I am a very new c++ programmer, having just learned the language this year. A few months ago I completed a course on Coursera that dealt with the security aspect of c (which I don't know, but it is similar enough):

linux inotify on a std.process.ProcessPipes ?

2015-11-16 Thread opla via Digitalmars-d-learn
Does anyone know if it's possible to monitor the events that happen on the output stream of a piped process ? I'm stuck on doc: - https://www.win.tue.nl/~aeb/linux/lk/lk-12.html - http://www.ibm.com/developerworks/library/l-ubuntu-inotify/ - http://linux.die.net/man/2/inotify_add_watch

Re: What does the -betterC switch in dmd do?

2015-11-16 Thread Mike via Digitalmars-d-learn
On Sunday, 15 November 2015 at 15:34:19 UTC, Jacob Carlborg wrote: I'm pretty sure that the only things that are excluded are module info and type info. It's still possible to use "new" and all the array features that requires support in the runtime (slicing, concatenation, appending and so

Re: Looking for a language to hang my hat on.

2015-11-16 Thread Chris Wright via Digitalmars-d-learn
On Monday, 16 November 2015 at 22:39:17 UTC, Dan wrote: I have been lurking on this site over the past few weeks trying to decide when (and if) to make the transition. Can anyone here who has already made that transition tell me how smoothly it went? Any major unexpected problems? Advice?

Re: linux inotify on a std.process.ProcessPipes ?

2015-11-16 Thread Justin Whear via Digitalmars-d-learn
On Mon, 16 Nov 2015 23:08:46 +, opla wrote: > Does anyone know if it's possible to monitor the events that happen on > the output stream of a piped process ? > > I'm stuck on doc: > > - https://www.win.tue.nl/~aeb/linux/lk/lk-12.html - >

Re: writef format specifier error message

2015-11-16 Thread ric maicle via Digitalmars-d-learn
On Tuesday, 17 November, 2015 03:49 AM, Ali Çehreli wrote: On 11/16/2015 10:56 AM, ric maicle wrote: I accidentally typed an extra asterisk in the format specifier. I know that it is wrong but the error isn't clear about what and where the error is. import std.stdio; void main() {

Re: How to use readText to read utf16 file?

2015-11-16 Thread Domain via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 02:42:29 UTC, Adam D. Ruppe wrote: On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote: How to use readText to read utf16 file? readText!wstring("filename") should do it for utf16. It will return a wstring, which is utf-16. You can do utf32 with

Re: How to use readText to read utf16 file?

2015-11-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote: Thanks! But how to remove BOM? Slice the result myself? Yeah. Do something like if(result.length &[0] == bom) { result = result[1..$]; } and you'll have it.

Re: How to use readText to read utf16 file?

2015-11-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/16/15 10:00 PM, Adam D. Ruppe wrote: On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote: Thanks! But how to remove BOM? Slice the result myself? Yeah. Do something like if(result.length &[0] == bom) { result = result[1..$]; } and you'll have it. To be technically correct, you

How to use readText to read utf16 file?

2015-11-16 Thread Domain via Digitalmars-d-learn
How to use readText to read utf16 file? Or other encoding file.

Re: How to use readText to read utf16 file?

2015-11-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote: How to use readText to read utf16 file? readText!wstring("filename") should do it for utf16. It will return a wstring, which is utf-16. You can do utf32 with readText!dstring. The default, of course, is string, which is utf8. It

Re: How to use readText to read utf16 file?

2015-11-16 Thread Domain via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 03:12:47 UTC, Steven Schveighoffer wrote: On 11/16/15 10:00 PM, Adam D. Ruppe wrote: On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote: Thanks! But how to remove BOM? Slice the result myself? Yeah. Do something like if(result.length &[0] == bom) {

Re: Any D IDE on Mac OSX with debugging support?

2015-11-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-11-16 08:48, Rikki Cattermole wrote: On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and security. I suspect this is what is stopping it. Alternatively use LLDB shipped

Re: Epoch time + msecs

2015-11-16 Thread Kagamin via Digitalmars-d-learn
On Saturday, 14 November 2015 at 12:14:42 UTC, Handyman wrote: Of course. That's why I mentioned my purpose of using Clock.currTime(), in the hope I got corrected in using the right and offical seed method which I failed to find, which brings me to another point. Don't docs provide examples

Re: Any D IDE on Mac OSX with debugging support?

2015-11-16 Thread Vadim Lopatin via Digitalmars-d-learn
On Monday, 16 November 2015 at 07:48:31 UTC, Rikki Cattermole wrote: On 16/11/15 7:45 PM, Vadim Lopatin wrote: [...] On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and

Re: Epoch time + msecs

2015-11-16 Thread Marc Schütz via Digitalmars-d-learn
On Monday, 16 November 2015 at 10:29:25 UTC, Kagamin wrote: On Saturday, 14 November 2015 at 12:14:42 UTC, Handyman wrote: Of course. That's why I mentioned my purpose of using Clock.currTime(), in the hope I got corrected in using the right and offical seed method which I failed to find,

Re: What does the -betterC switch in dmd do?

2015-11-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-11-16 01:27, Meta wrote: Don't those features require type info? Hmm, now that you mention it. I expected the compiler to give an error as soon as the D runtime was referenced, but that's at least not the case. -- /Jacob Carlborg