Re: Object.factory fails for static libraries

2016-06-05 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 4 June 2016 at 16:12:04 UTC, Andre Pany wrote: Hi, I try to create objects by using the factory method in a static library scenario. ... My windows batch file looks like this: dmd base -lib dmd child -lib base.lib dmd main base.lib child.lib main PAUSE All assertions fails.

Object.factory fails for static libraries

2016-06-04 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to create objects by using the factory method in a static library scenario. file base.d --- module base; class Base { } Object createObject(string name) { return Object.factory(name); } --- file child.d

Re: Object.factory fails for static libraries

2016-06-05 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 5 June 2016 at 08:40:18 UTC, Andre Pany wrote: On Saturday, 4 June 2016 at 16:12:04 UTC, Andre Pany wrote: Hi, I try to create objects by using the factory method in a static library scenario. ... I just validated, the same issue also occurs on ubuntu linux with the recent dmd

Behavior of __FILE__ in mixin template

2016-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, I thought a mixin template is copied into the place where the mixin statement exists and then the coding is evaluated. This seems not to be true for __FILE__ I have a module form, which has a class Form. This module also contains following mixin template mixin template formTemplate() {

Re: Behavior of __FILE__ in mixin template

2016-06-22 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 17:52:26 UTC, Ali Çehreli wrote: On 06/22/2016 10:07 AM, Andre Pany wrote: > Hi, > > I thought a mixin template is copied into the place where the mixin > statement > exists and then the coding is evaluated. > This seems not to be true for __FILE__ Apparently its

Different struct sizeof between linux and windows

2016-06-17 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to write a wrapper for a library. I translated the C++ header coding. While the wrapper is working fine in linux, on windows the library complains the struct size is too small while calling it. This is the reduced example: import core.stdc.time: time_t; import std.stdio;

Re: Different struct sizeof between linux and windows

2016-06-17 Thread Andre Pany via Digitalmars-d-learn
On Friday, 17 June 2016 at 07:11:28 UTC, Vladimir Panteleev wrote: On Friday, 17 June 2016 at 06:54:36 UTC, Andre Pany wrote: Is this behavior correct? Yes. time_t is defined as C long on Linux (meaning it'll be 64-bit in 64-bit programs), however it's always 32-bit on the Windows C

Re: Does D has any support for thunks?

2016-06-25 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 25 June 2016 at 17:26:03 UTC, Andre Pany wrote: On Saturday, 25 June 2016 at 16:05:30 UTC, Vladimir Panteleev wrote: On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote: Does D/Phobos has any support for thunks? Made this a while ago:

Re: Does D has any support for thunks?

2016-06-25 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 25 June 2016 at 16:05:30 UTC, Vladimir Panteleev wrote: On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote: Does D/Phobos has any support for thunks? Made this a while ago: http://stackoverflow.com/a/8656294/21501 Thanks, I had a look. Unfortunately it doesn't compile

Does D has any support for thunks?

2016-06-25 Thread Andre Pany via Digitalmars-d-learn
Hi everyone, I have some issue with win32 function SetWindowsHookEx. For this specific funtion there is no possibility to pass extra data (pointer to a class instance to be called) to the callback function. The general solution seems to use thunks. I found s.th. for c++:

Re: Does D has any support for thunks?

2016-06-25 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 25 June 2016 at 14:06:51 UTC, John wrote: On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote: [...] This will only work on X86: version(X86) struct FunctionPtr(TDelegate) if (is(TDelegate == delegate)) { [...] Thanks a lot John, that's fantastic. Kind regards André

Re: string mixin and alias

2016-07-29 Thread Andre Pany via Digitalmars-d-learn
On Friday, 29 July 2016 at 12:11:44 UTC, pineapple wrote: On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote: Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) =

string mixin and alias

2016-07-29 Thread Andre Pany via Digitalmars-d-learn
Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) = Alias!(mixin(generateCode(s))); string generateCode(string s){return "";} void main() { enum s = "a = 2 + 3; b = 4 +

alias to function literal, call without () not possible

2016-08-03 Thread Andre Pany via Digitalmars-d-learn
Hi, I just stumbled over this behavior. I am not sure whether the behavior is correct or not. alias foo = () => new Object; void bar(Object o){} void main() { auto n1 = foo; bar(foo); } While first line in main is working fine, second line does not compile due to missing ().

Initialize array of objects not work

2016-08-03 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to initialize an array of objects. The methods (linear/equals/) returns object of different classes, but all implement a common interface "Element". Element[] elements = quadraticCoefficient(1)~linearCoefficient(2)~equals()~constant(1); I tried different casts and different

Re: Initialize array of objects not work

2016-08-03 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 3 August 2016 at 18:34:02 UTC, Ali Çehreli wrote: On 08/03/2016 10:58 AM, Andre Pany wrote: > [...] (linear/equals/) > [...] common > [...] quadraticCoefficient(1)~linearCoefficient(2)~equals()~constant(1); [...] Thanks a lot Ali. Kind regards André

Re: alias to function literal, call without () not possible

2016-08-03 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 3 August 2016 at 18:15:23 UTC, Anonymouse wrote: On Wednesday, 3 August 2016 at 17:16:10 UTC, Andre Pany wrote: [...] [...] ...is an alias for a delegate/function returning an Object. It is analogous to [...] [...] ...is a function accepting an Object parameter. In main

Re: Initialize array of objects not work

2016-08-04 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 4 August 2016 at 13:48:46 UTC, Steven Schveighoffer wrote: On 8/3/16 2:34 PM, Ali Çehreli wrote: void main() { Element[] elements = cast(Element[])[ quadraticCoefficient(1), linearCoefficient(2), equals(), constant(1) ]; is the cast necessary? I assumed the compiler would

Re: Windows 10 Linux Bash Shell: Compiling linux app on windows

2016-08-06 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 6 August 2016 at 17:26:05 UTC, Rattle Weird Hole wrote: ld must be found in the environment ? Yes ld was missing, by installing the build-essentials dmd is running fine: sudo apt-get install build-essential Kind regards André

Windows 10 Linux Bash Shell: Compiling linux app on windows

2016-08-06 Thread Andre Pany via Digitalmars-d-learn
Hi, I play around with the new windows 10 feature to run a linux sub system on windows. -> Installing dmd is working fine with the command curl -fsS https://dlang.org/install.sh | bash -s dmd -> Activating dmd is also working source ~/dlang/dmd-2.071.1/activate -> dmd can be started and shows

Re: UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 08:35:26 UTC, rikki cattermole wrote: On 07/09/2016 8:26 PM, Andre Pany wrote: [...] People have tried, this is the behavior as designed. The workaround is simple, don't use UFCS. I won't repeat the explanation or reasoning here, plenty of posts on it ;)

UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
Hi, I just noticed ufcs does not work with alias. Is this limitation needed? void foo(int a) {} void main() { alias bar = foo; 3.foo(); 3.bar(); } Last line fails with "no property 'bar' for type int. Should I open an enhancement request? Kind regards André

Re: UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 08:08:34 UTC, rikki cattermole wrote: On 07/09/2016 8:06 PM, Andre Pany wrote: Should I open an enhancement request? No. It works outside of the function (part of lookup rules). I simplified my example too much. Yes in the example above I can move the

Re: UFCS not working with alias

2016-09-08 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 8 September 2016 at 13:38:54 UTC, Steven Schveighoffer wrote: There is a workaround, identified by Vladimir Panteleev (https://blog.thecybershadow.net/2015/04/28/the-amazing-template-that-does-nothing/): import std.algorithm; bool fulfillsKeyPredicate(string s, string t)

Re: Macintosh text file with invalid line breaks are created

2016-09-28 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 28 September 2016 at 16:53:24 UTC, Vladimir Panteleev wrote: On Wednesday, 28 September 2016 at 06:52:51 UTC, Andre Pany wrote: Since the file is opened in text mode (which is the default), the C runtime automatically translates the single \n to a \r\n pair when writing the

Re: Cannot spawn process: npm start

2016-10-04 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 4 October 2016 at 18:41:16 UTC, FreeSlave wrote: On Tuesday, 4 October 2016 at 17:02:34 UTC, Adam D. Ruppe wrote: On Tuesday, 4 October 2016 at 16:55:22 UTC, Andre Pany wrote: Spawn process is working fine on linux, only on windows it doesn't work. I will create a bug report.

Cannot spawn process: npm start

2016-10-04 Thread Andre Pany via Digitalmars-d-learn
Hi, I need to call a Node application. node and npm are in windows path variable. I have following folder structure: ./app.d ./js/helloworld.js ./js/package.json content of helloworld.js: console.log('hello world'); content of package.json: { "name": "test", "version": "1.0.0",

Re: Cannot spawn process: npm start

2016-10-04 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 4 October 2016 at 13:18:45 UTC, Adam D. Ruppe wrote: Are you sure npm is in the path? From your shell, do `which npm` and see where it is coming from, you might want to use the full path to spawn process. Yes, npm is in path. From all directories I can execute npm/node

Re: JSON decode?

2016-09-27 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 27 September 2016 at 10:45:45 UTC, Andre Pany wrote: Hi, from a rest call I get a JSON with a strange format: {"DEPLOY_ATTRIBUTES":"{\n \"dependency-type\": \"soft\"\n}","MTA_METADATA":"{\n \"id\":... The sub objects are enclosed with quotes and there are a lot of line break

JSON decode?

2016-09-27 Thread Andre Pany via Digitalmars-d-learn
Hi, from a rest call I get a JSON with a strange format: {"DEPLOY_ATTRIBUTES":"{\n \"dependency-type\": \"soft\"\n}","MTA_METADATA":"{\n \"id\":... The sub objects are enclosed with quotes and there are a lot of line break characters. Also the quotes are escaped. I try to translate a

Macintosh text file with invalid line breaks are created

2016-09-28 Thread Andre Pany via Digitalmars-d-learn
Hi, following application creates a text file with strange content: void writeTextFile(string filePath, string text) { import std.stdio: File; auto f = File(filePath, "w"); f.write(text); f.close(); } void main() { import std.ascii: newline;

Dub for single files - issue

2016-10-09 Thread Andre Pany via Digitalmars-d-learn
Hi, I just changed to latest version of dub (1.0.0) due to a bug. I am really confused. I want to build an executable for a file. But the executable will not be created within the same directory but in a temp directory. I even tried to set the target path: /+ dub.sdl: name "app"

Missing functionality in std.process?

2016-10-14 Thread Andre Pany via Digitalmars-d-learn
Hi, I developed an application which starts and stops other applications like NodeJS HTTP server applications or Java Tomee Servlets. A typical NodeJS application has a process tree of 4-5 levels. I had to switch really fast from std.process functionality like kill and wait to OS specific

How to get sqlite3.lib x64?

2016-10-23 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to get sqlite3.lib for 64 Bit windows os. I tried implib with the def file and the 64 Bit dll: implib sqlite3_implib.lib sqlite3.def /system -> App crash (Windows 10) With the dll file defined: implib sqlite3_implib.lib sqlite3.dll /system -> Error message: Error(10): Error: cannot

Re: How to get sqlite3.lib x64?

2016-10-24 Thread Andre Pany via Digitalmars-d-learn
On Monday, 24 October 2016 at 07:20:34 UTC, Vadim Lopatin wrote: In https://github.com/buggins/ddbc there are 32bit and 64bit windows libs and dlls for sqlite3: https://github.com/buggins/ddbc/tree/master/libs Thanks a lot John and Vadim. Kind regards André

Curl namelookup_time

2016-11-23 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to get some cUrl measurements like name lookup time. pragma(lib, "curl"); import std.stdio, std.net.curl, etc.c.curl; void main() { Curl curl; curl.initialize(); curl.set(CurlOption.url, "https://www.google.com;); curl.perform();

Re: Curl namelookup_time

2016-11-23 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 13:59:29 UTC, Adam D. Ruppe wrote: On Wednesday, 23 November 2016 at 08:24:46 UTC, Andre Pany wrote: [...] curl_easy_getinfo expects the C handle, CURL*, but you are passing it the D struct, Curl. [...] Thank you Adam. I will create a bug report and

Re: Android Status

2017-01-14 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 21:13:07 UTC, Ignacious wrote: On Wednesday, 11 January 2017 at 03:49:42 UTC, Joakim wrote: On Tuesday, 10 January 2017 at 18:48:17 UTC, Ignacious wrote: [...] It's probably not easier, and in any case, android-x86 won't be supported, largely because I don't

Re: CTFE output is kind of weired

2017-07-09 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 9 July 2017 at 08:43:47 UTC, Andre Pany wrote: Thanks for all the answers and explanations. I will create an issue to make the assert output more readable. The first 5 times I didn't recognize the slice information at the end of the string and thought dmd isn't working at all

Re: dmd, vibe.d RAM usage when compiling.

2017-07-11 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 11 July 2017 at 16:04:52 UTC, SrMordred wrote: I never notice this before, but i tried to put a basic hello world from vibe.d (like the one that are in the dlang front page examples now), into the most basic instance on google cloud (with 600mb of RAM) and the compilation returned

CTFE output is kind of weired

2017-07-08 Thread Andre Pany via Digitalmars-d-learn
Hi, I use assert(false, tmp) to see the content of variable tmp as it seems there is no other way in CTFE. The output is kind of weired: app.d(6): Error: "1234\x0a5678\x0a"[4..10] app.d(17):called from here: test("1234\x0a5678\x0a") I wrote the source code on windows with a source

Re: CTFE output is kind of weired

2017-07-09 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 9 July 2017 at 06:48:30 UTC, Stefan Koch wrote: On Sunday, 9 July 2017 at 04:03:09 UTC, H. S. Teoh wrote: On Sat, Jul 08, 2017 at 03:09:09PM -0700, Ali Çehreli via Digitalmars-d-learn wrote: On 07/08/2017 02:29 PM, Andre Pany wrote: > I use assert(false, tmp) to see the content of

Re: traits compiles does not work for symbols from other modules

2017-07-25 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 08:30:43 UTC, ag0aep6g wrote: Works for me. What compiler are you using? I reduced the example too lot. The issue is occuring if there is also a package.d is involved. m1.d --- module m1; import sub; // Does not throw if replaced with:

Re: traits compiles does not work for symbols from other modules

2017-07-25 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 11:34:23 UTC, Andre Pany wrote: On Tuesday, 25 July 2017 at 08:30:43 UTC, ag0aep6g wrote: Works for me. What compiler are you using? I reduced the example too lot. The issue is occuring if there is also a package.d is involved. m1.d ---

traits compiles does not work for symbols from other modules

2017-07-24 Thread Andre Pany via Digitalmars-d-learn
Hi, I want to validate whether a class contains a specific attribute. I have the attribute name as compile time string. This string could either be a direct attribute of the class or a hierarchy (TextSettings.Font.Size). As example T is the class Label and p.name contains the text

Why can't typeof() be used in member method?

2017-07-26 Thread Andre Pany via Digitalmars-d-learn
Hi, I try to track down why some complex logic is not working. I think the root issue is that typeof() is not working in member methods. I reduced it to following example: app.d(16): Error: this for Left needs to be type TBounds not type app.A Failed: ["dmd", "-v", "-o-", "app.d", "-I."]

Re: Why can't typeof() be used in member method?

2017-07-26 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 17:04:59 UTC, Adam D. Ruppe wrote: On Wednesday, 26 July 2017 at 16:50:35 UTC, Andre Pany wrote: [...] FYI, you shouldn't use .stringof here. Just use `T` instead of `T.stringof`. [...] Thank you so much! Kind regards André

Re: Why can't typeof() be used in member method?

2017-07-26 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 14:05:12 UTC, Adam D. Ruppe wrote: On Wednesday, 26 July 2017 at 13:51:05 UTC, Andre Pany wrote: How can I fix this issue? I would just do typeof((new TBounds).Left) m; so then it is clear that you want a non-static member. In my productive scenario I

Re: Cannot implicitly convert expression (struct this)

2017-07-05 Thread Andre Pany via Digitalmars-d-learn
On Friday, 23 June 2017 at 15:52:10 UTC, Kagamin wrote: On Thursday, 22 June 2017 at 09:57:44 UTC, Andre Pany wrote: This line raises the error: TestStruct s2 = TestStruct(Reason.FU); Error: cannot implicitly convert expression ("Fu") of type Reason to InitialEnum!(Reason) While this line is

Re: alias and UDAs

2017-05-11 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 11 May 2017 at 10:57:22 UTC, Stanislav Blinov wrote: On Thursday, 11 May 2017 at 10:39:03 UTC, Andre Pany wrote: [...] It should've been alias FooList = @Flattened Foo[]; which will generate a compile-time error (UDAs not allowed for alias declarations). And then: static

alias and UDAs

2017-05-11 Thread Andre Pany via Digitalmars-d-learn
Hi, in this example, both asserts fails. Is my assumption right, that UDA on alias have no effect? If yes, I would like to see a compiler warning. But anyway, I do not understand why the second assertion fails. Are UDAs on arrays not allowed? import std.traits: hasUDA; enum Flattened;

alias this and struct initializer

2017-05-18 Thread Andre Pany via Digitalmars-d-learn
Hi, I have some issues with struct initializer and alias this. In following example 1 and 2 is working but there is a syntax error for 3. I think as case 2 is working case 3 should work also. For me case 3 is looking much nicer than case 1. What do you think? void main() { // Working

Cannot implicitly convert expression (struct this)

2017-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, I created a custom type which enables me to have enums which have in their initial state, the init value of their base type. Something similiar to Nullable... enum Reason : string {CO = "Co", FU = "Fu", CA = "Ca"} struct TestStruct {InitialEnum!Reason reason;} This line raises the

Is there s.th. like enforceSuffix for arrays (string)?

2017-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, i often need to check whether an array(string) ends with a specific text and if not I need to add this text. For example I have a variable url and / has to be added to the end in case it is missing. I want to write: ...new RegistryPackageSupplier(URL(url.enforceSuffix("/"))... Of

Re: alias this and struct initializer

2017-05-18 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 18 May 2017 at 12:56:09 UTC, Adam D. Ruppe wrote: On Thursday, 18 May 2017 at 08:40:39 UTC, Andre Pany wrote: [...] Nope, case 2 is assigning to an already constructed object and case 3 is constructing a new one. [...] Thanks for the explanation, that makes perfectly sense.

How to check whether a struct is templated?

2017-06-13 Thread Andre Pany via Digitalmars-d-learn
Hi, I loop through a structure during compile time and want to check whether a field of the structure is of type Nullable. Therefore I use the TemplateOf traits which works for Nullable fields but raises an error for fields which are structures and not templated. static if(is(T == struct)

Calling delegate in a dll callback fails silently

2017-06-16 Thread Andre Pany via Digitalmars-d-learn
Hi, my D application uses a Dll written in another language. In my D code I retrieve the address of a delegate as integer: int dgRef = cast(int) &(dg); This integer I pass to a function in the dll together with the address of a callback function. extern(C) static void notifyEventCallback(int

Re: Calling delegate in a dll callback fails silently

2017-06-17 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 17 June 2017 at 03:35:42 UTC, Adam D. Ruppe wrote: On Friday, 16 June 2017 at 22:17:07 UTC, Andre Pany wrote: [...] What is the type of dg there? This looks horribly, horribly wrong to me. [...] Thanks a lot for the explanation and the link. Now it makes sense why it not

readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Andre Pany via Digitalmars-d-learn
Hi, I want to read passwords from the console (should be work on windows / linux / macos). Adam Ruppe has a quite nice library (terminal.d) which allows to deactivating the echo to the console, which makes sense for passwords. But I do not get it working with terminal.d nor with std.stdio:

Re: D scripting

2017-09-05 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 19:44:40 UTC, EntangledQuanta wrote: Just an idea for you: in delphi you can set the properties of a component (a class with runtime reflection enabled) on runtime. You can even call the methods and events of a component. I build a Delphi Bridge for D (see

Re: D scripting

2017-09-06 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 21:41:35 UTC, EntangledQuanta wrote: On Tuesday, 5 September 2017 at 19:59:27 UTC, Andre Pany wrote: On Tuesday, 5 September 2017 at 19:44:40 UTC, EntangledQuanta wrote: Just an idea for you: in delphi you can set the properties of a component (a class with

Re: D scripting

2017-09-05 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 07:32:24 UTC, EntangledQuanta wrote: I would like to use D as a "scripting" language for my D app. There seems to be no such thing. Since we can include the D compiler in our distribution, it is easy to enable "plugin" capabilities, but directly interfacing

Re: I need library for QR codes generation.

2017-09-06 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 14:30:24 UTC, MGW wrote: I need library for generation of QR codes. Who knows, give the link. It seems google has an api to create QR codes: https://developers.google.com/chart/infographics/docs/qr_codes Kind regards André

Re: D scripting

2017-09-05 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 18:37:17 UTC, EntangledQuanta wrote: On Tuesday, 5 September 2017 at 08:13:02 UTC, Andre Pany wrote: On Tuesday, 5 September 2017 at 07:32:24 UTC, EntangledQuanta wrote: I would like to use D as a "scripting" language for my D app. There seems to be no such

dub cross compilation binary extension

2017-09-26 Thread Andre Pany via Digitalmars-d-learn
Hi, I had set up a cross compilation from Windows to Raspberry Pi using LDC and GCC toolchain. Almost everything is working fine. Dub creates a binary which is runnable on the Raspberry Pi. There is only 1 small issue. Dub creates the executable with the windows file extension ".exe". Is

Re: dub cross compilation binary extension

2017-09-29 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 04:08:39 UTC, Joakim wrote: On Tuesday, 26 September 2017 at 17:48:06 UTC, Andre Pany wrote: Hi, I had set up a cross compilation from Windows to Raspberry Pi using LDC and GCC toolchain. Almost everything is working fine. Dub creates a binary which is

Is prime missing in photos?

2017-09-29 Thread Andre Pany via Digitalmars-d-learn
Hi, Does Phobos have an isPrime function? I cannot find it in the library. I currently have a look at projecteuler.net problem no 7. Such a function makes it a lot easier to solve the problem. https://projecteuler.net/problem=7 Kind regards Andre

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Andre Pany via Digitalmars-d-learn
On Monday, 28 August 2017 at 22:28:18 UTC, Moritz Maxeiner wrote: On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but not if it is a struct. I would rather prefer a struct, but

Accessing outer class attribute from inner struct

2017-08-28 Thread Andre Pany via Digitalmars-d-learn
Hi, I build some framework to access Delphi components from D. Delphi supports property array access "StringGrid1.Columns[2]" which is translated in Delphi to a private method call "GetColumn(2)". I need to imitate this behavior in my D code. Therefore my TCustomGrid class has a inner struct

D Code to html

2017-08-23 Thread Andre Pany via Digitalmars-d-learn
Hi, how does the D syntax highlighting in e.g. https://dlang.org/blog/2017/08/23/d-as-a-better-c/ works? From reading the html source code I understand there is some functionality prettyprint but not how it is included and what I have to do to use it in my page. Kind regards André

Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 08:30:24 UTC, Moritz Maxeiner wrote: On Tuesday, 29 August 2017 at 07:59:40 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default

Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Andre Pany via Digitalmars-d-learn
On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default initialization is not feasible, as S.init can't know about any particular instance of C. I don't think there's any way for you to avoid using

Deprecation of toUTF16

2017-08-31 Thread Andre Pany via Digitalmars-d-learn
Hi, I have some problems to find out what to use instead of the deprecated toUTF16 function. I am calling a shared library written in Delphi. While this coding is working fine (with german ü) import std.utf: toUTF16; wstring ws = toUTF16(s); BSTR bStr = SysAllocStringLen(ws.ptr, cast(UINT)

Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 17 October 2017 at 15:02:29 UTC, Adam D. Ruppe wrote: Or try this newest commit https://github.com/adamdruppe/arsd/blob/master/terminal.d and see if it works better for you. Thank you Adam. The ascii thing was causing the issue in the windows console. Now it is working fine.

Dynamically import() files

2017-10-23 Thread Andre Pany via Digitalmars-d-learn
Hi, I have a folder "i18n" which contains message bundle files. For now it contains only the message bundle file written by the developer: "messagebundle.properties". During the translation process additional message bundle files will be added to github: messagebundle_en.properties

Re: Dynamically import() files

2017-10-23 Thread Andre Pany via Digitalmars-d-learn
On Monday, 23 October 2017 at 20:13:20 UTC, Igor wrote: On Monday, 23 October 2017 at 12:15:17 UTC, Andre Pany wrote: Hi, I have a folder "i18n" which contains message bundle files. For now it contains only the message bundle file written by the developer: "messagebundle.properties". [...]

Re: Issue with sc.ini within XMake build infrastructure

2017-11-02 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 2 November 2017 at 12:21:50 UTC, rikki cattermole wrote: Override the shipped sc.ini file with your own. Simple and effective solution. What I just found out, by calling the batch file "vcvars64.bat" from the visual studio folder it seems everything is already pre configured

Issue with sc.ini within XMake build infrastructure

2017-11-02 Thread Andre Pany via Digitalmars-d-learn
Hi, I have a windows slave on which the dmd archive is extracted and dub is executed using build scripts. The windows slave has Visual Studio 2017 installed. I would like to switch from OMF to COFF executables to also allow 64 bit compilations. My issue is, there is no way to install DMD

Re: Issue with sc.ini within XMake build infrastructure

2017-11-02 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 2 November 2017 at 13:01:05 UTC, rikki cattermole wrote: On 02/11/2017 1:56 PM, Andre Pany wrote: On Thursday, 2 November 2017 at 12:21:50 UTC, rikki cattermole wrote: Override the shipped sc.ini file with your own. Simple and effective solution. What I just found out, by

Re: call Pascal DLL functions from D

2017-10-25 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 25 October 2017 at 03:12:56 UTC, Oleg B wrote: Hello. I have DLL written on Pascal and "headers" for use it (types and functions signatures definitions). How I can port "headers" to D? [...] Hi, this thread might be interesting for you, if you use Delphi

Re: dub optional dependency

2017-10-29 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 29 October 2017 at 03:26:14 UTC, Mike Parker wrote: On Sunday, 29 October 2017 at 01:55:22 UTC, evilrat wrote: This is dub design choice, optional requires manual fetching(dub fetch 'package'). I don't see other options, but you can try hack this using 'preBuildCommands' by

Building dmd/druntime on windows issue

2018-05-10 Thread Andre Pany via Digitalmars-d-learn
Hi, I follow the instructions from the wiki to build dmd/druntime from source on windows. https://wiki.dlang.org/Building_under_Windows Building dmd ends with following text: --- copy ..\generated\windows\release\32\dmd.exe . 1 file copied. make -fwin32.mak

Re: Building dmd/druntime on windows issue

2018-05-12 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 10 May 2018 at 22:01:25 UTC, Seb wrote: On Thursday, 10 May 2018 at 18:38:30 UTC, Andre Pany wrote: Hi, I follow the instructions from the wiki to build dmd/druntime from source on windows. https://wiki.dlang.org/Building_under_Windows [...] Which DMD/druntime do you try to

Re: Building dmd/druntime on windows issue

2018-05-11 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 10 May 2018 at 22:01:25 UTC, Seb wrote: On Thursday, 10 May 2018 at 18:38:30 UTC, Andre Pany wrote: Hi, I follow the instructions from the wiki to build dmd/druntime from source on windows. https://wiki.dlang.org/Building_under_Windows [...] Which DMD/druntime do you try to

Re: "Start a Minimal web server" example do not work.

2018-05-08 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 8 May 2018 at 13:33:51 UTC, drug wrote: 08.05.2018 16:23, BoQsc пишет: On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote: On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote: On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote: On Tuesday, 8 May 2018 at 12:13:56 UTC,

Re: fft and isPowerOf2?

2018-05-17 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 17 May 2018 at 13:36:39 UTC, kdevel wrote: On Thursday, 17 May 2018 at 12:34:25 UTC, Andre Pany wrote: this applications throws an error in std.numeric (Line 2826). => assert(isPowerOf2(range.length)); Isn't it possible to give an arbitrary length of data to fft like in numpy?

fft and isPowerOf2?

2018-05-17 Thread Andre Pany via Digitalmars-d-learn
Hi, this applications throws an error in std.numeric (Line 2826). => assert(isPowerOf2(range.length)); --- module std.numeric void fftImplPureReal(Ret, R)(R range, Ret buf) const in { assert(range.length >= 4); assert(isPowerOf2(range.length)); } ---

How to pass --DRT-covopt to dub test?

2018-01-10 Thread Andre Pany via Digitalmars-d-learn
Hi, I have some issues to find out how I can pass --DRT-covopt to dub test. I am pretty sure this should work, but dub doesn't like it: dub test --coverage -- --DRT-covopt "dstpath:./cov" ... Running .\cov-sample.exe dstpath:./cov ... Is there s.th. I miss? Kind regards André

curl_mime_init: How to get curl handle?

2018-01-25 Thread Andre Pany via Digitalmars-d-learn
Hi, I need to send multipart form data using curl. Until now I build the message body myself according to the HTML RFC but it is getting complex with large files causing Out Of Memory Exceptions. Low level curl supports multipart form data and I think I copied the C headers accordingly. The

MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread Andre Pany via Digitalmars-d-learn
Hi, in my application I create a zip archive with a size of ~ 400 MB and after that I read the archive. While trying to read the archive, there is an error: std.windows.syserror.WindowsException@std\mmfile.d(267): MapViewOfFileEx: Not enough storage is available to process this command.

Re: MapViewOfFileEx: Not enough storage is available to process this command.

2018-01-26 Thread Andre Pany via Digitalmars-d-learn
On Friday, 26 January 2018 at 12:19:10 UTC, rikki cattermole wrote: Could be heap fragmentation to who knows what else assuming of course this is 32bit right? If so, 64bit is the answer. Thanks for the hint. 64bit solves the issue. Should I anyway create an issue? Kind regards André

Re: How to proceed with learning to code Windows desktop applications?

2018-01-30 Thread Andre Pany via Digitalmars-d-learn
On Monday, 29 January 2018 at 22:55:12 UTC, I Lindström wrote: Hello all! I've been doing console apps for about a year and a half now, but my requirements are reaching the limits of easy to use with ASCII-based UI and typed commands so I'm thinking of moving into GUI-era with my projects. I

std.zip size limit of 2 GB?

2018-02-15 Thread Andre Pany via Digitalmars-d-learn
Hi, I just noticed that std.zip will throw an exception if the source files exceeds 2 GB. I am not sure whether this is a limitation of zip version 20 or a bug. On wikipedia a size limit of 4 GB is mentioned. Should I open an issue? Windows 10 with x86_64 architecture.

Re: std.zip size limit of 2 GB?

2018-02-16 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 15 February 2018 at 21:57:23 UTC, Steven Schveighoffer wrote: Really, i should be size_t in all places, I can't see why it should ever be int. Please file an issue. -Steve Issue created: https://issues.dlang.org/show_bug.cgi?id=18452 Thanks for the analysis. Kind regards André

Re: DMD Windows 64bit target - how to setup the environment?

2017-12-25 Thread Andre Pany via Digitalmars-d-learn
On Monday, 25 December 2017 at 10:57:46 UTC, realhet wrote: Hello, I'm very well satisfied with the DMD 32bit compiler and the OptLink linker on Windows. I even made an incremental builder to it, and I can see the running program in 1 second. Lately I sadly noticed, that the OptLink works

Re: Gui framework

2018-08-01 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 1 August 2018 at 15:28:32 UTC, Greatsam4sure wrote: Please help me recommend a gui toolkit for dlang, that has the following * work well on windows *look native on windows *support css styling like adobe flex spark toolkit and javafx *Support theming and skinning *support custom

Re: Gui framework

2018-08-01 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 1 August 2018 at 18:40:26 UTC, Everlast wrote: On Wednesday, 1 August 2018 at 17:24:23 UTC, Andre Pany wrote: On Wednesday, 1 August 2018 at 15:28:32 UTC, Greatsam4sure wrote: Please help me recommend a gui toolkit for dlang, that has the following * work well on windows *look

Re: [Unit tests] Mocking D objects

2018-08-22 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 08:33:36 UTC, Andrey wrote: Hello, I know that D has build-in unit tests. If so, what mechanism D provides for mocking objects? For example: struct WebParser { // ... int download(string path) { SomeHttpClient client(path); auto result =

Re: Find out druntime/import and phobos folder on Linux

2018-07-14 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 14 July 2018 at 19:00:56 UTC, Anonymouse wrote: On Saturday, 14 July 2018 at 17:19:20 UTC, Andre Pany wrote: Is there a way to find out both paths based on the dmd executable folder? What I found out so far, these paths are not always correct: /usr/include/dmd/druntime/import

Re: Find out druntime/import and phobos folder on Linux

2018-07-15 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 15 July 2018 at 09:17:31 UTC, Seb wrote: On Saturday, 14 July 2018 at 17:19:20 UTC, Andre Pany wrote: [...] DMD: https://github.com/dlang/dmd/blob/master/src/dmd/dinifile.d#L40 LDC: https://wiki.dlang.org/Using_LDC, https://github.com/dlang/dmd/blob/master/src/dmd/frontend.d#L97

  1   2   3   4   5   >