Re: D Language Foundation June 2022 Monthly Meeting Summary

2022-06-24 Thread Adam Ruppe via Digitalmars-d-announce
I wrote up a thing in my blog about what I'd like to see from dips and the steering of the language and there might be some overlap with your vision document concepts: http://dpldocs.info/this-week-in-d/Blog.Posted_2022_06_20.html

Re: Window created with Windows API is not visible

2022-06-18 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 18 June 2022 at 23:00:36 UTC, solidstate1991 wrote: This is going to be a long match. you might consider using another exisitng lib. my simpledisplay.d does all this and much more for example

Re: Comparing Exceptions and Errors

2022-06-04 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 4 June 2022 at 22:31:38 UTC, Ola Fosheim Grøstad wrote: So what do you have to do to avoid having Errors thrown? How do you make your task/handler fault tolerant in 100% @safe code? Run it in a separate process with minimum shared memory.

Re: What happened to Deimos and why ?

2022-06-04 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 4 June 2022 at 13:44:06 UTC, Alain De Vos wrote: What happened to Deimos and why ? Nothing, it does its job same as it always has.

Re: How to fix "typesafe variadic function parameter"?

2022-05-24 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 24 May 2022 at 22:46:55 UTC, Andrey Zherikov wrote: return S(s); return S(s.dup); The variadic lives in a temporary array that expires at the end of the function. So copying it out to the GC lets it live on. Your code was wrong on 2.099 too, but the compiler didn't

Re: Cannot check function address

2022-05-24 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 24 May 2022 at 18:54:33 UTC, frame wrote: Usually that works fine as shown in module A but for some reason not in module B. Do you have some other definition of fun somewhere?

Re: How to call destroy() in @nogc?

2022-05-24 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 24 May 2022 at 14:11:57 UTC, Steven Schveighoffer wrote: Note it has no idea what the real object type is at this point, just that it is an Object (which does not have a @nogc destructor). It actually has nothing to do with Object. It doesn't have a destructor at all, so there's

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Adam Ruppe via Digitalmars-d-learn
On Thursday, 19 May 2022 at 21:41:50 UTC, Marcone wrote: Are you using the `-L/entry:mainCRTStartup` or the `L/entry:wmainCRTStartup` ? -L/entry:mainCRTStartup try the w one too. both doing the same result?

Re: Release: serverino - please destroy it.

2022-05-10 Thread Adam Ruppe via Digitalmars-d-announce
On Monday, 9 May 2022 at 19:20:27 UTC, Andrea Fontana wrote: Thank you. Looking forward to getting feedback, bug reports and help :) BTW I'm curious, what made you not want to use my cgi.d which has similar capabilities?

Re: Release: serverino - please destroy it.

2022-05-08 Thread Adam Ruppe via Digitalmars-d-announce
On Sunday, 8 May 2022 at 22:09:37 UTC, Ali Çehreli wrote: That effectively uses multiple GCs. I always suspected that approach would provide better latency. My cgi.d has used some fork approaches for a very long time since it is a very simple way to spread this out, it works quite well.

Re: GCC 12.1 Released (D v2.100-rc.1)

2022-05-07 Thread Adam Ruppe via Digitalmars-d-announce
On Saturday, 7 May 2022 at 22:07:58 UTC, Iain Buclaw wrote: I expect it only to increase as more of the old opaque compiler-library interface is replaced with a templated interface that exposes the guts of what each helper does (for improved run-time performance, of course). Well, I'm pretty

Re: Library for image editing and text insertion

2022-04-26 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 18:31:49 UTC, H. S. Teoh wrote: maybe look at Adam Ruppe's arsd library (https://github.com/adamdruppe/arsd) for some lightweight modules that read common image formats and do some primitive image manipulations. I don't actually have an image to image blit

Re: A template construct like using()

