Re: Curl, how to recieve data.

2015-10-18 Thread holo via Digitalmars-d-learn
On Sunday, 18 October 2015 at 20:12:42 UTC, sigod wrote: On Sunday, 18 October 2015 at 20:05:24 UTC, holo wrote: @sigod Actually im working on ec2 requests. Thank you for help, it is working right now. I don't know why i was trying "+=" before instead of "~=". Is it good solution to make it

Re: kxml and dub package manager.

2015-10-18 Thread drug via Digitalmars-d-learn
19.10.2015 02:57, holo пишет: How to make dub to work for me? Try ``` import kxml.xml; // instead of import kxml; ```

Re: Curl, how to recieve data.

2015-10-18 Thread holo via Digitalmars-d-learn
@sigod Actually im working on ec2 requests. Thank you for help, it is working right now. I don't know why i was trying "+=" before instead of "~=". Is it good solution to make it such way? @Suliaman I need to collect information about my instances and put it to DB. I want to present those

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Mengu via Digitalmars-d-learn
On Sunday, 18 October 2015 at 13:29:50 UTC, Ola Fosheim Grøstad wrote: On Sunday, 18 October 2015 at 12:50:43 UTC, Namespace wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting

Re: kxml and dub package manager.

2015-10-18 Thread holo via Digitalmars-d-learn
ok i fugure out it. When i do initiation i need to add dependencies (thought it is enough to add them to sdl file). Proper initiation should look like that: dub init projectname kxml

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Sunday, 18 October 2015 at 20:44:44 UTC, Mengu wrote: i've seen the presentation and i can't stop thinking how it'd be if they had chosen D instead of Go. Not much better, probably worse, given that Go has stack protection for fibers and D doesn't. So in Go you can get away with 2K

Re: Curl, how to recieve data.

2015-10-18 Thread sigod via Digitalmars-d-learn
On Sunday, 18 October 2015 at 21:01:05 UTC, holo wrote: On Sunday, 18 October 2015 at 20:12:42 UTC, sigod wrote: [...] I changed it to such code: ... auto client = HTTP(endpoint ~ "?" ~ canonicalQueryString); client.method = HTTP.Method.get;

Re: Curl, how to recieve data.

2015-10-18 Thread sigod via Digitalmars-d-learn
On Sunday, 18 October 2015 at 20:05:24 UTC, holo wrote: @sigod Actually im working on ec2 requests. Thank you for help, it is working right now. I don't know why i was trying "+=" before instead of "~=". Is it good solution to make it such way? Not really as it will trigger allocation on

Re: Curl, how to recieve data.

2015-10-18 Thread holo via Digitalmars-d-learn
On Sunday, 18 October 2015 at 21:11:58 UTC, sigod wrote: On Sunday, 18 October 2015 at 21:01:05 UTC, holo wrote: On Sunday, 18 October 2015 at 20:12:42 UTC, sigod wrote: [...] I changed it to such code: ... auto client = HTTP(endpoint ~ "?" ~ canonicalQueryString);

Re: std.algorithm.startsWith only predicate

2015-10-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 18, 2015 17:48:18 Freddy via Digitalmars-d-learn wrote: > How do you call startsWith with only a predicate > --- > import std.algorithm; > import std.ascii; > > bool iden(string str) > { > return str.startsWith!(a => a.isAlpha || a == '_'); > } > --- startsWith doesn't

kxml and dub package manager.

2015-10-18 Thread holo via Digitalmars-d-learn
I want to add xml support to my application so i fetched kxml library with dub but it don't want to work for me. Steps and test code: [holo@ultraxps kxml]$ cat dub.sdl name "kxml" description "A minimal D application." copyright "Copyright © 2015, holo" authors "holo" dependencies "kxml"

Re: kxml and dub package manager.

2015-10-18 Thread holo via Digitalmars-d-learn
On Monday, 19 October 2015 at 03:04:28 UTC, drug wrote: 19.10.2015 02:57, holo пишет: How to make dub to work for me? Try ``` import kxml.xml; // instead of import kxml; ``` Same: [holo@ultraxps kxml]$ dub run Performing "debug" build using dmd for x86_64. kxml ~master: building

kxml - parsing AWS API xml respond

2015-10-18 Thread holo via Digitalmars-d-learn
I'm trying to take out from AWS respond needed information. Here is cut off part of example respond: ... i-x ami-x 16 running

Re: std.algorithm.startsWith only predicate

2015-10-18 Thread Freddy via Digitalmars-d-learn
On Sunday, 18 October 2015 at 17:58:30 UTC, Meta wrote: Is this a simplified use case of some actual code you have? Otherwise, you can just do: bool iden(string str) { auto f = str.front; return f.isAlpha || f == '_'; } It's simplified, i wanted to check for empty

Re: Curl, how to recieve data.

2015-10-18 Thread sigod via Digitalmars-d-learn
On Sunday, 18 October 2015 at 18:04:53 UTC, holo wrote: I'm trying to receive data from curl request my sample code looks like that: ... auto client = HTTP(endpoint ~ "?" ~ canonicalQueryString); client.method = HTTP.Method.get;

