Re: How do I get the output of the time bash command?

2021-01-27 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 27 January 2021 at 09:58:25 UTC, Marcone wrote: On Wednesday, 27 January 2021 at 09:35:21 UTC, Anthony wrote: I'm trying to read the timed output of a pipeShell command but it only results in empty output. Does anyone know why this is? ``` auto p = pipeShell("time ls");

Re: How do I overload += operator?

2021-01-26 Thread bachmeier via Digitalmars-d-learn
On Monday, 25 January 2021 at 17:09:22 UTC, Jack wrote: I'd like to make this work s += 10 where s is a struct. How can I do that? You have your answer, but someone else might come upon this in the future, so here's a link to the clearest explanation of operator overloading for someone new

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread bachmeier via Digitalmars-d-learn
On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: What did I do wrong in constructing the bindings? If it helps the library provides a function called EdsRelease for cleaning-up allocated objects. Is the management of pointers between D and C the issue? Please forgive me if

Re: Reflection on the book D web development.

2020-11-25 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 25 November 2020 at 17:26:44 UTC, Alaindevos wrote: hunt-http has no documentation and does not looks usable to me. What looks usable is kemal & the crystal language, https://kemalcr.com/guide/ Looks like Sinatra. That makes sense given the relationship of Crystal to Ruby. Many

Re: Reflection on the book D web development.

2020-11-23 Thread bachmeier via Digitalmars-d-learn
On Saturday, 21 November 2020 at 16:18:39 UTC, Alaindevos wrote: It's not my related to a lack of knowledge of the d-language but the complexity of the vibe.d framework itself. What I understand are : 1: jade/diet .dt templates, inheritance,includes,markdown. 2: A simple form with POST method.

Re: Question about: ("1.1").to!int;

2020-10-23 Thread bachmeier via Digitalmars-d-learn
On Friday, 23 October 2020 at 13:57:41 UTC, Joseph Rushton Wakeling wrote: In particular, if `to` just accepted any string numerical representation for conversion to int, how could the caller explicitly _exclude_ non-integer input, if that is their use-case? So it's far better to require

Re: More elaborate asserts in unittests?

2020-10-21 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 21 October 2020 at 22:48:04 UTC, IGotD- wrote: On Wednesday, 21 October 2020 at 22:41:42 UTC, Adam D. Ruppe wrote: try compiling with dmd -checkaction=context Thanks, that was simple and it worked. Speaking of this, shouldn't this be documented here for example.

Re: Question about: ("1.1").to!int;

2020-10-21 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 21 October 2020 at 22:50:27 UTC, matheus wrote: Since (1.1).to!int = 1, shouldn't the string value ("1.1").to!int at least try to convert to float/double and then to int? I don't think so. A silent string->double conversion isn't IMO consistent with D's design.

Re: Memory management

2020-09-29 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 10:57:07 UTC, novice3 wrote: Naive newbie question: Can we have (in theory) in D lang memory management like V lang? Quote: https://github.com/vlang/v/blob/master/doc/docs.md#memory-management "V doesn't use garbage collection or reference counting. The

Re: Installing D on Fresh Windows 10 machine is a pain

2020-08-27 Thread bachmeier via Digitalmars-d-learn
On Thursday, 27 August 2020 at 16:44:28 UTC, Mike Parker wrote: On Thursday, 27 August 2020 at 16:39:05 UTC, Mike Parker wrote: Or maybe better, just go to the 'Individual components', select the latest Windows 10 SDK version, and install it. Or just check the installation folder. For me,

Re: Creating a pointer array

2020-08-19 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 19 August 2020 at 13:03:54 UTC, data pulverizer wrote: Hi all, How do you create an array of pointers in D? I tried something like ``` double* []y; ``` Or ``` (double*) []y; ``` But I get the error: ``` Error: only one index allowed to index double[] ``` Thanks in advance.

Re: generating random numbers

2020-08-10 Thread bachmeier via Digitalmars-d-learn
On Monday, 10 August 2020 at 14:20:23 UTC, bachmeier wrote: On Monday, 10 August 2020 at 05:51:07 UTC, Andy Balba wrote: generating random numbers using https://dlang.org/library/std/random/uniform01.html I find the example given in this section totally incomprehensible .. Can any help me

