Re: an extremely naive question regarding synchronized...

2016-11-15 Thread Kapps via Digitalmars-d-learn
On Monday, 14 November 2016 at 17:43:37 UTC, WhatMeWorry wrote: I was reading this fasciniating article: https://davesdprogramming.wordpress.com/2013/05/06/low-lock-singletons/ And to quote a section of it: - static MySingleton get() {

Re: newbie problem with nothrow

2016-10-31 Thread Kapps via Digitalmars-d-learn
On Monday, 31 October 2016 at 17:04:28 UTC, Temtaime wrote: On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote: Is there a way to turn off nothrow or work around it? Because to me it looks like nothrow prevents me from doing anything useful. extern(C) void onKeyEvent(GLFWwindow*

Re: How to debug (potential) GC bugs?

2016-09-27 Thread Kapps via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:23:11 UTC, Matthias Klumpp wrote: Hello! I am working together with others on the D-based appstream-generator[1] project, which is generating software metadata for "software centers" and other package-manager functionality on Linux distributions, and is used

Re: Proper way to work around `Invalid memory operation`?

2016-09-27 Thread Kapps via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp wrote: Hello! I have a class similar to this one: ``` class Dummy { private: string tmpDir; public: this (string fname) { tmpDir = buildPath ("/tmp", fname.baseName); std.file.mkdirRecurse (tmpDir);

Re: Simple performance question from a newcomer

2016-02-21 Thread Kapps via Digitalmars-d-learn
On Monday, 22 February 2016 at 07:10:23 UTC, Kapps wrote: If you do want to test the differences between the range approach and the loop approach, something like: auto sumtest4(Range)(Range range) @safe pure { return range.reduce!((a, b) => a + b); } is a more fair comparison. I

Re: Simple performance question from a newcomer

2016-02-21 Thread Kapps via Digitalmars-d-learn
If you do want to test the differences between the range approach and the loop approach, something like: auto sumtest4(Range)(Range range) @safe pure { return range.reduce!((a, b) => a + b); } is a more fair comparison. I get results within 15% of sumtest2 with this using dmd. I think

Re: Is this nogc? dmd and gdc disagree

2016-02-13 Thread Kapps via Digitalmars-d-learn
On Saturday, 13 February 2016 at 00:41:35 UTC, tsbockman wrote: On Friday, 12 February 2016 at 23:46:09 UTC, Kapps wrote: You'll encounter this pretty often in Phobos I think. I really don't think @nogc is ready, and tend to avoid it in my code. Exceptions are a big reason for it, and lots

Re: Is this nogc? dmd and gdc disagree

2016-02-12 Thread Kapps via Digitalmars-d-learn
On Thursday, 11 February 2016 at 12:41:16 UTC, rcorre wrote: On Thursday, 11 February 2016 at 04:20:13 UTC, tsbockman wrote: On Thursday, 11 February 2016 at 03:09:51 UTC, rcorre wrote: I recently tried compiling enumap with GDC, and found that it disagrees with DMD on whether a function is

Re: nogc Array

2016-01-25 Thread Kapps via Digitalmars-d-learn
On Tuesday, 26 January 2016 at 04:31:07 UTC, Igor wrote: On Tuesday, 26 January 2016 at 03:06:40 UTC, maik klein wrote: On Tuesday, 26 January 2016 at 03:03:40 UTC, Igor wrote: Is there a GC-less array that we can use out of the box or do I have to create my own?

Re: Voldemort Type Construction Error

2016-01-15 Thread Kapps via Digitalmars-d-learn
On Friday, 15 January 2016 at 20:04:47 UTC, Nordlöw wrote: On Friday, 15 January 2016 at 16:51:24 UTC, Anon wrote: On Friday, 15 January 2016 at 14:04:50 UTC, Nordlöw wrote: What have I missed? In line 126, `static struct Result()` is a template. Either drop the parens there, or change the

Re: question about the implementation of Variant

2016-01-04 Thread Kapps via Digitalmars-d-learn
On Monday, 4 January 2016 at 09:13:25 UTC, Jonathan M Davis wrote: On Monday, January 04, 2016 07:30:50 aki via Digitalmars-d-learn wrote: But wait, how does GC detect there still be a live reference to the object Foo? Because store is just a fix sized array of bytes. ubyte[size] store; GC

Re: Speeding up text file parser (BLAST tabular format)

2015-09-14 Thread Kapps via Digitalmars-d-learn
On Monday, 14 September 2015 at 18:31:38 UTC, H. S. Teoh wrote: I decided to give the code a spin with `gdc -O3 -pg`. Turns out that the hotspot is in std.array.split, contrary to expectations. :-) Here are the first few lines of the gprof output: [...] Perhaps using the new rangified

Re: (De)Serializing interfaces

2015-08-22 Thread Kapps via Digitalmars-d-learn
On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I

Re: How disruptive is the GC?

2015-07-29 Thread Kapps via Digitalmars-d-learn
On Wednesday, 29 July 2015 at 17:09:52 UTC, Namespace wrote: On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote: I'm in the early stages of building a little game with OpenGL (in D) and I just want to know the facts about the GC before I decide to either use it or work around it. Lots of

Re: how to avoid cycle detected?

2015-07-02 Thread Kapps via Digitalmars-d-learn
On Wednesday, 1 July 2015 at 09:09:53 UTC, aki wrote: Following code causes run-time error. How can I use static this() without causing error? It's difficult to avoid this situation because actual code is more complex. file main.d: void main() { } file a.d: import b; class A { static

Re: Shouldn't std.conv.emplace be @nogc?

2015-03-02 Thread Kapps via Digitalmars-d-learn
On Monday, 2 March 2015 at 12:37:33 UTC, drug wrote: I guess the reason why std.conv.emplace is not @nogc-ed is that nobody added it yet? I didn't see using of gc in the emplace sources. Soon: https://github.com/D-Programming-Language/phobos/pull/2999

Re: stdio.lines doesn't have popFront, but works with foreach

2014-12-11 Thread Kapps via Digitalmars-d-learn
On Thursday, 11 December 2014 at 20:11:21 UTC, Andrew Klaassen wrote: The docs for stdio.lines say that it's a struct. stdio.lines works with foreach. The docs for foreach say: Iteration over struct and class objects can be done with ranges. For foreach, this means the following properties

Re: Check type is a struct at compile time?

2014-12-05 Thread Kapps via Digitalmars-d-learn
On Friday, 5 December 2014 at 20:38:31 UTC, Gary Willoughby wrote: How can i check that a type is a struct at compile time? I know i can test for a class like this: static if(is(T == class)) { ... } But how to do the same thing for a struct? Same thing but with struct: is(T == struct)

Re: [dub] Size of executable

2014-11-28 Thread Kapps via Digitalmars-d-learn
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote: [Maybe this has been asked before.] I usually use dub to create and build projects. I built one of the projects with dub and then by hand with dmd[1] passing all the files etc. Turned out that the executable built with dub was 1.4

Re: undefined reference to class template

2014-11-23 Thread Kapps via Digitalmars-d-learn
On Friday, 14 November 2014 at 23:29:34 UTC, Satoshi wrote: Hi, Im using GDC 4.9.0 compiler. I have template classes like public class LinkedList(T) {...} and when I try compile it together, everything works fine. But when I compile every source file to separate object file and link it

Re: new(malloc) locks everything in multithreading

2014-10-24 Thread Kapps via Digitalmars-d-learn
On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote: On Friday, 24 October 2014 at 10:46:57 UTC, tcak wrote: On Friday, 24 October 2014 at 10:29:10 UTC, Kagamin wrote: Looks like your IDE filters too much. Can you configure it to filter less and show address locations? This is what I have

Re: new(malloc) locks everything in multithreading

2014-10-24 Thread Kapps via Digitalmars-d-learn
On Friday, 24 October 2014 at 18:38:39 UTC, tcak wrote: On Friday, 24 October 2014 at 16:51:02 UTC, Kapps wrote: On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote: Not sure if this is the same issue, but by default gdb breaks on signals that the GC uses, which would explain why it's

Re: Beginner ?. Why does D suggest to learn java

2014-10-21 Thread Kapps via Digitalmars-d-learn
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your first programming language. Why? Looks

Re: Beginner ?. Why does D suggest to learn java

2014-10-21 Thread Kapps via Digitalmars-d-learn
On Tuesday, 21 October 2014 at 09:14:08 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 21 Oct 2014 09:01:32 + Kapps via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: no template magic that's very bad. it's time to stop making people think that templates

Re: Can someone explain how glfw3.dll gets created?

2014-10-13 Thread Kapps via Digitalmars-d-learn
Derelict provides bindings to C libraries, and loads them at runtime. So glfw3.dll is actually an existing C library (you can get it at http://www.glfw.org/download.html), which Derelict provides bindings for. Derelict / your code does not generate the actual dll.

Re: Threadpools, difference between DMD and LDC

2014-08-04 Thread Kapps via Digitalmars-d-learn
On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: I have another question: it seems I can spawn hundreds of threads (Heck, even 10_000 is accepted), even when I have 4-8 cores. Is there: is there a limit to the number of threads? I tried a threadpool

Re: Programming a Game in D? :D

2014-08-02 Thread Kapps via Digitalmars-d-learn
On Sunday, 3 August 2014 at 03:39:25 UTC, Rikki Cattermole wrote: Lastly the game dev industry is very hesitant to change languages for a lot of reasons. And one of those is platform support. They won't be seeing D on e.g. Xbox One anytime soon if you get my drift. Apparently D already

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Kapps via Digitalmars-d-learn
Measure a larger number of loops. I understand you're concerned about microseconds, but your benchmark shows nothing because your timer is simply not accurate enough for this. The benchmark that bearophile showed where C took ~2 nanoseconds vs the ~7000 D took heavily implies to me that the C

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Kapps via Digitalmars-d-learn
On Wednesday, 9 July 2014 at 13:18:00 UTC, Larry wrote: You are definitely right, I did mess up while translating ! I run the corrected codes (the ones I was meant to provide :S) and on a slow macbook I end up with : C : 2 D : 15994 Of course when run on very high end machines, this diff is

Re: Problem Linking Phobos git master

2014-07-04 Thread Kapps via Digitalmars-d-learn
Possibly something related to: https://github.com/D-Programming-Language/dmd/pull/3715 Have you tried updating to git master today?

Re: import except one?

2014-06-29 Thread Kapps via Digitalmars-d-learn
A bit late, but you should also be able to do: import scriptlike; alias Config = std.process.Config;

Re: httpS post fail at tango

2014-06-29 Thread Kapps via Digitalmars-d-learn
On Thursday, 26 June 2014 at 17:07:30 UTC, JJDuck wrote: On Thursday, 26 June 2014 at 16:33:57 UTC, JJDuck wrote: I tried to use phobos , but there is no such function exists for posting to https too With Phobos, you can use http://dlang.org/phobos/std_net_curl.html#post. Depending on

Re: Concurrency on Windows (spawn)

2014-06-18 Thread Kapps via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 15:03:55 UTC, Ali Çehreli wrote: On 06/18/2014 06:28 AM, Chris wrote: On Wednesday, 18 June 2014 at 11:57:06 UTC, Chris wrote: Windows: in a D-DLL I'm trying to spawn a thread. However, nothing happens auto myThread = spawn(myFunction, thisTid); send(myThread,

Re: what is going on with cgcs.c:351?

2014-06-16 Thread Kapps via Digitalmars-d-learn
Possibly https://issues.dlang.org/show_bug.cgi?id=11763 or https://issues.dlang.org/show_bug.cgi?id=11903

Re: Does __gshared have shared semantics?

2014-06-13 Thread Kapps via Digitalmars-d-learn
On Saturday, 14 June 2014 at 01:24:05 UTC, Mike Franklin wrote: In other words, is 'shared __gshared' redundant? All __gshared does is makes the variable not go into thread-local storage, nothing more. Shared does this, as well as modify the type to be shared(T) instead of just T. So yes,

Re: Source File and Position of User Defined Type

2014-06-11 Thread Kapps via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 20:58:41 UTC, Nordlöw wrote: Is there a way to, programatically (trait), lookup the source file and position of a user defined type either dynamically or, even better, statically? I don't believe this is possible. Perhaps you would be able to generate the .json

Re: Cannot understand deprecation message recently added to Phobos

2014-06-11 Thread Kapps via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 20:59:25 UTC, Nordlöw wrote: Can somebody explain the meaning of split in the error message Deprecation: function core.time.Duration.weeks is deprecated - Please use split instead. weeks was too frequently confused for total!weeks. given by function

Re: Class Data Members Name Reflection

2014-06-10 Thread Kapps via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 16:13:31 UTC, Adam D. Ruppe wrote: Two options: do allMembers and filter it out to only be data members, or do some slicing of tupleof.stringof: S s; foreach(idx, member; s.tupleof) { writeln(Name: , s.tupleof[idx].stringof[2..$]); } The tupleof[idx] inside the

Re: Class Data Members Name Reflection

2014-06-10 Thread Kapps via Digitalmars-d-learn
On Tuesday, 10 June 2014 at 20:01:37 UTC, Nordlöw wrote: Notice that A.init.tupleof segfaults for classes so that is _not_ an adviced solution in a generic solution! There's no need to use .init: import std.stdio; struct Foo { int a, b; } void main() {

Re: Basic dynamic array question. Use of new versus no new.

2014-06-10 Thread Kapps via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5; // now has 5 elements while in Mr. Alexandrescu's

Re: XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Kapps via Digitalmars-d-learn
On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote: I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking to try out Mono-D. Then this showed up: http://puu.sh/8NV4V.png Was wondering where I can get those

Re: XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Kapps via Digitalmars-d-learn
On Friday, 16 May 2014 at 01:07:28 UTC, Kapps wrote: On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote: I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking to try out Mono-D. Then this showed up: http

Re: Array!T and find are slow

2014-05-14 Thread Kapps via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 17:20:37 UTC, David Nadlinger wrote: On Wednesday, 14 May 2014 at 15:42:13 UTC, Damian Day wrote: On Wednesday, 14 May 2014 at 14:54:57 UTC, David Nadlinger wrote: Could you post a short benchmark snippet explicitly showing the problem? Benchmark found here:

Re: Array!T and find are slow

2014-05-14 Thread Kapps via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 23:50:34 UTC, Meta wrote: On the topic of lazy, why *is* it so slow, exactly? I thought it was just shorthand for taking a function that evaluates the expression, and wrapping said expression in that function at the call site. That is, I thought that: int

Re: Configuring Phobos from the 1-click installer

2014-05-12 Thread Kapps via Digitalmars-d-learn
On Monday, 12 May 2014 at 15:02:54 UTC, Moses wrote: PATH environment variable is not related at all with phobos2 sources paths. All Linux packages (Ubuntu too) includes -I/usr/include/dmd/phobos on /etc/dmd.conf configuration file. If you need to explicit pass this argument to dmd compiler,

Re: Create many objects using threads

2014-05-06 Thread Kapps via Digitalmars-d-learn
On Monday, 5 May 2014 at 22:11:39 UTC, Ali Çehreli wrote: On 05/05/2014 02:38 PM, Kapps wrote: I think that the GC actually blocks when creating objects, and thus multiple threads creating instances would not provide a significant speedup, possibly even a slowdown. Wow! That is the case

Re: Create many objects using threads

2014-05-06 Thread Kapps via Digitalmars-d-learn
On Tuesday, 6 May 2014 at 15:56:11 UTC, Kapps wrote: On Monday, 5 May 2014 at 22:11:39 UTC, Ali Çehreli wrote: On 05/05/2014 02:38 PM, Kapps wrote: I think that the GC actually blocks when creating objects, and thus multiple threads creating instances would not provide a significant speedup

Re: Create many objects using threads

2014-05-05 Thread Kapps via Digitalmars-d-learn
On Monday, 5 May 2014 at 17:14:54 UTC, Caslav Sabani wrote: Hi, I have just started to learn D. Its a great language. I am trying to achieve the following but I am not sure is it possible or should be done at all: I want to have one array where I will store like 10 objects. But I

Re: Optimize my code =)

2014-02-18 Thread Kapps
On Tuesday, 18 February 2014 at 09:05:33 UTC, Stanislav Blinov wrote: allocationTest ... Time required: 2 hnsecs (o_O) identityMatrixTest ... Time required: 4 hnsecs (o_O) LDC is probably detecting that you're never actually using the results of the operation and that none of

Re: 64 bit size_t

2014-02-17 Thread Kapps
On Monday, 17 February 2014 at 07:46:02 UTC, Steve Teale wrote: On Monday, 17 February 2014 at 07:17:06 UTC, Steve Teale wrote: What is size_t for 64 bit? Steve Sorry parent.children is just a straightforward array Sorry again - forget about it. I'd forgotten that D actually says int is

Re: Optimize my code =)

2014-02-17 Thread Kapps
On Monday, 17 February 2014 at 11:34:43 UTC, bearophile wrote: foreach (ref T element; this.data) { element *= scalar; } Try to use: data[] *= scalar; for (auto i = 0; i this.dim.size; ++i) { this.data[i] += other.data[i]; } Try to

Re: Optimize my code =)

2014-02-14 Thread Kapps
On Friday, 14 February 2014 at 16:00:09 UTC, Robin wrote: As I am very new to D I instantly ran into certain optimizing issues. E.g. the simple matrix multiplication based in my java implementation requires about 1.5 secs for multiplying two 1000x1000 matrices, however my D implementation

Re: std.algorithm for changing array values

2014-01-15 Thread Kapps
On Wednesday, 15 January 2014 at 20:34:32 UTC, Andre wrote: foreach(entry;entries){ if (entry.key == 3){ entry.value = 42; found = true; } } One thing to keep in mind is that structs are passed by

Re: Server is not active?

2013-09-28 Thread Kapps
This is just a guess, but it is because you're setting the socket to be blocking after the call to accept? If it defaults to non-blocking, this would cause accept to return immediately, so the client connecting would fail as the server isn't currently accepting connections. Also to verify it's

Re: Support implicit conversion between types

2013-09-04 Thread Kapps
On Wednesday, 4 September 2013 at 21:14:26 UTC, Ali Çehreli wrote: On 09/04/2013 01:46 PM, Adam D. Ruppe wrote: D does not support implicit struct construction. That's what I knew. Interestingly though, it *does* support it for functions taking classes: class Foo { this(int i)

Re: Tools for building a dynamic derived type? I need a push in the right direction.

2013-08-20 Thread Kapps
On Tuesday, 20 August 2013 at 18:55:44 UTC, Gary Willoughby wrote: I've been researching ways to accomplish creating a template that creates a special kind of derived type and i think i need a push in the right direction. Take this simple class: class Person { private string _name;

Getting vtable for inherited Interface instance

2013-08-20 Thread Kapps
I'm trying to implement a runtime reflection module, and am having some issues with figuring out the function pointer to invoke an interface on a class that derives from the one that implements the interface. For example, given the following code, we can call an interface function using a

Re: Getting vtable for inherited Interface instance

2013-08-20 Thread Kapps
I should mention that there's no knowledge of Bar nor DerivedBar at compile-time, but there is of Foo. The vtable index of bar within Foo is known as well, but without knowledge of Bar or DerivedBar I can't just do the same with their implementation.

Re: how to get enclosing function as symbol ? (eg: __function__.stringof ==__FUNCTION__)

2013-08-17 Thread Kapps
On Sunday, 18 August 2013 at 01:52:50 UTC, Timothee Cour wrote: Is there any way to get the enclosing function as symbol ? I'd like something like that: alternative names would be: __function__ __context__ auto fun(alias caller=__function__)(){ //caller represents fun1!double return

Re: Struct's alignment

2013-08-13 Thread Kapps
On Saturday, 10 August 2013 at 20:36:24 UTC, Temtaime wrote: Hello, guys! I have Matrix class(that contains an array of 16 floats) and SSE code to mult it. It's neccessary to have an array alignment 16. I'm figured out simple test-code: align(16) struct S { align(16) int a; } void

Re: Win32 + OpenGL bindings

2013-04-20 Thread Kapps
to 4.2 core here https://bitbucket.org/Kapps/shardgraphics/src (gl.d, glfuncs.d, gltypes.d, and possibly glfw.d if you need that), which include loading the function pointers, but there may be some licensing issues because they're parsed from the OpenGL man pages. Also there may be some incorrect

Re: foreach for ranges?

2012-07-17 Thread Kapps
On Wednesday, 18 July 2012 at 04:54:51 UTC, Jonathan M Davis wrote: On Wednesday, July 18, 2012 06:27:28 Mike L. wrote: Thanks for the reply. Not sure how I missed it there. Interesting that the compiler has to be made aware of a concept that I had thought was only supposed to be part of

Re: align(16) struct member throws an exception with movdqa

2012-06-16 Thread Kapps
On Monday, 11 June 2012 at 03:19:08 UTC, ixid wrote: struct a { align(16) int[4] test = [1,2,3,4]; } a test; asm { movdqa XMM0, test ; addps XMM0, XMM0; movdpa test, XMM0 ; } This works fine with unaligned movdqu but

Re: shared status

2012-04-15 Thread Kapps
On Saturday, 14 April 2012 at 10:48:16 UTC, Luis Panadero Guardeño wrote: What is the status of shared types ? I try it with gdmd v4.6.3 And I not get any warring/error when I do anything over a shared variable without using atomicOp. It's normal ? shared ushort ram[ram_size];

Re: D slower ~1s from C ?!

2012-04-05 Thread Kapps
On Thursday, 5 April 2012 at 17:22:38 UTC, Minas wrote: Many of you should know the website projecteuler.net, where there are mathematical problems to solve with computers. I am doing those in D, and after I finished one today, I decided to compile it in C as well to compare the results.

Re: HelloWordl in Webserver

2012-03-17 Thread Kapps
On Saturday, 17 March 2012 at 20:52:33 UTC, Xan wrote: So, there is not built-in functions? Thanks, Xan. There's no built in webserver class, and it's not something that should be in the standard library in the first place.

Re: Method invocation -- why it's not working?

2012-03-08 Thread Kapps
On Thursday, 8 March 2012 at 07:53:02 UTC, Jonathan M Davis wrote: It would be nice, but I honestly don't understand the people who think that the lack of it is crippling. It's just one of those nice-to-have features. Most languages don't have anything of the sort. - Jonathan M Davis

Re: MySQL connection strange behavior (again...)

2012-02-22 Thread Kapps
On Wednesday, 22 February 2012 at 21:18:32 UTC, miazo wrote: Problem solved. :-) I found that it was @4 suffix that was missing. With a libmysql.def file as below: LIBRARY libmysql EXETYPE NT SUBSYSTEM WINDOWS EXPORTS _mysql_init@4 = mysql_init I was able to generate working

Re: MySQL

2012-01-22 Thread Kapps
The way I did it is 1) Download C connector from mysql's website, 6.0.2 is version headers were made for. Remember you'll need the 32-bit one if you're using DMD on Windows. 2) Create the binding functions using extern(System). 3) For Windows, use 'coffimplib libmysql.dll libmysql.lib', and

Re: Reading web pages

2012-01-19 Thread Kapps
The host is www.google.com - http is only a web protocol. The DNS lookup is independent of HTTP, and thus should not include it. Note that you're also missing a space after the GET. Also, in terms of the example given, some servers won't like you not using the Host header, some won't like the

Re: associative arrays

2012-01-09 Thread Kapps
Looks like this is fixed for 2.058. https://github.com/D-Programming-Language/dmd/commit/3e23b0f5834acb32eaee20d88c30ead7e03bb2f4 On 08/01/2012 3:43 AM, Jonathan M Davis wrote: On Sunday, January 08, 2012 03:24:22 Kapps wrote: Ah, found the bug / pull request. https://github.com/D

Re: associative arrays

2012-01-08 Thread Kapps
Ah, found the bug / pull request. https://github.com/D-Programming-Language/dmd/pull/597 http://d.puremagic.com/issues/show_bug.cgi?id=4523 On 08/01/2012 1:39 AM, Kapps wrote: For most languages (such as C# and maybe Java), the Remove method on collections returns a boolean indicating whether

Re: associative arrays

2012-01-07 Thread Kapps
For most languages (such as C# and maybe Java), the Remove method on collections returns a boolean indicating whether it was removed. So you could write: enforce(MyAA.remove(lenght)) or bool Result = MyAA.remove(lenght); assert(Result); I'm not sure why it doesn't in D, but I thought I

Re: Make a variable single-assignment?

2011-11-21 Thread Kapps
For one reason, public fields that lack a set without having to create a backing field, followed by a bulky property. It does sound lazy, but when it's something you have to repeat many times, it gets annoying. On 21/11/2011 9:43 AM, Ary Manzana wrote: On 11/21/11 11:04 AM, Alex Rønne