Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 November 2015 at 09:24:47 UTC, Alexander wrote: On Friday, 27 November 2015 at 07:53:09 UTC, Rikki Cattermole Ah ok! so here's my updated code. I still get the object error. I am trying to get a blank window to appear. I call the reload after I set the glfwcontext. I'm not

Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 November 2015 at 16:20:47 UTC, Mike Parker wrote: On Friday, 27 November 2015 at 07:53:09 UTC, Rikki Cattermole wrote: When you activate an OpenGL context you reload it. You do not do this when one is not activated. Doing so shouldn't cause an access violation, though. It

Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Alexander via Digitalmars-d-learn
On Friday, 27 November 2015 at 16:26:44 UTC, Mike Parker wrote: On Friday, 27 November 2015 at 09:24:47 UTC, Alexander wrote: On Friday, 27 November 2015 at 07:53:09 UTC, Rikki Cattermole Ah ok! so here's my updated code. I still get the object error. I am trying to get a blank window to

Re: Password Storage

2015-11-27 Thread BLM768 via Digitalmars-d-learn
On Friday, 27 November 2015 at 16:14:06 UTC, H. S. Teoh wrote: True, so you'd store hash(password01) in the database, and compute hash(X + hash(password)) during authentication. T Another option is SCRAM: https://en.wikipedia.org/wiki/Salted_Challenge_Response_Authentication_Mechanism

Re: [Dtiled] Unfamiliar terms and trouble using it for Dgame

2015-11-27 Thread Namespace via Digitalmars-d-learn
On Friday, 27 November 2015 at 13:00:16 UTC, Jack wrote: Greetings! I've been using Dgame for quite a while now and I have been learning quite a lot from using playing with it. Then I found Tiled that's a tool to draw tilemaps, and DTiled to implement it. Link [

Re: The best way to store a structure by reference

2015-11-27 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 27, 2015 at 11:38:28AM +0300, drug via Digitalmars-d-learn wrote: > I need to store a struct like a reference type. Now I use pointer for > this, is it the best D way? This pointer is private and access to it > is safe, but it's just unusual for me to see pointers in D code. There's

Re: Password Storage

2015-11-27 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 27, 2015 at 02:51:30PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Friday, 27 November 2015 at 07:46:33 UTC, H. S. Teoh wrote: > >1) The server stores password01 in the user database. > > I still wouldn't actually store this, hash it anyway and use that as > the new

Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 November 2015 at 07:53:09 UTC, Rikki Cattermole wrote: When you activate an OpenGL context you reload it. You do not do this when one is not activated. Doing so shouldn't cause an access violation, though. It would be throwing a DerelictException saying that no context has

[Dtiled] Unfamiliar terms and trouble using it for Dgame