Re: generating random numbers

2020-08-10 Thread bachmeier via Digitalmars-d-learn
On Monday, 10 August 2020 at 05:51:07 UTC, Andy Balba wrote: generating random numbers using https://dlang.org/library/std/random/uniform01.html I find the example given in this section totally incomprehensible .. Can any help me answer two simple questions: How to generate a random floating

Re: dynamic array .length vs .reserve - what's the difference?

2020-07-30 Thread bachmeier via Digitalmars-d-learn
On Thursday, 30 July 2020 at 15:58:28 UTC, wjoe wrote: I just stumbled upon code like this: struct Foo(T) { T[] b; this(int n) { b.reserve(n); b.length = n; } } .reserve looks redundant. The docs are explaining .length nicely, however lack any specifics about

Re: sort a string

2020-05-01 Thread bachmeier via Digitalmars-d-learn
On Friday, 1 May 2020 at 15:04:01 UTC, notna wrote: On Friday, 1 May 2020 at 12:29:26 UTC, Steven Schveighoffer wrote:     dchar[] line3 = sort(line2.to!(dchar[])); dchar[] line3 = sort(line2.to!dchar[]).release; https://dlang.org/phobos/std_range.html#.SortedRange.release hmmm,

Re: Why libmir has to add its own algorithm functions

2020-05-01 Thread bachmeier via Digitalmars-d-learn
On Friday, 1 May 2020 at 11:31:29 UTC, Erdem wrote: 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 I

Re: How to sum multidimensional arrays?

2020-02-28 Thread bachmeier via Digitalmars-d-learn
On Friday, 28 February 2020 at 16:51:10 UTC, AB wrote: See https://dlang.org/spec/operatoroverloading.html#array-ops for a better overview of the required operators or mir.ndslice for an nD implementation. Here's an old version of some of the things I've been using:

Re: How to sum multidimensional arrays?

2020-02-27 Thread bachmeier via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: [...] This works but it does not look very efficient considering we flatten and then calling array twice. It will get even worse with 3D arrays. Is there a better way without relying on mir.ndslice? Is there a reason you

Re: Some impressions/notes from a new D programmer

2020-02-12 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 10:39:06 UTC, mark wrote: Library Reference Documentation The Library Reference documentation seems to be a mixed bag. Often I've found a good overview at the start, but then few or no examples in the docs for classes and methods (see e.g.,

Re: total newbie + IDE

2020-02-07 Thread bachmeier via Digitalmars-d-learn
On Friday, 7 February 2020 at 17:02:18 UTC, solnce wrote: Hi guys, I am total newbie and trying to learn a little bit of programming for personal purposes (web scrapping, small databases for personal use etc.). I've been trying to install any of IDE available, but had no success. I use

Re: Can't compile dlangui

2020-02-07 Thread bachmeier via Digitalmars-d-learn
On Friday, 7 February 2020 at 14:25:05 UTC, Jan Hönig wrote: I am afraid that dlangui and dlangide is currently not maintained, since i can reproduce the error as well. If you're sure that's the case, then it should be pushed to the inactive section on this page:

Re: readline / Gnu readline

2020-01-29 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 29 January 2020 at 21:15:08 UTC, Adam D. Ruppe wrote: On Wednesday, 29 January 2020 at 20:01:32 UTC, Michael wrote: I am new to D. I would like to use the Gnu readline function in D. Is there a module that i can use? just define it yourself --- // this line right here is all

Re: books for learning D

2020-01-13 Thread bachmeier via Digitalmars-d-learn
On Monday, 13 January 2020 at 11:20:31 UTC, mark wrote: On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş wrote: On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş wrote: On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote: I'm just starting out learning D. Andrei

Re: books for learning D

2020-01-13 Thread bachmeier via Digitalmars-d-learn
On Monday, 13 January 2020 at 11:20:31 UTC, mark wrote: On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş wrote: On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş wrote: On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote: I'm just starting out learning D. Andrei

Re: Calling D code from C

2020-01-08 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 8 January 2020 at 22:00:03 UTC, H. S. Teoh wrote: On Wed, Jan 08, 2020 at 09:42:03PM +, Ferhat Kurtulmuş via Digitalmars-d-learn wrote: [...] What is going on here? The original post date appears as to be of 2005 :D. [...] Haha yeah, I'm not sure why Stefan replied to a post

