On Sunday, 31 July 2016 at 18:57:50 UTC, Jack Stouffer wrote:
Next question: what's the fastest hashing implementation that
will provide the least collisions? Is there a hash
implementation that's perfered for AAs?
I've heard that FNV-1a is a decent general-purpose option, and
it's fairly
On Sunday, 31 July 2016 at 16:39:59 UTC, Jack Stouffer wrote:
But D provides a default toHash for every type if it's not
defined. I was wondering why not just rely on that version.
If two objects are equal, their hashes must also be equal.
Consider this example:
struct Nullable(T) {
bool
On Monday, 18 July 2016 at 13:00:16 UTC, Lodovico Giaretta wrote:
// how do I discover that "std" is a package?
I've got a DMD pull request that adds __traits(isPackage,
someSymbol), but it's stuck waiting for approval. If and when it
gets merged, it could be useful for that.
I just started working on a project in which it would be
convenient to hold a reference to a specific entry in a DList.
The interface doesn't seem to provide a way to get a pointer to a
raw node struct, so about the best solution I can find is to get
a range out of the list, pop elements until
On Tuesday, 26 April 2016 at 23:40:24 UTC, Adam D. Ruppe wrote:
D doesn't handle this C pattern well... you basically have to
rewrite the whole thing for each version.
Or you can use the technique that's used in llvm-d: build the
enumeration from a string mixin which is generated from a
On Wednesday, 20 January 2016 at 10:04:03 UTC, burjui wrote:
That's alright. Parsing and AST construction are trivial with
S-expressions (Lisp-like syntax), so if you use them for the
early stages of development, you can focus on the type system.
When you're done with types, you can switch to
On Sunday, 17 January 2016 at 02:08:06 UTC, Timon Gehr wrote:
On 01/16/2016 11:50 PM, data pulverizer wrote:
I guess the constraints are that of a static language.
(This is not true.)
I'm playing with the design of such a language myself. Basically,
anything can create/use/return type
On Monday, 7 December 2015 at 21:33:57 UTC, Enjoys Math wrote:
I've seen these:
https://github.com/DerelictOrg?page=1
BUt not sure how to use them, examples?
OpenGL itself can't create a window/context, so you'll need to
use DerelictGLFW or DerelictSDL. GLFW is lighter-weight.
Combine the
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
On Friday, 27 November 2015 at 02:05:49 UTC, H. S. Teoh wrote:
For authentication, the password shouldn't even be sent over
the wire. Instead, the server (which knows the correct
password) should send a challenge to the client (i.e., a large
random number produced by a good RNG -- which is
On Tuesday, 24 November 2015 at 09:48:45 UTC, magicdmer wrote:
I display chinese string like:
auto str = "你好,世界"
writeln(str)
and The display is garbled。
some windows api like MessageBoxA ,if string is chinese, it
displays disorder code too
i think i must use WideCharToMultiByte to convert
I'm trying to recursively visit a package and all
packages/modules within it using metaprogramming. I should be
able to use __traits(allMembers, somePackage) recursively to get
all symbols within the package, but is there an easy way to
determine whether a symbol represents a package, a
I've got some code that reduces to the following test case:
--
mixin template stuff() {
enum someEnum = testing;
static void test() {
foreach(member; __traits(allMembers, typeof(this))) {
pragma(msg, member);
That's probably it. I guess I'll have to work around it for now.
On Saturday, 27 April 2013 at 00:21:02 UTC, anonymous wrote:
On Friday, 26 April 2013 at 21:50:51 UTC, BLM768 wrote:
[...]
Is there some subtle point I'm missing, or is this just a bug?
Looks like http://d.puremagic.com/issues
Download their windows binaries and use Digital Mars implib
tool with /system switch.
Man, I wish I'd known about that tool a while ago...
It seems to be working, but it looks like I'll need to recompile
the DLL myself; DMD is looking for symbols mangled with a leading
underscore, but the
Man, I wish I'd known about that tool a while ago...
It seems to be working, but it looks like I'll need to
recompile the DLL myself; DMD is looking for symbols mangled
with a leading underscore, but the DLL has unmangled symbols,
so optlink still complains.
Oh; never mind. I forgot the
I've been trying various methods to get SQLite working in Windows
using the etc.c.sqlite3 bindings, but I can't figure out how to
get everything in a form that DMD likes. GCC doesn't seem to
output anything that OPTLINK can use, and I can't use the
standard DLL build without creating a .LIB
On Thursday, 27 December 2012 at 03:03:34 UTC, jose isaias
cabrera wrote:
I have a huge project with D1 using the old DDBI project in
dsource:
http://dsource.org/projects/ddbi
It would be nice if someone with time will port it to D2. IHTH.
jic
Actually, my current project is basically
In any case, though, separately initializing every member of an
array is
silly. That's what a loop is for. That, or a memcpy from an
immutable
copy of .init.
I think that the reasoning behind DMD's implementation is that
for small structs, writing out the instructions is more efficient
On Saturday, 27 October 2012 at 23:07:19 UTC, BLM768 wrote:
In any case, though, separately initializing every member of
an array is
silly. That's what a loop is for. That, or a memcpy from an
immutable
copy of .init.
I think that the reasoning behind DMD's implementation
I mean that I call C function from D code. And C function takes
void** pointer as its argument. In C this means array of array,
but if I pass D two-dimensional array it doesn't work (but
compiles).
I'm pretty sure that the issue is D's internal implementation of
2-dimensional arrays. From
I've been trying to write an OS kernel in D, and I'm having
issues with the runtime. I'm trying to use LDC's -noruntime
option, which is _supposed_ to prevent any runtime calls from
being generated, but the linker keeps complaining about
unresolved references to _d_assert_msg and other runtime
It's not like compiling without a runtime will make the
compiler not emit calls; what else would it do for e.g. the
'new' expression? Anyway, given your situation, just grab the
function prototypes from druntime and stub them out, then fill
them in later.
I knew that stuff like new
On Friday, 6 July 2012 at 09:38:13 UTC, Jacob Carlborg wrote:
On 2012-07-06 08:53, BLM768 wrote:
I've been trying to write an OS kernel in D, and I'm having
issues with
the runtime. I'm trying to use LDC's -noruntime option, which
is
_supposed_ to prevent any runtime calls from being generated
The output of the --help switch suggested that it would
actually keep LDC from generating the calls, but I guess not.
Looks like I've got a rumtime to stub out. At least I'll
understand it better when I'm done.
I meant runtime. Stupid touch-screen keyboard :).
On Friday, 6 July 2012 at 15:35:17 UTC, K.Wilson wrote:
Check out the Xomb OS as they had to stub things in the runtime
out IIRC, and they use LDC still, I believe. May need to check
out a very old copy to see what they originally did to get a
minimal kernel running.
I've looked a little
On Friday, 6 July 2012 at 21:54:15 UTC, 1100110 wrote:
I swear you guys read my mind sometimes... It's creepy.
I just had this very issue, doing the exact same thing, about
an hour ago.
Have you tried with -nodefaultlib -noruntime ? Cause that's
what works for me...
I just got
On Saturday, 7 July 2012 at 04:27:07 UTC, Jonathan M Davis wrote:
On Saturday, July 07, 2012 05:45:53 BLM768 wrote:
On Friday, 6 July 2012 at 21:54:15 UTC, 1100110 wrote:
I swear you guys read my mind sometimes... It's creepy.
I just had this very issue, doing the exact same thing, about
I'm fine that the assignment to C is verboten. I'd disallow
the
first assignments to and would like to know, why they are kept.
OK, now I get it. I'm not sure why they're allowed, either; I
guess that it's just because it's written with assignment syntax.
On second thought, it might be
I'm fine that the assignment to C is verboten. I'd disallow
the
first assignments to and would like to know, why they are kept.
OK, now I get it. I'm not sure why they're allowed, either; I
guess that it's just because it's written with assignment syntax.
On second thought, it might be
On Monday, 25 June 2012 at 20:06:21 UTC, Tobias Pankrath wrote:
-
struct A { bool a; alias a this; }
struct B { int b; alias b this; }
A a = false; // works
B b = 12; // works
struct C
{
A aa;
B ab;
}
C c = { false, 12 }; // does not work, because the implicit
conversion does
I've been having the same problem as well, but I never figured
out the link to the remove() call in the destructor. The only
solution I've found is to use GC.removeRoot() on the table, but
it's an untested and potentially dangerous solution.
For some reason, whenever I declare a method with package
visibility, it becomes non-virtual. Is this normal behavior, or
is there a bug in DMD 2.059?
On Wednesday, 13 June 2012 at 22:48:34 UTC, Jonathan M Davis
wrote:
On Thursday, June 14, 2012 00:32:45 BLM768 wrote:
For some reason, whenever I declare a method with package
visibility, it becomes non-virtual. Is this normal behavior, or
is there a bug in DMD 2.059?
Only public
override will eventually be required when overriding a
function. It is already
if you compile with -w but not yet all of the time - though
since protected
isn't virtual and isn't really overriding anything, the
compiler doesn't
complain if you don't use override with it (though it will if
True, but it will be explicit in the derived class code:
No 'override', no function that is overridden.
However, if a programmer expects it to override, there could be
an issue. Imagine a novice D programmer who is not used to using
override and looks at at the following code:
class Base
I guess that another solution to this whole mess is to just start
requiring the use of override; then everyone would be educated
and it would be obvious where the bug is in the code I posted.
Since we don't want to break code, though, maybe there should be
a message prominently displayed on
I'm working on a cross-platform GUI library and I'd like to be
able to call the user's main() function from WinMain() so users
don't have to write both functions. However, I'm at a bit of a
loss as to how to accomplish that. I know that D internally
creates the extern(C) main(), which in turn
I've researched this some more, and it appears that WinMain()
actually doesn't do any runtime initialization. That means I
should be able to just call the C main from WinMain() and let it
initialize the runtime and call _Dmain(). The main problem I have
now is that as soon as I put main() in,
39 matches
Mail list logo