Re: D User Survey
On Thursday, 7 December 2017 at 14:31:01 UTC, Chris wrote: I didn't know Ireland was so unknown, unless, of course, I'm supposed to choose "Great Britain". I also hated myself for clicking Great Britain :-)
Re: Passing array as an function argument.
On Monday, 11 September 2017 at 12:20:08 UTC, Vino.B wrote: On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: [...] The type returned from Test1() is a `RangeT!(Array!string)`. This is due to the `[]` on the end of `Fs[]`. Remove the `[]` to just return a `Array!string`. Hi, If i remove the `[]` at the end of `Fs[]` I am getting the same error, if i remove the `[]` from the file "auto t1 = Test1[];" the out is empty. From, Vino.B This works: https://dpaste.dzfl.pl/1fd9021739ad
Re: Passing array as an function argument.
On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1) is not callable using argument types (RangeT!(Array!string)) import std.stdio: writeln; import std.container; auto Test2 (Array!string t1) { return t1; } auto Test1 () { auto Fs = Array!string("C:\\Temp\\TEST1\\BACKUP", "C:\\Temp\\TEST2\\EXPORT"); return Fs[]; } void main () { auto t1 = Test1[]; Test2(t1); } From, Vino.B The type returned from Test1() is a `RangeT!(Array!string)`. This is due to the `[]` on the end of `Fs[]`. Remove the `[]` to just return a `Array!string`.
Re: {OT} My machines are dead
On Tuesday, 6 June 2017 at 12:46:21 UTC, Stefan Koch wrote: Hi Guys, bad news my dev machine and the backup machine are dead. The replacement hard-drive I ordered a week ago came today, but that's no longer the issue. If someone in the North Rhine-Westphalia area, wants get rid of a working computer, please contact me :) Cheers, Stefan Please tell me new-CTFE is pushed to the cloud? :-)
Re: vibe.d 0.8.0 and 0.7.31 beta releases
On Tuesday, 31 January 2017 at 11:11:28 UTC, Sönke Ludwig wrote: The first release of the revamped core module [1] is nearing, and along with that, a compatible vibe.d release (0.8.0). The new core module is still opt-in in this release and can be activated using a `subConfiguration "vibe-d:core" "vibe-core"` directive in dub.sdl (`"subConfigurations": {"vibe-d:core": "vibe-core"}` in dub.json). [...] Very nice! Thanks for all your work on this - excellent stuff.
Re: What are you planning, D related, for 2017 ?
I'm close to releasing a web-app built fully in vibe-d. I'm thinking of attempting a native android app using D based on the same project as above. Continue my 2D game dev project (which is going super slow lately).
Re: Detect that a child is waiting for input
On Wednesday, 23 November 2016 at 15:54:30 UTC, unDEFER wrote: On Tuesday, 22 November 2016 at 22:30:06 UTC, wobbles wrote: Easier said than done as there's no signal the child sends to say "OK, I'm waiting now". You can use expect to do this, if you know what the output of the child will be just before it's waiting for IO. This is the D lib I've written to do this: https://github.com/grogancolin/dexpect It's not wonderful or anything, but it works :) Thank you, good decision. Maybe I will use the idea. But how to detect that "cat" (without arguments) waits input, if it nothing prints? You dont :) You could wait for some period of time - and if that's passed and the child hasn't printed anything you can assume it's waiting for input.
Re: Detect that a child is waiting for input
On Monday, 21 November 2016 at 07:29:55 UTC, unDEFER wrote: On Sunday, 20 November 2016 at 21:03:57 UTC, John Colvin wrote: If blocking is an error, you could close stdin and assuming the process checks the error codes correctly No, I mean blocking is not error. One method to find it, run gdb or strace and see where the process stopped, or which syscall was last. But I believe that must be other way. Easier said than done as there's no signal the child sends to say "OK, I'm waiting now". You can use expect to do this, if you know what the output of the child will be just before it's waiting for IO. This is the D lib I've written to do this: https://github.com/grogancolin/dexpect It's not wonderful or anything, but it works :)
Re: [vibe.d] showing images
On Wednesday, 26 October 2016 at 12:42:09 UTC, Nicholas Wilson wrote: [...] When you get the 404, do you see the contents of 'writeln(images);' in your terminal?
Re: SOme fun with D compiler
On Tuesday, 18 October 2016 at 11:06:08 UTC, wobbles wrote: On Tuesday, 18 October 2016 at 08:21:09 UTC, Daniel Kozak wrote: Try to compile this: import std.stdio; auto xxx(T)() { return this; } struct S { mixin xxx!(typeof(this)); alias xxx this; } void foo(S pos) { writefln("(%.2f|%.2f)", pos.x, pos.y); } void main() { } Or this: import std.stdio; auto xxx(T)() if (is(T == struct)) { return this; } struct Vector2f { mixin xxx!(typeof(this)); alias xxx this; } void foo(ref const Vector2f pos) {} void main() { Vector2f v; foo(v); } Compiler bug? Looks like it's constantly going in circles trying to figure out what the hell 'xxx' is :) I cancelled compilation after a minute of 100% CPU usage so not sure if it will ever finish. With -v on, this is what it prints: dmd compileFun.d -v binarydmd version v2.071.0 config/usr/local/bin/dmd.conf parse compileFun importall compileFun importobject (/Library/D/dmd/src/druntime/import/object.d) importcore.attribute (/Library/D/dmd/src/druntime/import/core/attribute.d) importstd.stdio (/Library/D/dmd/src/phobos/std/stdio.d) importcore.stdc.stdio (/Library/D/dmd/src/druntime/import/core/stdc/stdio.d) importcore.stdc.stdint (/Library/D/dmd/src/druntime/import/core/stdc/stdint.d) importcore.stdc.stddef (/Library/D/dmd/src/druntime/import/core/stdc/stddef.d) importcore.stdc.signal (/Library/D/dmd/src/druntime/import/core/stdc/signal.d) importcore.stdc.wchar_ (/Library/D/dmd/src/druntime/import/core/stdc/wchar_.d) importcore.stdc.config (/Library/D/dmd/src/druntime/import/core/stdc/config.d) importcore.stdc.stdarg (/Library/D/dmd/src/druntime/import/core/stdc/stdarg.d) importcore.stdc.stdlib (/Library/D/dmd/src/druntime/import/core/stdc/stdlib.d) importcore.stdc.time (/Library/D/dmd/src/druntime/import/core/stdc/time.d) importcore.sys.posix.sys.types (/Library/D/dmd/src/druntime/import/core/sys/posix/sys/types.d) importcore.sys.posix.config (/Library/D/dmd/src/druntime/import/core/sys/posix/config.d) importstd.typecons (/Library/D/dmd/src/phobos/std/typecons.d) importstd.meta (/Library/D/dmd/src/phobos/std/meta.d) importstd.traits(/Library/D/dmd/src/phobos/std/traits.d) importstd.typetuple (/Library/D/dmd/src/phobos/std/typetuple.d) importstd.stdiobase (/Library/D/dmd/src/phobos/std/stdiobase.d) importstd.range.primitives (/Library/D/dmd/src/phobos/std/range/primitives.d) semantic compileFun importcore.stdc.errno (/Library/D/dmd/src/druntime/import/core/stdc/errno.d) importcore.stdc.string (/Library/D/dmd/src/druntime/import/core/stdc/string.d) entry main compileFun.d semantic2 compileFun semantic3 compileFun And sticsk on semantic3 forever.
Re: SOme fun with D compiler
On Tuesday, 18 October 2016 at 08:21:09 UTC, Daniel Kozak wrote: Try to compile this: import std.stdio; auto xxx(T)() { return this; } struct S { mixin xxx!(typeof(this)); alias xxx this; } void foo(S pos) { writefln("(%.2f|%.2f)", pos.x, pos.y); } void main() { } Or this: import std.stdio; auto xxx(T)() if (is(T == struct)) { return this; } struct Vector2f { mixin xxx!(typeof(this)); alias xxx this; } void foo(ref const Vector2f pos) {} void main() { Vector2f v; foo(v); } Compiler bug? Looks like it's constantly going in circles trying to figure out what the hell 'xxx' is :) I cancelled compilation after a minute of 100% CPU usage so not sure if it will ever finish.
Re: Your connection is not private
On Saturday, 1 October 2016 at 03:21:05 UTC, rikki cattermole wrote: On 01/10/2016 11:51 AM, Joel wrote: I get this when I click Learn at the top of the screen in dlang. This is on Chrome Mac (Sierra 10.12). Yup, you need to be on https. Chrome just started warning when using http in the last build. Would it be a good idea to have dlang.org always redirect to https:// ?
Re: Why I am switching to Go
On Tuesday, 20 September 2016 at 20:35:49 UTC, Daniel Kozak wrote: Dne 20.9.2016 v 22:01 Karabuta via Digitalmars-d napsal(a): On Tuesday, 20 September 2016 at 19:47:12 UTC, WebFreak001 wrote: On Tuesday, 20 September 2016 at 19:14:41 UTC, Intersteller wrote: Vibe.d looks great on the surface but lack of documentation, commonly used functionality, and that it looks like it is dying suggests that putting any effort in to it will be a waste. Go, OTH, has tons of frameworks, most are actively support, very well documented(beego, revel, etc), and feature rich. What is vibe.d missing? It works great for me and the documentation is great imo too because it has everything I need. I use vibe.d at the company I work at and I use it for all my websites. I never had any problems with it Lets me say from a beginners perspective, * How do I build a file upload form (single and multiple file uploads) * How do I work with mongoDB to do CRUD. * How do I use the Web API beyond hello world! * Form validation? * Data sanitization? * How do I structure my application for real-world (reusable and maintainable code) e.g for a simple blog, simple CMS etc. :) ... Some of these things may seem easy to figure-out but can be difficult for a beginner unless he/she has a copy of Kai's book at the moment (D Web Development) :) Nothing of this is specific for vibe.d, so I do not see any reason to have doc about this in vibe.d I would say otherwise. I've built multiple sites in vibe-d, so I probably wouldn't need them, but having a vibe-d specific beginner tutorial from start to end of a project would be great. Sonke wrote a good blog post a while back with a chat system, and there's a new blogger using vibe too. But we could do with more. I guess I should take that up maybe. Not sure if I have the time though, and I don't have a whole pile of interest in blogging...
Re: Countries where D is used
On Friday, 16 September 2016 at 11:34:31 UTC, Chris wrote: I've noticed that there is a lot of enthusiasm for D in France, Germany and Russia (alphabetic order) where it is also used for production. I see there's a company in Belarus that uses D, and D is also used in Italy, Austria and the Czech Republic. Where else is D used for production? I for my part can add Ireland to the list. Where in Ireland are you? Maybe we should organise a D ireland meetup!
Re: vibe.d PaaS
On Wednesday, 14 September 2016 at 16:03:50 UTC, Guillaume Piolat wrote: On Wednesday, 14 September 2016 at 10:56:57 UTC, llaine wrote: No PaaS service, but you can pretty simply use Heroku to deploy any vibe.d application. Check the tour.dlang.io http://tour.dlang.io/tour/en/vibed/deploy-on-heroku where everything is explained :) Thanks! I've had success connecting vibe-d and heroku hosted postgresql dbs too :)
Re: vibe.d PaaS
On Wednesday, 14 September 2016 at 09:01:11 UTC, Guillaume Piolat wrote: Is there vibe.d hosting sold anywhere? Not that I know, but any VPS you rent would be capable of hosting it. I guess you don't want to deal with all of the other services you'd need? (nginx / security / dbs etc etc ?)
Re: Mysql-native with LAMPP
On Monday, 12 September 2016 at 05:31:46 UTC, Geert wrote: Hi all! I tried the client driver for MySQL/MariaDB "mysql-native". https://github.com/mysql-d/mysql-native Everything works well with an individually installed version of MySql. But I would like to know if there is a way to make D programms work with LAMPP/XAMPP. I'm getting this error message while executing the program: host=localhost;port=3306;user=root;pwd=MY_testPa550;db=testdb Failed: std.socket.SocketOSException@/build/ldc/src/ldc/runtime/phobos/std/socket.d(2822): Unable to connect socket: Connection refused You're sure mysql is running?
Re: Compiling vibe.d application for Amazon ec2 instance
On Sunday, 11 September 2016 at 23:12:15 UTC, crimaniak wrote: Hi all! I made vibe-d application, and client give me already taken hosting for it on Amazon aws ec2, uname -a: Linux ip-xxx-xx-xx-xx 4.4.11-23.53.amzn1.x86_64 #1 SMP Wed Jun 1 22:22:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Compiled on my Ubuntu binary don't run because of different versions of libraries (on Amazon they older). I can try to install dmd to ec2 instance but don't think this is good idea. I want to compile binary on my developing machine (may be in specific OS in VirtualBox). How to resolve this problem by right way? Can I get VirtualBox image of ec2 version of Linux and use it on my machine? Can I compile all libraries used as static and make more independent binary? Something else? I would find out the AMI of the image you're going to be running on, and spin up a machine from that. Install all dev tools there, and compile. Then you'll be good to go. You could even export the ec2 VM and run it locally in VirtualBox or something. I've never done it, but it's apparently possible.
Re: Get all files imported by a D source file
On Thursday, 8 September 2016 at 07:20:52 UTC, Yuxuan Shui wrote: On Thursday, 8 September 2016 at 06:33:00 UTC, Jacob Carlborg wrote: On 2016-09-08 07:39, Yuxuan Shui wrote: Hi, I wonder if there's standardized way to gather which files are imported by a source file. I know I can run "dmd -v" and look for lines start with "import", but I don't know if this is the best way to do it. You can use the "-deps" flag. -deps is even noisier than just -v... It's pretty noisy alright, but it's also pretty easy to read... It also shows just how coupled phobos is. I'm importing one single function (std.stdio.writefln), and all the dependencies are imported: http://pastebin.com/DSC4JhBD
Re: Use of StackOverflow
On Thursday, 8 September 2016 at 09:04:27 UTC, cym13 wrote: On Thursday, 8 September 2016 at 08:54:16 UTC, Russel Winder wrote: Do people operate on StackOverflow for D questions and answers? Yes, from my experience most questions get answered quickly (within an hour) thanks to the IRC bot that relays new SO questions. I didn't even know there was a bot. I just have StackOverflow send me a mail when new D questions pop up. Gotta have those internet points! :)
Re: vibed.org is down
On Friday, 2 September 2016 at 07:23:51 UTC, Mike Parker wrote: On Friday, 2 September 2016 at 07:02:20 UTC, finalpatch wrote: Probably not good for publicity. meh. It's the internet. Sometimes servers go down. code.dlang.org is down too :-(
Re: Template not seeming to instantiate a second time with default alias parameter
On Tuesday, 30 August 2016 at 21:35:29 UTC, ag0aep6g wrote: On 08/30/2016 11:28 PM, wobbles wrote: I'll have to try find a workaround for now :/ This seems to work and isn't too ugly: class Node(T, alias func) {/*...*/} alias Node(T) = Node!(T, (T t) => t*t); Excellent - thanks for these. This one will work for me :) I was going to do something messy with a nested template and some static ifs. But, complicated things are complicated. This is much easier. Thanks!
Re: Template not seeming to instantiate a second time with default alias parameter
On Tuesday, 30 August 2016 at 20:55:20 UTC, ag0aep6g wrote: On 08/30/2016 10:41 PM, wobbles wrote: class Node(T, alias func = (T t => t*t))(){ //whatever } //instantiate Node!(int) intNode; Node!(float) floatNode; // fails as lambda func expects an int. Am I doing something wrong or is this a bug? Proper test case: class Node(T, alias func = (T t) => t*t) { void method() { func(T.init); } } //instantiate Node!(int) intNode; Node!(float) floatNode; // fails as lambda func expects an int. Looks like a bug to me. Similar to this: https://issues.dlang.org/show_bug.cgi?id=14501 Yeah. Looks related. I'll have to try find a workaround for now :/
Template not seeming to instantiate a second time with default alias parameter
Hi, Code here: https://gist.github.com/grogancolin/066a8a8c105fa473dfee961e2481a30e Basically, it seems when a template has an alias parameter like class Node(T, alias func = (T t => t*t))(){ //whatever } //instantiate Node!(int) intNode; Node!(float) floatNode; // fails as lambda func expects an int. Am I doing something wrong or is this a bug?
Realtime monitoring of GC
In the Java world, the JVM offers hooks to allow tools to monitor in real time what is happening under the hood of your application. I think this sort of tooling would be very useful in D. Especially in my current Game Dev project (it'd be really nice to see in real time where you're allocating). I've had a quick look, and the current -profile=gc code should be pretty adaptable. We'd just have to make available a public 'getter' of the current accumulated stats in profilegc.d [1]. I'm no compiler programmer, so: 1) I'm here looking for advice on whether this is even the correct way to go about it? 2) What would be the best way to make it available to the end user? Through a function call in core.runtime? Or maybe a compiler switch that prints to a file every X seconds? My current (hacky) attempt is here [2]: It copy/paste from other code, and would need cleaning up. But, it's a proof of concept at least. I provide access to user code through a function in core.runtime; It's in use in sample code here: [3] Thanks! Colin [1] https://github.com/dlang/druntime/blob/master/src/rt/profilegc.d [2] https://github.com/grogancolin/druntime/tree/realtimeGCMonitoring [3] https://gist.github.com/grogancolin/a96a33f3b6d36c820e63982ced116eca
Re: Autotester farm is down
On Wednesday, 17 August 2016 at 23:13:52 UTC, Brad Roberts wrote: On 8/17/16 3:27 PM, wobbles via Digitalmars-d wrote: On Monday, 15 August 2016 at 22:33:26 UTC, Brad Roberts wrote: [...] I wonder how much it would cost to host this in AWS? I imagine it wouldn't be that big a job (famous last words)... plus - I'm sure you don't want to be paying for power and internet bandwidth for it forever either. Now that we have the foundation - this should all be fundable (hell, I'm sure most of us here wouldn't mind donating if it took that!) Several of the machines are run out of aws. The cost of running a windows instance inside aws is pretty awful. Shrug.. it's a wash, for the most part. Ah yes, I forgot about windows :/
Re: Autotester farm is down
On Monday, 15 August 2016 at 22:33:26 UTC, Brad Roberts wrote: Network connectivity issues. That set of machines runs out of my house and the comcast connection isn't happy, apparently. On 8/15/16 12:55 PM, Lodovico Giaretta via Digitalmars-d wrote: I don't know much about PRs and the autotester, so I'm probably wrong, but... It looks like [1] the autotester farm is down: most hosts have been unreachable for more than two hours and a half, as of this writing. This may slow down the PRs, as all FreeBSD and all Windows hosts are gone. Is it known and expected (maybe maintainance)? [1] https://auto-tester.puremagic.com/hosts/ I wonder how much it would cost to host this in AWS? I imagine it wouldn't be that big a job (famous last words)... plus - I'm sure you don't want to be paying for power and internet bandwidth for it forever either. Now that we have the foundation - this should all be fundable (hell, I'm sure most of us here wouldn't mind donating if it took that!)
Re: Windows defender thinks dmd-2071.1.exe is a virus
On Sunday, 14 August 2016 at 09:55:07 UTC, Seb wrote: On Sunday, 14 August 2016 at 09:49:48 UTC, wobbles wrote: This is the exact link I downloaded from: http://downloads.dlang.org/releases/2.x/2.071.1/dmd-2.071.1.exe I am not sure - it will take over the world, but do you classify this as being a virus? ;-) ( In case it was hacked and is indeed a virus now :) ) There seems to be a change in the Window Defender code - did Microsoft start to see DMD as a threat? http://forum.dlang.org/post/losslyifqvphcnyhk...@forum.dlang.org Didn't realise there was a thread already :) "All of this has happened before, and will happen again."
Windows defender thinks dmd-2071.1.exe is a virus
This is the exact link I downloaded from: http://downloads.dlang.org/releases/2.x/2.071.1/dmd-2.071.1.exe ( In case it was hacked and is indeed a virus now :) )
Re: Release DUB 1.0.0
On Monday, 20 June 2016 at 15:52:46 UTC, Sönke Ludwig wrote: I'm pleased to announce the release of the first stable version of the DUB package manager. Stable in this case means that the API, the command line interface and the package recipe format will only receive fully backwards compatible changes and additions for a while. [...] Congrats - this is great stuff!
Re: Cross platform android ldc compiler
On Friday, 17 June 2016 at 13:35:01 UTC, Andre Pany wrote: On Friday, 17 June 2016 at 12:26:18 UTC, Gerald wrote: On Friday, 17 June 2016 at 11:48:23 UTC, Andre Pany wrote: [...] For windows and mac VirtualBox is included in the docker installation routine. Most users won't even notice Virtual Box is working behind the scene of docker. Last time I checked vagrant, I thought vagrant is a generator for virtual box images, but i will check again and include it into my research. Kind regards Andre Docker will be changing in the near future - there'll be no VirtualBox from now on. At least, I don't think so going from the Beta, but maybe it's just even more hidden from the user now.
Re: OpenGL Setup?
On Thursday, 16 June 2016 at 19:52:58 UTC, OpenJelly wrote: Last time I worked on anything OpenGL in D I was using a Linux machine, and I had to really bend over backward to get set up. I'm using Windows 7 at the moment and I'd like to work on some graphics stuff but I'm pretty lost... I just want to install an IDE that's not prone to crashing and comes with standard features like D syntax highlighting, code completion, code folding, side bar with my project's directory, integrated console, bindable key commands (build (with dub), run, stop), and some debugging help doesn't hurt but I can get by without being able to set break points... and then I need to get the right libs and bindings in order nut half of them I can't figure out the instructions for. What I've been trying to do for the past few hours is set up SublimeText3 with dub and get the derelictGLFW3 binding to work, but I can't even get dkit working, and I'd honestly rather be using code::blocks but I've had trouble getting D code completion working in that before, and while I could probably get SFML bindings to work (as their documentation caters to idiots like me), I don't really want to use it, I just want something small that handles an OpenGL window without the other stuff. If anyone's got a solid setup and can explain to me like I'm 5 how they got it all nice, that'd really help me out a lot. Thanks. I notice the ST3 plugin was a bit... flaky the last time I tried it (admittedly about 6 months ago). I ended up settling on vim with a few plugins (and live without auto-complete, it's not that important for me), but when I was using GUI text editors, I settled on VS Code with the code-d plugin. Its autocomplete etc worked pretty much out of the box for me. https://code.visualstudio.com/ https://marketplace.visualstudio.com/items?itemName=webfreak.code-d Make sure you follow the 'dependencies' section of code-d through though to get your env set up. It worked outta the box for me, on both windows and linux. You can get VS Code to compile via ctrl+B (I think that was the shortcut) but you've to make a modification to a json file to tell it to do it. If you need more help let me know and I'll write up something proper for you. Cheers!
Re: Release candidate 1.0.0-rc.1 is out
On Wednesday, 15 June 2016 at 17:54:00 UTC, Sönke Ludwig wrote: Am 07.06.2016 um 11:54 schrieb Sönke Ludwig: [...] The first release candidate is out now! If nothing else comes up, the release is scheduled for next Monday. For this release, I've restricted the recipe comments to the /+ +/ style and to be the first thing in the file apart from the optional shebang line. This leaves all options open to relax the rules later without losing backwards compatibility and allows #872 [1] to be finished with less time pressure. [1]: https://github.com/dlang/dub/pull/872 I think that's a good choice. +1
Re: Recommended coding convention for combining unix and windows code ?
On Tuesday, 7 June 2016 at 15:33:57 UTC, chmike wrote: Hello I'm writing some code that I want to be portable across Posix and Windows. What is the recommended code convention for such type of code ? 80% of the class implementation is the same for both OS. Should I write the following and copy past the 80% version( Windows ) { import core.sys.windows; class MyInfo {...} } else version( Posix ) { import core.sys.posix; class MyInfo {...} } else { static assert(false, "Unsupported platform"); } or should I do it the C way with multiple embedded static if... ? version( Windows ) { import core.sys.windows; } else { //Posix import core.sys.posix; } class MyInfo { ... static if(windows) { enum Value {...} } static else { //Posix enum Value {...} } ... } I did something similar, and went with the c-style version (x) inside each code block. Have a look here for how it looks. https://github.com/grogancolin/dexpect/blob/master/source/dexpect.d
Re: Beta release DUB 1.0.0-beta.1
On Tuesday, 7 June 2016 at 09:54:19 UTC, Sönke Ludwig wrote: DUB 1.0.0 is nearing completion. The new feature over 0.9.25 is support for single-file packages, which can be used to write shebang-style scripts on Posix systems: [...] This is great - very nice feature. That was one of the things I missed most when moving from rdmd to dub - so good to see it back!
Re: D plugin for Visual Studio Code
On Tuesday, 24 May 2016 at 09:01:15 UTC, akaDemik wrote: On Sunday, 22 May 2016 at 21:33:49 UTC, WebFreak001 wrote: windows hates me too much, these permission issues don't make any sense. Why wouldn't dub be able to write the lib file to the project directory? Fixing workspace-d-installer is just as important as fixing workspace-d for windows. Also the laptop is so super slow, I think my Windows VM would be faster. Gonna try and fix the issues on there in the next few days. Executable files with the text "install" and "setup" in the name, require elevation. And it's very uncomfortable :( Maybe change the output name from "workspace-d-installer" to "workspace-d-builder". About debugger on windows: https://forum.dlang.org/post/wctrsimrsfpbdkgce...@forum.dlang.org But I think it would be better to fix dmd. The fact the 'security' feature is done on the name of a file and therefore so easily circumvented means it's not a 'security' feature at all, and only an annoyance!
Re: Better Voldemort types
On Tuesday, 24 May 2016 at 01:29:53 UTC, Steven Schveighoffer wrote: Blog post on making Voldemort types without the disk-space issues: http://www.schveiguy.com/blog/2016/05/have-your-voldemort-types-and-keep-your-disk-space-too/ -Steve Very useful - thanks!
Re: How are you enjoying DConf? And where to go next?
On Monday, 9 May 2016 at 15:12:25 UTC, krzaq wrote: On Monday, 9 May 2016 at 09:58:32 UTC, Mark Isaacson wrote: Full recognition that there was way less demand for another US DConf... so perhaps somewhere easier to fly to? Reykjavik? Dublin? Oslo? Stockholm? Barcelona? London? Those are pretty good hubs and have solid airfare from the US... and all over. London and Barcelona in particular have a truly impressive number of flights in and out. They're all also really wonderful places to go exploring. Not a huge fan of Berlin as a city... that said the venue was pretty nice (a larger screen would've been better) and the food was definitely a step up from Utah. It's not just the distance, but also the overall personal cost of attending the conference. Berlin is, all things considered, a fairly cheap city. London is a big NO in this regard, can't speak about the other suggestions. I also think it should not only be in a decently cheap location, but also in a location where there is, by default, a high concentration of D users. Berlin fits that. Facebook fits that. Where's the other high concentration of D users?
Re: Adventures in D Programming
On Sunday, 8 May 2016 at 19:12:17 UTC, Adam D. Ruppe wrote: On Sunday, 8 May 2016 at 19:09:07 UTC, Daniel Kozak wrote: I remember that I have mentioned that once here, but I thing there was not big interest at it :( I'm doing it on dpldocs.info as soon as I leave the alpha period (which is finally coming soon). I haven't logged on for a look in ages. Have done so now, and they've come on leaps and bounds. Really like the layout and styling of the different pages. Jolly good show!
Re: How to convert this code: (is(ToString(t))
On Sunday, 8 May 2016 at 18:55:58 UTC, Pablo wrote: This is part of the old dparse.d file: private import std.string : ToString = toString ; char[] string() { static if(str) { static if(is(T == char[])) return t; else static if(is(ToString(t))) return ToString(t); else return "<<"~T.stringof~">>"; } else return "<<"~T.stringof~">>"; } I have a problem with this part: (is(ToString(t)) : dparse.d(215): Error: function declaration without return type. (Note that constructors are always named 'this') How to fix this code? Regards Pawel I think (THINK!!) you could use __traits(compiles, ToString(t)) in place of the is(ToString(t)). Unless all objects have an implicit toString? In which case it will always return true and be a useless check. On the phone and couldn't check properly...
Re: How are you enjoying DConf? And where to go next?
On Saturday, 7 May 2016 at 07:40:59 UTC, Russel Winder wrote: On Fri, 2016-05-06 at 20:59 +, John Colvin via Digitalmars-d wrote: On Friday, 6 May 2016 at 14:57:59 UTC, Chris wrote: > [...] Dublin has cheap direct flights from quite a few places in the US, as well as pretty much everywhere in europe. Obviously I will suggest London, but I guess it is a non-starter. The obvious venue would be Skills Matter's CodeNode, but the cost of accommodation in London is horrifying, and commuting is a non-starter. Well except for me. There are venues such as Coventry, the Techno Park has a great venue for up to about 200 people and fairly cheap and very local accommodation. (PyConUK has been using this venue for the last few years very successfully, it has only moved to Cardiff for a change and because of the problem of outgrowing the venue.) I have done the Gatwick → Dublin → (Gatwick | Birmingham) a few times, but on expenses so used taxis from Dublin airport to either Pearse Street or E Wall Road – the hotels shall remain nameless. What venue would be used in Dublin? I guess we could ask the PyConIE folk what they do, one of the hotels I think. Another +1 for Dublin here too. PyConIE is in the Radisson, which is very central and handy for everyone. Theres many many other venues around the city too - including the RDS which has oceans of event space. Also, tis a lovely city!
Re: TTS Synthesis: D and vibe.d in Action
On Tuesday, 12 April 2016 at 10:22:03 UTC, Chris wrote: Hi, Just to inform you that we successfully use D and vibe.d for two things: [...] Great to see some fellow Irish D users!
Re: Release D 2.071.0
On Monday, 11 April 2016 at 11:43:20 UTC, wobbles wrote: On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote: Glad to announce D 2.071.0. http://dlang.org/download.html This release fixes many long-standing issues with imports and the module system. See the changelog for more details. http://dlang.org/changelog/2.071.0.html -Martin When updating with the .dev package on my Ubuntu 15.10 system - .deb package - not .dev
Re: Release D 2.071.0
On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote: Glad to announce D 2.071.0. http://dlang.org/download.html This release fixes many long-standing issues with imports and the module system. See the changelog for more details. http://dlang.org/changelog/2.071.0.html -Martin When updating with the .dev package on my Ubuntu 15.10 system - I get this message: ``` The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package file and include the details beneath. Details Lintian check results for /home/colin/Downloads/dmd_2.071.0-0_amd64.deb: Can't close(GLOB(0x291a6f0)) filehandle: '' at /usr/share/lintian/helpers/coll/objdump-info-helper line 192 command failed with error code 123 at /usr/share/lintian/collection/objdump-info line 79. warning: collect info objdump-info about package dmd failed warning: skipping check of binary package dmd ```
Re: execute bash?
On Sunday, 10 April 2016 at 00:47:28 UTC, Puming wrote: On Saturday, 9 April 2016 at 08:56:17 UTC, wobbles wrote: On Friday, 8 April 2016 at 23:06:06 UTC, Puming wrote: On Friday, 8 April 2016 at 18:23:32 UTC, wobbles wrote: On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus waiting for user input from the terminal.. You might need to rig up a pseudo terminal that the bash can talk to. That's getting to be a pain though. You could run it through dexpect to get the effect of a pseudo terminal. https://github.com/grogancolin/dexpect Looked in the code, it is exacly what I need! Thanks. Also it has spawnInPty Cool. Any questions on using it let me know. I'm all for a bit of feedback also! I tried dexpect, now it works for the bash emulation! Good - glad it works! But there are still some issues: Bad - but to be expected :) 1. Spawn's data is a string, so it stores ALL data, but Expect class does not have a clear() method, so the data piles up and takes memory. Yeah, this was something I came across too but didn't have the time to fix it. My plan is to have the Expect class take an OutputRange, and all output is then sent to that Range. The only data that it keeps track of then is the data just before and since the latest 'expect' call. 2. There seems to be a visible lag for each send->read cycle. I haven't look in the details to find where, but it feels not as smooth as ssh does. I have added a good few Thread.sleep function calls in the send / read calls. This is because it seemed to crash out when there was nothing there and I needed something quick to get it working at the time. There must be a better way of handling this though. Also, I suspect I've added way too many sleep calls so I should do a bit of work on this! 3. when hiting 'vim a.file' on the command, things go messy. Have you got these interactive commands work in dexpect? Yeah, dexpect won't be handling something like vim. As Adam said, it sends lots of signals / commands to the terminal to tell it how to draw the window. Dexpect just cares about reading the data sent to/from the process, not what any of that data means. My wish list for the Expect class ( or design a separate class, like BashProxy ): 1. Fully proxy for a bash shell. 2. Result data are separated for each command. So I can easily search for hitorical sent commands or results. This would be cool. I'll have a think about how to go about it! But for now it works fine for my needs. I'll try to improve it when I get major parts of my repl lib done. Also, pull requests are welcome :)
Re: execute bash?
On Friday, 8 April 2016 at 23:06:06 UTC, Puming wrote: On Friday, 8 April 2016 at 18:23:32 UTC, wobbles wrote: On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus waiting for user input from the terminal.. You might need to rig up a pseudo terminal that the bash can talk to. That's getting to be a pain though. You could run it through dexpect to get the effect of a pseudo terminal. https://github.com/grogancolin/dexpect Looked in the code, it is exacly what I need! Thanks. Also it has spawnInPty Cool. Any questions on using it let me know. I'm all for a bit of feedback also!
Re: execute bash?
On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus waiting for user input from the terminal.. You might need to rig up a pseudo terminal that the bash can talk to. That's getting to be a pain though. You could run it through dexpect to get the effect of a pseudo terminal. https://github.com/grogancolin/dexpect
Re: Release D 2.071.0
On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote: Glad to announce D 2.071.0. http://dlang.org/download.html This release fixes many long-standing issues with imports and the module system. See the changelog for more details. http://dlang.org/changelog/2.071.0.html -Martin There's lots of good stuff in this release - Thanks!
Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?
On Sunday, 27 March 2016 at 07:45:00 UTC, ParticlePeter wrote: On Wednesday, 23 March 2016 at 20:00:55 UTC, wobbles wrote: [...] Thanks Wobbles, I took your approach. There were some minor issues, here is a working version: [...] Great, thanks for fixing it up!
Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?
On Wednesday, 23 March 2016 at 11:57:49 UTC, ParticlePeter wrote: I need to parse an ascii with multiple tokens. The tokens can be seen as keys. After every token there is a bunch of lines belonging to that token, the values. The order of tokens is unknown. I would like to read the file in as a whole string, and split the string with: splitter(fileString, [token1, token2, ... tokenN]); And would like to get a range of strings each starting with tokenX and ending before the next token. Does something like this exist? I know how to parse the string line by line and create new strings and append the appropriate lines, but I don't know how to do this with a lazy result range and new allocations. This isn't tested, but this is my first thought: void main(){ string testString = "this:is:a-test;" foreach(str; testString.multiSlice([":","-",";"])) writefln("Got: %s", str); } auto multiSlice(string string, string[] delims){ struct MultiSliceRange{ string m_str; string[] m_delims; bool empty(){ return m_str.length == 0; } void popFront(){ auto idx = findNextIndex; m_str = m_str[idx..$]; return; } string front(){ auto idx = findNextIndex; return m_str[0..idx]; } private long findNextIndex(){ long foundIndex=-1; foreach(delim; m_delims){ if(m_str.canFind(delim)){ if(foundIndex == -1 || m_str.indexOf(delim) >= 0)){ foundIndex = m_str.indexOf(delim); } } } return foundIndex; } } return MultiSliceRange(string, delims); } Again, totally untested, but I think logically it should work. ( No D compiler on this machine so it mightn't even compile :] )
Re: OpenCV bindings for D
On Monday, 21 March 2016 at 16:01:59 UTC, Guillaume Piolat wrote: On Monday, 21 March 2016 at 15:45:36 UTC, wobbles wrote: Hi Folks, I have a project in mind that I'd like to run on my new Raspberry Pi 3. Essentially a security camera that will only record when it detects changes between frames. Now, this is already a solved problem I believe, however in the interest of learning I want to do it myself. Ideally, I'd compare two images using the OpenCV library, and ideally I'd do that from D code. However, there exists no OpenCV binding for D that I can find. Is there a technical reason for this? I understand the OpenCV C api is quite old and dated, and it's recommended to use the C++ one as a result. On that, where is C++ / D linkage at? I know very little about linking the two, but it's something I'd like to learn more about and see this as an opportunity for that - before I sink a load of time into it, however, it'd be good to know if it's even feasibly possible to do so. Thanks! It's quite easy to write bindings for libraries that have a C interface (ie most), if only a bit boring. That's the thing, it doesn't have a C interface (or more correctly, it's modern versions don't have a C interface as it has been deprecated since I think version 2.4. OpenCV is at 3.4 now). I was wondering if there was any difficulties interfacing D to the C++ API?
OpenCV bindings for D
Hi Folks, I have a project in mind that I'd like to run on my new Raspberry Pi 3. Essentially a security camera that will only record when it detects changes between frames. Now, this is already a solved problem I believe, however in the interest of learning I want to do it myself. Ideally, I'd compare two images using the OpenCV library, and ideally I'd do that from D code. However, there exists no OpenCV binding for D that I can find. Is there a technical reason for this? I understand the OpenCV C api is quite old and dated, and it's recommended to use the C++ one as a result. On that, where is C++ / D linkage at? I know very little about linking the two, but it's something I'd like to learn more about and see this as an opportunity for that - before I sink a load of time into it, however, it'd be good to know if it's even feasibly possible to do so. Thanks!
Re: Enabling Only Top-Level Unittests
On Monday, 21 March 2016 at 10:37:31 UTC, ZombineDev wrote: On Monday, 21 March 2016 at 10:29:36 UTC, Nordlöw wrote: I want to enable unittests only at the top-level of a module compilation. If I have a module top.d that imports dep1.d dep2.d ... which all contain unittests, how do I compile top.d with only the unittests for top.d enabled? I think the easiest solution is to use http://dlang.org/spec/traits.html#getUnitTests and to run the tests you want manually. This is quite annoying I feel. There probably should be an option for the -unittest flag to only compile unittests for the source files I'm passing in, and not any of the tests in the -I import paths.
Re: write to file array by lines
On Tuesday, 15 March 2016 at 12:55:17 UTC, Suliman wrote: I created better example to show. string [] myarr = ["foo", "bar", "baz"]; myarr ~= "new"; File file = File(`result.txt`, "w"); file.write(myarr); is any way to write myarr to file in byLine mode void main(){ import std.stdio; import std.ascii; import std.algorithm; string[] myArr = ["foo", "bar", "baz"]; myArr ~= "new"; writeln("=== each! ==="); myArr.each!(a => writeln(a)); writeln("=== Using format ==="); writefln("%-(%s\n%)", myArr); writeln("=== Using joiner ==="); myArr.joiner(std.ascii.newline).writeln; } Output: === each! === foo bar baz new === Using format === foo bar baz new === Using joiner === foo bar baz new
Re: write to file array by lines
On Tuesday, 15 March 2016 at 12:55:17 UTC, Suliman wrote: I created better example to show. string [] myarr = ["foo", "bar", "baz"]; myarr ~= "new"; File file = File(`result.txt`, "w"); file.write(myarr); is any way to write myarr to file in byLine mode myarr .each!(line => file.writeln(line));
Re: write to file array by lines
On Tuesday, 15 March 2016 at 10:58:16 UTC, Suliman wrote: I have got: string [] total_content; I am appending to it data on every iteration. total_content ~= somedata File file = File(`D:\code\2vlad\result.txt`, "a+"); file.write(total_content); I need to write it's to file by lines. Like: somedataline1 somedataline2 somedataline3 I tried to do like: total_content ~= somedata ~ "\n" but in result I am getting all data in one line: somedataline1 "\n" somedataline2 "\n" somedataline3 "\n" what I am doing wrong? I know about split, but how it can be called on writing time? You're on windows, is newline not '\r\n' ? (I'm guessing here!)
Re: C++ UFCS update
On Wednesday, 24 February 2016 at 07:23:03 UTC, Suliman wrote: On Wednesday, 24 February 2016 at 07:19:02 UTC, Walter Bright wrote: On 2/23/2016 12:35 PM, Ola Fosheim Grøstad wrote: [...] Hardly. ! is not an overloadable operator in D, and ! has no binary operator meaning other than for template argument lists. I.e. it is not "reuse" at all. Furthermore, iostreams' use of << is neither thread-safe nor exception-safe, though its designer could be forgiven because iostreams predates both concepts. The only interesting thing about iostreams is why it wasn't deprecated 20 years ago, despite being ugly, not thread-safe, not exception-safe, and slow. Could you add to D operators like AND OR etc instead of && ||. Words are more readable. It's a matter of taste I think. I find 'and's and 'or's less readable than && and ||. I suspect that's because I'm used to looking at them.
Re: Updated plotcli (version 0.8.0). Now build on ggplotd
On Monday, 15 February 2016 at 21:43:27 UTC, Edwin van Leeuwen wrote: On Monday, 15 February 2016 at 20:17:00 UTC, wobbles wrote: This looks very cool - does it take long to export the png file? Particularly with the -f flag, if the data file is updated, how long until does it take to print? I know I could check, but you prob know the answer :P Currently it saves if the last save is more than 100ms ago. It also tries to read the file every 100ms, so at the outside it would take 200ms after a file update. Have been thinking I might have to increase that time a bit to deal with larger data sets. Sounds good! I have a vibe.d app that plots our servers sar data using plotly.js. I'll investigate integrating this instead of plotly so I'll have a fully D solution! (I tried generating my own svg file but it was too large an effort for me at the time!)
Re: Updated plotcli (version 0.8.0). Now build on ggplotd
On Monday, 15 February 2016 at 12:11:39 UTC, Edwin van Leeuwen wrote: Plotcli[1] is a command line application that can create plots by parsing text/csv files and from piped data, making it useful during data analysis. Plotcli v0.8.0 has been largely rewritten to use ggplotd[2] as its backend. This results in more beautiful plots and gives us greater control over the exact plots created. Note though that the command line arguments are incompatible with previous releases. Plotcli (through ggplotd) can now also show the plots in a gtk window, through using `plotcli --format gtk`. Previously versions only supported saving the resulting plots to files. Examples and more documentation are available on the its github page: https://github.com/BlackEdder/plotd [1] https://github.com/BlackEdder/plotd [2] https://github.com/BlackEdder/ggplotd This looks very cool - does it take long to export the png file? Particularly with the -f flag, if the data file is updated, how long until does it take to print? I know I could check, but you prob know the answer :P
Re: voldemort stack traces (and bloat)
On Monday, 8 February 2016 at 13:01:44 UTC, Steven Schveighoffer wrote: On 2/7/16 12:18 AM, Steven Schveighoffer wrote: I have a library where I was using very many voldemort types a la std.range. [snip] Is there a better way we should be doing this? I'm wondering if voldemort types are really worth it. They offer a lot of convenience, and are much DRYer than separate private template types. But the bloat cost is not really worth the convenience IMO. I modified all my voldemort-returning functions to return module-level types. One of my example programs (compiled optimized/inline) went from 10MB to 1MB. The other example program went from 2.1MB to 900k. -Steve Just to be sure, you replaced something like this: auto myFunc(int x){ struct MyStruct{ int a; } return MyStruct(x); } with? private struct MyStruct{ int a; } auto myFunc(int x){ return MyStruct(x); }
Github woes
Just curious, is there a backup plan for D if github.com goes by the wayside? Now that there seems to be community back-lash against it (at least on reddit) maybe a contingency plan would be useful. Obviously not today or tomorrow, but you never know what's down the road.
Re: reduce -> fold?
On Friday, 29 January 2016 at 12:08:01 UTC, Andrei Alexandrescu wrote: As has been discussed before there's been discussion about std.algorithm.reduce taking the "wrong" order of arguments (its definition predates UFCS). I recall the conclusion was there'd be subtle ambiguities if we worked reduce to implement both orders. So the next best solution is to introduce a new name such as the popular "fold", and put them together in the documentation. Thoughts? Andrei I think yes. Took me ages to realise the difference with reduce.
Re: Next London D Meetup: Wednesday 20th January 2016
On Thursday, 21 January 2016 at 20:27:14 UTC, Wyatt wrote: On Sunday, 10 January 2016 at 22:01:05 UTC, Kingsley wrote: This time we peek into the mind and code of Ross McKinlay who will give us a tour of some of his D efforts. I'm watching the recording right now. It's pretty exciting to see anything like F# discriminated unions in D. video here: https://skillsmatter.com/skillscasts/7185-london-d-meetup -Wyatt This is great stuff. Ross's excitability around opDispatch reminds me of my own reaction when I realised the power of using that feature. I emailed everyone saying "Holy shit, look at this!!" Pity none of these meetups are in Dublin - seem like good fun!
Re: Speed of csvReader
On Thursday, 21 January 2016 at 15:17:08 UTC, data pulverizer wrote: On Thursday, 21 January 2016 at 14:56:13 UTC, Saurabh Das wrote: On Thursday, 21 January 2016 at 14:32:52 UTC, Saurabh Das wrote: [...] Actually since you're aiming for speed, this might be better: sw.start(); auto records = File("Acquisition_2009Q2.txt").byChunk(1024*1024).joiner.map!(a => cast(dchar)a).csvReader!row_type('|').array sw.stop(); Please do verify that the end result is the same - I'm not 100% confident of the cast. Thanks, Saurabh @Saurabh I have tried your latest suggestion and the time reduces fractionally to: Time (s): 6.345 the previous suggestion actually increased the time @Edwin van Leeuwen The csvReader is what takes the most time, the readText takes 0.229 s Interesting that reading a file is so slow. Your timings from R, is that including reading the file also?
Re: Do D need a popular framework? like ruby's rails? or java 's ssh?
On Tuesday, 19 January 2016 at 13:22:48 UTC, beck wrote: Do D need a popular framework? in china ,a little peopel use dlang. i just use it do some simple work for myself. yet,i have learn d for a week .. i ask so many friends ,they don't use D at all.we use golang more than dlang. There is vibe-d, which I guess can be used like rails (I dont use rails myself, so could be mistaken). http://vibed.org/
Re: core.time Duration how to get units in double/float format?
On Tuesday, 19 January 2016 at 14:07:50 UTC, Borislav Kosharov wrote: On Monday, 18 January 2016 at 12:46:31 UTC, Jonathan M Davis wrote: [...] I want to use float time in a game where I call the update method passing the delta time as float seconds. It's more easy to multiply the dt with a speed constant meaning how much the object will move after 1 second. Such float delta time is used in many game engines and it's somewhat standart way of doing it. Also the method you wrote returns a string and I need a float to multiply it with a number. Thanks for the reply anyway Checkout out how DSFML handles this. You simply pass around a Clock object that you can restart every frame using clock.restart(); You then call your update function with update(Clock.getElapsedTime()); Then in each objects update(Time t) method you just get the time in whatever unit you want. Works pretty well. http://www.dsfml.com/
Re: [dlang.org] new forum design
On Monday, 18 January 2016 at 10:20:13 UTC, Vladimir Panteleev wrote: As the new design rolled out on dlang.org, I decided to push the changes on forum.dlang.org as well. From what I gathered from the previous feedback thread, I believe we've addressed the most stringent issues. Once again thanks to anonymous / @aG0aep6G for doing practically all the work, and to everyone who's provided feedback so far. [...] On the reddit thread, a bug in safari was posted: " I found a bug on Safari 7.1.3: each time I click the "Edit" button for the code editor, the gray panel with the code it in gets longer, and pushes the rest of the content in the site down. Here's an album with the before/after screenshots. http://imgur.com/a/TIylc " https://www.reddit.com/r/programming/comments/41j1nm/check_out_ds_new_site/cz32v1v
Re: [dlang.org] new forum design - preview
On Wednesday, 13 January 2016 at 06:01:41 UTC, Vladimir Panteleev wrote: http://beta.forum.dlang.org/ https://github.com/CyberShadow/DFeed/pull/51 I like it, it looks very well and I like how it mirrors the front pages design. As others have said, maybe utilizing more horizontal space would make it better. All in all though, great work!
Re: [dlang.org] getting the redesign wrapped up
On Monday, 11 January 2016 at 12:54:46 UTC, deadalnix wrote: On Sunday, 10 January 2016 at 23:31:07 UTC, anonymous wrote: On 10.01.2016 22:14, deadalnix wrote: - Learn barely make the cut on my 15' monitor. That's way too low. If one doesn't know D, one doesn't care about news, community or whatever. We can shuffle things around, of course. One alternative: Learn News Documentation Community Packages Contribute http://i.imgur.com/8mQj0rg.png This would make Learn the most prominent item. There is an empty void between Learn and Documentation. It could be filled by putting more into Learn. I don't know what to write there, though. No, nothing more needs to be added. Things needs to be removed, not added. I tested on a 15" screen, not even on a small screen. If there was a very slight border around each section (Learn, News, Documentation etc) then that gap between Learn and Documentation wouldn't look so... empty? - Please don't make me click on the menus. You can also make them work with pure CSS using :hover I think it was Adam who spoke out against :hover menus, preferring to click instead. So we're at 1:1 now, I guess? :hover is pretty much mandatory. Website need to work without JS. What was Adams gripe with :hover? I can't see a problem with it, as long as clicking still works as it does now (for mobile).
Re: [dlang.org] getting the redesign wrapped up
On Monday, 11 January 2016 at 14:27:51 UTC, Adam D. Ruppe wrote: On Monday, 11 January 2016 at 13:18:26 UTC, wobbles wrote: What was Adams gripe with :hover? I can't see a problem with it, as long as clicking still works as it does now (for mobile). I click on my URL bar and punch in "interesting-site.com". It loads and I move my mouse down to a link or text field that I actually want on the page and click... But as the mouse went down from the address bar to the site, I happened to pass over a hover menu. My click is now intercepted and I'm sent to some entirely different page. Really annoying. (My bank's website had a login right below a hover menu, they have fixed it recently, but for the longest time, I'd want to log in but accidentally be sent to the bank officers list instead!) Or, I'm trying to copy something from a hover element and the page size suddenly changes with it being there... which now puts my mouse pointer outside the hover, which causes it to disappear, which changes the page size again, and now I'm just lost. (A lot of web sites assume the page will be pixel-identical on all screens, but I disable web fonts, so your menus are often not exactly the same size on my screen...) Similarly, something near the edge of a hover can be really hard to click with shaky hands, or sometimes errant margins on hovers (you'd think debugging would catch this, but I see it on live sites too, including big ones like Facebook) mean mousing over the gap to get to a link causes the link to disappear! Really frustrating. I'd imagine it is even worse if you have poor dexterity in general, so there's the accessibility aspect too. There's also no such thing as hover on devices without a mouse, which used to be just fossils like me using our lynx browser, but now includes a large number of people on the touch screens (though I question how many of them are actually doing programming so I don't think we should optimize specifically for them, but sometimes new users will check out a language mentioned to them on such a device so we don't want to leave them completely out either.) Of course, a click fallback handles those people. But even when - especially when - I have a device that supports hover, I dislike it. Yeah, I can see why that is an annoyance. But there is ways around it, like using transition-delay:0.200s [1] (or some other time that's quite small, so it doesn't impact the user actually trying to look at the drop down menu). That will prevent any annoying issues arising from moving the mouse across the web page. I think the drop down list is completely worthless on dlang.org anyway. Things moving around are harder to locate than a static thing, your spacial memory leads you to the wrong place then. I'd rather have a single click bring you to an info page with the other links. The above solution doesn't solve this of course, as you just think having a drop-down is a bad design decision :) How else would you lay it out? I dont think you could put all the content in that top bar pre-expanded - so you'd have all the menus on the left as it is on the current site? [1] http://dabblet.com/gist/1498446
Re: [dlang.org] getting the redesign wrapped up
On Monday, 11 January 2016 at 15:06:40 UTC, Adam D. Ruppe wrote: On Monday, 11 January 2016 at 14:54:12 UTC, wobbles wrote: How else would you lay it out? I dont think you could put all the content in that top bar pre-expanded - so you'd have all the menus on the left as it is on the current site? I think the left menu on the current site is of limited value too. It is really hard to find what I'm actually looking for. (The organization is weird. To me, "D reference" and "standard library" ought to be the same, for example, and why is bug tracker under community?) I'd prefer to simplify it to like 5 menu items, each of which leads to a new page that can further break it down, using the whole screen to lay it out. Really, one of my biggest worries with dlang.org isn't the color scheme, but rather I feel like everything is cramped and content takes a back seat to cramming it all in. That's not to say we need infinite whitespace like so many new sites, I just don't think everything needs to be on every page. Yeah, I really dislike the over use of whitespace in current trendy sites. And the constant scrolling down to view more info is annoying too (I know CSS z-layer animations are cool, but they dont need to be everywhere!!). Well, while the website is going under such tumultuous changes, is now not the time to fix all the above? Clean everything up and put everything under sane headings/sections etc?
Re: D Cross Platform Status + OpenGL Status ?
On Saturday, 9 January 2016 at 19:43:03 UTC, Jakob Jenkov wrote: And what about OpenGL support? Is that easy? And does it work easily across platforms? http://code.dlang.org/packages/derelict-gl3 This is the OpenGL binary. Have used it on both Windows and Linux, I just got a window up and running on both, and it works well. Read more here on how to get it up and running: http://derelictorg.github.io/
Re: Regex benchmarks in Rust, Scala, D and F#
On Wednesday, 6 January 2016 at 07:05:43 UTC, israel wrote: On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote: Hi, Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D. http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html I think the problem with these "benchmarks" is that when their favorite language is up there and not doing as good as the others, people begin to yell out that they didnt optimize the code well, either through compiler flags or something else. There should be a public benchmark standard. No special functions. No special linker flags. Just the plain code and compilation process. That'll never work though. 'Just the plain code' to me isn't 'just the plain code' to you. Ideally, a Git repo somewhere with a lot of benchmarks that the community can edit and make better. Over time (assuming the repo becomes somewhat popular) all benchmarking programs will use each language to it's fullest - thus giving accurate, comparable results across the board.
Re: What are you planning for 2016?
On Wednesday, 6 January 2016 at 11:16:20 UTC, Chris wrote: Don't think I'll have time for that and once you use D, you lose interest in other languages :-) Amen to that. Had to write some Java recently and kept trying to go call functions UFCS style. And if I have to match up angle brackets for a generic list of a generic list of a generic type one more time I'll poke my eyes out!
Re: What are you planning for 2016?
On Tuesday, 5 January 2016 at 12:27:12 UTC, Ola Fosheim Grøstad wrote: I wonder what kind of programming people plan or _hope_ to use D for in 2016? Do you have plans to: 6. create runtime less programs (games, embedded)? Am currently knee deep in my first game in D. Using DTiled and DSFML, has been very fun so far. A rogue-like nomadic city-builder. (That's a thing?!) 7. work on the D language/phobos ? I don't have the knowledge or skills sadly. I will attempt to help out on the documentation at some stage. What other languages do you think you will use or toy with in 2016 and for what purpose? Been using Groovy more and more in work. Will also sadly have to write Java code for some in-house Jenkins plugins. Personally, I've been using D a lot more in work recently, and quick and dirty tools I need I always go to D first. One example, we use sysstat to monitor all our servers resource usage, and had no centralised way to view those stats. I wrote a vibe.d service to do just that, plotting the data via plotly.js. I might clean it up and put it up on Github actually... could be useful to someone.
Re: DMD now does Dwarf style exception handling!
On Tuesday, 5 January 2016 at 01:39:51 UTC, Temtaime wrote: On Sunday, 3 January 2016 at 02:05:38 UTC, Walter Bright wrote: On 1/2/2016 4:17 PM, Jack Stouffer wrote: What is involved in catching C++ exceptions? Was this the hard part of the whole thing? DMD doesn't catch them yet. But C++ on Linux throws them in Dwarf format, so supporting that is the first step. Useless work. Almost nobody will throw exceptions from C++ code to D code. Same old same old : Walter could fix regressions, but instead he found a new nice useless toy to play, and after that, it will be a cause of new regressions. That's why D is always dead in the water. That's a bit harsh! Getting D to play nice with C++ is, I feel at least, one of the most important pieces of work to getting more D adoption. The vast amount of C++ libs out there that will be usable in the D sphere is immense (think Game engines!)
Re: Redesign of dlang.org
On Wednesday, 23 December 2015 at 17:22:25 UTC, Andrei Alexandrescu wrote: Third I think I'm being reasonable if I ask to introduce new or custom technology dependencies only with good reason. Andrei I think that's very fair. On your earlier point of getting people to work on the website and also commit to helping out in future, is there an "official" thing here? Like a contract (An unpaid contract, obviously :D)? Or is it more a matter of trust from you and everyone else involved with the site towards a person stating they'd like to help?
Re: Small minesweeper game in D
On Sunday, 20 December 2015 at 02:11:58 UTC, Adam D. Ruppe wrote: code here: http://arsdnet.net/dcode/minesweeper.d [...] On Ubuntu 64 bit: $ dmd minesweeper.d simpledisplay.d color.d simpledisplay.d(4477): Error: cannot implicitly convert expression (XCreatePixmapCursor(this.display, pm, pm, & blackcolor, & blackcolor, 0u, 0u)) of type ulong to int $ dmd --version DMD64 D Compiler v2.069.2 I casted the problem away with cast(int)XCreatePixmapCursor(...) to play a couple games. Not really solving the problem though... Nice work though! 'Tis very cool. The game code is very simple to follow too. I'll try making a simple game using simpledisplay over the christmas. It looks quite nifty!
Re: Redesign of dlang.org
On Sunday, 20 December 2015 at 13:50:53 UTC, Jacob Carlborg wrote: On 2015-12-20 06:12, Charles wrote: kind of a neat project here... mind if I help out? Sure, that would be great. Although I don't really want to do anything until Walter and Andrei approve the design. On that - have you had any contact / discussion with Walter and/or Andrei about this? I recall there was a thread on this very subject close to a year ago but can't remember if there was any decisions made.
Re: Redesign of dlang.org
On Monday, 21 December 2015 at 15:28:44 UTC, Jacob Carlborg wrote: The original code is written in HTML, JavaScript and Less (CSS). See repository for build instructions [1]. If I move forward with this I would go with vibe.d. +1
Re: Redesign of dlang.org
On Saturday, 19 December 2015 at 23:38:17 UTC, JohnCK wrote: On Saturday, 19 December 2015 at 23:11:33 UTC, Jacob Carlborg wrote: I changed the permissions, does it work now? Now it's working! Well... it's clean, but of course needs more polishing, like taking out a few border colors for example, but another thing that I liked was the buttons on top. JohnCK. Personally I prefer the buttons on the side. Probably 99% of people have widescreen format now (at leas 16:9), so I feel buttons at the top use up precious vertical space. This is of course all down to preference! Also, I love how the site handles mobile well. Very nice!
Re: Some feedback on the website.
On Thursday, 17 December 2015 at 08:06:28 UTC, Jacob Carlborg wrote: On 2015-12-17 00:46, Andrei Alexandrescu wrote: Overall I think a few additions to the macro engine could be very beneficial. E.g. while working on dconf.org I could use $(IF a, b, c) to expand b if a is nonempty and c otherwise. Oh, God, please no. Just use vibe.d and be done with it. We obviously need a proper programming language to generate dconf.org. That would be a whole re-write of the website though. It would be preferable of course. The official D site being run through one of it's more popular libraries (it's most popular library maybe?) can only be a good thing.
Trying to build dlang.org - what am I doing wrong
So - the conversation about the website/documentation piqued my interest a bit and I decided to have a go at making the documentation more readable. However, reading the instructions from: http://wiki.dlang.org/Starting_as_a_Contributor#Fetch_and_build_dlang.org It should be a simple matter of: ```bash mkdir -p ~/code; cd ~/code git clone https://github.com/D-Programming-Language/dlang.org cd dlang.org make -f posix.mak LATEST=2069.2 ``` However, I get a std.net.curl error during compilation of dub (luckily dlang.org doesn't depend on dub, so it doesn't particularly matter and I can carry on with my tinkering). http://pastebin.com/q41AnJyr I assume theres a problem with the makefiles here - or is it stupid user syndrome?
Re: We need better documentation for functions with ranges and templates
On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz Something has to be done with the documentation for Phobos functions that involve ranges and templates. The example I gave there is bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) if (isInputRange!Range1 && isInputRange!Range2 && !isInfinite!Range1 && !isInfinite!Range2); Unfortunately, that's less ugly than for a lot of functions. In some circumstances, I can see something like that reminding the author of the function about some details, but it can only confuse anyone else. There is nothing I can do about this. Who makes these decisions? Can we change it to something useful? Also, I think the documentation for functions involving ranges needs more "for dummies" examples. Too many of those functions leave the reader not having a clue what to do after calling the function. I know how that can be fixed. I think that most of the problem is simply down to how the documentation looks. It's too dense. I think some whitespace and some color-coding will go a long way to making the function signatures better. bool isSameLength (Range1, Range2) // a grey color (Range1 r1, Range2 r2) // a blue if (isInputRange!Range1 && isInputRange!Range2 && !isInfinite!Range1 && !isInfinite!Range2); // same grey color as template args, to point out they're working on the template I think that would make all documentation much easier to glance over, and yet easy to read if you need to. On the examples - more examples can only be better!
Re: We need better documentation for functions with ranges and templates
On Tuesday, 15 December 2015 at 08:08:10 UTC, landaire wrote: On Tuesday, 15 December 2015 at 02:39:16 UTC, Steven Schveighoffer wrote: [...] I started exploring D a couple of months ago and I was the original poster in the reddit thread who sparked this discussion. While on the topic of documentation I wanted to quickly put in my thoughts about what frustrated me with the documentation: [...] I think these are some great suggestions, particularly the 3rd example where the function signature is emphasized.
Re: Balanced match with std.regex
On Tuesday, 15 December 2015 at 02:35:34 UTC, Xinok wrote: On Tuesday, 15 December 2015 at 01:29:39 UTC, Jakob Ovrum wrote: Thanks, that makes sense. String manipulation in D without regex is pretty nice anyway, so it's not a big loss. There is a library named Pegged which can match against balanced parens: https://github.com/PhilippeSigaud/Pegged Pegged is amazeballs. Can build some v cool things with it. Particularly with some CTFE abuse!
Re: Use https: for wikipedia links
On Monday, 14 December 2015 at 14:53:20 UTC, Kagamin wrote: On the other hand there's a move to make encrypted protocol the default and leave unencrypted as legacy, so maybe WEB macro should be silently upgraded to https? Full links look better and more intuitive IMO. I think this would be the most logical step. Replace current WEB with https://, and create another macro (maybe WEBL - Web Legacy) for the current http:// links.
Re: D is on his way to Top 20 in Tiobe
On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was expecting more by now. I think D maybe lost it momentum, because for what I've been seeing, C++ for example is integrating some D features, other languages are growing[1] like Go or will be used actively like Rust on Servo engine. Unfortunately I think D will remain like a niche. [1] - When I'm say "growing", I'm basing on what I'm seeing on internet. JohnCK. Don't believe everything you read on the internets! :)
Re: DConf 2016 news: 20% sold out, book signing
On Monday, 7 December 2015 at 20:42:21 UTC, Adam D. Ruppe wrote: On Monday, 7 December 2015 at 19:37:11 UTC, deadalnix wrote: Adam won't be coming ? I haven't decided for sure yet, but probably not. I don't like travel at all and the thought of a trans-atlantic flight strikes me as the worst. Sleeping tablets make long flights much more bearable!
Re: Another cool mini-project: advance a range within n steps from its end
On Friday, 4 December 2015 at 20:01:10 UTC, Jacob Carlborg wrote: On 2015-12-04 17:37, Andrei Alexandrescu wrote: Like "tail" in Unix. Given a range R r and a number size_t n, return a TakeExactly!R that's r at no more than n steps from its end: TakeExactly!R advanceWithin(R)(R r, size_t n) if (isForwardRange!R); Invariant: assert(r.advanceWithin(n).length <= n); Implementation would send a scout range ahead, etc. I didn't file an issue for it, but it's a great function to have. retro + take? + retro to turn it back the normal way? Also, I think this'd work? return r.takeExactly(r.walkLength - n); It wouldn't be particularly efficient though I wouldn't think - as you'd need to walk the whole range to find it's length. r.retro.take(n).retro seems like the easiest fit.
Re: Strange behaviour of to!string and JSON
On Thursday, 3 December 2015 at 08:46:44 UTC, Suliman wrote: void login(HTTPServerRequest req, HTTPServerResponse res) { Json request = req.json; writeln(to!string(request["username"])); writeln(request["username"].to!string); } Why first code print output with quotes, and second not? "asd" asd I regularly use request["username"].get!string; in these cases, as I find it reads better and is more consistent with what you're actually doing. http://vibed.org/api/vibe.data.json/Json.get Also, I think this is the case (haven't used it in a while), get!string will fail if the item it's getting ISNT a string, while to!string wont.
Re: I hate new DUB config format
On Friday, 27 November 2015 at 11:04:09 UTC, Chris wrote: Our house doesn't stand properly yet and we're discussing effin bikesheds. +10 Everyones opinion is different, no one is right, no one is wrong - It's all just opinion. The only thing it's served to do is piss off a very important contributor to the D ecosystem. None of this thread matters - can we move on?
Re: I hate new DUB config format
On Friday, 27 November 2015 at 13:52:13 UTC, wobbles wrote: On Friday, 27 November 2015 at 11:04:09 UTC, Chris wrote: Our house doesn't stand properly yet and we're discussing effin bikesheds. +10 Everyones opinion is different, no one is right, no one is wrong - It's all just opinion. The only thing it's served to do is piss off a very important contributor to the D ecosystem. None of this thread matters - can we move on? "It" being this thread.
Re: I love any DUB config format
On Thursday, 26 November 2015 at 20:35:28 UTC, mattcoder wrote: On Thursday, 26 November 2015 at 18:56:20 UTC, Sebastiaan Koppe wrote: On Thursday, 26 November 2015 at 08:50:42 UTC, Sönke Ludwig wrote: Thanks, Sönke Thank you (and others) for your time developing dub. I don't understand any feelings for or against the configuration's format. From a maintainability perspective JSON wins, from readability SDL wins. Pick _one_. Move on. ... Yes man and like I said previously, this should be settled directly with developer, it is too much drama for such a small thing. And thinking more about it, now I start to understand Linus Torvalds rants on code and I really think this community needs someone like him to shake up things, and stopping those nonsense complaints. :) Matheus. We do, he's called Andrei!
Re: Silicon Valley D Meetup November 19, 2015
On Wednesday, 18 November 2015 at 20:35:31 UTC, Ali Çehreli wrote: "Fireside Chat with Andrei, Foundation Update, Q4 Technical Update" http://www.meetup.com/D-Lang-Silicon-Valley/events/226112242/ Andrei will attend over Google+, Walter is a slight possibility. I will update this thread with conferencing information when I know more. Ali If Google+ is playing up, I'd recommend appear.in. Very handy site for video conferencing.
Re: 2.069.0 Installation problem with .exe for Windows
On Wednesday, 11 November 2015 at 08:41:41 UTC, Mike James wrote: On Wednesday, 11 November 2015 at 03:13:18 UTC, Martin Nowak wrote: On Tuesday, 10 November 2015 at 14:17:28 UTC, Mike James wrote: The x64 sub-directory does not exist on my system. We found the bug and I build a new installer with the fix. https://dlang.dawg.eu/downloads/dmd.2.069.0~fix15824/ As soon as someone confirms the fix, we'll make a new point release. Hi Martin, I can confirm it installs correctly on: Windows 10 64-bit. Windows Vista 32-bit. Windows 7 64-bit. Thanks. Regards, -=mike=- I also tried on Windows 8.1 64-bit. To test, I installed it over DMD 2.067 and 2.068, both were successful.
Re: String interpolation
On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: Hi, The only example of string interpolation I've found so far is on Rosetta Code: void main() { import std.stdio, std.string; "Mary had a %s lamb.".format("little").writeln; "Mary had a %2$s %1$s lamb.".format("little", "white").writeln; } Is this a "proper" way of string interpolation in D? This looks a little clumsy. Are there any better approaches? Quick skimming through the docs didn't give anything. Whats clumsy about it? If it's the style (excessive use of UFCS), I'd have to agree with you. Could easily have been written as: format("Mary had a %s lamb", "little"); which I personally think is more readable...
Re: String interpolation
On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: [...] std.string.format and std.format are the standard options. What are you missing? Ruby: a = 1 b = 4 puts "The number #{a} is less than #{b}" PHP: $a = 1; $b = 4; echo "The number $a is less than $b"; D: ??? int a = 1; int b = 4; writefln("The number %s is less than %s", a, b);
Re: Please vote for the DConf logo
On Wednesday, 4 November 2015 at 09:30:30 UTC, Andrei Alexandrescu wrote: Reply to this with 1.1, 1.2, 2, or 3: 1) by ponce: Variant 1: https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png Variant 2: https://raw.githubusercontent.com/p0nce/dconf.org/4f0f2b5be8ec2b06e3feb01d6472ec13a7be4e7c/2016/images/logo2-sample.png 2) by Jonas Drewsen: https://dl.dropboxusercontent.com/u/188292/g4421.png 3) by anonymous: PNG: http://imgur.com/GX0HUFI SVG: https://gist.github.com/anonymous/4ef7282dfec9ab327084 Thanks, Andrei 2. I think it's the cleanest currently. 3 if the font is changed. It needs to be bolder!
Re: Release D 2.069.0
On Wednesday, 4 November 2015 at 01:50:38 UTC, Martin Nowak wrote: Glad to announce D 2.069.0. http://dlang.org/download.html http://downloads.dlang.org/releases/2.x/2.069.0/ This is the first release with a self-hosted dmd compiler and comes with even more rangified phobos functions, std.experimental.allocator, and many other improvements. See the changelog for more details. http://dlang.org/changelog/2.069.0.html -Martin Great stuff! Thanks. In my (very) limited trial run - I don't notice much of a performance difference. Is there any numbers to compare 2069 with 2068 (and maybe even older)?