Re: Using core/sys/posix/mqueue.d on FreeBSD
On Saturday, 6 April 2024 at 12:05:56 UTC, Jonathan M Davis wrote: Actually, since I'm usually the one who does the FreeBSD ones anyway, here you go: https://github.com/dlang/dmd/pull/16359 The declarations compile, and they should match the ones in C, since I copied them over and then tweaked them, but I haven't actually tested them. All that being said, even if they're merged immediately, they won't be available as part of druntime until dmd 2.109.0 is released (and 2.108.0 was released less than a week ago), so you'll probably need to copy them into your own install or use the development version of dmd to get the updated bindings if you want to use them now. - Jonathan M Davis This is awesome, Jonathan! Thanks a lot for your elaboration on the issue, no wonder I got confused, and of course the PR! Really appreciated. Thanks!
Re: Ali introduced D at Northeastern University
On Tuesday, 4 October 2022 at 05:26:53 UTC, Ali Çehreli wrote: DConf 2022 speaker Mike Shah[1] had invited me to give a presentation for the computer science students at Northeastern University. I was there this past Friday having a great time not only presenting but also meeting with the students, drinking non-virtual beer bought by Steven Schveighoffer. :) Mike has just posted the video on his YouTube channel: https://www.youtube.com/watch?v=0JL9uT_XGZE Ali [1] https://dconf.org/2022/#mikes Really a great presentation!
Re: Serial communication library
On Saturday, 24 September 2022 at 08:52:42 UTC, Imperatorn wrote: On Thursday, 22 September 2022 at 12:05:00 UTC, Imperatorn wrote: Hi guys! What's the best/preferred library to use for serial communication (RS)? Thanks I will give onyx-serial a try Also on code.dlang.org: https://github.com/NCrashed/serial-port Depending on you specific needs, using the platform/os api is also an option.
Re: What are (were) the most difficult parts of D?
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Overhall I think that D was not hard to learn because well designed (i.e intuitive). I concur.. A few specific points however that I remember - Certain variant forms of the `is` Expression are not obvious (not intuitive), I'm pretty sure I still cant use them without a quick look to the specs. Yes indeed, had to read through the then excellent pdf()https://github.com/PhilippeSigaud/D-templates-tutorial by Philippe Sigaud (of PEG) to grasp the whole idea first, and still have to look it up when the need to use it arises... - Operator overloading in certain cases was confusing, I remember that for one particular form once I had to use your book instead of the official specs (when opSlice and opIndex are combined) Indeed same experience. Also opCmp and opEquals caused some confusion. D's [][] !== C's [][], Range peculiarities w.r.t some algo's (algo want's fwdRange but got inputRange but did not have the constraint ea) lazy vs eager algorithms (the need to call .array) The main difficulty I had is actually not specific to D. It was to accept that a GC is OK. Nice one. I recon I have to think much harder sometimes to know where the data is and 'who' has access: stack heap tls mutexed or not whatever, but find myself almost never asking this question anymore in D, which I use(d) to do almost all the time in c++ land. The need for it is almost removed by D.
Re: error connecting to mongodb atlas with vibe.d
On Saturday, 30 April 2022 at 14:29:56 UTC, notsteve wrote: Hi, I am trying to setup a simple webserver in D using vibe.d (0.9.4) and want to use mongoDB as a database. To achieve this, I've set up a mongoDB atlas instance with the following command inside the standard app.d file created by vibe.d ``` string MongoURL = "mongodb://username:@cluster0-shard-00-01.gaetq.mongodb.net:27017"; auto client = connectMongoDB(MongoURL); ``` but am getting error [1] below. Alternatively if I use the following path to the instance ``` string MongoURL = "mongodb://username:passw...@cluster0-shard-00-01.gaetq.mongodb.net:27017/myFirstDatabase?ssl=true=false"; ``` I get error [2]. I have tried accessing this instance using other programming languages and am not having any issues so am sure it is not an issue with the database instance. Does anyone have experience with this? Error 1: ``` object.Exception@../../../.dub/packages/vibe-core-1.22.3/vibe-core/source/vibe/core/net.d(777): Reached end of stream while reading data. ``` https://github.com/vibe-d/vibe-core/blob/v1.22.3/source/vibe/core/net.d#L777 Apparently, no data is received anymore within the remaining time duration. Error 2: ``` object.Exception@../../../.dub/packages/vibe-d-0.9.4/vibe-d/data/vibe/data/bson.d(813): BSON value is type 'int_', expected to be one of [double_] ``` https://github.com/vibe-d/vibe.d/blob/v0.9.4/data/vibe/data/bson.d#L813 There is clearly something wrong with the type expected and provided. Check the schemes/layouts.
Re: Our New Pull-Request and Issue Manager
On Thursday, 24 February 2022 at 13:05:33 UTC, Mike Parker wrote: Everyone, please congratulate Dennis Korpel on his new job! Goed bezig! Veel plezier en succes Dennis.
Re: stripping binaries from LDC2
On Monday, 7 February 2022 at 13:14:19 UTC, max haughton wrote: On Monday, 7 February 2022 at 12:16:53 UTC, Arjan wrote: In c++ our release builds are build `-O2 -g` and the resulting binaries are stripped with GNU/strip. Is this also possible with LDC2 generated binaries for D code? So build D code with `-O2 -g` and then strip the resulting binary? Why build with debug info if you're going to strip it anyway? The stripped release binaries are going to the client, when a problem occurs get a core dump, using the core dump + the original binary / symbol gives full debug info off site. It is common practice.
stripping binaries from LDC2
In c++ our release builds are build `-O2 -g` and the resulting binaries are stripped with GNU/strip. Is this also possible with LDC2 generated binaries for D code? So build D code with `-O2 -g` and then strip the resulting binary?
Re: Visual D 1.2.0 supports Visual Studio 2022
On Saturday, 15 January 2022 at 09:06:23 UTC, Rainer Schuetze wrote: Hi, Visual D 1.2.0 has just been released. Major new features: * added support for Visual Studio 2022 Thank you very much, Rainer. Much appreciated!
Re: Why I Like D
On Wednesday, 12 January 2022 at 16:14:54 UTC, Steven Schveighoffer wrote: On 1/12/22 10:41 AM, Adam D Ruppe wrote: On Wednesday, 12 January 2022 at 15:25:37 UTC, H. S. Teoh wrote: However it turns out that unless you are writing a computer game, a high frequency trading system, a web server Most computer games and web servers use GC too. idk about hf trading. I know for sure that one was written in JAVA, using Azul C4 and other tech to maximize performance... Yeah, I had trouble agreeing with that statement too. Just wait for Paulo Pinto to join the conversation, he will happily refer a lot of tech and products using GC which are high performant and very successful ;-) I wonder if there is just so much fear of the GC vs people who actually tried to use the GC and it failed to suit their needs. I've never been afraid of the GC in my projects, and it hasn't hurt me at all. I think it stems from experience from long ago when JAVA was HOT and sold as the solution of all world problems, but failed to meet expectations and was dismissed because they found is was the GC what made it fail.. A lot of engineers just repeat the opinion of some guru they admire without fact checking. Although I've seen various serious performance issues with JAVA and python software, only once it was related to the GC..
Re: How to loop through characters of a string in D language?
On Friday, 10 December 2021 at 06:24:27 UTC, Rumbu wrote: On Wednesday, 8 December 2021 at 11:23:45 UTC, BoQsc wrote: Let's say I want to skip characters and build a new string. The character I want to skip: `;` Expected result: ``` abcdefab ``` Since it seems there is a contest here: ```d "abc;def;ghi".split(';').join(); ``` :) ```d "abc;def;ghi".tr(";", "", "d" ); ```
Re: KQueue and Fibers
On Friday, 9 April 2021 at 09:00:17 UTC, rashir wrote: Goodmorning everyone, I'm trying to understand both Kqueue and Fiber's operation on Mac. Why don't I get the correct data as long as I read from the socket? It seems to be reading too early, but Kquue tells me that the socket is readable. ... yield for readibility kqueue waiting for readibilty resuming fiber as it's readable 131858 read bytesRead: -1readableAmount:131858 errno:35 35 == EAGAIN This informs the operation (recv) could not complete without blocking and should be retried. This does not mean the socket is not readable, but the operation would block (for whatever reason).
Re: Vibe.d diet template help
On Sunday, 7 February 2021 at 00:05:51 UTC, Tim wrote: Hi all, I'm trying to render a diet template out to a WebSocket as a string to be inserted into a specific portion of the currently served page. Does anyone know how to go about this? Is the websocket really needed? Otherwise a plain XHR would be advised which would Just implie another handler.
Re: Using a betterC dub package in ordinary D
On Friday, 8 January 2021 at 20:19:59 UTC, Bastiaan Veelo wrote: Off topick, the original js implementation is documented to not generate results that are guaranteed to be correct. I could not find information on what the conditions are that cause deviations, and how large these then can be. Do you have an idea about this or experience with accuracy of the algorithm? I am looking into whether earcutd can replace GLU tesselation. We use the result for engineering purposes (not only visualisation) and correctness is important to us. I've used documentation and implementations from David Eberly at https://www.geometrictools.com/ and also on github nowadays to get 'correct' or at least 'predictable' behavior for various geometric challenges. Using this library solved various issues for us. The documentation is great!
Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'
On Tuesday, 29 December 2020 at 17:49:20 UTC, Steven Schveighoffer wrote: On 12/29/20 12:13 PM, Arjan wrote: On Tuesday, 29 December 2020 at 14:42:07 UTC, Steven Schveighoffer wrote: On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct structs only add context pointers if nested in functions (and even then, only if it's not POD). If nested in structs, classes, or unions (or anything else), then no context pointer is added. So the answer is, don't use static. That is what I discovered indeed. Thanks both for answering and the additional information. This could however be made more explicit and clear in the documentation.
Re: Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'
On Tuesday, 29 December 2020 at 14:42:07 UTC, Steven Schveighoffer wrote: On 12/29/20 7:38 AM, Arjan wrote: see https://en.cppreference.com/w/c/language/struct I added in some printouts of the addresses of the variables. It appears that if you add static to the struct, it now becomes a static member of the union, which means it's not an instance variable, and is now a thread-local variable. Its address doesn't even coincide remotely with the address of v1. What is the equivalent behavior for C that you are expecting? The usage of "static struct" doesn't appear in that page you linked to. On the C/C++ side there is no static. I added those on the D side to to make sure there is no context pointer being added, since that will change the layout and size of struct. (in the c/c++ code those unions and structs are nested several levels deep) Based on this: https://dlang.org/spec/struct.html#nested I expected to have the equivalent of C behavior in D by using the static keyword, which in this case just caused havoc. So the other way around.
Nasty supprise when using c 'anonymous struct and union' in D with 'static struct'
see https://en.cppreference.com/w/c/language/struct It seems the 'static' must NOT be used here to get the equivalent behavior of c, when left in the assertions will fail. Is this expected? ``` unittest { struct W { align(1): long k; long l; } struct V { align(1): union // anonymous union { /*static*/ struct // anonymous structure { long i; long j; } W w; } int m; } V v1; v1.i = 2; assert( 2 == v1.w.k ); v1.w.l = 5; assert( 5 == v1.j ); } ```
name enum vs static named enum
What is the usage of `static` in this? : ``` static enum Status { NONE, BUSY, ... } ```
Dub cmdline overrides?
Is there a cmdline switch to DUB to override certain dub.sdl settings for a dependency? Like the addition or override to lib dirs or link-libs? For example once and a while I run into linking issues with symbols not found due to the `soname` being different on my system than specified in some dependency dub.sdl. Or the lib path to the shared lib is different.
Re: How to use bootstrap with vibe.d.
On Thursday, 5 November 2020 at 16:22:11 UTC, Alaindevos wrote: This is from the bootstrap documentation. I think you must adapt this to .dt files. dt files are basically pugjs https://pugjs.org/ files. When you use vscode with this extension: https://marketplace.visualstudio.com/items?itemName=ditto.convert-html-to-pug It becomes easy to convert from html to pug/dt.
Re: How to use bootstrap with vibe.d.
On Thursday, 5 November 2020 at 16:22:11 UTC, Alaindevos wrote: This is from the bootstrap documentation. I think you must adapt this to .dt files. ``` ... ... html( lang='nl' ) head title #{pageTitle} meta( charset="utf-8") meta( name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" ) link( rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css; integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous") //- fontawesome icons from localhost link( rel="stylesheet" href="/css/fontawesome.css" ) link( rel="stylesheet" href="/css/brands.css" ) link( rel="stylesheet" href="/css/solid.css" ) body //- main page0 div.d-flex.flex-column.h-100 //- nav bar nav.navbar.navbar-expand-sm.sticky-top ... ``` Like this.
Re: Symmetry Investments and the D Language Foundation are Hiring
On Sunday, 30 August 2020 at 14:13:36 UTC, Mike Parker wrote: Looking for a full-time or part-time gig? Not only is Symmetry Investments hiring D programmers, they are also generously funding two positions for ecosystem work under the D Language Foundation. And they've put up a bounty for a new DUB feature. Read all about it here: https://dlang.org/blog/2020/08/30/symmetry-investments-and-the-d-language-foundation-are-hiring/ Fantastic! Thanks Symmetry!
Re: D binary io functions
On Sunday, 30 August 2020 at 06:00:20 UTC, Andy Balba wrote: going nuts trying to figure out which D functions will read/write binary files see this blog: http://nomad.uk.net/articles/working-with-files-in-the-d-programming-language.html
Re: Visual D 1.0.0 released
On Sunday, 5 July 2020 at 19:02:23 UTC, Rainer Schuetze wrote: I have added some documentation and screenshots here: https://rainers.github.io/visuald/visuald/Debugging.html#customization Thank you very much, Rainer. Your efforts on this and the gc are really appreciated.
Re: scope guard question
On Tuesday, 30 June 2020 at 12:18:14 UTC, Steven Schveighoffer wrote: On 6/30/20 2:56 AM, Arjan wrote: On Monday, 29 June 2020 at 22:47:16 UTC, Steven Schveighoffer wrote: [...] Thanks for the assurance. The spec does state it like this: ``` The ScopeGuardStatement executes NonEmptyOrScopeBlockStatement at the close of the current scope, rather than at the point where the ScopeGuardStatement appears. ``` Which is correct, but there is no single example with a return where the ScopeBlockStatement interferes with the return. I started wondering about this since I hit a bug in a piece of code. I can see where it would be confusing, and it could probably contain an example and clarification. -steve That would certainly be helpfull.
Re: scope guard question
On Monday, 29 June 2020 at 22:47:16 UTC, Steven Schveighoffer wrote: Yes. The return statement is inside the scope of the function, so it runs before the scope is exited. Are you saying the spec doesn't say that? Thanks for the assurance. The spec does state it like this: ``` The ScopeGuardStatement executes NonEmptyOrScopeBlockStatement at the close of the current scope, rather than at the point where the ScopeGuardStatement appears. ``` Which is correct, but there is no single example with a return where the ScopeBlockStatement interferes with the return. I started wondering about this since I hit a bug in a piece of code.
scope guard question
``` void main() { import std.stdio; auto f = (){ string[] t; { // inner scope t ~= "hello"; scope( exit ) t ~= "world"; } // inner scope exit return t; }; f().writeln; // ["hello", "world"] } ``` removing the inner scope in f() gives ["hello"] So when no inner scope is present, the scope exit 'runs' after the return? Is that indeed expected behavior according to the specification?
Re: On the D Blog: Lomuto's Comeback
On Thursday, 14 May 2020 at 13:26:23 UTC, Mike Parker wrote: After reading a paper that grabbed his curiosity and wouldn't let go, Andrei set out to determine if Lomuto partitioning should still be considered inferior to Hoare for quicksort on modern hardware. This blog post details his results. Blog: https://dlang.org/blog/2020/05/14/lomutos-comeback/ Reddit: https://www.reddit.com/r/programming/comments/gjm6yp/lomutos_comeback_quicksort_partitioning/ HN: https://news.ycombinator.com/item?id=23179160 A follow up article on this: https://news.ycombinator.com/item?id=23363165 https://blog.reverberate.org/2020/05/29/hoares-rebuttal-bubble-sorts-comeback.html
Vibed unix socket
I noticed vibe has gained support for unix sockets. What is unclear (at least from API docs) how to create a raw unix stream socket. should `listenTCP` and `connectTCP` be used? Seems weird because those require a 'port'..
Re: Visual D debugger tuple _expand_field
On Sunday, 23 February 2020 at 17:22:13 UTC, Rainer Schuetze wrote: On 20/02/2020 23:03, BetaDamnit wrote: _expand_field takes up a huge amount of space for no reason. I think tuple scan be safely listed like arrays. We know they are tuples, no need to display _expand_field=, it just takes up a lot of space in the display for no reason, specially if there are several elements in the tuple. This is the result of the compiler lowering the tuple to a number of variables ___field_. No info is generated about this being a structure-like compound. I have added support to the debugger to recombine these variables to an expandable array, but it wasn't actually trivial: https://github.com/rainers/mago/commit/451f856fd70a311460af1153ce1a1647059b5d89 It will be in the next release. Rainer, you worth more money! Thank you for your relentless effort and support, it is highly appreciated, at least by me. Thanks! Arjan
Re: Program exited with code -11
On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends wrote: Hey all, "Program exited with code -11" Not signal 11? On unix/linux I assume?
Re: Recommendations for best JSON lib?
On Sunday, 21 April 2019 at 02:09:29 UTC, evilrat wrote: On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky I also tried experimental std json, asdf and vibe.d. The only one that worked for me is vibe.d JSON subpackage, and What was the problem with asdf? I've succesfully used it in the past.
Re: Half-baked thought: Out-of-process asserts
On Tuesday, 4 September 2018 at 03:39:04 UTC, Nick Sabalausky (Abscissa) wrote: It seems pretty well established around here that: 1. Doing anything after a process has entered an unknown state is dangerous, and the more activity, the more danger (Note also, the transition to an unknown state actually occurs *before* any assert which is intended to detect it.) [...] Reminds me of google breakpad: https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/
install.sh gives Invalid signature error
Trying to execute the install.sh on a centos7.5 system gives an error: Invalid signature http://downloads.dlang.org/releases/2.x/2.080.1/dmd.2.080.1.linux.tar.xz.sig For each version I tried. Whats wrong?
Re: Remember the Vasa! by Bjarne Stroustrup
On Tuesday, 29 May 2018 at 01:46:47 UTC, Walter Bright wrote: A cautionary tale we should all keep in mind. http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0977r0.pdf https://www.reddit.com/r/programming/comments/8mq10v/bjarne_stroustroup_remeber_the_vasa_critique_of/ https://news.ycombinator.com/item?id=17172057 Hmm reminds me of this Scott Meyers talk: https://www.youtube.com/watch?v=ltCgzYcpFUI=youtu.be
Re: Favorite GUI library?
On Tuesday, 24 April 2018 at 18:43:54 UTC, H. S. Teoh wrote: This reminds me of Nick Sabalausky's rant once that back in the 80's we used to run programs on 64KB RAM and 8kHz CPUs, and lived with the slow performance, and nowadays we have GB's of RAM and multicore GHz CPUs, and we are finally able to write web apps that do basically the same things with about the same slow performance as in the 80's (but with many orders of magnitude greater resource consumption). Software has come a long ways indeed. :-D T https://www.artima.com/cppsource/how_to_go_slow.html
dub default settings
I find myself typing over and over again the same things like '-a x86_64'. Is it somehow possible to set those defaults?
Re: D beyond the specs
On Friday, 16 March 2018 at 19:27:40 UTC, Walter Bright wrote: On 3/16/2018 4:44 AM, Chris wrote: Would it be possible to find out at DConf in Munich why exactly D is so popular in Germany (my impression) and in other countries of Europe (and that general post code) like France, Italy, GB, Romania and Russia etc.? My old company's product, Zortech C++, was also very popular in Germany, England, and Japan. I don't know why. And a certain spot in the Netherlands, because at the time it outperformed all the others like Borland Watcom IBM/visual-age ms-visual-c++ and others at compilation speed and most of the time in execution speed as well. Besides since we used multiple compiler on our code base symantec/digitalmars often reported violations were the other happily accepted the code (and produced wrong code) And the incident response time from you was just marvelous, reported an issue, next morning a fixed compiler version in the emailbox! Beside that, I really appreciated the so called IDDE and accompanied srcs of libs. It was imo much much better than VC++ at the time. Have used it for a very long time even after Symantec ditched it. (borland f* up theirs by forcing the C++ builder upone us)
Re: howto run unittest of a single module in dub driven project?
On Monday, 5 March 2018 at 11:26:37 UTC, Atila Neves wrote: On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote: Is it somehow possible to only run the unittests of a single d file within a dub project? Of course without resorting to typing the complete commandline with all versions includes switches etc. You could use unit-threaded: http://code.dlang.org/packages/unit-threaded You'd still need to build everything, but `dub test` would take care of that. I started working on, and need to get back to, a way of only building one module and needed dependencies. Atila Thanx will take a look at it and yes that would be exactly what I was after!
Re: howto run unittest of a single module in dub driven project?
On Sunday, 4 March 2018 at 16:51:06 UTC, Basile B. wrote: [1] https://github.com/BBasile/Coedit/commit/f8c5e686c8c6aaa7dc2c770121767e3e59806a0e Thanks for givin me the idea original poster. Guess I will have to give coedit another try then.. ;-) So you do use dub behind the scenes so it seems? Care to elaborate a little on how you achieved this?
howto run unittest of a single module in dub driven project?
Is it somehow possible to only run the unittests of a single d file within a dub project? Of course without resorting to typing the complete commandline with all versions includes switches etc.
Re: Debugging bad requests with vibe
On Friday, 9 February 2018 at 11:46:31 UTC, Nicholas Wilson wrote: On Friday, 9 February 2018 at 08:06:53 UTC, Seb wrote: On Thursday, 8 February 2018 at 17:09:44 UTC, Nicholas Wilson wrote: Is there a way I can see/log what requests are being made? I can change both the client and server. -v and -vv All that gives me is a bunch of [FAC3BFF6:FAC451F6 dia] Actively closing TCP connection is there a way to get the JSON being sent? Wireshark?
Re: Vibe.d rest & web service?
On Wednesday, 7 February 2018 at 20:23:10 UTC, Nicholas Wilson wrote: On Wednesday, 7 February 2018 at 19:50:31 UTC, Jacob Carlborg wrote: Have you tried this? No. But apart from the fact that I forgot to make the class inherit from an interface to that the rest interface would actually compile, the web interface is routed before the rest interface and so the rest interface would never be reached since the methods are all the same and the REST's are shadowed by the web's . Makes me wonder whether or not vibe does honor the http request Accept headers? e.g.: application/json or application/javascript or text/html etc.
Re: Release D 2.078.1
On Wednesday, 31 January 2018 at 15:58:02 UTC, Atila Neves wrote: On Thursday, 25 January 2018 at 20:11:54 UTC, Rainer Schuetze wrote: On 25.01.2018 14:54, Atila Neves wrote: [...] Visual Studio is supposed to be detected by dmd now, either from the environment or from the registry. What errors do you get? Try running with -v to show the linker command line. $ dub init $ dub build --arch=x86_64 Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for x86_64. example ~master: building configuration "application"... Linking... LINK : fatal error LNK1104: cannot open file 'shell32.lib' -v shows that it's linking like so: C:\D\dmd2\windows\bin\dmd.exe -of.dub\build\application-debug-windows-x86_64-dmd_2078-70A25404824ECE07D24A9F4D03E746CD\example.exe .dub\build\application-debug-windows-x86_64-dmd_2078-70A25404824ECE07D24A9F4D03E746CD\example.obj -m64 -g Should I file a bug for dmd or the installer? Are 64-bit dub builds not done by CI on Windows? This is pretty embarassing. Atila By any chance, is this on a corperate machine? I've hit the same issue seems to do with enforced windows group-policy which disables registry access for certain type of applications at my place.
Re: Adding Markdown to Ddoc
On Thursday, 7 December 2017 at 10:21:21 UTC, Jacob Carlborg wrote: On 2017-12-06 05:11, Walter Bright wrote: https://help.github.com/articles/basic-writing-and-formatting-syntax/ Anyone interested in picking up the flag? (I know this has come up before, and I've been opposed to it, but I've changed my mind.) Finally :), this is awesome. Should we implement standard markdown, GitHub markdown or some other extension? Dang! And there you have it: endless complains and issues about the choosen flavour comming ahead of us now... :-( I would suggest: AsciiDoc! Why? see:http://ericholscher.com/blog/2016/mar/15/dont-use-markdown-for-technical-docs/
Re: R.filter!(..).sort!(..)
On Tuesday, 28 November 2017 at 13:24:09 UTC, Steven Schveighoffer wrote: On 11/28/17 8:10 AM, Arjan wrote: [...] The library is correctly telling you that your filtered range is not random access. It can't be, because it lazily applies the filter (that is, it filters on each element as you popFront them). So how can it know what the e.g. 3rd element is, if you haven't run any filters yet? The array version works because you are applying the filter completely and storing the results elsewhere in one step. -Steve Well I would have liked an error msg something like: isRandomAccessRange!Range for Range=.. failed! Or unable to sort!() a lazy Range.
R.filter!(..).sort!(..)
When applying a sort!() on a filtered range I get this compiler error: Error: template std.algorithm.sorting.sort cannot deduce function from argument types !((a, b) => a.name < b.name)(FilterResult!(__lambda3, RangeT!(Array!(IssueType, candidates are: C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\sorting.d(1851,1):std.algorithm.sorting.sort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r) if ((ss == SwapStrategy.unstable && (hasSwappableElements!Range || hasAssignableElements!Range) || ss != SwapStrategy.unstable && hasAssignableElements!Range) && isRandomAccessRange!Range && hasSlicing!Range && hasLength!Range) But it seems the problem is with the filter!() result not being a isRandomAccessRange!Range because: R.filter!(..).array.sort!(..) just works (by copying the filter results in a array). Iaw is the compiler error msg wrong? Or i'm I wrong?
Re: [OT] Windows dying
On Tuesday, 7 November 2017 at 13:59:26 UTC, codephantom wrote: But I think what really made it take off so fast and unexpectadly, was the convergence of mobile devices, mobile communication technology (i.e wifi, gps and stuff), and of course the internet... as well as the ability to find cheap labour overseas to build the produces on mass. The thing is apple combined (at the right time) the various things which made it very succesfull. - they learned from napstar, people are interessted in (buying) a single song => iPod + iTunes - they 'copied' that concept over to the iPhone with appstore For both they enabled not only business for themselfes but created platforms on which many parties external to apple were able to create succesfull business on. iaw its not the device itself what made it succesfull, its because it is part of a 'platform'
Re: London senior DevOps job and two London [D-ish] developer roles
On Thursday, 19 October 2017 at 20:01:20 UTC, Laeeth Isharc wrote: Hi. Symmetry Investments is looking to hire ... Please feel free to drop me a line if you're interested or know of someone who might be - for this role or for the others. How would one contact you?
Re: debugging in vs code on Windows
On Tuesday, 17 October 2017 at 03:10:52 UTC, Dmitry wrote: On Tuesday, 17 October 2017 at 02:32:49 UTC, Domain wrote: Can you share your tasks.json and launch.json? tasks.json - I don't have this file. launch.json: { "version": "0.2.0", "configurations": [ { "name": "(Windows) Launch", "type": "cppvsdbg", "request": "launch", "program": "${workspaceRoot}\\parser.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceRoot}", "environment": [], "externalConsole": true } ] } Also I have changed preferences: "debug.allowBreakpointsEverywhere": true, Status bar: x86_64 debug dmd Before this will work, one must install the Microsoft C/C++ Addin i.e. ms-vscode.cpptools. Start debugging and select the C++ debugger.
Re: Calling C++ "void foo(Klass&)"
On Thursday, 10 August 2017 at 00:32:40 UTC, Mengu wrote: my second question is: i have no idea what's going on in this file: https://github.com/whoshuu/cpr/blob/master/include/cpr/body.h i'd appreciate some pointers. A new 'type' named Body which IS-A std::string is defined. To construct a Body there are various options: The ctors 'default': Body(), 'copy': Body(const Body&) and 'move': Body(Body&&) ctors are using the compiler generated default implementation. The same is true for the assignment operators = Then a few explicit conversion ctors are defined to construct a Body from a const char* string and std::string. Explicit means the compiler is not allowed to implicit convert to std::string or const char* for provide args not being a const char* or std::string but for which a conversion exists. Since the h file also contains the definitions, the compiler must inline the code for the Body ctors and assignment operator. It also means not C/cpp file is needed since the function bodies are already in the h file. HTH
Re: Visual Studio Code code-d serve-d beta release
On Wednesday, 9 August 2017 at 05:24:37 UTC, Dmitry wrote: On Tuesday, 8 August 2017 at 17:13:18 UTC, WebFreak001 wrote: Use my other extension `code-debug` (or `Native Debug`) for that Is there somebody who used it successfully on Windows? You mean the code-debug? No because there is at least one bug in the mago-mi, I once had a fix for it but seem not to have made it into a PR. Besides that bug(fix) I did run into other issues preventing succesfull use, unfortunately. code-d yes works fine on windows though, as on linux, one must build dcd-server and dcd-client, dscanner, (dfmt) and put it in the search path or provide the locations to those executables in the settings file. (did not yet try the new code-d serve-d)
Re: Visual Studio Code code-d serve-d beta release
On Tuesday, 8 August 2017 at 17:27:30 UTC, Johannes Pfau wrote: Am Tue, 08 Aug 2017 17:13:18 + schrieb WebFreak001 <d.fo...@webfreak.org>: On Tuesday, 8 August 2017 at 08:03:05 UTC, Arjan wrote: > Small request: could the setting "d.stdlibPath" be inferred > from the compiler in use? DMD and LDC both have a conf file > in which the paths are already set. oh cool I didn't know that, is there a standard path to where these conf files are though? The D frontend (and therefore all compilers) already has code to print the import paths. Unfortunately this code is only used when an import is not found: -- test.d:1:8: Fehler: module a is in file 'a.d' which cannot be read import a; ^ import path[0] = /usr/include/d import path[1] = /opt/gdc/lib/gcc/x86_64-unknown-linux-gnu/4.9.4/include/d -- It should be trivial though to refactor this code and add a command-line switch to dump the import path. See Module::read in dmodule.c. If Walter opposes adding this to DMD (one more command line switch!) we could probably still add it to GDC glue. This code is all you need: if (global.path) { for (size_t i = 0; i < global.path->dim; i++) { const char *p = (*global.path)[i]; fprintf(stderr, "import path[%llu] = %s\n", (ulonglong)i, p); } } -- Johannes Even better! But when this is rejected, one could also trigger it by feeding a deliberate wrong file to the compiler... Another option is to build a simple hello.d with the -v flag which will reveal the location of the binary the location of the config file used and also the import paths and lib paths so it seems.
Re: Visual Studio Code code-d serve-d beta release
On Saturday, 5 August 2017 at 22:43:31 UTC, WebFreak001 wrote: ... Thanks a lot! Will give it a try. Small request: could the setting "d.stdlibPath" be inferred from the compiler in use? DMD and LDC both have a conf file in which the paths are already set. What about the debugging experience? Plans to integrate that as well? Keep up the good work!
Re: Are there any known remaining deadlock bugs in OPTLINK?
On Thursday, 25 May 2017 at 14:16:41 UTC, Vladimir Panteleev wrote: - Does OPTLINK use threads or thread synchronization primitives? - Is anyone aware of any threading/deadlock bugs in OPTLINK? - Any known workarounds? Like setting CPU affinity? Back in the days when I was using the DigtalMars C++ compiler on almost a daily basis I always setted CPU affinity on HT/multicore machines for optlink.exe to avoid lockups. I'm not aware whether or not there have been any fixes or changes to optlink.exe over the past 8 years regarding this issue.
Re: Binderoo - we're open sourcing our binding system
On Tuesday, 16 August 2016 at 14:31:54 UTC, Ethan Watson wrote: Slides are up at http://www.slideshare.net/EthanWatson5/d-using-an-emerging-language-in-quantum-break I'm getting an error and can't see the slide content. Is it just me?
Re: How are you enjoying DConf? And where to go next?
On Friday, 6 May 2016 at 14:13:35 UTC, Andrei Alexandrescu wrote: The atmosphere here is great, and I'm curious how it feels for those who are watching remotely. Is the experience good? What can we do better? Also: we're talking about the DConf 2017 location. Please share any initial thoughts! Thanks, Andrei I was not able to watch live much. But the parts I did were OK. Audio was good enough, video I would have liked to be a bit better, but do-able. A very good idea to have the slides available upfront! I watched the most in the made available streams afterwards. Easy to pick and select the topics of interest. IMO it is great to have the content available right after/during the current day. The atmosphere was even noticeable in the video stream, for me at least. To me it seems like a really great and inspirational conference! Location, personally doesn't matter much to me since I'm most probably not able to attend anyway. But maybe Japan/Korea? Topics and niveau, you did not ask but will give my opinion anyway, the diversity is good, the level of the talks I saw were for people not to intemit with the language and its eco system possibly a bit to high / abstract. I don't know whether or not there is a specific group targeted by dconf but when one of its (main) purposes is to attract new people from other language- eco systems, then IMO there should be given a bit more thought on the content topics and niveau. When this is not the purpose then its all fine. About attracting people to D, my experience is that beside the language zealots which will never change to different language eco system, most developers do not look around and select the best tools for the job at hand, they just look back into to their experience-toolbox and start solving the problem using the tools and technologies their familiar with, even though better tools are readily available. IMO D offers for a lot, a near perfect fit for a lot of problems, but fails in 'marketing' department. Most professionals I met never heard of D or never tried it (to much hassle). When they try it out it is not only the first 5 minutes, but the first project that matters. Most of them never finish that project in D Feedback I get: - integration in tooling not good enough (VisualD is of help, but seems to fail) - debugging problems(!!!) - documentation for beginners not easy to find or follow. - just to much of a hassle I hope we can improve on this. Arjan
Re: DConf keynote speaker ideas
On Tuesday, 17 November 2015 at 18:47:58 UTC, Andrei Alexandrescu wrote: I'm thinking of inviting a notable industry luminary to deliver a conference keynote. Please reply to this with ideas! -- Andrei Chris Lattner Howard Hinnant Bill Joy Ray Kurzweil
Re: Shout out to D at cppcon, when talkign about ranges.
On Wednesday, 30 September 2015 at 01:55:43 UTC, deadalnix wrote: On Wednesday, 30 September 2015 at 01:45:49 UTC, deadalnix wrote: https://www.youtube.com/watch?v=mFUXNMfaciE From http://wiki.dlang.org/Component_programming_with_ranges Congrat H. S. Teoh Shared on reddit: https://www.reddit.com/r/programming/comments/3mwu4e/cppcon_2015_eric_niebler_ranges_for_the_standard/ Also disappointed by Herb talk. It was very interesting, but he was blatantly dishonest when comparing other languages. He goes to claim GC in other languages is costly (it is) but then goes to propose "cost free" smart pointer kind of solution that are not cost free. Many paper show how both solution are on a continuum and he MUST know this. I had the same feeling, as a lot of the ideas clearly comes from languages (like D / Rust / ..) but were presented to the public as inventions of their own.
Re: This Week in D #23 - Interview with Dmitry Olshansky, dmd beta, std.experimental.color
On Monday, 29 June 2015 at 03:46:55 UTC, Adam D. Ruppe wrote: http://arsdnet.net/this-week-in-d/jun-28.html great interview.
Re: best way to interface D code to Excel
On Wednesday, 17 June 2015 at 18:35:36 UTC, Laeeth Isharc wrote: Hi. Any thoughts on the best way to write D functions that I can call from Excel? I am completely unfamiliar with Windows programming and COM (last time I wrote this kind of thing was in the mid-90s I think using xloper and C). The easiest way for now seems to be via pyxll and pyd. Wrap the D function using pyd and then call it from an annotated pyxll python function. That's probably good enough for a start, but it requires python to be installed on each user machine which I would rather not have as the end game - just a single xll would be perfect. I know D has support for COM - not sure of its status. And there was a Microsoft chap who posted here a couple of years back - wonderful templated code that made it easy to write this kind of thing. Unfortunately he wasn't able to share it publicly. So I would like to write: 1. worksheet function that will function picker and have help text in the picker. In general will take some combination of strings, doubles and arrays of doubles as arguments and return either string, double, or range/matrix of doubles. 2. vba function with similar kinds of arguments and return values. I know it's easy to do this with double** and the like - at least on the VBA side. I got a bit stuck navigating the headers when it comes to Excel strings. If anyone has some source they could point me to, and some reading material then I would very much appreciate it. This might help facilitate adoption of D within a large financial institution, but it is early days yet. And I would guess this is a common sort of use for people operating in a financial environment, since people are still attached to spreadsheets. Thanks. Laeeth. You actually want to create ActiveX/COM components in D? See the 'COM in plain C' articles by Jeff Glatt which demonstrate how to do it using C. This might give you the information needed to do it using D. http://www.codeproject.com/Articles/Jeff-Glatt#articles. An idea to accelerate a little might be to use Visual Studio with C++ to create ActiveX/COM interfaces, wrappers, etc of the components and do the actual implementation of the interfaces in D. Books (old): Inside COM and Essential COM might be handy to get hold of. HTH. Arjan
Re: A few notes on choosing between Go and D for a quick project
One underused resource seems to be all the examples bearophile has put on Rosetta Code: http://rosettacode.org/wiki/Category:D Indeed, I found myself frequently looking though these examples. Thank you bearophile! If he, Adam, or some other proficient D user were to do a weekly series breaking down each of those 733 examples one at a time- what idioms were used, why certain variations were more efficient- that could go a long way to introduce the language and its idioms to beginners. +1000
Re: Dutch D Meetup
On Monday, 23 February 2015 at 21:07:04 UTC, George Sapkin wrote: Seems like there are some local meetups starting across the globe, but no Dutch one so far. Are there any D users from the Netherlands that would want to meetup and share their D stories? Cheers. I would surely come. Though have not really anything to share yet.
Re: dub.json dependencies per configuration?
On Wednesday, 11 February 2015 at 01:06:02 UTC, Mike Parker wrote: On 2/11/2015 8:38 AM, Arjan wrote: Snippet from: https://github.com/buggins/ddbc/blob/master/dub.json#L7 ddbc has a dependencies on mysql-native: =0.0.12. But this is only true for configurations: MySQL. Is it allowed to put the dependency within the configuration section for MySQL?. Yes. I moved the dependencies into the configuration of MySQL, but no dice. It is accepted by dub but does not make a difference when selecting an other configuration. e.g. dub build -f -c SQLite -a x86 still fetches and builds the mysql-native. Is this behavior of dub expected or a bug?
dub.json dependencies per configuration?
Snippet from: https://github.com/buggins/ddbc/blob/master/dub.json#L7 ddbc has a dependencies on mysql-native: =0.0.12. But this is only true for configurations: MySQL. Is it allowed to put the dependency within the configuration section for MySQL?. dependencies: { mysql-native: =0.0.12 }, targetPath: lib, targetType: staticLibrary, configurations: [ { name: full, versions: [USE_MYSQL, USE_SQLITE, USE_PGSQL], libs-posix: [sqlite3, pq], libs-windows: [sqlite3, libpq], copyFiles-windows-x86: [ libs/win32/sqlite3.dll, libs/win32/libpq.dll, libs/win32/intl.dll ], sourceFiles-windows-x86 : [ libs/win32/sqlite3.lib, libs/win32/libpq.lib ] }, { name: MySQL, versions: [USE_MYSQL] }, { name: SQLite, versions: [USE_SQLITE], libs-posix: [sqlite3], libs-windows: [sqlite3], copyFiles-windows-x86: [ libs/win32/sqlite3.dll ], sourceFiles-windows-x86 : [ libs/win32/sqlite3.lib ] }, { name: PGSQL, versions: [USE_PGSQL], libs-posix: [pq], libs-windows: [libpq], copyFiles-windows-x86: [ libs/win32/libpq.dll, libs/win32/intl.dll ], sourceFiles-windows-x86 : [ libs/win32/libpq.lib ] } ]
Re: Learning to XML with D
On Friday, 6 February 2015 at 09:15:54 UTC, Derix wrote: So, I set sails to transform a bunch of HTML files with D. This, of course, will happen with the std.xml library. There is this nice example : http://dlang.org/phobos/std_xml.html#.DocumentParser that I put to some use already, however some of the basics seem to escape me, specially in lines like xml.onEndTag[author] = (in Element e) { book.author = e.text(); }; OK, we're doing some event-base parsing, reacting with a lambda function on encountering so-and-do tag, à la SAX. (are we ?) What I don't quite grab is the construct (in Element e) , especially the *in* part. Is it *in* as in http://dlang.org/expression.html#InExpression ? In which case I fail to see what associative array we're considering. It's probably more a way to further qualify the argument e were passing to the λ-function : could someone elaborate on that ? Of course, it is entirely possible that I completely miss the point and that I'm overlooking some fundamentals, if so have mercy and help me find my way back to teh righteous path ;-) Thxxx Maybe, when you're on windows, you could use msxml6 through COM. You have DOM, SAX, Xpath 1.0 and XSLT at your disposal.
Re: Why hibernated does not create tables automatically?
On Friday, 6 February 2015 at 09:42:09 UTC, zhmt wrote: class Card { import hibernated.core; @Id @Generated long id; @UniqueKey string pwd; } MySQLDriver driver = new MySQLDriver(); string url = MySQLDriver.generateUrl(10.211.55.10, 3306, test); string[string] params = MySQLDriver.setUserAndPassword(root, xxx); auto ds = new ConnectionPoolDataSourceImpl(driver, url, params); EntityMetaData schema = new SchemaInfoImpl!(Card); Dialect dialect = new MySQLDialect(); auto factory = new SessionFactoryImpl(schema, dialect, ds); Card c = new Card; auto s = factory.openSession(); scope(exit) s.close(); s.save(c); Here is the simplest example, but it complains the same error. OK, Before the call auto s = factory.openSession(); Does de mysql db has a db called 'test' and a table called 'card' with columns named 'id' and 'pwd'? If not call: factory.getDBMetaData().updateDBSchema( conn, true, true ); verify the table is created in mysql. After create call: factory.openSession(); ... If things are still failing take a look here: https://github.com/buggins/hibernated/blob/master/hdtest/source/htestmain.d This is a simple program testing some basic functions of hibernated. Try it with sqlite first after that add a mysql section and try again.
Re: Why hibernated does not create tables automatically?
On Friday, 6 February 2015 at 08:53:12 UTC, zhmt wrote: The app compiles fine, but It throw an exception when I try to save data to mysql : hibernated.type.MappingException@../../../zhmt/.dub/packages/hibernated-0.2.19/source/hibernated/metadata.d(3332): Cannot find entity by class ezsockacount.Dao.Customer My initialization code is something like: MySQLDriver driver = new MySQLDriver(); string url = MySQLDriver.generateUrl(10.211.55.10, 3306, test); string[string] params = MySQLDriver.setUserAndPassword(root, xxx); ds = new ConnectionPoolDataSourceImpl(driver, url, params); EntityMetaData schema = new SchemaInfoImpl!(Customer,Card,Agent); Dialect dialect = new MySQLDialect(); factory = new SessionFactoryImpl(schema, dialect, ds); Connection conn = ds.getConnection(); scope(exit) conn.close(); DBInfo db = factory.getDBMetaData(); db.updateDBSchema(conn, false, true); I checked the static EntityInfo [] entities; in SchemaInfoImpl, the length of entites is 0. And tables in mysql is not created automatically either. I found the point of this question, but dont know how to resolve it? Will anybody help me? Thx ahead!! IFAIK partial creation does not work. (bug?) Use db.updateDBSchema( conn, true, true) make sure none of the entities exist in the database. Otherwise it will fail. hth.
Re: Problem interfacing with GSL
On Sunday, 30 November 2014 at 16:26:53 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: On 30/11/14 13:21, Arjan via Digitalmars-d-learn wrote: Hi! D noob here. I'm trying to call this function from the GSL lib: Out of curiosity (since your question has already been answered), what functionality is it that is making you want to use GSL? I ask because I want to be sure we're not missing something we ought to have in Phobos. I'm taking a course in statistical inference and uncertainty, since I'm learning D, i thought I'd do some numerical computing in it. Does there exist a library so I can stick in D only?
Problem interfacing with GSL
Hi! D noob here. I'm trying to call this function from the GSL lib: double gsl_stats_long_double_mean (const long double [], const size_t, const size_t); linking with: -L-lgsl -L-lgslcblas -L-lm I have tried different configurations, refering to http://dlang.org/interfaceToC.html and the forums, but it always gives me probems like, calling it the wrong way or segmentation falt. Can anyone help? Arjan
Re: Problem interfacing with GSL
On Sunday, 30 November 2014 at 13:09:15 UTC, John Colvin wrote: On Sunday, 30 November 2014 at 12:21:51 UTC, Arjan wrote: Hi! D noob here. I'm trying to call this function from the GSL lib: double gsl_stats_long_double_mean (const long double [], const size_t, const size_t); linking with: -L-lgsl -L-lgslcblas -L-lm I have tried different configurations, refering to http://dlang.org/interfaceToC.html and the forums, but it always gives me probems like, calling it the wrong way or segmentation falt. Can anyone help? Arjan the correct signature in D for that would be: import core.std.config; double gsl_stats_long_double_mean(const(c_long_double)*, const size_t, const size_t); I admit i was far from getting it right :), and was unaware of core.std.config functionalities. Thanks! Arjan.
Re: Example of the perils of binding rvalues to const ref
On Tuesday, 16 September 2014 at 15:30:49 UTC, Andrei Alexandrescu wrote: http://www.slideshare.net/yandex/rust-c C++ code: std::string get_url() { return http://yandex.ru;; } string_view get_scheme_from_url(string_view url) { unsigned colon = url.find(':'); return url.substr(0, colon); } int main() { auto scheme = get_scheme_from_url(get_url()); std::cout scheme \n; return 0; } string_view has an implicit constructor from const string (see basic_string_view(const basic_stringcharT, traits, Allocator str) noexcept; in https://isocpp.org/files/papers/N3762.html). The function get_url() returns an rvalue, which in turn gets bound to a Forgive me my ignorance but get_url() returns a std::string (on the stack), so its address can be token. And iirc the explainer Scott Meyers explained once iff you can take its address its not a rvalue its a lvalue. So isn't the get_scheme_from_url() not simply holding a const ref to temporary? (which most compiler warn about) ...Or am I missing the point? reference to const and implicitly passed to string_view's constructor. The obtained view refers to a dead string. Andrei
Re: D Users Survey: Primary OS?
On Thursday, 29 May 2014 at 18:24:57 UTC, Tom Browder via Digitalmars-d wrote: Has anyone done a survey of the primary OS of D users? I (a D newbie) use Debian Linux (64-bit), but I get the feeling that many (if not most) users are on some version of Windows. Thanks. Best regards, -Tom Windows-7, opensuse-12.3/thumbleweed, FreeBSD-9/10 32 and 64 bits.
Re: Video of my LDC talk @ FOSDEM'14
Enjoy! Besides the noise, I did! Great talk! And thanks for your efforts to make LDC a success.
Re: SQLite3
On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me like some forums. Now to the questions: I'm searching for a quick and easy way to integrate SQLite3 in my application. maybe: https://github.com/buggins/ddbc/wiki ? I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln(SUCCESS); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help? Did you specify the configuration to use to dub? dub -c SQLite
Re: SQLite3
On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote: On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me like some forums. Now to the questions: I'm searching for a quick and easy way to integrate SQLite3 in my application. maybe: https://github.com/buggins/ddbc/wiki ? I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln(SUCCESS); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help? Did you specify the configuration to use to dub? dub -c SQLite Yes. I've also linked the library to it. Dub: http://puu.sh/8DYrR.png Code::Blocks Configuration: http://puu.sh/8DYug.png Ah ok. CodeBlocks does not integrate with dub. Take a look in the dub.json file of ddbc and collect the 'versions' for the SQLite configuration (USE_SQLITE) Add those 'versions' to the DMD commandline n codeblocks: dmd.exe -version=USE_SQLITE -version=...
Re: DOSNEWSIZE Error
On Thursday, 8 May 2014 at 14:49:09 UTC, Jack wrote: I had a compiler error with just a DOSNEWSIZE Error with no more information. Code: http://pastebin.com/UDAgmjtx I was trying to learn to implement SQLite connections to a local file with only the path to the file and no port or localhost nonesense from this : https://github.com/buggins/ddbc/wiki I tried a google search about the error but so far it landed me into a post with no replies, and various other non-D related posts. Optlink error. Are you builing a x86_32 exe or x86_64 exe? when 32 bits use the dmd -m32 and make sure to use omf libs. when 64 bits don not use optlink but MS VS link.exe and use coff libs.
Re: SQLite3
On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me like some forums. Now to the questions: I'm searching for a quick and easy way to integrate SQLite3 in my application. maybe: https://github.com/buggins/ddbc/wiki ?
Re: Top-3 for 2.066
https://d.puremagic.com/issues/show_bug.cgi?id=11902 +1 https://d.puremagic.com/issues/show_bug.cgi?id=12244 +1
UDA initialize a user defined type attribute field
When a user defined type is used as an attribute like this: // the attribute struct MyAttrib { immutable string name; imuttable int sz; immutable string defaultvalue; } // using the attribute class Data { // field 'id' has attribute MyAttrib with name and sz set to 'fancy name' // and 10 resp. @MyAttrib( fancy name, 10 ) long id; ... } But how do I only set the MyAttrib.defaultvalue? class OtherData { //@MyAttrib( ??defaultvalue = null ?? ) //@MyAttrib( string.init, int.init, null ) //seems to work? long id; ... } MyAttrib instances may be initialized like this: auto myattrib = { defaultvalue:null }; But this seems not possible when using MyAttrib as attribute.
Re: UDA initialize a user defined type attribute field
On Tuesday, 18 February 2014 at 23:46:28 UTC, Adam D. Ruppe wrote: On Tuesday, 18 February 2014 at 23:43:56 UTC, Arjan wrote: But how do I only set the MyAttrib.defaultvalue? You could do it by adding a constructor to MyAttrib that only takes one string and fills it in that way. But what happens than when only the first field 'name' is used in MyAttrib like this: class OtherData { @MyAttrib( fancy name ) long id; ... } I guess the field MyAttrib.defaultvalue will be assigned the value fancy name?
Re: Mono-D v1.5.2 - Completion improvements, dub support fixes
On Sunday, 16 February 2014 at 11:49:08 UTC, Rene Zwanenburg wrote: On Saturday, 15 February 2014 at 20:28:03 UTC, Alexander Bothe 5) Could you pastebin me your last log file(s) please? (You can open the folder via 'Help' menu - Open Log directory) Parts of the log file is Dutch (OS language), Xamarin Studio language is set to English but most of the interface and even the log files are unaffected. I guess I'll have to take that up with the Mono Develop devs. No it is not the OS language but the location setting of the OS I guess, I have Windows 7 64 bits English and the Monodevelop/Xamarin studio default language is still Dutch... Had to set it manually to English in the options.
Re: Struct-typing in Phobos
On Wednesday, 5 February 2014 at 23:47:03 UTC, Chris Williams wrote: Nice and clear write up. I would love to see more of these kind of articles.
Re: [OT] Good or best Linux distro?
How's the FreeBSD documentation / community? Is it easy to find solutions? I'm a long time FreeBSD user. I've always found the documentation quality outstanding. Never had any difficulty to find answers or solutions. Besides FreeBSD has a web forum and mailing list with lots of helpfull people attending. I'm also using OpenSUSE since 10.0 days. And debian on and off since the 4.0 days. I use D (self build from github sources) on FreeBSD OpenSUSE and windows. (On windows sometimes also the prebuid binaries.) As DE I prefer KDE.
Re: Array of pointers
Keep in mind that, unlike in c++, D classes are reference types: class Node { Node[] nodes; // This is valid } Structs are value types though, so using a struct in the above example is illegal. You mean: struct Node { Node[] nodes; } or struct Node { Node*[] nodes; } ? Works both. What's not working is this: struct Node { Node node; } I wanted to heap allocate Nodes which connect to each other via pointers. Since each Node connects to multiple others i came up with this solution. class Node { auto content; Node*[] nodes; //..constructor.. }
Re: Array of pointers
Nodes are reference types in D, so probably you don't need to use a * for Node. Alternatively use a struct handled by pointer. auto content; can't compile, you need a type, or you have to template Node on T and use it for content. Bye, bearophile Youre right, it compiles now, and the object generated is of the same size. I'm still confusing with C. I have some experience with C experience, so I still have to learn tamplates. Thaks for the help. Arjan
Array of pointers
Hi. I started my first program in D (I have a little experience in c). I wanted to create an array of pointers for creating a node with multiple connections. In C you can make one directly (node *nedePtr[]). What is the equivalent for the D's syntax?? Regards Arjan
Re: Array of pointers
On Thursday, 16 January 2014 at 09:00:18 UTC, Namespace wrote: On Thursday, 16 January 2014 at 08:55:43 UTC, Arjan Fetahu wrote: Hi. I started my first program in D (I have a little experience in c). I wanted to create an array of pointers for creating a node with multiple connections. In C you can make one directly (node *nedePtr[]). What is the equivalent for the D's syntax?? Regards Arjan node*[] nedePtr; Ok. Thank You!
Re: Databases daemons
On Monday, 6 January 2014 at 05:27:38 UTC, chuck wrote: My first post. :) My question is: does Phobos or another standard library have intentions to make it easier to connect to a database (either Postgresql, see: http://code.dlang.org/packages/ddbc see: http://vibed.org/docs#db-support
Re: GuitarHero/RockBand fans... side project anyone?
Have you heard of Frets on Fire? http://en.wikipedia.org/wiki/ Frets_on_Fire I remember trying this out several years ago, though it didn't really have that smoothe Guitar Hero feel. Yes, it's fucking terrible. It's also written in Java, which might partly explain the first bit... I'm pretty sure it has been written in python (to prove one could write games using python), also there is FoFix a (better?) clone also python. My kids do play FoFix from time to time. But nothing beats minecraft.
Re: GuitarHero/RockBand fans... side project anyone?
On Thursday, 12 December 2013 at 14:52:10 UTC, Manu wrote: On 13 December 2013 00:38, Arjan ar...@ask.me.to wrote: Have you heard of Frets on Fire? http://en.wikipedia.org/wiki/ Frets_on_Fire I remember trying this out several years ago, though it didn't really have that smoothe Guitar Hero feel. Yes, it's fucking terrible. It's also written in Java, which might partly explain the first bit... I'm pretty sure it has been written in python (to prove one could write games using python), also there is FoFix a (better?) clone also python. My kids do play FoFix from time to time. But nothing beats minecraft. Oh yeah, you're probably right. I just remembered that it wasn't written in a real language ;) It doesn't feel very tight, and the synchronisation window is super wide. I suspect this is because the libraries they use aren't really meant for low-latency real-time use, and they have no access to the hardware/drivers directly, so they have to allow for a huge margin of error. I have no idea what is required for a game like that, but I've been on a project where python is used in machine control (wafer handling) at control frequencies / sampling rates up to 100Hz. Although 100Hz was not achieved easily. Indeed no direct access to hw/drivers from python it usually goes through c-wrappers.
Re: dmd 2.064.2 stuck compiling code?
On Wednesday, 20 November 2013 at 08:44:47 UTC, Arjan wrote: On Tuesday, 19 November 2013 at 21:19:13 UTC, michaelc37 wrote: On Tuesday, 19 November 2013 at 10:30:15 UTC, Arjan wrote: On Tuesday, 19 November 2013 at 02:07:18 UTC, michaelc37 wrote: On Monday, 18 November 2013 at 08:30:05 UTC, Arjan wrote: On Monday, 18 November 2013 at 04:17:25 UTC, Brian Schott wrote: On Monday, 18 November 2013 at 02:18:34 UTC, michaelc37 wrote: I have an issue where dmd v2.064.2 never finishes compiling (hangs) i'm trying to recompile my patched up fork of qtd (https://github.com/michaelc37/qtd) but the code never stops compiling (it was compiling with v2.063.2). any suggestions on how to investigate this further? Possibly related: https://github.com/Hackerpilot/DCD/issues/79 I had the same problems when building Dscanner on OpenSUSE(32) bits, on FreeBSD-9(64) it core dumps. The backtrace shows an endless list of: #0 0x0.. FuncDeclaration::overloadInsert () #1 0x0.. FuncDeclaration::overloadInsert () #2 0x0.. FuncDeclaration::overloadInsert () .. Haven't had the time to investigate this further. This happens with dmd build form the the master/HEAD(ff81ae9) i think i tracked down the commit that caused this issue for me it seems to be this. https://github.com/D-Programming-Language/dmd/commit/5f0c3a12de2a15116fac109b39912bfcb22842b8 using a dmd built on the commit before it does not hang. https://github.com/D-Programming-Language/dmd/commit/435af3171f488c7857c2d2859c1c99981de19506 Great! Did you already report this bug here? https://d.puremagic.com/issues/ Not yet, I'm still trying to isolate the issue out of an enormous amount of *.d files. Once i can get to that, i can paste the minimum amount of coded needed to reproduce the issue to https://d.puremagic.com/issues/. OK. Thanks for doing this. Maybe dustmite can be of help? https://github.com/CyberShadow/DustMite/wiki The code snippet is reduced using dustmite and causes DMD to coredump on FreeBSD and compile forever on Linux. Version dmd FreeBSD: DMD64 D Compiler v2.065-devel-b6b240b Version dmd Linux: DMD32 D Compiler v2.065-devel-be98dbb Maybe someone is willing to file this in bugzilla as I have no account. ---8-- public: /** * Represents a D token */ struct Token { TokenType type; } /** * Listing of all the tokens in the D language. */ enum TokenType: ushort { invalid} import std.algorithm; /** * Parser structure */ class Parser { bool peekIsOneOf(TokenType[] types...) { canFind(types, tokens[1].type); } const(Token)[] tokens; }
Re: dmd 2.064.2 stuck compiling code?
On Tuesday, 19 November 2013 at 21:19:13 UTC, michaelc37 wrote: On Tuesday, 19 November 2013 at 10:30:15 UTC, Arjan wrote: On Tuesday, 19 November 2013 at 02:07:18 UTC, michaelc37 wrote: On Monday, 18 November 2013 at 08:30:05 UTC, Arjan wrote: On Monday, 18 November 2013 at 04:17:25 UTC, Brian Schott wrote: On Monday, 18 November 2013 at 02:18:34 UTC, michaelc37 wrote: I have an issue where dmd v2.064.2 never finishes compiling (hangs) i'm trying to recompile my patched up fork of qtd (https://github.com/michaelc37/qtd) but the code never stops compiling (it was compiling with v2.063.2). any suggestions on how to investigate this further? Possibly related: https://github.com/Hackerpilot/DCD/issues/79 I had the same problems when building Dscanner on OpenSUSE(32) bits, on FreeBSD-9(64) it core dumps. The backtrace shows an endless list of: #0 0x0.. FuncDeclaration::overloadInsert () #1 0x0.. FuncDeclaration::overloadInsert () #2 0x0.. FuncDeclaration::overloadInsert () .. Haven't had the time to investigate this further. This happens with dmd build form the the master/HEAD(ff81ae9) i think i tracked down the commit that caused this issue for me it seems to be this. https://github.com/D-Programming-Language/dmd/commit/5f0c3a12de2a15116fac109b39912bfcb22842b8 using a dmd built on the commit before it does not hang. https://github.com/D-Programming-Language/dmd/commit/435af3171f488c7857c2d2859c1c99981de19506 Great! Did you already report this bug here? https://d.puremagic.com/issues/ Not yet, I'm still trying to isolate the issue out of an enormous amount of *.d files. Once i can get to that, i can paste the minimum amount of coded needed to reproduce the issue to https://d.puremagic.com/issues/. OK. Thanks for doing this. Maybe dustmite can be of help? https://github.com/CyberShadow/DustMite/wiki
Re: dmd 2.064.2 stuck compiling code?
On Tuesday, 19 November 2013 at 02:07:18 UTC, michaelc37 wrote: On Monday, 18 November 2013 at 08:30:05 UTC, Arjan wrote: On Monday, 18 November 2013 at 04:17:25 UTC, Brian Schott wrote: On Monday, 18 November 2013 at 02:18:34 UTC, michaelc37 wrote: I have an issue where dmd v2.064.2 never finishes compiling (hangs) i'm trying to recompile my patched up fork of qtd (https://github.com/michaelc37/qtd) but the code never stops compiling (it was compiling with v2.063.2). any suggestions on how to investigate this further? Possibly related: https://github.com/Hackerpilot/DCD/issues/79 I had the same problems when building Dscanner on OpenSUSE(32) bits, on FreeBSD-9(64) it core dumps. The backtrace shows an endless list of: #0 0x0.. FuncDeclaration::overloadInsert () #1 0x0.. FuncDeclaration::overloadInsert () #2 0x0.. FuncDeclaration::overloadInsert () .. Haven't had the time to investigate this further. This happens with dmd build form the the master/HEAD(ff81ae9) i think i tracked down the commit that caused this issue for me it seems to be this. https://github.com/D-Programming-Language/dmd/commit/5f0c3a12de2a15116fac109b39912bfcb22842b8 using a dmd built on the commit before it does not hang. https://github.com/D-Programming-Language/dmd/commit/435af3171f488c7857c2d2859c1c99981de19506 Great! Did you already report this bug here? https://d.puremagic.com/issues/
Re: dmd 2.064.2 stuck compiling code?
On Monday, 18 November 2013 at 04:17:25 UTC, Brian Schott wrote: On Monday, 18 November 2013 at 02:18:34 UTC, michaelc37 wrote: I have an issue where dmd v2.064.2 never finishes compiling (hangs) i'm trying to recompile my patched up fork of qtd (https://github.com/michaelc37/qtd) but the code never stops compiling (it was compiling with v2.063.2). any suggestions on how to investigate this further? Possibly related: https://github.com/Hackerpilot/DCD/issues/79 I had the same problems when building Dscanner on OpenSUSE(32) bits, on FreeBSD-9(64) it core dumps. The backtrace shows an endless list of: #0 0x0.. FuncDeclaration::overloadInsert () #1 0x0.. FuncDeclaration::overloadInsert () #2 0x0.. FuncDeclaration::overloadInsert () .. Haven't had the time to investigate this further. This happens with dmd build form the the master/HEAD(ff81ae9)
Re: dmd 2.064 release candidate 1
Why not volunteer to handle the FreeBSD package builds? I have access to FreeBSD machine(s) and willing to lend a hand and spend some time on this. What is needed to do the FreeBSD package build? (Currently I just do a git clone/pull of the github dlang stuff and build it to get the master or any other branch I want) Were do I find the build and package instructions? Is running regressions tests required before releasing a build package? What is the packages release (and build) frequency? DMD1 and DMD2 (and GDC) seems to be in the FreeBSD ports collection. Why can't those be used to buid the packages?
Re: ARM bare-metal programming in D (cont) - volatile
On Thursday, 24 October 2013 at 00:43:11 UTC, Mike wrote: Hello again, I'm interested in ARM bare-metal programming with D, and I'm trying to get my head wrapped around how to approach this. I'm making progress, but I found something that was surprising to me: deprecation of the volatile keyword. In the bare-metal/hardware/driver world, this keyword is important to ensure the optimizer doesn't cache reads to memory-mapped IO, as some hardware peripheral may modify the value without involving the processor. I've read a few discussions on the D forums about the volatile keyword debate, but noone seemed to reconcile the need for volatile in memory-mapped IO. Was this an oversight? What's D's answer to this? If one were to use D to read from memory-mapped IO, how would one ensure the compiler doesn't cache the value? This article might also give some insight in the problems with volatile: http://blog.regehr.org/archives/28
Re: Early review of std.logger
On Thursday, 17 October 2013 at 02:13:12 UTC, Eric Anderton wrote: On Tuesday, 15 October 2013 at 15:16:44 UTC, Andrei Alexandrescu wrote: Eric, could you please enumerate a short list of features of log4j that you think would be really missed if absent? Certainly. Here's my top 3, with some background to explain why I think they'd be missed. - Hierarchical logging with a centralized (singleton) logging facility. The strength of this is that it would allow us to freely integrate D libraries that use std.logger, yet filter their log output from *outside* the library through the std.logger API. This can be accomplished by tagging each log event with a category name. Log events are then filtered by prefix matching of the category name, as well as by log level. Without this feature, library authors would have to provide explicit API calls to manipulate their library's logging, or require API users to pass logging contexts forward to the library. - Configurable output strategies for each log category. In log4cpp, these are known as appenders. Appenders need not be registered explicitly for each category, but can be registered by category name prefix match, just like the filtering for the hierarchical system (above). The idea is to allow for different formatting strategies and output targets, including the logrotate issue I mentioned earlier. This provides a nice integration point to tackle basic capabilities today, like file logging and syslog support, and more advanced features by 3rd party authors. - Nested Diagnostic Context support (Mapped Diagnostic Context in log4j). The NDC facility in log4cpp/log4cxx is incredibly handy for cutting down on the amount of data one usually puts into a given log event. The gist of an NDC is just a way to bracket a series of log calls with a prefix that is emitted with the rest of the log line. These contexts are maintained on a thread-specific stack, such that each log event is prefixed with all the information in the entire stack, at the time of the event. Without this, one winds up re-inventing the concept (usually poorly) to forward the same information to each call to emit a log message. It also eliminates the need for a stack trace in a log message in most cases, which is something that people who use SIEM software (e.g. Splunk) would appreciate. There are other things that would be nice - configuration file support, lazy evaluation of log event arguments, custom output formats - but I think the above is really core of what's needed. For what it's worth: my opinions mostly come from my experience in integrating with log4j and log4cpp. Log4j is a very heavyweight library - I don't think we need anything anywhere close to that nuanced. In contrast, log4cpp is very small library and worth a look as something that may be a good model for what std.logger could accomplish. - Eric +1 I have used log4net some years ago, really liked the the 'context logging' feature. (Nested Diagnostic Context support). I've also used www.panteios.org logging api, liked that approach too.
Re: D2 is really that stable as it is claimed to be?
On Wed, 25 Sep 2013 17:53:41 +0200, Sean Kelly s...@invisibleduck.org wrote: On Sep 24, 2013, at 8:45 PM, deadalnix deadal...@gmail.com wrote: On Wednesday, 25 September 2013 at 03:12:55 UTC, Walter Bright wrote: On 9/24/2013 5:39 PM, deadalnix wrote: It doesn't seem that surprising to me. If you want a compiler that is fast, you use DMC, if you want a compiler that will do coffee, you use GCC or clang recently. I do think the user base you judge on is biased. I'm sorry, I don't believe the dmc user base secretly loved that feature. Which is why I dropped it from dmd, despite having spent significant time making it work nice in dmc. That is the exact opposite. People that like feature rich compiler already use another compiler. People that like minimal tooling and speed uses DMC. I don't know. I liked DMC specifically because of the nifty features. I used VC++ for the debugging environment. But then I never worked on a Windows project where compile time was a problem. The really big stuff (ie. millions of LOC) has always been on some variant of Unix. Well we extensively used Symantec C/C++ and later DMC on various large projects om Windows. And I did appreciate the error caret in DMC at the time. I really loved the compiler and IDDE back then. We also used compilers from other vendors (Borland Watcom IBM KAI MS). The most remarkable memories are of course the compile speed but also (for a long time) the performance of the generated code! An other thing we really really really loved was the speed in response on reporting compiler bugs! Almost every time within 2 or 3 days we received a 'fixed' compiler in our inbox from Walter! (Thank You Walter!) Also often times DMC captured programming bugs during compilation not found by the Borland Watcom or MS compilers. It wasn't until 2004/2005 before I switched to VS2003/vS2005 because DMC was getting to much behind and the MS compiler had improved a lot. Arjan
Re: Qt Creator and D
This I actually disagree with that on a couple of levels. First, edit and continue is really only a absolute necessity for the AAA game industry (and some others).. since the ability to make changes without having to re-navigate the game to the area being effected is a crucial time saver. Surely not only for games and some others, I is really a very useful feature of MSVC debugging, which will save lots of precious time once one starts using it. I can attest to that. Another useful feature is the ease in which one might adjust the instruction pointer. I'm using those two quite often in concert, which is really a time(and ass)saver. For D to gain more traction (at least on the windows platforms) it has to have these kind of features. So I'm really happy to see what is happening twith visual-D! It's certainly missed in my professional environment, but even outside that, it's still super handy and saves a lot of time. Particularly if you are in the habit of using it. +100 Linux can also be very pretty and feature-rich, and, as a geek, I like the available choice in DEs Linux offers rather than being stuck with the sometimes unsavory advancements Windows makes in their design (i'm looking at you, Windows 8). Well you could give this a try: http://windows.kde.org/ I still think the biggest problem by far is that only an expert can fix it when anything goes wrong. And things *always* go wrong. It might seem trivial if you love computer OS's at the command line and text file level, but I think to most users it just appears to be unstable and tedious. It's getting better. I want it to succeed... I really do. Although I'm a long time FreeBSD/Linux and KDE user (my primairy OS's) I have to agree. There is a reason for the rise of Apple products. Most heard non techies comment: It just works.