_getmaxstdio / _setmaxstdio

2019-10-10 Thread Damian via Digitalmars-d-learn
Missing _getmaxstdio / _setmaxstdio? I'd like to try and increase the limit of open files without resorting to Windows API, is it possible or will I have to resort to the WinAPI to achieve this? Thanks Damian

Re: Fastest Way to Append Multiple Elements to an Array

2014-12-30 Thread Damian via Digitalmars-d-learn
On Friday, 26 December 2014 at 16:31:48 UTC, Nordlöw wrote: On Friday, 26 December 2014 at 16:29:56 UTC, Nordlöw wrote: See my update at https://github.com/nordlow/justd/blob/master/algorithm_ex.d#L1602 which tries to merge all the ideas into one adapting algorithm :) Destroy! BTW: 1. Is

Re: Problems with Mutex

2014-10-26 Thread Damian via Digitalmars-d-learn
On Sunday, 26 October 2014 at 22:53:09 UTC, Neven wrote: On Sunday, 26 October 2014 at 22:21:17 UTC, Damian wrote: On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up:

Re: Problems with Mutex

2014-10-26 Thread Damian via Digitalmars-d-learn
On Sunday, 26 October 2014 at 22:53:09 UTC, Neven wrote: On Sunday, 26 October 2014 at 22:21:17 UTC, Damian wrote: On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up:

Re: Problems with Mutex

2014-10-26 Thread Damian via Digitalmars-d-learn
On Sunday, 26 October 2014 at 22:14:25 UTC, Neven wrote: I'm trying to use Mutex from core.sync.mutex; but when I try to initialize it at compile time this error pops up: Error: constructor core.sync.mutex.Mutex.this core.sync.mutex.Mutex cannot be constructed at compile time, because the con

Error: template cannot deduce function from argument types.

2014-08-23 Thread Damian Day via Digitalmars-d-learn
Hi, I've been trying to reduce a bug in the containers (8824). From the example below it seems the dup method is passing the constructor an array of dchars and the template is failing. Is this a compiler bug, or ? import std.range, std.traits; struct Array2(T) { private T[] _payload;

Re: What hashing algorithm is used for the D implementation of associative arrays?

2014-08-09 Thread Damian Day via Digitalmars-d-learn
On Saturday, 9 August 2014 at 09:33:12 UTC, Gary Willoughby wrote: What hashing algorithm is used for the D implementation of associative arrays? Where in the D source does the AA code live? https://github.com/D-Programming-Language/druntime/blob/master/src/rt/aaA.d I think it uses the object

Building phobos documentation

2014-06-06 Thread Damian Day via Digitalmars-d-learn
I'm having some trouble with building Phobos documentation locally on Win32. I've been referring to this guide: http://wiki.dlang.org/Building_DMD#Building_the_Docs I don't want to pull it from github and I don't really need the tools building either. My make command is: make -f win32.mak

Re: Is there any way to differentiate between a type and an alias?

2014-05-25 Thread Damian Day via Digitalmars-d-learn
On 25/05/2014 12:04, Rene Zwanenburg wrote: Given alias GLenum = uint; void glSomeFunction(GLenum, uint); Now, is there some way to differentiate between GLenum and uint when using ParameterTypeTuple!glSomeFunction? I'm writing a function which shows the arguments a GL function was called with

Re: Array!T and find are slow

2014-05-14 Thread Damian Day via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 17:57:30 UTC, monarch_dodra wrote: BTW, this is a more "general" issue: Given a generic algorithm "std.foo", how can I write my own (better optimized) "object.foo", and make sure *that* is called instead? I initially filed the issue for "retro", while indeed men

Re: Array!T and find are slow

2014-05-14 Thread Damian Day via Digitalmars-d-learn
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: http://dpaste.dzfl.pl/0058fc8341830

Array!T and find are slow

2014-05-14 Thread Damian Day via Digitalmars-d-learn
I've found bench-marking my program that std.algorithm.find is very slow on Array!T, due to the fact it iterates on a range instead of a plain array. I've written some search functions, which are many times faster, is it worth making a pull request? http://dpaste.dzfl.pl/63b54aa27f35#

Re: Socket server + thread: cpu usage

