Another solution using dlangs builtin csv support for reading.
import std.csv;
import std.file;
import std.algorithm : map;
import std.range;
string csvWrite(Header, Rows)(Header header, Rows rows)
{
return header.join(",") ~ "\n" ~ rows.map!(r => header.map!(h =>
I am a total beginner but I want to post that a lot.
auto autoCorrelation(R)(R range)
if (isRandomAccessRange!R)
{
import std.numeric : fft, inverseFft;
import std.range : chain, repeat, zip, dropBack;
import std.algorithm : map;
import std.complex;
On Wednesday, 4 October 2017 at 19:20:12 UTC, Jesse Phillips
wrote:
On Wednesday, 4 October 2017 at 15:26:02 UTC, Ali Çehreli wrote:
On 10/04/2017 02:04 AM, Biotronic wrote:
...
Hey where is the list of features used e.g: ranges, ufcs...
Features used: D.
But sure, added them to the gist:
On Wednesday, 4 October 2017 at 15:30:08 UTC, Ali Çehreli wrote:
the hidden \r characters at the ends
Those got me too!
Here's my less than optimal solution:
int main(string[] args)
{ import std.stdio;
import std.algorithm.iteration : map, splitter, joiner, each;
import
On Wednesday, 4 October 2017 at 15:26:02 UTC, Ali Çehreli wrote:
On 10/04/2017 02:04 AM, Biotronic wrote:
...
Hey where is the list of features used e.g: ranges, ufcs...
On Wednesday, 4 October 2017 at 15:30:08 UTC, Ali Çehreli wrote:
On 10/04/2017 02:26 AM, Atila Neves wrote:
> in D so trivial it'd probably make me sleep out of boredom.
I spent more time on this obviously trivial program than
necessary. :( In addition to facing known template resolution
On 10/04/2017 02:26 AM, Atila Neves wrote:
> in D so trivial it'd probably make me sleep out of boredom.
I spent more time on this obviously trivial program than necessary. :(
In addition to facing known template resolution issues, the hidden \r
characters at the ends of some of the fields in
On 10/04/2017 02:04 AM, Biotronic wrote:
> I opted for writing to stdout instead, because 1) it's easier, x) it's
> less code, and b) it's more flexible.
Exactly! :)
> a simple replacement of readText with an mmapped equivalent should
> enable humongous file support with no other code change
On Wednesday, 4 October 2017 at 09:04:58 UTC, Biotronic wrote:
Since the code uses ranges though, a simple replacement of
readText with an mmapped equivalent should enable humongous
file support with no other code change required.
Drop-in replacement for readText:
struct MmText {
import
On Tuesday, 3 October 2017 at 19:25:56 UTC, Ali Çehreli wrote:
Found on Reddit:
https://www.reddit.com/r/programming/comments/740617/the_expressive_c17_coding_challenge/
How would you do it in D?
Ali
P.S. You can ignore the following note from the challenge text;
I don't think it applies
On Tuesday, 3 October 2017 at 19:25:56 UTC, Ali Çehreli wrote:
Found on Reddit:
https://www.reddit.com/r/programming/comments/740617/the_expressive_c17_coding_challenge/
How would you do it in D?
Ali
P.S. You can ignore the following note from the challenge text;
I don't think it applies
Found on Reddit:
https://www.reddit.com/r/programming/comments/740617/the_expressive_c17_coding_challenge/
How would you do it in D?
Ali
P.S. You can ignore the following note from the challenge text; I don't
think it applies to D. Honestly, I don't think it matters for C++17
either. :)
12 matches
Mail list logo