[Issue 14835] Statement is not reachable doesn't play along generic code

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14835 Walter Bright changed: What|Removed |Added CC|

Re: Article: Increasing the performance of D math code

2016-10-11 Thread Walter Bright via Digitalmars-d-announce
On 10/11/2016 7:01 AM, Johan Engelen wrote: I wrote a piece on LDC's fastmath stuff that Mir uses for high-performance D math code: https://johanengelen.github.io/ldc/2016/10/11/Math-performance-LDC.html Articles like this are great! Keep 'em coming.

Re: How to do "inheritance" in D structs

2016-10-11 Thread lobo via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 02:18:47 UTC, TheFlyingFiddle wrote: On Wednesday, 12 October 2016 at 01:22:04 UTC, lobo wrote: Hi, I'm coming from C++ and wondered if the pattern below has an equivalent in D using structs. I could just use classes and leave it up to the caller to use

Re: How to do "inheritance" in D structs

2016-10-11 Thread TheFlyingFiddle via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 02:18:47 UTC, TheFlyingFiddle wrote: void foo(ref ABase base) { base.ival = 32; } This should be: void foo(ref Base1 base) { base.ival = 32; }

Re: How to do "inheritance" in D structs

2016-10-11 Thread TheFlyingFiddle via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 01:22:04 UTC, lobo wrote: Hi, I'm coming from C++ and wondered if the pattern below has an equivalent in D using structs. I could just use classes and leave it up to the caller to use scoped! as well but I'm not sure how that will play out when others start

How to do "inheritance" in D structs

