Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-07 18:02:16 +, Ron Tarrant said: I'm curious. What's the ultimate aim of the framework you're working on? An aid to building web apps? Desktop apps? The goal is to have a generic framework for desktop apps where you can directly start to work on the app and don't have to care a

Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-07 17:43:57 +, H. S. Teoh said: Note: it's a very bad idea to call a member function 'init'. It conflicts with the built-in .init property of all types, and can lead to strange bugs / confusing behaviours. Call it something else, like 'initialize'. Yes, thanks. I'm currently ju

Re: Meson build system user new to D.

2019-05-07 Thread Petar via Digitalmars-d-learn
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote: Hello everyone I am a Meson build system user and I am new to the D language, just wondering if there are compiler flags that I should add, unit testing frameworks, any good practices I can follow and or anything like that also some res

Re: Framework design, initialization and framework usage

2019-05-07 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 6 May 2019 at 16:50:14 UTC, Robert M. Münch wrote: I want to build a framework which gives some structure to the app using it. I'm curious. What's the ultimate aim of the framework you're working on? An aid to building web apps? Desktop apps? Or something more specific like 3D, 2D,

Re: Blog Post #0033 - Faking an ImageMenuItem with an AccelKey

2019-05-07 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 11:46:01 UTC, number wrote: On Tuesday, 7 May 2019 at 09:39:55 UTC, Ron Tarrant wrote: the github link links to file .._16_.. from 0032 instead of .._17_.. some end block comments need update: class FileMenuHeader ... } // class FileMenu void reportStuff } //

Re: Blog Post #0032 - Menu Accelerator Keys

2019-05-07 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 12:02:10 UTC, number wrote: On Friday, 3 May 2019 at 12:12:32 UTC, Ron Tarrant wrote: void doSomething(MenuItem mi) } // doSomethingNew() There is also 4 times a comment '// arg: ...' that doesn't make sense in that context. It always makes me happy when you poi

Re: Framework design, initialization and framework usage

2019-05-07 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, May 07, 2019 at 07:21:52PM +0200, Robert M. Münch via Digitalmars-d-learn wrote: [...] > > interface myFrameworkApp { > > void init(); > > } [...] Note: it's a very bad idea to call a member function 'init'. It conflicts with the built-in .init property of all types, and can lead to s

Re: Find sequence in binary fiel and advance from there

2019-05-07 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, May 07, 2019 at 08:26:16AM +, alex1974 via Digitalmars-d-learn wrote: > I want to read a binary file and validate that it contains the > sequence [73,68,51] (ID3). And than start to read from this position > onward. > > I could read in the whole file as an ubyte array but I would pref

Re: Nothing at all compiles with -m64 on Windows

