Re: Mixin and map

2015-04-05 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 5 April 2015 at 21:23:14 UTC, Dennis Ritchie wrote: Hi, Can you please tell how to make map worked correctly. I want to program published [2, 3, 4, 5, 6]. - import std.stdio; import std.algorithm; string print(string s) { return `writeln(` ~ s ~ `);`; } void main() {

Re: CURL to get/set cookies

2015-04-05 Thread Benjamin via Digitalmars-d-learn
Im still not able to set the cookie. Would it be possible to provide a few sample lines - to ensure I'm on the right path. I appreciate any additional help!! Thanks! Benjamin On Wednesday, 1 April 2015 at 14:33:55 UTC, Adam D. Ruppe wrote: There's two ways, you can let curl handle it by

Re: Speed of horizontal flip

2015-04-05 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 1 April 2015 at 13:52:06 UTC, tchaloupka wrote: C#: PNG load - 90ms PNG flip - 10ms PNG save - 380ms D using dlib (http://code.dlang.org/packages/dlib): PNG load - 500ms PNG flip - 30ms PNG save - 950ms D using imageformats (http://code.dlang.org/packages/imageformats): PNG load

Binary search in structs

2015-04-05 Thread FreeSlave via Digitalmars-d-learn
I have array of structs sorted by specific field. How can I perform binary search using this field as a key? Currently I ended up with this, but it gives error: struct S { int i; string s; } import std.range; void main(string [] args) { S[] structs = [{1,hello}, {2,world}, {3,

Re: Binary search in structs

2015-04-05 Thread w0rp via Digitalmars-d-learn
On Sunday, 5 April 2015 at 23:06:27 UTC, FreeSlave wrote: I have array of structs sorted by specific field. How can I perform binary search using this field as a key? Currently I ended up with this, but it gives error: struct S { int i; string s; } import std.range; void main(string

Re: CURL to get/set cookies

2015-04-05 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 5 April 2015 at 23:55:15 UTC, Benjamin wrote: Im still not able to set the cookie. Would it be possible to provide a few sample lines - to ensure I'm on the right path. I appreciate any additional help!! Thanks! Benjamin This should work: auto cookiesFile = cookies.txt; auto

Re: Mixin and map

2015-04-05 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 5 April 2015 at 21:28:27 UTC, Gary Willoughby wrote: Post incrementing t is not storing the increments value. http://ideone.com/1gGnvP Thanks.

Mixin and map

2015-04-05 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, Can you please tell how to make map worked correctly. I want to program published [2, 3, 4, 5, 6]. - import std.stdio; import std.algorithm; string print(string s) { return `writeln(` ~ s ~ `);`; } void main() { auto arr = [1, 2, 3, 4, 5];

Re: Binary search in structs

2015-04-05 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 5 April 2015 at 23:15:04 UTC, w0rp wrote: On Sunday, 5 April 2015 at 23:06:27 UTC, FreeSlave wrote: I have array of structs sorted by specific field. How can I perform binary search using this field as a key? Currently I ended up with this, but it gives error: struct S { int i;

Re: [dimgui] building results in 16 warnings, no error BUT: Building .dub\lib\imgui_d.lib failed!

2015-04-05 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 4 April 2015 at 21:29:57 UTC, Jacques Müller wrote: On Saturday, 4 April 2015 at 18:11:32 UTC, ParticlePeter wrote: Hi, am still searching for the right place to ask library related questions, and was advised to ask them here. The dimgui library looks interesting for my projects

Re: Placing variable/array in a particular section

2015-04-05 Thread Jens Bauer via Digitalmars-d-learn
On Sunday, 5 April 2015 at 10:16:10 UTC, Johannes Pfau wrote: I'll push support for the section attribute in 1~2 hours. (waiting for the testsuite ;-) [1] https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/attribute.d I've made a couple of tests and it all works

Re: C++ to D - recursion with std.variant

2015-04-05 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 April 2015 at 16:46:08 UTC, Dennis Ritchie wrote: Hi, Is it possible to write on D recursion using std.variant? Using Algebraic from std.variant and some additional templates: http://dpaste.dzfl.pl/65afd3a7ce52 (taken from this thread:

Re: Placing variable/array in a particular section

2015-04-05 Thread Jens Bauer via Digitalmars-d-learn
On Sunday, 5 April 2015 at 10:16:10 UTC, Johannes Pfau wrote: On 4/04/2015 3:08 a.m., Jens Bauer wrote: It's possible to use gcc.attribute with custom mini-runtimes. You need the gcc/attribute.d file but you can simply copy/paste it from druntime[1], there are no dependencies. After

Re: Placing variable/array in a particular section

2015-04-05 Thread Johannes Pfau via Digitalmars-d-learn
Am Sat, 04 Apr 2015 10:38:44 + schrieb Jens Bauer doc...@who.no: On Saturday, 4 April 2015 at 02:57:22 UTC, Rikki Cattermole wrote: On 4/04/2015 3:08 a.m., Jens Bauer wrote: src/start.d:7:10: error: module attribute is in file 'gcc/attribute.d' which cannot be read import

Re: C++ to D - recursion with std.variant

2015-04-05 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 5 April 2015 at 09:48:01 UTC, thedeemon wrote: On Friday, 3 April 2015 at 16:46:08 UTC, Dennis Ritchie wrote: Hi, Is it possible to write on D recursion using std.variant? Using Algebraic from std.variant and some additional templates: http://dpaste.dzfl.pl/65afd3a7ce52 (taken