2014-04-30 Thread Damian Day via Digitalmars-d-learn
On Tuesday, 29 April 2014 at 17:44:21 UTC, Tim wrote: On Tuesday, 29 April 2014 at 17:35:08 UTC, Tim wrote: On Tuesday, 29 April 2014 at 17:19:41 UTC, Adam D. Ruppe wrote: On Tuesday, 29 April 2014 at 17:16:33 UTC, Tim wrote: Is there anything I'm doing wrong? You should be using a blocking

Re: Can I circumvent nothrow?

2014-04-26 Thread Damian Day via Digitalmars-d-learn
On Sunday, 27 April 2014 at 01:53:15 UTC, Ali Çehreli wrote: On 04/26/2014 06:39 PM, Damian Day wrote: > Problem I have is inside "shutdown_system()" I have code that can't > possibly be @nothrow because their are a lot of subsystems to shutdown. You can wrap the conten

Can I circumvent nothrow?

2014-04-26 Thread Damian Day via Digitalmars-d-learn
So I have this procedure: extern (C) void signal_proc(int sn) @system nothrow Which can call this: shutdown_system() @system nothrow Problem I have is inside "shutdown_system()" I have code that can't possibly be @nothrow because their are a lot of subsystems to shutdown. What I've done for n

Re: Best data structure for a particle system?

2013-11-15 Thread Damian
On Friday, 15 November 2013 at 11:52:44 UTC, Mikko Ronkainen wrote: What would be the best data structure for handling particles in a particle system in D2? Here's some thoughts: Particles are simple structs. Two lists, one for alive particles, one for dead ones. Memory allocations should be a

Re: How to get a substring?

2013-10-26 Thread Damian
On Saturday, 26 October 2013 at 23:19:56 UTC, Namespace wrote: On Saturday, 26 October 2013 at 22:17:33 UTC, Ali Çehreli wrote: On 10/26/2013 02:25 PM, Namespace wrote: On Saturday, 26 October 2013 at 21:23:13 UTC, Gautam Goel wrote: Dumb Newbie Question: I've searched through the library refe

Re: Slices and arrays problems?

2013-07-01 Thread Damian
Thanks Ali and Adam for the good explanations I understand now.

Slices and arrays problems?

