Re: @nogc and opengl errors check

2017-01-20 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 20 January 2017 at 22:47:17 UTC, Xavier Bigand wrote: Hi, I am writing some code with opengl commands that I want to check in debug, so I am using the function checkgl (from glamour lib). The issue is that checkgl throw exception and can't be @nogc, I had try to use std.experimen

@nogc and opengl errors check

2017-01-20 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I am writing some code with opengl commands that I want to check in debug, so I am using the function checkgl (from glamour lib). The issue is that checkgl throw exception and can't be @nogc, I had try to use std.experimental.logger in place of exceptions, but it doesn't work either. I

Re: iterating through members of bitfields

2017-01-20 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 05:21 PM, Nestor wrote: On Wednesday, 18 January 2017 at 12:52:56 UTC, drug wrote: I've "solved" the same problem by using AliasSeq to generate bitfields so that for iterating over bitfields I can iterate over alias sequence and mixin code. Not very good but it works. Interesting

Re: working with and installing multiple versions of dmd and D's std-library on linux/ubuntu

2017-01-20 Thread David via Digitalmars-d-learn
Many thanks! dvm works as a dream and I will also give Coedit a try

Re: Strange Bug

2017-01-20 Thread Chris M. via Digitalmars-d-learn
On Friday, 20 January 2017 at 11:58:39 UTC, Rene Zwanenburg wrote: On Friday, 20 January 2017 at 08:19:57 UTC, Chris M. wrote: [...] My guess: The encrypted output will be a bit longer than your input. You're not getting an out of bounds exception during encryption since OpenSSL only has th

Re: With not working with BitFlags

2017-01-20 Thread Jot via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:12:04 UTC, Dukc wrote: This is fairly complex thing, but I managed to get it working: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; private static auto implementation() { string result; forea

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-20 Thread aberba via Digitalmars-d-learn
On Friday, 20 January 2017 at 03:48:14 UTC, rikki cattermole wrote: On 20/01/2017 9:29 AM, Rene Zwanenburg wrote: On Thursday, 19 January 2017 at 14:04:36 UTC, aberba wrote: Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current ti

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 20, 2017 08:39:40 Rene Zwanenburg via Digitalmars-d-learn wrote: > On Friday, 20 January 2017 at 03:48:14 UTC, rikki cattermole > > wrote: > > As per the documentation this is wrong for anything beyond a > > few weeks. > > Although I have no idea if that's the case implementatio

Re: iterating through members of bitfields

2017-01-20 Thread drug via Digitalmars-d-learn
20.01.2017 15:04, Nestor пишет: Where does one define the size for a field using AliasSeq, and in this example, why does it take 1 bit if the size is not declared anywhere? Something like that https://goo.gl/zV8T23

Re: iterating through members of bitfields

2017-01-20 Thread drug via Digitalmars-d-learn
20.01.2017 15:04, Nestor пишет: On Friday, 20 January 2017 at 08:13:08 UTC, drug wrote: Something like that https://goo.gl/C4nOqw Because you generate code iterating over AliasSeq you can do almost everything you need - for example generate setters/getters. Interesting site, I wouldn't impleme

Re: iterating through members of bitfields

2017-01-20 Thread Nestor via Digitalmars-d-learn
On Friday, 20 January 2017 at 08:13:08 UTC, drug wrote: Something like that https://goo.gl/C4nOqw Because you generate code iterating over AliasSeq you can do almost everything you need - for example generate setters/getters. Interesting site, I wouldn't implemente something like this in a p

Re: Strange Bug

2017-01-20 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 20 January 2017 at 08:19:57 UTC, Chris M. wrote: I have no idea if this is an issue with D, or OpenSSL, or if I'm just doing something completely wrong. I'm writing a program that will either encrypt or decrypt a string using AES in ECB mode (for a school assignment) and it's giving

Re: working with and installing multiple versions of dmd and D's std-library on linux/ubuntu

2017-01-20 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:54:58 UTC, David wrote: Hi I am wondering what a good strategy would be to install and work with multiple versions of DMD and the associated standard library on Linux/Ubuntu? The background is that for some features and libraries I need another compiler/std-li

Re: Strange Bug

2017-01-20 Thread Timothee Cour via Digitalmars-d-learn
This and some other recent posts (`Is this a bug?`, `Hopefully a simple question...`). If you want help (and help other ppl who search for similar issues), could you please make the subject more descriptive? On Fri, Jan 20, 2017 at 12:19 AM, Chris M. via Digitalmars-d-learn < digitalmars-d-learn

Re: working with and installing multiple versions of dmd and D's std-library on linux/ubuntu

2017-01-20 Thread BBasile via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:54:58 UTC, David wrote: Hi I am wondering what a good strategy would be to install and work with multiple versions of DMD and the associated standard library on Linux/Ubuntu? The background is that for some features and libraries I need another compiler/std-li

working with and installing multiple versions of dmd and D's std-library on linux/ubuntu

2017-01-20 Thread David via Digitalmars-d-learn
Hi I am wondering what a good strategy would be to install and work with multiple versions of DMD and the associated standard library on Linux/Ubuntu? The background is that for some features and libraries I need another compiler/std-lib version than for others. So having the opportunity to c

Re: With not working with BitFlags

2017-01-20 Thread Dukc via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:12:04 UTC, Dukc wrote: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; //... } I think that typecons import was needless, you could try removing it...

Re: With not working with BitFlags

2017-01-20 Thread Dukc via Digitalmars-d-learn
This is fairly complex thing, but I managed to get it working: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; private static auto implementation() { string result; foreach(i, enumMem; EnumMembers!E) { resul

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-20 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 20 January 2017 at 08:39:40 UTC, Rene Zwanenburg wrote: On Friday, 20 January 2017 at 03:48:14 UTC, rikki cattermole wrote: As per the documentation this is wrong for anything beyond a few weeks. Although I have no idea if that's the case implementation wise. I think the documentat

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-20 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 20 January 2017 at 03:48:14 UTC, rikki cattermole wrote: As per the documentation this is wrong for anything beyond a few weeks. Although I have no idea if that's the case implementation wise. I think the documentation is talking about the units used, not length of the duration. Th

Strange Bug

2017-01-20 Thread Chris M. via Digitalmars-d-learn
I have no idea if this is an issue with D, or OpenSSL, or if I'm just doing something completely wrong. I'm writing a program that will either encrypt or decrypt a string using AES in ECB mode (for a school assignment) and it's giving me a very strange bug. encrypt and decrypt are both bools,

Re: iterating through members of bitfields

2017-01-20 Thread drug via Digitalmars-d-learn
20.01.2017 04:21, Nestor пишет: On Wednesday, 18 January 2017 at 12:52:56 UTC, drug wrote: I've "solved" the same problem by using AliasSeq to generate bitfields so that for iterating over bitfields I can iterate over alias sequence and mixin code. Not very good but it works. Interesting, coul