std.zip for Binary example

2016-01-17 Thread locco via Digitalmars-d-learn
Hi :) I found this example: == import std.file: write; import std.string: representation; void main() { char[] data = "Test data.\n".dup; // Create an ArchiveMember for the test file. ArchiveMember am = new ArchiveMember(

Re: std.zip for Binary example

2016-01-17 Thread Sean Campbell via Digitalmars-d-learn
On Sunday, 17 January 2016 at 10:34:19 UTC, locco wrote: Hi :) I found this example: == import std.file: write; import std.string: representation; void main() { char[] data = "Test data.\n".dup; // Create an ArchiveMember f

core.time Duration how to get units in double/float format?

2016-01-17 Thread Borislav Kosharov via Digitalmars-d-learn
Seeing that TickDuration is being deprecated and that I should use Duration instead, I faced a problem. I need to get total seconds like a float. Using .total!"seconds" returns a long and if the duration is less than 1 second I get 0. My question is whats the right way to do it. Because I saw t

Re: core.time Duration how to get units in double/float format?

2016-01-17 Thread biozic via Digitalmars-d-learn
On Sunday, 17 January 2016 at 14:43:26 UTC, Borislav Kosharov wrote: Seeing that TickDuration is being deprecated and that I should use Duration instead, I faced a problem. I need to get total seconds like a float. Using .total!"seconds" returns a long and if the duration is less than 1 second

Re: Functions that return type

2016-01-17 Thread data pulverizer via Digitalmars-d-learn
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.) Could you please explain?

Re: core.time Duration how to get units in double/float format?

2016-01-17 Thread Borislav Kosharov via Digitalmars-d-learn
On Sunday, 17 January 2016 at 18:57:13 UTC, biozic wrote: On Sunday, 17 January 2016 at 14:43:26 UTC, Borislav Kosharov wrote: Seeing that TickDuration is being deprecated and that I should use Duration instead, I faced a problem. I need to get total seconds like a float. Using .total!"seconds"

Re: DUB - link error on Windows 10 64-bit

2016-01-17 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 17 January 2016 at 03:07:39 UTC, Mike Parker wrote: Have you verified that this is the only DMD installation on your path? Looks like the problem is not in dub - but the fact that a shared library in D requires a DllMain - as described in: http://forum.dlang.org/post/eokrmosskw

copying directories recursively

2016-01-17 Thread anonymous via Digitalmars-d-learn
TL;DR: Is there a simple way to copy directories recursively? My goal is to copy the directories ./src/dlang.org/{css,images,js} and their contents to ./ddo/{css,images,js}. Naively I tried this: void main() { import file = std.file; auto outputPath = "./ddo/"; foreach (dir;

Re: DUB - link error on Windows 10 64-bit

2016-01-17 Thread bachmeier via Digitalmars-d-learn
On Sunday, 17 January 2016 at 02:48:47 UTC, Mike Parker wrote: On Saturday, 16 January 2016 at 20:28:02 UTC, Dibyendu Majumdar wrote: I have installed DMD by unzipping the DMD archive (The installer does not work correctly on Windows 10). DUB installed as normal. What problem did you have

Can file name, module name, class name and variable name be the same?

2016-01-17 Thread WhatMeWorry via Digitalmars-d-learn
file 1: camera.d --- module camera; class Camera { public: // Camera Attributes vec3 position = vec3(0.0f, 0.0f, 0.0f); . . . }; --- file 2: main.d --- module main; import camera; Camera camera; // Compile error (1) --