Re: Startup files for STM32F4xx

2015-04-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/04/2015 12:54 p.m., Jens Bauer wrote: ... I now succeeded in making a mirror on GitHub: https://github.com/jens-gpio/STM32F4xx (It was absolutely tedious, because the tutorial on GitHub didn't work for me; I haven't yet added automatic mirroring; hopefully I'll be able to figure it out).

Re: Startup files for STM32F4xx

2015-04-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/04/2015 5:07 p.m., Jens Bauer wrote: On Saturday, 25 April 2015 at 04:21:06 UTC, Martin Nowak wrote: The STM peripheral library really sux, verbose boilerplate for the simplest stuff and no type safety for the enums (find the difference of GPIO_PIN4 and GPIO_PinSource4 via debugging). I

Re: Startup files for STM32F4xx

2015-04-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 23/04/2015 9:54 p.m., Jens Bauer wrote: On Thursday, 23 April 2015 at 04:59:47 UTC, Rikki Cattermole wrote: On 23/04/2015 4:53 p.m., Jens Bauer wrote: On Thursday, 23 April 2015 at 04:48:16 UTC, Rikki Cattermole wrote: Ehh, maybe you should setup a e.g. vm of e.g. Linux Mint and use e.g.

Re: Startup files for STM32F4xx

2015-04-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 23/04/2015 4:53 p.m., Jens Bauer wrote: On Thursday, 23 April 2015 at 04:48:16 UTC, Rikki Cattermole wrote: On 23/04/2015 2:41 p.m., Jens Bauer wrote: ... Unfortunately I have no 'read-only' checkout on my git-server, but I'll be happy to make a tar.bz2 archive upon request. Make a github

Re: Startup files for STM32F4xx

2015-04-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 23/04/2015 2:41 p.m., Jens Bauer wrote: I've now created a few startup files for the STM32F4xx microcontrollers. You can grab them here ... http://d.gpio.dk/cgi-bin/gitweb.cgi ... Unfortunately I have no 'read-only' checkout on my git-server, but I'll be happy to make a tar.bz2 archive upon

Re: readText for large files on Windows.

2015-04-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/04/2015 7:06 a.m., Kenny wrote: This function works fine for large text files like 100Mb or 1Gb but failed when I tried to read 6Gb file. This happens on Windows x64. The possible reason that it uses read(in char[], size_t) function and on windows it calls GetFileSize. This function

Re: std.array.split - Template instantiating error

2015-04-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 18/04/2015 8:08 p.m., nrgyzer wrote: Hi, I've the following source: import std.array : split; import std.stdio : writeln; void main() { string myString = Hello World; string[] splitted = myString.split( ); } But when I compile the code above, I'm getting the following error:

Re: GC: Memory keeps growing

