Thanks for your help.
On Wednesday, 12 July 2017 at 18:49:23 UTC, Jack Applegame wrote:
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Also what is it possible in D to write a function that accepts
an static array of any size?
void foo(size_t N)(ref int[N] arr) {
...
}
int[10] arr;
foo(arr);
Tha
On Thursday, 13 July 2017 at 01:15:46 UTC, FoxyBrown wrote:
auto EnumServices()
I wouldn't use auto here. The reason you get mismatch types on
return here since you don't return consistent types inside.
ENUM_SERVICE_STATUS_PROCESS[5000] services;
Are you sure you are getting the
On Thursday, 13 July 2017 at 01:15:46 UTC, FoxyBrown wrote:
Everything I do results in some problem, I've tried malloc but
then converting the strings resulted in my program becoming
corrupted.
Heres the code:
auto EnumServices()
{
auto schSCManager = OpenSCManager(null, null,
SC_MANAG
Everything I do results in some problem, I've tried malloc but
then converting the strings resulted in my program becoming
corrupted.
Heres the code:
auto EnumServices()
{
auto schSCManager = OpenSCManager(null, null,
SC_MANAGER_ALL_ACCESS);
if (NULL == schSCManager)
{
On Wednesday, 12 July 2017 at 12:05:33 UTC, Jacob Carlborg wrote:
On 2017-07-12 12:18, Joel wrote:
Is there a 2D physics library I can use on macOS, with D?
I already use a multimedia library for graphics, sound and
input.
Box2D [1] perhaps. I think I've seen bindings for it, somewhere.
[1]
On Wednesday, 12 July 2017 at 12:05:17 UTC, Namal wrote:
Hello,
I used the Install Script command line to install the newest
dmd compiler (Ubuntu 16.04.2 LTS). Now I have to type 'source
~/dlang/dmd-2.074.1/activate' before I can use it and it is
also not show in the software center like it u
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Also what is it possible in D to write a function that accepts
an static array of any size?
void foo(size_t N)(ref int[N] arr) {
...
}
int[10] arr;
foo(arr);
On Wednesday, 12 July 2017 at 09:49:32 UTC, Guillaume Piolat
wrote:
On Tuesday, 11 July 2017 at 22:59:42 UTC, Igor Shirkalin wrote:
[...]
--
Biotronic
Thanks for very useful information!
Just one small note.
If you don't know the foreign thread lifetime, it's cleaner to
detach it from t
I want to create a string while making sure it qualifies as an
identifier. Like this:
struct quote
{
static @property string opDispatch(string str)() { return str; }
}
unittest
{
assert(quote.foo == "foo");
}
Does it already exist somewhere in the language or the library?
J-L
On Wednesday, 12 July 2017 at 13:47:06 UTC, Adam D. Ruppe wrote:
This tells me the problem is in the collection order at the end
of the program.
...
So I'd say the answer is prolly to keep HTTP away from the GC.
Manually free its arrays, or keep them outside arrays in the
first place.
I'd
On Wednesday, 12 July 2017 at 11:18:08 UTC, Biotronic wrote:
The traditional solution is static opCall:
That's bug city... the dummy argument is better, or a named
static factory function.
Foo foo = Foo;
Foo foo = Foo();
those are different with static opCall. It also conflicts with
const
On Wednesday, 12 July 2017 at 11:57:33 UTC, Biotronic wrote:
Debug = no optimization.
That's not really true, you can have an optimized debug build.
dmd's -debug, -g, and -O switches are all independent. -debug
turns on blocks labeled with the `debug` switch in code. -g adds
info for a debug
On Tuesday, 11 July 2017 at 21:23:28 UTC, Ali Çehreli wrote:
Default template and function arguments are resolved at
instantiation site, which means __MODULE__ would resolve
automatically to the caller's module. For example, if you have
this module:
__MODULE__ is a string so I cannot pass it
On Wednesday, 12 July 2017 at 11:00:54 UTC, Jiyan wrote:
when A(0) is called I would want here optimal performance, so
there doesnt even need to be a value pushed on the stack (i=0),
what would be like having a constructor with zero arguments (i
is never used!).
This is so, so irrelevant. Eve
On Monday, 10 July 2017 at 00:10:36 UTC, NoBigDeal256 wrote:
The error goes away. The error also goes away if
ThingA.arrayOfThingBs returns a single instance of ThingB
instead of an array of ThingB.
This tells me the problem is in the collection order at the end
of the program.
The HTTP ins
On Wednesday, 12 July 2017 at 12:20:11 UTC, Miguel L wrote:
What is the best way in D to create a function that receives a
static array of any length?
Do know that static arrays are passed by value in D, so passing a
static array of a million elements will copy them...
There are two solution
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length is not going
to change inside f.
Then just don't change the length... this is a correct way to do
it.
You could also allocate it
On Wednesday, 12 July 2017 at 12:57:19 UTC, Rene Zwanenburg wrote:
On Wednesday, 12 July 2017 at 12:20:11 UTC, Miguel L wrote:
What is the best way in D to create a function that receives a
static array of any length?
Templatize the array length:
void foo(size_t length)(int[length] arr)
{
}
On Wednesday, 12 July 2017 at 12:20:11 UTC, Miguel L wrote:
What is the best way in D to create a function that receives a
static array of any length?
You will need to use templates:
void foo(size_t N)(int[N] arr) {
}
--
Biotronic
On Wednesday, 12 July 2017 at 12:20:11 UTC, Miguel L wrote:
What is the best way in D to create a function that receives a
static array of any length?
Templatize the array length:
void foo(size_t length)(int[length] arr)
{
}
What is the best way in D to create a function that receives a
static array of any length?
On Wednesday, 12 July 2017 at 12:08:35 UTC, Jacob Carlborg wrote:
On 2017-07-12 11:28, Biotronic wrote:
That's basically what I tried to say
It wasn't very clear to me at least.
Yeah, I see it in retrospect. "might collect memory that the
thread is referencing on the stack or in non-GC mem
On 2017-07-12 11:28, Biotronic wrote:
That's basically what I tried to say
It wasn't very clear to me at least.
- the GC may collect memory *it has
allocated* if the only pointers to it are in memory the GC doesn't scan
(i.e. on the stack of an unregistered thread or in memory not allocated
On Wednesday, 12 July 2017 at 12:02:37 UTC, Jiyan wrote:
Thank you, one last question:
If i declare the parameter as ref i, then there shouldnt be any
overhead wouldnt it?
Thanks :)
That would be basically the exact equivalent - instead of passing
an int, you'll be passing a pointer.
--
On 2017-07-12 12:18, Joel wrote:
Is there a 2D physics library I can use on macOS, with D?
I already use a multimedia library for graphics, sound and input.
Box2D [1] perhaps. I think I've seen bindings for it, somewhere.
[1] http://box2d.org
--
/Jacob Carlborg
Hello,
I used the Install Script command line to install the newest dmd
compiler (Ubuntu 16.04.2 LTS). Now I have to type 'source
~/dlang/dmd-2.074.1/activate' before I can use it and it is also
not show in the software center like it used to be. How can I fix
it or how can I remove it?
Thx
Thank you, one last question:
If i declare the parameter as ref i, then there shouldnt be any
overhead wouldnt it?
Thanks :)
On Wednesday, 12 July 2017 at 11:34:45 UTC, Jiyan wrote:
Hey,
yes i did but to be honest i used dmd in debug version.
The thing about the static one, is that it creates a local
object A isnt that a performance issue itself - or am i wrong -
im confused actually :P?
Debug = no optimization. Lo
On Wednesday, 12 July 2017 at 11:18:08 UTC, Biotronic wrote:
On Wednesday, 12 July 2017 at 11:00:54 UTC, Jiyan wrote:
[...]
The traditional solution is static opCall:
struct A {
int field;
static A opCall() {
A result;
result.field = getDataFromFile("file.txt");
On Wednesday, 12 July 2017 at 11:00:54 UTC, Jiyan wrote:
Hey there:)
i want to know whether the following is somehow possible:
structs dont have default constructors, i know so:
struct A
{
int field;
this(int i){field = getDataFromFile("file.txt");}
}
A instance = A(0);
Here comes my issue:
w
Hey there:)
i want to know whether the following is somehow possible:
structs dont have default constructors, i know so:
struct A
{
int field;
this(int i){field = getDataFromFile("file.txt");}
}
A instance = A(0);
Here comes my issue:
when A(0) is called I would want here optimal performance,
Is there a 2D physics library I can use on macOS, with D?
I already use a multimedia library for graphics, sound and input.
On Tuesday, 11 July 2017 at 22:59:42 UTC, Igor Shirkalin wrote:
On Tuesday, 11 July 2017 at 06:18:44 UTC, Biotronic wrote:
On Monday, 10 July 2017 at 20:03:32 UTC, Igor Shirkalin wrote:
[...]
If DRuntime is not made aware of the thread's existence, the
thread will not be stopped by the GC, a
On Wednesday, 12 July 2017 at 09:10:07 UTC, Jacob Carlborg wrote:
On 2017-07-11 08:18, Biotronic wrote:
If DRuntime is not made aware of the thread's existence, the
thread will not be stopped by the GC, and the GC might collect
memory that the thread is referencing on the stack or in
non-GC m
On 2017-07-11 08:18, Biotronic wrote:
If DRuntime is not made aware of the thread's existence, the thread will
not be stopped by the GC, and the GC might collect memory that the
thread is referencing on the stack or in non-GC memory.
Are you sure? Wouldn't that make malloc or any other custom
ikod wrote:
On Wednesday, 12 July 2017 at 08:24:12 UTC, NoBigDeal256 wrote:
On Monday, 10 July 2017 at 20:55:19 UTC, ketmar wrote:
NoBigDeal256 wrote:
Do you happen to have a link to the bug report for this specific issue
that I could look at? I looked at the known bugs list and couldn't
fi
On Wednesday, 12 July 2017 at 08:24:12 UTC, NoBigDeal256 wrote:
On Monday, 10 July 2017 at 20:55:19 UTC, ketmar wrote:
NoBigDeal256 wrote:
Do you happen to have a link to the bug report for this
specific issue that I could look at? I looked at the known
bugs list and couldn't find anything re
On Wednesday, 12 July 2017 at 07:43:27 UTC, Suliman wrote:
Compiler require libssl32.dll for run dlang-request based app.
Where I can get it?
I installed, OpenSSL, but can't find this lib in
C:\OpenSSL-Win64
I don't use windows so it's nothing definitive but I'd bet that
the "32" in libssl3
On Monday, 10 July 2017 at 20:55:19 UTC, ketmar wrote:
NoBigDeal256 wrote:
Do you happen to have a link to the bug report for this
specific issue that I could look at? I looked at the known
bugs list and couldn't find anything related to this.
nope. it is a kind of "known bug nobody bothered
Compiler require libssl32.dll for run dlang-request based app.
Where I can get it?
I installed, OpenSSL, but can't find this lib in C:\OpenSSL-Win64
41 matches
Mail list logo