Re: how to get current timestamp?

2020-01-02 Thread bachmeier via Digitalmars-d-learn
On Thursday, 2 January 2020 at 18:41:59 UTC, Ferhat Kurtulmuş wrote: Is there any built-in method returning current timestamp like doing it in python like: time.time() which returns something like 1577990478.4675508? I use import std.datetime; Clock.currTime().toISOExtString()

Re: Concatenation/joining strings together in a more readable way

2020-01-02 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote: Are there any other ways to join two strings without Tilde ~ character? I can't seems to find anything about Tilde character concatenation easily, nor the alternatives to it. Can someone share some knowledge on this or at least point

Re: Finding position of a value in an array

2019-12-31 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 31 December 2019 at 04:38:53 UTC, Daren Scot Wilson wrote: On Monday, 30 December 2019 at 23:15:48 UTC, JN wrote: On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote: int i = a.countUntil!(v => v == 55); assert(i == 2); I also had to ask because I couldn't find it. In other

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-30 Thread bachmeier via Digitalmars-d-learn
On Monday, 30 December 2019 at 06:43:03 UTC, H. S. Teoh wrote: Generally, I find myself *much* more productive with CLI-based tools; IDEs are generally much heavier in terms of memory and CPU usage, and worst of all, require a GUI, which for me is a deal-breaker because I do a lot of work

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread bachmeier via Digitalmars-d-learn
On Sunday, 29 December 2019 at 14:41:46 UTC, Russel Winder wrote: Whilst many programmers are happy using 1970s approaches to programming using ed, ex, vi, vim, emacs, sublime text, atom, etc. Many programmers prefer using IDEs, and are better programmers for it. I don't think it's black

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-23 Thread bachmeier via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:07:32 UTC, H. S. Teoh wrote: On Sun, Dec 22, 2019 at 05:20:51PM +, BoQsc via Digitalmars-d-learn wrote: There are lots of editors/IDE's that support D language: https://wiki.dlang.org/Editors What kind of editor/IDE are you using and which one do you

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread bachmeier via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:34:13 UTC, Steven Schveighoffer wrote: I really appreciate the enthusiasm here, but at the risk of being cynical, I see little chance that this gets accepted. Before you spend any time on actual code, a DIP is going to be required, as this would be a huge

Re: What would it take to bring preinstalled D language compiler in the major Linux Distributions?

2019-12-23 Thread bachmeier via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:11:21 UTC, H. S. Teoh wrote: On Mon, Dec 23, 2019 at 01:34:55PM +, BoQsc via Digitalmars-d-learn wrote: I would love to see D language available out of box in major Linux distributions and use without much care of installation. Anyone have a though about

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-22 Thread bachmeier via Digitalmars-d-learn
On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote: There are lots of editors/IDE's that support D language: https://wiki.dlang.org/Editors What kind of editor/IDE are you using and which one do you like the most? I use Geany, but I don't know that there's any good argument for that

Re: matrix operations

2019-11-27 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 27 November 2019 at 18:10:36 UTC, René Heldmaier wrote: On Wednesday, 27 November 2019 at 16:35:40 UTC, bachmeier wrote: I do have all that for my own use. I've never bothered to turn it into something others could use because I love the garbage collector, but that's a turnoff

Re: matrix operations

