Re: countUntil for SortedRange

2015-08-11 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 19:30:02 UTC, Laeeth Isharc wrote: Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best way to do that? It's not clear that countUntil treats a

Code Reviewer

2015-08-11 Thread Clayton via Digitalmars-d-learn
Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea is to have 6 final implementations ( 3 compile-time and 3 runtime) . I think am basically done with the

Problem with dmd 2.068 Win 32

2015-08-11 Thread MGW via Digitalmars-d-learn
Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake?

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 15:04:29 UTC, MGW wrote: Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake? See the changelog.

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread MGW via Digitalmars-d-learn
Thanks to all! The problem is localized!

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread Martin Nowak via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 15:04:29 UTC, MGW wrote: Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake? Try ddemangle

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 15:10:57 UTC, Dominikus Dittes Scherkl wrote: See the changelog. The compiler is now pickier if you forgot to link something explicitly. That shouldn't affect an Exception constructor through since they are part of the core druntime. I suspect it has to do

Re: Problem with dmd 2.068 Win 32

2015-08-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 15:18:31 UTC, Martin Nowak wrote: You either have a wrong import paths (check which dmd.conf is used with 'dmd -v non_existent') or a stable object_.di file. Or maybe a stale .obj or .lib file, referencing the old symbol. Try a make clean too - delete any .obj

countUntil for SortedRange

2015-08-11 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best way to do that? It's not clear that countUntil treats a SortedRange specially. I could get the lowerBound and then length or

Re: Infinity loop with dates comparison

2015-08-11 Thread anonymous via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote: Date startDate = Date.fromISOExtString(2014-08-01); [...] Date nextday; while (nextday currentDate) { nextday = startDate + 1.days; writeln(nextday); } startDate

Re: Infinity loop with dates comparison

2015-08-11 Thread cym13 via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote: The code look very trivial, but I am getting infinity loop like: 2014-Aug-02 2014-Aug-02 2014-Aug-02 ... 2014-Aug-02 Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days);

Infinity loop with dates comparison

2015-08-11 Thread Suliman via Digitalmars-d-learn
The code look very trivial, but I am getting infinity loop like: 2014-Aug-02 2014-Aug-02 2014-Aug-02 ... 2014-Aug-02 Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current day is not finished writeln(startDate);

Re: Infinity loop with dates comparison

2015-08-11 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Aug 11, 2015 at 07:56:00PM +, Suliman via Digitalmars-d-learn wrote: [...] Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current day is not finished writeln(startDate); writeln(currentDate);

Convert a hex color string into r,g,b components.

2015-08-11 Thread Marcin Szymczak via Digitalmars-d-learn
When programming i have encountered a simple ( i think ) problem, yet i can't get my head around it. I am trying to convert a string ( like #FF00FF for magenta ) into a color. I figured out that i need to skip the first character '#' and then using chunks range convert each pair of 2 chars

Re: Convert a hex color string into r,g,b components.

2015-08-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 22:11:51 UTC, Marcin Szymczak wrote: /usr/include/dlang/dmd/std/conv.d(295): Error: template std.conv.toImpl cannot deduce function from argument types !(ubyte)(Take!string, int), candidates are: I don't think to! with the base given works on the chunked

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:35:30 UTC, Mike Parker wrote: One of the best I've seen is by Anton Gerdelan [1]. The four [1] http://antongerdelan.net/opengl/index.html

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 03:32:47 UTC, DarthCthulhu wrote: So, any ideas what I'm doing wrong? Too much to list. I suggest you get going with a good tutorial. One of the best I've seen is by Anton Gerdelan [1]. The four basic tutorials he has on his site will be enough to get you up

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: static this() { DerelictGL3.load; DerelictGL.load; DerelictSDL2.load; SDL_Init(SDL_INIT_VIDEO); } I should point out that *either* DerelictGL3 *or* DerelictGL should be loaded, but never both. DerelictGL actually

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: For me the following code works: --- import derelict.sdl2.sdl; import derelict.opengl3.gl3; import derelict.opengl3.gl; import std.stdio; static this() { DerelictGL3.load; DerelictGL.load; DerelictSDL2.load;

Re: Code Reviewer

2015-08-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/08/2015 10:50 a.m., Clayton wrote: Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea is to have 6 final implementations ( 3 compile-time and 3 runtime) . I

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread BBasile via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 03:32:47 UTC, DarthCthulhu wrote: So I decided to try some OGL3 stuff in D utilizing the Derelict bindings and SDL. Creating an SDL-OGL window worked fine, but I'm having trouble with doing the most basic thing of rendering a triangle. I get the window just fine

Re: countUntil for SortedRange

2015-08-11 Thread Laeeth Isharc via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 21:38:49 UTC, John Colvin wrote: On Tuesday, 11 August 2015 at 19:30:02 UTC, Laeeth Isharc wrote: Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best

Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread DarthCthulhu via Digitalmars-d-learn
So I decided to try some OGL3 stuff in D utilizing the Derelict bindings and SDL. Creating an SDL-OGL window worked fine, but I'm having trouble with doing the most basic thing of rendering a triangle. I get the window just fine and the screen is being properly cleared and buffered, but no

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-11 Thread JN via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 03:32:47 UTC, DarthCthulhu wrote: So I decided to try some OGL3 stuff in D utilizing the Derelict bindings and SDL. Creating an SDL-OGL window worked fine, but I'm having trouble with doing the most basic thing of rendering a triangle. I get the window just fine