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, arg);
The thread is never called. Any ideas? Thanks!
PS In an old DLL it used to work, there I called
On Wednesday, 18 June 2014 at 15:23:11 UTC, Kapps wrote:
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
aut
On Thursday, 26 June 2014 at 08:36:15 UTC, Chris wrote:
On Wednesday, 25 June 2014 at 09:29:35 UTC, Orfeo wrote:
I wanted to create a simple application to display and edit
data from postgresql database using GtkD and ddb
(https://github.com/pszturmaj/ddb)
The application should run on WinXp
On Wednesday, 25 June 2014 at 09:29:35 UTC, Orfeo wrote:
I wanted to create a simple application to display and edit
data from postgresql database using GtkD and ddb
(https://github.com/pszturmaj/ddb)
The application should run on WinXp or Win7. After a week of
work I throw in the towel ...
On Thursday, 26 June 2014 at 08:39:46 UTC, Chris wrote:
On Thursday, 26 June 2014 at 08:36:15 UTC, Chris wrote:
On Wednesday, 25 June 2014 at 09:29:35 UTC, Orfeo wrote:
I wanted to create a simple application to display and edit
data from postgresql database using GtkD and ddb
(https://github
On Friday, 27 June 2014 at 05:58:14 UTC, pgtkda wrote:
What does this symbol mean in relation to D?
~
~ D means it's about the best language I've come across so far.
On Sunday, 29 June 2014 at 20:28:23 UTC, Evan Davis wrote:
Hello, I have a compile error when trying to use GtkD 2.3.3.
When I try to create a FileChooseDialog, I call
new FileChooserDialog("Save File",
editor.drawingArea.getParent().getParentWindow(),
On Wednesday, 9 July 2014 at 15:00:25 UTC, seany wrote:
I apologize many times for this question, may be this had
already been answered somewhere, but considering today the last
of my nerve is broken, I can not really find the soution.
So I have a D code, which acts as a central manager of all
On Wednesday, 9 July 2014 at 15:09:09 UTC, Larry wrote:
On Wednesday, 9 July 2014 at 14:30:41 UTC, John Colvin wrote:
On Wednesday, 9 July 2014 at 13:46:59 UTC, Larry wrote:
The rest of the code is numerical so it will not change by
much the fact that d cannot get back the huge launching time.
On Thursday, 10 July 2014 at 12:12:20 UTC, Marc Schütz wrote:
On Wednesday, 9 July 2014 at 15:09:08 UTC, Chris wrote:
On Wednesday, 9 July 2014 at 15:00:25 UTC, seany wrote:
I apologize many times for this question, may be this had
already been answered somewhere, but considering today the
las
Tried to compile on linux, got this error message (I guess I can
fix it):
dmd -c textgen.d
textgen.d(36): Error: cannot implicitly convert expression
("DMDScript fatal runtime error: ") of type string to char[]
textgen.d(36): Error: cannot implicitly convert expression (0) of
type int to char[
On Sunday, 13 July 2014 at 07:18:38 UTC, Jason King wrote:
On Friday, 11 July 2014 at 15:45:42 UTC, Chris wrote:
Tried to compile on linux, got this error message (I guess I
can fix it):
dmd -c textgen.d
textgen.d(36): Error: cannot implicitly convert expression
("DMDScript fatal runtime erro
On Monday, 14 July 2014 at 21:22:12 UTC, Jason King wrote:
My idea is to use (at least test) DMDScript for server side JS.
I don't mean to sound like a D-hater here, but V8 has had about
2 years more work on it than DMDScript. At one time they were.
IIRC, quite close performance-wise but lo
I'm using / testing LuaD atm. It works very well, however, I've
encountered a problem. When I load the module lualsp (for "lua
server pages") the app crashes. If I run the lua script on its own
$ lua5.1 test.lua
it works perfectly fine. The lua server page is executed
correctly. If I run the
On Thursday, 17 July 2014 at 10:53:56 UTC, Chris wrote:
I'm using / testing LuaD atm. It works very well, however, I've
encountered a problem. When I load the module lualsp (for "lua
server pages") the app crashes. If I run the lua script on its
own
$ lua5.1 test.lua
it works perfectly fine.
Short question: how can I grab the stdout written to by C(++),
i.e.
C code:
fwrite(...);
std.cstream will be replaced sooner or later.
On Wednesday, 23 July 2014 at 15:12:13 UTC, John Colvin wrote:
On Wednesday, 23 July 2014 at 14:53:35 UTC, Chris wrote:
Short question: how can I grab the stdout written to by C(++),
i.e.
C code:
fwrite(...);
std.cstream will be replaced sooner or later.
I don't think I understand the ques
On Wednesday, 23 July 2014 at 15:27:23 UTC, John Colvin wrote:
On Wednesday, 23 July 2014 at 15:22:41 UTC, Chris wrote:
On Wednesday, 23 July 2014 at 15:12:13 UTC, John Colvin wrote:
On Wednesday, 23 July 2014 at 14:53:35 UTC, Chris wrote:
Short question: how can I grab the stdout written to by
The C++ code does this:
size_t fwrite ( const void * ptr, size_t size, size_t count, FILE
* stream );
// stream is stdout
and text appears in the console (a string).
I don't how to grab the text that is written to console. I might
have to redirect it from within the C++ code.
On Wednesday, 23 July 2014 at 16:46:04 UTC, FreeSlave wrote:
On Wednesday, 23 July 2014 at 15:35:59 UTC, Chris wrote:
The C++ code does this:
size_t fwrite ( const void * ptr, size_t size, size_t count,
FILE * stream );
// stream is stdout
and text appears in the console (a string).
I don't
Maybe a trivial question: How do I use "preWriteCallback"
properly? It doesn't work properly for me yet (I might not see
the forest for the trees at the moment). I am trying to set a
field in the HTTPServerResponse.
http://vibed.org/api/vibe.http.fileserver/HTTPFileServerSettings.preWriteCallb
On Friday, 22 August 2014 at 13:58:02 UTC, Chris wrote:
Maybe a trivial question: How do I use "preWriteCallback"
properly? It doesn't work properly for me yet (I might not see
the forest for the trees at the moment). I am trying to set a
field in the HTTPServerResponse.
http://vibed.org/api/
dmd v2.066: templ/parsetools.d has a reference to
std/metastrings.d which no longer exists there.
On Thursday, 28 August 2014 at 13:21:57 UTC, Dicebot wrote:
On Thursday, 28 August 2014 at 13:19:42 UTC, Chris wrote:
dmd v2.066: templ/parsetools.d has a reference to
std/metastrings.d which no longer exists there.
Fixed in vibe.d master afaik, you need to wait for new release
or use master.
DUB version 0.9.21
dmd version 2.065.0
vibe.d version 0.7.20
Since v0.7.19 vibe.d has vibe.utils.dictionarylist. This doesn't
go well with LuaD's vibe.utils.dictionarylist (same goes for
higher versions of dmd and vibe.d, see below)
Compiling...
source/luad/conversions/structs.d-mixin-38(38): E
Why is that?
import std.stdio, std.array
void main() {
auto output = appender!(string);
output ~= "world!";
// output.data.insertInPlace(0, "Hello, "); // Doesn't work
auto asString = output.data;
asString.insertInPlace(0, "Hello, "); // Works
writeln(asString); // prints "Hello, w
On Monday, 22 September 2014 at 15:00:09 UTC, anonymous wrote:
On Monday, 22 September 2014 at 14:45:31 UTC, Chris wrote:
Why is that?
import std.stdio, std.array
void main() {
auto output = appender!(string);
output ~= "world!";
// output.data.insertInPlace(0, "Hello, "); // Doesn't work
Today I tried to build a dll via dub, unfortunately I didn't
succeed. I couldn't find much on the internet about it. Is it at
all possible, and if yes, what's the config I have to use?
I tried this (and similar configs)
{
"name": "myDLL32bit",
"targetName": "myDLL.dll",
"targ
On Sunday, 28 September 2014 at 21:29:21 UTC, Cliff wrote:
Coming from the C# world, all of localization we did was based
on defining string resource files (XML-formatted source files
which were translated into C# classes with named-string
accessors by the build process) that would get included
What is the best way to kill a thread when it pleases the owner
(main thread)? The background is playing audio files. The
playback happens in a separate thread so the owner can keep on
listening to events triggered by the user (like stop, pause). I
have to queue audio files, wait until one has
On Thursday, 2 October 2014 at 10:33:02 UTC, thedeemon wrote:
Just use non-blocking receives in main thread's event loop.
When you get a message from child thread that it's finished
playing and you decide you don't need that thread anymore, send
a message to child "you're dismissed". The child
On Thursday, 2 October 2014 at 13:05:00 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 02 Oct 2014 11:36:06 +
Chris via Digitalmars-d-learn
wrote:
you can use receiveTimeout! to check if there is some message
available.
That won't do. It blocks the main thread too (fo
On Thursday, 2 October 2014 at 18:08:40 UTC, Ali Çehreli wrote:
On 10/02/2014 06:49 AM, Chris wrote:
On Thursday, 2 October 2014 at 13:05:00 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 02 Oct 2014 11:36:06 +
Chris via Digitalmars-d-learn
wrote:
you can use receiveTimeout! to
On Friday, 3 October 2014 at 04:39:38 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 02 Oct 2014 20:42:49 +
Chris via Digitalmars-d-learn
wrote:
I'll try that now. Somehow the 1.msecs solution doesn't seem
clean enough.
it seems that you want thread messaging to be int
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 l
On Friday, 17 October 2014 at 14:38:39 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 14:33:57 +
eles via Digitalmars-d-learn
wrote:
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Fri, 17 Oct 2014 10:10:09 +0200
> spir via Digitalm
On Tuesday, 28 October 2014 at 00:16:03 UTC, John McFarlane wrote:
Hi,
I've written a modest shared library in D that I'd like to call
directly from a Python web server (Linux/OS X, Apache, WSGI,
Pyramid). I can call it reliably from within Python unit tests
but on a running server, the libra
On Sunday, 26 October 2014 at 06:20:45 UTC, Suliman wrote:
Unfortunately that library has no dub package.
But you can include it in your project.
See info here http://code.dlang.org/package-format
I can't understand how to set in dub that I need to to include
in compilation process other file
On Tuesday, 4 November 2014 at 12:47:11 UTC, Chris wrote:
The following
struct DATA {
short* data;
size_t len;
}
// data and len are provided by a C function
// ...
auto data = mymodule.getSpeechData();
// cast to immutable, because of concurrency
immutable short* tmp = cast(immutable)(data.d
The following
struct DATA {
short* data;
size_t len;
}
// data and len are provided by a C function
// ...
auto data = mymodule.getSpeechData();
// cast to immutable, because of concurrency
immutable short* tmp = cast(immutable)(data.data);
auto proc = spawn(&processData, thisTid);
send(proces
On Tuesday, 4 November 2014 at 14:01:16 UTC, anonymous wrote:
On Tuesday, 4 November 2014 at 12:47:11 UTC, Chris wrote:
The following
struct DATA {
short* data;
size_t len;
}
// data and len are provided by a C function
// ...
auto data = mymodule.getSpeechData();
// cast to immutable, because
On Tuesday, 4 November 2014 at 14:36:19 UTC, Chris wrote:
On Tuesday, 4 November 2014 at 14:01:16 UTC, anonymous wrote:
On Tuesday, 4 November 2014 at 12:47:11 UTC, Chris wrote:
The following
struct DATA {
short* data;
size_t len;
}
// data and len are provided by a C function
// ...
auto dat
On Tuesday, 4 November 2014 at 14:47:49 UTC, anonymous wrote:
On Tuesday, 4 November 2014 at 14:36:19 UTC, Chris wrote:
I'm still curious, though, how D handles this internally,
because data.data is still mutable while the other reference
to the same address (tmp) is not. What if I change data.
On Tuesday, 4 November 2014 at 16:07:11 UTC, thedeemon wrote:
On Tuesday, 4 November 2014 at 14:36:19 UTC, Chris wrote:
I'm still curious, though, how D handles this internally,
because data.data is still mutable while the other reference
to the same address (tmp) is not. What if I change data.
On Sunday, 9 November 2014 at 08:26:59 UTC, Suliman wrote:
I know that a lot of people are using for programming tools
like Sublime. I am one of them. But if for very simple code
it's ok, how to write hard code?
Do you often need debugger when you are writing code? For which
tasks debugger ar
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 14:52:55 +
Kagamin via Digitalmars-d-learn
wrote:
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
"list" is a good term, but it's already tak
On Tuesday, 11 November 2014 at 16:10:33 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 15:38:26 +
Chris via Digitalmars-d-learn
wrote:
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Tue, 11 Nov 2014 14:52:55 +
> Kagam
On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote:
On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote:
Does that entail the concept that ranges (in D) are
homogeneous (i.e. every member/item is of the same type)?
Yes (if you mean static type)
ElementType!Range is used extensi
The following causes the DLL to crash on Windows:
Input: immutable(short)* data (immutable because in separate
thread).
// Later
core.stdc.stdlib.free(cast(short *)data);
(short* data is provided by the C library, where the memory is
allocated)
On Linux it works fine and never crashes, in t
On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 12 Nov 2014 12:40:30 +
Chris via Digitalmars-d-learn
wrote:
The following causes the DLL to crash on Windows:
Input: immutable(short)* data (immutable because in separate
thread).
// Later
On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 12 Nov 2014 14:11:35 +
Chris via Digitalmars-d-learn
wrote:
On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Wed, 12 Nov 2014 12:40:30 +
>
On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote:
On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via
if you can extend C DLL, just add wrapper for `free()` there.
so you
will not call `free()` from D, but call C DLL function which
will free
the memory. it's a good practice an
On Wednesday, 12 November 2014 at 16:10:34 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 12 Nov 2014 16:03:08 +
Chris via Digitalmars-d-learn
wrote:
On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote:
> On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via
>&g
On Thursday, 13 November 2014 at 10:17:35 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 13 Nov 2014 10:08:47 +
Chris via Digitalmars-d-learn
wrote:
Interesting though that it never crashes on Linux, only on
Windows did this cause problems.
seems that libc allocator is not marking
[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 MB whereas the one built by hand was only 807 kB. Why is that?
[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 MB whereas the one built by hand was only 807 kB. Why is that?
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary Willoughby
wrote:
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
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 exec
On Thursday, 27 November 2014 at 13:59:23 UTC, CraigDillabaugh
wrote:
On Thursday, 27 November 2014 at 13:56:19 UTC, Chris wrote:
On Thursday, 27 November 2014 at 12:29:03 UTC, Gary Willoughby
wrote:
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
I usually use dub to create and bui
On Thursday, 27 November 2014 at 17:08:00 UTC, CraigDillabaugh
wrote:
On Thursday, 27 November 2014 at 14:14:50 UTC, Chris wrote:
On Thursday, 27 November 2014 at 13:59:23 UTC, CraigDillabaugh
wrote:
On Thursday, 27 November 2014 at 13:56:19 UTC, Chris wrote:
On Thursday, 27 November 2014 at 12
On Friday, 28 November 2014 at 19:59:40 UTC, Xinok wrote:
Given that we have GDC with the GCC backend and LDC with the
LLVM backend, what are the benefits of keeping the DMD compiler
backend? It seems to me that GCC and LLVM are far more
developed and better supported by their respective commun
On Tuesday, 2 December 2014 at 10:37:18 UTC, bearophile wrote:
Chris:
As others have said already, the reasons why I use dmd are:
Walter has developed the back-end of DMD and he wants to keep
using it no matter what. But I love the very small compilation
time of dmd sources.
Bye,
bearophi
On Tuesday, 2 December 2014 at 10:57:20 UTC, Temtaime wrote:
It's only words.
If we speak about LDC it can compile fast in debug mode with
performance average to DMD's backend but with much great
performance in release mode thanks to vectorization and other
techniques.
Also LDC thanks to LLVM
On Tuesday, 2 December 2014 at 21:10:33 UTC, Meta wrote:
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe
wrote:
While I have been a programmer for close to 23 years, it's
been mostly API level code cobbling work.
Would like to learn "D", but am a bit intimidated by the fact
that I
On Friday, 6 February 2015 at 09:15:54 UTC, Derix wrote:
So, I set sails to transform a bunch of HTML files with D.
This, of course, will happen with the std.xml library.
There is this nice example :
http://dlang.org/phobos/std_xml.html#.DocumentParser
that I put to some use already, however so
On Friday, 6 February 2015 at 14:11:19 UTC, CraigDillabaugh wrote:
On Friday, 6 February 2015 at 14:09:51 UTC, CraigDillabaugh
wrote:
On Friday, 6 February 2015 at 11:39:32 UTC, Chris wrote:
On Friday, 6 February 2015 at 09:15:54 UTC, Derix wrote:
clip
Thxxx
The documentation says:
"Warn
On Wednesday, 11 March 2015 at 03:16:50 UTC, Taylor Hillegeist
wrote:
So I found http://ec-lang.org/ it seems alot like D, But it has
a company backing it. It just seems interesting.
Seems to me that structs are not the same as in D, and structs in
D are very powerful. I don't like the fact th
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 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] https://
I get the following message from dub when using "--build=release":
Linking...
.dub/build/myprogram-release-linux.posix-x86_64-dmd_2067-C1A5273464ACE9961E3F3BA6AC04084B/abairtts.o:(.data._D65TypeInfo_xC3std5range10interfaces18__T10InputRangeTiZ10InputRange6__initZ+0x10):
undefined reference to
`
Sorry, I forgot the title the first time around!
I get the following message from dub when using "--build=release":
Linking...
.dub/build/myprogram-release-linux.posix-x86_64-dmd_2067-C1A5273464ACE9961E3F3BA6AC04084B/abairtts.o:(.data._D65TypeInfo_xC3std5range10interfaces18__T10InputRangeTiZ10In
On Tuesday, 14 April 2015 at 15:58:18 UTC, Chris wrote:
Sorry, I forgot the title the first time around!
I get the following message from dub when using
"--build=release":
Linking...
.dub/build/myprogram-release-linux.posix-x86_64-dmd_2067-C1A5273464ACE9961E3F3BA6AC04084B/abairtts.o:(.data._D
On Wednesday, 15 April 2015 at 10:26:55 UTC, John Colvin wrote:
On Wednesday, 15 April 2015 at 10:11:17 UTC, Chris wrote:
On Tuesday, 14 April 2015 at 15:58:18 UTC, Chris wrote:
Sorry, I forgot the title the first time around!
I get the following message from dub when using
"--build=release":
My garbage collected app starts with ~10 MB in memory, however
with every execution of code it grows by at least 0.2 MB (or more
depending on the input). Although I can see memory being freed
(say it goes up to 32 MB and drops to 14 MB), it keeps on growing
slowly but surely.
I use structs fo
On Wednesday, 15 April 2015 at 11:48:26 UTC, Rikki Cattermole
wrote:
On 15/04/2015 11:44 p.m., Chris wrote:
My garbage collected app starts with ~10 MB in memory, however
with
every execution of code it grows by at least 0.2 MB (or more
depending
on the input). Although I can see memory being f
On Thursday, 16 April 2015 at 18:51:25 UTC, Kagamin wrote:
On Wednesday, 15 April 2015 at 12:03:49 UTC, Chris wrote:
There might be some low-hanging fruit there. However, before I
change anything, maybe you guys have some suggestions.
See if switching to 64-bit mode changes anything.
64bit i
The following:
import std.stdio : writefln;
import std.range.primitives : isInputRange, hasLength;
void main() {
size_t[] a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
doSomething(a); // works
doSomething(a[0..5]);
// ---> Error: template slices.doSomething cannot deduce function
from argument type
On Saturday, 18 April 2015 at 16:26:57 UTC, Max Klyga wrote:
On 2015-04-18 13:46:19 +, Chris said:
The following:
import std.stdio : writefln;
import std.range.primitives : isInputRange, hasLength;
void main() {
size_t[] a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
doSomething(a); // works
do
On Saturday, 18 April 2015 at 17:59:19 UTC, ketmar wrote:
On Sat, 18 Apr 2015 17:50:56 +, Chris wrote:
Doh! You're right! My bad. However, this makes the function
less
generic, but it doesn't matter here.
maybe `auto ref` can help here?
Yes, auto ref does the trick. I prefer it to pass
On Monday, 20 April 2015 at 09:58:06 UTC, Marc Schütz wrote:
On Monday, 20 April 2015 at 09:07:54 UTC, Chris wrote:
On Saturday, 18 April 2015 at 17:59:19 UTC, ketmar wrote:
On Sat, 18 Apr 2015 17:50:56 +, Chris wrote:
Doh! You're right! My bad. However, this makes the function
less
gene
On Monday, 20 April 2015 at 10:27:00 UTC, anonymous wrote:
On Monday, 20 April 2015 at 10:14:27 UTC, Chris wrote:
string a = "bla";
string b = "blub";
auto res = doSomething(a, b);
If I didn't use "auto ref" or "ref", string would get copied,
wouldn't it?
auto ref doSomething(R needle, R ha
On Monday, 20 April 2015 at 10:42:54 UTC, Chris wrote:
On Monday, 20 April 2015 at 10:27:00 UTC, anonymous wrote:
On Monday, 20 April 2015 at 10:14:27 UTC, Chris wrote:
string a = "bla";
string b = "blub";
auto res = doSomething(a, b);
If I didn't use "auto ref" or "ref", string would get cop
The following works great. It sorts an AA by value:
1. by frequency of word
2. by alphabetic order (if two or more words have the same value)
import std.stdio : writefln;
import std.algorithm.sorting : multiSort;
void main() {
size_t[string] wcount = [
"hamster":5,
"zorro":80,
"tr
On Tuesday, 21 April 2015 at 11:46:24 UTC, bearophile wrote:
Chris:
I'm happy with it, but maybe there is a more concise
implementation?
This is a bit shorter and a bit better (writefln is not yet
able to format tuples nicely):
void main() {
import std.stdio: writeln;
import std.a
Maybe something like bearophile's example should go into the
documentation of std.algorithm.sorting.multiSort. It's a common
enough thing in programming.
On Thursday, 23 April 2015 at 16:57:30 UTC, Jens Bauer wrote:
On Thursday, 23 April 2015 at 14:22:01 UTC, Ali Çehreli wrote:
On 04/23/2015 06:56 AM, ref2401 wrote:
http://ddili.org/ders/d.en/fibers.html
I appreciate any feedback before the book is finally printed
sometime before DConf.
This
On Thursday, 23 April 2015 at 22:26:28 UTC, Jens Bauer wrote:
On Thursday, 23 April 2015 at 19:24:31 UTC, Chris wrote:
On Thursday, 23 April 2015 at 16:57:30 UTC, Jens Bauer wrote:
3: Audio mixing and playback (eg. a MOD player for instance).
5: Queueing up a bunch of different jobs;
At the m
On Friday, 24 April 2015 at 12:38:39 UTC, Jens Bauer wrote:
On Friday, 24 April 2015 at 09:15:21 UTC, Chris wrote:
I was more thinking of the audio thread. But the audio is
probably better off in a separate thread.
I think you could do this too.
In fact, this is very similar to how the audio
I keep getting this message. Why?
Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip
[>] 56256/54884 KB
Installing: dmd-2.067.0
An unknown error occurred:
tango.core.Exception.IOException@/Users/doob/development/d/tango/tango/core/Exception.d(59):
/User
On Wednesday, 29 April 2015 at 06:41:30 UTC, Jacob Carlborg wrote:
On 2015-04-28 19:46, Chris wrote:
I keep getting this message. Why?
Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip
[>] 56256/54884 KB
Installing: dmd-2.067.0
An unknown error occurr
What would be the D equivalent of the factory pattern? This
obviously doesn't work:
struct A {
int x = 42;
}
struct B {
int x = 7;
}
auto factory(string type) {
if (type == "A")
return A();
else if (type == "B")
return B();
else
return A(); // default
}
void main()
{
On Friday, 1 May 2015 at 10:04:46 UTC, Namespace wrote:
How about this:
struct A {
int x = 42;
}
struct B {
int x = 7;
}
T factory(T)() {
return T();
}
void main()
{
auto a = factory!(A);
}
That's what I was looking for, I just couldn't get it right.
Thanks.
Rikki:
I w
On Friday, 1 May 2015 at 10:27:16 UTC, biozic wrote:
On Friday, 1 May 2015 at 10:12:36 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:04:46 UTC, Namespace wrote:
How about this:
struct A {
int x = 42;
}
struct B {
int x = 7;
}
T factory(T)() {
return T();
}
void main()
{
auto a = factor
On Friday, 1 May 2015 at 10:46:20 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:27:16 UTC, biozic wrote:
On Friday, 1 May 2015 at 10:12:36 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:04:46 UTC, Namespace wrote:
How about this:
struct A {
int x = 42;
}
struct B {
int x = 7;
}
T factor
On Friday, 1 May 2015 at 10:47:22 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:46:20 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:27:16 UTC, biozic wrote:
On Friday, 1 May 2015 at 10:12:36 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:04:46 UTC, Namespace wrote:
How about this:
struct
On Friday, 1 May 2015 at 11:11:28 UTC, biozic wrote:
On Friday, 1 May 2015 at 11:01:29 UTC, Chris wrote:
Thinking about it,
T factory(T)() {
return T();
}
is better suited for a factory (with static type checks).
But then I don't know what factory!X() provides that X() alone
doesn't.
On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote:
By default vibed use Diet. Maybe it's cool, but for me it's
easier to write in pure HTML. What is the best way to do it?
You want to serve html files instead of templates, right? It
should be something like
router.get("*", serveStaticF
On Wednesday, 6 May 2015 at 13:50:04 UTC, Chris wrote:
On Wednesday, 6 May 2015 at 13:32:48 UTC, Suliman wrote:
By default vibed use Diet. Maybe it's cool, but for me it's
easier to write in pure HTML. What is the best way to do it?
You want to serve html files instead of templates, right? It
On Wednesday, 6 May 2015 at 14:21:24 UTC, Chris wrote:
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically,
but I thought that 99% of dynamic is javascript code...
Templates are like PHP, JSP, LSP etc. They can do stuff on the
s
On Wednesday, 6 May 2015 at 14:07:09 UTC, Suliman wrote:
I mean that I know that template can be changes dynamically,
but I thought that 99% of dynamic is javascript code...
Templates are like PHP, JSP, LSP etc. They can do stuff on the
server side via embedded D code, load files for example.
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
I have never used the templat
101 - 200 of 287 matches
Mail list logo