2019-11-27 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 27 November 2019 at 16:16:04 UTC, René Heldmaier wrote: Hi, I'm looking for some basic matrix/vector operations and other numeric stuff. I spent quite a lot time in reading through the mir documentation, but i kinda miss the bigger picture. I'm not a Python user btw. (I know

Re: D vs Java which is more powerful

2019-11-16 Thread bachmeier via Digitalmars-d-learn
On Saturday, 16 November 2019 at 07:24:50 UTC, GreatSam4sure wrote: According to this [1] a person that java is much more powerful than D. I am really surprised at this claim. Is this true? Because I believe D much more powerful than Java. I will really appreciate detail analysis

Re: Is there any writeln like functions without GC?

2019-10-31 Thread bachmeier via Digitalmars-d-learn
On Thursday, 31 October 2019 at 15:11:42 UTC, Ferhat Kurtulmuş wrote: It would be nice if one reimplement writeln of Phobos by bypassing gc and use a custom nogc exception as described here*? Of course I can imagine that it would be a breaking change in the language and requires so much work

Re: Meta question - what about moving the D - Learn Forum to a seperate StackExchange platform?

2019-10-18 Thread bachmeier via Digitalmars-d-learn
On Friday, 18 October 2019 at 13:30:37 UTC, Martin Tschierschke wrote: On Friday, 18 October 2019 at 12:51:35 UTC, bachmeier wrote: On Friday, 18 October 2019 at 07:35:21 UTC, Martin Tschierschke wrote: If I search for what ever, not related to D, I very often end with a solution found on one

Re: Meta question - what about moving the D - Learn Forum to a seperate StackExchange platform?

2019-10-18 Thread bachmeier via Digitalmars-d-learn
On Friday, 18 October 2019 at 07:35:21 UTC, Martin Tschierschke wrote: If I search for what ever, not related to D, I very often end with a solution found on one of the StackExchange forums like StackOverflow or AskUbuntu etc. The main advantage is, that all answers can be classified

Re: Meta question - what about moving the D - Learn Forum to a seperate StackExchange platform?

2019-10-18 Thread bachmeier via Digitalmars-d-learn
On Friday, 18 October 2019 at 07:35:21 UTC, Martin Tschierschke wrote: If I search for what ever, not related to D, I very often end with a solution found on one of the StackExchange forums like StackOverflow or AskUbuntu etc. The main advantage is, that all answers can be classified

Re: Functional Programming in D

2019-10-10 Thread bachmeier via Digitalmars-d-learn
On Thursday, 10 October 2019 at 08:59:49 UTC, Russel Winder wrote: I feel that it is best to leave functional programming to functional programming language, e.g. Haskell, Scheme, etc. rather than try to do functional programming in imperative languages, e.g. Java, C++, Rust, D. The reason is

Re: Functional Programming in D

2019-10-10 Thread bachmeier via Digitalmars-d-learn
On Thursday, 10 October 2019 at 10:08:14 UTC, H. S. Teoh wrote: On Thu, Oct 10, 2019 at 09:59:49AM +0100, Russel Winder via Digitalmars-d-learn wrote: On Wed, 2019-10-09 at 11:12 -0700, H. S. Teoh via Digitalmars-d-learn wrote: […] > Actually, std.functional is somewhat of a misnomer. It >

Re: Dynamic Arrays as Stack and/or Queue

2019-10-07 Thread bachmeier via Digitalmars-d-learn
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote: I need a stack and a queue and I noticed that the standard library doesn't appear to have one. Which is ok. I just need something that can logically behave as a stack and queue, which I think the dynamic array should be able to do (if

Re: Dynamic Arrays as Stack and/or Queue

2019-10-07 Thread bachmeier via Digitalmars-d-learn
On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote: I need a stack and a queue and I noticed that the standard library doesn't appear to have one. Which is ok. I just need something that can logically behave as a stack and queue, which I think the dynamic array should be able to do (if

Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-28 Thread bachmeier via Digitalmars-d-learn
On Saturday, 28 September 2019 at 09:00:51 UTC, drug wrote: 28.09.2019 5:15, Hossain Adnan пишет: On Wednesday, 25 September 2019 at 11:46:04 UTC, Ron Tarrant wrote: Hi y'all, I've been Googling how to do this, but coming up with nothing definitive. Are there any articles for how to do this

Re: Howto create bindings?

2019-09-28 Thread bachmeier via Digitalmars-d-learn
On Saturday, 28 September 2019 at 09:18:24 UTC, Martin Brezeln wrote: Hello everyone, i have a rather general question about how to approach the attempt to create a binding for a foreign system, for which bindings already exists for other languages than dlang. To be more concrete: There is

Re: Learning delegates

2019-09-09 Thread bachmeier via Digitalmars-d-learn
On Sunday, 8 September 2019 at 10:04:57 UTC, Joel wrote: I'm trying to understand delegates. Is there any good ways I can get a better understanding of them? I think this chapter should give you some useful information: http://www.ddili.org/ders/d.en/lambda.html

Re: Is there has an pdf document for Phobos.

2019-09-04 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 4 September 2019 at 12:24:47 UTC, lili wrote: On Wednesday, 4 September 2019 at 04:21:10 UTC, Mike Parker wrote: On Wednesday, 4 September 2019 at 03:07:18 UTC, lili wrote: Hi: For some reason it too slow that some times i visited dlang.org, Can admin make a pdf document for

Re: Sort Associative Array by Key

2019-08-27 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 27 August 2019 at 20:14:21 UTC, Machine Code wrote: It isn't really hard: It really is hard. foo.byPair.array.sort!((a, b) => a.key < b.key).map!(a => a.value); is a lot to digest for someone learning the language. There's a big difference between not being hard for someone

Re: How should I sort a doubly linked list the D way?

2019-08-13 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 13 August 2019 at 09:48:52 UTC, Mirjam Akkersdijk wrote: I would write my compare function and let qsort sort it out. I'm confused by this statement. Are you referring to the qsort in C's stdlib? I had never heard of using that to sort a linked list, so I searched, and it is

Re: Help me decide D or C

2019-08-02 Thread bachmeier via Digitalmars-d-learn
On Thursday, 1 August 2019 at 22:36:06 UTC, Russel Winder wrote: On Thu, 2019-08-01 at 14:49 +, bachmeier via Digitalmars-d-learn wrote: […] There's nothing wrong with Haskell if you want to take a deep dive into pure functional programming. I personally find Haskell to be more

Re: Help me decide D or C

2019-08-02 Thread bachmeier via Digitalmars-d-learn
On Friday, 2 August 2019 at 13:57:44 UTC, Bastiaan Veelo wrote: On Thursday, 1 August 2019 at 20:02:08 UTC, Aurélien Plazzotta wrote: [...] But don't fool yourself, D is not for beginners. Ali Çehreli is a very skilled programmer, ergo, he can't reason like a new/starting programmer anymore,

Re: Help me decide D or C

2019-08-01 Thread bachmeier via Digitalmars-d-learn
On Thursday, 1 August 2019 at 03:59:23 UTC, Bert wrote: But if you really want to learn to program I suggest you go with Haskell. You can do them all together too but Haskell is like learning Alien while D is learning German. There's nothing wrong with Haskell if you want to take a deep

Re: Help me decide D or C

2019-08-01 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 23:42:10 UTC, SashaGreat wrote: About Mike's book, you're talking about this one: https://www.amazon.com/Learning-D-Michael-Parker/dp/1783552484/ref=as_li_ss_tl?ie=UTF8=1448974911=8-1=learning+d=sl1=aldacron-20=d696b771c78030fc272e9b853986a708 Yep. It provides a

Re: Help me decide D or C

2019-07-31 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 22:49:10 UTC, SashaGreat wrote: On Wednesday, 31 July 2019 at 22:16:42 UTC, bachmeier wrote: What is your goal? In my opinion, learning C is a waste of time in 2019 unless you have something specific in mind related to a job. C is mostly "fun with segmentation

Re: Help me decide D or C

2019-07-31 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote: Hi everyone, I would like an honest opinion. I have a beginner level (able to do very small programs) in a few languages such as python, go, C, guile(scheme) and common lisp. I want to pick a language and go deep with it and focus

Re: How to setup D language with Apache httpd cgi?

2019-07-31 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 07:19:12 UTC, BoQsc wrote: There are some other bad news, I switched from rdmd to dub package manager since I need a package from Adam D. Ruppe. It is all good and well: this one works perfectly. #!/usr/bin/env dub /+ dub.sdl: name "hello" +/

Re: How to contact people on the forum

2019-07-24 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:37:33 UTC, Greatsam4sure wrote: On Wednesday, 24 July 2019 at 15:56:43 UTC, drug wrote: 24.07.2019 18:51, Greatsam4sure пишет: Good day everyone. I am thinking,  if there is a  way to contact any person on dlang forums through mail or any other means. How do I

Re: Any full feature xml library available?

2019-05-01 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 1 May 2019 at 13:54:08 UTC, Domain wrote: I need a xml library which support document entity or xinclude. The xml may like this: ]> http://www.w3.org/2001/XInclude;> Have you looked at this? https://github.com/jmdavis/dxml

