Re: Why is the following failing?

2024-01-25 Thread Erdem via Digitalmars-d-learn
On Thursday, 25 January 2024 at 16:07:44 UTC, Stefan Koch wrote: On Thursday, 25 January 2024 at 15:39:08 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect for the example above.. Raise a bug, I'll fix it. buna

Re: Using .require for struct types

2022-09-13 Thread Erdem via Digitalmars-d-learn
On Sunday, 11 September 2022 at 21:01:27 UTC, Salih Dincer wrote: On Saturday, 10 September 2022 at 16:33:03 UTC, Erdem Demir wrote: I wish I could use ref DListOfA returnVal = but we can't in D. Can you please suggest alternatives? I think you should try advanced update. Your

Re: Using .require for struct types

2022-09-13 Thread Erdem via Digitalmars-d-learn
On Saturday, 10 September 2022 at 18:39:55 UTC, Steven Schveighoffer wrote: On 9/10/22 12:33 PM, Erdem Demir wrote: Can you please suggest alternatives? Use a pointer. ```d DListOfA *returnVal = (...); returnVal.insert(a); ``` -Steve Actually that could be answer I am seeking for I will

Re: Using .require for struct types

2022-09-13 Thread Erdem via Digitalmars-d-learn
On Saturday, 10 September 2022 at 18:38:40 UTC, Ali Çehreli wrote: On 9/10/22 09:33, Erdem Demir wrote: > DListOfA returnVal = temp.require("a", DListOfA());--> I wish I > could use ref DListOfA here But keeping a reference to a temporary would not work because the life of that

Why libmir has to add its own algorithm functions

2020-05-01 Thread Erdem via Digitalmars-d-learn
As can be seen in the link below : http://mir-algorithm.libmir.org/mir_algorithm_iteration.html Libmir provides almost the same function as std. Why is benefit of doing that? Wouldn't it be better to not duplicate std stuff? Erdem

Cross product in lib mir or lubeck

2020-05-01 Thread Erdem via Digitalmars-d-learn
Hi, I am looking for cross product function in libmir or lubeck. But I couldn't find it. Does anyone know if it exists or not? Erdem

Profiling the memory in D

2019-12-04 Thread Erdem via Digitalmars-d-learn
I am used to have cool tools like valgrid massif to visualize the memory usage from C++ but in D it seems I am blind folded looking for the problem. Until now I tried: --vgc option which show million things which makes it not useful --build=profile-gc which seems to slow down my program like

Libharu D binding harud unicode support

2017-03-01 Thread Erdem via Digitalmars-d-learn
How should one use libharu d binding in unicode mode. Consider this basic example. import std.stdio; import harud; import harud.c; void main() { void errorCallback(uint error_number, uint detail_number) { writefln("err %x, %s, (num %x)" , error_number ,

Re: Gtkd how to filter TreeView according to user input

2017-01-17 Thread Erdem via Digitalmars-d-learn
On Tuesday, 17 January 2017 at 19:07:21 UTC, Ali Çehreli wrote: On 01/17/2017 01:25 AM, Erdem wrote: > void main(string[] args) > { > Main.init(args); > new MyWindow(); > Main.run(); > } I have no experience with Gtkd but the code inside main looks fundamentally wrong. One would

Gtkd how to filter TreeView according to user input

2017-01-17 Thread Erdem via Digitalmars-d-learn
I'd like to filter Treeview data according to user input. How should I do that? When I run this program it gives segmentation fault error. import gtk.Main; import gtk.MainWindow; import gtk.Box; import gtk.Entry; import gtk.EditableIF; import gtk.TreeModelFilter; import gtk.TreeView; import

Re: Gtkd how to add double value to liststore

2017-01-14 Thread Erdem via Digitalmars-d-learn
On Sunday, 15 January 2017 at 01:36:44 UTC, Ali Çehreli wrote: It looks like ListStore is a collection of 'Value's. Does the following work? setValue(iterator, 1, new Value(price)); Yes it works. Ali bey teşekkürler! :)

Gtkd how to add double value to liststore

2017-01-14 Thread Erdem via Digitalmars-d-learn
I would like to pass some double value to ListStore's constructor but it doesn't allows me to do. import gtk.Main; import gtk.MainWindow; import gtk.Box; import gtk.ListStore; import gtk.TreeView; import gtk.TreeViewColumn; import gtk.TreeIter; import gtk.CellRendererText; class MyWindow:

Re: arsd.dom appenChild method gives assertion message

2016-12-12 Thread Erdem via Digitalmars-d-learn
On Sunday, 11 December 2016 at 22:11:51 UTC, Adam D. Ruppe wrote: On Sunday, 11 December 2016 at 17:52:29 UTC, Erdem wrote: [...] Try something like: content.appendChild(firstElements[0].removeFromTree()); Thanks this method also works. foreach (element; firstElements) {

Re: arsd.dom appenChild method gives assertion message

2016-12-11 Thread Erdem via Digitalmars-d-learn
Ok this seems to work as expected. import arsd.dom; import std.stdio; void main() { auto document = new Document(); document.parseGarbage(` Test Document1 This is the first paragraph of our href="test.html">test document. This second paragraph also has a

arsd.dom appenChild method gives assertion message

2016-12-11 Thread Erdem via Digitalmars-d-learn
I would like to add first documents content inside a div element like this. import arsd.dom; import std.stdio; void main() { auto document = new Document(); document.parseGarbage(` Test Document1 This is the first paragraph of our href="test.html">test

std.net.curl application throws an exception

2016-11-27 Thread Erdem via Digitalmars-d-learn
try to compile this program from std.net.curl import std.net.curl, std.stdio; void main() { auto range1 = byLineAsync("www.google.com"); auto range2 = byLineAsync("www.wikipedia.org"); foreach (line; byLineAsync("dlang.org")) writeln(line); foreach (line; range1)