2015-11-27 Thread Jack via Digitalmars-d-learn
Greetings! I've been using Dgame for quite a while now and I have been learning quite a lot from using playing with it. Then I found Tiled that's a tool to draw tilemaps, and DTiled to implement it. Link [ http://code.dlang.org/packages/dtiled] I've spent about an hour in order to make it

Re: EnumMemberNames

2015-11-27 Thread anonymous via Digitalmars-d-learn
On 27.11.2015 15:05, drug wrote: I need to get names of enum members, is it possible? EnumMembers returns the members itself, i.e. ``` enum Sqrts : real { one = 1, two = 1.41421, three = 1.73205, } pragma(msg, [EnumMembers!Sqrts]); ``` returns

Re: EnumMemberNames

2015-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 27 November 2015 at 14:05:46 UTC, drug wrote: pragma(msg, [EnumMembers!Sqrts]); pragma(msg, __traits(allMembers, Sqrts));

Re: The best way to store a structure by reference

2015-11-27 Thread B.Basile via Digitalmars-d-learn
On Friday, 27 November 2015 at 08:38:29 UTC, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. One thing: take care when

Re: The best way to store a structure by reference

2015-11-27 Thread drug via Digitalmars-d-learn
On 27.11.2015 11:38, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. Thank to all for answer. I stay with pointers in my case.

EnumMemberNames

2015-11-27 Thread drug via Digitalmars-d-learn
I need to get names of enum members, is it possible? EnumMembers returns the members itself, i.e. ``` enum Sqrts : real { one = 1, two = 1.41421, three = 1.73205, } pragma(msg, [EnumMembers!Sqrts]); ``` returns [1.0L, 1.41421L, 1.73205L] but I need [

Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 27 November 2015 at 07:48:15 UTC, Alexander wrote: import std.stdio; import derelict.opengl3.gl3; import derelict.sdl2.sdl; pragma(lib, "DerelictUtil.lib"); pragma(lib, "DerelictGL3.lib"); pragma(lib, "derelictSDL2.lib"); void main(){ DerelictGL3.load();

Re: No static fold in phobos ?

2015-11-27 Thread Ali Çehreli via Digitalmars-d-learn
On 11/27/2015 12:57 PM, userabcABC123 wrote: That would work on an AliasSeq ? I'm surprised not to find one: eg: ~~~ enum seq = AliasSeq!("aa", "bb"); enum val = staticFold!((a,b)=>a~b, seq); static assert(val == "aabb"); ~~~ it works with foreach or a eponymous template that consumes

Re: No static fold in phobos ?

2015-11-27 Thread Meta via Digitalmars-d-learn
On Friday, 27 November 2015 at 20:57:44 UTC, userabcABC123 wrote: That would work on an AliasSeq ? I'm surprised not to find one: eg: ~~~ enum seq = AliasSeq!("aa", "bb"); enum val = staticFold!((a,b)=>a~b, seq); static assert(val == "aabb"); ~~~ it works with foreach or a eponymous

Re: No static fold in phobos ?

2015-11-27 Thread userabcABC123 via Digitalmars-d-learn
On Friday, 27 November 2015 at 23:46:32 UTC, Ali Çehreli wrote: On 11/27/2015 12:57 PM, userabcABC123 wrote: That would work on an AliasSeq ? I'm surprised not to find one: eg: ~~~ enum seq = AliasSeq!("aa", "bb"); enum val = staticFold!((a,b)=>a~b, seq); static assert(val == "aabb");

Re: Derelict GLFW3 glfw3.dll error

2015-11-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 November 2015 at 22:58:20 UTC, Alexander wrote: ERROR: "derelict.util.exception.SharedLibLoadException@..\..\AppData\Roaming\dub\packages\derelict-util-2.0.4\source\derelict\util\exception.d(35): Failed to load one or more shared libraries: glfw3.dll - The specified

Re: [Dtiled] Unfamiliar terms and trouble using it for Dgame

2015-11-27 Thread Jack via Digitalmars-d-learn
On Friday, 27 November 2015 at 19:22:50 UTC, Namespace wrote: On Friday, 27 November 2015 at 13:00:16 UTC, Jack wrote: Greetings! I've been using Dgame for quite a while now and I have been learning quite a lot from using playing with it. Then I found Tiled that's a tool to draw tilemaps,

Derelict GLFW3 glfw3.dll error

2015-11-27 Thread Alexander via Digitalmars-d-learn
import std.stdio; import derelict.opengl3.gl3; import derelict.glfw3.glfw3; pragma(lib, "C:\\Users\\Alexander\\AppData\\Roaming\\dub\\packages\\derelict-gl3-1.0.17\\lib\\DerelictGL3"); pragma(lib,

Re: Multithreaded HTTP Download

2015-11-27 Thread Mike McKee via Digitalmars-d-learn
Hey guys, as it turns out, someone on stackoverflow.com pointed out in a Perl version of this question that the Bash example that was given is really buggy and doesn't make sense. They say that trying to download a single file using two socket handles will not speed up the download. So, this

Re: Password Storage

2015-11-27 Thread Chris Wright via Digitalmars-d-learn
On Fri, 27 Nov 2015 08:09:49 -0800, H. S. Teoh via Digitalmars-d-learn wrote: > On Fri, Nov 27, 2015 at 02:51:30PM +, Adam D. Ruppe via > Digitalmars-d-learn wrote: >> On Friday, 27 November 2015 at 07:46:33 UTC, H. S. Teoh wrote: >> >1) The server stores password01 in the user database. >>

Multithreaded HTTP Download

2015-11-27 Thread Mike McKee via Digitalmars-d-learn
Looking at this example that's an all-Bash technique, someone has figured out on OSX (and Unix, Linux, FreeBSD, etc.) how to use /dev/tcp and download a zip file in a multithreaded way (they use only two threads, but you get the point):

Re: Password Storage

2015-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 27 November 2015 at 07:46:33 UTC, H. S. Teoh wrote: 1) The server stores password01 in the user database. I still wouldn't actually store this, hash it anyway and use that as the new "password".

Re: EnumMemberNames

2015-11-27 Thread drug via Digitalmars-d-learn
On 27.11.2015 17:49, Adam D. Ruppe wrote: __traits(allMembers, Sqrts) Thanks to all for answers!

No static fold in phobos ?

2015-11-27 Thread userabcABC123 via Digitalmars-d-learn
That would work on an AliasSeq ? I'm surprised not to find one: eg: ~~~ enum seq = AliasSeq!("aa", "bb"); enum val = staticFold!((a,b)=>a~b, seq); static assert(val == "aabb"); ~~~ it works with foreach or a eponymous template that consumes the sequence , but as said where is it in

Re: Derelict GLFW3 glfw3.dll error

2015-11-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 November 2015 at 22:58:20 UTC, Alexander wrote: import std.stdio; import derelict.opengl3.gl3; import derelict.glfw3.glfw3; pragma(lib, "C:\\Users\\Alexander\\AppData\\Roaming\\dub\\packages\\derelict-gl3-1.0.17\\lib\\DerelictGL3"); pragma(lib,

Re: The best way to store a structure by reference

2015-11-27 Thread Ali Çehreli via Digitalmars-d-learn
On 11/27/2015 12:38 AM, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. Agreed but that's the only way. Ali

Re: Multidimensional AA question

2015-11-27 Thread Jack Applegame via Digitalmars-d-learn
On Thursday, 26 November 2015 at 17:27:34 UTC, André wrote: My question now is: is there some more elegant solution to achieve this? Something like in C++ when you have std::map's of std::map's and just access the elements and the entry is created implicitly? No. But you can create a wrapper:

Re: Derelict3 object.Error@(0): Access Violation?

2015-11-27 Thread Alexander via Digitalmars-d-learn
On Friday, 27 November 2015 at 07:53:09 UTC, Rikki Cattermole wrote: On 27/11/15 8:48 PM, Alexander wrote: import std.stdio; import derelict.opengl3.gl3; import derelict.sdl2.sdl; pragma(lib, "DerelictUtil.lib"); pragma(lib, "DerelictGL3.lib"); pragma(lib, "derelictSDL2.lib"); void

Re: Multidimensional AA question

2015-11-27 Thread Jack Applegame via Digitalmars-d-learn
On Friday, 27 November 2015 at 04:21:41 UTC, Nicholas Wilson wrote: AA are weird in that AFAIK you need to "initialise" them before you try to look suff up in them else they crash. i.e. int[string] foo; // auto e = "1" in foo; // crash AA not initialised foo[ "blah"] = 0; foo.remove("blah");

The best way to store a structure by reference

2015-11-27 Thread drug via Digitalmars-d-learn
I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code.

Re: Password Storage

2015-11-27 Thread Brad Anderson via Digitalmars-d-learn
On Friday, 27 November 2015 at 00:17:34 UTC, brian wrote: [snip] Can the developers in the room confirm if this is the correct approach? Are there examples of betters ways of doing this? Regards Brian Botan has well thought out password hashing:

Re: The best way to store a structure by reference

2015-11-27 Thread Kagamin via Digitalmars-d-learn
I use this http://dpaste.dzfl.pl/b926ff181709 to simulate reference types.

Re: The best way to store a structure by reference

2015-11-27 Thread rsw0x via Digitalmars-d-learn
On Friday, 27 November 2015 at 08:38:29 UTC, drug wrote: I need to store a struct like a reference type. Now I use pointer for this, is it the best D way? This pointer is private and access to it is safe, but it's just unusual for me to see pointers in D code. if you own the resource,