Re: Associative array literal: length wrong when duplicate keys found

2017-02-02 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 31 January 2017 at 19:45:33 UTC, Ivan Kazmenko wrote: On Tuesday, 31 January 2017 at 17:20:00 UTC, John Colvin wrote: It's a bug, please report it. The initializer should be statically disallowed. Anyway, I'll file a bug report. Hmm, found it:

The reason of vibed slow down (request timeout)

2017-02-02 Thread Suliman via Digitalmars-d-learn
I have simple web-app. Server part is based on vibed http://194.87.235.42:8080/ I can't understand the reason of issue. after some days of work when I trying to open it in web-browser it's begin opening very slooowly, or like now does not opens at all. On mobile web-browser I am getting

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
Dne 2.2.2017 v 21:43 John Doe via Digitalmars-d-learn napsal(a): On Thursday, 2 February 2017 at 20:26:36 UTC, Daniel Kozak wrote: Dne 2. 2. 2017 20:35 napsal uživatel "John Doe via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: On Thursday, 2 February 2017 at 18:58:46 UTC,

Re: offline library reference documentation

2017-02-02 Thread Soolayman via Digitalmars-d-learn
On Friday, 3 February 2017 at 03:59:17 UTC, Adam D. Ruppe wrote: On Friday, 3 February 2017 at 03:44:00 UTC, Soolayman wrote: Where can i get library reference for offline reading In the dmd zip there's a folder called "html" that contains a mirror of the website. Thanks.

Re: offline library reference documentation

2017-02-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 3 February 2017 at 03:44:00 UTC, Soolayman wrote: Where can i get library reference for offline reading In the dmd zip there's a folder called "html" that contains a mirror of the website.

offline library reference documentation

2017-02-02 Thread Soolayman via Digitalmars-d-learn
Where can i get library reference for offline reading

Re: capture stdout or stderr

2017-02-02 Thread Emil via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 14:38:18 UTC, angel wrote: On Wednesday, 1 February 2017 at 01:08:19 UTC, Emil wrote: is it possible to intercept the STDOUT or STDERR and capture the output into a variable ? . writeln(output_buffer); # prints '["test 1","test 2"]' No. Please keep in

Re: capture stdout or stderr

2017-02-02 Thread sarn via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 01:08:19 UTC, Emil wrote: is it possible to intercept the STDOUT or STDERR and capture the output into a variable ? some pseudocode to explain what I mean string[] output_buffer; stdout.capture_to(output_buffer); writeln("test 1"); # not printed

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
On Thursday, 2 February 2017 at 20:26:36 UTC, Daniel Kozak wrote: Dne 2. 2. 2017 20:35 napsal uživatel "John Doe via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: On Thursday, 2 February 2017 at 18:58:46 UTC, Daniel Kozak wrote: [...] Thanks readln is perfect. Since I am

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
Dne 2. 2. 2017 20:35 napsal uživatel "John Doe via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: On Thursday, 2 February 2017 at 18:58:46 UTC, Daniel Kozak wrote: > Even this one could works: > > import std.stdio; > > void main(string[] args) > { > auto range =

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Ali Çehreli via Digitalmars-d-learn
On 02/02/2017 11:30 AM, Daniel Kozak via Digitalmars-d-learn wrote: More range aproach, untested written on the fly from mobile phone import std.stdio : File; import std.range : chunks; import.std.algorithm : map, filter, array; void main() { auto r = File("text.txt").byLine

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
On Thursday, 2 February 2017 at 18:58:46 UTC, Daniel Kozak wrote: Even this one could works: import std.stdio; void main(string[] args) { auto range = File("text.txt").byLine(); foreach (line; range) { if (line != "") { writeln(line);

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
More range aproach, untested written on the fly from mobile phone import std.stdio : File; import std.range : chunks; import.std.algorithm : map, filter, array; void main() { auto r = File("text.txt").byLine .filter!(a=>a.length) .chunks(2) .map!(a=>[a[0].dup, a[1].dup])

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
Even this one could works: import std.stdio; void main(string[] args) { auto range = File("text.txt").byLine(); foreach (line; range) { if (line != "") { writeln(line); range.popFront; char[] url = range.front().dup;

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Jack Stouffer via Digitalmars-d-learn
On Thursday, 2 February 2017 at 18:18:13 UTC, John Doe wrote: Let's say you're trying to parse a file format like: Name http://example.com 123234 Foo Bar http://dlang.org 88 with blocks separated by varying amount of blank lines. - import std.stdio; void main(string[] args){

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
Dne 2. 2. 2017 7:24 PM napsal uživatel "Daniel Kozak" : There is a readln function, and this is not forum but just web frontend around mailing list. http://forum.dlang.org/help#about https://dlang.org/phobos/std_stdio.html#.File.readln

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread Daniel Kozak via Digitalmars-d-learn
There is a readln function, and this is not forum but just web frontend around mailing list. http://forum.dlang.org/help#about Dne 2. 2. 2017 7:20 PM napsal uživatel "John Doe via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: > Let's say you're trying to parse a file format like: >

Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
Let's say you're trying to parse a file format like: Name http://example.com 123234 Foo Bar http://dlang.org 88 with blocks separated by varying amount of blank lines. - import std.stdio; void main(string[] args){ auto range = File("text.txt").byLine(); foreach( line; range

Re: std.system reports win32 when running OS X

2017-02-02 Thread Dave Chapman via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 21:43:09 UTC, Ali Çehreli wrote: On 02/01/2017 01:34 PM, Dave Chapman wrote: I am running an iMac with OS X 10.11.5 (El Capitan) and dmd version 2.072.2 The following program prints out OS = win32. Is this the intended behavior? #!/usr/local/bin/rdmd import

Re: std.system reports win32 when running OS X

2017-02-02 Thread Bauss via Digitalmars-d-learn
On Thursday, 2 February 2017 at 08:42:44 UTC, Andrea Fontana wrote: On Wednesday, 1 February 2017 at 21:43:09 UTC, Ali Çehreli wrote: That's a local variable that you've defined. Since OS.init happens to be OS.win32, that's what you get. :) Maybe it should be "unknown" or "undefined" :)

Re: std.system reports win32 when running OS X

2017-02-02 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 21:43:09 UTC, Ali Çehreli wrote: That's a local variable that you've defined. Since OS.init happens to be OS.win32, that's what you get. :) Maybe it should be "unknown" or "undefined" :)