Re: Dlangui can't build x64 example1.exe , because the size_t is ulong on winx64

2014-05-03 Thread Rikki Cattermole via Digitalmars-d-learn
On Saturday, 3 May 2014 at 08:59:40 UTC, FrankLike wrote: Hi,everyone, I build the dlangui on win7 x64,use the debug win32,it can get the example1.exe, but use the debug x64,not get the exe file,the error is Error: function pointer FreeImage_OpenMemory (ubyte* data = null, uint

Re: Math-Parser

2014-05-03 Thread Rikki Cattermole via Digitalmars-d-learn
On Friday, 2 May 2014 at 22:34:48 UTC, Tim Holzschuh via Digitalmars-d-learn wrote: Hi there, I currently try to write a simple math-parser in D. However.. something isn't working and I just can't figure out what's the problem. (I'm relative new to D, and this is my first test to write a

Re: Template delegate/function ptr struct member

2014-05-13 Thread Rikki Cattermole via Digitalmars-d-learn
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 accept delegates for future use without breakage to existing code...

Re: Objects(from classes) at Compile time? no gc

2014-05-16 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/05/2014 4:59 p.m., Taylor Hillegeist wrote: The subject says it all really. i have this example: import core.memory; class fruit{ int value=5; public int getvalue(){ return value; } } int main(string[] args) { GC.disable; static fruit myfruit; return

Re: Video playback

2014-05-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/05/2014 7:10 p.m., Dmitry wrote: Hi everyone! I want to play video in my D-application (maybe WebM or Theora). However didn't find any library for operation with video in D. I am a beginner in D, experience of transfer of libraries with C/C++, certainly isn't present. Maybe somebody will

Re: Error compiling test code

2014-05-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/05/2014 3:17 p.m., Larry Hemsley wrote: I just installed dmd on Mint Linux distro using the Ubuntu dep package. Ran a simple test program test.d and recieved this error. test.d(1): Error: module stdio is in file 'stdio.d' which cannot be read import path[0] = /usr/include/dmd/phobos

Re: Seeking Advice on D Bindings for Large C Library Collection

2014-05-20 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/05/2014 10:36 p.m., Tom Browder via Digitalmars-d-learn wrote: I am working on a project to provide D binding files for the C/C++ FOSS BRL-CAD project: http://brlcad.org My work is on the d-binding branch and specifically here:

Re: Passing a function as an argument to another function : what is this sorcery ?

2014-05-25 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/05/2014 9:37 p.m., Derix wrote: Hello everyone, So I'm Getting Started With Gtkd [1] and the tuto includes this piece of code : ... DrawingArea da = new DrawingArea(590, 200); da.addOnDraw(onDraw); layout.put(da, 5, 30); add(layout); // Add the layout

Re: Create const regex?

2014-06-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/06/2014 12:01 a.m., AntonSotov wrote: const r1 = regex(bla); matchFirst( big string, r1 ); // ERROR! immutable r2 = regex(bla); // ERROR! Why can I not use const/immutable regex? In none of your examples you have not defined the type of the variables. However you are giving it an

Re: Some kind of RPC exists for D?

2014-06-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/06/2014 7:24 a.m., Bienlein wrote: Hello, I'm looking for a way to do some kind of RPC in D. Some way of being able to say aFoo.bar(int i, ...) with receiver object and method being marshalled at the sender's site and being unmarshalled and invoked at the receiver's site. Any hints

Re: Missed it by THIS much

2014-06-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/06/2014 1:13 p.m., Jason King wrote: This is me trying to link with Juno and getting tantalizingly close to success. DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on path) Juno is in D:\dlang\Juno-Windows-Class-Library D:\dlang\Juno-Windows-Class-Library\juno.lib exists sc.ini

Re: implib and system dlls, oh my

2014-06-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/06/2014 12:34 a.m., Jason King wrote: On Tuesday, 24 June 2014 at 04:37:56 UTC, Rikki Cattermole wrote: On 24/06/2014 1:13 p.m., Jason King wrote: This is me trying to link with Juno and getting tantalizingly close to success. DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on

Re: Concatenates int

2014-07-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/07/2014 12:11 a.m., Sean Campbell wrote: i have the ints 4, 7, 0 and 1 how can i Concatenate them into four thousand seven hundred and one. If we talking at compile time definition: int myint = 4_7_0_1; Would work. However I'll assume its at runtime you really want this. I.e.

Re: Concatenates int

2014-07-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/07/2014 1:18 a.m., Sean Campbell wrote: perhaps I'd better state what I'm doing. i have an array of 4 bytes and a want to convert them to a 32 bit int and convert the 32 bit int back into a 4 bytes again. Small hack I use in Dakka: union RawConvTypes(T) { T value;

Re: I don't get it. version(unittest) can't seem to use local variable

2014-07-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/07/2014 5:08 p.m., dysmondad wrote: I'm new to D. I've been using C since it was a baby and C++ back when it was only a pre-compiler for c. So, I may just be stuck thinking in C land. The issue is I am attempting to use the version(unittest) feature. However the compiler pukes up the

Re: I don't get it. version(unittest) can't seem to use local variable

2014-07-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/07/2014 2:35 p.m., dysmondad wrote: . try: unittest { Velocity v = new Velocity( 2.0f, 5.0f ); v *= 5.0f; // - line 110 printf( v = %s\n, to!string(v) ); } instead. Basically version is like static if, it doesn't indicate its a function. Instead it changes what

Re: How can I express the type '(int) = int' where it is a function or a delegate

2014-07-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/07/2014 3:50 p.m., Puming wrote: I'd like to have a Command class, where their is a name and a handler field: ```d class Command { string name; string delegate(string[]) handler; } ``` this is ok, but sometimes I want the handler also accept a function (lambdas are init to

Re: Dump mixins (preprocessed/generated) code

2014-07-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/07/2014 11:39 p.m., Domingo Alvarez Duarte wrote: Hello ! I'm trying to make MiniD/Croc work with dmd2 and I'm having a problem with this code and I want to know how to dump the generated code to understand what's happening. How that can be done ? debugmixin.d-mixin-15(15): Error: no

Re: Dump mixins (preprocessed/generated) code

2014-07-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/07/2014 12:09 a.m., Domingo Alvarez Duarte wrote: Thank you so much ! That did exactly what I was looking for, but now why I'm getting that error message ? Any help is welcome ! Cheers ! The generated code seems to fine: debug assert(t.stackIndex t.stackBase, (printStack(t),

Re: Deploying Vibe.d applications to OpenShift

2014-07-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/07/2014 1:28 p.m., Rutger wrote: Hello! Really enjoying D so far and have started to toy around with Vibe.d. I was just wondering if someone here has had any experience with publishing vibe applications on the OpenShift Paas? (https://www.openshift.com) Please let me know how you did it,

Re: Deploying Vibe.d applications to OpenShift

2014-07-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/07/2014 2:48 p.m., Rutger wrote: On Thursday, 24 July 2014 at 01:47:43 UTC, Rikki Cattermole wrote: On 24/07/2014 1:28 p.m., Rutger wrote: Hello! Really enjoying D so far and have started to toy around with Vibe.d. I was just wondering if someone here has had any experience with

Re: Programming a Game in D? :D

2014-08-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/08/2014 8:38 a.m., David wrote: Hi, not too sure if there's still someone reading this post, but i do have another question. So, I heared so much good stuff about D, it's powerfull, fast the syntax is nice, but well, why is D actually not used for common games yet? (I mean I know about some

Re: Programming a Game in D? :D

2014-08-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/08/2014 5:18 p.m., Kapps wrote: On Sunday, 3 August 2014 at 03:39:25 UTC, Rikki Cattermole wrote: Lastly the game dev industry is very hesitant to change languages for a lot of reasons. And one of those is platform support. They won't be seeing D on e.g. Xbox One anytime soon if you get

Re: Command Line Application in D

2014-08-04 Thread Rikki Cattermole via Digitalmars-d-learn
On 5/08/2014 10:03 a.m., TJB wrote: On Monday, 4 August 2014 at 21:58:09 UTC, maarten van damme via Digitalmars-d-learn wrote: I am a little bit confused as to what you want. There is a command line example at dlang.org, and there exists a program (rdmd) that compiles several D files and runs

Re: alias to fully qualified enum in scope where enum is expected

2014-08-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 6/08/2014 6:11 p.m., Timothee Cour via Digitalmars-d-learn wrote: Is there a simple way to to do this? enum A{ a1, a2 } void fun(A a){...} void test(){ fun(A.a1); //works fun(a1); //I'd like a1 to work, but just where an A is expected to avoid polluting namespace. } The magic of with

Re: Templates and function parametes

2014-08-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 9/08/2014 6:19 p.m., Paul D Anderson wrote: When I try to compile these two functions, the second function is flagged with an already defined error: bool testRoundTrip(T, U)(T first, U second) if (isIntegral!T isFloatingPoint!U) { return false; } bool testRoundTrip(U, T)(U first, T

Re: Class parameters that are either setable at run-time or compile-time

2014-08-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/08/2014 10:47 p.m., Markus Mayr wrote: Hello, I am new to D. I am sorry if this question was already answered or if it is trivial. I am having a class. That class takes several parameters that may be known at either compile time or run time. I want users of my class to be able to pass the

Re: Very vague compiler error message

2014-08-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/08/2014 7:16 p.m., Jeremy DeHaan wrote: I recently got this error messege when building my library: dmd: cppmangle.c:154: void CppMangleVisitor::cpp_mangle_name(Dsymbol*): Assertion `0' failed. I have no idea what it means and haven't found much information about it. I think I have

Re: struct or class

2014-08-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/08/2014 11:56 p.m., nikki wrote: I come from languages that don't offer structs, I have this json load function that has to keep some data and intuitively I've written a struct, I've read about the differences, heap vs stack, value vs reference, but know I think i am overthinking it.

Re: accessing memory from address

2014-08-30 Thread Rikki Cattermole via Digitalmars-d-learn
On 31/08/2014 1:41 a.m., bojoe wrote: I am interfacing with a dll that returns a pointer to an int. In python, I can use from_address: shape=list((c_int*rank).from_address(pi[2].contents.value)) Is there something equivalent in d? Or do I need to manually call ReadProcessMemory at that

Re: Linking phobos64.lib errors

2014-09-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/09/2014 7:22 p.m., Szymon Gatner wrote: Hi, I am trying to make simple x64 C++ application that uses D static library (trying to do Interfacing with C++ from D Cookbook chapter). I am Using Visual Studio 2012 to create main() like this: #include iostream extern C int rt_init(); extern C

Re: How to pack types with variables in one message to send it to another thread? [tuple]

2014-09-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/09/2014 10:42 p.m., MarisaLovesUsAll wrote: Hi! I'm trying to make my program multithreaded, and I was stuck at messaging between threads. I need to pack types and variables into one message. Will I use Tuples or something? e.g. class Sprite {}; send(tid, Sprite, create, myInt); Don't

Re: How to pack types with variables in one message to send it to another thread? [tuple]

2014-09-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/09/2014 12:39 a.m., MarisaLovesUsAll wrote: Thanks for reply. Strings are immutable so thats ok. A class instance that isn't immutable isn't. It's not a class instance, it's a class type. Something like `cast(Sprite) null` in parameters. It can be replaced by string Sprite, but in this

Re: Novice web developer trying to learn D

2014-09-07 Thread Rikki Cattermole via Digitalmars-d-learn
On Sunday, 7 September 2014 at 21:06:48 UTC, zuzuleinen wrote: Hello, First, here is my Linkedin profile http://www.linkedin.com/in/andreiboar in order to make an image of my professional background. I do realise here are really good programmers for which this background might sound like a

Re: Dirilect3 Installation Step by Step

2014-09-17 Thread Rikki Cattermole via Digitalmars-d-learn
On Thursday, 18 September 2014 at 00:06:41 UTC, fuijiy wrote: Hello guys, I'm trying to install Derelict3. I read a lot of thing and I lost myself between this huge set of information. What I must do ? First, I try to build Derelict3 (github version) manually but I failed. So I tried with

Re: Recursive data-types

2014-09-27 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/09/2014 11:26 p.m., ponce wrote: I'm dabbling with Scheme interpreter and ultimately I would need to declare the following types. -- struct Function { Environment env; Atom params; Atom body_; } // An atom is either a string, a double, a symbol, a function or

Re: Advanced (HTML5/JS) client webpage connecting to vibe.d server backend

2014-10-08 Thread Rikki Cattermole via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 21:14:42 UTC, Nordlöw wrote: I'm looking for a vibe.d sample application that shows a complete app including vibe.d server logic together with some html/js that together provides a modern dynamic web experience. I typically want a web form that updates parts of

Re: __traits(getMember) works only the second time

2014-10-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/10/2014 8:08 p.m., andre wrote: Hi, by executing the example source code, following output is returned: Reference: Child false true At first childStr is not found, then it is found? Is this a bug? Kind regards André - module app; import test; class Child : Parent {

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/10/2014 3:00 p.m., RBfromME wrote: On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote: I'm a newbie to programming and have been looking into the D lang as a general purposing language to learn, yet the D overview indicates that java would be a better language to learn for your

Re: template type deduction of static 2d arrays

2014-10-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/10/2014 11:32 a.m., uri wrote: 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

Re: Template constraint: T is a value type

2014-10-29 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/10/2014 11:01 p.m., Gareth Foster wrote: Hi there, I'm looking to write a function template that operates only on value types. Basically I'm looking for an equivalent of where T: struct from C# (http://msdn.microsoft.com/en-us/library/d5x73970.aspx) I was thinking that maybe using

Re: Dart bindings for D?

2014-10-30 Thread Rikki Cattermole via Digitalmars-d-learn
On 31/10/2014 6:39 a.m., Laeeth Isharc wrote: Hi. Thanks for all the thoughts, and sorry it has taken me a little while to reply. Adam - I liked your book very much: it really complemented the other resources out there, especially in communicating a refreshing spirit of enthusiasm and fearless

Re: manually call opUnary

2014-11-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/11/2014 8:19 p.m., Algo wrote: Is it possible? As in { int a; a.opUnary!++(); } no property 'opUnary' for type 'int' For primitives it doesn't look like it. To confirm this, we'll first figure out what TypeInfo is used for it: pragma(msg, typeid(int).name); /d133/f260.d(16):

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 3:45 p.m., Israel wrote: On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that,

Re: Get full class name at compile time - Not yet implemented

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 6:22 p.m., Andre wrote: Hi, I currently have some issues to get the full class name at compile time by the variable which might point to null. With .stringof I get the class name without the module. It seems typeid(typeof()) is the solution, but DMD throws the error:

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 7:18 p.m., Casey wrote: On Thursday, 13 November 2014 at 02:58:02 UTC, Rikki Cattermole wrote: On 13/11/2014 3:45 p.m., Israel wrote: On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at

Re: release building problem

2014-12-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/12/2014 11:15 p.m., Oleg wrote: When I build my program with release flag I get an errors, in debug build all works .dub/build/application-profile-linux.posix-x86_64-dmd-AD20DEA65FEE410217932549C1D262EF/ftree.o: In function

Re: @property usage

2014-12-04 Thread Rikki Cattermole via Digitalmars-d-learn
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. https://github.com/Devisualization/window/blob/master/interfaces/devisualization/window/interfaces/window.d#L144 vs

Re: mixin template had error by calling shared function

2014-12-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template Template(void function() func1, void function() func2) { void to() { func1(); func2(); } }; class SomeClass { mixin Template!(func, func23); void func()

Re: mixin template had error by calling shared function

2014-12-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/12/2014 12:24 a.m., Vlasov Roman wrote: On Wednesday, 10 December 2014 at 10:34:25 UTC, Marc Schütz wrote: On Wednesday, 10 December 2014 at 09:41:43 UTC, Rikki Cattermole wrote: On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template

Re: SQLLite driver

2014-12-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 14/12/2014 9:21 a.m., Suliman wrote: On the code.dlang.org I found SQLLite driver https://github.com/biozic/d2sqlite3 Look like it's not ready for Windows: pragma(msg, \nWARNING !!!\nDevelopped for POSIX systems only.\nNot tested on Windows.\n); I tried to add import to my project and I

Re: SQLLite driver

2014-12-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 14/12/2014 7:35 p.m., Suliman wrote: Yes I used 2.0.65, but after updating compiler the situation did not resolved... http://www.everfall.com/paste/id.php?apd0bfs5z4eg Ah oh, I remember this issue from 2.064 - 2.065. Definitely hasn't been upgraded.

Re: struct vs built-in type

2014-12-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 17/12/2014 8:57 p.m., Jack Applegame wrote: Code: import std.stdio; struct Bar { int payload; alias payload this; } struct Foo { private { Bar m_bar; int m_baz; } @property { Bar bar() { return m_bar; } void bar(Bar v) { m_bar =

Re: Non-blocking UDP calls using std.socket

2014-12-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 17/12/2014 9:20 p.m., Andre Artus wrote: I've written a small program that uses UdpSocket (std.socket) to query a DNS server for selected records. It works as expected, but I would like to try a non-blocking approach. The last time I wrote socket code (without a supporting library) was over

Re: DUB build questions

2014-12-19 Thread Rikki Cattermole via Digitalmars-d-learn
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 that up. There is e.g. preBuildCommands. b) Can I do parallel builds

Re: Get vars in current scope at compile time?

2014-12-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/12/2014 10:09 a.m., Tofu Ninja wrote: Is there some way to get a list of the variables that are in the current scope via traits? Some things like allMembers? I would like to be able to call this from a mixin to grab the locals in the scope that the mixin is being dropped into. No way to

Re: Get vars in current scope at compile time?

2014-12-20 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/12/2014 11:03 p.m., bearophile wrote: Rikki Cattermole: No way to do this. But perhaps it's worth supporting as future enhancement with a __traits. What are the use cases? Bye, bearophile Short answer, I'm not keen on the idea, at least not yet. I would far more comfortable once

Re: DUB build questions

2014-12-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 23/12/2014 1:39 a.m., uri wrote: 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

Re: [TkD] X11 Error(Possible bug?)

2014-12-25 Thread Rikki Cattermole via Digitalmars-d-learn
On 26/12/2014 6:58 p.m., Jack wrote: Complete error code here: http://codepad.org/KcW7jhXl Apparently, there exists an incompatibility. Take note, I just listed tkd as a dependency on my dub.json, and I haven't really used the library as of the time of its building. So, is this a bug? Short

Re: xcb error for core.thread's Thread.join

2014-12-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/12/2014 7:39 p.m., Jeremy DeHaan wrote: On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan wrote: On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan wrote: Hey all, I've never gotten any xcb errors with just regular D code before, but maybe I just haven't done anything

Re: xcb error for core.thread's Thread.join

2014-12-29 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/12/2014 9:54 p.m., Jeremy DeHaan wrote: On Monday, 29 December 2014 at 07:23:32 UTC, Rikki Cattermole wrote: On 29/12/2014 7:39 p.m., Jeremy DeHaan wrote: On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan wrote: On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan wrote:

Re: Checking C return results against NULL

2014-12-31 Thread Rikki Cattermole via Digitalmars-d-learn
On 1/01/2015 12:22 a.m., Laeeth Isharc wrote: Am I missing a more agreeable way to check the return value of a C function against NULL. It's fine if it's a char*, but if it returns a pointer to some kind of struct, one has to go through and convert each instance of NULL to a cast of the

Re: Dub hanging for a long time

2015-02-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/02/2015 8:55 p.m., Suliman wrote: Several times I encounter problem when DUB is hanging for a long time It's look like that when I tun DUB from folder of current project it's do not show me nothing, just move cursor on next line for a long time.

Re: Using reduce with user types

2015-02-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/02/2015 1:47 a.m., Kadir Erdem Demir wrote: I can use filter algorithm with my types easily. struct A { string value; int count; } void main( string[] args ) { A[] aArr; aArr ~= A(HTTP, 3); aArr ~= A(HTTPS, 2); aArr ~= A(UNKNOWN_TCP, 4);

Re: Clarification in continue statement

2015-02-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 6/02/2015 10:37 p.m., Vasileios Anagnostopoulos via Digitalmars-d-learn wrote: hi, I observed in the documentation If continue is followed by /Identifier/, the /Identifier/ must be the label of an enclosing while, for, or do loop, and the next iteration of that loop is executed. It is an

Re: [dub] specify dependency configuration

2015-01-18 Thread Rikki Cattermole via Digitalmars-d-learn
I forgot to mention dub should automatically choose the first configuration available if you do not specify it. In this case that's the library one. Or atleast it should do that.

Re: druntime build failing because of masm386 problems

2015-01-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/01/2015 4:53 p.m., Jonathan M Davis via Digitalmars-d-learn wrote: It's been a while since I did anything in Windows with D, and unfortunately, I need to again, and now I can't get druntime to build. I'm getting this lovely error: dmc -c src\rt\minit.asm masm386 -DM_I386=1 -D_WIN32 -Mx

Re: [dub] specify dependency configuration

2015-01-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/01/2015 1:59 p.m., cal wrote: Given myapp and a dependency, specified by dub.json's: myapp: dub.json { ... dependencies: { dependency_a: =0.6.0 } ... } dependency_a: dub.json { ... configurations: [ { name: config_a, targetType: library, ... },

Re: What is the Final?

2015-01-20 Thread Rikki Cattermole via Digitalmars-d-learn
On 21/01/2015 12:58 a.m., RuZzz wrote: Alexandrescu The_D_Programming_Language page 264: 7.1.10 Subtyping with structs. The @disable Attribute import std.stdio; ... unittest { auto a = Final!Widget(new Widget); a.print(); // Fine, just print a auto b = a; // Fine, a and b are bound to the same

Re: Why foreach do not print value during every single Insert request in SQL?

2015-01-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/01/2015 1:05 a.m., Suliman wrote: void IMGsInsert(string [] fullimgurl) { foreach (url; fullimgurl) { string sqlinsert = (sqlrequest) writeln(sqlinsert); write(|); auto rs =

Re: building a simple json tree

2015-01-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/01/2015 12:16 a.m., anonymous wrote: what's the right syntax for building a JSON tree ? I try to do like in an AA but the program throw because the Key doesn't exist: --- import std.stdio, std.json; void main(string[] args) { struct Foo{ string a, b; void

Re: building a simple json tree

2015-01-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/01/2015 1:37 a.m., anonymous wrote: On Thursday, 15 January 2015 at 12:10:09 UTC, Rikki Cattermole wrote: On 16/01/2015 12:16 a.m., anonymous wrote: what's the right syntax for building a JSON tree ? I try to do like in an AA but the program throw because the Key doesn't exist: ---

Re: Mimicking C++'s indexing behavior in D associative arrays

2015-02-17 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/02/2015 1:21 p.m., Matt Kline wrote: In C++, the index operator for maps will either return a reference to the existing value if the key can be found, or a reference to a new, default-initialized value if one with the given key cannot be found. In D, an exception is thrown instead when a

Re: D : dmd vs gdc : which one to choose?

2015-02-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/02/2015 9:46 p.m., Mayuresh Kathe wrote: How do I (a newbie to D) figure out which compiler set to use? I am running Ubuntu 14.10, and intend to stick with it in the long term. Should I choose DMD or go with GDC? I would like to know the rationale for suggestions for either. Thanks.

Re: D : dmd vs gdc : which one to choose?

2015-02-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/02/2015 12:10 a.m., Mayuresh Kathe wrote: On Thursday, 19 February 2015 at 09:10:16 UTC, Rikki Cattermole wrote: On 19/02/2015 9:46 p.m., Mayuresh Kathe wrote: How do I (a newbie to D) figure out which compiler set to use? I am running Ubuntu 14.10, and intend to stick with it in the

Re: D : dmd vs gdc : which one to choose?

2015-02-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/02/2015 5:08 a.m., ketmar wrote: On Thu, 19 Feb 2015 22:10:11 +1300, Rikki Cattermole wrote: And anyway, GDC is still hasn't been updated to the latest version of D. And its the last major D compiler that hasn't. LDC is 2.067 already? O_O 'cause GDC is 2.066.1 now. Well according to

Re: Using dub

2015-01-26 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and

Re: Using dub

2015-01-26 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/01/2015 8:40 p.m., Joel wrote: On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole wrote: On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now).

Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?

2015-01-27 Thread Rikki Cattermole via Digitalmars-d-learn
On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of

Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?

2015-01-27 Thread Rikki Cattermole via Digitalmars-d-learn
On 28/01/2015 11:30 a.m., Gan wrote: On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote: On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special

Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?

2015-01-27 Thread Rikki Cattermole via Digitalmars-d-learn
On 28/01/2015 11:39 a.m., Gan wrote: On Tuesday, 27 January 2015 at 22:30:13 UTC, Gan wrote: On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote: On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at

Re: Does anybody work on std.net.curl?

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/01/2015 12:54 a.m., Suliman wrote: Just interesting is there any plans to replace net.curl on native lib? I mean not plans for long future, but some stuff on which somebody active work? The best I can suggest is Vibe.d.

Re: Using dub

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 28/01/2015 2:14 p.m., Joel wrote: On Wednesday, 28 January 2015 at 00:34:13 UTC, Joel wrote: On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. Actually I got this

Re: Using dub

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 28/01/2015 1:34 p.m., Joel wrote: On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. I don't now how to set up the dub executable to work with out doing stuff like

Re: Using dub

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/01/2015 11:27 a.m., Joel wrote: When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS. Ohh, I was meaning a dmg. But ugh looks like I lied, my bad, only had to do it once. Looks like I used

Re: Using dub

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/01/2015 1:24 p.m., Joel wrote: On Wednesday, 28 January 2015 at 23:48:52 UTC, Rikki Cattermole wrote: On 29/01/2015 11:27 a.m., Joel wrote: When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS.

Re: Import paths do not work

2015-01-28 Thread Rikki Cattermole via Digitalmars-d-learn
On 29/01/2015 8:08 p.m., tcak wrote: I have a library that has many folders and D files in them. I do not want to list name of all module files one by one while compiling projects. So, I thought I could use -I flag while compiling. It says: -Ipath where to look for imports So, I made a

Re: Time from timestamp?

2015-01-30 Thread Rikki Cattermole via Digitalmars-d-learn
On 31/01/2015 11:18 a.m., Chris Williams wrote: I'm attempting to print a human-readable version of a timestamp. The timestamp is coming from an external service, via JSON. An example is: 1421865781342 Which I know to be: 2015-01-21T18:43:01.342Z The only method I see which takes an

Re: Time from timestamp?

2015-01-30 Thread Rikki Cattermole via Digitalmars-d-learn
On 31/01/2015 12:06 p.m., ketmar wrote: On Fri, 30 Jan 2015 22:38:20 +, Chris Williams wrote: Unix timestamps can be negative WUT?! O_O Looks like we are both thinking the usual case. The standard Unix time_t (data type representing a point in time) is a signed integer data type,

Re: How to tell an identifier is a module?

2015-01-26 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/01/2015 2:25 a.m., bearophile wrote: __traits(allMembers, mixin(__MODULE__)) also yields a module name like object, but then how can you find out that object is a module? This doesn't work: void main() { pragma(msg, is(int == int)); pragma(msg, is(object == module)); } Bye,

Re: Other libraries - web site link, and other thoughts

2015-01-26 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/01/2015 8:29 a.m., Laeeth Isharc wrote: At the moment it goes straight go code.dlang.org, which may be a bit overwhelming if you have just arrived at dlang.org and want to see what it can do. Is it worth changing to the library wiki write up page on libraries? And making sure link to

Re: simple dub question - avoiding creating a vibed project

2015-01-05 Thread Rikki Cattermole via Digitalmars-d-learn
On 5/01/2015 11:42 p.m., Laeeth Isharc wrote: Figured out a fix: versions: [VibeCustomMain], It is still mysterious as to why it is pulling in vibed though (I don't import it, and I didn't think ddbc did). https://github.com/mysql-d/mysql-native/blob/master/package.json

Re: simple dub question - avoiding creating a vibed project

2015-01-05 Thread Rikki Cattermole via Digitalmars-d-learn
On 5/01/2015 11:55 p.m., Laeeth Isharc wrote: On Monday, 5 January 2015 at 10:46:17 UTC, Rikki Cattermole wrote: On 5/01/2015 11:42 p.m., Laeeth Isharc wrote: Figured out a fix: versions: [VibeCustomMain], It is still mysterious as to why it is pulling in vibed though (I don't import it,

Re: How to do equivalent of npm install --save with dub?

2015-01-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/01/2015 2:01 p.m., Andrew Grace wrote: I am trying to play with D, but I'm getting stuck with the DUB package manager. If use DUB to download a package to my project, how do I get DUB to add what I downloaded to the dub.json file? I have tried DUB --fetch --cache=local http-parser (for

Re: vibe.d Subdirectory?

2015-01-14 Thread Rikki Cattermole via Digitalmars-d-learn
On 15/01/2015 12:40 a.m., seany wrote: I am new to vibe.d and plying a bit with it. I notice, that in case of Apache, there is a root directory, often by default under /var/www or /srv/http (resp. ftp) if you are using linux, and then every time the client sends a request, apache looks in to

Re: parse string as char

2015-02-08 Thread Rikki Cattermole via Digitalmars-d-learn
On 9/02/2015 3:40 p.m., Timothee Cour via Digitalmars-d-learn wrote: Is there a simple way to parse a string as a char? eg: unittest{ assert(parseChar(`a`)=='a'); assert(parseChar(`\n`)=='\n'); //NOTE: I'm looking at `\n` not \n // should also work with other forms of characters, see

Re: function and variable

2015-02-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/02/2015 4:28 p.m., Fyodor Ustinov wrote: Hi! I think this code should not be compiled without any warning: import std.stdio; void f(int a) { writeln(it's a function! : , a); } void main() { auto f = function (int a) {writeln(It's a variable! : , a);}; 5.f(); f(5); }

Re: Need extern (C) interface even though using Derelict GLFW

2015-01-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/01/2015 5:34 p.m., WhatMeWorry wrote: I've been translating C++, OpenGL, and GLUT code into D, Derelict OpenGL, and Derelict GLFW using: import derelict.opengl3.gl3; import derelict.glfw3.glfw3; auto window = glfwCreateWindow(800, 600, Shaders, null, null); etc. Things have been going

Re: Need extern (C) interface even though using Derelict GLFW

2015-01-04 Thread Rikki Cattermole via Digitalmars-d-learn
On 5/01/2015 9:30 a.m., WhatMeWorry wrote: On Sunday, 4 January 2015 at 09:02:48 UTC, Mike Parker wrote: On 1/4/2015 1:34 PM, WhatMeWorry wrote: Maybe GLFW callback functions can't handled through Derelict GLFW? And just to be clear, because the pointers to the callback functions are being

  1   2   3   4   5   6   7   8   9   >