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() {
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*
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
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);
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
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
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
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
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?
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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
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.
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
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
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
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
Possibly something related to:
https://github.com/D-Programming-Language/dmd/pull/3715
Have you tried updating to git master today?
A bit late, but you should also be able to do:
import scriptlike;
alias Config = std.process.Config;
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
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,
Possibly https://issues.dlang.org/show_bug.cgi?id=11763 or
https://issues.dlang.org/show_bug.cgi?id=11903
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,
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
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
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
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() {
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
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
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
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:
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
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,
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
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
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
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
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
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
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
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
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
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)
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;
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
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.
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
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
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
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
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
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];
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.
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.
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
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
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
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
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
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
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
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
74 matches
Mail list logo