winpcap binding

2011-08-04 Thread maarten van damme
Hello everyone, It's been a couple of days since I've started trying to use the pcap library with d. first I've started from scratch but I gave up partly because I don't know enough of how sockets are implemented in d and how I was going to be able to bridge those two, I ended up making one giant m

Re: winpcap binding

2011-08-04 Thread simendsjo
On 04.08.2011 09:10, maarten van damme wrote: Hello everyone, It's been a couple of days since I've started trying to use the pcap library with d. first I've started from scratch but I gave up partly because I don't know enough of how sockets are implemented in d and how I was going to be able to

More than one invariant per struct/class

2011-08-04 Thread simendsjo
I would like to use a template mixin to add some fields to a struct, but I'd also like the template to add additional invariant checks without having to remember to add this for all struct/classes that mixes in this code. class C { int a; } mixin template EmbedC() { C _c; // oops

Re: More than one invariant per struct/class

2011-08-04 Thread Alex Rønne Petersen
On 04-08-2011 11:32, simendsjo wrote: I would like to use a template mixin to add some fields to a struct, but I'd also like the template to add additional invariant checks without having to remember to add this for all struct/classes that mixes in this code. class C { int a; } mixin template E

Re: More than one invariant per struct/class

2011-08-04 Thread Pelle
On Thu, 04 Aug 2011 11:32:03 +0200, simendsjo wrote: I would like to use a template mixin to add some fields to a struct, but I'd also like the template to add additional invariant checks without having to remember to add this for all struct/classes that mixes in this code. class C {

Re: More than one invariant per struct/class

2011-08-04 Thread simendsjo
On 04.08.2011 12:30, Pelle wrote: On Thu, 04 Aug 2011 11:32:03 +0200, simendsjo wrote: I would like to use a template mixin to add some fields to a struct, but I'd also like the template to add additional invariant checks without having to remember to add this for all struct/classes that mixes

Re: More than one invariant per struct/class

2011-08-04 Thread Pelle
On Thu, 04 Aug 2011 12:40:48 +0200, simendsjo wrote: On 04.08.2011 12:30, Pelle wrote: What happens if you replace assert(_c) with assert(_c !is null)? The problem is that you cannot include more than one invariant() in a struct or class. IIRC assert(obj) gets rewritten to obj.__invariant

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Magnus Lie Hetland
On 2011-08-03 14:57:57 +, David Nadlinger said: This seems to be exactly same problem I reported to the NG some days ago. It is caused by ASLR being enabled for 32bit applications on Lion too, and kennytm is to be credited for tracking this down to a fixed stack bottom in the druntime code

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Alex Rønne Petersen
On 04-08-2011 14:09, Magnus Lie Hetland wrote: On 2011-08-03 14:57:57 +, David Nadlinger said: This seems to be exactly same problem I reported to the NG some days ago. It is caused by ASLR being enabled for 32bit applications on Lion too, and kennytm is to be credited for tracking this dow

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Magnus Lie Hetland
On 2011-08-04 12:27:54 +, Alex Rønne Petersen said: Hi, You can see my blog for Linux: http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/ Thanks! -- Magnus Lie Hetland http://hetland.org

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Jacob Carlborg
On 2011-08-04 14:09, Magnus Lie Hetland wrote: On 2011-08-03 14:57:57 +, David Nadlinger said: This seems to be exactly same problem I reported to the NG some days ago. It is caused by ASLR being enabled for 32bit applications on Lion too, and kennytm is to be credited for tracking this dow

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Magnus Lie Hetland
On 2011-08-04 12:27:54 +, Alex Rønne Petersen said: Hi, You can see my blog for Linux: http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/ For others trying to do the same (i.e., compile this stuff in OS X Lion), one change is needed in posix.mak: Change .

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Magnus Lie Hetland
On 2011-08-04 13:01:19 +, Jacob Carlborg said: Since it's just the runtime that's been changed in this case, perhaps you just can compile the runtime and replace that with what's in the release. I guess so. I've just starting compiling/linking stuff together -- I'll see how it goes. (It

Re: GG bug? (OS X Lion, DMD 2.054)

2011-08-04 Thread Alex Rønne Petersen
On 04-08-2011 15:21, Magnus Lie Hetland wrote: On 2011-08-04 12:27:54 +, Alex Rønne Petersen said: Hi, You can see my blog for Linux: http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/ For others trying to do the same (i.e., compile this stuff in OS X Lion)

