synchronized confusion...

2013-04-15 Thread estewh
Hi All, I have this bit of code like this: shared bool varInitialized = false; bool initVar() { bool ret; synchronized { ret = varInitialized;} return ret; } I know there are atomics and I am using them but I am curious about the above code. It compiles but I have no idea how safe it

Ref and class function calls?

2013-04-15 Thread Tofu Ninja
I could not think of what to call this because I don't know if it has a name to call it by. Basicly what I was wondering is if their was a way in D to make a class function pass the object being called on by reference. might be easier to show code, basically I want something like this to be

difference between C++11 rvalue references && and D's proposed rvalue reference?

2013-04-15 Thread Timothee Cour
What would be the difference between C++11's rvalue reference && (see for example http://thbecker.net/articles/rvalue_references/section_03.html) and D's proposed rvalue references (eg http://wiki.dlang.org/DIP36) ? So far I only saw C++'s const & mentioned, but C++11's && seems pretty close. Whi

Re: How i can clear Associative Arrays

2013-04-15 Thread Michael
On Monday, 15 April 2013 at 11:36:55 UTC, Tobias Pankrath wrote: You could set the length to 0. Before version 4.0 in C# a Clear extension-method just calls Collection.length = 0; Later this method was included to BCL. In D length property for AA is readonly.

Re: mysql

2013-04-15 Thread simendsjo
On Monday, 15 April 2013 at 17:34:07 UTC, gedaiu wrote: Hi, Can anyone help me to connect to mysql from D? Thanks! You can use Steve Teales native library. The most up-to-date version is here: https://github.com/rejectedsoftware/mysql-native It relies on vibes async sockets though. You'll

Re: GtkD "No GSettings schemas installed"

2013-04-15 Thread Mike Wey
On 04/15/2013 05:45 PM, Josh wrote: On Sunday, 14 April 2013 at 13:34:07 UTC, Mike Wey wrote: So it looks like the shemas are installed properly. You could try running the gsettings app from a different location than where it's located, it should be in your path. If it doesn't give the same ou

mysql

2013-04-15 Thread gedaiu
Hi, Can anyone help me to connect to mysql from D? Thanks!

Re: How i can clear Associative Arrays

2013-04-15 Thread Steven Schveighoffer
On Sun, 14 Apr 2013 02:50:07 -0400, gedaiu wrote: On Saturday, 13 April 2013 at 21:10:16 UTC, Nicolas Guillemot wrote: I think we should introduce a removeAll function for hashes. Either through Druntime or through a UFCS function that we could put in std.array or somewhere. How about .clear

Re: Calculation differences between Debug and Release mode

2013-04-15 Thread Steven Schveighoffer
On Sat, 13 Apr 2013 02:07:39 -0400, Jeremy DeHaan wrote: I have a function that will calculate a random point on a circle based on a specified radius and total number of points. The only point in question is the first point. I get different values when the code compiles in Release and De

Re: Calculation differences between Debug and Release mode

2013-04-15 Thread Steven Schveighoffer
On Mon, 15 Apr 2013 11:51:07 -0400, Steven Schveighoffer wrote: I would suspect that the issue is floating point error. On certain hardware, the CPU uses higher-precision 80-bit floating points. When you store those back to doubles, the extra precision is truncated. I see you use float

Re: GtkD "No GSettings schemas installed"

2013-04-15 Thread Josh
On Sunday, 14 April 2013 at 13:34:07 UTC, Mike Wey wrote: On 04/13/2013 07:00 AM, Josh wrote: On Wednesday, 10 April 2013 at 20:17:36 UTC, Mike Wey wrote: On 04/10/2013 03:20 PM, Josh wrote: After trying to compile in 64 bit and failing, I've given up and just used 32 bit. So now I have GTK-

Re: How i can clear Associative Arrays

2013-04-15 Thread Andrea Fontana
Not on associative arrays afaik. On Monday, 15 April 2013 at 11:36:55 UTC, Tobias Pankrath wrote: You could set the length to 0.

Re: How i can clear Associative Arrays

2013-04-15 Thread Tobias Pankrath
You could set the length to 0.

Re: How i can clear Associative Arrays

2013-04-15 Thread Andrea Fontana
On Sunday, 14 April 2013 at 06:50:08 UTC, gedaiu wrote: On Saturday, 13 April 2013 at 21:10:16 UTC, Nicolas Guillemot wrote: I think we should introduce a removeAll function for hashes. Either through Druntime or through a UFCS function that we could put in std.array or somewhere. How about