Is it possible to mix fibers with sockets from phobos?
If so, how would I do it?
Like just a simple example of async sockets using fibers in D.
I will say that I'd prefer to not use any packages ex. vibe.d
On Thursday, 21 May 2020 at 07:38:45 UTC, data pulverizer wrote:
Started uploading the code and writing the article for this.
The code for each language can be run, see the script.x files
in each folder for details and timings.
https://github.com/dataPulverizer/KernelMatrixBenchmark
Thanks
On Thursday, 21 May 2020 at 15:42:50 UTC, Basile B. wrote:
On Thursday, 21 May 2020 at 04:29:30 UTC, Kaitlyn Emmons wrote:
is there a way to redirect std out to a string or a buffer
without using a temp file?
yes:
[snip]
Alternatively, setvbuf can be used:
void[1024] buf; // buffer must b
On Thursday, 21 May 2020 at 20:12:13 UTC, Harry Gillanders wrote:
On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran
wrote:
Hi all,
I need to use the macro GET_X_LPARAM. But compiler says that
"undefined identifier GET_X_LPARAM". I cant find any modules
with GET_X_LPARAM defined. Do i
On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote:
Hi all,
I need to use the macro GET_X_LPARAM. But compiler says that
"undefined identifier GET_X_LPARAM". I cant find any modules
with GET_X_LPARAM defined. Do i miss something ?
GET_X_LPARAM isn't defined in Phobos's Windows b
On Thursday, 21 May 2020 at 18:42:47 UTC, Vinod K Chandran wrote:
Hi all,
I need to use the macro GET_X_LPARAM. But compiler says that
"undefined identifier GET_X_LPARAM". I cant find any modules
with GET_X_LPARAM defined. Do i miss something ?
I search all modules in "
C:\D\dmd2\src\druntim
Hi all,
I need to use the macro GET_X_LPARAM. But compiler says that
"undefined identifier GET_X_LPARAM". I cant find any modules with
GET_X_LPARAM defined. Do i miss something ?
On Thursday, 21 May 2020 at 06:57:28 UTC, mw wrote:
On Thursday, 21 May 2020 at 01:13:27 UTC, Paul Backus wrote:
On Wednesday, 20 May 2020 at 23:41:15 UTC, mw wrote:
Can we do string interpolation in D now?
There's an implementation in the dub package "scriptlike":
https://code.dlang.org/pac
On Thursday, 21 May 2020 at 17:17:49 UTC, Adam D. Ruppe wrote:
On Thursday, 21 May 2020 at 17:10:31 UTC, mw wrote:
BTW, is the .idup must be there?
It is discussed more in the github document but basically the
proposed built-in syntax returns a generic builder thing which
can make more than
On Thursday, 21 May 2020 at 18:12:01 UTC, ZK wrote:
I love the extensibility of this, but perhaps there should be
something like `ii"foo".idup` that's syntactic sugar for
`i"foo".idup`. New users might get confused by the need for
appending idup, and then they'll think about how other
language
On Thursday, 21 May 2020 at 15:09:57 UTC, Steven Schveighoffer
wrote:
On 5/20/20 10:50 PM, data pulverizer wrote:
how do you allocate/free memory without using the garbage
collector?
Use C malloc and free.
Does allocating and freeing memory using `GC.malloc` and
`GC.free` avoid D's garbage c
On Thursday, 21 May 2020 at 17:10:31 UTC, mw wrote:
BTW, is the .idup must be there?
It is discussed more in the github document but basically the
proposed built-in syntax returns a generic builder thing which
can make more than just strings. The idup specifically asks it to
make a copy into
On Thursday, 21 May 2020 at 12:53:50 UTC, Adam D. Ruppe wrote:
On Thursday, 21 May 2020 at 06:57:28 UTC, mw wrote:
i.e how to write this 's'?
gimme a like on the proposal to add to the language!
https://github.com/dlang/DIPs/pull/186
If accepted, that would let you write
i"stuff here".idup
On Thursday, 21 May 2020 at 04:29:30 UTC, Kaitlyn Emmons wrote:
is there a way to redirect std out to a string or a buffer
without using a temp file?
yes:
---
#!dmd -betterC
module runnable;
extern(C) int main()
{
import core.sys.posix.stdio : fclose, stdout, fmemopen,
printf, fflush;
On Thursday, 21 May 2020 at 04:29:30 UTC, Kaitlyn Emmons wrote:
is there a way to redirect std out to a string or a buffer
without using a temp file?
If you want to do the redirection at startup, it's possible. Have
an another program to start your program by std.process functions
and redirec
On Wednesday, 20 May 2020 at 21:15:25 UTC, Dukc wrote:
On Wednesday, 20 May 2020 at 20:49:52 UTC, Vinod K Chandran
wrote:
[...]
No can do :(. Well, moderators can delete posts so you could
try to ask them nicely in some cases but the primary way tends
to be the same as with email: send a corre
On Wednesday, 20 May 2020 at 21:13:25 UTC, Paul Backus wrote:
On Wednesday, 20 May 2020 at 20:49:52 UTC, Vinod K Chandran
wrote:
[...]
You can't. If you need to make a correction, the best you can
do is to make a follow-up post.
[...]
Copy & paste it.
[...]
You can't embed images dir
On 5/21/20 12:29 AM, Kaitlyn Emmons wrote:
is there a way to redirect std out to a string or a buffer without using
a temp file?
D's I/O is dependent on C's FILE * API, so if you can make that write to
a string, then you could do it in D.
I don't think there's a way to do it in C. So likely
On 5/20/20 10:50 PM, data pulverizer wrote:
how do you allocate/free memory without using the garbage collector?
Use C malloc and free.
Does allocating and freeing memory using `GC.malloc` and `GC.free` avoid
D's garbage collector?
No, an allocation can trigger a collection. D does not have
On Thursday, 21 May 2020 at 06:57:28 UTC, mw wrote:
i.e how to write this 's'?
gimme a like on the proposal to add to the language!
https://github.com/dlang/DIPs/pull/186
If accepted, that would let you write
i"stuff here".idup
to get an interpolated string.
On Thursday, 21 May 2020 at 06:57:28 UTC, mw wrote:
On Thursday, 21 May 2020 at 01:13:27 UTC, Paul Backus wrote:
On Wednesday, 20 May 2020 at 23:41:15 UTC, mw wrote:
Can we do string interpolation in D now?
There's an implementation in the dub package "scriptlike":
https://code.dlang.org/pac
https://forum.dlang.org/post/prlulfqvxrgrdzxot...@forum.dlang.org
On Tuesday, 10 November 2015 at 11:22:56 UTC, wobbles wrote:
int a = 1;
int b = 4;
writefln("The number %s is less than %s", a, b);
writeln("The number ",a, " is less than ",b);
On Thursday, 21 May 2020 at 07:16:11 UTC, Basile B. wrote:
The problem is that "K" is a template type parameter [1].
When the compiler deduces the parameter that ends up with a
symbol, i.e not a type.
To permit a symbol to be deduced you can use a template alias
parameter[2] instead:
---
stru
On Wednesday, 6 May 2020 at 17:31:39 UTC, Jacob Carlborg wrote:
On 2020-05-06 12:23, data pulverizer wrote:
Yes, I'll do a blog or something on GitHub and link it.
It would be nice if you could get it published on the Dlang
blog [1]. One usually get paid for that. Contact Mike Parker.
[1]
On Thursday, 21 May 2020 at 07:16:11 UTC, Basile B. wrote:
On Thursday, 21 May 2020 at 04:46:02 UTC, data pulverizer wrote:
I'd like to pass kernel functions using:
```
auto calculateKernelMatrix(K, T)(K!(T) Kernel, Matrix!(T) data)
{
...
}
```
and call it using `calculateKernelMatrix(myKer
On Thursday, 21 May 2020 at 04:46:02 UTC, data pulverizer wrote:
I'd like to pass kernel functions using:
```
auto calculateKernelMatrix(K, T)(K!(T) Kernel, Matrix!(T) data)
{
...
}
```
and call it using `calculateKernelMatrix(myKernel, myData);`
but I get a type deduction error and have to
On Thursday, 21 May 2020 at 01:13:27 UTC, Paul Backus wrote:
On Wednesday, 20 May 2020 at 23:41:15 UTC, mw wrote:
Can we do string interpolation in D now?
There's an implementation in the dub package "scriptlike":
https://code.dlang.org/packages/scriptlike#string-interpolation
Thank you! ve
27 matches
Mail list logo