Re: experimental.logger: safe function and stdou

2015-11-18 Thread Andre via Digitalmars-d-learn
On Thursday, 19 November 2015 at 06:27:58 UTC, Andre wrote: override void writeLogMsg(ref LogEntry payload) { with (payload) { _stdOutLogger.logf(logLevel, `{ "file":"%s", "line":%s, "funcName":"%s", "prettyFuncName":"%s",

Re: char[] == null

2015-11-18 Thread Jack Applegame via Digitalmars-d-learn
On Thursday, 19 November 2015 at 03:53:48 UTC, Meta wrote: On Wednesday, 18 November 2015 at 23:53:01 UTC, Chris Wright wrote: [...] This is not true. Consider the following code: import std.stdio; void main() { int[] a = [0, 1, 2]; //4002E000 3 writeln(a.ptr, " ", a.

Re: dataframe implementations

2015-11-18 Thread Jay Norwood via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 22:46:01 UTC, jmh530 wrote: My sense is that any data frame implementation should try to build on the work that's being done with n-dimensional slices. I've been watching that development, but I don't have a feel for where it could be applied in this case, sin

experimental.logger: safe function and stdou

2015-11-18 Thread Andre via Digitalmars-d-learn
Hi, I want to write log entries to stdout in JSON format. Therefore I created a customer logger. Unfortunatelly there are 2 errors with following implementation: module logger; import std.experimental.logger; import std.stdio: stdout; class MyCustomLogger : Logger { private FileLogger _

Re: char[] == null

2015-11-18 Thread anonymous via Digitalmars-d-learn
On 19.11.2015 06:18, Chris Wright wrote: Just for fun, is an array ever not equal to itself? Yes, when it contains an element that's not equal to itself, e.g. NaN.

Arty of Constructor

2015-11-18 Thread Andrew via Digitalmars-d-learn
The documentation gives plenty of examples of how to use a static if with the arity trait, but how do I specify the constructor of an object as the parameter to arity? Thanks

Re: char[] == null

2015-11-18 Thread Chris Wright via Digitalmars-d-learn
On Thu, 19 Nov 2015 03:53:46 +, Meta wrote: > On Wednesday, 18 November 2015 at 23:53:01 UTC, Chris Wright wrote: >> --- >> char[] buffer; >> if (buffer.length == 0) {} >> --- > > This is not true. Consider the following code: > > import std.stdio; > > void main() > { > int[] a = [0,

Re: char[] == null

2015-11-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 23:53:01 UTC, Chris Wright wrote: --- char[] buffer; if (buffer.length == 0) {} --- This is not true. Consider the following code: import std.stdio; void main() { int[] a = [0, 1, 2]; //4002E000 3 writeln(a.ptr, " ", a.length);

Re: char[] == null

2015-11-18 Thread Chris Wright via Digitalmars-d-learn
On Wed, 18 Nov 2015 20:57:06 +, Spacen Jasset wrote: > Should this be allowed? What is it's purpose? It could compare two > arrays, but surely not that each element of type char is null? > > char[] buffer; > if (buffer == null) {} 'null' is a value of ambiguous type. The compiler finds a set

Re: dataframe implementations

2015-11-18 Thread jmh530 via Digitalmars-d-learn
On Monday, 2 November 2015 at 13:54:09 UTC, Jay Norwood wrote: I saw someone posting that they were working on DataFrame implementation here, but haven't been able to locate any code in github, and was wondering what implementation decisions are being made here. Thanks. My sense is that an

Re: dataframe implementations

2015-11-18 Thread Jay Norwood via Digitalmars-d-learn
One more discussion link on the NA subject. This one on the R implementation of NA using a single encoding of NaN, as well as their treatment of a selected integer value as a NA. http://rsnippets.blogspot.com/2013/12/gnu-r-vs-julia-is-it-only-matter-of.html

Re: char[] == null

2015-11-18 Thread anonymous via Digitalmars-d-learn
On 18.11.2015 22:02, rsw0x wrote: slices aren't arrays http://dlang.org/d-array-article.html The language reference/specification [1] uses the term "dynamic array" for T[] types. Let's not enforce a slang that's different from that. [1] http://dlang.org/arrays.html

Re: char[] == null

2015-11-18 Thread rsw0x via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 20:57:08 UTC, Spacen Jasset wrote: Should this be allowed? What is it's purpose? It could compare two arrays, but surely not that each element of type char is null? char[] buffer; if (buffer == null) {} slices aren't arrays http://dlang.org/d-array-article.h

char[] == null

2015-11-18 Thread Spacen Jasset via Digitalmars-d-learn
Should this be allowed? What is it's purpose? It could compare two arrays, but surely not that each element of type char is null? char[] buffer; if (buffer == null) {}

Re: dataframe implementations

2015-11-18 Thread Jay Norwood via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 18:04:30 UTC, Jay Norwood wrote: vector. I'll try to find the discussions and post the link. Here are the two discussions I recall on the julia NA implementation. http://wizardmac.tumblr.com/post/104019606584/whats-wrong-with-statistics-in-julia-a-reply htt

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 17:40:21 UTC, maik klein wrote: On Wednesday, 18 November 2015 at 17:22:52 UTC, Meta wrote: Which version of the compiler are you using? Linux - DMD64 D Compiler v2.069.0 https://issues.dlang.org/show_bug.cgi?id=15357 https://issues.dlang.org/show_bug.cgi?id

Re: dataframe implementations

2015-11-18 Thread Jay Norwood via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 17:15:38 UTC, Laeeth Isharc wrote: What do you think about the use of NaN for missing floats? In theory I could imagine wanting to distinguish between an NaN in the source file and a missing value, but in my world I never felt the need for this. For integers

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread maik klein via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 17:22:52 UTC, Meta wrote: On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote: [...] Which version of the compiler are you using? Linux - DMD64 D Compiler v2.069.0

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote: https://stackoverflow.com/questions/33779822/unable-to-call-each-on-a-lockstep-range-containing-2-or-more-ranges http://dpaste.dzfl.pl/76c79f1f12ab void main(){ import std.container; import std.stdio; import std.algorithm.i

Re: dataframe implementations

2015-11-18 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 2 November 2015 at 13:54:09 UTC, Jay Norwood wrote: I was reading about the Julia dataframe implementation yesterday, trying to understand their decisions and how D might implement. From my notes, 1. they are currently using a dictionary of column vectors. 2. for NA (not available)

Re: dataframe implementations

2015-11-18 Thread Laeeth Isharc via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 13:56:14 UTC, Jay Norwood wrote: I looked through the dataframe code and a couple of comments... I had thought perhaps an app could read in the header info and type info from hdf5, and generate D struct definitions with column headers as symbol names. That woul

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 14:11:45 UTC, maik klein wrote: On Wednesday, 18 November 2015 at 13:51:59 UTC, John Colvin wrote: On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote: [...] I think this is a bug, please report it at issues.dlang.org and perhaps there will be a

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread maik klein via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 13:51:59 UTC, John Colvin wrote: On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote: [...] I think this is a bug, please report it at issues.dlang.org and perhaps there will be an explanation or it will be fixed. In the mean time, something lik

Re: opEquals default behaviour - poorly documented or am I missing something?

2015-11-18 Thread MichaelZ via Digitalmars-d-learn
On Tuesday, 17 November 2015 at 19:44:36 UTC, Ali Çehreli wrote: On 11/17/2015 12:40 AM, MichaelZ wrote: > In http://dlang.org/operatoroverloading.html#eqcmp it is stated that > > "If opEquals is not specified, the compiler provides a default version > that does member-wise comparison." > > Howev

Re: Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote: https://stackoverflow.com/questions/33779822/unable-to-call-each-on-a-lockstep-range-containing-2-or-more-ranges http://dpaste.dzfl.pl/76c79f1f12ab void main(){ import std.container; import std.stdio; import std.algorithm.i

Unable to call each on a lockstep range containing 2 or more ranges

2015-11-18 Thread maik klein via Digitalmars-d-learn
https://stackoverflow.com/questions/33779822/unable-to-call-each-on-a-lockstep-range-containing-2-or-more-ranges http://dpaste.dzfl.pl/76c79f1f12ab void main(){ import std.container; import std.stdio; import std.algorithm.iteration; import std.range; Array!int ai = [1,2,3,4]; Array!i