Re: Copyright for reworked Phobos code in Mir

2018-12-26 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 15:40:13 UTC, 9il wrote: std.numeric contains: Copyright: Copyright Andrei Alexandrescu 2008 - 2009. What copyright should contain mir.numeric? Disclaimer: I'm also not a lawyer. At least in the US, what matters is not the copyright but the license. You

Re: Doubt about this book: The D Programming Language

2018-12-16 Thread bachmeier via Digitalmars-d-learn
On Sunday, 16 December 2018 at 18:37:15 UTC, Marko wrote: On Amazon The D Programming Language has good reviews but it's 8 years old. So is this book still relevant today? Would you recommend another book? PS: I am already a programmer writing mainly in C and C#. Thanks, Marko. I can

Re: How do I install a library?

2018-11-11 Thread bachmeier via Digitalmars-d-learn
On Friday, 9 November 2018 at 17:38:18 UTC, Adam D. Ruppe wrote: But my libs are :P I'm aware. That's why I use your libraries but Dub not so much.

Re: How do I install a library?

2018-11-08 Thread bachmeier via Digitalmars-d-learn
On Friday, 9 November 2018 at 00:18:28 UTC, H. S. Teoh wrote: It's not true that you're stuck with dub. And I'm not among the people who think dub is the way to go (though it's true that that's a minority opinion around here). Where I have a choice, my own D projects do not use dub. I have

