Re: How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
On Sunday, 29 November 2020 at 02:55:02 UTC, Ali Çehreli wrote: On 11/28/20 6:40 PM, Marcone wrote: void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? } Since it's optional, T2 must have a default type. I

Re: How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Ali Çehreli via Digitalmars-d-learn
On 11/28/20 6:40 PM, Marcone wrote: void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? } Since it's optional, T2 must have a default type. I made it 'int' below. void a(T1, T2 = int)(T1 b, T2 c = T2.init)

How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? }

Re: lambda recursion

2020-11-28 Thread ddcovery via Digitalmars-d-learn
On Friday, 27 November 2020 at 20:53:37 UTC, Ali Çehreli wrote: This has been done with the Y-combinator, where the lambda refers to itself as 'self': https://github.com/gecko0307/atrium/blob/master/dlib/functional/combinators.d There has been been other discussions on it on these forums. A

Re: Are JSONOptions broken?

2020-11-28 Thread frame via Digitalmars-d-learn
On Saturday, 28 November 2020 at 16:59:11 UTC, ag0aep6g wrote: Makes perfect sense. The option is called "escapeNonAsciiChars", not "escapeNonUnicodeChars". This is a slash: / This is a backslash: \ There are no slashes in your string. Thanks, I realized that the options are only for dealin

Re: How to connect to SQLITE?

2020-11-28 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 28 November 2020 at 17:50:43 UTC, kdevel wrote: On Saturday, 28 November 2020 at 13:29:50 UTC, Ferhat Kurtulmuş wrote: On Saturday, 28 November 2020 at 12:01:59 UTC, Alex NL wrote: Is there libs for SQLITE? How to use it? thanks. https://github.com/aferust/GtkD-examples-for-TreeV

Re: How to connect to SQLITE?

2020-11-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 November 2020 at 13:29:50 UTC, Ferhat Kurtulmuş wrote: On Saturday, 28 November 2020 at 12:01:59 UTC, Alex NL wrote: Is there libs for SQLITE? How to use it? thanks. https://github.com/aferust/GtkD-examples-for-TreeView-and-ListBox IMNSHO the code in example1.d string sql

Re: Are JSONOptions broken?

2020-11-28 Thread ag0aep6g via Digitalmars-d-learn
On 28.11.20 15:21, frame wrote: This throws an UTF-exception: auto json = JSONValue(cast(char[])[0x00, 0x7D, 0xFE, 0xFF, 0x14, 0x32, 0x43, 0x10]); writeln(json.toString(JSONOptions.escapeNonAsciiChars)); Makes no sense. Either the bytes should be properly escaped or there should not be any o

list dll from Gtk executable build with dmd not working

2020-11-28 Thread Jack via Digitalmars-d-learn
So I build a Gtk executable with dmd, following this[1] tutorial but no tool ldd, nlldd, listdlls[2], dependencies[3] list the gtk's dlls that the executable, as far I know, depends on to run, hence the need to install the Gtk runtime[4]. What am I missing? all those tools only return the wind

Re: Reflection on the book D web development.

2020-11-28 Thread Alaindevos via Digitalmars-d-learn
& Golang has Martini which is quite easy to use, https://www.youtube.com/watch?v=tUFzdUIjVRg

Are JSONOptions broken?

2020-11-28 Thread frame via Digitalmars-d-learn
I need to encode a key as string through json. This throws an UTF-exception: auto json = JSONValue(cast(char[])[0x00, 0x7D, 0xFE, 0xFF, 0x14, 0x32, 0x43, 0x10]); writeln(json.toString(JSONOptions.escapeNonAsciiChars)); Makes no sense. Either the bytes should be properly escaped or there shou

Re: How to connect to SQLITE?

2020-11-28 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 28 November 2020 at 12:01:59 UTC, Alex NL wrote: Is there libs for SQLITE? How to use it? thanks. https://github.com/aferust/GtkD-examples-for-TreeView-and-ListBox

Re: How to connect to SQLITE?

2020-11-28 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 28 November 2020 at 12:01:59 UTC, Alex NL wrote: Is there libs for SQLITE? How to use it? thanks. You may use google translate, https://d-land.sepany.de/tutorials/datenbanken/sqlite-erste-schritte/ Here I describe how to use Sqlite using dub package arsd-official. Kind regards An

How to connect to SQLITE?

2020-11-28 Thread Alex NL via Digitalmars-d-learn
Is there libs for SQLITE? How to use it? thanks.

Re: Automatic update system

2020-11-28 Thread vnr via Digitalmars-d-learn
Thank you for your suggestions :) I particularly appreciate the idea of making my program a dub package, it allows me to be cross platform and to have no dependencies other than those of the default D environment. To the detriment of automatically updating the application, I think that only c