On 25/03/2015 2:31 a.m., Eric wrote:
BTW, why do you need FreeImage to create image? Isn't it just possible
inside dlangui?
This is basically my question. Is there a drawing engine that
can draw lines, circles, and shapes as well as single pixels?
-Eric
If you have some way to draw you
BTW, why do you need FreeImage to create image? Isn't it just
possible inside dlangui?
This is basically my question. Is there a drawing engine that
can draw lines, circles, and shapes as well as single pixels?
-Eric
On 3/24/2015 5:50 AM, zhmt wrote:
I am using kqueue on macosx, I know how to write a simple server. But
don't know which event will be triggered in kqueue when connected
successfully , which event when failed?
EVFILT_READ or EVFILT_WRITE?
I have googled this question, got no examples, any
On Tuesday, 24 March 2015 at 12:25:14 UTC, Etienne wrote:
On 3/24/2015 5:50 AM, zhmt wrote:
I am using kqueue on macosx, I know how to write a simple
server. But
don't know which event will be triggered in kqueue when
connected
successfully , which event when failed?
EVFILT_READ or
I am using kqueue on macosx, I know how to write a simple server.
But don't know which event will be triggered in kqueue when
connected successfully , which event when failed?
EVFILT_READ or EVFILT_WRITE?
I have googled this question, got no examples, any suggestions
are welcome, Thanks.
On Tuesday, 24 March 2015 at 16:56:13 UTC, matovitch wrote:
Thanks, just to be clear :
void Bar(T : Foo)(T t){
}
is the same as
void Bar(T)(T t) if (is(T == Foo)){
}
and it is checked only at compile time ? (for the runtime I
know that what interface were meant for ;)).
Ali already
On 03/24/2015 08:50 AM, matovitch wrote:
Lets say I want to implement some generic algorithm. I would like
to checks the types passed to my algorithm implements a specific
interface.
I think you are looking for template constraints. Look at isInputRange's
implementation:
On 03/24/2015 09:56 AM, matovitch wrote:
just to be clear :
void Bar(T : Foo)(T t){
}
That means if T can implicitly be converted to Foo.
is the same as
void Bar(T)(T t) if (is(T == Foo)){
}
That means if T is exactly Foo.
and it is checked only at compile time ?
Yes to both.
Ali
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n = 18_446_724_073_709_551_614U;
bitArr[0] = format(%b, n).to!BigInt;
Hi,
It's been a long time since I coded some d code... sorry I take
the lazy way asking for advices. :D
Lets say I want to implement some generic algorithm. I would like
to checks the types passed to my algorithm implements a specific
interface.
interface IStuff(Stuff)
{
void foo();
}
for example:use vc compile on x86
func.c:
__declspec(dllexport) int _stdcall sub(int a,int b)
{
return a-b;
}
func.def:
LIBRARY
EXPORTS
sub
-
i use implib.exe to create a omf format lib.
D code:
import std.exception;
//this is a cdecl call
extern(C)
More like :
import std.stdio;
interface IStuff(Stuff)
{
void foo();
}
class TypeClass(T, I) : I(T)
{
alias this stuff;
T stuff;
}
void myAwesomeAlgo(Stuff) (TypeClass!(Stuff, IStuff) stuff)
{
stuff.foo();
}
struct MyStuff
{
void foo()
{
writeln(Hello World
Well, just follow that link to the code...it almost compile :
http://dpaste.com/3JNP0QD.
On Tuesday, 24 March 2015 at 15:26:22 UTC, Adam D. Ruppe wrote:
try extern(Windows) isntead of extern(C).
use extern(Windows) or extern(System)
the compile show the link error:
Error 42: Symbol Undefined _sub@8
dll export func name is sub,
and the dll is 3rd party,i can't
On Wednesday, 25 March 2015 at 00:09:33 UTC, mzf wrote:
i use implib.exe /system func.lib func.dll to create a
func.lib.
You might also need to specify the .def file as the final
argument to that.
http://digitalmars.com/ctg/implib.html
The def file can list aliases for the functions.
On 25/03/2015 6:55 a.m., Ilya Korobitsyn wrote:
Hello!
Is there any websocket client implementation in D?
I know there is WS server as a part of vibe.d, but it does not seem to
include client.
Maybe there are some library bindings that I've missed?
Thank you,
Ilya
It appears you are on your
On Wednesday, 25 March 2015 at 00:26:21 UTC, Adam D. Ruppe wrote:
On Wednesday, 25 March 2015 at 00:09:33 UTC, mzf wrote:
i use implib.exe /system func.lib func.dll to create a
func.lib.
You might also need to specify the .def file as the final
argument to that.
Wait no ! In that case my type will have to inherit the
interface...I don't want that, checking without inheriting...I
know thats weird.
On Tuesday, 24 March 2015 at 16:54:47 UTC, Chris wrote:
I tried to use Dscanner with Textadpet, but it doesn't work. I
created the directory modules/dmd and copied the init.lua file
from here [1] into it. What am I doing wrong, or is it an old
version that is no longer supported?
[1]
On Tuesday, 24 March 2015 at 16:44:54 UTC, weaselcat wrote:
On Tuesday, 24 March 2015 at 15:51:00 UTC, matovitch wrote:
Hi,
It's been a long time since I coded some d code... sorry I take
the lazy way asking for advices. :D
Lets say I want to implement some generic algorithm. I would
like
to
Hello!
Is there any websocket client implementation in D?
I know there is WS server as a part of vibe.d, but it does not
seem to include client.
Maybe there are some library bindings that I've missed?
Thank you,
Ilya
On Tuesday, 24 March 2015 at 17:35:14 UTC, matovitch wrote:
xor it with -1 instead of 1. (-1 is store as 0xfff..f with the
classic modular arithmetic)
Thanks.
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n =
On Tuesday, 24 March 2015 at 16:35:04 UTC, Ivan Kazmenko wrote:
What exactly is not working?
Everything works. I'm just a little forgotten properties of the
operation xor.
I just wanted to xor 1 each digit in the number of type BigInt,
while I would like to store each number in the binary
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n =
To resume my goal (last lonely message I promise), how can you
statically check a type implement an interface without making
this type inherit the interface (otherwise std.traits would do
it) ?
ps : it seems to me that this is exactly what the haskell
compiler do with type classes - layman
On Tuesday, 24 March 2015 at 15:45:36 UTC, Dennis Ritchie wrote:
Tell me, please, how can I replace this code?
import std.conv : to;
import std.bigint : BigInt;
import std.string : format;
import std.stdio : writeln;
void main() {
BigInt[10] bitArr;
ulong n =
well, alias this is the issue here.
interface I
{
void foo();
}
struct S
{
void foo() {}
}
class C : I
{
S s;
alias this s;
}
don't compile...if you have any idea to do otherwise I am greatly
interested. Thanks !
On Saturday, 21 March 2015 at 23:16:39 UTC, rcorre wrote:
If I am developing a library and some of my functinos take a
std.typecons.Flag as an argument, should I 'public import
std.typecons: Flag, Yes, No'?
It seems like it would be a pain for users of the library to
have to import this
On Tuesday, 24 March 2015 at 15:51:00 UTC, matovitch wrote:
Hi,
It's been a long time since I coded some d code... sorry I take
the lazy way asking for advices. :D
Lets say I want to implement some generic algorithm. I would
like
to checks the types passed to my algorithm implements a
I don't know if this is a bug or expected behaviour. The struct
is mutable, assignable and pre-increment operator works. But
post-increment doesn't compile because of the immutable member.
--
struct S
{
int i;
immutable(Object) o;
S opUnary(string op)() { return this; }
void
I tried to use Dscanner with Textadpet, but it doesn't work. I
created the directory modules/dmd and copied the init.lua file
from here [1] into it. What am I doing wrong, or is it an old
version that is no longer supported?
[1] https://bitbucket.org/SirAlaran/ta-d/
On Tuesday, 24 March 2015 at 13:31:06 UTC, Eric wrote:
BTW, why do you need FreeImage to create image? Isn't it just
possible inside dlangui?
This is basically my question. Is there a drawing engine that
can draw lines, circles, and shapes as well as single pixels?
-Eric
Hello,
I've
On 24/03/2015 6:36 p.m., Laeeth Isharc wrote:
On Tuesday, 24 March 2015 at 04:53:39 UTC, Laeeth Isharc wrote:
Hi.
struct RawGoogleResults
{
string version_;
string status;
string sig;
string[string][][string] table;
}
enum json =
try extern(Windows) isntead of extern(C).
On Tuesday, 24 March 2015 at 17:28:50 UTC, Dennis Ritchie wrote:
On Tuesday, 24 March 2015 at 16:35:04 UTC, Ivan Kazmenko wrote:
What exactly is not working?
Everything works. I'm just a little forgotten properties of the
operation xor.
I just wanted to xor 1 each digit in the number of
On Monday, 23 February 2015 at 19:41:30 UTC, Eric wrote:
I have been trying out dlanui, and I am able to create an image
with FreeImage and display it with an ImageWidget. However this
requires that I write the image out to disk, and then load it
again
to display it. Is there any way I can
37 matches
Mail list logo