Re: How do I install a library?

2018-11-08 Thread bachmeier via Digitalmars-d-learn
On Thursday, 8 November 2018 at 23:43:38 UTC, Murilo wrote: It finally worked, but I can't just compile it normally, I have to use dub run, I wish it were something simple that I just download into the folder and then use an import statement and then compile it like any other program. I wish

Re: module `socket` is in file 'std/c/linux/socket.d' which cannot be read

2018-08-03 Thread bachmeier via Digitalmars-d-learn
On Friday, 3 August 2018 at 17:09:37 UTC, Adam D. Ruppe wrote: On Friday, 3 August 2018 at 16:51:37 UTC, bachmeier wrote: I'm running Ubuntu 16.04. OK, I see it now, I had another .di file on my system than the stock one. Pushed a new version to git, it needs to also import a second

Re: module `socket` is in file 'std/c/linux/socket.d' which cannot be read

2018-08-03 Thread bachmeier via Digitalmars-d-learn
On Friday, 3 August 2018 at 16:47:42 UTC, Adam D. Ruppe wrote: On Friday, 3 August 2018 at 16:41:09 UTC, bachmeier wrote: 2.081.1 huh, it works for me... you on Linux or some other system? The embedded_httpd_processes version is Linux specific, on other OSes it uses threads... I'm running

Re: module `socket` is in file 'std/c/linux/socket.d' which cannot be read

2018-08-03 Thread bachmeier via Digitalmars-d-learn
On Friday, 3 August 2018 at 16:19:15 UTC, Adam D. Ruppe wrote: On Friday, 3 August 2018 at 16:13:06 UTC, bachmeier wrote: Swapping the comment and changing to master both fix the original error, but then I get ugh, what dmd version you on? 2.081.1 I find it hard to not have all my

Re: module `socket` is in file 'std/c/linux/socket.d' which cannot be read

2018-08-03 Thread bachmeier via Digitalmars-d-learn
On Friday, 3 August 2018 at 15:42:53 UTC, Adam D. Ruppe wrote: On Friday, 3 August 2018 at 15:33:57 UTC, bachmeier wrote: Any suggestions? The line right next to it, commented, is the solution. Try grabbing the new one from git master, or swap the comment yourself. Older dmd versions used

module `socket` is in file 'std/c/linux/socket.d' which cannot be read

2018-08-03 Thread bachmeier via Digitalmars-d-learn
I'm trying to use Adam's cgi.d. I'm trying to compile previously working code, but I get the following error: cgi.d(2711): Error: module `socket` is in file 'std/c/linux/socket.d' which cannot be read import path[0] = /usr/include/dmd/phobos import path[1] = /usr/include/dmd/druntime/import

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: Another possibility might be in dlopen'able functions. Currently Octave uses so-called oct functions, which are nothing more than C++ object code that is dynamically loaded by the interpreter at runtime. They are