2019-05-07 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 14:50:17 UTC, Anonymouse wrote: Obviously something is wrong with the environment/setup. What can I do? I've had this happen, too. I don't know for sure, but I think it may be because the installers aren't prepared to do updates, not on Windows, anyway. My best su

Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-07 09:06:03 +, Kagamin said: struct myFramework { myFrameworkAccessor myFWApp; } interface myFrameworkApp { void init(); } main(){ myFramework mf = new myFramework; mf.myFWApp.init(); // this bombs because myFWApp is NULL } struct myFrameworkAcc

Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-07 09:06:03 +, Kagamin said: struct myFramework { myFrameworkAccessor myFWApp; } interface myFrameworkApp { void init(); } main(){ myFramework mf = new myFramework; mf.myFWApp.init(); // this bombs because myFWApp is NULL } struct myFrameworkAcc

Vibe.d throw error with dmd 2.086

2019-05-07 Thread greatsam4sure via Digitalmars-d-learn
dub run gives The dependency resolution process is taking too long. The dependency graph is likely hitting a pathological case in the resolution algorithm. Please file a bug report at https://github.com/dlang/dub/issues and mention the package recipe that reproduces this error. what is t

Nothing at all compiles with -m64 on Windows

2019-05-07 Thread Anonymouse via Digitalmars-d-learn
Everything, even an empty void main, fails to compile in -m64 on this machine running Windows. -m32 works. dmd was installed with the .exe installer. It used to work and I forget what version of dmd I had, but then I upgraded to 2.086 and now it doesn't. I've tried reverting as far back as 2.07

Re: What are some ways to get more strict type-checking?

2019-05-07 Thread Devin via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 13:46:55 UTC, Devin wrote: [snip] I'm wrapping around OpenGL, which uses a int and uint for numerous types, so I decided to make a mixin template for making a sort of strict alias type. Importantly, they aren't assignable to each other, unlike Typedef. Here's the

Re: What are some ways to get more strict type-checking?

2019-05-07 Thread Devin via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:41:31 UTC, Adam D. Ruppe wrote: struct ID { private uint handle_; @property uint handle() { return handle_; } alias handle this; // now aliased to a property getter // so it won't allow modification through that/ } This seems like a good solution! I was

Re: Blog Post #0032 - Menu Accelerator Keys

2019-05-07 Thread number via Digitalmars-d-learn
On Friday, 3 May 2019 at 12:12:32 UTC, Ron Tarrant wrote: An accelerating post for a rainy Friday (well, it's raining here, at least) all about menu accelerator keys. Here's the link: http://gtkdcoding.com/2019/05/03/0032-accelerator_keys.html some end block comments need update: class File

Re: Blog Post #0033 - Faking an ImageMenuItem with an AccelKey

2019-05-07 Thread number via Digitalmars-d-learn
On Tuesday, 7 May 2019 at 09:39:55 UTC, Ron Tarrant wrote: But the result is today's post: how to produce a MenuItem with an image AND and AccelKey. Here's the link: http://gtkdcoding.com/2019/05/07/0033-fake_image_menu_and_accel.html Thanks! the github link links to file .._16_.. from 0032

Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-07 09:06:03 +, Kagamin said: struct myFramework { myFrameworkAccessor myFWApp; } interface myFrameworkApp { void init(); } main(){ myFramework mf = new myFramework; mf.myFWApp.init(); // this bombs because myFWApp is NULL } struct myFrameworkAcc

Re: Framework design, initialization and framework usage

2019-05-07 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-06 18:21:27 +, Adam D. Ruppe said: Just the constructor. It is so they don't try to skip a step calling the constructor themselves. But, of course, it doesn't have to be private. Ok, that makes sense. What I want to avoid is that explicit init line in main(). I did things t

Blog Post #0033 - Faking an ImageMenuItem with an AccelKey

2019-05-07 Thread Ron Tarrant via Digitalmars-d-learn
While browsing the GTK source, I came across a comment showing how to fake the deprecated ImageMenuItem and add an AccelKey. I'm not sure why this was considered useful enough to write about in the source comments, but it sounded like an interesting exercise. So I ported the code from C to D wh

Re: Framework design, initialization and framework usage

2019-05-07 Thread Kagamin via Digitalmars-d-learn
struct myFramework { myFrameworkAccessor myFWApp; } interface myFrameworkApp { void init(); } main(){ myFramework mf = new myFramework; mf.myFWApp.init(); // this bombs because myFWApp is NULL } struct myFrameworkAccessor { myFrameworkApp instance()

Re: Erasing passwords from ram?

2019-05-07 Thread Dukc via Digitalmars-d-learn
On Monday, 6 May 2019 at 17:57:55 UTC, Cym13 wrote: So what I'm trying to say is that, given your threat model, it does not seem relevant to protect against memory disclosure specifically: you want to protect against the larger and more common threat of memory corruptions and that happens to co

Find sequence in binary fiel and advance from there

2019-05-07 Thread alex1974 via Digitalmars-d-learn
I want to read a binary file and validate that it contains the sequence [73,68,51] (ID3). And than start to read from this position onward. I could read in the whole file as an ubyte array but I would prefer a range-based solution. Has anyone done this and could point me in the right directio

Re: __gshared 32 & 64 bit

2019-05-07 Thread Seb via Digitalmars-d-learn
On Monday, 6 May 2019 at 18:21:28 UTC, Jacob Carlborg wrote: On 2019-05-06 15:43, Aldo wrote: Hello, is there a difference between __gshared on 32 and 64 bit apps ? Shouldn't be. Yeah, maybe you're running into issues with the antique DigitalMars runtime? It has well-known issues with conc