Re: DLL loading behaviors and pragma(lib)

2017-08-10 Thread rikki cattermole via Digitalmars-d-learn
On 11/08/2017 12:18 AM, David Zhang wrote: I've been working on getting OpenGL to load on windows without a library, and encountered something curious; Context creation fails when I try to use the function pointer retrieved through GetProcAddress, but works just fine with the statically linked

Re: Bug in D?!

2017-08-10 Thread ketmar via Digitalmars-d-learn
Mr. Pib wrote: string Q(alias T, alias D)() { pragma(msg, T); pragma(msg, D); enum x = T~" = "~D~";"; pragma(msg, x); } mixin(Q!(`x`, 100)()); outputs, at compile time, x 100 x = d; there is no lowercase d. I did initially define Q as string Q(alias T, D)(D

Bug in D?!

2017-08-10 Thread Mr. Pib via Digitalmars-d-learn
string Q(alias T, alias D)() { pragma(msg, T); pragma(msg, D); enum x = T~" = "~D~";"; pragma(msg, x); } mixin(Q!(`x`, 100)()); outputs, at compile time, x 100 x = d; there is no lowercase d. I did initially define Q as string Q(alias T, D)(D d) and one might

Re: GTKD resources

2017-08-10 Thread Mr. Pib via Digitalmars-d-learn
On Friday, 11 August 2017 at 02:27:21 UTC, captaindet wrote: On 2017-08-11 13:00, Mr. Pib wrote: How can one include external files such as glade, icons, images that are static in nature in to the binary but not require extraction on program run to be used? gtk's builder doesn't seem to take

Re: GTKD resources

2017-08-10 Thread captaindet via Digitalmars-d-learn
On 2017-08-11 13:00, Mr. Pib wrote: How can one include external files such as glade, icons, images that are static in nature in to the binary but not require extraction on program run to be used? gtk's builder doesn't seem to take an in memory representation of glade files and building a pixbuf

Re: DlangUI Error

2017-08-10 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 10 August 2017 at 23:38:42 UTC, Jiyan wrote: So the strange thing is i had an older compiler (v2.074.1), so i started running the 2.075 version - with which it worked! The thing is i can start the 2.075 version only over the activate.sh script in a shell. Can you tell me how i can

GTKD resources

2017-08-10 Thread Mr. Pib via Digitalmars-d-learn
How can one include external files such as glade, icons, images that are static in nature in to the binary but not require extraction on program run to be used? gtk's builder doesn't seem to take an in memory representation of glade files and building a pixbuf seems quite over the top to do s

Re: DlangUI Error

2017-08-10 Thread HyperParrow via Digitalmars-d-learn
On Thursday, 10 August 2017 at 23:38:42 UTC, Jiyan wrote: On Thursday, 10 August 2017 at 22:27:44 UTC, HyperParrow wrote: On Thursday, 10 August 2017 at 20:48:23 UTC, Jiyan wrote: Hey, i get the following errors when i try to use dlangui, by just importing the package i get a lot of errors whi

Re: DlangUI Error

2017-08-10 Thread Jiyan via Digitalmars-d-learn
On Thursday, 10 August 2017 at 22:27:44 UTC, HyperParrow wrote: On Thursday, 10 August 2017 at 20:48:23 UTC, Jiyan wrote: Hey, i get the following errors when i try to use dlangui, by just importing the package i get a lot of errors which look like: function std.xml.Item.opEquals does not overr

DLL loading behaviors and pragma(lib)

2017-08-10 Thread David Zhang via Digitalmars-d-learn
I've been working on getting OpenGL to load on windows without a library, and encountered something curious; Context creation fails when I try to use the function pointer retrieved through GetProcAddress, but works just fine with the statically linked version provided through core.sys.windows

Re: string hash significant speedup

2017-08-10 Thread HyperParrow via Digitalmars-d-learn
On Thursday, 10 August 2017 at 20:07:35 UTC, Steven Schveighoffer wrote: On 8/10/17 3:36 PM, Johnson Jones wrote: when using T[string], hashing is used. Computing the hash is slow(relatively speaking). Does D cache the hashes? Strings are immutable so there is absolutely no reason why the has

Re: DlangUI Error

2017-08-10 Thread HyperParrow via Digitalmars-d-learn
On Thursday, 10 August 2017 at 20:48:23 UTC, Jiyan wrote: Hey, i get the following errors when i try to use dlangui, by just importing the package i get a lot of errors which look like: function std.xml.Item.opEquals does not override any function, did you mean to override 'object.Object.opEqua

Re: How do I compile a program with curl lib on Windows?

2017-08-10 Thread Neto via Digitalmars-d-learn
UPDATE 2: Managed to do it! Got the precompiled binaries from here: https://github.com/HazeProductions/libcurl (thank @frk1 very much for his repo) downloaded them then extracted the release folder to proper curl folder on my machine then dmd -L-libcurl app.d -I"C:\libcrl" worked just

Re: string hash significant speedup

2017-08-10 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 10 August 2017 at 20:07:35 UTC, Steven Schveighoffer wrote: On 8/10/17 3:36 PM, Johnson Jones wrote: when using T[string], hashing is used. Computing the hash is slow(relatively speaking). Does D cache the hashes? Strings are immutable so there is absolutely no reason why the has

Re: How do I compile a program with curl lib on Windows?

2017-08-10 Thread Neto via Digitalmars-d-learn
On Thursday, 10 August 2017 at 20:29:53 UTC, Neto wrote: Could someone give me an example to how do I compile a program with support to curl on Windows? Where do I find the .lib for link against my D programa under Windows or do I need to compile it myself? I downloaded the lib versions at curl

DlangUI Error

2017-08-10 Thread Jiyan via Digitalmars-d-learn
Hey, i get the following errors when i try to use dlangui, by just importing the package i get a lot of errors which look like: function std.xml.Item.opEquals does not override any function, did you mean to override 'object.Object.opEquals'? What is happening there?

How do I compile a program with curl lib on Windows?

2017-08-10 Thread Neto via Digitalmars-d-learn
Could someone give me an example to how do I compile a program with support to curl on Windows? Where do I find the .lib for link against my D programa under Windows or do I need to compile it myself? I downloaded the lib versions at curl's official web site but I find either .a files or .h in

Re: string hash significant speedup

2017-08-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/10/17 3:36 PM, Johnson Jones wrote: when using T[string], hashing is used. Computing the hash is slow(relatively speaking). Does D cache the hashes? Strings are immutable so there is absolutely no reason why the hash ever need to be computed more than once. It computes them on insertion

string hash significant speedup

2017-08-10 Thread Johnson Jones via Digitalmars-d-learn
when using T[string], hashing is used. Computing the hash is slow(relatively speaking). Does D cache the hashes? Strings are immutable so there is absolutely no reason why the hash ever need to be computed more than once. Essentially the hash should be attached to strings like their length

Vectorflow noob

2017-08-10 Thread Jiyan via Digitalmars-d-learn
Hey, wanted to the following simple thing with vectorflow: I want to develop a simple MLP, which has 2 input neurons and one output neuron. The network should simply add the input values together, so [1,2] predicts [3] i guess. I started in a newbish way to build the following code: import ve

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Meta via Digitalmars-d-learn
On Thursday, 10 August 2017 at 15:55:41 UTC, Jason Brady wrote: Wow. That makes perfect sense. I forgot stringof works only with expressions It works with symbols too. See the following: template test(){} pragma(msg, test.stringof);

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Jason Brady via Digitalmars-d-learn
On Thursday, 10 August 2017 at 14:51:22 UTC, Meta wrote: Welcome to optional parentheses hell. Please enjoy your stay. Because function calls in D can optionally omit the parens, `FunctionWithArguments.stringof` is actually attempting to call `FunctionWithArguments` without any arguments, and

Re: delegates/lambas do not pick up calling convention

2017-08-10 Thread Timon Gehr via Digitalmars-d-learn
On 10.08.2017 15:22, Adam D. Ruppe wrote: On Wednesday, 9 August 2017 at 23:52:00 UTC, Johnson Jones wrote: extern(C) delegate(void*) {} You should very rarely use extern(C) delegate... delegate is a D type, so the C function is almost certainly not actually receiving it. Only time you'd wa

Re: Fix gtkD api display

2017-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 10 August 2017 at 14:55:06 UTC, Mike Wey wrote: The problem was that there are a few large classes at the start of the hierarchy, and with the old version of ddox the function pages would not only be generated for the base class, but also for all the derived classes. Oh, I see. M

Re: Fix gtkD api display

2017-08-10 Thread Mike Wey via Digitalmars-d-learn
On 10-08-17 15:57, Adam D. Ruppe wrote: On Saturday, 5 August 2017 at 14:02:09 UTC, Mike Wey wrote: One issue is the shear size of the generated documentation, though the current version of ddox no longer generates a ton of unused files bringing the size down from 15-20GB to a mere 2GB. what?

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Meta via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote: Why does the following code error out with: app.d(12,10): Error: function app.FunctionWithArguments (uint i) is not callable using argument types () Code: import std.stdio; void FunctionWithoutArguments() { } void FunctionWith

Re: gtkD window centering message up and no app on taskbar

2017-08-10 Thread Mike Wey via Digitalmars-d-learn
On 09-08-17 23:54, Johnson Jones wrote: Ok, I added import core.sys.windows.winuser; __gshared extern(C) core.sys.windows.winuser.HANDLE function(GdkWindow*) gdk_win32_window_get_handle; Linker.link(gdk_win32_window_get_handle, "gdk_win32_window_get_handle", LIBRARY_GDK); to G

Re: Fix gtkD api display

2017-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 5 August 2017 at 14:02:09 UTC, Mike Wey wrote: One issue is the shear size of the generated documentation, though the current version of ddox no longer generates a ton of unused files bringing the size down from 15-20GB to a mere 2GB. what?! I'm not actually sure how much gtk alon

Re: delegates/lambas do not pick up calling convention

2017-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 23:52:00 UTC, Johnson Jones wrote: extern(C) delegate(void*) {} You should very rarely use extern(C) delegate... delegate is a D type, so the C function is almost certainly not actually receiving it. Only time you'd want an extern(C) using D types like delegat

Re: Efficiently streaming data to associative array

2017-08-10 Thread Jon Degenhardt via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 13:36:46 UTC, Steven Schveighoffer wrote: On 8/8/17 3:43 PM, Anonymouse wrote: On Tuesday, 8 August 2017 at 16:00:17 UTC, Steven Schveighoffer wrote: I wouldn't use formattedRead, as I think this is going to allocate temporaries for a and b. What would you sugge

Re: delegates/lambas do not pick up calling convention

2017-08-10 Thread Timon Gehr via Digitalmars-d-learn
On 10.08.2017 01:52, Johnson Jones wrote: given somethign like Threads.threadsAddIdle which takes an extern(C) int (void*) we can't seem to do threadsAddIdle((void*) { }, null); I think this is a compiler bug. Try: threadsAddIdle((x){ }, null); It seems that the calling convention is deduc

Re: delegates/lambas do not pick up calling convention

2017-08-10 Thread ag0aep6g via Digitalmars-d-learn
On 08/10/2017 01:52 AM, Johnson Jones wrote: I've tried import gdk.Threads; alias DD = static extern(C) int delegate(void*); auto x = (void*)

Re: D on AArch64 CPU

2017-08-10 Thread David J Kordsmeier via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 08:37:53 UTC, Johannes Pfau wrote: Iain recently updated GDC & phobos up to 2.074 and we have a pull request for 2.075. So don't worry about fixing old GDC phobos/druntime versions, recent gdc git branches should already have AArch64 phobos changes. We have a