Re: Curl, how to recieve data.

2015-10-18 Thread Suliman via Digitalmars-d-learn
On Sunday, 18 October 2015 at 18:04:53 UTC, holo wrote: I'm trying to receive data from curl request my sample code looks like that: ... auto client = HTTP(endpoint ~ "?" ~ canonicalQueryString); client.method = HTTP.Method.get;

[sdc] linker problems when building programs with sdc

2015-10-18 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
Hello all, I recently decided to have another play with sdc to see how it's doing. Since my dmd is installed in /opt/dmd/ I had to do a couple of tricks to get sdc itself to build: (i) put a dlang.conf in /etc/ld.so.conf.d/ containing the /opt/dmd/lib64 path; (ii) call 'make

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Namespace via Digitalmars-d-learn
On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. Maybe also interesting:

Re: OT: why do people use python when it is slow?

2015-10-18 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 15 October 2015 at 21:16:18 UTC, Laeeth Isharc wrote: On Wednesday, 14 October 2015 at 22:11:56 UTC, data pulverizer wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Sunday, 18 October 2015 at 12:50:43 UTC, Namespace wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. Maybe also interesting:

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Namespace via Digitalmars-d-learn
On Sunday, 18 October 2015 at 13:29:50 UTC, Ola Fosheim Grøstad wrote: On Sunday, 18 October 2015 at 12:50:43 UTC, Namespace wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Suliman via Digitalmars-d-learn
On Friday, 16 October 2015 at 12:43:59 UTC, Meta wrote: On Friday, 16 October 2015 at 10:38:52 UTC, Shriramana Sharma wrote: Is there a particular reason that File.byLine() returns char[] and not string i.e. immutable(char)[]? Is it just to avoid being overly restrictive? It seems that having

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread novice2 via Digitalmars-d-learn
what buffer you are talking. internal buffer. where result line resides. And what is "signal"? How it's working? just the fact for programmer, that result line can be changed by other code (by phobos library code in this case). no any special programming "signal".

Re: [sdc] linker problems when building programs with sdc

2015-10-18 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 18 Oct 2015 11:35:16 +0200 schrieb Joseph Rushton Wakeling via Digitalmars-d-learn : > Hello all, > > I recently decided to have another play with sdc to see how it's doing. > Since > my dmd is installed in /opt/dmd/ I had to do a couple of tricks to

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Daniel Kozak via Digitalmars-d-learn
V Sun, 18 Oct 2015 15:51:13 + Suliman via Digitalmars-d-learn napsáno: > On Sunday, 18 October 2015 at 15:40:09 UTC, novice2 wrote: > >> what buffer you are talking. > > > > internal buffer. where result line resides. > > > > > >> And what is "signal"?

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Suliman via Digitalmars-d-learn
On Sunday, 18 October 2015 at 15:40:09 UTC, novice2 wrote: what buffer you are talking. internal buffer. where result line resides. And what is "signal"? How it's working? just the fact for programmer, that result line can be changed by other code (by phobos library code in this case).

Re: OT: why do people use python when it is slow?

2015-10-18 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Sunday, 18 October 2015 at 13:57:40 UTC, Namespace wrote: I liked the fact that Python with PyPy is more performant than Go (in contrast to the title "Python is slow") and that Go-Routines leak. Yes, Python apparently used less memory, which is rather important when you write a service

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Meta via Digitalmars-d-learn
On Sunday, 18 October 2015 at 15:03:22 UTC, Suliman wrote: Sorry, but could you explain more simply? I reread all information, bit can't understand about what buffer you are talking. This is more or less how byLine works, simplified: struct ByLine { File file; char[] line; char[]

std.algorithm.startsWith only predicate

2015-10-18 Thread Freddy via Digitalmars-d-learn
How do you call startsWith with only a predicate --- import std.algorithm; import std.ascii; bool iden(string str) { return str.startsWith!(a => a.isAlpha || a == '_'); } ---

Re: std.algorithm.startsWith only predicate

2015-10-18 Thread Meta via Digitalmars-d-learn
On Sunday, 18 October 2015 at 17:48:20 UTC, Freddy wrote: How do you call startsWith with only a predicate --- import std.algorithm; import std.ascii; bool iden(string str) { return str.startsWith!(a => a.isAlpha || a == '_'); } --- Is this a simplified use case of some actual code you

Curl, how to recieve data.

2015-10-18 Thread holo via Digitalmars-d-learn
I'm trying to receive data from curl request my sample code looks like that: ... auto client = HTTP(endpoint ~ "?" ~ canonicalQueryString); client.method = HTTP.Method.get; client.addRequestHeader("x-amz-date", xamztime);

Re: [sdc] linker problems when building programs with sdc

2015-10-18 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 18/10/15 19:43, Marco Leise via Digitalmars-d-learn wrote: Maybe you should have started with `return 42;`? :D writeln is not a light-weight in terms of exercised compiler features. I didn't even know that it compiles yet. Last time I heard it was not usable. Hahahahahahahaha :-D Turns out