2015-04-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 16/04/2015 12:03 a.m., Chris wrote: On Wednesday, 15 April 2015 at 11:48:26 UTC, Rikki Cattermole wrote: On 15/04/2015 11:44 p.m., Chris wrote: My garbage collected app starts with ~10 MB in memory, however with every execution of code it grows by at least 0.2 MB (or more depending on the

Re: GC: Memory keeps growing

2015-04-15 Thread Rikki Cattermole via Digitalmars-d-learn
On 15/04/2015 11:44 p.m., Chris wrote: My garbage collected app starts with ~10 MB in memory, however with every execution of code it grows by at least 0.2 MB (or more depending on the input). Although I can see memory being freed (say it goes up to 32 MB and drops to 14 MB), it keeps on growing

Re: stdout redirect

2015-04-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/04/2015 1:12 a.m., FreeSlave wrote: On Sunday, 12 April 2015 at 04:39:06 UTC, Philip Stuckey wrote: why not: import std.stdio; stdout = File(args[4], w+); stderr = File(args[4], w+); It just replaces the object, not redirects output. E.g. if you use printf somewhere it will use stdout,

Re: vibed - best approach to manage central state (cached records)

2015-04-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/04/2015 7:24 a.m., Laeeth Isharc wrote: Hi. Two questions: 1. On startup I load various indexes from file storage into memory in the shared static this segment, and I would like to access these from threads serving web requests. The data can be considered immutable once loaded. What is

Re: seeking D wisdom

2015-04-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/04/2015 2:22 a.m., John S wrote: On Saturday, 11 April 2015 at 03:27:32 UTC, Rikki Cattermole wrote: I'm currently writing a web server[0]. I do have a web service framework waiting for it. It is based upon my previous one (Cmsed). If you want to help with the web server, please let me

Re: seeking D wisdom

2015-04-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/04/2015 6:07 a.m., John S wrote: Hello World, I am hoping that someone can lend some advice. I am not really a programmer but I studied programming in the late 90s/early 2000 time period. I started with QBasic, then I learned HTML, CSS, JavaScript. I dabbled in C++ using books and

Re: Managing memory usage at Compile Time with DMD

2015-04-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 9/04/2015 9:49 p.m., wobbles wrote: So, I'm writing a poker AI bot. The idea was to generate a lookup table of all the poker hands using CTFE so runtime can be as quick as possible (as the bot has a very small amount of time to act). There are a LOT of calculations though, many millions of

Re: return the other functions of the void main()

2015-04-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 9/04/2015 11:22 p.m., John Colvin wrote: On Thursday, 9 April 2015 at 11:07:05 UTC, Rikki Cattermole wrote: On 9/04/2015 11:03 p.m., Dennis Ritchie wrote: Hi, Is it allowed in D similar designs? void main() { import std.stdio; return writeln(Hello, world!); } Sure when: import

Re: return the other functions of the void main()

2015-04-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 9/04/2015 11:03 p.m., Dennis Ritchie wrote: Hi, Is it allowed in D similar designs? void main() { import std.stdio; return writeln(Hello, world!); } Sure when: import std.traits : ReturnType; import std.stdio : writeln; static assert(is(ReturnType!writeln == int));

Re: Creating a microcontroller startup file

2015-04-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/04/2015 8:38 a.m., Jens Bauer wrote: On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote: Question number 1: How can a C subroutine be made optional, so it's called only if it linked ? Question 1 might be answered by the following thread:

Re: Troubles with devisualization/window

2015-04-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/04/2015 10:34 a.m., ddos wrote: it's getting warmer, window doesnt freeze anymore and opengl calls don't crash the window, but it's still all white after calling glClearColor(1,0,1,1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); updated src:

Re: Troubles with devisualization/window

2015-04-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/04/2015 10:07 a.m., ddos wrote: Hi! i'm trying to get devisualization/window [1] working with some simple opengl calls. I have created a windows with opengl context using Window window = new Window(800, 600, My window!w, WindowContextType.Opengl); If i run writeln(type: , context.type);

Re: Troubles with devisualization/window

2015-04-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 7/04/2015 12:10 p.m., ddos wrote: On Monday, 6 April 2015 at 22:56:15 UTC, Rikki Cattermole wrote: On 7/04/2015 10:34 a.m., ddos wrote: it's getting warmer, window doesnt freeze anymore and opengl calls don't crash the window, but it's still all white after calling glClearColor(1,0,1,1);

Re: linking C library with D, creating a OpenVG D port

2015-04-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/04/2015 1:00 a.m., ddos wrote: progress ... i think in some forum posts i've read 64bit dmd uses a differnt linker which supports coff atleast i can now link my app in 64bit mode without errors dmd -m64 source/app.d OpenVG.lib also an exported test function prints to stdout, so my problem

Re: Placing variable/array in a particular section

2015-04-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/04/2015 3:08 a.m., Jens Bauer wrote: On Friday, 3 April 2015 at 13:58:21 UTC, Jens Bauer wrote: On Friday, 3 April 2015 at 13:37:50 UTC, Rikki Cattermole wrote: On 4/04/2015 2:12 a.m., Jens Bauer wrote: Is there a way of setting the target section for a variable or an array ?

Re: Placing variable/array in a particular section

2015-04-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/04/2015 2:12 a.m., Jens Bauer wrote: Today I finally succeeded in building my first Hello World D program (after fixing the endian problem). Is there a way of setting the target section for a variable or an array ? Eg. the equivalent way of doing this using gcc is:

Re: Speed of horizontal flip

2015-04-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 2/04/2015 2:52 a.m., tchaloupka wrote: Hi, I have a bunch of square r16 and png images which I need to flip horizontally. My flip method looks like this: void hFlip(T)(T[] data, int w) { import std.datetime : StopWatch; StopWatch sw; sw.start(); foreach(int i; 0..w) {

Re: Speed of horizontal flip

2015-04-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/04/2015 4:27 a.m., John Colvin wrote: On Thursday, 2 April 2015 at 11:49:44 UTC, Rikki Cattermole wrote: On 3/04/2015 12:29 a.m., John Colvin wrote: On Thursday, 2 April 2015 at 09:55:15 UTC, Rikki Cattermole wrote: On 2/04/2015 10:47 p.m., Rikki Cattermole wrote: On 2/04/2015 2:52

Re: Speed of horizontal flip

2015-04-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 3/04/2015 12:29 a.m., John Colvin wrote: On Thursday, 2 April 2015 at 09:55:15 UTC, Rikki Cattermole wrote: On 2/04/2015 10:47 p.m., Rikki Cattermole wrote: On 2/04/2015 2:52 a.m., tchaloupka wrote: Hi, I have a bunch of square r16 and png images which I need to flip horizontally. My flip

Re: Speed of horizontal flip

2015-04-02 Thread Rikki Cattermole via Digitalmars-d-learn
On 2/04/2015 10:47 p.m., Rikki Cattermole wrote: On 2/04/2015 2:52 a.m., tchaloupka wrote: Hi, I have a bunch of square r16 and png images which I need to flip horizontally. My flip method looks like this: void hFlip(T)(T[] data, int w) { import std.datetime : StopWatch; StopWatch sw;

Re: How to avoid code duplication?

2015-04-01 Thread Rikki Cattermole via Digitalmars-d-learn
On 1/04/2015 7:19 p.m., Suliman wrote: Rikki, could you explain? I did not understand where it can help me Here is some example code. While I've only implemented one InputRange!string instance. You would probably have one, for just zip's and another raw text files. Keep in mind it returns

Re: How to avoid code duplication?

2015-04-01 Thread Rikki Cattermole via Digitalmars-d-learn
On 1/04/2015 6:15 p.m., Suliman wrote: The situation is next: I have got the function that get arrays of lognames and logfullname: void loginsert(string [] lognames, string [] logfullname) { if(logfullname[i].endsWith(txt)) { auto file = File(logfullname[i], r);

Re: Use libusb in windows system

2015-03-31 Thread Rikki Cattermole via Digitalmars-d-learn
On 1/04/2015 2:54 a.m., Vitaly wrote: Hi, I am new in this language. Have anybody dynamic linking libusb with dmd2 on windows. I know ther is a project libusb-d but this project is for posix system. As I understand for windows I nid to add .lib file to project, but there is a problem with COFF

Re: Specify an entire directory tree for string imports

2015-03-29 Thread Rikki Cattermole via Digitalmars-d-learn
On 30/03/2015 3:51 p.m., Baz wrote: On Monday, 30 March 2015 at 02:13:22 UTC, Alex Parrill wrote: I have a directory structure like this: . | test.d | \---test | test1.txt | \---subfolder test2.txt I am running test.d using this

Re: Looking for a little help with the win32 headers

2015-03-25 Thread Rikki Cattermole via Digitalmars-d-learn
On 26/03/2015 5:52 p.m., Belly wrote: Hello, just installed D today. I have this code: import std.stdio; import win32.windef; import win32.winbase; void main() { LPSTR lpBuffer; PDWORD lpnSize; int result = GetComputerNameA(lpBuffer, lpnSize); writeln(result); } It passes

Re: Need help with DLANGUI

2015-03-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/03/2015 2:31 a.m., Eric wrote: BTW, why do you need FreeImage to create image? Isn't it just possible inside dlangui? This is basically my question. Is there a drawing engine that can draw lines, circles, and shapes as well as single pixels? -Eric If you have some way to draw you

Re: Is there websocket client implementation for D

2015-03-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/03/2015 6:55 a.m., Ilya Korobitsyn wrote: Hello! Is there any websocket client implementation in D? I know there is WS server as a part of vibe.d, but it does not seem to include client. Maybe there are some library bindings that I've missed? Thank you, Ilya It appears you are on your

Re: using vibe.d to parse json

2015-03-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/03/2015 6:36 p.m., Laeeth Isharc wrote: On Tuesday, 24 March 2015 at 04:53:39 UTC, Laeeth Isharc wrote: Hi. struct RawGoogleResults { string version_; string status; string sig; string[string][][string] table; } enum json =

Re: Position of unittest attributes

2015-03-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 22/03/2015 10:29 p.m., Stefan Frijters wrote: So I was trying to add some attributes to unittests in my code, but apparently they are only allowed *before* the unittest keyword, which I think makes it much harder to quickly see the unittests when scrolling through the code: void foo() @safe

Re: how to pass a ubyte[] to c interface?

2015-03-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/03/2015 7:47 p.m., zhmt wrote: On Friday, 13 March 2015 at 06:39:31 UTC, Rikki Cattermole wrote: On 13/03/2015 7:35 p.m., zhmt wrote: ubyte[] arr ; I pass the arr.ptr to c program, it fails silently. Is there any way to cast a ubyte[] to a clang pointer? Theoretically this should

Re: how to pass a ubyte[] to c interface?

2015-03-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/03/2015 7:35 p.m., zhmt wrote: ubyte[] arr ; I pass the arr.ptr to c program, it fails silently. Is there any way to cast a ubyte[] to a clang pointer? Theoretically this should work. D: void func(ubyte[] value) { func(value.length, value.ptr); } extern(C) void func(size_t

Re: Memoization in compile-time

2015-03-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/03/2015 2:23 p.m., Dennis Ritchie wrote: Is it possible to run this code in compile-time? import std.stdio, std.functional; ulong fact(ulong n) { alias mfact = memoize!fact; return n 2 ? 1 : n * mfact(n - 1); } void main() { writeln(fact(10)); } In CommonLisp variable

Re: Template. C++ to D

2015-03-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/03/2015 1:02 a.m., Dennis Ritchie wrote: Hi. How to rewrite this code on D? #include string #include iostream template typename T T foo(const T val) { return val; } template typename T, typename ...U T foo(const T val, const U ...u) { return val + foo(u...); } int main() {

Re: is eC alot like D?

2015-03-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/03/2015 4:16 p.m., Taylor Hillegeist wrote: So I found http://ec-lang.org/ it seems alot like D, But it has a company backing it. It just seems interesting. There is almost no meta programming support. Let alone CTFE. And no generics in the form of e.g. Java's is not the same as D's

Re: 32/64 bit in Phobos

2015-03-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/03/2015 2:49 p.m., Jason den Dulk wrote: Hi I noticed that in 32bit, many Phobos functions use int and uint, while in 64bit, they use long and ulong. As a result I am having some difficulty in writing code that works for both 32 bit and 64 bit. Is there an existing mechanism that allows

Re: how to read some in vibe.d tcpconnection?

2015-03-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 6/03/2015 10:30 p.m., zhmt wrote: I am forwarding data from client to another server, if the client send data to server,I want to forward that to another server in time. So, if the server recieves nothing it will wait, if it receive some data , forward them to another server immediately. I

Re: one problem at dlang.org site

2015-02-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/02/2015 1:58 a.m., novice2 wrote: sorry - i cant find where i can post this. bugtracker have no dlang.org product. when i click to left menu Standart Library - std - windows - charset then i have error The requested URL /phobos/std_windows_charset.html was not found on this server.

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: D : dmd vs gdc : which one to choose?

2015-02-19 Thread Rikki Cattermole via Digitalmars-d-learn
On 20/02/2015 3:11 p.m., ketmar wrote: On Fri, 20 Feb 2015 02:08:19 +, ketmar wrote: On Fri, 20 Feb 2015 13:29:09 +1300, Rikki Cattermole wrote: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: [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: 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: 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: 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: setup problem wih dub

2015-01-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/01/2015 4:48 p.m., Jason den Dulk wrote: Hi. Package in question: fpdf Dub version I'm using: 0.9.22 DMD version: 2.066.1 (64 bit) Platform: Fedora 19 (64-bit). I created the fpdf package, and it is dependant on the imageformats package, but it won't compile. When I place a copy of

Re: What does dmd 2.066 want from me?

2015-01-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/01/2015 9:10 a.m., Artem Tarasov wrote: I'm trying to compile my software with the latest compiler, and it spits out the following error: $ make ... rdmd --force --build-only -IBioD -g -L-Lhtslib -L-l:libhts.a -L-l:libphobos2.a -ofbuild/sambamba.o main.d ...

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: 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

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: 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: 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: 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: [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: 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: 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-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: 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: 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: 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: @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: 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: 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

<    5   6   7   8   9   10   11   >