Re: Better native D 2D graphics library?

2015-02-08 Thread uri via Digitalmars-d-learn
On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote: On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote: Is there a better D graphics library in the works? I'm using SFML(which is very easy and has lots of features) but it seems to use a lot of ram(if you leave it running for a

Re: DUB build questions

2014-12-22 Thread uri via Digitalmars-d-learn
On Saturday, 20 December 2014 at 08:36:15 UTC, Russel Winder via Digitalmars-d-learn wrote: On Sat, 2014-12-20 at 05:46 +, Dicebot via Digitalmars-d-learn wrote: On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote: b) Can I do parallel builds with dub. CMake gives me

DUB build questions

2014-12-19 Thread uri via Digitalmars-d-learn
Hi All, I'm very happy with CMakeD but thought I'd try dub because CMake script is a PITA. So I have a couple of questions. a) Can dub do out out of source builds and how would I set that up. b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a

Re: DUB build questions

2014-12-19 Thread uri via Digitalmars-d-learn
On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote: On 20/12/2014 11:14 a.m., uri wrote: Hi All, I'm very happy with CMakeD but thought I'd try dub because CMake script is a PITA. So I have a couple of questions. a) Can dub do out out of source builds and how would I set

Re: VLA in Assembler

2014-12-17 Thread uri via Digitalmars-d-learn
On Wednesday, 17 December 2014 at 11:39:43 UTC, Foo wrote: On Wednesday, 17 December 2014 at 10:59:09 UTC, bearophile wrote: Foo: Hi, Could someone explain me, if and how it is possible to allocate a variable length array with inline assembly? Somewhat like int[] arr; int n = 42; asm {

Re: @property usage

2014-12-09 Thread uri via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 07:31:21 UTC, Nicholas Londey wrote: as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought no but was recently asked to add it if using the

@property usage

2014-12-04 Thread uri via Digitalmars-d-learn
Hi All, Do you guys use @property much, or is it largely ignored/avoided? Thanks, uri

Re: @property usage

2014-12-04 Thread uri via Digitalmars-d-learn
On Thursday, 4 December 2014 at 10:24:00 UTC, Rikki Cattermole wrote: On 4/12/2014 11:21 p.m., uri wrote: Hi All, Do you guys use @property much, or is it largely ignored/avoided? Thanks, uri When it makes sense I use it.

Re: write multiple lines without \n with writeln

2014-11-20 Thread uri via Digitalmars-d-learn
On Thursday, 20 November 2014 at 08:28:11 UTC, Suliman wrote: In dco source code I have found: void ShowUsage() { writeln( dco build tool ~ strVersion ~ written by FrankLIKE. Usage: dco [switches...] files... for example: dco or: dco app.d build for dfl2: dco } I do not see here any \n.

Re: write multiple lines without \n with writeln

2014-11-20 Thread uri via Digitalmars-d-learn
On Thursday, 20 November 2014 at 10:41:24 UTC, bearophile wrote: uri: It's by design And it's a nice handy design. Bye, bearophile For Wysiwyg strings I agree that it's great but I prefer C/C++/Python like behaviour for double quoted strings. I guess it's what I'm used to :)

Re: print yyyy-mm-dd

2014-11-20 Thread uri via Digitalmars-d-learn
On Thursday, 20 November 2014 at 20:38:08 UTC, MrSmith wrote: On Thursday, 20 November 2014 at 13:50:49 UTC, Suliman wrote: I can't understand how to get date in format -MM-dd from Clock.currTime auto time = Clock.currTime; And what next? Could anybody give any examples?

Re: Compiling with SQLite

2014-11-17 Thread uri via Digitalmars-d-learn
On Tuesday, 18 November 2014 at 01:14:26 UTC, impatient-dev wrote: I'm new to D, and I'm trying to use SQLite, but I can't get this basic program to compile: import etc.c.sqlite3 : sqlite3_open; void main(string[] args){ sqlite3_open(test.sqlite, null); } When compiling with DMD

Which SciD to use (if at all)?

2014-11-03 Thread uri via Digitalmars-d-learn
Hi All, I've just started using kyllingstad/scid but it hasn't been updated for a while and I just found a fork which references some GSoC work. Is SciD is still maintained and which should I use? https://github.com/kyllingstad/scid or https://github.com/cristicbz/scid Or is there an

template type deduction of static 2d arrays

2014-10-24 Thread uri via Digitalmars-d-learn
Hi All, I was wondering why in the code below f1() works but f2 template version called in the same manner does not. Is there a good reason from a language/compiler perspective? Thanks. uri --- auto f1(int[2][2] m) { return m[0][0]*m[1][1]-m[0][1]*m[1][0]; } auto f2(T)(T[2][2] m) {

Re: template type deduction of static 2d arrays

2014-10-24 Thread uri via Digitalmars-d-learn
On Friday, 24 October 2014 at 23:20:02 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 24 Oct 2014 22:32:57 + uri via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi All, I was wondering why in the code below f1() works but f2 template version called in the same

Re: template type deduction of static 2d arrays

2014-10-24 Thread uri via Digitalmars-d-learn
On Friday, 24 October 2014 at 23:46:28 UTC, uri wrote: On a related note, does the D spec guarantee the following will be rectangular in memory? auto a = [ [1,2],[3,4] ]; Cheers, uri I just checked the docs and auto a = [ [1,2],[3,4] ] will be an an array of pointers. So this cannot

Re: template type deduction of static 2d arrays

2014-10-24 Thread uri via Digitalmars-d-learn
On Saturday, 25 October 2014 at 00:00:54 UTC, ketmar via Digitalmars-d-learn we have a nice PR from Kenji that allows the following declarations: int[$][$] a = [ [1,2],[3,4] ]; but alas, it's not in the mainline yet. This will be cool, especially auto[$][$] also works. thanks, uri

Re: How to convert from ubyte[] to and from float?

2014-10-20 Thread uri via Digitalmars-d-learn
On Sunday, 19 October 2014 at 03:14:26 UTC, Charles Hixson via Digitalmars-d-learn wrote: What is the best way to convert from a part of a ubyte[] to a float? I've tried converting the ubyte[] into a uint, but neither casting the uint to a float nor to!float work. I suppose I could use a

is scid still maintained

2014-09-20 Thread uri via Digitalmars-d-learn
Hi All, I'm wondering if SciD is still maintained because the last commit to this repo is a while ago now... https://github.com/kyllingstad/scid Is there a fork, or some other repo that is more up to date I should look at? Thanks, uri

Re: Getting RefCounted to work with classes

2014-08-26 Thread uri via Digitalmars-d-learn
On Monday, 25 August 2014 at 21:14:03 UTC, Bienlein wrote: Hello, the code below compiles and runs fine. However, when I change Payload from struct to class I get compiler errors: Error 1 Error: template instance std.typecons.RefCounted!(Payload, cast(RefCountedAutoInitialize)1) does not

D with no druntime

2014-08-20 Thread uri via Digitalmars-d-learn
Hi All, I am playing with a small hack OS for fun and in 2066 there are these undefined refs (I have no druntime): _d_arraybounds (new to 2066) _d_assert (new to 2066) _d_unittest (new to 2066) _Dmodule_ref (also in 2065) _d_dso_registry (also in 2065) It is trivial to stub these out but it

Auto attributes for functions

2014-08-19 Thread uri via Digitalmars-d-learn
Hi all, Bit new to D so this might be a very naive question... Can the compiler auto infer function attributes? I am often adding as many attributes as possible and use the compiler to show me where they're not applicable and take them away. It would be great if this could be achieved like

Re: implicit conversion

2014-08-12 Thread uri via Digitalmars-d-learn
Sorry should add this is on 2.066.0-rc2 and it used to work on 2.064. Cheers, uri On Tuesday, 12 August 2014 at 06:21:19 UTC, uri wrote: Hi, I'm trying to allow implicit conversions for my own type happening. I have the following: import std.math; import std.traits; struct S(T)

implicit conversion

2014-08-12 Thread uri via Digitalmars-d-learn
Hi, I'm trying to allow implicit conversions for my own type happening. I have the following: import std.math; import std.traits; struct S(T) if(isFloatingPoint!T) { T val; alias val this; } void main() { auto s = S!float(); assert(isNaN(s)); s = 10.0;

Re: implicit conversion

2014-08-12 Thread uri via Digitalmars-d-learn
On Tuesday, 12 August 2014 at 06:37:45 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Tue, 12 Aug 2014 06:21:17 + uri via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi, I'm trying to allow implicit conversions for my own type happening. I have the following

Re: undefined references

2014-08-10 Thread uri via Digitalmars-d-learn
On Monday, 11 August 2014 at 03:12:45 UTC, Vlad Levenfeld wrote: [snip] this (Elements...)(Elements elements) if (Elements.length == length) { foreach (i, element; elements) components[i] = element; } this (Element

Re: undefined references

2014-08-10 Thread uri via Digitalmars-d-learn
On Monday, 11 August 2014 at 04:02:12 UTC, uri wrote: On Monday, 11 August 2014 at 03:12:45 UTC, Vlad Levenfeld wrote: [snip] this (Elements...)(Elements elements) if (Elements.length == length) { foreach (i, element; elements)

Re: Template delegate/function ptr struct member

2014-05-13 Thread uri via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 07:50:09 UTC, Rikki Cattermole wrote: On 13/05/2014 7:28 p.m., ed wrote: I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to