Re: The difference between the dates in years

2024-02-10 Thread Brad Roberts via Digitalmars-d-learn
On 2/10/2024 6:01 PM, matheus via Digitalmars-d-learn wrote: On Saturday, 10 February 2024 at 22:11:48 UTC, Brad Roberts wrote: Back when I was doing lots of software developer interviews, one of my frequent questions involved date math.  This wasn't because it's difficult from a coding

Re: The difference between the dates in years

2024-02-10 Thread Brad Roberts via Digitalmars-d-learn
Back when I was doing lots of software developer interviews, one of my frequent questions involved date math. This wasn't because it's difficult from a coding standpoint, but that it's NOT a coding problem. The key part of the question is realization that it's a requirements question. The

Re: malloc error when trying to assign the returned pointer to a struct field

2023-09-09 Thread Brad Roberts via Digitalmars-d-learn
On 9/8/2023 12:59 AM, rempas via Digitalmars-d-learn wrote: u64 _cap = 0; // Total amount of elements (not bytes) we can this._ptr = cast(T*)malloc(size); I'm pretty sure this is your problem. You're allocating size bytes which is only going to work where sizeof(T) == 1. Changing to

Re: purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
On 5/28/2017 6:46 PM, Brad Roberts via Digitalmars-d-learn wrote: Here's the bug that I'm digging into today, a clear example of an api that _should_ be pure, but based on the implementation is rather difficult for the compiler to infer. https://issues.dlang.org/show_bug.cgi?id=17442

Re: purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
On 5/28/2017 6:36 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, May 28, 2017 17:53:25 Brad Roberts via Digitalmars-d-learn wrote: On 5/28/2017 5:34 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, May 28, 2017 16:49:16 Brad Roberts via Digitalmars-d-learn wrote

Re: purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
28, 2017 16:49:16 Brad Roberts via Digitalmars-d-learn wrote: Is there a mechanism for declaring something pure when it's built from parts which individually aren't? string foo(string s) { // do something arbitrarily complex with s that doesn't touch globals or change global state except

Re: purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
On 5/28/2017 6:01 PM, Stefan Koch via Digitalmars-d-learn wrote: On Monday, 29 May 2017 at 00:53:25 UTC, Brad Roberts wrote: On 5/28/2017 5:34 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, May 28, 2017 16:49:16 Brad Roberts via Digitalmars-d-learn wrote: Is there a mechanism

Re: purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
On 5/28/2017 5:34 PM, Jonathan M Davis via Digitalmars-d-learn wrote: On Sunday, May 28, 2017 16:49:16 Brad Roberts via Digitalmars-d-learn wrote: Is there a mechanism for declaring something pure when it's built from parts which individually aren't? string foo(string s) { // do

purity question

2017-05-28 Thread Brad Roberts via Digitalmars-d-learn
Is there a mechanism for declaring something pure when it's built from parts which individually aren't? string foo(string s) { // do something arbitrarily complex with s that doesn't touch globals or change global state except possibly state of the heap or gc return s; }

Re: spam in bugzilla

2016-11-23 Thread Brad Roberts via Digitalmars-d-learn
I've been marking the accounts as spam and moving the bugs to a specific spam product/category. The last few days have been unusual. If it keeps up, I'll investigate ways of potentially dealing with it better, but I really don't want to add friction to the signup process. It's hard enough

Re: Is memory-safe IO possible?

2016-01-22 Thread Brad Roberts via Digitalmars-d-learn
On 1/22/2016 9:10 AM, Chris Wright via Digitalmars-d-learn wrote: On Fri, 22 Jan 2016 08:36:14 +, Kagamin wrote: Should be possible. Why not? Because almost no IO routines in Phobos are marked @safe, which implies that it's difficult in practice or that people simply haven't done it. I

Re: Calling D from C, C++, Python…

2015-09-12 Thread Brad Roberts via Digitalmars-d-learn
On 9/12/15 9:20 AM, Adam D. Ruppe via Digitalmars-d-learn wrote: On Saturday, 12 September 2015 at 09:47:55 UTC, Jacob Carlborg wrote: Well, if your D function doesn't use anything of the runtime I guess it's not necessary. Right. If you don't call into the threading system in the druntime,

Re: Startup files for STM32F4xx

2015-04-25 Thread Brad Roberts via Digitalmars-d-learn
On 4/25/2015 10:02 PM, Timo Sintonen via Digitalmars-d-learn wrote: -Import mess. Phobos files import several other files. Some of them cannot be used. Work is going on to remove unnecessary imports and use scoped imports. It is important that imports for unittests are only in unittest blocks.

Re: Valgrind

2015-04-20 Thread Brad Roberts via Digitalmars-d-learn
Valgrind has a mechanism for teaching it how to ignore certain patterns. A long time ago I setup suppressions for the gc, but the code has changed out from under that version so the work would need to be redone. On 4/20/2015 7:23 PM, Martin Nowak via Digitalmars-d-learn wrote: On Monday, 20

Re: std.conv.to purity

2015-02-14 Thread Brad Roberts via Digitalmars-d-learn
While snprintf might be one thing that provides to be an interesting obstacle, the better answer to why std.conv.to isnt pure is that no one has invested the time to work through issues like that to make it so. It _should_ be pure. On 2/14/2015 12:32 PM, ketmar via Digitalmars-d-learn wrote:

Re: Getting libcurl for 64 bit Windows

2014-06-26 Thread Brad Roberts via Digitalmars-d-learn
The one that the win64 auto-tester uses is here: http://downloads.dlang.org/other/ curl-7.28.1-devel-rainer.win64.zip There's a newer one available there, but I can't vouch for it. On 6/26/14, 11:49 AM, Andrei Alexandrescu via Digitalmars-d-learn wrote: On 6/26/14, 11:11 AM, Mark