On Sunday, 14 February 2016 at 08:19:16 UTC, Ali Çehreli wrote:
On 02/14/2016 12:03 AM, Beginner-8 wrote:
Uh, wait! Forgot about that Socket calls .close() in its dtor
Try duplicating the socket handle before handing it over to
Socket (not compiled nor tested):
import core.sys.posix.unistd;
I'm not 100% sure it's included, but I think so.
__
NOOR
On Monday, 15 February 2016 at 05:29:23 UTC, sigod wrote:
On Monday, 15 February 2016 at 03:22:44 UTC, Jon D wrote:
Is there a way to reserve capacity in associative arrays?
[snip]
Maybe try using this: http://code.dlang.org/packages/aammm
Thanks, I wasn't aware of this package. I'll give it
On Monday, 15 February 2016 at 03:22:44 UTC, Jon D wrote:
Is there a way to reserve capacity in associative arrays? In
some programs I've been writing I've been getting reasonable
performance up to about 10 million entries, but beyond that
performance is impacted considerably (say, 30 million o
On Saturday, 13 February 2016 at 19:24:44 UTC, ishwar wrote:
I am stumped on need finding interval between two events in a
program execution in nanoseconds. Any sample code will be
appreciated (along with imports needed to make it work):
- time in nanoseconds-now
- do-some processing
- time in
Is there a way to reserve capacity in associative arrays? In some
programs I've been writing I've been getting reasonable
performance up to about 10 million entries, but beyond that
performance is impacted considerably (say, 30 million or 50
million entries). GC stats (via the "--DRT-gcopt=prof
On Monday, 15 February 2016 at 00:58:54 UTC, Brother Bill wrote:
On Sunday, 14 February 2016 at 23:39:33 UTC, cym13 wrote:
On Sunday, 14 February 2016 at 22:54:36 UTC, Brother Bill
wrote:
In "The D Programming Language", page 402, the toy program
fails.
[...]
Can't reproduce with DMD 2.0.70
On Sunday, 14 February 2016 at 19:32:31 UTC, Bastiaan Veelo wrote:
Thanks. I didn't know that iterating a range means mutating its
contents. I still don't quite get it, and it is probably
because I don't fully understand ranges. I think what confuses
me the most is their analogy to containers.
On 02/14/2016 11:32 AM, Bastiaan Veelo wrote:
> Thanks. I didn't know that iterating a range means mutating its
> contents.
That's not the case: Just like an iterator, a range must maintain some
state to know which item is next. What needs to be mutated is that
iteration state.
> I still don
On 02/14/2016 03:43 PM, Tofu Ninja wrote:
So I wrote a simple ref counted string type because using the built in
strings without the GC is extremely painful. It there any way I can get
strings to implicitly convert to my custom string type?
No, D does not support such implicit conversions.
st
On Sunday, 14 February 2016 at 23:39:33 UTC, cym13 wrote:
On Sunday, 14 February 2016 at 22:54:36 UTC, Brother Bill wrote:
In "The D Programming Language", page 402, the toy program
fails.
[...]
Can't reproduce with DMD 2.0.70, LDC 0.16.1 or GDC 5.3.0 on
Linux x86_64. The code seems to work
So I wrote a simple ref counted string type because using the
built in strings without the GC is extremely painful. It there
any way I can get strings to implicitly convert to my custom
string type?
Some way to make this work...
struct rstring {...}
void fun(rstring s) {...}
...
fun("hello wo
On Sunday, 14 February 2016 at 22:54:36 UTC, Brother Bill wrote:
In "The D Programming Language", page 402, the toy program
fails.
[...]
Can't reproduce with DMD 2.0.70, LDC 0.16.1 or GDC 5.3.0 on Linux
x86_64. The code seems to work as intended.
In "The D Programming Language", page 402, the toy program fails.
The first fail is that enforce() needs: import std.exception;
The second fail is that when debugging, in Visual Studio 2015
Community Edition,
it fails with this error:
First-change exception: std.format.FormatException Unterm
On Sunday, 14 February 2016 at 18:28:11 UTC, Jonathan M Davis
wrote:
An immutable range fundamentally does not work. The same goes
with const. In fact, a type that's immutable is going to fail
isInputRange precisely because it can't possibly function as
one. While empty and front may be calla
On Sunday, February 14, 2016 15:24:39 Bastiaan Veelo via Digitalmars-d-learn
wrote:
> Hi,
>
> I am having trouble getting the iteration methods in
> std.algorithm.iteration to work on immutable data:
>
> > import std.algorithm.iteration;
> > import std.stdio;
> >
> > void main()
> > {
> > stri
On Sunday, 14 February 2016 at 12:56:51 UTC, Vladde Nordholm
wrote:
I'm not sure of how to use alias efficiently, so I want to know
if I could somehow do this (psuedo-code)
class Singleton
{
//So instead of calling `Singleton.getSingleton()` you just
call `Singleton`
alias this = getSingl
Hi,
I am having trouble getting the iteration methods in
std.algorithm.iteration to work on immutable data:
import std.algorithm.iteration;
import std.stdio;
void main()
{
string[][] cycles;
cycles ~= ["one", "two"];
cycles ~= ["three", "four"];
foreach (numbe
On Sunday, 14 February 2016 at 13:23:28 UTC, Guillaume Piolat
wrote:
On Sunday, 14 February 2016 at 12:56:51 UTC, Vladde Nordholm
wrote:
I'm not sure of how to use alias efficiently, so I want to
know if I could somehow do this (psuedo-code)
class Singleton
{
//So instead of calling `Singlet
On Sunday, 14 February 2016 at 12:56:51 UTC, Vladde Nordholm
wrote:
I'm not sure of how to use alias efficiently, so I want to know
if I could somehow do this (psuedo-code)
class Singleton
{
//So instead of calling `Singleton.getSingleton()` you just
call `Singleton`
alias this = getSingl
I'm not sure of how to use alias efficiently, so I want to know
if I could somehow do this (psuedo-code)
class Singleton
{
//So instead of calling `Singleton.getSingleton()` you just
call `Singleton`
alias this = getSingleon()
//code for singleton...
}
Thanks in advance,
vladde
On Sunday, 14 February 2016 at 07:16:54 UTC, Russel Winder wrote:
On Sat, 2016-02-13 at 18:58 +, Vladde Nordholm via
Digitalmars-d- learn wrote:
[...]
Following the ACCU consensus: there is never, ever a good
Singleton or reason to contemplate using one.
Obviously though there are some
Photoshop has the ability to be controlled by scripts and
programming languages. For example, C# can be used to access
photoshop by adding the appropriate reference and using
directives. I believe it is COM based but I am not totally sure.
I've tried reading the docs but it's not making much s
On 02/14/2016 12:03 AM, Beginner-8 wrote:
Uh, wait! Forgot about that Socket calls .close() in its dtor
Try duplicating the socket handle before handing it over to Socket (not
compiled nor tested):
import core.sys.posix.unistd;
Socket(dup(myHandle))
I think socket handles are duplicata
Uh, wait! Forgot about that Socket calls .close() in its dtor
On Sunday, 14 February 2016 at 07:33:11 UTC, Ali Çehreli wrote:
Maybe another option is to duplicate the socket handle
Sure!
Nevertheless, it is need method for socket_t duplication.
Something like:
class Socket
{
...
static Socket dup(socket_t)
...
}
before giving it to Socket but I am f
26 matches
Mail list logo