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

Re: Code Reviewer

2015-08-13 Thread Clayton via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 13:14:04 UTC, sigod wrote: On Tuesday, 11 August 2015 at 22:50:52 UTC, 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.

Re: Code Reviewer

2015-08-13 Thread Clayton via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:14:20 UTC, Rikki Cattermole wrote: On 13/08/2015 12:09 a.m., Clayton wrote: On Wednesday, 12 August 2015 at 02:49:59 UTC, Rikki Cattermole wrote: On 12/08/2015 10:50 a.m., Clayton wrote: [...] Upload to e.g. Github/gist/pastebin. Hi Rikki, can I have

Re: Code Reviewer

2015-08-12 Thread Clayton via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 02:49:59 UTC, Rikki Cattermole wrote: 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

Re: Measuring Execution time

2015-07-22 Thread Clayton via Digitalmars-d-learn
On Wednesday, 22 July 2015 at 09:32:15 UTC, John Colvin wrote: On Wednesday, 22 July 2015 at 09:23:36 UTC, Clayton wrote: [...] The normal way of doing this would be using std.datetime.StopWatch: StopWatch sw; sw.start(); algorithm(); long exec_ms = sw.peek().msecs; Much

Measuring Execution time

2015-07-22 Thread Clayton via Digitalmars-d-learn
How does one represent Duration in only Micro-seconds, or milliseconds. Trying to measure the execution time of an algorithm and I get 4 ms, 619 μs, and 8 hnsecs , I want to sum all these and get total hnsecs or μs . I would also appreciate advise on whether this is the best way to measure

Re: Measuring Execution time

2015-07-23 Thread Clayton via Digitalmars-d-learn
On Wednesday, 22 July 2015 at 09:32:15 UTC, John Colvin wrote: On Wednesday, 22 July 2015 at 09:23:36 UTC, Clayton wrote: [...] The normal way of doing this would be using std.datetime.StopWatch: StopWatch sw; sw.start(); algorithm(); long exec_ms = sw.peek().msecs; Am

String Metaprogramming

2015-07-18 Thread Clayton via Digitalmars-d-learn
Am new to D programming, am considering it since it supports compile-time function execution . My challenge is how can I re-implement the function below so that it is fully executed in compile-time. The function should result to tabel1 being computed at compile-time. There seems to be a lot of

Re: String Metaprogramming

2015-07-18 Thread Clayton via Digitalmars-d-learn
On Saturday, 18 July 2015 at 16:01:25 UTC, Nicholas Wilson wrote: On Saturday, 18 July 2015 at 13:48:20 UTC, Clayton wrote: [...] [...] change function signature to int[char] function(string) or as the char type is the index probably better of as int[256] function(string). also probably

Re: String Metaprogramming

2015-07-18 Thread Clayton via Digitalmars-d-learn
On Saturday, 18 July 2015 at 13:56:36 UTC, Adam D. Ruppe wrote: On Saturday, 18 July 2015 at 13:48:20 UTC, Clayton wrote: There seems to be a lot of mutation happening here yet I have heard no mutation should take place in meta-programming as it subscribes to functional programming paradigm.

static-if cant compile

2015-07-19 Thread Clayton via Digitalmars-d-learn
Pardon me for trivial question, Am new to D. Why would a statement as below fail to compile. The plan is to do some computation at compile-time hence considering the static-if statement which fails to compile. The regular if-statement compiles but is not useful since it is a runtime

monitoring variable evaluation time

2015-07-20 Thread Clayton via Digitalmars-d-learn
What could be the best-tool for monitoring the evaluation time of a variable . What I usually do is run the command :- - dmd -J. program.d Then I inspect the program.o file using vi for presence of compile-time constants and enums. I am wondering if this is the right way to do this. Am a bit

Re: monitoring variable evaluation time

2015-07-20 Thread Clayton via Digitalmars-d-learn
On Monday, 20 July 2015 at 09:29:26 UTC, anonymous wrote: On Monday, 20 July 2015 at 08:53:52 UTC, Clayton wrote: [...] You mean you want to know if some value is pre-computed during compilation? [...] Thankyou a lot for the suggestion. Am noting as I learn the language.

Re: monitoring variable evaluation time

2015-07-20 Thread Clayton via Digitalmars-d-learn
On Monday, 20 July 2015 at 10:11:10 UTC, Marc Schütz wrote: On Monday, 20 July 2015 at 08:53:52 UTC, Clayton wrote: [...] I'm not sure that's what you want to know, but... The evaluation time of expressions is completely deterministic. Global (module level) or static variables, default

Re: C Style char**

2019-05-13 Thread Doug Clayton via Digitalmars-d-learn
On Monday, 13 May 2019 at 09:56:19 UTC, evilrat wrote: On Monday, 13 May 2019 at 09:24:34 UTC, Doug Clayton wrote: [...] You don't need to cast it, arrays have .ptr property to get pointer to first element, and in @safe you just [0] instead, or so I think. If you are using static/literal

C Style char**

2019-05-13 Thread Doug Clayton via Digitalmars-d-learn
Hi All, First time poster :) I'm working on getting a binding to Vulkan working properly in D, but I've run into a roadblock. The good news is that the binding seems to work fine, but I'm having an issue getting a parameter that needs an input of a const(char*)* to receive all of the