www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Quick Start with D: few examples and set of links.

reply "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
http://d.readthedocs.org

I hope this examples will be useful for students.

Ilya
May 01 2015
next sibling parent reply "Namespace" <rswhite4 gmail.com> writes:
On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
 Hellow Wolrd!
Is this intended?
May 01 2015
parent reply "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
On Friday, 1 May 2015 at 08:45:35 UTC, Namespace wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
 Hellow Wolrd!
Is this intended?
Thanks! Fixed.
May 01 2015
next sibling parent "Andy Smith" <andyrsmith googlemail.com> writes:
very nice examples. Kudos! A.


On Friday, 1 May 2015 at 09:49:51 UTC, Ilya Yaroshenko wrote:
 On Friday, 1 May 2015 at 08:45:35 UTC, Namespace wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
 Hellow Wolrd!
Is this intended?
Thanks! Fixed.
May 01 2015
prev sibling parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 05/01/2015 02:49 AM, Ilya Yaroshenko wrote:
 On Friday, 1 May 2015 at 08:45:35 UTC, Namespace wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
 Hellow Wolrd!
Is this intended?
Thanks! Fixed.
Now it's time to fix the other typo there: Wolrd -> World :) Ali
May 01 2015
parent "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
On Friday, 1 May 2015 at 15:25:28 UTC, Ali Çehreli wrote:
 On 05/01/2015 02:49 AM, Ilya Yaroshenko wrote:
 On Friday, 1 May 2015 at 08:45:35 UTC, Namespace wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
 Hellow Wolrd!
Is this intended?
Thanks! Fixed.
Now it's time to fix the other typo there: Wolrd -> World :) Ali
OMG! This article is my work for english exams >< Thank you)
May 01 2015
prev sibling next sibling parent "Chris" <wendlec tcd.ie> writes:
On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Thanks. That's very good and exactly what we need for people to lose their fear of touching D.
May 01 2015
prev sibling next sibling parent reply "cym13" <cpicard openmailbox.org> writes:
On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Showing how easy interacting with python can be is a very good idea, and doing so by dealing with scientific data is an even better one!
May 01 2015
next sibling parent "Chris" <wendlec tcd.ie> writes:
On Friday, 1 May 2015 at 09:14:19 UTC, cym13 wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Showing how easy interacting with python can be is a very good idea, and doing so by dealing with scientific data is an even better one!
+1
May 01 2015
prev sibling parent reply Iain Buclaw via Digitalmars-d-announce writes:
On 1 May 2015 at 11:14, cym13 via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Showing how easy interacting with python can be is a very good idea, and doing so by dealing with scientific data is an even better one!
Only comment I have to say on it is rather than embedding the python script in a string, use import! immutable script = import("myscript.py"); Iain
May 03 2015
parent "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
On Sunday, 3 May 2015 at 09:46:13 UTC, Iain Buclaw wrote:
 On 1 May 2015 at 11:14, cym13 via Digitalmars-d-announce
 <digitalmars-d-announce puremagic.com> wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Showing how easy interacting with python can be is a very good idea, and doing so by dealing with scientific data is an even better one!
Only comment I have to say on it is rather than embedding the python script in a string, use import! immutable script = import("myscript.py"); Iain
Thanks! Implemented. Ilya
May 03 2015
prev sibling next sibling parent "Laeeth Isharc" <laeeth nospamlaeeth.com> writes:
On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
very nice. I didn't know about the D interface to some of those chart libraries. if you would care to incorporate some of the new things you mention in your piece in the python section of the wiki, I think that would be very helpful: http://wiki.dlang.org/Programming_in_D_for_Python_Programmers
May 01 2015
prev sibling next sibling parent reply "Anonymous" <anon yahoo.com> writes:
This is great, thank you.

I couldn't get the example in the introduction to work without 
adding .map!(chomp) to the pipeline:

auto sample = File("10numbers.txt")
         .byLine
         .takeExactly(10)
         .map!(chomp)
	.map!(to!double)
         .tee!((x){mean += x;})
         .array;

Without that, I got an error converting to a double (my file had 
'\r' after each number)

On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
May 01 2015
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Friday, 1 May 2015 at 14:01:38 UTC, Anonymous wrote:
 This is great, thank you.

 I couldn't get the example in the introduction to work without 
 adding .map!(chomp) to the pipeline:

 auto sample = File("10numbers.txt")
         .byLine
         .takeExactly(10)
         .map!(chomp)
 	.map!(to!double)
         .tee!((x){mean += x;})
         .array;

 Without that, I got an error converting to a double (my file 
 had '\r' after each number)
Alternatively, byLine(KeepTerminator.no, terminator = std.ascii.newline) could help if you know you're dealing with native file-endings.
May 01 2015
prev sibling next sibling parent "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
Thank you for the patch for windows line endings!

