Re: How to embed static strings to a D program?

2017-10-15 Thread evilrat via Digitalmars-d-learn
On Monday, 16 October 2017 at 05:34:13 UTC, Ky-Anh Huynh wrote: Hello, I want to use some static contents in my program, e.g, a CSS file, a long listing. To help deployment process I'd like to have them embedded in the final binary file. Is there any convenient way to support this? Maybe I n

How to embed static strings to a D program?

2017-10-15 Thread Ky-Anh Huynh via Digitalmars-d-learn
Hello, I want to use some static contents in my program, e.g, a CSS file, a long listing. To help deployment process I'd like to have them embedded in the final binary file. Is there any convenient way to support this? Maybe I need a tool/library to load file contents and generate D-code at

Re: Why isn't IID_ITaskbarList3 defined?

2017-10-15 Thread evilrat via Digitalmars-d-learn
On Sunday, 15 October 2017 at 15:13:09 UTC, Nieto wrote: I'm trying to write a blinding and I found both IID_ITaskbarList and IID_ITaskbarList2 are defined but IID_ITaskbarList3 isn't. Any reason why it isn't defined? sorry if it sounds such a naive question, I'm new to COM and D interop. I kn

Re: Temporary objects as function parameters or when-is-this-shit-going-to-end?

2017-10-15 Thread ketmar via Digitalmars-d-learn
Michael V. Franklin wrote: In fact, you might want to propose matching bounty from the community on this specific bug to encourage funding. For example, make an announcement on the forum that anyone who places a bounty on the bug in question will receive a matching contribution from you. May

Re: Temporary objects as function parameters or when-is-this-shit-going-to-end?

2017-10-15 Thread Michael V. Franklin via Digitalmars-d-learn
On Monday, 16 October 2017 at 03:29:03 UTC, Michael V. Franklin wrote: My experience says that BountySource almost doesn't help. It works if the bounty is worth someone sacrificing their free time to do the work. For example, I'd attempt fixing the bug if the bounty were greater than $200,

Re: Temporary objects as function parameters or when-is-this-shit-going-to-end?

2017-10-15 Thread Michael V. Franklin via Digitalmars-d-learn
On Friday, 13 October 2017 at 11:54:38 UTC, Jack Applegame wrote: On Friday, 13 October 2017 at 11:21:48 UTC, Biotronic wrote: BountySource[2] lets you do basically exactly that. My experience says that BountySource almost doesn't help. It works if the bounty is worth someone sacrificing thei

Re: For fun: Expressive C++ 17 Coding Challenge in D

2017-10-15 Thread Christian Köstlin via Digitalmars-d-learn
Another solution using dlangs builtin csv support for reading. import std.csv; import std.file; import std.algorithm : map; import std.range; string csvWrite(Header, Rows)(Header header, Rows rows) { return header.join(",") ~ "\n" ~ rows.map!(r => header.map!(h => r[h]).join(",")).join("\n");

Re: Is there an opposite of .toString()?

2017-10-15 Thread Faux Amis via Digitalmars-d-learn
On 2017-10-14 05:47, Jonathan M Davis wrote: On Saturday, October 14, 2017 00:18:35 myst via Digitalmars-d-learn wrote: I'm sorry if this has been answered already, it seems like a very basic question. There is .toString() method convention for printing, but I can not find anything alike for re

Why isn't IID_ITaskbarList3 defined?

2017-10-15 Thread Nieto via Digitalmars-d-learn
I'm trying to write a blinding and I found both IID_ITaskbarList and IID_ITaskbarList2 are defined but IID_ITaskbarList3 isn't. Any reason why it isn't defined? sorry if it sounds such a naive question, I'm new to COM and D interop. I knew a thing or two about PInvokes with C#. Then how do I

Re: debugging in vs code on Windows

2017-10-15 Thread Dmitry via Digitalmars-d-learn
On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: Has anyone been able to debug in VS code on Windows? What am I doing wrong? Yep, it work for me. How do you start debugging? I noticed that the bottom button (small bug) at status bar doesn't work for me. But when I use Debug → Start

Re: How to overload with enum type?

2017-10-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, October 15, 2017 08:47:42 Domain via Digitalmars-d-learn wrote: > void f(int i) > { > writeln("i"); > } > > void f(E)(E e) if (is(E == enum)) > { > writeln("e"); > } > > enum E { A } > E e = E.A; > f(e);// output i > > How can I overload with enum type? I'd strongly advise

Re: How to overload with enum type?

2017-10-15 Thread Domain via Digitalmars-d-learn
On Sunday, 15 October 2017 at 08:47:42 UTC, Domain wrote: void f(int i) { writeln("i"); } void f(E)(E e) if (is(E == enum)) { writeln("e"); } enum E { A } E e = E.A; f(e);// output i How can I overload with enum type? I know I can do that with this: void f(T)(T i) if (is(T == in

How to overload with enum type?

2017-10-15 Thread Domain via Digitalmars-d-learn
void f(int i) { writeln("i"); } void f(E)(E e) if (is(E == enum)) { writeln("e"); } enum E { A } E e = E.A; f(e);// output i How can I overload with enum type?

Re: Assert and undefined behavior

2017-10-15 Thread Timon Gehr via Digitalmars-d-learn
On 14.10.2017 23:36, kdevel wrote: On Saturday, 14 October 2017 at 09:32:32 UTC, Timon Gehr wrote: Also, UB can and does sometimes mean that the program can execute arbitrary code. It's called "arbitrary code execution": https://en.wikipedia.org/wiki/Arbitrary_code_execution This confuses dif