Re: Processing a gzipped csv-file by line-by-line

2017-05-11 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 12 May 2017 at 00:18:47 UTC, H. S. Teoh wrote: On Wed, May 10, 2017 at 11:40:08PM +, Jesse Phillips via Digitalmars-d-learn wrote: [...] H.S. Teoh mentioned fastcsv but requires all the data to be in memory. Or you could use std.mmfile. But if it's decompressed data, then it w

Re: Processing a gzipped csv-file by line-by-line

2017-05-11 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 10, 2017 at 11:40:08PM +, Jesse Phillips via Digitalmars-d-learn wrote: [...] > H.S. Teoh mentioned fastcsv but requires all the data to be in memory. Or you could use std.mmfile. But if it's decompressed data, then it would still need to be small enough to fit in memory. Well,

Re: Unicode Bidi Brackets in D std library?

2017-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, May 11, 2017 7:07:30 PM PDT Las via Digitalmars-d-learn wrote: > On Thursday, 11 May 2017 at 19:05:46 UTC, Las wrote: > > On Thursday, 11 May 2017 at 18:59:12 UTC, ag0aep6g wrote: > >> On 05/11/2017 08:27 PM, Las wrote: > >>> I see no way of getting > >>> [these](http://unicode.org/Pub

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread Jordan Wilson via Digitalmars-d-learn
On Thursday, 11 May 2017 at 18:07:47 UTC, H. S. Teoh wrote: On Thu, May 11, 2017 at 05:55:03PM +, k-five via Digitalmars-d-learn wrote: On Thursday, 11 May 2017 at 17:18:37 UTC, crimaniak wrote: > On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote: --

Re: Unicode Bidi Brackets in D std library?

2017-05-11 Thread Las via Digitalmars-d-learn
On Thursday, 11 May 2017 at 19:05:46 UTC, Las wrote: On Thursday, 11 May 2017 at 18:59:12 UTC, ag0aep6g wrote: On 05/11/2017 08:27 PM, Las wrote: I see no way of getting [these](http://unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt) properties for unicode code points in the std.uni library.

Re: Unicode Bidi Brackets in D std library?

2017-05-11 Thread Las via Digitalmars-d-learn
On Thursday, 11 May 2017 at 18:59:12 UTC, ag0aep6g wrote: On 05/11/2017 08:27 PM, Las wrote: I see no way of getting [these](http://unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt) properties for unicode code points in the std.uni library. How do I get these properties? Looks like it's to

Re: Unicode Bidi Brackets in D std library?

2017-05-11 Thread ag0aep6g via Digitalmars-d-learn
On 05/11/2017 08:27 PM, Las wrote: I see no way of getting [these](http://unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt) properties for unicode code points in the std.uni library. How do I get these properties? Looks like it's too new. std.uni references "Unicode v6.2" as the standard it

Re: Lookahead in unittest

2017-05-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-05-10 18:17, Stefan Koch wrote: It looks like this unitest-test block are treated like a function. unittest blocks are lowered to functions. -- /Jacob Carlborg

Unicode Bidi Brackets in D std library?

2017-05-11 Thread Las via Digitalmars-d-learn
I see no way of getting [these](http://unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt) properties for unicode code points in the std.uni library. How do I get these properties?

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 11, 2017 at 05:55:03PM +, k-five via Digitalmars-d-learn wrote: > On Thursday, 11 May 2017 at 17:18:37 UTC, crimaniak wrote: > > On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote: > - > > try this: > > https://dlang.org/p

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread k-five via Digitalmars-d-learn
On Thursday, 11 May 2017 at 17:18:37 UTC, crimaniak wrote: On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote: - try this: https://dlang.org/phobos/std_exception.html#ifThrown Worked. Thanks. import std.stdio; import std.conv: to

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread crimaniak via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote: I have a line of code that uses "to" function in std.conv for a purpose like: int index = to!int( user_apply[ 4 ] ); // string to int When the user_apply[ 4 ] has value, there is no problem; but when it is empty: "" it throws an ConvExc

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread k-five via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 21:44:32 UTC, Andrei Alexandrescu wrote: On 5/10/17 3:40 PM, k-five wrote: --- I no need to handle that, so is there any way to prevent this exception? Use the "parse" family: https://dlang.org/phobos/std_conv.html#parse -- Andrei

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-11 Thread k-five via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 21:19:21 UTC, Stanislav Blinov wrote: On Wednesday, 10 May 2017 at 15:35:24 UTC, k-five wrote: On Wednesday, 10 May 2017 at 14:27:46 UTC, Stanislav Blinov --- I don't understand. If you don't want to take c

Re: alias and UDAs

2017-05-11 Thread ag0aep6g via Digitalmars-d-learn
On 05/11/2017 12:39 PM, Andre Pany wrote: in this example, both asserts fails. Is my assumption right, that UDA on alias have no effect? If yes, I would like to see a compiler warning. But anyway, I do not understand why the second assertion fails. Are UDAs on arrays not allowed? import std.tra

Re: alias and UDAs

2017-05-11 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 11 May 2017 at 10:57:22 UTC, Stanislav Blinov wrote: On Thursday, 11 May 2017 at 10:39:03 UTC, Andre Pany wrote: [...] It should've been alias FooList = @Flattened Foo[]; which will generate a compile-time error (UDAs not allowed for alias declarations). And then: static ass

Re: alias and UDAs

2017-05-11 Thread Stanislav Blinov via Digitalmars-d-learn
On Thursday, 11 May 2017 at 10:39:03 UTC, Andre Pany wrote: Hi, in this example, both asserts fails. Is my assumption right, that UDA on alias have no effect? If yes, I would like to see a compiler warning. But anyway, I do not understand why the second assertion fails. Are UDAs on arrays n

alias and UDAs

2017-05-11 Thread Andre Pany via Digitalmars-d-learn
Hi, in this example, both asserts fails. Is my assumption right, that UDA on alias have no effect? If yes, I would like to see a compiler warning. But anyway, I do not understand why the second assertion fails. Are UDAs on arrays not allowed? import std.traits: hasUDA; enum Flattened; st

Re: struct File. property size.

2017-05-11 Thread AntonSotov via Digitalmars-d-learn
On Thursday, 11 May 2017 at 08:42:26 UTC, Nicholas Wilson wrote: Are you in windows perchance? IIRC the when compiling for 32 bit it doesn't use the 64 bit C file function so that will not work. Yes, windows. Ok, I understood you.

Re: struct File. property size.

2017-05-11 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 11 May 2017 at 07:24:00 UTC, AntonSotov wrote: import std.stdio; int main() { auto big = File("bigfile", "r+"); //bigfile size 20 GB writeln(big.size); // ERROR! return 0; } // std.exception.ErrnoException@std\stdio.d(1029): Could no

Re: struct File. property size.

2017-05-11 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 11 May 2017 at 07:24:00 UTC, AntonSotov wrote: import std.stdio; int main() { auto big = File("bigfile", "r+"); //bigfile size 20 GB writeln(big.size); // ERROR! return 0; } // std.exception.ErrnoException@std\stdio.d(1029): Could no

struct File. property size.

2017-05-11 Thread AntonSotov via Digitalmars-d-learn
import std.stdio; int main() { auto big = File("bigfile", "r+"); //bigfile size 20 GB writeln(big.size); // ERROR! return 0; } // std.exception.ErrnoException@std\stdio.d(1029): Could not seek in file `bigfile` (Invalid argument) I can not work