2016-10-11 Thread lobo via Digitalmars-d-learn
Hi, I'm coming from C++ and wondered if the pattern below has an equivalent in D using structs. I could just use classes and leave it up to the caller to use scoped! as well but I'm not sure how that will play out when others start using my lib. Thanks, lobo module A; class Base1 {

Re: Communication between 2 Socket listener on 2 different port with one program and server.

2016-10-11 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 11 October 2016 at 16:59:56 UTC, vino wrote: Hi All, Need your help, on the below request. Requirement: Server: 2 socket listening to 2 different ports with one main program Socket1 Port1 (Used for receiving user request(user data)) Socket2 Port2 (Used for system

Re: Any relation?

2016-10-11 Thread Israel via Digitalmars-d
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei Obviously the ECU is programmed in D. oh wait...

What influenced D? - goals, ideas, concepts, language features?

2016-10-11 Thread A D dev via Digitalmars-d
Hi list, I'm liking D as I keep using it (still new to it), and interested in how it evolved, hence this question. I have seen the Wikipedia article about D: https://en.wikipedia.org/wiki/D_(programming_language) which mentions language influences (right sidebar). I've also read some other

Re: Any relation?

2016-10-11 Thread Ali Çehreli via Digitalmars-d
On 10/11/2016 12:53 PM, Dennis Ritchie wrote: On Tuesday, 11 October 2016 at 19:43:07 UTC, cym13 wrote: On Tuesday, 11 October 2016 at 18:58:09 UTC, Dennis Ritchie wrote: On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote:

Determining if a class has a template function

2016-10-11 Thread Straivers via Digitalmars-d-learn
I have a class T with a templated function foo(string name)(int, int, float) that will be mixed in via template, and I want to determine if that class has mixed it in such that foo(name = "bar"). How could I go about this? Thanks. eg: mixin template A(string name, Args...) { void

Re: passing static arrays to each! with a ref param [Re: Why can't static arrays be sorted?]

2016-10-11 Thread Jon Degenhardt via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 19:46:31 UTC, Jon Degenhardt wrote: On Tuesday, 11 October 2016 at 18:18:41 UTC, ag0aep6g wrote: On 10/11/2016 06:24 AM, Jon Degenhardt wrote: The example I gave uses ref parameters. On the surface it would seem reasonable to that passing a static array by ref

Re: Any relation?

2016-10-11 Thread Dennis Ritchie via Digitalmars-d
On Tuesday, 11 October 2016 at 19:43:07 UTC, cym13 wrote: On Tuesday, 11 October 2016 at 18:58:09 UTC, Dennis Ritchie wrote: On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei

Re: passing static arrays to each! with a ref param [Re: Why can't static arrays be sorted?]

2016-10-11 Thread Jon Degenhardt via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 18:18:41 UTC, ag0aep6g wrote: On 10/11/2016 06:24 AM, Jon Degenhardt wrote: The example I gave uses ref parameters. On the surface it would seem reasonable to that passing a static array by ref would allow it to be modified, without having to slice it first.

Re: Any relation?

2016-10-11 Thread cym13 via Digitalmars-d
On Tuesday, 11 October 2016 at 18:58:09 UTC, Dennis Ritchie wrote: On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei Yes, definitely. http://dlanguage-z.com/about.html

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 11, 2016 10:42:42 Ali Çehreli via Digitalmars-d-learn wrote: > Those interfaces already exist in Phobos: :) > >https://dlang.org/phobos/std_range_interfaces.html > > auto foo(int[] ints) { >import std.range; >if (ints.length > 10) { >return >

[Issue 16608] 'static foreach', nested function template, 'static if', anySatisfy: Only the first iteration seems to work

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16608 Ali Cehreli changed: What|Removed |Added Summary|'static foreach', local |'static foreach', nested

[Issue 16608] 'static foreach', local function template, 'static if', anySatisfy: Only the first iteration seems to work

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16608 --- Comment #1 from Ali Cehreli --- Johan Engelen notes that the problem is because the local function is generated only for the first iteration:

[Issue 16608] 'static foreach', local function template, 'static if', anySatisfy: Only the first iteration seems to work

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16608 Ali Cehreli changed: What|Removed |Added Priority|P1 |P3 --

[Issue 16608] New: 'static foreach', local function template, 'static if', anySatisfy: Only the first iteration seems to work

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16608 Issue ID: 16608 Summary: 'static foreach', local function template, 'static if', anySatisfy: Only the first iteration seems to work Product: D Version: D2

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread orip via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 18:09:26 UTC, ag0aep6g wrote: You've got some options: Wow, thanks everyone, great information! I think I understand my options now.

Re: Any relation?

2016-10-11 Thread Dennis Ritchie via Digitalmars-d
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei Yes, definitely. http://dlanguage-z.com/about.html

Re: Article: Increasing the performance of D math code

2016-10-11 Thread cym13 via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 18:01:47 UTC, Johan Engelen wrote: On Tuesday, 11 October 2016 at 17:29:47 UTC, Ali Çehreli wrote: On 10/11/2016 07:01 AM, Johan Engelen wrote: > I wrote a piece on LDC's fastmath stuff that Mir uses for > high-performance D math code: > >

Re: Any relation?

2016-10-11 Thread Martin Krejcirik via Digitalmars-d
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei There is no Kenji Hara in the team, so I would say no :)

Re: Any relation?

2016-10-11 Thread Ali Çehreli via Digitalmars-d
On 10/11/2016 11:13 AM, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei I think so: - D-Language: check - Most powerful: check - Japan: check - squeeze out [...] power: check - not street-legal: check (similar to D

Re: passing static arrays to each! with a ref param [Re: Why can't static arrays be sorted?]

2016-10-11 Thread ag0aep6g via Digitalmars-d-learn
On 10/11/2016 06:24 AM, Jon Degenhardt wrote: The example I gave uses ref parameters. On the surface it would seem reasonable to that passing a static array by ref would allow it to be modified, without having to slice it first. Your ref parameters are only for the per-element operations.

Any relation?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei

Re: Auto-gen list of D compiler versions: Improvements

2016-10-11 Thread Johan Engelen via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 17:21:42 UTC, Nick Sabalausky wrote: The automatically-updated list of D compiler versions available on Travis-CI (and which front-end/back-end version they each use) has had a few small improvements lately: http://semitwist.com/travis-d-compilers Perhaps

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread ag0aep6g via Digitalmars-d-learn
On 10/11/2016 09:55 AM, orip wrote: auto foo(int[] ints) { import std.range; if (ints.length > 10) { return chain(ints[0..5], ints[8..$]); } else { //return ints; // Error: mismatched function return type inference of int[] and Result return chain(ints[0..0], ints[0..$]); //

Re: Article: Increasing the performance of D math code

2016-10-11 Thread Johan Engelen via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 17:29:47 UTC, Ali Çehreli wrote: On 10/11/2016 07:01 AM, Johan Engelen wrote: > I wrote a piece on LDC's fastmath stuff that Mir uses for > high-performance D math code: > > https://johanengelen.github.io/ldc/2016/10/11/Math-performance-LDC.html > > cheers, >

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 11, 2016 07:55:36 orip via Digitalmars-d-learn wrote: > I get "Error: mismatched function return type inference" errors > with choosing the return type for functions that work on ranges > using, e.g, std.algorithm or std.range functions, but have > different behavior based on

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread Ali Çehreli via Digitalmars-d-learn
On 10/11/2016 10:28 AM, TheFlyingFiddle wrote: On Tuesday, 11 October 2016 at 15:46:20 UTC, orip wrote: On Tuesday, 11 October 2016 at 13:06:37 UTC, pineapple wrote: Rewrite `return chain(ints[0..5], ints[8..$]);` as `return ints[0..5] ~ ints[8..$];` The `chain` function doesn't return an

Re: Article: Increasing the performance of D math code

2016-10-11 Thread Ali Çehreli via Digitalmars-d-announce
On 10/11/2016 07:01 AM, Johan Engelen wrote: > I wrote a piece on LDC's fastmath stuff that Mir uses for > high-performance D math code: > > https://johanengelen.github.io/ldc/2016/10/11/Math-performance-LDC.html > > cheers, > Johan Kind of off topic and hopefully constructive critism: You

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread TheFlyingFiddle via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 15:46:20 UTC, orip wrote: On Tuesday, 11 October 2016 at 13:06:37 UTC, pineapple wrote: Rewrite `return chain(ints[0..5], ints[8..$]);` as `return ints[0..5] ~ ints[8..$];` The `chain` function doesn't return an array, it returns a lazily-evaluated sequence of

Auto-gen list of D compiler versions: Improvements

2016-10-11 Thread Nick Sabalausky via Digitalmars-d-announce
The automatically-updated list of D compiler versions available on Travis-CI (and which front-end/back-end version they each use) has had a few small improvements lately: http://semitwist.com/travis-d-compilers - Now includes beta versions available for DMD (starting at v2.072.0) and LDC

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 16:13:45 UTC, Andrei Alexandrescu wrote: On 10/11/16 11:15 AM, Stefan Koch wrote: I will now run this problem through STOKE. Let's see what it comes up with :) http://stoke.stanford.edu you mean? That would be cool. Keep us posted! -- Andrei Yep I mean that

Communication between 2 Socket listener on 2 different port with one program and server.

2016-10-11 Thread vino via Digitalmars-d
Hi All, Need your help, on the below request. Requirement: Server: 2 socket listening to 2 different ports with one main program Socket1 Port1 (Used for receiving user request(user data)) Socket2 Port2 (Used for system request(system data)) User request arrives via

Re: dmd -o- option meaning changed recently? Now not creating OBJ but also not creating EXE

2016-10-11 Thread A D dev via Digitalmars-d-learn
On Monday, 3 October 2016 at 09:06:32 UTC, Dicebot wrote: Purpose is to skip code generation and only do syntax/semantic validation. Very helpful when testing compiler because: a) it takes less time speeding up overall test suite b) doesn't require runtime static library to succeed, thus

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/11/16 11:15 AM, Stefan Koch wrote: I will now run this problem through STOKE. Let's see what it comes up with :) http://stoke.stanford.edu you mean? That would be cool. Keep us posted! -- Andrei

Re: scone 1.2.0

2016-10-11 Thread vladdeSV via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 06:22:24 UTC, Suliman wrote: Could you add example of progress bar? Yes, will get one up in the next coming days

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread drug via Digitalmars-d-learn
11.10.2016 18:46, orip пишет: On Tuesday, 11 October 2016 at 13:06:37 UTC, pineapple wrote: Rewrite `return chain(ints[0..5], ints[8..$]);` as `return ints[0..5] ~ ints[8..$];` The `chain` function doesn't return an array, it returns a lazily-evaluated sequence of an entirely different type

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread orip via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 13:06:37 UTC, pineapple wrote: Rewrite `return chain(ints[0..5], ints[8..$]);` as `return ints[0..5] ~ ints[8..$];` The `chain` function doesn't return an array, it returns a lazily-evaluated sequence of an entirely different type from `int[]`. Of course it

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 15:08:34 UTC, Andrei Alexandrescu wrote: On 10/10/2016 11:00 PM, Stefan Koch wrote: [...] Looked at this, still seems to generate a jump forward with ldc. Also, why do you leave a fallthrough path? Progress needs to be made on all paths, otherwise we have

Re: Article: Increasing the performance of D math code

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 10/11/2016 11:06 AM, Ilya Yaroshenko wrote: On Tuesday, 11 October 2016 at 14:01:54 UTC, Johan Engelen wrote: I wrote a piece on LDC's fastmath stuff that Mir uses for high-performance D math code: https://johanengelen.github.io/ldc/2016/10/11/Math-performance-LDC.html cheers, Johan

Re: Can you shrink it further?

2016-10-11 Thread David Nadlinger via Digitalmars-d
On Tuesday, 11 October 2016 at 15:08:34 UTC, Andrei Alexandrescu wrote: Looked at this, still seems to generate a jump forward with ldc. ldc.intrinsics.llvm_expect might help to influence basic block layout. — David

Re: Article: Increasing the performance of D math code

2016-10-11 Thread Ilya Yaroshenko via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 14:01:54 UTC, Johan Engelen wrote: I wrote a piece on LDC's fastmath stuff that Mir uses for high-performance D math code: https://johanengelen.github.io/ldc/2016/10/11/Math-performance-LDC.html cheers, Johan Awesome! Thank you for the post! Twitted

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/10/2016 11:00 PM, Stefan Koch wrote: void popFront3(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1; if (c < 127) { Lend : s = s.ptr[char_length .. s.length]; } else { if ((c & b01100_) == 0b1000_) { //just

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/11/2016 10:49 AM, Matthias Bentrup wrote: void popFrontAsmIntel(ref char[] s) @trusted pure nothrow { immutable c = s[0]; if (c < 0x80) { s = s[1 .. $]; } else { uint l = void; asm pure nothrow @nogc { mov EAX, 1; mov BL, 0xf8-1; sub BL, c; cmp

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 14:49:28 UTC, Matthias Bentrup wrote: This is the result I'd like to get, but I can't find a way to write it without inline assembly :( void popFrontAsmIntel(ref char[] s) @trusted pure nothrow { immutable c = s[0]; if (c < 0x80) { s = s[1 .. $]; }

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/11/2016 05:45 AM, Temtaime wrote: void popFront7(ref char[] s) @trusted pure nothrow { import core.bitop; auto v = 7 - bsr(~s[0] | 1); s = s[v > 6 ? 1 : (v ? (v > s.length ? s.length : v) : 1)..$]; } Please check this. Thanks. This does a lot of work on the frequent path c < 0x80:

cpuid v0.3.0: Better C, Virtual Machines, AVX2 & AVX512, GDC

2016-10-11 Thread Ilya Yaroshenko via Digitalmars-d-announce
(Mir) cpuid v0.3.0 was released. https://github.com/libmir/cpuid ## New - Basic leaf 7 CPUID information was added. It includes AVX2 flag, AVX512 family flags and others. - Initial support for virtual machines was added. - `virtualVendor`, `virtualVendorIndex` was added. - `cpuid` is

Re: Can you shrink it further?

2016-10-11 Thread Matthias Bentrup via Digitalmars-d
On Tuesday, 11 October 2016 at 14:24:56 UTC, Andrei Alexandrescu wrote: On 10/11/2016 03:30 AM, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248); s =

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 14:24:56 UTC, Andrei Alexandrescu wrote: On 10/11/2016 03:30 AM, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248); s =

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/11/2016 03:30 AM, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248); s = s.ptr[char_length .. s.length]; } Theoretically the char_length could be

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 14:16:54 UTC, Andrei Alexandrescu wrote: On 10/11/2016 04:57 AM, Stefan Koch wrote: Yours runs with 790 us best time. bsr is a real timetaker :) What inputs did you test it on? https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt

[your code here]

2016-10-11 Thread jessie via Digitalmars-d
judr jpg

Re: Trait hasIndexing

2016-10-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 11, 2016 10:08:02 Nordlöw via Digitalmars-d-learn wrote: > I can't find any traits `hasIndexing!R` corresponding to > `std.range.primitives.hasSlicing!R` > > that is `true` iff `R` has `opIndex[size_t]` defined. Is there > one? > > If not what should I use instead? The traits

Re: Can you shrink it further?

2016-10-11 Thread Andrei Alexandrescu via Digitalmars-d
On 10/11/2016 04:57 AM, Stefan Koch wrote: Yours runs with 790 us best time. bsr is a real timetaker :) What inputs did you test it on? Here's what I think would be a good set of requirements: * The ASCII case should be short and fast: a comparison and a branch, followed by return. This

[Issue 16423] ModuleInfo missing when linking to static lib with classes

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16423 --- Comment #9 from Ketmar Dark --- (In reply to Steven Schveighoffer from comment #8) > But there may be code out there which expects Object.factory to work, and in > some cases, it will not. and there is. some of my UI

Re: Can you shrink it further?

2016-10-11 Thread Ethan Watson via Digitalmars-d
On Tuesday, 11 October 2016 at 10:01:41 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 09:45:11 UTC, Temtaime wrote: Sorry this was also a type in the code. void popFront7(ref char[] s) @trusted pure nothrow { import core.bitop; auto v = 7 - bsr(~s[0] | 1); s = s[v > 6 ? 1 : (v

Re: Current State of the GC?

2016-10-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 10 October 2016 at 21:12:42 UTC, Martin Lundgren wrote: So what's been happening in memory management land lately? Bad GC seems like one of the Dlangs weak points, so showing improvements here could definitely bring more people in. It's not that the D GC is bad per se, but rather

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Robert burner Schadek via Digitalmars-d-announce
the backend/view for it: https://github.com/kamon-io/docker-grafana-graphite

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Robert burner Schadek via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 12:47:55 UTC, Atila Neves wrote: I didn't even know that this existed, and I have a feeling that soon I'll wonder how I lived without it. Awesome! I had the exact same feeling

[Issue 16423] ModuleInfo missing when linking to static lib with classes

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16423 --- Comment #8 from Steven Schveighoffer --- Whether we need it or not, it's currently a feature of the runtime. Do we not care about existing code anymore? I'm totally in favor of deprecating Object.factory, and also in favor

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Joakim via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 13:22:48 UTC, Dicebot wrote: On 10/11/2016 04:13 PM, Joakim wrote: On Monday, 10 October 2016 at 08:47:54 UTC, Robert burner Schadek wrote: [...] Never heard about this either, I ignore node.js stuff. I was just reading this interesting post on

Re: color lib

2016-10-11 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 11 October 2016 at 12:14:37 UTC, Manu wrote: Oh dear... thanks for digging that up. I didn't know the web had a standard for alpha. Certainly 0xAARRGGBB has been used in windows code for as long as I've been programming... but now there's a competing #RRGGBBAA version... How to

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Dicebot via Digitalmars-d-announce
On 10/11/2016 04:13 PM, Joakim wrote: > On Monday, 10 October 2016 at 08:47:54 UTC, Robert burner Schadek wrote: >> http://code.dlang.org/packages/dstatsd >> >> StatsD allows to collect statistics about any application by using >> counters, gauges and more through UDP. >> >> Usage: >> >> auto s =

Re: LDC 1.1.0-beta3 has been released!

2016-10-11 Thread Kai Nacke via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 09:16:36 UTC, Johan Engelen wrote: On Tuesday, 11 October 2016 at 07:29:00 UTC, Sönke Ludwig wrote: Whoops, that's my bad :( (I editted a little and clicked the "save draft" button which turned it into a draft again, I think) :-) Unintentionally I did the same

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Joakim via Digitalmars-d-announce
On Monday, 10 October 2016 at 08:47:54 UTC, Robert burner Schadek wrote: http://code.dlang.org/packages/dstatsd StatsD allows to collect statistics about any application by using counters, gauges and more through UDP. Usage: auto s = new StatsD("127.0.0.1", 1234, ""); // connect to statsd

Re: Working with ranges: mismatched function return type inference

2016-10-11 Thread pineapple via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 07:55:36 UTC, orip wrote: I get "Error: mismatched function return type inference" errors with choosing the return type for functions that work on ranges using, e.g, std.algorithm or std.range functions, but have different behavior based on runtime values. The

Re: DStatsD - A fast, memory efficent, vibe.d compatible client for etsy's statsd.

2016-10-11 Thread Atila Neves via Digitalmars-d-announce
On Monday, 10 October 2016 at 08:47:54 UTC, Robert burner Schadek wrote: http://code.dlang.org/packages/dstatsd StatsD allows to collect statistics about any application by using counters, gauges and more through UDP. Usage: auto s = new StatsD("127.0.0.1", 1234, ""); // connect to statsd

Re: color lib

2016-10-11 Thread Manu via Digitalmars-d
On 11 October 2016 at 18:10, Andrea Fontana via Digitalmars-d wrote: > On Monday, 10 October 2016 at 23:26:53 UTC, Manu wrote: >> >> I'm not sure why it matters what format the colour you have is... >> Strings are in the form #RRGGBB, or #AARRGGBB. That is all. >>

Re: Trait hasIndexing

2016-10-11 Thread Nordlöw via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 10:08:02 UTC, Nordlöw wrote: I can't find any traits `hasIndexing!R` corresponding to `std.range.primitives.hasSlicing!R` My definition of `hasIndexing` so far: https://github.com/nordlow/phobos-next/blob/master/src/typecons_ex.d#L83

Trait hasIndexing

2016-10-11 Thread Nordlöw via Digitalmars-d-learn
I can't find any traits `hasIndexing!R` corresponding to `std.range.primitives.hasSlicing!R` that is `true` iff `R` has `opIndex[size_t]` defined. Is there one? If not what should I use instead?

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 09:45:11 UTC, Temtaime wrote: Sorry this was also a type in the code. void popFront7(ref char[] s) @trusted pure nothrow { import core.bitop; auto v = 7 - bsr(~s[0] | 1); s = s[v > 6 ? 1 : (v ? (v > s.length ? s.length : v) : 1)..$]; } Please check this.

Re: Can you shrink it further?

2016-10-11 Thread Temtaime via Digitalmars-d
On Tuesday, 11 October 2016 at 09:13:10 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 08:57:46 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 08:44:04 UTC, Temtaime wrote: void popFront1(ref char[] s) @trusted pure nothrow { import core.bitop, std.algorithm; auto v =

Re: LDC 1.1.0-beta3 has been released!

2016-10-11 Thread Johan Engelen via Digitalmars-d-announce
On Tuesday, 11 October 2016 at 07:29:00 UTC, Sönke Ludwig wrote: Just noticed that the release binaries are missing from https://github.com/ldc-developers/ldc/releases/tag/v1.1.0-beta3 This means that the beta currently cannot be tested with TravisCI (wanted to test a DUB related regression

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 08:57:46 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 08:44:04 UTC, Temtaime wrote: void popFront1(ref char[] s) @trusted pure nothrow { import core.bitop, std.algorithm; auto v = bsr(~s[0] | 1); s = s[clamp(v, 1, v > 6 ? 1 : $)..$]; } Seems to

[Issue 16513] Speed up TemplateInstance.findExistingInstance, hash by mangling

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16513 ZombineDev changed: What|Removed |Added CC|

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 08:44:04 UTC, Temtaime wrote: void popFront1(ref char[] s) @trusted pure nothrow { import core.bitop, std.algorithm; auto v = bsr(~s[0] | 1); s = s[clamp(v, 1, v > 6 ? 1 : $)..$]; } Seems to be less if i'm not wrong. Yours runs with 790 us best time. bsr

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 08:17:52 UTC, Stefan Koch wrote: Also the code produces conditional set instructions which have a higher latency. And worse throughput. On my arguably a bit dated laptop: popFront3 performs 109 us best time and popFront4 performs with 265 us best time

Re: Can you shrink it further?

2016-10-11 Thread Temtaime via Digitalmars-d
On Tuesday, 11 October 2016 at 08:17:52 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 08:03:40 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 07:30:26 UTC, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c =

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 08:03:40 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 07:30:26 UTC, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248);

Re: color lib

2016-10-11 Thread Andrea Fontana via Digitalmars-d
On Monday, 10 October 2016 at 23:26:53 UTC, Manu wrote: I'm not sure why it matters what format the colour you have is... Strings are in the form #RRGGBB, or #AARRGGBB. That is all. It's the standard I've seen used everywhere ever, including the web, which is a pretty good precedent :P If

[Issue 16607] New: [REG2.072b1] "forward reference" error with structs nested in struct templates

2016-10-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16607 Issue ID: 16607 Summary: [REG2.072b1] "forward reference" error with structs nested in struct templates Product: D Version: D2 Hardware: All OS: All

Re: Can you shrink it further?

2016-10-11 Thread Stefan Koch via Digitalmars-d
On Tuesday, 11 October 2016 at 07:30:26 UTC, Matthias Bentrup wrote: A branch-free version: void popFront4(ref char[] s) @trusted pure nothrow { immutable c = s[0]; uint char_length = 1 + (c >= 192) + (c >= 240) + (c >= 248); s = s.ptr[char_length .. s.length]; } Theoretically the

Working with ranges: mismatched function return type inference

2016-10-11 Thread orip via Digitalmars-d-learn
I get "Error: mismatched function return type inference" errors with choosing the return type for functions that work on ranges using, e.g, std.algorithm or std.range functions, but have different behavior based on runtime values. The return type is always a range with the same underlying

Re: Can you shrink it further?

2016-10-11 Thread Matthias Bentrup via Digitalmars-d
On Tuesday, 11 October 2016 at 04:05:47 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 03:58:59 UTC, Andrei Alexandrescu wrote: On 10/10/16 11:00 PM, Stefan Koch wrote: On Tuesday, 11 October 2016 at 02:48:22 UTC, Andrei Alexandrescu wrote: [...] If you want to skip a byte it's easy

Re: LDC 1.1.0-beta3 has been released!

2016-10-11 Thread Sönke Ludwig via Digitalmars-d-announce
Am 09.10.2016 um 14:32 schrieb Kai Nacke: Hi everyone, LDC 1.1.0-beta3, the LLVM-based D compiler, is available for download! This BETA release is based on the 2.071.2 frontend and standard library and supports LLVM 3.5-3.9. We provide binaries for Linux, OX X, FreeBSD, Win32 & Win64,

Re: weighted round robin

2016-10-11 Thread vino via Digitalmars-d-learn
On Monday, 10 October 2016 at 09:18:16 UTC, Marc Schütz wrote: On Saturday, 8 October 2016 at 22:48:53 UTC, vino wrote: Hi, Can some one guide me on how to implement the weighted round robin, below is what i tried or any other better ways to do it Main Requirement : Incoming socket

Re: scone 1.2.0

2016-10-11 Thread Suliman via Digitalmars-d-announce
On Monday, 10 October 2016 at 19:50:53 UTC, vladdeSV wrote: scone, Simple CONsole Engine, version 1.2.0 has just been released! https://github.com/vladdeSV/scone/releases/tag/v1.2.0 This version includes a restructure of the whole project (should not affect applications), and the addition of

Re: ptrdiff_t of class.tupleof entry

2016-10-11 Thread Satoshi via Digitalmars-d-learn
On Monday, 10 October 2016 at 18:21:10 UTC, Jonathan M Davis wrote: On Monday, October 10, 2016 17:57:15 Satoshi via Digitalmars-d-learn wrote: [...] You can use the offsetof property of a member variable to find out the offset between its address and the address of the beginning of the

Re: Code signing to help with Windows virus false positives

2016-10-11 Thread Thomas Mader via Digitalmars-d
On Tuesday, 11 October 2016 at 01:37:55 UTC, Martin Nowak wrote: On Saturday, 20 August 2016 at 13:45:11 UTC, Basile B. wrote: "to MSI using innosetup" ? There's a misunderstanding here. Inno setup doesn't compile to MS installer, it's a complete independant solution. Whatever makes more

Re: Batch operations

2016-10-11 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 11 October 2016 at 03:20:54 UTC, Stefan Koch wrote: On Tuesday, 11 October 2016 at 03:05:12 UTC, Nicholas Wilson wrote: Splitting this from the colour thread(https://forum.dlang.org/thread/mailman.961.1475765646.2994.digitalmar...@puremagic.com?page=1). [...] This will bloat