On Friday, 22 September 2017 at 05:43:24 UTC, Nicholas Wilson
wrote:
On Friday, 22 September 2017 at 04:37:44 UTC, Enjoys Math wrote:
On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math
wrote:
I've tried opening the port for TCP with windows 10 firewall
settings. Same result.
What
On Friday, 22 September 2017 at 04:37:44 UTC, Enjoys Math wrote:
On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote:
I've tried opening the port for TCP with windows 10 firewall
settings. Same result.
What tool would best help me debug this? Wireshark or is that
too low level?
On Friday, 22 September 2017 at 04:25:00 UTC, Enjoys Math wrote:
I've tried opening the port for TCP with windows 10 firewall
settings. Same result.
What tool would best help me debug this? Wireshark or is that
too low level?
I've used Hercules:
On Friday, 22 September 2017 at 03:26:36 UTC, Mike Parker wrote:
On Friday, 22 September 2017 at 02:22:46 UTC, Josh wrote:
src\mixer.d(80,22): Error: function pointer
Mix_ChannelFinished (extern (C) void function(int channel)) is
not callable using argument types (extern (C) void
I've tried opening the port for TCP with windows 10 firewall
settings. Same result.
What tool would best help me debug this? Wireshark or is that
too low level?
Here's my minimal D code (server.d):
module server;
import core.thread;
import std.socket;
import std.experimental.logger;
class Server : Thread
{
private:
Socket listener;
int backlog;
string address;
ushort port;
SocketSet sockSet;
Socket[]
On Friday, 22 September 2017 at 02:57:32 UTC, Joseph wrote:
On Saturday, 16 September 2017 at 14:33:53 UTC, Mike Wey wrote:
On 16-09-17 06:33, Joseph wrote:
I've used null in place of [te]. I'm not sure what target
entry is for and if that is the problem or what. I am trying
to drag files
On Friday, 22 September 2017 at 02:32:56 UTC, Josh wrote:
Why should the binding force nothrow? I don't understand why
you HAVE to not throw exceptions. Is it because of the C -> D
aspect?
Yes, it's because D exceptions are not guaranteed to propagate
through the C callstack. It works on
On Friday, 22 September 2017 at 02:32:56 UTC, Josh wrote:
Why should the binding force nothrow? I don't understand why
you HAVE to not throw exceptions. Is it because of the C -> D
aspect?
Yes, it's because D exceptions are not guaranteed to propagate
through the C callstack. It works on
On Friday, 22 September 2017 at 02:22:46 UTC, Josh wrote:
src\mixer.d(80,22): Error: function pointer Mix_ChannelFinished
(extern (C) void function(int channel)) is not callable using
argument types (extern (C) void delegate(int channel))
Code:
void unmuteAfterPlaySound()
{
On Saturday, 16 September 2017 at 14:33:53 UTC, Mike Wey wrote:
On 16-09-17 06:33, Joseph wrote:
I've used null in place of [te]. I'm not sure what target
entry is for and if that is the problem or what. I am trying
to drag files from windows explorer to a grid or label(I
duplicated the
On Friday, 22 September 2017 at 02:18:34 UTC, Mike Parker wrote:
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones
wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just
On Friday, 22 September 2017 at 02:18:34 UTC, Mike Parker wrote:
and use & to reference the function instead of calling it:
Mix_ChannelFinished();
To expand on this, D allows functions to be called without
parentheses. `channelDone` is actually a function call, whereas
in C, it's treated
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just making a minor
mistake somewhere.
[...]
Make it a C function,
On Thursday, 21 September 2017 at 13:52:25 UTC, Meta wrote:
On Thursday, 21 September 2017 at 12:30:15 UTC, David Bennett
wrote:
On Thursday, 21 September 2017 at 11:42:36 UTC, David Bennett
wrote:
enum isCTstring(alias arg) = (!isAssignable!(typeof(arg)) ||
__traits(compiles, mixin(` "foo"
On 09/21/2017 09:59 PM, H. S. Teoh wrote:
On Thu, Sep 21, 2017 at 09:49:14PM +0200, ag0aep6g via Digitalmars-d-learn
wrote:
[...]
3) Declaring a packed struct in a function literal that gets
immediately called:
enum size_so_very_clever(Types ...) = () {
struct S { align(1) Types
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a function
as a parameter, and so I think I'm just making a minor mistake
somewhere.
The C SDL docs say:
// make a
On Thu, Sep 21, 2017 at 09:49:14PM +0200, ag0aep6g via Digitalmars-d-learn
wrote:
[...]
> 3) Declaring a packed struct in a function literal that gets
> immediately called:
>
> enum size_so_very_clever(Types ...) = () {
> struct S { align(1) Types fields; }
> return S.sizeof;
> } ();
On 9/21/17 3:24 PM, Timon Gehr wrote:
This is a good alternative, maybe arrange it like this:
dfs(a + 1, b); dfs(a, b + 1);
dfs(a - 1, b); dfs(a, b - 1);
Yes, better!
Just need to make sure no code is duplicated. (For example, there could
be more work to do in each loop iteration, and then
On Thursday, 21 September 2017 at 19:49:14 UTC, ag0aep6g wrote:
I don't have a one-liner, but here are some other solutions
that might be interesting. None of them is particularly pretty,
though.
1) Recursive template:
2) Using the std library:
3) Declaring a packed struct in a function
On 09/21/2017 08:44 PM, David Zhang wrote:
Given the function F, where: F(Args...)(Args args) { ... }
How can I statically determine the size of the argument list in bytes?
Preferably, I would like a one-liner. However, std.algorithm doesn't
seem to support tuples, or `Args.each!(T =>
On 21.09.2017 17:53, Steven Schveighoffer wrote:
On 9/21/17 11:48 AM, Steven Schveighoffer wrote:
On 9/21/17 11:06 AM, Timon Gehr wrote:
foreach(i; 0 .. 4){
dfs(a + (i==0) - (i==1),
b + (i==2) - (i==3));
}
So am I, but I wasn't commenting on
Given the function F, where: F(Args...)(Args args) { ... }
How can I statically determine the size of the argument list in
bytes?
Preferably, I would like a one-liner. However, std.algorithm
doesn't seem to support tuples, or `Args.each!(T =>
T.sizeof).sum` would work.
For the moment,
On Wednesday, 20 September 2017 at 19:25:58 UTC, Timon Gehr wrote:
Actually, it is useful enough to have a Wikipedia page:
https://en.wikipedia.org/wiki/Iverson_bracket
Example of a good use:
void floodFill(dchar[][] data,dchar c,int i,int j) {
void dfs(int a, int b) {
if (a<0 ||
On 9/21/17 11:48 AM, Steven Schveighoffer wrote:
On 9/21/17 11:06 AM, Timon Gehr wrote:
foreach(i; 0 .. 4){
dfs(a + (i==0) - (i==1),
b + (i==2) - (i==3));
}
So am I, but I wasn't commenting on trade-offs, only the view that
there are no good
On 9/21/17 11:06 AM, Timon Gehr wrote:
foreach(i; 0 .. 4){
dfs(a + (i==0) - (i==1),
b + (i==2) - (i==3));
}
...
So am I, but I wasn't commenting on trade-offs, only the view that there
are no good uses.
This seems way easier for me to grok, and
On 20.09.2017 23:13, nkm1 wrote:
Example of a good use:
void floodFill(dchar[][] data,dchar c,int i,int j) {
void dfs(int a, int b) {
Example of a good use:
void floodFill(dchar[][] data,dchar c,int i,int j) {
void dfs(int a, int b) {
if (a<0 || a >= data.length) return;
On Thursday, 21 September 2017 at 12:30:15 UTC, David Bennett
wrote:
On Thursday, 21 September 2017 at 11:42:36 UTC, David Bennett
wrote:
[snip]
```
string[] escapeCTFE(Args...)(){
static foreach (arg; Args){
static if(__traits(compiles, ###WHATDOIPUTHERE###)){
[snip]
So far
On Thursday, 21 September 2017 at 11:42:36 UTC, David Bennett
wrote:
[snip]
```
string[] escapeCTFE(Args...)(){
static foreach (arg; Args){
static if(__traits(compiles, ###WHATDOIPUTHERE###)){
[snip]
So far the best I've come up with is :
```
enum isCTstring(alias arg) =
Hi Guys,
Is there an easy way to check if the value of string passed to a
template is available at compile time?
Here is a cut down example of that I'm doing:
```
string[] escapeCTFE(Args...)(){
static foreach (arg; Args){
static if(__traits(compiles, ###WHATDOIPUTHERE###)){
32 matches
Mail list logo