Re: "is" expression and type tuples

2015-03-04 Thread bearophile via Digitalmars-d-learn
Jack Applegame: On Tuesday, 3 March 2015 at 17:49:24 UTC, bearophile wrote: That's 1 + n-1 :-) Could you please explain what does '1 + n-1' mean? This is your code: template Is(ARGS...) if(ARGS.length % 2 == 0) { enum N = ARGS.length/2; static if(N == 1) enum Is = is(ARGS[0] : ARGS[1

[rosettacode] std.container.DList problems

2015-03-04 Thread bearophile via Digitalmars-d-learn
This code used to work in DMD 2.065: http://rosettacode.org/wiki/Strand_sort#D import std.stdio, std.container; DList!T strandSort(T)(DList!T list) { static DList!T merge(DList!T left, DList!T right) { DList!T result; while (!left.empty && !right.empty) { if (lef

Incorrect display in Cyrillic Windows

2015-03-04 Thread Dennis Ritchie via Digitalmars-d-learn
Hi. It's normal for Windows? http://i.imgur.com/TEx4H3k.png import std.uni; import std.stdio; void main() { string s; foreach(ch; CodepointSet('А', 'Я' + 1, 'а', 'я' + 1).byCodepoint) s ~= ch; writeln(s); writeln("s[0] = ", s[0]); }

Re: Incorrect display in Cyrillic Windows

2015-03-04 Thread Kagamin via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=2742

Re: Incorrect display in Cyrillic Windows

2015-03-04 Thread Martin Krejcirik via Digitalmars-d-learn
On Wednesday, 4 March 2015 at 11:32:40 UTC, Dennis Ritchie wrote: Hi. It's normal for Windows? You have to set your console encoding to UTF-8 first. You can do it by command "chcp 65001" or by calling Windows API function: extern(Windows) BOOL SetConsoleOutputCP( UINT ); SetConsoleOutputCP(

Re: Incorrect display in Cyrillic Windows

2015-03-04 Thread Dennis Ritchie via Digitalmars-d-learn
On Wednesday, 4 March 2015 at 12:14:01 UTC, Martin Krejcirik wrote: You have to set your console encoding to UTF-8 first. You can do it by command "chcp 65001" or by calling Windows API function: extern(Windows) BOOL SetConsoleOutputCP( UINT ); SetConsoleOutputCP( 65001 ); Also change your f

Re: Cycle detected between modules with ctors/dtors

2015-03-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/3/15 4:24 PM, rumbu wrote: On Tuesday, 3 March 2015 at 18:55:49 UTC, Steven Schveighoffer wrote: Only one of the listed modules has a static contructor (system.globalization) and that constructor doesn't use any information from other modules. It's a complex problem. Because we don't co

Re: Cycle detected between modules with ctors/dtors

2015-03-04 Thread rumbu via Digitalmars-d-learn
On Wednesday, 4 March 2015 at 16:08:00 UTC, Steven Schveighoffer wrote: curiously not listed? That doesn't make any sense. If there is not a cycle in the listed modules, where at least 2 modules have a static ctor or static dtor, then there is a bug in the cycle detection code. Source cod

Re: Cycle detected between modules with ctors/dtors

2015-03-04 Thread ketmar via Digitalmars-d-learn
On Wed, 04 Mar 2015 11:06:50 -0500, Steven Schveighoffer wrote: > Clearly, the above is not an issue, but at the moment, the code treats > having a ctor and having a dtor as the same thing. How to fix it? I'm > not exactly sure, you need to have the modules sorted according to ctor > and also acco

I want to introduce boost_asio to dlang

2015-03-04 Thread zhmt via Digitalmars-d-learn
I am a gameserver developer, my programming lang is java now. I want to change java to dlang, and I like boost_asio and it's coroutine, so, I want to create a binding of boost_asio. But I am not familiar with dlang, so I want to find someone help me, or develope this binding with me. I will

Re: Filling a char array with letters and element type of char[]

2015-03-04 Thread Kadir Erdem Demir via Digitalmars-d-learn
@Tobias @Ali @Jonathan @Steven Thanks alot for your answers. I will try to learn as much as I can from them. Regards Erdem

how to write a string to a c pointer?

2015-03-04 Thread zhmt via Digitalmars-d-learn
I am writing a asio binding. Objects need to be serialized into a buffer (void *), for example, write utf8 string into buffer, write int into buffer, write long into buffer, Here is my class class Buffer { private void *ptr; private int size; private int _cap;

Re: I want to introduce boost_asio to dlang

2015-03-04 Thread ketmar via Digitalmars-d-learn
On Thu, 05 Mar 2015 06:05:55 +, zhmt wrote: > But I am not familiar with dlang this is the root of the problem. please, make yourself familiar before starting to wrap boost crap. you may find that you don't need it at all. signature.asc Description: PGP signature

Getting the socket information from HTTP and DNS sessions

2015-03-04 Thread Kadir Erdem Demir via Digitalmars-d-learn
I have been ask to write a test tool which initiates DNS-HTTP-HTTPS-TCP sessions. And ofcourse I wrote this with D. For HTTP I used std.net like "m_HTTP = HTTP(m_url);m_HTTP.perform();" For DNS I simply used "getAddressInfo(m_domainName);" Than tool makes some simple checks which are npt su

Re: I want to introduce boost_asio to dlang

2015-03-04 Thread zhmt via Digitalmars-d-learn
On Thursday, 5 March 2015 at 07:38:35 UTC, ketmar wrote: On Thu, 05 Mar 2015 06:05:55 +, zhmt wrote: But I am not familiar with dlang this is the root of the problem. please, make yourself familiar before starting to wrap boost crap. you may find that you don't need it at all. I see.