On Wednesday, 5 June 2024 at 05:15:42 UTC, Olivier Pisano wrote:
This is technically not a memory corruption, because as
bool.sizeof < int.sizeof, you just write the low order byte of
an int you allocated on the stack.
It was not an int, it was a ushort. Anyway, what I wrote still
applies.
On Tuesday, 4 June 2024 at 16:58:50 UTC, Basile B. wrote:
question in the header, code in the body, execute on a X86 or
X86_64 CPU
I understand that the notion of `bool` doesn't exist on X86,
hence what will be used is rather an instruction that write on
the lower 8 bits, but with a 7 bits
Hi,
You should have a look at the decorator design pattern, it
reduces the amount of classes to implement if you need to combine
different effects such as elemental damage to your weapons (e.g.
if you want flame arrows).
https://en.wikipedia.org/wiki/Decorator_pattern
On Sunday, 28 January 2024 at 08:55:54 UTC, zjh wrote:
On Sunday, 28 January 2024 at 06:34:13 UTC, Siarhei Siamashka
wrote:
The explicit conversion `.length.to!int` has an extra benefit
I rarely use numbers over one million.
But do I have to consider numbers over `4 billion` every day?
On Monday, 4 September 2023 at 09:41:54 UTC, BoQsc wrote:
I've seen everyone using **datatype**`.sizeof` property.
https://dlang.org/spec/property.html#sizeof
It's great, but I wonder if it differ in any way from the
standard C function `sizeof()`.
Technically speaking, in C, sizeof is not
On Friday, 7 July 2023 at 10:45:33 UTC, Guillaume Piolat wrote:
On Friday, 7 July 2023 at 09:35:14 UTC, Paolo Invernizzi wrote:
I respectfully disagree, and prefer to keep going on with the
current deprecation and cleanup policy: Scott Meyers' DConf
2014 keynote all the way down.
+1
I've
Hi,
I am currently trying to connect to a signal on UDisks2 to be
notified whenever the user plugs a USB drive on the system, but
my method never gets called.
Here is my code :
import ddbus;
import ddbus.c_lib;
import std.stdio;
final class UsbDevice
{
void
On Sunday, 17 May 2020 at 09:27:40 UTC, Vinod K Chandran wrote:
Hi all,
I am trying to create a win32 based gui in dlang. So far so
good. I can create and display my window on screen. But for
handling messages, i planned to write something like message
crackers in c++. But since, my WndProc
On Friday, 8 May 2020 at 12:38:51 UTC, Marcio Martins wrote:
Hi,
I am building a CRC32C implementation using SSE for D, because
I couldn't find any readily available :[
Here is mine:
https://github.com/opisano/crc32c/blob/master/crc32c.d
On Monday, 4 May 2020 at 09:20:06 UTC, Ali Çehreli wrote:
On 4/30/20 10:04 AM, Ben Jones wrote:> On Thursday, 30 April
2020 at 16:55:36 UTC, Robert M. Münch wrote:
> I think you want to use scope rather than auto which will put
the class
> on the stack and call its destructor:
>
On Monday, 26 August 2019 at 13:49:21 UTC, Anders S wrote:
Hi guys,
I'm trying to read a post of different datatypes from MariaDB
table into another message and pass it on into a FIFO pipe to
an other application.
My code :
string sql = "SELECT * FROM guirequest WHERE read_request =
On Tuesday, 22 January 2019 at 13:55:30 UTC, FrankLike wrote:
Hi,everyone,
In C++, _T can guarantee that when converting from ascii
encoding type to unicode encoding type, the program does not
need to be modified. What do I need to do in D?
Thanks.
Hi,
_T is not relevant to C++, but to
On Wednesday, 22 August 2018 at 22:51:58 UTC, Piotrek wrote:
You may already know that from youtube. It seems D starts
getting traction even among musicians:
https://www.youtube.com/watch?v=yCX1Ze3OcKo=youtu.be=64
That really put a smile on my face :D
And it would be a nice example of a D
On Thursday, 10 November 2016 at 11:11:17 UTC, Guillaume Piolat
wrote:
On Thursday, 10 November 2016 at 06:52:12 UTC, Olivier Pisano
wrote:
I cannot read your website on Firefox 45 (no text is
displayed). It works on chromium anyway.
I develop it on Firefox. What is your OS?
I am on Debian
I cannot read your website on Firefox 45 (no text is displayed).
It works on chromium anyway.
Hi,
I personally separate OS-specific implementations in modules with
the same name, in different directories. From the filesystem
perspective:
widget.d
linux/widgetimpl.d
windows/widgetimpl.d
From the code perspective, the *impl modules would present
homonymic types with the same public
Salut Christophe,
Did you have a look at
https://dlang.org/phobos/std_functional.html#partial ?
On Friday, 8 April 2016 at 03:27:04 UTC, Dsby wrote:
when the soft start, call GC.disable().
use "new " create a class , struct or a array. and use
destory(T/void *) to call the ~this(), then GC.free to free the
memory, and use RAII in class or Struct.
And user the Timer, or in some where to
On Tuesday, 26 January 2016 at 05:53:29 UTC, Igor wrote:
On Tuesday, 26 January 2016 at 04:38:13 UTC, Adam D. Ruppe
wrote:
On Tuesday, 26 January 2016 at 04:31:07 UTC, Igor wrote:
then std.algorithm.find!("a.myInt == b")(classes, 3)
Try
std.algorithm.find!("a.myInt == b")(classes[], 3)
On Saturday, 5 December 2015 at 09:49:06 UTC, ref2401 wrote:
I want to create a static array large enough to store 1MB of
float values.
What am I doing wrong?
Here is a sample code with notes:
void main(string[] args) {
enum size_t COUNT = 1024 * 512 / float.sizeof; // works OK :)
On Tuesday, 17 November 2015 at 18:47:58 UTC, Andrei Alexandrescu
wrote:
I'm thinking of inviting a notable industry luminary to deliver
a conference keynote. Please reply to this with ideas! -- Andrei
Erik Meijer?
On Sunday, 25 October 2015 at 04:04:29 UTC, Shriramana Sharma
wrote:
rsw0x wrote:
use std.container.array
Thanks all for all the recommendations. When would one use
std.array.appender with a built-in array vs
std.container.array.Array? What are the pros and cons on either
side?
Appender
On Saturday, 3 October 2015 at 23:05:41 UTC, deadalnix wrote:
On Saturday, 3 October 2015 at 12:29:17 UTC, Marco Leise wrote:
That's a lot of people. You must be some kind of programming
national hero in Romania. Good luck and watch out for those
C++ moroi in the audience!
Time to get a Dman
On Thursday, 27 August 2015 at 09:38:52 UTC, Andrew Brown wrote:
That's lovely, thank you. One quick question, the length of the
file is not a multiple of the length of ubyte, but the cast
still seems to work. Do you know how it converts a truncated
final section?
Thanks again
Andrew
On Thursday, 27 August 2015 at 10:49:02 UTC, John Burton wrote:
To be honest I'm finding it very hard to find the right idioms
in D for safe and efficient programming when I'm so used to C++
/ RAII everywhere. I'll adapt though :P
This is true for every new language you learn. You first
On Wednesday, 19 August 2015 at 00:57:32 UTC, Ali Çehreli wrote:
I am very happy! :)
It will be available on many other distribution channels like
Amazon in a few days as well but the following is the link that
pays me the most royalty:
https://www.createspace.com/5618128
This revision
On Wednesday, 8 July 2015 at 09:20:58 UTC, wobbles wrote:
After reading the recent Lessons Learned article [1], and
reading a few comments on the thread, there was a mention of
using __gshared over shared.
What exactly is the difference here?
Are they 2 keywords to do the same thing, or are
On Saturday, 14 March 2015 at 08:38:06 UTC, Raphaël Jakse wrote:
Le 13/03/2015 16:45, Olivier Pisano a écrit :
What is the next chapter to need translation ?
It should be const ref Parameters and const Member Functions
but Scroph might want to translate it as it seems to be the
following of
What is the next chapter to need translation ?
The chapter on function overloading is translated. If it is OK
with you, I acquire the mutex on const ref Parameters and const
Member Functions, then :o)
I did send you a first draft of the variable number of parameters
chapter on Friday, on your gmail address. Did you get it ?
On Sunday, 22 February 2015 at 22:27:42 UTC, Raphaël Jakse wrote:
Le 22/02/2015 14:00, Olivier Pisano a écrit :
I did send you a first draft of the variable number of
parameters
chapter on Friday, on your gmail address. Did you get it ?
Yes, I thought I answered to your mail. Sorry if I
On Saturday, 21 February 2015 at 10:06:26 UTC, FrankLike wrote:
RAII(Resource Acquisition Is Initialization) is a good
thing,will D plan to do it?
It's already here :
import std.stdio;
struct Test
{
~this() { writeln(RAII); }
}
void main()
{
Test t; // prints RAII when goes out of
On Tuesday, 17 February 2015 at 22:46:01 UTC, Raphaël Jakse wrote:
To begin the translation of a chapter, I suggest you tell it
here so two people are not translating the same chapter at the
same time.
Ok, I am gonna start with the Variable number of parameters
chapter, then.
I am thinking
On Tuesday, 17 February 2015 at 17:29:15 UTC, Raphaël Jakse wrote:
Is anybody interested? Don't hesitate to send me an email if
you are willing to get involved, even for the smallest task.
There are no small tasks when a work is to get completed. I
will tell you how to help.
I suppose I
On Saturday, 20 September 2014 at 06:28:11 UTC, Paulo Pinto wrote:
This is one of the reasons why the Objective-C GC failed.
Mixing Frameworks compiled with both modes never worked
properly.
--
Paulo
Yes this was a huge failure to take into account.
Linking code where Throwable inherits
Hello,
I may have not understood what you actually want to do, but
aren't std.bitmanip.peek or std.bitmanip.read what you are
looking for ?
http://dlang.org/phobos/std_bitmanip.html#.peek
No, import is different from include. It does not stupidly copy
and paste its content but tells the compiler to take the module
into account for name resolution. The result may seem similar,
but is much more efficient.
A D module is also a unit of encapsulation (a private declaration
in a module
On Wednesday, 25 June 2014 at 03:33:15 UTC, Yuushi wrote:
Thanks a ton - I guess I need to do a fair bit more reading
about alias.
In this case, alias acts as typedef in C++. What is important
here is the function pointers/delegates syntax.
I have just ordered mine. I can't wait to get it !
Hello :)
AFAIK, Higher-level library support is planned for next release
(v2.066) [1].
Meanwhile, you'll have to rely on your own exported factory
functions to create objects instead of Object.factory().
1 : http://wiki.dlang.org/Agenda#high-level_shared_library_support
41 matches
Mail list logo