Re: Printing an std.container.Array

2015-04-17 Thread Daniel Kozák via Digitalmars-d-learn
On Thu, 16 Apr 2015 20:18:40 + Panke via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Yep, but problem is almost no one expect this, or know this. We definitely should do better. How? Improve doc at least. But it would be fine to have something like dump function

Re: What is the memory usage of my app?

2015-04-17 Thread Adil via Digitalmars-d-learn
On Thursday, 16 April 2015 at 17:13:25 UTC, Laeeth Isharc wrote: Fwiw, I have been working on something similar. Others will have more experience on the GC, but perhaps you might find this interesting. For CSV files, what I found is that parsing is quite slow (and memory intensive). So

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-17 Thread Dicebot via Digitalmars-d-learn
On Thursday, 16 April 2015 at 12:39:07 UTC, Jacob Carlborg wrote: On 2015-04-16 11:56, Dicebot wrote: Simple issue but unpleasant fix. You always must use C++ library that matches base C++ compiler. For GDC it is GCC (which is used by default). For DMD it is DMC (Digital Mars C compiler). For

Re: What is the memory usage of my app?

2015-04-17 Thread Adil via Digitalmars-d-learn
On Thursday, 16 April 2015 at 20:33:17 UTC, Marc Schütz wrote: On Thursday, 16 April 2015 at 17:13:25 UTC, Laeeth Isharc wrote: For CSV files, what I found is that parsing is quite slow (and memory intensive). If your sure that CSV reading is the culprit, writing a custom parser could help.

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 10:16, Dicebot wrote: Does DMD also use GCC conventions on Linux when compiling extern(C++) code? I didn't know that. Not exactly sure that you mean by conventions but extern(C++) and extern(C) follows the ABI of the system compiler. On Linux that is GCC, on OS X it's

Re: Formatted output ranges

2015-04-17 Thread Ivan Kazmenko via Digitalmars-d-learn
On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie wrote: I also want to know whether it is possible to D somehow set the maximum width of the print string in characters? - void main() { import std.stdio, std.range; writefln(;; %(%s, %))., iota(10, 1101)); } -

Re: Interlocked (compare) exchange

2015-04-17 Thread Max Klyga via Digitalmars-d-learn
On 2015-04-17 10:36:31 +, Szymon Gatner said: Hi, are there equivalents of Interlocked.Exchange [1] and Interlocked.CompareExchange [2] in D? I can't find it in teh docs? [1] https://msdn.microsoft.com/en-us/library/f2090ex9(v=vs.110).aspx [2]

Re: About @ and UDA

2015-04-17 Thread Sönke Ludwig via Digitalmars-d-learn
Am 15.04.2015 um 18:59 schrieb ketmar: On Wed, 15 Apr 2015 08:53:05 +, Andrea Fontana wrote: My 2 cents. If I remember correctly, @ prefix in @safe, @trusted, @system, etc was added just to avoid keywords pollution, right? Now UDA uses the same prefix: if some new

Re: Where is COFFIMPLIB

2015-04-17 Thread Adam D. Ruppe via Digitalmars-d-learn
coffimplib is a paid utility out of the $15 extended utility package http://digitalmars.com/eup.html buy from here (be sure javascript is enabled or the form won't even appear) http://digitalmars.com/shop.html and yeah i realized this is a pain, it is just the way it is...

Re: Printing an std.container.Array

2015-04-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/15 5:18 PM, Dennis Ritchie wrote: On Thursday, 16 April 2015 at 20:34:19 UTC, Steven Schveighoffer wrote: On 4/16/15 4:18 PM, Panke wrote: Yep, but problem is almost no one expect this, or know this. We definitely should do better. How? By doing what is expected. Print the array

Re: Formatted output ranges