Re: NaCl stable ABI

2011-08-04 Thread Andrej Mitrovic
On 8/4/11, Nick Sabalausky wrote: > There is nothing you've mentioned that can't be (better) fixed without > cramming everything into a browser. Where would you cram it then? Put MSN inside the game itself?

Re: Weird timing issue with Thread.sleep

2011-08-04 Thread Andrej Mitrovic
On 8/4/11, Jacob Carlborg wrote: > I would say that the correct solution is to rewrite the examples to work > with any CPU speed. > > -- > /Jacob Carlborg > That's what I did. The framerate isn't clamped, and the threads don't sleep, there's no spinning going on, I've replaced all of that with ti

Re: NaCl stable ABI

2011-08-04 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.2102.1312471399.14074.digitalmars-d-le...@puremagic.com... > On 8/4/11, Nick Sabalausky wrote: >> There is nothing you've mentioned that can't be (better) fixed without >> cramming everything into a browser. > > Where would you cram it then? Put MS

Re: NaCl stable ABI

2011-08-04 Thread Andrej Mitrovic
I think we're misunderstanding each other. I'm not saying move the game to the browser, just the part of the game where you can browse the servers for that game. That's the part of QLive that I liked, I don't care if the game actually runs in the browser or not. I don't know what this NaCI busines

Re: NaCl stable ABI

2011-08-04 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.2111.1312489332.14074.digitalmars-d-le...@puremagic.com... >I think we're misunderstanding each other. > > I'm not saying move the game to the browser, just the part of the game > where you can browse the servers for that game. That's the part of >

Re: NaCl stable ABI

2011-08-04 Thread Andrej Mitrovic
I thought MSN had a pretty large network of users. IIRC arstechnica recently had an article comparing the userbase of msn and skype.

Re: Hexadecimal string to integer

2011-08-04 Thread Kai Meyer
On 08/03/2011 10:44 AM, Stijn Herreman wrote: On 3/08/2011 2:32, Johann MacDonagh wrote: On 8/2/2011 8:17 PM, Stijn Herreman wrote: std.conv does not support conversion from a hexadecimal string to an integer. Is there a technical reason for this limitation? This is the best I could do, can it

Re: NaCl stable ABI

2011-08-04 Thread Adam Ruppe
MSN has done very well outside the United States.

Re: Minimum value in a range

2011-08-04 Thread Kai Meyer
On 08/02/2011 06:03 AM, Andrej Mitrovic wrote: import std.algorithm; void main() { auto x = min([1, 2, 3]); // x would be 1 } min() isn't equipped to do this on a single range. What can I use instead? I haven't had my coffee yet. :) Looking at std.algorithm, I think what you really want

Re: Minimum value in a range

2011-08-04 Thread Timon Gehr
Andrei Mitrovic wrote: > Does anyone know why putting this alias in module scope errors out?: > > import std.algorithm; > > alias reduce!((a, b){ return 1; }) foo; > > void main() > { > foo([1, 2, 3]); > } > > Error: delegate test.__dgliteral1!(int,int).__dgliteral1 is a nested > function and c

Re: Minimum value in a range

2011-08-04 Thread Andrej Mitrovic
Cool. I've submitted a bug report for this, but maybe it's a duplicate.

Multi-file byte comparison tool. What would you have done differently?

2011-08-04 Thread Kai Meyer
I have a need for detecting incorrect byte sequences in multiple files (>2) at a time (as a part of our porting effort to new platforms.) Ideally the files should be identical for all but a handful of byte sequences (in a header section) that I can just skip over. I thought this would be a fun

Re: Multi-file byte comparison tool. What would you have done differently?

2011-08-04 Thread Timon Gehr
Kai Meyer wrote: > So the question is, how would you make it more D-ish? (Do we have a term > analogous to "pythonic" for D? :)) An easy first step to improve the D-Factor would be to replace all these for loops with foreach loops and ref foreach loops. -Timon

Re: Minimum value in a range

2011-08-04 Thread bearophile
Kai Meyer: > Looking at std.algorithm, I think what you really want is minCount: > http://www.d-programming-language.org/phobos/std_algorithm.html#minCount It's a bad design. Bye, bearophile

Re: winpcap binding

2011-08-04 Thread maarten van damme
hehe, thank you, that was what I was looking for. I've created an import lib from the dll and now started to translate the header files following those guidelines. I'm assuming thats how I have to do it? :) the problem is that it's a lot of work and that I can never really test if what I have so f