On Tuesday, 3 July 2018 at 14:39:34 UTC, ag0aep6g wrote:
Looks like forum.dlang.org has a problem when they appear side
by-side.
Works (in the preview): 👩👩👦👦 🏳️🌈
Doesn't work: 👩👩👦👦🏳️🌈
For me, it looks as the used font has ligatures for these faces.
Mozilla under Linux, I guess it's
On Sunday, 1 July 2018 at 13:44:23 UTC, Anton Fediushin wrote:
I reduced the test case to _one_ line:
```
1.seconds.setTimer(() => "http://google.com".requestHTTP((scope
req) {}, (scope res) {res.disconnect;}), true);
```
What happens is `res.disconnect` doesn't free all of the
internal buff
On Saturday, 16 June 2018 at 09:00:21 UTC, Jacob Shtokolov wrote:
On Saturday, 16 June 2018 at 01:24:04 UTC, crimaniak wrote:
Hi all!
The first try to host application on Heroku provider. The
application is started and starts to listen in 3 seconds on
the port, provided by heroku-buildpack-d.
Hi all!
The first try to host application on Heroku provider. The
application is started and starts to listen in 3 seconds on the
port, provided by heroku-buildpack-d. But the server doesn't
detect listening and stops the application. On the local machine,
the application works as expected. W
On Saturday, 9 June 2018 at 15:11:02 UTC, Computermatronic wrote:
I'd like to create a bunch of tasks in vibe.d, then wait for
them all to complete.
Using std.concurrency and std.parallelism this is trivial.
I could just spawn a bunch of vibe.d tasks and then iteratively
join them, but I woul
On Saturday, 2 June 2018 at 19:48:36 UTC, Matthias Klumpp wrote:
@crimaniak: If you really want to build with all compilers,
there is a workaround for this issue that does not involve you
supporting ancient D versions, and that is to actually use
Debian's GDC on Travis. I use this excessiv
I started to work with Travis-CI, building packages using all
three main compilers, and noticed that I have problems with gdc
every time and need to tweak code because of many things missing.
For example:
https://travis-ci.org/crimaniak/json-patch/jobs/386963340
Why this situation with gdc and
On Thursday, 24 May 2018 at 20:24:32 UTC, IntegratedDimensions
wrote:
I'm pretty much guaranteed that in C, t will be type TT due to
the design(C goes with TT like bread with butter).
...
1) Your architecture is wrong, I recommend to rethink it.
2) You still can deal with it using template mixin
On Saturday, 31 March 2018 at 16:08:36 UTC, lempiji wrote:
---
import rx;
auto firstWord = new BehaviorSubject!string("Change");
auto secondWord = new BehaviorSubject!string("me!");
auto bothWords = new BehaviorSubject!string("");
combineLatest!((a, b) => a ~ " " ~ b)(firstWord,
seco
I want to have reactive variables like in this example:
```
USING_REACTIVE_DOMAIN(D)
// The two words
VarSignalT firstWord = MakeVar(string( "Change" ));
VarSignalT secondWord = MakeVar(string( "me!" ));
// ...
SignalT bothWords = firstWord + string( " " ) +
secondWord;
```
from this page:
On Saturday, 10 March 2018 at 20:48:06 UTC, Nordlöw wrote:
If I have a function
bool f(Rs...)(Rs rs)
is it somehow possible to map and forward all its arguments
`rs` to another function
bool g(Rs...)(Rs rs);
docs:
https://dlang.org/phobos/std_traits.html#.Parameters
usage example:
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
then copy it to sources folder?
...
Also, symlinks are power tool for organizing your files without
copying.
On Tuesday, 16 January 2018 at 08:54:58 UTC, Sönke Ludwig wrote:
...
The problem is with the `immutable struct StopEvent {}`
Thanks!
...
So, removing the `immutable` from the declaration solved the
issue for me, but if possible I'd rather remove the
`cast(shared Unqual!EventType)` from `emit
Hi!
I make multi-task event bus, but there is a problem with the task
stops.
Please see end of file
https://github.com/crimaniak/d-vision/blob/master/src/vision/eventbus.d
Expected behavior: After sending the StopEvent message in line
244 it is must be detected in listeners (line 147), so all
On Friday, 22 December 2017 at 10:18:52 UTC, ketmar wrote:
crimaniak wrote:
Both operands are the same type, so as I understand casting to
longest type is not needed at all, and longest type here is
ushort in any case. What am I doing wrong?
it is hidden in specs: all types shorter than int
My code:
alias MemSize = ushort;
struct MemRegion
{
MemSize start;
MemSize length;
@property MemSize end() const { return start+length; }
}
Error: cannot implicitly convert expression `cast(int)this.start
+ cast(int)this.length` of type `int` to `ushort`
Both operands
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote:
How does one keep their fork up to date? For example, if I fork
https://help.github.com/articles/syncing-a-fork/
On Wednesday, 29 November 2017 at 11:32:51 UTC, Jayam wrote:
In D lang,
1. Is there any feature async/ await like "c#" ? I can't find
feature like async.
As for me, async/await feature is a half-baked solution. With
vibe-d you can write asynchronous code without thinking about it
at all. Detai
First problem: it doesn't understand enums, it seems to be a bug:
```
enum TopicMask : string
{
divider = "/",
oneLevelMask = "+",
multiLevelMask = "#",
system = "$",
level = "[^"~divider~oneLevelMask~multiLevelMask~"]*",
publishMask = "^("~divider~
On Saturday, 25 November 2017 at 15:34:21 UTC, John Chapman wrote:
Is there any way of determining whether a variable has been
initialized or not? For example, if something is declared like
this:
int x = void;
can I check if it's void before I use it, say, in a function
it's been passed to
Hi!
I need to send Publish struct from
https://github.com/tchaloupka/vibe-mqtt to another vibe.d task.
And there is the problem. First of all, I can't make it immutable
because send() wants to mutate it. I can't send local copy
because of "Aliases to mutable thread-local data not allowed.".
On Friday, 10 November 2017 at 14:36:03 UTC, DrCataclysm wrote:
It is working now. The problem was that the debugger in eclipse
ddt seems to completely broken. If i run it directly from bash
it is working.
Be careful with such statements. Typically, this situation means
that there are Heisen
On Friday, 3 November 2017 at 12:42:29 UTC, ANtlord wrote:
Hello! I can't get how to use double linked list in
concurrency. Please help.
...
I get a compile error onlineapp.d(8): Error: template
std.container.dlist.DList!string.DList.insertFront cannot
deduce function from argument types !()(s
On Tuesday, 17 October 2017 at 04:01:54 UTC, Fat_Umpalumpa wrote:
Do you by any chance know anything that replaced std.xml?
Everything I look up on it suggests not to use it.
Is this really a problem? In this case, I can help: I recommend
to use it. And only if you really will have performanc
On Tuesday, 5 September 2017 at 13:51:40 UTC, Sönke Ludwig wrote:
The error is most likely caused by issuing two requests to the
MySQL server from two different tasks on the same connection.
Usually, mysql-native uses a connection pool to avoid this, but
that could have been circumvented by ac
On Monday, 4 September 2017 at 09:22:25 UTC, Vino.B wrote:
Thank you very much, i have used your idea and was able to
resolve, and i need one more favor. the below code outputs the
value but i need the name of the variable + value as below.
Output :
1
2
["C:\\Temp\\TEAM1\\BACKUP", "C:\\Temp\
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta
wrote:
interface I
{
void Go(T)(S!T s);
static final I New()
{
return new C();
}
}
abstract class A : I
{
}
class C : A
{
void Go(T)(S!T s)
{
On Monday, 4 September 2017 at 07:27:12 UTC, Vino.B wrote:
Hi,
Can you help me in how to return multiple values from a
function, the below code is throwing an error as below
import std.stdio: writeln;
import std.typecons: tuple, Tuple;
Tuple!(int, string[]) Params () {
return tuple(1, [
On Monday, 21 August 2017 at 02:17:57 UTC, crimaniak wrote:
...
shared A a;
...
Sorry, accidental delete, read this as shared A a = new
shared(A);
On Monday, 14 August 2017 at 03:59:48 UTC, Jonathan M Davis wrote:
And no, this isn't ideal, but the only semi-decent solution
that's been proposed that safely casts away shared for you is
synchronized classes, which Andrei describes in TDPL but have
never been implemented.
After reading this
On Thursday, 17 August 2017 at 13:09:29 UTC, Kagamin wrote:
On Wednesday, 16 August 2017 at 23:15:10 UTC, crimaniak wrote:
I wonder if it possible and usable to make some template to
support this pattern, where we give mutex(es), shared
object(s) and delegate to operate with objects as non-shar
On Monday, 14 August 2017 at 03:59:48 UTC, Jonathan M Davis wrote:
The way to handle shared is to protect the section of code
that's using the shared object with either a mutex or
synchronized block, and then you cast away shared from the
object within that section and operate on it as thread-
On Sunday, 13 August 2017 at 11:35:05 UTC, Arek wrote:
Yeah, I've read this. But conurrency.send cannot pass immutable
object. The same story with Unique.
Sorry, read this as 'efficient immutable'.
More over, "shared" looks rather like unfinished concept.
Yes, exactly.
Anyway, _gshared loo
On Saturday, 12 August 2017 at 18:57:44 UTC, Arek wrote:
I have the folowing problem:
I like to envelope the class object in struct to control the
destruction moment and then send this object to another
thread/fiber (or task, cause I use vibe-d).
I can't find any method to make it working. An
On Saturday, 15 July 2017 at 18:14:13 UTC, Joakim wrote:
core.exception.InvalidMemoryOperationError@src/core/exception.d(696): Invalid
memory operation
...
See the wiki page about this:
https://wiki.dlang.org/InvalidMemoryOperationError
If you can't do all that, look for places you might be
On Thursday, 13 July 2017 at 22:36:47 UTC, Basile B. wrote:
return cast(char[])`
...
Never cast a literal to char[]. modifying the resulting char[]
will lead to AV, at least under linux. `.dup` the literal if
you really needs char[].
Hmm, yes, my bad. Probably, it was necessary even f
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito
bem...
https://pastebin.com/2xw9geRR
alguem poderia me ajudar?
Se acepta utilizar intervalos en lu
On Wednesday, 12 July 2017 at 13:47:06 UTC, Adam D. Ruppe wrote:
This tells me the problem is in the collection order at the end
of the program.
...
So I'd say the answer is prolly to keep HTTP away from the GC.
Manually free its arrays, or keep them outside arrays in the
first place.
I'd
On Tuesday, 11 July 2017 at 22:46:00 UTC, Steven Schveighoffer
wrote:
On 7/5/17 12:04 PM, crimaniak wrote:
...
Because of the temporary copy likely inside map closes the
connection.
See the bug I reported:
https://github.com/mysql-d/mysql-native/issues/117
Yes, it seems to be the same issue
Hi!
I have vibe.d application and long-standing error in it.
For the current moment, I have logs for stdout, stderr, and
additional log to write exceptions I catch. This error gives me
only the short line in stderr log:
core.exception.InvalidMemoryOperationError@src/core/exception.d(696): Inv
Hi all!
After some hard time with debugging, I found ResultRange returned
by query() and Prepared::query() of mysql-native package can't be
combined with map() because after map() it becomes empty
resultset.
Code (conn.queryRows just a wrapper for query(Connections, sql) ):
immutabl
On Sunday, 2 July 2017 at 01:06:29 UTC, Ali Çehreli wrote:
On 07/01/2017 04:56 PM, crimaniak wrote:
> about very long error messages generated in some
> cases.
Please submit a bug report. The compiler may be able to
abbreviate certain types. For example, in this case most of the
error message
On Saturday, 1 July 2017 at 22:46:06 UTC, Adam D. Ruppe wrote:
On Saturday, 1 July 2017 at 22:44:33 UTC, crimaniak wrote:
enum moduleMask = ctRegex!`module\s+([^;]+)`;
That should be `static`, not `enum`. I betcha that will at
least change the error.
Works both variants, and reason
Just for fun (may be):
code:
auto findModule = execute(["dscanner", "--etags", entry.name]);
enum moduleMask = ctRegex!`module\s+([^;]+)`;
Captures c = findModule.output.matchFirst!(moduleMask);
result (even C++ guys will be impressed):
phobos_imports.d(43): Error: stru
On Friday, 30 June 2017 at 16:18:33 UTC, tetyys wrote:
On Friday, 30 June 2017 at 00:52:28 UTC, crimaniak wrote:
Hi!
Moving my project from mysql-lited to mysql-native I faced the
problem with null pointer error inside of mysql-native:
seems like it's already fixed
https://github.com/mysql
Hi!
Moving my project from mysql-lited to mysql-native I faced the
problem with null pointer error inside of mysql-native:
Log:
SELECT id FROM versionupdate ORDER BY id
Task terminated with unhandled exception:
etc.linux.memoryerror.NullPointerError@src/etc/linux/memoryerror.d(325)
I tried to run an example from the site. Example from
https://dlang.org/phobos/std_regex.html#replaceAllInto section.
And this is problem number 0: I can't give a link to the example,
only to section. The section can be long, there can be more than
one example, so it's good to have an anchor fo
On Friday, 19 May 2017 at 12:55:05 UTC, Biotronic wrote:
revComp6 seems to be the fastest, but it's probably also the
least readable (a common trade-off).
Try revComp7 with -release :)
string revComp7(string bps)
{
char[] result = new char[bps.length];
auto p1 = result.ptr;
auto p2
On Sunday, 14 May 2017 at 19:00:09 UTC, Suliman wrote:
I am trying to learn how to write text parser. I have example
doc with follow format:
#Header
my header text
##SubHeader
my sub header text
it's there any better way to parse such format?
Ready markdown Pegged based parser:
https://g
On Wednesday, 10 May 2017 at 12:40:41 UTC, k-five wrote:
I have a line of code that uses "to" function in std.conv for a
purpose like:
int index = to!int( user_apply[ 4 ] ); // string to int
When the user_apply[ 4 ] has value, there is no problem; but
when it is empty: ""
it throws an ConvExc
On Wednesday, 3 May 2017 at 17:43:07 UTC, kinke wrote:
can anyone recommend a more or less production-ready dev
environment for vibe.d on Linux?
I'm evaluating vibe.d against Phoenix (Elixir/Erlang) for a new
project. Today I gave Visual Studio Code a quick shot (with LDC
1.1.1 and DMD 2.071/7
On Tuesday, 18 April 2017 at 11:43:24 UTC, Suliman wrote:
I am writing app that extract data from DB to array of
structures.
void getSingleTrackInfo()
{
foreach(item; getTablesGPSSensorList)
{
ResultRange r
Hi, all!
Yes, I know, most simple way to validate URL is regex and it
works for most cases, but I search for a correct solution
(ideally rfc3986-compatible), which will be hard to implement
using regular expressions.
On Saturday, 25 March 2017 at 16:08:49 UTC, NotSpooky wrote:
__gshared implies static,...
Thanks! Confusing for me moment.
Simple File test:
void main()
{
import std.stdio;
File f = File("test.txt", "w");
f.writeln("hello");
}
All works as expected.
Now let's add __gshared:
void main()
{
import std.stdio;
__gshared File f = File("test.txt", "w");
On Wednesday, 22 March 2017 at 20:35:27 UTC, StarGrazer wrote:
I've tried compiles but I guess that only checks if the code
has valid syntax, not if it actually will compile in context.
https://dlang.org/spec/traits.html#hasMember
On Sunday, 5 March 2017 at 13:41:23 UTC, Suliman wrote:
I had seen some mentions about `vibe.conf` file in vibed docs.
But can't understand it's structure and find examples of it's
usage.
Json file. Real example:
```
{
"mqttHost" : "***.***.**.***",
"mqttPort" : 188
Hi all!
I make vibe-d based project and now I have problem passing
messages between threads.
First some words about architecture. Each event in the system has
a corresponding class that validates and performs the required
actions. Each class has a nested structure with the parameters
that are
On Sunday, 26 February 2017 at 21:50:38 UTC, Jordan Wilson wrote:
.map!(a => a.to!double)
If lambda just calls another function you can pass it directly:
== .map!(to!double)
On Thursday, 16 February 2017 at 09:18:16 UTC, aberba wrote:
On linux it is pretty easy. Just compile with `-g` to dmd and
run the program in gdb. Run till it crashes and it should tell
you the file and line of where.
Thanks, will try and see.
Also don't forget to do this:
http://vibed.org/d
On Friday, 3 February 2017 at 06:46:37 UTC, Suliman wrote:
If I open it's from VPS (as localhost:8080) it's work same as
from Internet (no do not open at all).
If problem is reproducible on localhost - very good, just debug
it. If you have memory leak and can't figure out source, try
valgrind
Ok, I found it: https://issues.dlang.org/show_bug.cgi?id=16044
On Saturday, 7 January 2017 at 12:29:34 UTC, ketmar wrote:
On Saturday, 7 January 2017 at 12:11:20 UTC, crimaniak wrote:
Is this a bug or documentation problem?
well, it's hard to say. package.d is one of the cases where you
*have* to provide explicit module definition. ;-) 'cause
implicit o
On Saturday, 7 January 2017 at 10:38:29 UTC, ketmar wrote:
On Saturday, 7 January 2017 at 10:27:51 UTC, Nicholas Wilson
wrote:
Do you require a module statement per chance?
it doesn't matter. if there is no explicit module declaration,
compiler will insert implicit one. from the code PoV, the
Hi!
I need to iterate module members and find specific classes (and
make tuple).
class foo{};
pragma (msg, __traits(allMembers,mixin(__MODULE__)));
gives me empty tuple. I found also this thread from 2011:
http://forum.dlang.org/post/mailman.325.1293887146.4748.digitalmars-d-le...@pu
On Monday, 2 January 2017 at 15:29:08 UTC, Geert wrote:
Hi!
How can i create a full database backup using mysql-native for
D?
Too common question. Do you have problems with driver usage? Do
you have problems with database backup schema?
On Tuesday, 27 December 2016 at 02:05:27 UTC, Ali Çehreli wrote:
On 12/26/2016 02:04 PM, crimaniak wrote:
So my main question: how it is possible to do such thing?
Just to make sure we're on the same page: :)
* There is 'interface' in addition to 'class'
Yes. I want it for structs exactly.
On Monday, 26 December 2016 at 21:15:03 UTC, Adam D. Ruppe wrote:
On Monday, 26 December 2016 at 20:07:56 UTC, crimaniak wrote:
// I want to see Foo here and use it's reflection to
iterate fields and methods.
then pass foo to it
What do you mean parent symbol? I assumed you mean
```
class uda
{
this()
{
// I want to see Foo here and use it's reflection to
iterate fields and methods.
}
}
@uda
struct Foo
{
}
```
Is there a way to do it?
On Thursday, 1 December 2016 at 23:51:19 UTC, Payotz wrote:
So, to give context, I am trying to make an event manager for a
game I'm making.
I was writing the "register()" method so I ran into a problem.
The register method will take in delegates as an argument, but
those delegates have varied
Hi All!
I will try to illustrate by code what exactly I have in mind:
// we have not shared class/struct with some interface.
class FooController
{
...
int foo1(int a, string b);
string foo2(Struct1 c);
...
}
// now we want to make a running task with an instance inside
auto controller
On Tuesday, 20 September 2016 at 13:35:27 UTC, Steven
Schveighoffer wrote:
Yes, but if your code does instantiate it, it is called, even
if you don't ever call the function that calls it.
Yes, it's not ideal but better then just global variable and
static block - it's called in any case, even if
On Tuesday, 20 September 2016 at 09:14:39 UTC, Marc Schütz wrote:
Have a look at `std.concurrency.initOnce`:
https://dlang.org/phobos/std_concurrency.html#.initOnce
But you will still need to use assumePure() for calling
`thisExePath`, and it might do other things that are impure...
Yes, it's
On Tuesday, 20 September 2016 at 04:26:05 UTC, Jonathan M Davis
wrote:
On Tuesday, September 20, 2016 04:17:21 crimaniak via
Digitalmars-d-learn wrote:
static shared immutable ReturnType!T value;
I would point out that immutable is implicitly shared, so
there's no reason t
Hi and thanks all!
On Tuesday, 20 September 2016 at 00:43:10 UTC, Jonathan M Davis
wrote:
immutable string executablePath;
shared static this()
{
import std.file : thisExePath();
executablePath = thisExePath();
}
This code is good for my needs but I start to think about how to
cal
Hi!
Is there situations when output of thisExePath() can be different
during runtime? If yes, what the reason?
If no, is this possible to mark it as pure in phobos?
https://dlang.org/library/std/file/this_exe_path.html
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
versio
On Saturday, 18 June 2016 at 16:46:26 UTC, Mark wrote:
I've spent may hours trying to do this in OSX. Everything goes
fine from the marketplace window...until I restart Eclipse and
find no files have been added?
Any words of consolation or advice will be greatly appreciated.
I have Eclipse
On Tuesday, 8 March 2016 at 11:50:32 UTC, Peter wrote:
Hi,
Can anyone explain to me what's causing the following code to
generate a missing symbol error...
Relevant comment: https://issues.dlang.org/show_bug.cgi?id=8553#c1
On Thursday, 11 February 2016 at 07:41:55 UTC, Enjoys Math wrote:
If I just type out sqrt(2.0) in D, is that automatically made
into a constant for me?
Thanks.
for DMD -O :
import std.math;
immutable foo = sqrt(2.0);
pure float precalculated()
{
return foo;
}
pure float not_precalcula
Hi!
I need to read bad-formed json files in type-tolerant mode, and
my idea is to make JSONValue-specific 'to' method which will
convert it to target type if applicable, else throw exception.
Like this:
import std.json;
unittest
{
JSONValue s="123";
JSONValue i=123;
JSONValue f=
On Tuesday, 15 December 2015 at 00:16:41 UTC, Jakob Ovrum wrote:
Is there a way to do balanced match with std.regex?
It's only possible with (?R) implemented:
http://php.net/manual/en/regexp.reference.recursive.php
But there is no (?R) in D regex implementation.
On Saturday, 7 November 2015 at 06:02:49 UTC, BBaz wrote:
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
[...]
url.Cache.UrlCache.doRequest has no return statement, but is
expected to return a value of type string
[...]
public string doRealRequest(string url, Method met
On Saturday, 7 November 2015 at 00:27:02 UTC, Adam D. Ruppe wrote:
On Saturday, 7 November 2015 at 00:21:57 UTC, crimaniak wrote:
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
Try inserting assert(0); instead of a dummy return.
Done, no diff
Hi!
I have the error message:
source/url.cache.d(20,16): Error: function
url.Cache.UrlCache.doRequest has no return statement, but is
expected to return a value of type string
Inserting dummy return statement doesn't help. final switch /
switch with default - no matter.
As I understand com
On Sunday, 20 September 2015 at 20:17:37 UTC, Dandyvica wrote:
My file is made of 10 lines:
cat numbers.txt
1
2
3
4
5
6
7
8
9
10
╰─$ wc -l numbers.txt
CR/LF can be interpreted as line _dividers_, so if you have CR or
CR/LF at the end of line 10, really here is line 11 which is
empty. Remove
86 matches
Mail list logo