2022-04-26 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 23:00:57 UTC, cc wrote: If your draw code doesn't depend on any scoped state you can use `function()` instead of `delegate()` to save a GC call. `scope delegate` also works here and just reuses the stack.

Re: Beginner memory question.

2022-04-16 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 16 April 2022 at 20:41:25 UTC, WhatMeWorry wrote: Is virtual memory entering into the equation? Probably. Memory allocated doesn't physically exist until written to a lot of the time.

Re: TIC-80 WebAssembly: pointers to fixed addresses

2022-04-16 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 16 April 2022 at 14:29:09 UTC, Pierce Ng wrote: ``` pub const FRAMEBUFFER: *allowzero volatile [16320]u8 = @intToPtr(*allowzero volatile [16320]u8, 0); pub const TILES : *[8192]u8 = @intToPtr(*[8192]u8, 0x4000); pub const SPRITES : *[8192]u8 = @intToPtr(*[8192]u8, 0x6000); ``` I

Re: arsd.minigui

2022-04-03 Thread Adam Ruppe via Digitalmars-d-learn
On Sunday, 3 April 2022 at 16:58:03 UTC, JG wrote: Hi, I have an png image that I generate (via pdf via pdflatex) that I want to scale and display in a widget. Is this possible via something in arsd? I tried resizeImage but that doesn't seem to do what I expect. Any suggestions? Which

Re: arsd-minigui - couple of questions

2022-03-28 Thread Adam Ruppe via Digitalmars-d-learn
In fact, using a pragma now, I think I got it so you don't even need the manifest now (the pragma includes a default one now). Only works when doing dmd -m32mscoff or dmd -m64 builds (which are also what dub uses fyi), will NOT work with a default dmd no-switch build.

Re: arsd-minigui - couple of questions

2022-03-28 Thread Adam Ruppe via Digitalmars-d-learn
oooh it actually is even easier than I thought, just a changed flag plus the manifest. Just pushed to minigui master. only ended up being 4 lines for this little thing. Try rebuilding with that AND be sure to use the manifest file too, same as dwt. Then you should be able to find some joy.

Re: arsd-minigui - couple of questions

2022-03-28 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 28 March 2022 at 21:10:47 UTC, Sai wrote: FWIW, DWT which uses native controls on windows can show transparent pngs and also both image & text at the same time. However I had to add the following app.exe.manifest Yeah, this tells me they used owner-drawn buttons, which is only

Re: arsd-minigui - couple of questions

2022-03-28 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote: 1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color. Well, I tried forwarding the

Re: arsd-minigui - couple of questions

2022-03-28 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote: 1. I assume arsd-minigui library does not support transparent images by itself, does it? I am trying to show a png image with transparent areas on a button, but those transparent areas shows as black color. I added that to simpledisplay

Re: Basic question about size_t and ulong

2022-03-18 Thread Adam Ruppe via Digitalmars-d-learn
On Friday, 18 March 2022 at 21:54:55 UTC, WhatMeWorry wrote: Isn't ulong an integer? And isn't memory addresses 64 bits long? Only if you are doing a 64 bit build. Try using -m64

Re: argparse version 0.7.0 - a CLI parsing library

2022-03-18 Thread Adam Ruppe via Digitalmars-d-announce
On Friday, 18 March 2022 at 18:21:46 UTC, Anonymouse wrote: I use UDAs extensively in my project and I've historically been doing the multiple-UDA approach you describe. Upon seeing argparse a few months back I started rewriting it to use a single UDA, and I found it allowed for a simpler

Re: static init c struct with array filed