On Friday, 1 May 2015 at 14:01:38 UTC, Anonymous wrote:
 This is great, thank you.

 I couldn't get the example in the introduction to work without 
 adding .map!(chomp) to the pipeline:

 auto sample = File("10numbers.txt")
         .byLine
         .takeExactly(10)
         .map!(chomp)
 	.map!(to!double)
         .tee!((x){mean += x;})
         .array;

 Without that, I got an error converting to a double (my file 
 had '\r' after each number)

 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
May 01 2015
prev sibling parent reply "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
On Friday, 1 May 2015 at 14:01:38 UTC, Anonymous wrote:
 This is great, thank you.

 I couldn't get the example in the introduction to work without 
 adding .map!(chomp) to the pipeline:

 auto sample = File("10numbers.txt")
         .byLine
         .takeExactly(10)
         .map!(chomp)
 	.map!(to!double)
         .tee!((x){mean += x;})
         .array;

 Without that, I got an error converting to a double (my file 
 had '\r' after each number)

 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
`parse` should works with whitespace after number: auto sample = File("10numbers.txt") .byLine .takeExactly(10) .map!(line => parse!double(line)) .tee!((x){mean += x;}) .array;
May 01 2015
parent reply "Anonymous" <anon yahoo.com> writes:
Yes, that works. I also tried what John Colvin suggested 
(.byLine(KeepTerminator.no, std.ascii.newline) and that works 
too. Is it true that both of those are better than adding chomp 
because it would be one less time through the pipeline?

Learned several new things today! Thanks again!

On Friday, 1 May 2015 at 15:03:33 UTC, Ilya Yaroshenko wrote:
 On Friday, 1 May 2015 at 14:01:38 UTC, Anonymous wrote:
 This is great, thank you.

 I couldn't get the example in the introduction to work without 
 adding .map!(chomp) to the pipeline:

 auto sample = File("10numbers.txt")
        .byLine
        .takeExactly(10)
        .map!(chomp)
 	.map!(to!double)
        .tee!((x){mean += x;})
        .array;

 Without that, I got an error converting to a double (my file 
 had '\r' after each number)

 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
`parse` should works with whitespace after number: auto sample = File("10numbers.txt") .byLine .takeExactly(10) .map!(line => parse!double(line)) .tee!((x){mean += x;}) .array;
May 01 2015
parent reply "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
Pipeline should be optimised (I am not sure about `tee`) by LDC, 
GDC and probably DMD so all examples are generaly equal.

On Friday, 1 May 2015 at 15:15:14 UTC, Anonymous wrote:
 Yes, that works. I also tried what John Colvin suggested 
 (.byLine(KeepTerminator.no, std.ascii.newline) and that works 
 too. Is it true that both of those are better than adding chomp 
 because it would be one less time through the pipeline?

 Learned several new things today! Thanks again!

 On Friday, 1 May 2015 at 15:03:33 UTC, Ilya Yaroshenko wrote:
 On Friday, 1 May 2015 at 14:01:38 UTC, Anonymous wrote:
 This is great, thank you.

 I couldn't get the example in the introduction to work 
 without adding .map!(chomp) to the pipeline:

 auto sample = File("10numbers.txt")
       .byLine
       .takeExactly(10)
       .map!(chomp)
 	.map!(to!double)
       .tee!((x){mean += x;})
       .array;

 Without that, I got an error converting to a double (my file 
 had '\r' after each number)

 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
`parse` should works with whitespace after number: auto sample = File("10numbers.txt") .byLine .takeExactly(10) .map!(line => parse!double(line)) .tee!((x){mean += x;}) .array;
May 01 2015
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Friday, 1 May 2015 at 15:53:12 UTC, Ilya Yaroshenko wrote:
 Pipeline should be optimised (I am not sure about `tee`) by 
 LDC, GDC and probably DMD so all examples are generaly equal.
Yeah I wouldn't expect a big difference here. Even if things aren't well optimised, the various branches should be very predictable.
May 01 2015
prev sibling next sibling parent reply "xky" <mozirikan gmail.com> writes:
On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Nice tutorial! Thanks! By the way, can i try to translation for korean? :)
May 01 2015
parent "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
On Friday, 1 May 2015 at 15:11:37 UTC, xky wrote:
 On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
Nice tutorial! Thanks! By the way, can i try to translation for korean? :)
Iit would be great! See also: 1. Localisation with RST: http://docs.readthedocs.org/en/latest/localization.html 2. GitHub page: https://github.com/9il/thenextafterc/tree/master
May 01 2015
prev sibling parent "rom" <monfollet.romain hotmail.fr> writes:
Congratulations on that web site : trendy stripped down and 
efficient style, greatly instructive and easy to read for the new 
comers. That's what i think the D language misses the most, if i 
may.

Rom

On Friday, 1 May 2015 at 08:18:10 UTC, Ilya Yaroshenko wrote:
 http://d.readthedocs.org

 I hope this examples will be useful for students.

 Ilya
May 02 2015