On 2013-08-14 05:05, Adam D. Ruppe wrote:
Your code looks like D1...
in D1 or D2:
import std.uni;
dstring s2 = toUTF32(str);
writeln(s2.length); // 13
in D2 you can do it a little more efficiently like this:
import std.range;
writeln(walkLength(str)); // 13
In D1 you can easily implement
I have defined the following module:
/**
* Module containing unit test helper functions for date time
operations.
*/
module common.test.unit.datetime;
/**
* Imports.
*/
import std.conv;
import std.datetime;
/**
* Return a unix timestamp.
*
* Params:
* T = The return type of the
On 2013-08-14 15:21, Gary Willoughby wrote:
I have defined the following module:
/**
* Module containing unit test helper functions for date time operations.
*/
module common.test.unit.datetime;
/**
* Imports.
*/
import std.conv;
import std.datetime;
/**
* Return a unix timestamp.
On Tuesday, 13 August 2013 at 21:10:53 UTC, John Colvin wrote:
On Tuesday, 13 August 2013 at 20:23:00 UTC, Craig Dillabaugh
wrote:
On Tuesday, 13 August 2013 at 19:50:37 UTC, Jonathan M Davis
wrote:
On Tuesday, August 13, 2013 21:22:24 Craig Dillabaugh wrote:
I have code that attempts to copy
On Tuesday, 13 August 2013 at 21:37:28 UTC, Joseph Rushton
Wakeling wrote:
clip.
Try lockstep instead of zip. See:
http://d.puremagic.com/issues/show_bug.cgi?id=8155#c8
... for more info on the reasons why zip doesn't work here.
While I've now solved my problem using a slightly different
On Wednesday, 14 August 2013 at 14:05:07 UTC, Jacob Carlborg
wrote:
Have you compiled all the files? Show us the command you use to
compile your code. Usually this is enough rdmd main.d, where
main.d is the file containing the main function.
I'm sure all source files are compiled during the
On Wednesday, 14 August 2013 at 16:11:38 UTC, Gary Willoughby
wrote:
...
Hm, I remember I had similar issue once which faded away once I
have stopped naming main module as `main`. Was not able to track
exact conditions to trigger it - this may be something similar.
On Sunday, 11 August 2013 at 17:01:46 UTC, Yota wrote:
On Friday, 9 August 2013 at 17:35:18 UTC, monarch_dodra wrote:
On Friday, 9 August 2013 at 15:28:10 UTC, Manfred Nowak wrote:
michaelc37 wrote:
WTF - -1 is greater than 7
From the docs:
It is an error to have one operand be signed
On 8/14/13 2:26 PM, Andre Artus wrote:
On Sunday, 11 August 2013 at 17:01:46 UTC, Yota wrote:
On Friday, 9 August 2013 at 17:35:18 UTC, monarch_dodra wrote:
On Friday, 9 August 2013 at 15:28:10 UTC, Manfred Nowak wrote:
michaelc37 wrote:
WTF - -1 is greater than 7
From the docs:
It
On 9.8.2013. 17:11, michaelc37 wrote:
forgive me if i'm doing something stupid, i'm extremely tired and trying
to avoid drinking coffee.
void main()
{
int[] arr = [0, 1, 2, 3, 4, 5, 6];
//check 1
if (-1 arr.length)
writefln(WTF - %d is greater than %d , -1, arr.length);
else
writefln(GOOD
On Wednesday, 14 August 2013 at 18:08:56 UTC, Ary Borenszweig
wrote:
On 8/14/13 2:26 PM, Andre Artus wrote:
On Sunday, 11 August 2013 at 17:01:46 UTC, Yota wrote:
On Friday, 9 August 2013 at 17:35:18 UTC, monarch_dodra wrote:
On Friday, 9 August 2013 at 15:28:10 UTC, Manfred Nowak
wrote:
I need to have a generalized settings functionality that should work like
this:
* I need to be able to add this to a class
* each setting has its name, description, type and default value
* I need to iterate over all settings for given object
API would more or less look like:
class A {
... here
Hello.
When working with my code I noticed that if I use front on a
char[], it yields a dchar. Am I correct in concluding that it
does a UTF-8 to UTF-32 conversion and popFont will skip the whole
character, not just a code unit?
Also, does this mean that if I'm creating an output range for
On Thursday, 15 August 2013 at 00:49:00 UTC, Jason den Dulk wrote:
When working with my code I noticed that if I use front on a
char[], it yields a dchar. Am I correct in concluding that it
does a UTF-8 to UTF-32 conversion and popFont will skip the
whole character, not just a code unit?
yup
On Wednesday, 14 August 2013 at 22:28:13 UTC, Marek Janukowicz
wrote:
I need to have a generalized settings functionality that
should work like
this:
* I need to be able to add this to a class
* each setting has its name, description, type and default value
* I need to iterate over all settings
Hi all,
I think this is a bug, but if not I'm very confused and would
like some clarification.
When checking double values that could be nan or unassigned I
have to check both double.init and double.nan. But double.init IS
double.nan.
---
void main() {
// passes but I believe it is
On Thursday, August 15, 2013 06:01:21 bsd wrote:
Hi all,
I think this is a bug, but if not I'm very confused and would
like some clarification.
When checking double values that could be nan or unassigned I
have to check both double.init and double.nan. But double.init IS
double.nan.
On Thursday, 15 August 2013 at 04:01:28 UTC, bsd wrote:
Hi all,
I think this is a bug, but if not I'm very confused and would
like some clarification.
When checking double values that could be nan or unassigned I
have to check both double.init and double.nan. But double.init
IS
18 matches
Mail list logo