2015-04-17 Thread Dennis Ritchie via Digitalmars-d-learn
On Friday, 17 April 2015 at 09:25:43 UTC, Ivan Kazmenko wrote: On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie wrote: I also want to know whether it is possible to D somehow set the maximum width of the print string in characters? - void main() { import std.stdio,

Re: Printing an std.container.Array

2015-04-17 Thread Bayan Rafeh via Digitalmars-d-learn
On Thursday, 16 April 2015 at 20:08:30 UTC, H. S. Teoh wrote: On Thu, Apr 16, 2015 at 07:55:52PM +, Bayan Rafeh via Digitalmars-d-learn wrote: Executing this code: import std.container.array; import std.stdio; int main() { writeln(Array!int([1, 2])); return 0; } outputs

Re: Interlocked (compare) exchange

2015-04-17 Thread rumbu via Digitalmars-d-learn
On Friday, 17 April 2015 at 10:36:33 UTC, Szymon Gatner wrote: Hi, are there equivalents of Interlocked.Exchange [1] and Interlocked.CompareExchange [2] in D? I can't find it in teh docs? [1] https://msdn.microsoft.com/en-us/library/f2090ex9(v=vs.110).aspx [2]

Re: Interlocked (compare) exchange

2015-04-17 Thread Szymon Gatner via Digitalmars-d-learn
On Friday, 17 April 2015 at 11:00:40 UTC, rumbu wrote: On Friday, 17 April 2015 at 10:36:33 UTC, Szymon Gatner wrote: Hi, are there equivalents of Interlocked.Exchange [1] and Interlocked.CompareExchange [2] in D? I can't find it in teh docs? [1]

Interlocked (compare) exchange

2015-04-17 Thread Szymon Gatner via Digitalmars-d-learn
Hi, are there equivalents of Interlocked.Exchange [1] and Interlocked.CompareExchange [2] in D? I can't find it in teh docs? [1] https://msdn.microsoft.com/en-us/library/f2090ex9(v=vs.110).aspx [2] https://msdn.microsoft.com/en-us/library/h7etff8w(v=vs.110).aspx

Re: GC: Memory keeps growing

2015-04-17 Thread Chris via Digitalmars-d-learn
On Thursday, 16 April 2015 at 18:51:25 UTC, Kagamin wrote: On Wednesday, 15 April 2015 at 12:03:49 UTC, Chris wrote: There might be some low-hanging fruit there. However, before I change anything, maybe you guys have some suggestions. See if switching to 64-bit mode changes anything. 64bit

Re: Interlocked (compare) exchange

2015-04-17 Thread Tobias Pankrath via Digitalmars-d-learn
On Friday, 17 April 2015 at 10:36:33 UTC, Szymon Gatner wrote: Hi, are there equivalents of Interlocked.Exchange [1] and Interlocked.CompareExchange [2] in D? I can't find it in teh docs? [1] https://msdn.microsoft.com/en-us/library/f2090ex9(v=vs.110).aspx [2]

Where is COFFIMPLIB

2015-04-17 Thread Darrell Gallion via Digitalmars-d-learn
Attempting to link to snappy.lib on windows. Getting the infamous Error 43: Not a Valid Library File The conversion from COFF Format to OMF Format seems like the issue. The fix isn't so clear. There's an ftp site that needs a password. ftp://digitalmars.com/coffimplib.zip Thanks -=Darrell

randomUUID for runtime / how to generate UUIDs in runtime

2015-04-17 Thread via Digitalmars-d-learn
Hi! In the std.uuid PHOBOS library doc I found: @trusted UUID randomUUID(); This function generates a random number based UUID from a random number generator. CTFE: This function is not supported at compile time. Than trying a call like auto uuid = randomUUID() results in an

Re: randomUUID for runtime / how to generate UUIDs in runtime

2015-04-17 Thread Ali Çehreli via Digitalmars-d-learn
On 04/17/2015 07:05 AM, Ozan =?UTF-8?B?U8O8ZWwi?= ozan.su...@gmail.com wrote: CTFE: This function is not supported at compile time. Than trying a call like auto uuid = randomUUID() results in an error message: /usr/include/dmd/phobos/std/random.d(1138,10): Error: static

Re: What is the memory usage of my app?

2015-04-17 Thread via Digitalmars-d-learn
On Friday, 17 April 2015 at 14:49:19 UTC, Márcio Martins wrote: On Thursday, 16 April 2015 at 12:17:24 UTC, Adil wrote: I've written a simple socket-server app that securities (stock market shares) data and allows clients to query over them. The app starts by loading instrument information from

Re: What is the memory usage of my app?

2015-04-17 Thread via Digitalmars-d-learn
On Thursday, 16 April 2015 at 12:17:24 UTC, Adil wrote: I've written a simple socket-server app that securities (stock market shares) data and allows clients to query over them. The app starts by loading instrument information from a CSV file into some structs, then listens on a socket

Re: Where is COFFIMPLIB

2015-04-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Apr 2015 19:48:05 +, rumbu wrote: On Friday, 17 April 2015 at 14:39:52 UTC, Adam D. Ruppe wrote: coffimplib is a paid utility out of the $15 extended utility package http://digitalmars.com/eup.html buy from here (be sure javascript is enabled or the form won't even appear)

Re: Where is COFFIMPLIB

2015-04-17 Thread rumbu via Digitalmars-d-learn
On Friday, 17 April 2015 at 19:50:13 UTC, ketmar wrote: On Fri, 17 Apr 2015 19:48:05 +, rumbu wrote: On Friday, 17 April 2015 at 14:39:52 UTC, Adam D. Ruppe wrote: coffimplib is a paid utility out of the $15 extended utility package http://digitalmars.com/eup.html buy from here (be

Re: randomUUID for runtime / how to generate UUIDs in runtime

2015-04-17 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 17 April 2015 at 14:05:26 UTC, Ozan Süel wrote: Why I'm asking: I want to create class instances with an unique id as default. But now that great idea seems to be a death end. Sounds like your code is something like: class foo { auto myid = randomUUID(); } The compiler

Re: Where is COFFIMPLIB

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 16:20, Darrell Gallion wrote: Attempting to link to snappy.lib on windows. Getting the infamous Error 43: Not a Valid Library File The conversion from COFF Format to OMF Format seems like the issue. The fix isn't so clear. There's an ftp site that needs a password.

Re: About @ and UDA

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 16:34, Sönke Ludwig wrote: +1 for body I still haven't got the reason though, why safe and friends cannot simply be UDAs defined in object.d that the compiler recognizes. UDA's were available when these attributes/keywords were created. Reasons why they're still not UDA's are

Re: Where is COFFIMPLIB

2015-04-17 Thread rumbu via Digitalmars-d-learn
On Friday, 17 April 2015 at 14:39:52 UTC, Adam D. Ruppe wrote: coffimplib is a paid utility out of the $15 extended utility package http://digitalmars.com/eup.html buy from here (be sure javascript is enabled or the form won't even appear) http://digitalmars.com/shop.html and yeah i

Re: Where is COFFIMPLIB

2015-04-17 Thread ketmar via Digitalmars-d-learn
On Fri, 17 Apr 2015 20:05:42 +, rumbu wrote: On Friday, 17 April 2015 at 19:50:13 UTC, ketmar wrote: On Fri, 17 Apr 2015 19:48:05 +, rumbu wrote: On Friday, 17 April 2015 at 14:39:52 UTC, Adam D. Ruppe wrote: coffimplib is a paid utility out of the $15 extended utility package

Re: Why doesn't map!(a = writeln(a)) print anything?

2015-04-17 Thread Mark Isaacson via Digitalmars-d-learn
On Saturday, 18 April 2015 at 01:04:24 UTC, Adam D. Ruppe wrote: map evaluates its arguments on demand. Think of it as returning a function that does the work instead of actually doing the work - you still need to call that function, which happens when you loop over it. std.algorithm.each is

Re: Why doesn't map!(a = writeln(a)) print anything?

2015-04-17 Thread Adam D. Ruppe via Digitalmars-d-learn
map evaluates its arguments on demand. Think of it as returning a function that does the work instead of actually doing the work - you still need to call that function, which happens when you loop over it. std.algorithm.each is more appropriate for acting now.

Why doesn't map!(a = writeln(a)) print anything?

2015-04-17 Thread Mark Isaacson via Digitalmars-d-learn
Why can't I print things using the map algorithm? Specifically: http://ideone.com/VLp4Xa