Re: state of win32 headers?

2009-02-03 Thread Daniel Keep
akcom wrote: What is the state of the win32 headers? Is there any place where I can get win32 headers including winsock2? http://www.dsource.org/projects/bindings/wiki/WindowsApi Haven't checked on them in a while, but they should be usable. -- Daniel

Deleting an element from an array

2009-02-03 Thread nobody
What is the best way to completely remove an element from an array? For example you have an array: [1,2,3,4,5,6] and want to remove element 3 in such a way that the resulting array is: [1,2,4,5,6] Thanks.

Re: Deleting an element from an array

2009-02-03 Thread Jarrett Billingsley
On Tue, Feb 3, 2009 at 10:14 AM, Frank Benoit keinfarb...@googlemail.com wrote: arr = arr[ 0 .. lowerBound ] ~ arr[ upperBound .. $ ]; That's simple enough, but inefficient. Something like this: import std.c.string; // or import tango.stdc.string; T[] erase(T)(ref T[] arr, size_t idx) {

Re: Deleting an element from an array

2009-02-03 Thread nobody
Jarrett Billingsley jarrett.billings...@gmail.com wrote in message news:mailman.635.1233675301.22690.digitalmars-d-le...@puremagic.com... On Tue, Feb 3, 2009 at 10:14 AM, Frank Benoit keinfarb...@googlemail.com wrote: arr = arr[ 0 .. lowerBound ] ~ arr[ upperBound .. $ ]; That's simple

Re: Deleting an element from an array

2009-02-03 Thread Jarrett Billingsley
On Tue, Feb 3, 2009 at 10:54 AM, nobody someb...@somewhere.com wrote: Let's see if I understand memmove.. The way it's used here, it copies the tail of an array onto that same array, only starting one index earlier, thus removing the undesired element? Neat. Right. However I just realized

Re: Deleting an element from an array

2009-02-03 Thread nobody
Denis Koroskin 2kor...@gmail.com wrote in message news:op.uor1gzqho7c...@korden-pc... On Tue, 03 Feb 2009 15:46:52 +0300, nobody someb...@somewhere.com wrote: What is the best way to completely remove an element from an array? For example you have an array: [1,2,3,4,5,6] and want to

Re: Deleting an element from an array

2009-02-03 Thread nobody
Jarrett Billingsley jarrett.billings...@gmail.com wrote in message news:mailman.636.1233678501.22690.digitalmars-d-le...@puremagic.com... On Tue, Feb 3, 2009 at 10:54 AM, nobody someb...@somewhere.com wrote: Let's see if I understand memmove.. The way it's used here, it copies the tail of an

Re: Deleting an element from an array

2009-02-03 Thread Jarrett Billingsley
On Tue, Feb 3, 2009 at 11:51 AM, nobody someb...@somewhere.com wrote: Would you also happen to know why the following gives an error? arr[1] = arr[$-1];// main.d(11): Error: cannot assign to static array arr[1][] = arr[$-1][]; You cannot reassign what fixed-size array references point

Re: Deleting an element from an array

2009-02-03 Thread Denis Koroskin
On Tue, 03 Feb 2009 15:46:52 +0300, nobody someb...@somewhere.com wrote: What is the best way to completely remove an element from an array? For example you have an array: [1,2,3,4,5,6] and want to remove element 3 in such a way that the resulting array is: [1,2,4,5,6] Thanks. import

Re: state of win32 headers?

2009-02-03 Thread Stewart Gordon
akcom wrote: What is the state of the win32 headers? snip Looking for people like you to help complete the work. But usable. Stewart.

Re: Some performance questions

2009-02-03 Thread Chris Nicholson-Sauls
Lars Kyllingstad wrote: Daniel Keep wrote: Lars Kyllingstad wrote: [snip] From a performance perspective, however, it carries with it the overhead of an extra function call, which I'm not sure I want. -Lars You're worried about a second function call which could potentially be inlined, yet

Re: Learning by Doing: dimensioning units or geometric algebra?

2009-02-03 Thread Bill Baxter
On Wed, Feb 4, 2009 at 6:45 AM, Joel C. Salomon joelcsalo...@gmail.com wrote: Hello all, I'm a C programmer with some C++ experience (C with Classes+STL anyway; never did implement anything but the most trivial templates) and I'm looking to get stated with D. I figured a good way to do that

Anybody ever tried to work with ffmpeg?

2009-02-03 Thread Mike
Hi! I'm trying to get ffmpeg to work with D; I've got some stuff running, but ... well. av_open_input_file gives me -2 as an error and I can't figure out what this means (the #defines for the error codes are impossible to understand, much less translate to D). Anybody ever done that and

Re: Some performance questions

2009-02-03 Thread Lars Kyllingstad
Chris Nicholson-Sauls wrote: Lars Kyllingstad wrote: Daniel Keep wrote: Lars Kyllingstad wrote: [snip] From a performance perspective, however, it carries with it the overhead of an extra function call, which I'm not sure I want. -Lars You're worried about a second function call which

Re: Time some code using Tango

2009-02-03 Thread Jarrett Billingsley
On Tue, Feb 3, 2009 at 7:15 PM, grauzone n...@example.net wrote: If he had to use OS specific APIs (which would be another sad thing about Tango), I'd suggest to use clock_gettime() with CLOCK_THREAD_CPUTIME_ID under Unix. What is timex? http://en.wikipedia.org/wiki/Timex_(Unix)

Re: Time some code using Tango

2009-02-03 Thread grauzone
Jarrett Billingsley wrote: On Tue, Feb 3, 2009 at 5:54 PM, Matthias Walter wal...@mail.math.uni-magdeburg.de wrote: Hi there, I'd like to time some functions using Tango, but only including the really used CPU-time. StopWatch and the other time functions I've found don't mind on the CPU

switch off GC?

2009-02-03 Thread Weed
It is possible to disable GC? That it has not been included in result binary for an increasing performance of ref operations and reduction of the size of the binary I have not found the answer in google.

Re: switch off GC?

2009-02-03 Thread Daniel Keep
Weed wrote: It is possible to disable GC? Yes. See std.gc or tango.core.Memory. That it has not been included in result binary for an increasing performance of ref operations and reduction of the size of the binary I don't know what ref operations are, but odds are disabling the GC will

Re: Some performance questions

2009-02-03 Thread Chris Nicholson-Sauls
Jarrett Billingsley wrote: On Tue, Feb 3, 2009 at 3:44 PM, Chris Nicholson-Sauls ibisbase...@gmail.com wrote: The second reason, is that before every allocation the garbage collector will perform a collection run. This can actually be disabled (at least in theory) if you plan on doing several

Re: Learning by Doing: dimensioning units or geometric algebra?

2009-02-03 Thread BCS
Hello Bill, On Wed, Feb 4, 2009 at 6:45 AM, Joel C. Salomon • a library for dimensional analysis, like boost::units, and/or I always found this kind of thing boring, also I see it as kind of useless overhead that I don't want in my calculations. But it could be a nice way to get your feet

Re: Learning by Doing: dimensioning units or geometric algebra?

2009-02-03 Thread BCS
Hello Joel, Hello all, I'm a C programmer with some C++ experience (C with Classes+STL anyway; never did implement anything but the most trivial templates) and I'm looking to get stated with D. I figured a good way to do that would be to implement a template library, and it may as well be

Re: switch off GC?

2009-02-03 Thread Jesse Phillips
On Wed, 04 Feb 2009 09:38:45 +0700, Weed wrote: It is possible to disable GC? That it has not been included in result binary for an increasing performance of ref operations and reduction of the size of the binary I have not found the answer in google. You can find some more answers,