Re: socketpair

2015-12-30 Thread Vladimir Panteleev via Digitalmars-d-learn
On Thursday, 31 December 2015 at 02:37:07 UTC, sanjayss wrote: OK; one way I realized was to put the network socket select in one thread and the watching for keypress in another thread and then use the concurrency primitives to message pass events to the main thread -- may be a little expensive

Re: socketpair

2015-12-30 Thread sanjayss via Digitalmars-d-learn
On Thursday, 31 December 2015 at 02:31:09 UTC, sanjayss wrote: On Thursday, 31 December 2015 at 02:26:23 UTC, Rikki Cattermole wrote: On 31/12/15 3:22 PM, sanjayss wrote: [...] Wrong tool for the job. You want message passing not sockets to communicate between threads in this case. You're

Re: socketpair

2015-12-30 Thread sanjayss via Digitalmars-d-learn
On Thursday, 31 December 2015 at 02:26:23 UTC, Rikki Cattermole wrote: On 31/12/15 3:22 PM, sanjayss wrote: std.socket supports the socketpair() function, but it seems like this api is not really usable in any of the concurrency primitives supported by D. So what is the purpose of the socketpa

Re: socketpair

2015-12-30 Thread Rikki Cattermole via Digitalmars-d-learn
On 31/12/15 3:22 PM, sanjayss wrote: std.socket supports the socketpair() function, but it seems like this api is not really usable in any of the concurrency primitives supported by D. So what is the purpose of the socketpair() support? Basically I am trying to create two threads and am trying t

socketpair

2015-12-30 Thread sanjayss via Digitalmars-d-learn
std.socket supports the socketpair() function, but it seems like this api is not really usable in any of the concurrency primitives supported by D. So what is the purpose of the socketpair() support? Basically I am trying to create two threads and am trying to use socketpair() to create two s

Re: GTKD Cairo get pixel color

2015-12-30 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see cairo_image_surface_create_for_data then you'll be able to access the data and, at the same t

Re: ndslice help.

2015-12-30 Thread Zz via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 20:43:21 UTC, Ilya Yaroshenko wrote: On Wednesday, 30 December 2015 at 18:53:15 UTC, Zz wrote: Hi, Just playing with ndslice and I couldn't figure how to get the following transformations. given. auto slicea = sliced(iota(6), 2, 3, 1); foreach (item; slicea

Re: ndslice help.

2015-12-30 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 18:53:15 UTC, Zz wrote: Hi, Just playing with ndslice and I couldn't figure how to get the following transformations. given. auto slicea = sliced(iota(6), 2, 3, 1); foreach (item; slicea) { writeln(item); } which gives. [[0][1][2]] [[3][4][5]] what tra

GTKD Cairo get pixel color

2015-12-30 Thread TheDGuy via Digitalmars-d-learn
Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context?

ndslice help.

2015-12-30 Thread Zz via Digitalmars-d-learn
Hi, Just playing with ndslice and I couldn't figure how to get the following transformations. given. auto slicea = sliced(iota(6), 2, 3, 1); foreach (item; slicea) { writeln(item); } which gives. [[0][1][2]] [[3][4][5]] what transformation should i do to get the following from slicea.

regex - match/matchAll and bmatch - different output

2015-12-30 Thread Ivan Kazmenko via Digitalmars-d-learn
Hi, While solving Advent of Code problems for fun (already discussed in the forum: http://forum.dlang.org/post/cwdkmblukzptsrsrv...@forum.dlang.org), I ran into an issue. I wanted to test for the pattern "two consecutive characters, arbitrary sequence, the same two consecutive characters". Sa

Re: virtual destructor in C++ integration: bug or me being stupid?

2015-12-30 Thread Atila Neves via Digitalmars-d-learn
On Tuesday, 29 December 2015 at 18:41:41 UTC, Adam D. Ruppe wrote: On Tuesday, 29 December 2015 at 18:32:23 UTC, Atila Neves wrote: The problem here is that I don't know what the workaround is. The one I used (well, last time I tried this) was to just put a dummy function in the D interface t

Re: pragma(inline)

2015-12-30 Thread Daniel Kozak via Digitalmars-d-learn
V Wed, 30 Dec 2015 03:24:45 + Ilya via Digitalmars-d-learn napsáno: > Hi, > > Does `pragma(inline, true)` force DMD compiler to inline function > when `-inline` was _not_ defined? > > I am failing to get a good disassembled code with obj2asm/otool > :-( > > Best, Ilya pragma(inline), pr

Re: pragma(inline)

2015-12-30 Thread Daniel Kozak via Digitalmars-d-learn
V Wed, 30 Dec 2015 03:24:45 + Ilya via Digitalmars-d-learn napsáno: > Hi, > > Does `pragma(inline, true)` force DMD compiler to inline function > when `-inline` was _not_ defined? > > I am failing to get a good disassembled code with obj2asm/otool > :-( > > Best, Ilya No