Re: Trying to use the libclang Dub package

2018-07-20 Thread bachmeier via Digitalmars-d-learn
On Friday, 20 July 2018 at 10:31:44 UTC, Laurent Tréguier wrote: On Thursday, 19 July 2018 at 15:42:02 UTC, bachmeier wrote: Found the problem. The libclang package is looking for /usr/lib/llvm-3.9/lib/libclang.so. For some reason, Ubuntu has libclang.so.1. Creating a symlink in that directory

Re: Trying to use the libclang Dub package

2018-07-19 Thread bachmeier via Digitalmars-d-learn
On Thursday, 19 July 2018 at 14:21:51 UTC, bachmeier wrote: [...] .dub/build/unittest-unittest-linux.posix-x86_64-dmd_2081-A8A607969A46E4CDF45479E7A30874E9/ut.o: In function `_D5parse3raw17__unittest_L64_C9FZ12__dgliteral1MFNaNbNiNfZk':

Trying to use the libclang Dub package

2018-07-19 Thread bachmeier via Digitalmars-d-learn
I haven't been able to get dpp to build. I've discovered that the problem is with libclang. It installs, but when running the tests, I get the lengthy message below. Obviously I need to install something (running Ubuntu 16.04) but I've got numerous libclang related packages installed already

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-18 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 22:10:52 UTC, jmh530 wrote: On Tuesday, 17 July 2018 at 16:39:48 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 15:55:03 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: [...] I'm going to create an issue on Github. This is the

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 15:55:03 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: [...] I'm going to create an issue on Github. This is the output I get: [...] I solved that problem but now I have others. dpp is a good thing on paper but maybe not yet in

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: I just build it using dub then do something like that(from memory): `d++ some_c_header.h --include-path path/to/other/c/header/files --keep-d-files` and it generates d file for the corresponding c header. Although dpp is intended to be

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread bachmeier via Digitalmars-d-learn
On Friday, 13 July 2018 at 19:53:45 UTC, Laeeth Isharc wrote: On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: What are your ideas? If you would like to expose C function and type declarations to D, you could take a look at DPP, which allows you to just #include

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Line breaks in JSON

2018-05-10 Thread bachmeier via Digitalmars-d-learn
On Thursday, 10 May 2018 at 17:59:26 UTC, jmh530 wrote: On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole wrote: [snip] You'll need to unescape them (which is pretty easy, a simple replacement here). For reference, this is invalid json[0]: ``` { "1 2 3 " }

Re: Line breaks in JSON

2018-05-10 Thread bachmeier via Digitalmars-d-learn
On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole wrote: You'll need to unescape them (which is pretty easy, a simple replacement here). For reference, this is invalid json[0]: ``` { "1 2 3 " } ``` [0] https://jsonlint.com/ So I see the answer is that I

Line breaks in JSON

2018-05-10 Thread bachmeier via Digitalmars-d-learn
I'm using std.json for the first time. I want to download the contents of a markdown file from a web server. When I do that, the line breaks are escaped, which I don't want. Here's an example: import std.conv, std.json, std.stdio; void main() { string data = "This is a paragraph with

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

2018-05-08 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote: This is the code example, that was presented on the https://dlang.org frontpage: Maybe that isn't the best choice of beginner example if even the D experts can't figure out how to get it to run.

Re: Parse .eml files

2018-04-11 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 11 April 2018 at 15:20:08 UTC, Martin Tschierschke wrote: My question in the moment is, how do I invoke Thunderbird to display a certain single mail (or maildir) file? How do I use Thunderbird as the client, to show, to answer or to forward these mails. An alternative would be

Re: Parse .eml files

2018-04-10 Thread bachmeier via Digitalmars-d-learn
On Monday, 9 April 2018 at 19:17:20 UTC, Adam D. Ruppe wrote: [...] I had a chance to try this out and it worked without a problem. I did have to download color.d in addition to the other dependencies you listed. In the event that Google brings someone here, this is a complete working

Re: Parse .eml files

2018-04-09 Thread bachmeier via Digitalmars-d-learn
On Monday, 9 April 2018 at 19:17:20 UTC, Adam D. Ruppe wrote: My understanding is .eml is the same MIME format the email itself and mbox and maildir all use. Thanks. I didn't know that. I will try it using email.d.

