Re: contains method on immutable sorted array

2019-10-21 Thread Andrey via Digitalmars-d-learn
On Monday, 21 October 2019 at 20:44:29 UTC, Nicholas Wilson wrote: works, so I guess contains doesn't work with immutable? If you can do some more research into this and confirm it then, please file a bug report. As I understand - yes. It doesn't work with immutable object. Also I see the same

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: Hi All, Request your help in converting a PHP code to D equivalent code You can get one connection object and close it :) ```D import hunt.database; class AvmTest { private Database _db; this() { _db = new Datab

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Monday, 21 October 2019 at 15:36:25 UTC, Andre Pany wrote: On Monday, 21 October 2019 at 15:29:33 UTC, zoujiaqing wrote: On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: [...] import hunt.database; class avmtest { private Database db; this() { db = new Databas

Re: exceptions and optimization

2019-10-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 21 October 2019 at 21:09:32 UTC, Peter Jacobs wrote: On Monday, 21 October 2019 at 20:37:32 UTC, Nicholas Wilson wrote: What kind of conditions are you wanting to throw exception on? infinities, NaNs, ill conditioning, something else? As always the best way to check is to mark the

Re: exceptions and optimization

2019-10-21 Thread Peter Jacobs via Digitalmars-d-learn
On Monday, 21 October 2019 at 20:37:32 UTC, Nicholas Wilson wrote: What kind of conditions are you wanting to throw exception on? infinities, NaNs, ill conditioning, something else? As always the best way to check is to mark the function of interest, nothrow take a look at the disassembly an

Re: contains method on immutable sorted array

2019-10-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 21 October 2019 at 10:14:54 UTC, Andrey wrote: Hello, I have got a global constant immutable array: immutable globalvalues = sort(cast(wstring[])["й", "ц", "ук", "н"]); Somewhere in program I want to check an existance: globalvalues.contains("ук"w).writeln; But get an error: Erro

Re: exceptions and optimization

2019-10-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 21 October 2019 at 20:12:19 UTC, Peter Jacobs wrote: Toward the end of Walter's recent talk, D at 20, he says something to the effect that optimizations are disabled when exceptions can be thrown. We have a compressible flow solver in which it is very convenient to be able to throw

exceptions and optimization

2019-10-21 Thread Peter Jacobs via Digitalmars-d-learn
Toward the end of Walter's recent talk, D at 20, he says something to the effect that optimizations are disabled when exceptions can be thrown. We have a compressible flow solver in which it is very convenient to be able to throw an exception from deep within the code and catch it at a relativ

Re: Small program producing binary with large filesize

2019-10-21 Thread Prokop Hapala via Digitalmars-d-learn
On Wednesday, 1 August 2018 at 15:58:53 UTC, Jacob Shtokolov wrote: On Tuesday, 31 July 2018 at 15:19:19 UTC, Dan Barbarito wrote: Hi all, I am starting to write a command line tool. Hi! First, Vibe.d will increase your binary size because it contains a lot of unnecessary things inside it.

Re: ... use of ... is hidden by ...; use alias ... to introduce base class overload set ??

2019-10-21 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-10-21 07:04:33 +, John Chapman said: This should work: class FilterSubject : SubjectObject!message { alias subscribe = typeof(super).subscribe; Disposable subscribe(myWidget observer){...} } This now gives: rx_filter_subject.d(66,23): Error: rx_filter_subject.FilterSubject

Re: PHP to D Conversion

2019-10-21 Thread Andre Pany via Digitalmars-d-learn
On Monday, 21 October 2019 at 15:29:33 UTC, zoujiaqing wrote: On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: [...] import hunt.database; class avmtest { private Database db; this() { db = new Database("mysql://testusr:x...@test.srv.com:3910/test"); }

Re: PHP to D Conversion

2019-10-21 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: Hi All, Request your help in converting a PHP code to D equivalent code PHP Code: class avmtest { private $con; function __construct() { global $config; $this->con = new mysqli(test.srv.

Re: PHP to D Conversion

2019-10-21 Thread Andre Pany via Digitalmars-d-learn
On Monday, 21 October 2019 at 11:36:00 UTC, Vino wrote: On Saturday, 19 October 2019 at 20:40:36 UTC, Boris Carvajal wrote: [...] Hi Boris, [...] Hi, Where do you call avmconnect? Is this.conn null when connection fails? What happens if the query does not contains rows? Kind regards Andre

Re: PHP to D Conversion

2019-10-21 Thread Vino via Digitalmars-d-learn
On Saturday, 19 October 2019 at 20:40:36 UTC, Boris Carvajal wrote: On Saturday, 19 October 2019 at 19:08:45 UTC, Vino wrote: On Friday, 18 October 2019 at 14:56:05 UTC, Andre Pany wrote: On Friday, 18 October 2019 at 09:21:46 UTC, Vino wrote: On Friday, 18 October 2019 at 09:17:24 UTC, Vino w

contains method on immutable sorted array

2019-10-21 Thread Andrey via Digitalmars-d-learn
Hello, I have got a global constant immutable array: immutable globalvalues = sort(cast(wstring[])["й", "ц", "ук", "н"]); Somewhere in program I want to check an existance: globalvalues.contains("ук"w).writeln; But get an error: Error: template std.range.SortedRange!(wstring[], "a < b").Sor

SQL Questions Query

2019-10-21 Thread Arjunkumar via Digitalmars-d-learn
Hello Everyone, I am looking for SQL interview questions list. I have scheduled my interviews in the upcoming week, Recruiters told me they might test my SQL knowledge too. What kind of questions should I expect? One is a consultant swe / data scientist and the other is an application develo

Re: Any 3D Game or Engine with examples/demos which just work (compile&run) out of the box on linux ?

2019-10-21 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 20 October 2019 at 22:48:25 UTC, Jonathan Marler wrote: On Friday, 18 October 2019 at 06:11:37 UTC, Ferhat Kurtulmuş wrote: On Friday, 18 October 2019 at 05:52:19 UTC, Prokop Hapala wrote: Already >1 year I consider to move from C++ to Dlang or to Rust in my hobby game development (m

Re: ... use of ... is hidden by ...; use alias ... to introduce base class overload set ??

2019-10-21 Thread John Chapman via Digitalmars-d-learn
On Sunday, 20 October 2019 at 21:45:35 UTC, Robert M. Münch wrote: class myWidget : Observer!message {...} class FilterSubject : SubjectObject!message { Disposable subscribe(myWidget observer){...} } I tried to add "alias subscribe = SubjectObject.subscribe;" in different places, but that di