Re: vibe.d: How to get the conent of a file upload ?

2020-09-18 Thread Atwork via Digitalmars-d-learn

On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
And if not, how is data processed with a 10mb file upload 
followed by a few number fields ?
It needs to read all of the file data to get to the other data 
fields, doesn't it ?


Yes and no


Re: Construct an used-defined hash table container type from an AA-literal expression

2020-07-06 Thread Atwork via Digitalmars-d-learn

On Monday, 6 July 2020 at 11:51:19 UTC, Jacob Carlborg wrote:

On Monday, 6 July 2020 at 01:43:43 UTC, user1234 wrote:


Hereh we go ;)

---
import std;

struct AA
{
void opIndexAssign(int v, string k) @nogc
{}
}

void main(string[] args) @nogc
{
AA myCustom;

enum literal = ["one":1, "two":2].stringof[1..$-1];
enum pairs   = literal.split(',').array;
---


That split won't work if you have something more complicated, 
like struct values:


struct Foo
{
int a;
int b;
}

enum literal = ["one":Foo(1, 2), "two":Foo(3, 
4)].stringof[1..$-1];

enum pairs = literal.split(',').array;
static assert(pairs == 4);

--
/Jacob Carlborg


Wouldn't work if the keys had , in them either. So don't even 
need a struct to break it.


enum literal = ["one,two": 12, "two,three": 23].stringof[1..$-1];

// Now split(",") won't work either.


Fibers and std.socket

2020-05-22 Thread Atwork via Digitalmars-d-learn

Is it possible to mix fibers with sockets from phobos?

If so, how would I do it?

Like just a simple example of async sockets using fibers in D.

I will say that I'd prefer to not use any packages ex. vibe.d


Dub installer (Windows)

2020-05-20 Thread Atwork via Digitalmars-d-learn

Is there no longer an installer for Dub on Windows?

The download page just links to the release page on Github but 
all of the archives just contain dub.exe


Do I have to manually add it to PATH etc. now? That is painful 
having to do.


Re: Dub installer (Windows)

2020-05-20 Thread Atwork via Digitalmars-d-learn

On Wednesday, 20 May 2020 at 10:50:10 UTC, Atwork wrote:

Is there no longer an installer for Dub on Windows?

The download page just links to the release page on Github but 
all of the archives just contain dub.exe


Do I have to manually add it to PATH etc. now? That is painful 
having to do.


Nvm. Figured it out. It came with DMD.


Re: gzip and vibe.d

2020-05-20 Thread Atwork via Digitalmars-d-learn

On Wednesday, 20 May 2020 at 07:49:28 UTC, Daniel Kozak wrote:
On Wed, May 20, 2020 at 9:45 AM Atwork via Digitalmars-d-learn 
 wrote:


Is it possible to have vibe.d gzip responses?

I cannot find anything in the documentation about it.

I am not talking about gzipping ex. files/streams but ALL 
responses as a whole.


Is there a configuration or something I need to set for it to 
be supported?


https://vibed.org/api/vibe.http.server/HTTPServerSettings.useCompressionIfPossible


Thank you!


gzip and vibe.d

2020-05-20 Thread Atwork via Digitalmars-d-learn

Is it possible to have vibe.d gzip responses?

I cannot find anything in the documentation about it.

I am not talking about gzipping ex. files/streams but ALL 
responses as a whole.


Is there a configuration or something I need to set for it to be 
supported?