Parse .eml files

2018-04-09 Thread bachmeier via Digitalmars-d-learn
I want to save all email messages related to a research project into a directory, call a D program to generate an index of all messages, and push it to the repo server. That way all coauthors have access to all email messages even if they joined a project after several years. My client is

Re: complex arithmetic in D: multiple questions

2018-03-09 Thread bachmeier via Digitalmars-d-learn
On Friday, 9 March 2018 at 14:41:47 UTC, J-S Caux wrote: Going further, I'm really wondering what the plan is as far as Complex is concerned. Right now it just feels neglected (half-done/aborted transition from creal etc to Complex, lots of missing basic functions etc), and is one major

Re: Speed of math function atan: comparison D and C++

2018-03-05 Thread bachmeier via Digitalmars-d-learn
On Monday, 5 March 2018 at 20:11:06 UTC, H. S. Teoh wrote: Walter has been adamant that we should always compute std.math.* functions with the `real` type, which on x86 maps to the non-IEEE 80-bit floats. However, 80-bit floats have been deprecated for a while now, and pretty much nobody

Can someone help a Reddit user

2018-02-20 Thread bachmeier via Digitalmars-d-learn
Someone has posted a question on our subreddit. Would be nice if he could get an answer: https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_write_to_the_wrong_file/

Re: It makes me sick!

2017-07-28 Thread bachmeier via Digitalmars-d-learn
On Friday, 28 July 2017 at 12:48:37 UTC, Grander wrote: On Friday, 28 July 2017 at 12:40:27 UTC, rjframe wrote: On Fri, 28 Jul 2017 05:14:16 +, FoxyBrown wrote: You can make any claim you want like: "The end user should install in to a clean dir so that DMD doesn't get confused and load

Re: Remove instance from array

2017-07-05 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote: Here in D everything looks like climbing mount everest. When you ask how to use D's containers you are recommended to use dynamic arrays instead. When you look at the docs for std.algorithm, e.g. the .remove section, you get bombed

Re: Linking external *.lib files

2017-06-21 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 21 June 2017 at 13:07:31 UTC, Jolly James wrote: *push* Have you asked on the Dub forum? http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/

Re: [Solved] Confusing error message

2017-06-07 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 21:13:37 UTC, H. S. Teoh wrote: On Wed, Jun 07, 2017 at 11:16:14PM +0300, drug via Digitalmars-d-learn wrote: 07.06.2017 22:40, bachmeier пишет: [...] > In any event, I made a second suggestion that would always > work. If it can't find a match, it asks if you're

Re: [Solved] Confusing error message

2017-06-07 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 19:02:59 UTC, drug wrote: How do compiler know that you want use `std.conv.to` instead of _already imported_ `core.time.to`? In general it's impossible. There is no way for compiler to guess that you want some other symbol from out there. What if you've imported

Re: [Solved] Confusing error message

2017-06-07 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 14:58:26 UTC, drug wrote: 07.06.2017 16:27, Wulfklaue пишет: Some of the dmd error messages need some tweaking. import std.datetime; auto t = Clock.currStdTime; writeln(to!string(t)); Result in: Error: template core.time.to cannot deduce function from

Re: [Solved] Confusing error message

2017-06-07 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 13:27:05 UTC, Wulfklaue wrote: Some of the dmd error messages need some tweaking. import std.datetime; auto t = Clock.currStdTime; writeln(to!string(t)); Result in: Error: template core.time.to cannot deduce function from argument types !(string)(long),

Re: site examples

2017-05-25 Thread bachmeier via Digitalmars-d-learn
On Thursday, 25 May 2017 at 15:41:47 UTC, crimaniak wrote: I tried to run an example from the site. Example from https://dlang.org/phobos/std_regex.html#replaceAllInto section. And this is problem number 0: I can't give a link to the example, only to section. The section can be long, there can

Re: Which editor to use for editing DDOCs?

2017-05-23 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 23 May 2017 at 07:40:21 UTC, biocyberman wrote: Adding DDOC support for D Mode require some more work obviously. I will see if I can make some changes to that. For the time being, I would like to know which editors people are using. Or is it a plain black and white editor ? I

  1   2   3   >