On Monday, 4 January 2016 at 19:04:48 UTC, Max Klyga wrote:
On 2016-01-04 18:40:03 +, Jason Jeffory said:
The fastest one would probably be Lua -
http://code.dlang.org/search?q=lua
But there are other options:
Python - http://code.dlang.org/packages/pyd
Javascript -
On Thursday, 31 December 2015 at 08:51:42 UTC, Daniel Kozak wrote:
I try to build vibe-d Hello world app with dub, but I have many
problems with dub, nothing works at all
Error: Output file 'client.o' for module 'vibe.http.client'
collides with previous module 'vibe.db.mongo.client'. See the
hi!
how can i format a string with captures from a regular
expression?
basically make this pass:
https://gist.github.com/f17647fb2f8ff2261d42
context: i'm trying to write a implementation for
https://github.com/ua-parser
where the regular expression as well as the format strings are
regex from
https://github.com/ua-parser/uap-core/blob/master/regexes.yaml#L38
seems to work in other languages, not so in D:
auto r2 = r"(?:\/[A-Za-z0-9\.]+)? *([A-Za-z0-9
_\!\[\]:]*(?:[Aa]rchiver|[Ii]ndexer|[Ss]craper|[Bb]ot|[Ss]pider|[Cc]rawl[a-z]*)) (\d+)(?:\.(\d+)(?:\.(\d+))?)?".regex();
Hi Rikki,
On Monday, 23 November 2015 at 03:57:06 UTC, Rikki Cattermole
wrote:
I take it that browscap[0] does it not do what you want?
I have an generator at [1].
Feel free to steal.
This looks interesting, thanks for the hint. However it might be
a bit limited,
i have 15M+ different User
i'm trying to build the docs as per
http://wiki.dlang.org/Building_DMD#Building_the_Docs
i have a working setup to build the latest dmd/druntime/phobos
but somehow the makefile tries to download an old dmd version and
my bandwith currently is a bit restricted and i want an offline
version.
On Tuesday, 16 August 2016 at 10:06:05 UTC, ikod wrote:
On Tuesday, 16 August 2016 at 09:16:40 UTC, yawniek wrote:
There is common http message parser that used in nginx and
nodejs. I think it can be ported from C to D.
that is pico, see:
https://github.com/nodejs/http-parser/pull/200
On Wednesday, 26 April 2017 at 17:06:52 UTC, krylon wrote:
I looked at the DUB package registry and asked Google quite a
bit now, but I did not found such a package for D. So my first
question is - did I not look hard enough? I found a
reimplentation of QDBM [1] (the spiritual ancestor of
in how far is it or would the following be possible:
dynamically compile and execute some glue logic that is also
written in D under linux?
and what happens if that code uses phobos or other dub libs that
are available in the host binary?
especially the 2nd point is important as i would
On Monday, 6 October 2014 at 17:11:51 UTC, ANtlord wrote:
Good day! I recenlty have tried create typical project on
vibe.d. The web framework is not bad. And I can say, that it is
better that something another web frameworks. But I have met a
problem. I can't find search engine.
I use xapian
i found two snippets from the functional docs that do not work
(anymore?)
http://dlang.org/phobos/std_functional.html
assert(compose!(map!(to!(int)), split)(1 2 3) == [1, 2, 3]);
and
int[] a = pipe!(readText, split, map!(to!(int)))(file.txt);
throwing a std.array.array into the mix works
hi,
i'm trying to get a thrift example working within a dub project.
it seems that the thrift.d in the dub repo is not whats actually
needed but
i should link against libthriftd.a that comes from the official
thrift distro.
what i tried is add the following to dub.json:
libs:
got it to work by using the thrift code from the fbthrift repo
(minus the tests).
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
1. Do I need write ./public/ ? In examples often simply
public/
will work too. even public
it goes trough Path struct, see:
https://github.com/rejectedsoftware/vibe.d/blob/11578aa956a9b3b0e305d655f9668a867fdd89bd/source/vibe/inet/path.d
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote:
shared static this()
{
auto router = new URLRouter;
router.get(/, root);
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, router);
}
void root(HTTPServerRequest req,
On Thursday, 28 May 2015 at 10:11:38 UTC, zhmt wrote:
On Thursday, 28 May 2015 at 02:00:57 UTC, zhmt wrote:
the throughput is steady now: if buffer size is set to 1,
throughput is about 20K response/second; when buffer size is
big enough ,the throughput is about 60K response/second.
On Monday, 17 August 2015 at 13:04:31 UTC, tired_eyes wrote:
On Monday, 17 August 2015 at 12:58:54 UTC, Adam D. Ruppe wrote:
On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote:
Hovewer, dmd app.d spits a whole bunch of strange error
messages:
try dmd -lcurl app.d and see if that
On Friday, 21 August 2015 at 21:08:25 UTC, Laeeth Isharc wrote:
I guess this kind of thing will do:
upRangeHighs.each!((ref a)=(++histogram[a][0]));
int[] arr = [5,1,2,2,3,4,5,5,5];
int[int] histo;
arr.each!( a = ++histo[a] );
writeln(histo);
this works
On Wednesday, 29 July 2015 at 17:59:26 UTC, Kyoji Klyden wrote:
How would I use a C function that's returning a struct? auto
doesn't work here, and from what I can tell D can't import C
headers. (If it really can't then, that would be a very welcome
feature)
I do have the required libs but I
On Wednesday, 29 July 2015 at 16:36:41 UTC, Atila Neves wrote:
LDC:
Cerealed: 970 ms, 482 μs, and 6 hnsecs
MsgPack: 896 ms, 591 μs, and 2 hnsecs
Not too shabby!
Atila
cool.
what are the advantages of cereald over msgpack?
can you stream in packets with cereald too?
cool thing about
hi,
unpacking files is kinda slow, probably i'm doing something wrong.
below code is about half the speed of gnu zcat on my os x machine.
why?
why do i need to .dup the buffer?
can i get rid of the casts?
the chunk size has only a marginal influence.
https://github.com/yannick/zcatd
import
On Friday, 7 August 2015 at 08:50:11 UTC, Daniel Kozák wrote:
ldc[2] -O -release -boundscheck=off -singleobj app.d
ldc 0.15.2 beta2
2.86s user 0.55s system 77% cpu 4.392 total
v2.068-devel-8f81ffc
2.86s user 0.67s system 78% cpu 4.476 total
v2.067
2.88s user 0.67s system 78% cpu 4.529
On Friday, 7 August 2015 at 07:29:15 UTC, Daniel Kozák wrote:
Which compiler and version. There has been some performance
problem with IO on OSX, it should be fixed in 2.068 release
i'm on master. v2.068-devel-8f81ffc
also changed file read mode to rb.
i don't understand why the program
On Friday, 7 August 2015 at 07:43:25 UTC, Daniel Kozák wrote:
i don't understand why the program crashes when i do not do
the .dup
This is weird. I would say it should not crash
exactely. but try it yourself.
the fastest version i could come up so far is below.
std.conv slows it down.
going
On Friday, 7 August 2015 at 07:48:25 UTC, yawniek wrote:
On Friday, 7 August 2015 at 07:43:25 UTC, Daniel Kozák wrote:
the fastest version i could come up so far is below.
std.conv slows it down.
going from a 4kb to a 4mb buffer helped. now i'm within 30% of
gzcat's performance.
ok maybe not,
On Friday, 7 August 2015 at 08:05:01 UTC, Daniel Kozák wrote:
import
std.zlib,
std.file,
std.stdio,
std.conv;
void main(string[] args)
{
auto f = File(args[1], rb);
auto uncompressor = new UnCompress(HeaderFormat.gzip);
foreach (buffer; f.byChunk(4096))
{
auto
On Friday, 7 August 2015 at 08:24:11 UTC, Daniel Kozák wrote:
can you try it with ldc?
ldc[2] -O -release -boundscheck=off -singleobj app.d
ldc 0.15.2 beta2
2.86s user 0.55s system 77% cpu 4.392 total
v2.068-devel-8f81ffc
2.86s user 0.67s system 78% cpu 4.476 total
v2.067
2.88s user
On Friday, 7 August 2015 at 11:45:00 UTC, Daniel Kozak wrote:
On Friday, 7 August 2015 at 09:12:32 UTC, yawniek wrote:
[...]
Can you try it without write operation (comment out all write)?
And than try it without uncompression?
// without compression:
void main(string[] args)
{
auto f
i'm trying to have my own versions of my dependencies as git
submodules.
problem:
i include a local version of vibe.d and then i add other local
versions of
packages that themselves include vibe.d
somehow my version of vibe isn't picked up by the other
dependencies and it results in an
On Friday, 14 August 2015 at 08:09:18 UTC, Edwin van Leeuwen
wrote:
On Friday, 14 August 2015 at 08:06:15 UTC, yawniek wrote:
dub add-local allows you to add local copy of a package. This
will be system wide though, not only for the current package.
i actually tried this, somehow did't work
is there a reason the trace log is a bit weirdly formatted?
a) different tables within one file
b) column separation is something like (fill with space until it
exceeds 7 digits
could this be improved to use a standard format (e.g. tsv) or are
there some legacy reasons?
also it would be
i tried to automagically create bindings for librdkafka
(https://github.com/edenhill/librdkafka)
with dstep.
now the code contains typedefs structs with the same name as
methods:
```
typedef struct rd_kafka_metadata {
int broker_cnt; /* Number of brokers in
'brokers' */
On Tuesday, 21 July 2015 at 06:12:53 UTC, Jacob Carlborg wrote:
what the correct way to bind these?
Please report an issue for this. In this case
rd_kafka_metadata_t should be used for the struct name.
done, https://github.com/jacob-carlborg/dstep/issues/40
i was under the impression that
whats the proper way to use/wrap C functions that expect a error
string buffer
e.g.:
somefun(T param1, char* errstr, size_t errstr_size)
in D ?
hi,
i'm reading in a stream of data that is deserialized into
individual frames.
a frame is either of:
a) a specific D datastructure ( struct with a few
ulong,string,string[string] etc members), known at compile time
b) json (preferably stdx.data.json)
i now want to implement something
many thanks for the valuable insights.
so far i made a simple prototype with LuaD and classes, works
nicely for when my niput
what so far is not 100% clear is if there is a way to have a
parsed
msgpack or json documents being exposed in my lua code in a way
so it behaves
like a lua object.
can someone explain a bit how the @before hooks works in detail,
i mainly have problems understanding why ensureAuth in belows
example refers to
SampleService. as an instance:
On Saturday, 3 October 2015 at 03:11:06 UTC, holo wrote:
Hello
I'm trying to contact AWS API with D according to documentation:
[...]
check https://github.com/yannick/vibe-aws
it has v4 implemented
On Friday, 18 September 2015 at 09:42:05 UTC, smadus wrote:
Ok i have rewrite :)
Now:
http://dpaste.dzfl.pl/cf8bb54b1390
The Problem is:
http://www.directupload.net/file/d/4114/9zryku49_png.htm
but i dont understand this, because, the exception should be
"Something wrong" ?!?
But, thanks
my C library works a lot with strings defined in C as:
struct vec_t {
char *base;
size_t len;
}
is there a easy way to feed regular D strings to functions that
accept vec_t*
without creating a vec_t every time
or do i write wrappers for these functions and if so, what is the
most
On Friday, 27 May 2016 at 16:47:19 UTC, Daniel Kozak wrote:
Why not to use distribute oprion?
Dne 27. 5. 2016 17:35 napsal uživatel "yawniek via
Digitalmars-d-learn" <
digitalmars-d-learn@puremagic.com>:
it its a flawed strategy.
what you should do is let the kernel handl
On Saturday, 11 June 2016 at 10:26:17 UTC, Mike Parker wrote:
On Saturday, 11 June 2016 at 09:32:54 UTC, yawniek wrote:
thanks mike for the in depth answer.
i forgot to add a few important points:
- the strings in vec_t are not c strings
- vec_t might contain other data than strings
the
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
On Thursday, 16 June 2016 at 19:04:38 UTC, bachmeier wrote:
On Thursday, 16 June 2016 at 12:23:09 UTC, fbmac wrote:
How people use it on Linux, if htod is required to import C
libraries and windows only?f
Just to clarify, so as to prevent confusion by someone that
randomly stumbles across
On Wednesday, 27 January 2016 at 23:42:54 UTC, brian wrote:
Anyone able to shed some light on what the structure of the
response is, and how I can read/output it all?
Regards
Brian
its unlikely that vibe client misses something.
for debugging i would try to go trough all requests with curl
On Saturday, 20 February 2016 at 13:09:53 UTC, Andrew Edwards
wrote:
I'm searching for client drivers for the following databases.
Are the any available?
https://rethinkdb.com/docs/install-drivers/
http://docs.basho.com/riak/latest/dev/references/client-implementation/
Thanks,
Andrew
none
i figured i can count the number of bits set for a BitArray with
std.algorithm : count:
BitArray([0,0,1]).bitsSet.count()
but this seems not very optimal, is there a faster way directly
accessible trough phobos?
ideally something that is optimized by the compiler.
On Thursday, 7 April 2016 at 08:03:34 UTC, Edwin van Leeuwen
wrote:
You can try this library:
https://code.dlang.org/packages/dateparser
nope this will not work and the question is broader:
i want to have a standard datatype parsed in a specific way and
so that i can
use other std library
On Thursday, 7 April 2016 at 13:40:17 UTC, Rene Zwanenburg wrote:
On Thursday, 7 April 2016 at 13:25:29 UTC, Jerry wrote:
I generated a visuald project and tried that. Now suddenly it
is working as expected. So I guess it's a bug in dub.
That's possible of course, but I'd expect something so
On Thursday, 7 April 2016 at 18:29:19 UTC, Jonathan M Davis wrote:
On Thursday, April 07, 2016 07:45:06 yawniek via
Digitalmars-d-learn wrote:
So, while I understand your frustration, I just don't see any
other sane way to approach this problem than what you've done.
Putting it all
what is the way one is supposed to parse e.g. a
double of unixtime (as delived by nginx logs) into a SysTime?
currently i'm creating a wrapper struct around SysTime with alias
this as:
https://gist.github.com/yannick/6caf5a5184beea0c24f35d9d4a4c7783
really ugly imho.
is there a better way
On Tuesday, 1 March 2016 at 09:32:20 UTC, Andrea Fontana wrote:
Maybe you should look for "hamming weight" :)
maybe. and here is a snowman for you: ☃
the question was if it exists for BitArray in phobos.
https://issues.dlang.org/show_bug.cgi?id=10239 so apparently its
really missing in
On Wednesday, 27 April 2016 at 13:00:29 UTC, RuZzz wrote:
Code:
import std.concurrency;
import core.thread;
//import vibe.http.client; // If uncommented this
line, the thread "worker" does not start
void worker() {
foreach (i; 0 .. 5) {
On Tuesday, 10 May 2016 at 13:34:36 UTC, chmike wrote:
vibed uses libevent, a C library.
The discussion is regarding a possible pure D equivalent of
libevent.
libasync is an interesting proposal but it is apparently slower
than libevent. I don't know the current status because vibed
improved
On Friday, 22 July 2016 at 12:36:31 UTC, Alexander Milushev wrote:
I there any json serialization library which allow to make
decision about ignoring fields in runtime? I trying to write
rest client but server accept either 'cmd' or 'args' field for
example and I need to find solution.
can
On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote:
What I'm looking for is the opposite of the "FromUnixTime"
function.
i often use
long toNsUnixTime(SysTime t)
{
return (t.stdTime - 621_355_968_000_000_000L)*100;
}
as a helper. any chance that something like this can be put
On Thursday, 5 January 2012 at 22:15:32 UTC, asm wrote:
how can i implementing the singleton pattern in D?
https://p0nce.github.io/d-idioms/#Leveraging-TLS-for-a-fast-thread-safe-singleton
imo things should be modularized.
so there should be (fast) protocol parsers first, something like
https://github.com/h2o/picohttpparser or
https://github.com/seanmonstar/httparse
then a very simple eventloop that has abstractions and range
based interfaces for reading/writing data into
58 matches
Mail list logo