2022-03-16 Thread Adam Ruppe via Digitalmars-d-learn
On Thursday, 17 March 2022 at 00:16:39 UTC, Mike Parker wrote: On Wednesday, 16 March 2022 at 07:27:06 UTC, test wrote: ```c struct Test { int32_t a; } struct Test2 { int32_t a; Test arr[]; } ``` I need static const init Test2, then pass it to c library late(third library, can not

Re: From the D Blog: The Binary Language of Moisture Vaporators

2022-01-24 Thread Adam Ruppe via Digitalmars-d-announce
On Monday, 24 January 2022 at 22:45:14 UTC, Ali Çehreli wrote: I am not aware of any association between "alpha" and "man" because I hear both "alpha male" and "alpha female" in e.g. nature documentaries. It isn't really accurate in nature either and when used with people it tends to be

Re: D Language Quarterly Meeting Summary for January 2021

2022-01-23 Thread Adam Ruppe via Digitalmars-d-announce
On Sunday, 23 January 2022 at 15:35:17 UTC, Paul Backus wrote: The main benefit of having multiple versions available in separate namespaces is that it allows them to coexist in the same project, which means that users can migrate their code incrementally from one to the other. Yeah, I know

Re: D Language Quarterly Meeting Summary for January 2021

2022-01-23 Thread Adam Ruppe via Digitalmars-d-announce
On Sunday, 23 January 2022 at 14:33:26 UTC, Paul Backus wrote: Absolutely-no-breakage-ever is basically the C++ approach, and I have already explained why I think it's a bad idea, though I recognize that reasonable people can disagree on this point. My view is it isn't worth shipping mixed

Re: forward tuple arg to local variable + dtor

2022-01-22 Thread Adam Ruppe via Digitalmars-d-learn
You can't forward to a local variable. Local variables will be a copy of the tuple. forward only actually works if sent *directly* to another function call. There's a bunch of things in D that only work in function parameter lists and not local variables. This is one of them.

Re: Using getSymbolsByUDA in a static foreach loop

2022-01-19 Thread Adam Ruppe via Digitalmars-d-learn
On Thursday, 20 January 2022 at 00:55:33 UTC, Jack Stouffer wrote: static foreach(member; __traits(allMembers, Manager)) member here is a string, not the member. I prefer to call it memberName. Then you __traits(getMember, Manager, memberName) to actually get the alias you can

Re: Ambiguity issue with expanding and evaluating single template type parameter enums

2021-12-27 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 28 December 2021 at 00:13:13 UTC, data pulverizer wrote: There are various requirements, sometimes I have to cast or type convert, so I **need** the type to paste correctly and explicitly. You almost never actually need types as strings. I'm almost certain there's a better way

Re: Ambiguity issue with expanding and evaluating single template type parameter enums

2021-12-27 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 27 December 2021 at 21:21:30 UTC, data pulverizer wrote: alias T = MyType!(INTEGER); What is MyType? enum code = "writeln(\"instance: \", adder(" ~ T.stringof ~ "(), " ~ U.stringof ~ "()" ~ "));"; And why is this a string mixin instead of a plain simple

Re: Ambiguity issue with expanding and evaluating single template type parameter enums

2021-12-27 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 27 December 2021 at 21:05:51 UTC, data pulverizer wrote: adder(MyType!MyEnum.INTEGER(), MyType!MyEnum.STRING()); The rule for !(args) is of you leave the parenthesis off, it only uses the next single token as the argument. So it will never include a dot; it is like you wrote

Re: How to print unicode characters (no library)?

2021-12-26 Thread Adam Ruppe via Digitalmars-d-learn
On Sunday, 26 December 2021 at 20:50:39 UTC, rempas wrote: I want to do this without using any library by using the "write" system call directly with 64-bit Linux. write just transfers a sequence of bytes. It doesn't know nor care what they represent - that's for the receiving end to figure

Re: How to pass a class by (const) reference to C++

2021-12-15 Thread Adam Ruppe via Digitalmars-d-learn
On Wednesday, 15 December 2021 at 22:24:42 UTC, H. S. Teoh wrote: `__gshared` is needed to coax the compiler into making the variable global in the C/C++ sense, i.e., only 1 instance across all threads. it is just normally __gshared implies static automatically. it does in like every other

Re: Beta 2.098.1

2021-12-12 Thread Adam Ruppe via Digitalmars-d-announce
On Sunday, 12 December 2021 at 22:01:57 UTC, Martin Nowak wrote: http://dlang.org/changelog/2.098.1.html 404'd!

Re: Why code failed to compile for foo2?

2021-12-11 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 11 December 2021 at 23:17:17 UTC, Stanislav Blinov wrote: ? No. If it was unsatisfied constraint, the error would've shown that. And if you try to instantiate it, you'll see it is an unsatisfied constraint anyway. There's two layers of failure here. Using Unqual there is pretty

Re: Why code failed to compile for foo2?

2021-12-11 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 11 December 2021 at 22:50:45 UTC, apz28 wrote: void foo2(T)(Unqual!T x) if(isUnsigned!T) {} This means it treats foo2 as if it doesn't exist unless T is unsigned... onlineapp.d(15): Error: template `onlineapp.foo2` cannot deduce function from argument types `!()(int)`

Re: T... args!

2021-12-08 Thread Adam Ruppe via Digitalmars-d-learn
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer wrote: Is this not a contradiction? : and 3.1415 aren't string: ```d void foo(string...)(string args) { `string...` there is a user-defined identifier representing a mix of types. string isn't special, yo can declare your own

Re: How to read a single character in D language?

2021-11-19 Thread Adam Ruppe via Digitalmars-d-learn
On Friday, 19 November 2021 at 20:51:09 UTC, BoQsc wrote: But the source file overwhelmed me by its size. Yeah, the getch function in there builds on the rest of the events the library offers, so it won't be that useful outside. The OS functions for getch alone though are actually pretty

Re: arsd.simpledisplay on macos

2021-11-16 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 16 November 2021 at 03:41:31 UTC, Ben Jones wrote: I'm trying to use Adam's simpledisplay on a mac with XQuartz which is installed + running. When I try to create a window, it crashes when calling `XDisplayConnection.get()`. Hmm, I have never actually seen that fail since the mac

Re: D modules

2021-11-13 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote: When I'm searching for "toUpper" and "toLower" functions that string type uses They are usable though `import std.string;` the docs just don't do a great job showing that. The newest test version of my doc generator does

Re: in a template, how can I get the parameter of a user defined attribute

2021-11-06 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 6 November 2021 at 19:45:49 UTC, Chris Bare wrote: dbForeignKey!(Position) static if(is(T == dbForeignKey!Arg, Arg)) { // use Arg here }

Re: How to do a function pointer to "malloc" and "free"?

2021-10-17 Thread Adam Ruppe via Digitalmars-d-learn
On Sunday, 17 October 2021 at 23:07:15 UTC, Elmar wrote: Do you have a link for more information how to initialize the D runtime? Export a function that calls this: http://druntime.dpldocs.info/core.runtime.Runtime.initialize.html And also export a function that calls this:

Re: Beta 2.098.0

2021-10-12 Thread Adam Ruppe via Digitalmars-d-announce
On Sunday, 10 October 2021 at 23:11:56 UTC, Walter Bright wrote: ImportC resolves a long standing serious issue where multiple other substantial attempts at solving it have fallen short over the years. Why have the other approaches fallen short? How does importC address these problems?

Re: How to do a function pointer to "malloc" and "free"?

2021-10-10 Thread Adam Ruppe via Digitalmars-d-learn
On Sunday, 10 October 2021 at 13:52:57 UTC, Elmar wrote: The language subset "BetterC" is required for calling D functions from C though. This is false. You can use any D features when calling it from C, you just need to provide an init and term function that is called from C that runtime

Re: DConf Online 2021 Schedule Published

2021-10-08 Thread Adam Ruppe via Digitalmars-d-announce
On Friday, 8 October 2021 at 22:16:16 UTC, Matheus wrote: Adam beyond the continuation... we need a new and simply Web Browser written in D. :) You know back in 2013ish I actually was doing a little one. htmlwidget.d in my github repo. It always sucked but it is tempting to go back to it;

Re: Better debugging?

2021-10-03 Thread Adam Ruppe via Digitalmars-d-learn
On Sunday, 3 October 2021 at 22:21:45 UTC, Tim wrote: -gc DMD2 compiler switch tried plain -g ? -gc is a compatibility debug thing for things with zero D support. p oboslete now

Re: Template mixin problem with EnumMembers

2021-10-02 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 2 October 2021 at 22:07:23 UTC, Ferhat Kurtulmuş wrote: The below code works as expected on https://run.dlang.io/, but not on my computer. And I don't know why? You used .stringof. That's undefined behavior. Never use stringof. (except for debugging writes) Now, I'd actually

Re: Understanding range.dropBackOne

2021-09-28 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 22:56:17 UTC, Tim wrote: I'm doing the following: int[25] window = 0; Note that this array has a fixed size. window = someInteger ~ window[].dropBackOne; Here the window[] takes a variable-length slice of it. Turning it from int[25] into plain int[]. Then

Re: Templates for instantiating derived class

2021-09-20 Thread Adam Ruppe via Digitalmars-d-learn
On Monday, 20 September 2021 at 22:16:47 UTC, rjkilpatrick wrote: auto opBinary(string op)(int rhs) const if (op == "+") { return new Super(_a + rhs); // Creates of type Super even when called from derived class } Make this auto opBinary(string op, this This)(int rhs)

Re: SAOC 2021 Projects Summarized

2021-09-01 Thread Adam Ruppe via Digitalmars-d-announce
On Wednesday, 1 September 2021 at 22:23:59 UTC, user1234 wrote: I dont know why destructors are not virtual. https://dlang.org/spec/class.html#destructors "There can be only one destructor per class, the destructor does not have any parameters, and has no attributes. It is always virtual. "

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 17 July 2021 at 20:42:06 UTC, someone wrote: From the interface perspective: are these signatures identical or not ? No, they are very different. But you also don't gain much from const here and that ref is probably actively harmful so i wouldn't use them here.

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 17 July 2021 at 20:49:58 UTC, someone wrote: ref classTickerID robjTickerID Why are you using ref here at all? You probably shouldn't be using it. But if it is legitimately needed you can do a pointer instead of ref.

Re: UFCS doubt

2021-07-08 Thread Adam Ruppe via Digitalmars-d-learn
On Thursday, 8 July 2021 at 22:24:26 UTC, Antonio wrote: I supossed that ```mfp(c,20)``` and ```c.mfp(20)``` should be equivalent because UFCS in second example, but it is not... why? UFCS only works with functions defined at top level, not nested inside other functions. That's just how it

Re: What can be done to reduce executable size?

2011-12-11 Thread Adam Ruppe
Jacob Carlborg Wrote: As long as the runtime and standard library is statically linked the executables will be bigger than the corresponding C/C++ executable. I just want to say it's very important to me that static linking still just works very easily even if we start to offer dynamic

Re: D1 to be discontinued on December 31, 2012

2011-12-11 Thread Adam Ruppe
Vladimir Panteleev Wrote: This raises a question: will the D1 compiler be made redistributable when it's discontinued? Isn't it already licensed for redistribution by the Tango folks?

Re: Haxe (From: Java Scala - new thread: GUI for D)

2011-12-07 Thread Adam Ruppe
Adrian Wrote: [OT] As a side point from a not yet D developer, but someone who looks at the language with great interest, but also someone with a commercial responsibility: I am missing big projects developed in D and the most logic project would be the compiler itself! I know this has been

Re: Comma operator = broken design

2011-12-07 Thread Adam Ruppe
Alex Rønne Petersen Wrote: I really do not see the value in allowing such syntax in the first place. I've been told that one argument was that generated code might use it, but I have no idea why it would be needed. Aside from the compiler's implementation, one possible use is something I

Re: javascript (was Re: Java Scala - new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Jacob Carlborg Wrote: for e in arr # do something with the element e Heh, I used to think that would work in regular Javascript, since it does have a for(blah in something) form... But in regular javascript, that only works on objects!

Re: javascript (was Re: Java Scala - new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Marco Leise Wrote: This is really one of the largest shortcomings of the language that can not be explained with a simple design choice. Aye. One of the newer versions adds a forEach member to the array prototype, that works like this: [1, 2, 3].forEach(function(element) { use element here;

Re: Java Scala - new thread: GUI for D

2011-12-05 Thread Adam Ruppe
Jacob Carlborg Wrote: Do you have any opinion about Dart from Google? Google's MO is generally to take something bad... and make it /worse/. It compiles to Javascript, but script that doesn't actually work everywhere...

Re: Haxe (From: Java Scala - new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Nick Sabalausky Wrote: The only problem now is that that would rule out the possibility of sharing code between both server and client - Which is *NOT* something I want to give up... What kind of code is it? The main reason for the javascript api thing in my web.d is to help minimize the

Re: Haxe (From: Java Scala - new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Adam Ruppe Wrote: Of course, it keeps the JS down to size... but doesn't actually let you run code on the client written in D. Unless your client is a real application, of course :P I did a Qt app using the modules from a work web app earlier in the year. I interfaced with Qt via a message

Re: boost crowd.

2011-11-28 Thread Adam Ruppe
Do you think it'd be a good thing to put the .di file in the generated compiled lib? That'd be somewhat similar to the c# example. dmd myprog.d something.dll searches something.dll for a .di reference, and adds it to the compile command line if it's there.

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Kagamin Wrote: well, most people here seem to use nntp clients, so their requests (like threaded view) can be safely ignored :) they have it in their clients. Indeed. Hell, I probably won't use it very often, since I have my precious mutt mail client! But, regardless, I wrote that already and

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Nick Sabalausky Wrote: a:link vs a:visited That was my original plan, but I like having multiple posts on one page too, and you can't link them up that way. Or can you? Maybe with script, I can watch the scroll position and change the anchor as each post scrolls into view. The anchor could be

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Vladimir Panteleev Wrote: Hmm... Now what do I do with the half-written thing I started writing two days ago (for news and newsgroups)? We could always combine the best parts of both of them!

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Walter Bright Wrote: It's trivial with a news reader, because unread messages are in boldface. Which is possible because the messages are sorted linearly in the computer! When you do a newnews command in NNTP, you tell it a time, not a thread. Then it grabs everything since that time, and you

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Peter Alexander Wrote: Would this encourage vandalism? If people know they can get a post on the front page of the D website just by posting to D.announce then I think we could see some trouble. Meh, I say we cross that bridge when we come to it. Right now, the D newsgroups have a pretty

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Jonathan M Davis Wrote: Knowing the parent post of a particular post can be critical to understanding that post - especially when the parent post isn't quoted in the reply. Yeah, that's one of the few times I hit the o-t keys in my mail reader to sort by thread. Keep in mind that this

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
bcs Wrote: Cut the tab size by about 60% and that's usable. OK OTOH it will still end up with a column size of -10 pt about the time threads get interesting. Another fundamentally broken aspect of tree views. And if anyone keeps more than about 3 layers of quoting you need to be Tolstoy

Re: newsgroup web viewer

2011-11-16 Thread Adam Ruppe
Walter Bright Wrote: If that sin isn't enough, the other problem is there is no way to mark a post as read. Every linear view web forum software I've ever seen handles this automatically. I don't really love the implementation of most of them, but they usually do a good enough job anyway.

Re: Dynamic alter-ego of D.

2011-10-26 Thread Adam Ruppe
You can use opDispatch to make runtime methods and properties by having it forward to a function to do the lookup. Something alone these lines: DynamicObject delegate(DynamicObject[] args) dynamicFunctions; DynamicObject opDispatch(string name, T...)(T t) { if(name !in dynamicFunctions)

Re: FastCGI binding or implementation?

2011-10-19 Thread Adam Ruppe
Andrea Fontana: other http methods have nothing special Indeed. The only thing that might get you is if the data's content type is different than the default. That's possible on POST too, though, so still nothing special. My cgi library has an enum to tell you what the requestMethod is, and it

Re: xml Bible for conversion for D

2011-10-19 Thread Adam Ruppe
I found std.xml useless too, so I wrote my own lib. https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff Grab dom.d from there. First, convert your file to UTF-8. My lib might work for you, but it assumes utf-8 so it will throw if it actually encounters a non-ascii

Re: FastCGI binding or implementation?

2011-10-19 Thread Adam Ruppe
Jacob Carlborg: Why not just cache the generated HTML and let Apache handle it. That sounds hard... configuring Apache to do anything beyond the most trivial of tasks is a huge pain to me. It is easy to call cgi.setCache(true); though. Then it doesn't even need to start the application if the

Re: [std.database]

2011-10-11 Thread Adam Ruppe
Andrei Alexandrescu wrote: The database engine should be codified in the connection string, not in the type name. Why? If it's in the type, you can trivially specialize for different engines and get static checking for functions not supported across them all, or runtime checking if you

Re: [std.database]

2011-10-09 Thread Adam Ruppe
The way I'd do it is: interface Database { // support shared functions here, and other stuff useful enough to // warrant emulation } class Postgres : Database { // implement the interface, of course, but also all other postgres // specific stuff } When you go to use it, if you're

Re: how to build up the library..

2011-10-07 Thread Adam Ruppe
What's the big advantage of Person.find_all_by_name_and_age(Joe, 15) over db.query(select * from people where name = ? and age = ?, Joe, 15); The latter is much easier to write in the library and you retain all the flexibility of sql itself if needed.

Re: Database interface design - was how to build up the library.

2011-10-07 Thread Adam Ruppe
In my database.d, I used a database row struct to provide both integer and key based indexes.

Re: Database interface design - was how to build up the library.

2011-10-07 Thread Adam Ruppe
Sean Kelly wote: Does your Row equate to the ResultSet above? Fairly similar. Mine looks something like this: interface ResultSet { // name for associative array to result index int getFieldIndex(string field); string[] fieldNames(); bool empty(); Row

Re: std.getopt suggestion

2011-10-05 Thread Adam Ruppe
Andrei wrote: We don't kind of have a MySQL library. We just don't have one. Actually, we have three or four. Maybe more. There aren't any in phobos, but they are still fairly easy to find. (Or hell to just wrap C takes less than an hour.)

Re: std.getopt suggestion

2011-10-05 Thread Adam Ruppe
Andrei wrote: link to a few There's mine: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff see database.d and mysql.d for mysql. Also some code for postgres and sqlite in there own modules. Piotr Szturmaj's is postgres only, but generally vastly superior to

Re: version vs. static if

2011-09-23 Thread Adam Ruppe
I hope there's no D3 for a very long time. Maybe 2020.

Re: version vs. static if

2011-09-23 Thread Adam Ruppe
There's several reasons backward compatibility is important: 1) Breaking it annoys me. There's still stuff I like for new features, so I'm not at the point where I'll never update again yet, but I don't want my code to break more. Especially if non-trivial. 2) It splits people. Suppose you

Re: Paradox about D's popularity.

2011-09-21 Thread Adam Ruppe
SWIG kinda scares me... doesn't it generate wrappers instead of direct calls into the C++? That could easily double the size of the library. There's a bugzilla entry with a thing to allow calling into more of C++'s functions with extern(C++). I'd like to see that pulled into the tree if it passes

Re: Anonymous function syntax

2011-09-21 Thread Adam Ruppe
deadalnix wrote: This makes Javascript's and D's closures the most readable for somebody having this background. Indeed! I find most the proposed lambdas to look like random noise. D has it good just how it is.

Re: How can I use D to develop web application?

2011-09-13 Thread Adam Ruppe
zsxxsz wrote: I think the cgi module is lower effecient. That's not really true. The reason CGI has a perception of being slow is because it's used by slow languages most the time, but with D, it's fast. That said, if you still want to use fast cgi, just use -version=fastcgi when compiling with

Re: How can I use D to develop web application?

2011-09-13 Thread Adam Ruppe
zsxxsz wrote: The fork process is expensive for any OS. Have you actually measured this? I feel the cgi library is too simple, so I doubt wether it supports fcgi for Apache, Nginx or other Webserver. Have you actually looked at it? I've personally used it on three web servers (IIS, Apache,

Re: Line lengths discussed in eclipse forum and on reddit

2011-09-12 Thread Adam Ruppe
Andrei Alexandrescu wrote: Surely you're jesting. Partially. For the most part, the metric system is better for science, but for day to day stuff? Poo. Lots of silly things to remember and the numbers don't line up well to regular stuff. Could be due to the fact that I'm more used to it, but

Re: Line lengths discussed in eclipse forum and on reddit

2011-09-12 Thread Adam Ruppe
Andrei Alexandrescu wrote: Well I agree to that, but allow me to note that it's only one post away you mentioned 0 as a memorable number. I might have been unclear - it's not so much that it's memorable, but it has a different gut reaction. Below zero in my gut is akin to saying it's off the

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Walter Bright wrote: I don't think that is the reason PHP is such a bear to work with. It is one of the problems with PHP, but I'm not sure it applies to D the same way. Almost *every time* I write PHP, I either mess up a name or the argument order. (Sometimes, PHP functions go src, dest, and

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Walter Bright wrote: I agree that the XML and JSON libraries need to be scrapped and rewritten. Ugh, I actually use the std.json. Furthermore, in order to work successfully, gofix [...] The easiest way to do that is run the compiler. If an error occurs, go to the given line of the problem and

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Andrei Alexandrescu wrote: What should we use? xml2? That might be a good idea. If D modules were to get in the habit of writing their major version numbers as part of the name, it'd solve this as well the dget automatic library downloading thingy in one go. Going with new and old won't work if

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Jacob Carlborg wrote: I prefer to use old_. There's two big problems with that though: 1) It still breaks the old code. It's an even easier fix, so this isn't too bad, but it is still broken. 2) What if a third version of a module comes along?

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Jacob Carlborg wrote: You can always keep your own local copy of a module. Yeah, though that comes with it's own set of pains. But, let me ask you this. Which is better? 1) Ask an unknown number of people to change their code to keep up with your changes and/or distribute the old module or

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Andrej Mitrovic wrote: select deprecated functionality The problem I have is old code isn't going to change itself to select old functions. New code, on the other hand, can decide to use new functions since someone is actively writing it. Therefore, it's less painful to opt in to using new

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Andrej Mitrovic: I assume people will just pick the first thing they see That's why the links on the left should always point to the newest version, and there might be notes in the docs pointing people to newer and older versions. std.xml looks standard so they would pick that over std.xml2

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-06 Thread Adam Ruppe
Daniel Murphy wrote: How could [moving a module to your own code] be made easier? Actually, ironically enough, removing it from Phobos would make it easier, since they the file can simply be copied into my own tree without needing to rename it to avoid conflicts. This wouldn't apply to a

Re: std.stdio overhaul by Steve Schveighoffer

2011-09-05 Thread Adam Ruppe
Count me as another who is sick and tired of the gratuitous breaking changes every damned month. The worst part is there's still some new stuff I actually want each month, so I'm not doing my usual strategy of never, ever, ever updating software. It's just pain. Trivial changes are easy enough

  1   2   3   4   >