2013-07-01 Thread Damian
void testref(ref int[] arr) { arr[0] = 1; } void test(int[] arr) { arr[0] = 1; } void main() { //int[] buffer1 = new int[4]; // This works int[4] buffer1; // This doesn't int[4] buffer2; testref(buffer1); test(buffer2); assert(buffer1[0] == 1); asser

Re: D is totally useless

2013-05-01 Thread Damian
On Wednesday, 1 May 2013 at 08:42:40 UTC, Temtaime wrote: I'm new in D, so i'm tried to write some in that langugage. That's story about how i tried to port OGL sample, that renders one triangle. I was very surprised when i found, that D doesn't have equivalent of gl/gl.h. Any C++ compiler ha

Re: std.signal woes :/

2013-02-25 Thread Damian
On Sunday, 24 February 2013 at 19:20:06 UTC, cal wrote: On Sunday, 24 February 2013 at 17:30:14 UTC, Damian wrote: That solution is ok for 1 argument but for many arguments it wont suffice. This is issue 5028. What is the problem with many arguments? I'm probably misunderstanding, bu

Re: std.signal woes :/

2013-02-24 Thread Damian
On Saturday, 23 February 2013 at 23:39:19 UTC, cal wrote: On Saturday, 23 February 2013 at 17:01:48 UTC, Damian wrote: Ok signals work fine, until I use them in a descendant class. Snippet: - import std.signals; class ClassA { public mixin Signal!(int) addNumber1

Re: Array remove 1 item? (std.container)

2013-01-09 Thread Damian
On Wednesday, 9 January 2013 at 15:40:48 UTC, monarch_dodra wrote: On Wednesday, 9 January 2013 at 15:29:50 UTC, Damian wrote: On Wednesday, 9 January 2013 at 15:20:40 UTC, Robert wrote: On Wednesday, 9 January 2013 at 15:06:01 UTC, Damian wrote: Hi, I've got the jist of using mo

Re: Array remove 1 item? (std.container)

2013-01-09 Thread Damian
On Wednesday, 9 January 2013 at 15:20:40 UTC, Robert wrote: On Wednesday, 9 January 2013 at 15:06:01 UTC, Damian wrote: Hi, I've got the jist of using most of std.container.Array, but I can't seem to remove a single item, I understand I must remove a range. Array!int arr; arr.inser

Re: clear array

2012-10-15 Thread Damian
On Tuesday, 16 October 2012 at 00:44:15 UTC, Jonathan M Davis wrote: On Tuesday, October 16, 2012 02:37:52 Andrej Mitrovic wrote: On 10/16/12, Damian wrote: > Does D have a built-in way to clear arrays dynamic and > static? clear(arr). arr.clear() should work too. Use destroy, not

Re: clear array

2012-10-15 Thread Damian
On Tuesday, 16 October 2012 at 00:47:44 UTC, H. S. Teoh wrote: On Tue, Oct 16, 2012 at 02:33:03AM +0200, Damian wrote: I know this is a bit of a dumb question and I have searched and not found anything concrete surprisingly :/ Does D have a built-in way to clear arrays dynamic and static? I

clear array

2012-10-15 Thread Damian
I know this is a bit of a dumb question and I have searched and not found anything concrete surprisingly :/ Does D have a built-in way to clear arrays dynamic and static? I don't want to iterate over every element and set a default value. In C++ I would just use memset, I don't know if I shou

Re: floating point divide

2012-10-11 Thread Damian
On Thursday, 11 October 2012 at 15:21:01 UTC, bearophile wrote: Damian: I come from a pascal background and we could use: divintegral division operator / floating point division operator Two operators for the two different operations is a design better than C, that is bug-prone

floating point divide

2012-10-11 Thread Damian
I come from a pascal background and we could use: divintegral division operator / floating point division operator So my question is, how does D force floating point division on integrals? At the moment i do this, but i was hoping for an easier way: int n1 = 10, n2 = 2; float f = cast

Re: Problem: handling a function dependent on release mode.

2012-07-20 Thread Damian
On Friday, 20 July 2012 at 21:47:55 UTC, Namespace wrote: On Friday, 20 July 2012 at 21:36:59 UTC, Damian wrote: Trying to convert the below code to D, for the life of me I cannot do it :( I'm guess I need to use a template for this but I just cannot get my head around it. Any help p

Problem: handling a function dependent on release mode.

2012-07-20 Thread Damian
Trying to convert the below code to D, for the life of me I cannot do it :( I'm guess I need to use a template for this but I just cannot get my head around it. Any help please? #ifdef SFML_DEBUG // If in debug mode, perform a test on every call #define alCheck(Func) ((Func), priv::alC

Build WindowsApi bindings with dmd?

2012-07-02 Thread Damian
I was looking through the bindings and only see a makefile for GNU make. Is there a version for dmd? I really wanted to avoid GNU make if possible.

Re: A GUI library to begin with

2012-02-09 Thread Damian Ziemba
Ach, and there is plugin for Windows Gtk+ runtime called WIMP which emulates Windows Native look, so situation with GtkD isn't so bad on Linux/FreeBSD and Windows. I guess the biggest problem is da Mac OSX platform. Monodevelop looks so f**cking ugly on Mac :D

Re: A GUI library to begin with

2012-02-09 Thread Damian Ziemba
On Wednesday, 8 February 2012 at 03:55:41 UTC, Mr. Anonymous wrote: Hello, I want to start playing with D, and I'm looking at a GUI library to begin with. From what I see here: http://www.prowiki.org/wiki4d/wiki.cgi?GuiLibraries I have four choices: GtkD, DWT, DFL, DGui. Has anyone tried thes

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
y in vars ) return vars[ key ]; else return ""; } string toString() { // implement me } } auto storage = new Storage; storage.vars["test"] = "I'm a test!"; storage.vars["popFront"] = "I'm a poping aroun

Re: opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
On Thu, 01 Sep 2011 07:56:49 +, Christophe wrote: > Try to create the method: > > const void toString(void delegate(const(char)[]) sink, string > formatString) { > sink(toString()); > } Adding it as it is results in compiler error: ./quick.d(30): Error: function quick.Test2.toStrin

opDispatch shadowing toString - feature or bug?

2011-09-01 Thread Damian Ziemba
dispatching in class! writeln ( test2.s() ); // I am dispatching in class! writeln ( test2 ); // NOTHING :( But should return "I am Test class!" } Is it a feature or a bug? Best regards, Damian Ziemba