Hey, I'm trying to do some vector based code, and my unittests started
to fail on testing normalize. I'm using the standard algorithm, but
the assert is always return false. I did some investigation, and can
show that this program causes failure:
import std.math : sqrt;
import std.stdio
On 19.03.2012 6:50, Jay Norwood wrote:
On Friday, 16 March 2012 at 03:36:12 UTC, Joshua Niehus wrote:
Hello,
Does anyone know why I would get different results between
ctRegex and regex in the following snippet?
Thanks,
Josh
I'm also having questions about the matchers. From what I
On 19.03.2012 12:05, Dmitry Olshansky wrote:
On 19.03.2012 6:50, Jay Norwood wrote:
On Friday, 16 March 2012 at 03:36:12 UTC, Joshua Niehus wrote:
Hello,
Does anyone know why I would get different results between
ctRegex and regex in the following snippet?
Thanks,
Josh
I'm also having
On 18/03/2012 21:28, bearophile wrote:
Alex Rønne Petersen Wrote:
Does D to tail call optimization of any kind?
The D standard doesn't require the D compiler to perform that optimization
(unlike Scheme).
Currently both DMD and LDC are able to perform tail call optimization in some
normal
Stewart Gordon:
What are normal cases?
It means very simple cases. Things like fibonacci / factorial functions that
call themselves at the tail.
Generally it's a fragile optimization, it's easy for it to not work/stop
working. LLVM used to perform this optimization, then it stopped working
On 19-03-2012 13:07, bearophile wrote:
Stewart Gordon:
What are normal cases?
It means very simple cases. Things like fibonacci / factorial functions that
call themselves at the tail.
Generally it's a fragile optimization, it's easy for it to not work/stop
working. LLVM used to perform
On Sat, 17 Mar 2012 19:05:24 -0400, Simen Kjærås simen.kja...@gmail.com
wrote:
As for a workaround, have you considered using a simple array instead of
a linked list?
Arrays in D, especially when combined with std.array, make for
easy-to-use (though
perhaps not particularly efficient)
James Miller:
writeln(v1 == 1); //false
writeln(v1 == 1.0); //false
writeln(v1 == 1.0f); //false
writeln(v1+1 == 2.0f); //true
Maybe I'd like to deprecate and then statically forbid the use of == among
floating point values, and replace it with a
On Monday, 19 March 2012 at 08:14:18 UTC, Dmitry Olshansky wrote:
On 19.03.2012 12:05, Dmitry Olshansky wrote:
In that case, I should have been able to do something like:
matches=match(input,ctr);
l_cnt = matches.length();
I'm curious what this length() does as I have no length for
On 19.03.2012 16:59, Jay Norwood wrote:
On Monday, 19 March 2012 at 08:14:18 UTC, Dmitry Olshansky wrote:
On 19.03.2012 12:05, Dmitry Olshansky wrote:
In that case, I should have been able to do something like:
matches=match(input,ctr);
l_cnt = matches.length();
I'm curious what this
On Monday, 19 March 2012 at 08:05:18 UTC, Dmitry Olshansky wrote:
Like I told in main D group it's wrong - regex doesn't only
count matches. It finds slices that do match.
Thus to make it more efficient, it returns lazy range that does
searches on request. g - means global :)
Then code like
On Monday, 19 March 2012 at 13:27:03 UTC, Jay Norwood wrote:
ok, global. So the document implies that I should be able to
get a single match object with a count of the submatches. So I
think maybe I've jumped to the wrong conclusion about how to
use it, thinking I could just use \n and g
On 19.03.2012 17:27, Jay Norwood wrote:
On Monday, 19 March 2012 at 08:05:18 UTC, Dmitry Olshansky wrote:
Like I told in main D group it's wrong - regex doesn't only count
matches. It finds slices that do match.
Thus to make it more efficient, it returns lazy range that does
searches on
On 19.03.2012 17:39, Jay Norwood wrote:
On Monday, 19 March 2012 at 13:27:03 UTC, Jay Norwood wrote:
ok, global. So the document implies that I should be able to get a
single match object with a count of the submatches. So I think maybe
I've jumped to the wrong conclusion about how to use it,
On Mar 20, 2012 1:50 AM, bearophile bearophileh...@lycos.com wrote:
James Miller:
writeln(v1 == 1); //false
writeln(v1 == 1.0); //false
writeln(v1 == 1.0f); //false
writeln(v1+1 == 2.0f); //true
Maybe I'd like to deprecate and then statically forbid the
On Monday, 19 March 2012 at 12:50:02 UTC, bearophile wrote:
James Miller:
writeln(v1 == 1); //false
writeln(v1 == 1.0); //false
writeln(v1 == 1.0f); //false
writeln(v1+1 == 2.0f); //true
Maybe I'd like to deprecate and then statically forbid the use
of ==
On Mon, Mar 19, 2012 at 08:50:02AM -0400, bearophile wrote:
James Miller:
writeln(v1 == 1); //false
writeln(v1 == 1.0); //false
writeln(v1 == 1.0f); //false
writeln(v1+1 == 2.0f); //true
Using == to compare floating point values is wrong. Due to the
On Monday, 19 March 2012 at 13:55:39 UTC, Dmitry Olshansky wrote:
That's right, however counting is completely separate from
regex, you'd want to use std.algorithm count:
count(match(,\n));
or more unicode-friendly:
count(match(, regex($,m)); //note the multi-line flag
This only sets
On Sunday, 18 March 2012 at 05:19:48 UTC, Kapps wrote:
On Saturday, 17 March 2012 at 20:52:33 UTC, Xan wrote:
So, there is not built-in functions?
Thanks,
Xan.
There's no built in webserver class, and it's not something
that should be in the standard library in the first place.
A pain. A
On Sun, 18 Mar 2012 06:19:47 +0100, Kapps opantm2+s...@gmail.com wrote:
On Saturday, 17 March 2012 at 20:52:33 UTC, Xan wrote:
So, there is not built-in functions?
Thanks,
Xan.
There's no built in webserver class, and it's not something that should
be in the standard library in the first
On Monday, 19 March 2012 at 19:24:30 UTC, Jay Norwood wrote:
This fails to build, so I'd guess is missing \p
void wcp (string fn)
{
enum ctr = ctRegex!(\p{WhiteSpace},m);
}
-- Build started: Project: a7, Configuration: Release Win32
--
Building Release\a7.exe...
a7.d(210):
Hey Guys,
I am trying to parse an XML document with std.xml. I've looked
over the reference of std.xml as well as the example but i'm
still stuck. I've also looked over some example code, but it's a
bit confusing and doesn't entirely help explain what i'm doing
wrong.
As far as I understand
I know very little about std.xml (I looked at it and
said 'meh' and wrote my own lib), but my lib
makes this pretty simple.
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
grab dom.d and characterencodings.d
This has a bit of an html bias, but it works for
23 matches
Mail list logo