June 21, 2011
On 6/21/11, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
> On 6/21/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
>> stride isn't a UTF version of strlen.
>
> Brain misshap, I meant std.utf.count.
>

Double brain misshap. I wasn't looking for code-point count of a D string, but of a zero-terminated wchar*.
June 22, 2011
On 6/21/2011 1:46 PM, Andrej Mitrovic wrote:
>> 	char[100] buffer;
>> 	APIWriteToBuffer(buffer.ptr);
>>           auto p = buffer[0 .. strlen(buffer.ptr)];
>> 	myDStringFunction(p);
>>
>
> Yeah I was going to suggest that. My only problem was I didn't know
> where to look for an strlen equivalent for UTF, but I found it in
> std.utf and it's called stride().

I think there's a misunderstanding somewhere. strlen() works just fine on UTF-8 code.
June 22, 2011
On 6/21/2011 2:24 PM, Andrej Mitrovic wrote:
> Walter, would it be possible to make .map file generation follow the
> -od flag? It's odd when a  build script fills a directory with map
> files while executables and object files are properly in their own
> directories as specified via -od and -of flags.

I think it's a good idea. Please post to bugzilla!

>
> Btw, I have just pushed a changeset and made the build script
> parallel. I turned this:
> foreach (dir; dirs)
>
> into this:
> foreach (dir; taskPool.parallel(dirs, 1))
>
> And added other small cosmetic changes, but the above is the only real change.
>
> Here's my timings:
> Serial build: 1min, 3sec
> Parallel build: 22sec

Awesome!

June 22, 2011
On 6/22/11, Walter Bright <newshound2@digitalmars.com> wrote:
> I think there's a misunderstanding somewhere. strlen() works just fine on
> UTF-8
> code.
>

I need a UTF16 strlen function for wchar*.
June 22, 2011
On 6/21/2011 4:17 PM, Andrej Mitrovic wrote:
> On 6/21/11, Andrej Mitrovic<andrej.mitrovich@gmail.com>  wrote:
>> On 6/21/11, Jonathan M Davis<jmdavisProg@gmx.com>  wrote:
>>> stride isn't a UTF version of strlen.
>>
>> Brain misshap, I meant std.utf.count.
>>
>
> Double brain misshap. I wasn't looking for code-point count of a D
> string, but of a zero-terminated wchar*.

wcslen()
June 22, 2011
On 6/21/2011 5:41 PM, Andrej Mitrovic wrote:
> I need a UTF16 strlen function for wchar*.

wcslen()
June 22, 2011
On 6/22/11, Walter Bright <newshound2@digitalmars.com> wrote:
> On 6/21/2011 5:41 PM, Andrej Mitrovic wrote:
>> I need a UTF16 strlen function for wchar*.
>
> wcslen()
>

You, sir, are a gentleman and a scholar.
June 22, 2011
On 6/21/2011 6:08 PM, Andrej Mitrovic wrote:
> You, sir, are a gentleman and a scholar.

I've been called worse :-)
June 22, 2011
Now on YC too: http://news.ycombinator.com/item?id=2681216
June 22, 2011
On 6/21/11 4:28 PM, Andrei Alexandrescu wrote:
> On 6/20/11 11:14 PM, Andrej Mitrovic wrote:
>> This is a translation project of Charles Petzold's Programming Windows
>> (5th edition) book code samples.
>>
>> Currently over 120 code samples have been translated into D, with only
>> a few modules remaining.
>>
>> Everything else you need to know is in the Readme file:
>> https://github.com/AndrejMitrovic/DWindowsProgramming
>>
>> The examples were tested on fresh installs of XP and Win7 with the
>> only dependency being DMD v2.053 and an NT operating system. I hope
>> everyone will be able to build these examples without too much
>> trouble. *crosses fingers*
>
> Now on reddit:
>
> http://www.reddit.com/r/programming/comments/i5m0c/petzolds_windows_programming_5th_ed_code_samples/

And now approved.

Andrei
1 2 3 4
Next ›   Last »