I've been trying to solve the exercise of the caesar encryption
for practicing with arrays with no luck. I'm new to D
Thanks for your help. :D
On Thursday, 9 June 2016 at 20:53:38 UTC, tcak wrote:
(cast()mx).lock();
I was told casting away shared when there are still references to
it is a bad idea. Like, the Mutex object might get corrupted if
the garbage collector tries to move it while another thread is
using it.
So th
On Thursday, 9 June 2016 at 22:19:33 UTC, Stretto wrote:
I have some class like
class bar { }
class foo : bar
{
bar[] stuff;
}
and have another class
class dong : bar
{
int x;
}
Now sometimes stuff will contain dong's, but I cannot access
its members it without a cast.
fooo.stuff[0
Ultimately what I want to do is access a member
foo.Dongs[i];
Where Dongs is essentially a "view" in to the Bars array and only
accesses types of type Dong.
It seems one can't do both an override on a name("Dongs") and an
index on the overridden name(`[i]`)?
It is not appropriate to use fo
I have some class like
class bar { }
class foo : bar
{
bar[] stuff;
}
and have another class
class dong : bar
{
int x;
}
Now sometimes stuff will contain dong's, but I cannot access its
members it without a cast.
fooo.stuff[0].x // invalid because bar doesn't contain x;
Hence,
((c
On Tuesday, 7 June 2016 at 22:09:58 UTC, Alex Parrill wrote:
On Monday, 6 June 2016 at 21:57:20 UTC, Pie? wrote:
On Monday, 6 June 2016 at 21:31:32 UTC, Alex Parrill wrote:
[...]
Not necessarily, You chased that rabbit quite far! The data
your reading could contain sensitive information only
is it supposed to work?
normally it works e.g.
assert(0, "some\nstring");
prints:
some
string
but if you do it inside a template constraint like this:
void someTemp(T)(T t) if(isCallable!T.call!((b){assert(b,
"some\nstring");}))
{
}
it prints:
some\x0astring
On 6/9/16 2:31 PM, cy wrote:
Is core.sync.mutex.Mutex even usable in D anymore? It seems every mutex
that wasn't shared would be part of thread local data, so two threads
locking on the same mutex would actually be locking separate mutexes.
Yes, but this is because Mutex existed way before sha
On Thursday, 9 June 2016 at 18:31:16 UTC, cy wrote:
I was thinking of using threads in a D program (ignores
unearthly wailing) and I need 1 thread for each unique string
resource (database connection info). So I did this:
shared BackgroundDB[string] back;
I don't see any way to make less data
On Tuesday, 7 June 2016 at 22:09:58 UTC, Alex Parrill wrote:
Accessing a SQL server at compile time seems like a huge abuse
of CTFE (and I'm pretty sure it's impossible at the moment).
Why do I need to install and set up a MySQL database in order
to build your software?
Presumably you would
The other way is better, but since you asked...
On Wednesday, 8 June 2016 at 01:42:55 UTC, Carl Vogel wrote:
Now, I can use something like isCallable std.traits to make
sure the predicate is a Callable, and there are various
function traits in the module that I could combine with `is`
clauses
I can't help but notice that loadModel is not a static member
function, yet you don't seem to call it with a Model object in
your "get" function.
Also have a look at std.typecons.RefCounted if you want reference
counted data..
On Thursday, 9 June 2016 at 16:13:21 UTC, Jonathan Marler wrote:
I don't see that documentation anywhere on that page.
https://issues.dlang.org/show_bug.cgi?id=16148
I was thinking of using threads in a D program (ignores unearthly
wailing) and I need 1 thread for each unique string resource
(database connection info). So I did this:
shared BackgroundDB[string] back;
I don't see any way to make less data shared there. If it weren't
shared, it would be thr
On Thursday, 9 June 2016 at 11:45:01 UTC, Andrew Edwards wrote:
On 6/9/16 2:15 PM, Jonathan Marler wrote:
On Thursday, 9 June 2016 at 05:07:33 UTC, Nikolay wrote:
On Thursday, 9 June 2016 at 04:57:30 UTC, Jonathan Marler
wrote:
I've googled and searched through the forums but haven't
found too
On 06/09/16 07:20, cy via Digitalmars-d-learn wrote:
> Like this is why it doesn't really make sense:
>
> import std.stdio;
>
> auto foo(Callable)(Callable c) {
> return c(42);
> }
>
> auto foo2(alias c)() {
> return c(42);
> }
>
> void main() {
> // this works, when you know it's an int
On 6/9/16 2:15 PM, Jonathan Marler wrote:
On Thursday, 9 June 2016 at 05:07:33 UTC, Nikolay wrote:
On Thursday, 9 June 2016 at 04:57:30 UTC, Jonathan Marler wrote:
I've googled and searched through the forums but haven't found too
much on how fibers are implemented. How does yield return execu
On Monday, 2 February 2015 at 21:04:11 UTC, Nordlöw wrote:
Made it PR at
https://github.com/D-Programming-Language/dmd/pull/4371
Synched with DMD D conversion and improved isInputRange and
message at:
https://github.com/dlang/dmd/pull/4371
I have a really weird bug in my application, i succeeded in
making a small program with the bare munimum to show that bug.
The full source code of the application + a dub.json file are at
https://github.com/Begah/D_Pointer_Problem ( < 300 LOC )
I have a template called ResourceManager (asset.
This is awesome! I added it to my D cookbook.
Thank you very much.
20 matches
Mail list logo