On Sunday, 24 September 2017 at 15:51:01 UTC, dark777 wrote:
On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote:
On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote:
I have the following code:
https://pastebin.com/PWuaXJNp
but typing my name does not go to the next line as
On Sunday, 24 September 2017 at 17:11:26 UTC, Haridas wrote:
In the following code, Bar is an element of struct Foo. Is
there a way to avoid a call to ~Bar when ~Foo is getting
executed?
Don't construct it to begin with.
struct Bar {
import std.stdio : writeln;
int a = 123;
http://asm.dlang.org/ does not have DMD 2.072, 2.073, 2.074,
2.075, nor 2.076.
Thanks for updating the site.
Cheers,
Johan
In the following code, Bar is an element of struct Foo. Is there
a way to avoid a call to ~Bar when ~Foo is getting executed?
// >>
import std.stdio;
struct Foo {
Bar bar;
~this() {
writeln("~Foo");
// some code that disables call to ~Bar
}
}
struct Bar {
~this() {
I think readf("%s") reads everything available. readf(" %s\n")
might help but personally, I say avoid readf.
Just use readln and to!int instead
auto line = readln();
if(line.length == 0)
writeln("please enter a number");
age = to!int(line);
to is from import std.conv
On Sunday, 24 September 2017 at 04:24:55 UTC, user1234 wrote:
This is the 100,000th Thread.
https://m.popkey.co/61642c/WxA4D.gif
On Sunday, 24 September 2017 at 17:11:26 UTC, Haridas wrote:
In the following code, Bar is an element of struct Foo. Is
there a way to avoid a call to ~Bar when ~Foo is getting
executed?
No, but you could just set a flag in Bar that the destructor
checks and skips running if it is set.
In
On Sunday, 24 September 2017 at 17:05:11 UTC, Neia Neutuladh
wrote:
On Sunday, 24 September 2017 at 16:13:30 UTC, dark777 wrote:
when you execute and call
Name:
I type my name:
Name: dark777 + [enter]
and he does not jump to the next line to get the age
This is what I want to know how to
On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote:
On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote:
I have the following code:
https://pastebin.com/PWuaXJNp
but typing my name does not go to the next line as soon as I
press enter
how to solve this?
use writeln instead
On Sunday, 24 September 2017 at 16:13:30 UTC, dark777 wrote:
when you execute and call
Name:
I type my name:
Name: dark777 + [enter]
and he does not jump to the next line to get the age
This is what I want to know how to solve.
Add a `writeln();` after reading input, maybe?
On Friday, 22 September 2017 at 09:40:00 UTC, Sönke Ludwig wrote:
What's was the last status? Could you observe any meaningful
thread scaling?
It works for me - multithreading improves performance on my PC.
So far, test results on
https://github.com/nuald/simple-web-benchmark
show that D is
Also consider the following code. Please let me know if I am
doing the right thing for dynamic arrays. My hack seems to have
the desired effect on shutting down the destructor. Is this hack
legal use of D? Can you please guide me if/how it can be achieved
for std.container.Array?
//
On Sunday, 24 September 2017 at 18:00:32 UTC, Adam D. Ruppe wrote:
I think readf("%s") reads everything available. readf(" %s\n")
might help but personally, I say avoid readf.
Just use readln and to!int instead
auto line = readln();
if(line.length == 0)
writeln("please enter a number");
On Sunday, 24 September 2017 at 18:46:15 UTC, Haridas wrote:
Also consider the following code. Please let me know if I am
doing the right thing for dynamic arrays. My hack seems to have
the desired effect on shutting down the destructor. Is this
hack legal use of D? Can you please guide me
On Sunday, 24 September 2017 at 08:08:35 UTC, Petar Kirov
[ZombineDev] wrote:
On Saturday, 23 September 2017 at 22:07:58 UTC, bitwise wrote:
[...]
Can you give a bit more details? What kind of architectures do
you mean (hardware, software, ..)?
What was your use case? IO-multiplexing,
Thanks Adam
Actually Bar's API and implementation is not in my control.
Consider the scenario where it is implemented in a library. Or a
scenario where I have millions of instances of Bar (not
necessarily as a component of Foo) and I do not want to add to
runtime memory footprint.
Ok,
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko
wrote:
Should we add `a * b` to ndslice for 1d vectors?
Discussion at https://github.com/libmir/mir-algorithm/issues/91
Generally I expect that a binary operation denoted by + or *
would produce an element from the original domain,
On Sunday, 24 September 2017 at 21:01:06 UTC, Johan Engelen wrote:
DMD <= 2.074 and DMD >= 2.075 disagree on struct alignment.
```
struct UInt {
align(1):
uint a;
}
struct Bug {
ubyte one;
UInt two;
}
static assert(Bug.two.offsetof == 4); // Error DMD>=2.075, 1 ==
4 is false
DMD <= 2.074 and DMD >= 2.075 disagree on struct alignment.
```
struct UInt {
align(1):
uint a;
}
struct Bug {
ubyte one;
UInt two;
}
static assert(Bug.two.offsetof == 4); // Error DMD>=2.075, 1 == 4
is false
static assert(Bug.sizeof == 8); // Error DMD>=2.075, 5 == 8 is
false
On Monday, 25 September 2017 at 01:46:15 UTC, Haridas wrote:
[...]
It all works well so far. But as soon as I create an instance
of Bar inside a Dlang class (say Foo) or as part of a Dlang
dynamic array, hell follows. At some point, Dlang's GC kicks in
and Bar's destructor gets called from
On Sunday, 24 September 2017 at 21:21:27 UTC, kinke wrote:
On Sunday, 24 September 2017 at 21:01:06 UTC, Johan Engelen
wrote:
So... what's correct? :-)
2.075+. ;)
See https://github.com/dlang/dmd/pull/6754.
Thanks kinke.
(now on to fix LDC's codegen ;-)
On 24 September 2017 at 22:10, Johan Engelen via Digitalmars-d
wrote:
> http://asm.dlang.org/ does not have DMD 2.072, 2.073, 2.074, 2.075, nor
> 2.076.
> Thanks for updating the site.
>
> Cheers,
> Johan
>
I'll have a look at it possibly tomorrow.
Iain.
On Sunday, 24 September 2017 at 21:01:06 UTC, Johan Engelen wrote:
So... what's correct? :-)
2.075+. ;)
See https://github.com/dlang/dmd/pull/6754.
On Sunday, 24 September 2017 at 23:59:59 UTC, jmh530 wrote:
On Sunday, 24 September 2017 at 22:33:48 UTC, H. S. Teoh wrote:
With UFCS, you have the slightly nicer notation a.dot(b) and
a.cross(b).
T
Below is a link to the operators in Matlab and associated
functions. mir can include all
In general, of course, this is a bad idea - there's probably a
reason that destructor does the thing it's doing. If you're
sure skipping it is what you want, go ahead.
@Biotronic, the code you have provided may be exactly what I am
looking for. Let me explain my situation.
I have a library
On Sunday, 24 September 2017 at 18:36:50 UTC, Vadim Lopatin wrote:
On Friday, 22 September 2017 at 09:40:00 UTC, Sönke Ludwig
wrote:
What's was the last status? Could you observe any meaningful
thread scaling?
It works for me - multithreading improves performance on my PC.
So far, test
On Sun, Sep 24, 2017 at 06:18:38PM +, Mark via Digitalmars-d wrote:
> On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko wrote:
> > Should we add `a * b` to ndslice for 1d vectors?
> > Discussion at https://github.com/libmir/mir-algorithm/issues/91
>
> Generally I expect that a
On Sunday, 24 September 2017 at 18:18:38 UTC, Mark wrote:
Generally I expect that a binary operation denoted by + or *
would produce an element from the original domain, e.g.
multiplying two matrices yields a matrix, concatenating two
strings yields a string, etc. So personally I don't like
On Sunday, 24 September 2017 at 22:33:48 UTC, H. S. Teoh wrote:
With UFCS, you have the slightly nicer notation a.dot(b) and
a.cross(b).
T
Below is a link to the operators in Matlab and associated
functions. mir can include all of those functions, but not all of
them can be implemented
On 23 September 2017 at 22:55, Eugene Wissner via
Digitalmars-d-announce wrote:
> On Saturday, 23 September 2017 at 20:34:51 UTC, Iain Buclaw wrote:
>>
>> On 23 September 2017 at 21:45, Eugene Wissner via Digitalmars-d-announce
>>
Hmmm. Find some useful information here.
On Sunday, 24 September 2017 at 05:24:57 UTC, Manu wrote:
On 23 September 2017 at 03:11, Ilya Yaroshenko via
Digitalmars-d < digitalmars-d@puremagic.com> wrote:
Should we add `a * b` to ndslice for 1d vectors?
Discussion at https://github.com/libmir/mir-algorithm/issues/91
I often ponder
https://issues.dlang.org/show_bug.cgi?id=17855
Issue ID: 17855
Summary: Forum draft, error accessing 5-month-old draft, can't
dismiss banner
Product: D
Version: D2
Hardware: x86_64
OS: Linux
https://issues.dlang.org/show_bug.cgi?id=17855
b2.t...@gmx.com changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
I have the following code:
https://pastebin.com/PWuaXJNp
but typing my name does not go to the next line as soon as I
press enter
how to solve this?
On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote:
I have the following code:
https://pastebin.com/PWuaXJNp
but typing my name does not go to the next line as soon as I
press enter
how to solve this?
use writeln instead write
https://issues.dlang.org/show_bug.cgi?id=17855
Simon Na. changed:
What|Removed |Added
Severity|enhancement |normal
--
On Saturday, 23 September 2017 at 22:07:58 UTC, bitwise wrote:
Of the few different architectures I tried, the fiber based
approach was much slower. It's possible that my implementation
did too many unnecessary context switches.
Can you give a bit more details? What kind of architectures do
On 25/09/2017 6:28 AM, WhatMeForget wrote:
This is taken exactly from the traits documentation.
25 Traits
25.21 identifier
Takes one argument, a symbol. Returns the identifier for that symbol as
a string literal.
Am 24.09.2017 um 20:36 schrieb Vadim Lopatin:
On Friday, 22 September 2017 at 09:40:00 UTC, Sönke Ludwig wrote:
What's was the last status? Could you observe any meaningful thread
scaling?
It works for me - multithreading improves performance on my PC.
So far, test results on
On Sunday, 24 September 2017 at 04:24:55 UTC, user1234 wrote:
This is the 100,000th Thread.
A few hours ago, i was letting my mind flying. What if i were a
professor. What would i tell about D...
"
We reach the end of this short course. Next time we'll see us
you'll be tested.
This test
On Monday, 25 September 2017 at 01:08:35 UTC, Nicholas Wilson
wrote:
There's nothing stopping someone writing a DIP to include `@`
(and possibly `#`) as overloadable binary operators.
I actually like * for dot product and matrix multiplication...
The issue is that if you use * for these,
In your case, the postblit of Bar is still going to run and add
a ref to it's count when you place it in Foo, right? That means
that if you don't destroy it, it will leak memory or resources.
Actually no. Since when Foo (class that instantiates Bar) gets
GCed, that is the point that I need
On Monday, 25 September 2017 at 01:08:35 UTC, Nicholas Wilson
wrote:
There's nothing stopping someone writing a DIP to include `@`
(and possibly `#`) as overloadable binary operators. All other
characters on the standard keyboard are used I think.
̣̣§
This is taken exactly from the traits documentation.
25 Traits
25.21 identifier
Takes one argument, a symbol. Returns the identifier for that
symbol as a string literal.
There are no
On Monday, 25 September 2017 at 03:22:01 UTC, user1234 wrote:
On Monday, 25 September 2017 at 01:08:35 UTC, Nicholas Wilson
wrote:
There's nothing stopping someone writing a DIP to include `@`
(and possibly `#`) as overloadable binary operators. All other
characters on the standard keyboard
46 matches
Mail list logo