On Wednesday, 2 November 2016 at 02:33:10 UTC, Konstantin
Kutsevalov wrote:
On Wednesday, 2 November 2016 at 02:20:43 UTC, rikki cattermole
wrote:
On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote:
The question is simple.
Is there something like "this" word for classes?
For example:
```
On Wednesday, 2 November 2016 at 02:20:43 UTC, rikki cattermole
wrote:
On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote:
The question is simple.
Is there something like "this" word for classes?
For example:
```
class CLS {
int numberValue;
public this(numberValue)
{
On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote:
The question is simple.
Is there something like "this" word for classes?
For example:
```
class CLS {
int numberValue;
public this(numberValue)
{
// how can I put the local numberValue to class property?
// in
The question is simple.
Is there something like "this" word for classes?
For example:
```
class CLS {
int numberValue;
public this(numberValue)
{
// how can I put the local numberValue to class property?
// in some prog language I can do like:
//
On Wednesday, November 02, 2016 01:36:23 Concealment via Digitalmars-d-learn
wrote:
> On Wednesday, 2 November 2016 at 01:32:27 UTC, Adam D. Ruppe
>
> wrote:
> > On Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment
> >
> > wrote:
> >> can someone help me please?
> >
> > did you import
On Wednesday, 2 November 2016 at 01:32:27 UTC, Adam D. Ruppe
wrote:
On Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment
wrote:
can someone help me please?
did you import anything? `import core.stdc.stdlib;` I think
will fix that one, but generally you need an import to use lib
On Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment wrote:
can someone help me please?
did you import anything? `import core.stdc.stdlib;` I think will
fix that one, but generally you need an import to use lib
functions.
void main(string[] args)
{
srand(time(null));
int p1 = rand() % 7;
p1++;
i compiled this program i wrote... but it keeps giving me an error
main.d(17): Error: undefined identifier 'time'
can someone help me please?
On Tuesday, 1 November 2016 at 22:55:36 UTC, Nordlöw wrote:
On Tuesday, 1 November 2016 at 20:54:34 UTC, Steven
Schveighoffer wrote:
MonoTime has about 5-10 % fluctuations on my laptop. Is this
as good as
it gets?
This is not clear. What is this a percentage of?
It percentage of execution
On Tuesday, 1 November 2016 at 20:54:34 UTC, Steven Schveighoffer
wrote:
MonoTime has about 5-10 % fluctuations on my laptop. Is this
as good as
it gets?
This is not clear. What is this a percentage of?
It percentage of execution time.
15 ms +- 2 ms
That seems doesn't look like what you
Greetings,
I need some help with dub libraries.
Executing "dub list" in my machine, I got the following:
Packages present in the system and known to dub:
colorize ~master:
C:\Users\Alfred\AppData\Roaming\dub\packages\colorize-master\colorize\
...
sqlite-d ~master:
On Tuesday, 1 November 2016 at 18:13:32 UTC, TheGag96 wrote:
On Monday, 31 October 2016 at 07:16:50 UTC, Sebastien Alaiwan
wrote:
Hello,
From GCC 6.2, -fpie is becoming the default setting at compile
and at link time.
As dmd uses GCC to link, now the code needs to be compiled
with a special
On 11/1/16 4:19 PM, Nordlöw wrote:
On Tuesday, 1 November 2016 at 18:39:01 UTC, Jonathan M Davis wrote:
Alternatively, you can always do something like
immutable before = MonoTime.currTime();
// do stuf...
immutable after = MonoTime.currTime();
Duration timeSpent = after - before;
MonoTime
On Tuesday, November 01, 2016 20:21:32 Nordlöw via Digitalmars-d-learn
wrote:
> On Tuesday, 1 November 2016 at 20:19:31 UTC, Nordlöw wrote:
> > MonoTime has about 5-10 % fluctuations on my laptop. Is this as
> > good as it gets?
>
> Is
>
>
On Tuesday, November 01, 2016 20:19:31 Nordlöw via Digitalmars-d-learn
wrote:
> On Tuesday, 1 November 2016 at 18:39:01 UTC, Jonathan M Davis
>
> wrote:
> > Alternatively, you can always do something like
> >
> > immutable before = MonoTime.currTime();
> > // do stuf...
> > immutable after =
On Tuesday, 1 November 2016 at 20:19:31 UTC, Nordlöw wrote:
MonoTime has about 5-10 % fluctuations on my laptop. Is this as
good as it gets?
Is
https://dlang.org/phobos/core_time.html#.ClockType.threadCPUTime
what I should use if I'm on Linux?
On Tuesday, 1 November 2016 at 18:39:01 UTC, Jonathan M Davis
wrote:
Alternatively, you can always do something like
immutable before = MonoTime.currTime();
// do stuf...
immutable after = MonoTime.currTime();
Duration timeSpent = after - before;
MonoTime has about 5-10 % fluctuations on my
On 11/01/2016 10:34 AM, bachmeier via Digitalmars-d-learn wrote:
On Tuesday, 1 November 2016 at 17:23:54 UTC, Charles Hixson wrote:
On 11/01/2016 12:52 AM, Nordlöw via Digitalmars-d-learn wrote:
On Tuesday, 1 November 2016 at 07:15:19 UTC, Mike Parker wrote:
but
dmd -defaultlib=libphobos2.so
On Tuesday, November 01, 2016 17:52:56 Nordlöw via Digitalmars-d-learn
wrote:
> Should I always, when possible, prefer `immutable` over `const`?
>
> And does `immutable` increase the possibility of the compiler
> doing optimizations, such as common subexpression elimination?
>
> Or can the
On 11/01/2016 06:52 PM, Nordlöw wrote:
Should I always, when possible, prefer `immutable` over `const`?
I'd say: prefer immutable.
And does `immutable` increase the possibility of the compiler doing
optimizations, such as common subexpression elimination?
Or can the compiler infer `const`
On Tuesday, November 01, 2016 16:53:51 Nordlöw via Digitalmars-d-learn
wrote:
> Which way of measuring time in std.datetime should I used if I
> want to benchmark a function by the amount of time spent in the
> current thread, not wall-clock time?
That's what std.datetime.benchmark is for,
On 11/1/16 10:08 AM, Steven Schveighoffer wrote:
On 10/31/16 3:24 PM, Ali Çehreli wrote:
Because it considers the .ptr property of arrays as well:
[snip]
return bytesHash(bytes.ptr, bytes.length, seed);// <-- HERE
bytesHash shouldn't use the pointer value in any way, it should
On Monday, 31 October 2016 at 07:16:50 UTC, Sebastien Alaiwan
wrote:
Hello,
From GCC 6.2, -fpie is becoming the default setting at compile
and at link time.
As dmd uses GCC to link, now the code needs to be compiled with
a special option.
Which means you need, at the moment, to add the
On 11/1/16 12:24 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Tuesday, November 01, 2016 12:19:11 Steven Schveighoffer via Digitalmars-
d-learn wrote:
On 11/1/16 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Tuesday, November 01, 2016 10:57:38 Steven Schveighoffer via
On Tuesday, 1 November 2016 at 14:06:08 UTC, Steven Schveighoffer
wrote:
On 10/31/16 3:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) ==
Should I always, when possible, prefer `immutable` over `const`?
And does `immutable` increase the possibility of the compiler
doing optimizations, such as common subexpression elimination?
Or can the compiler infer `const` declarations to also be
`immutable`?
On Tuesday, 1 November 2016 at 17:23:54 UTC, Charles Hixson wrote:
On 11/01/2016 12:52 AM, Nordlöw via Digitalmars-d-learn wrote:
On Tuesday, 1 November 2016 at 07:15:19 UTC, Mike Parker wrote:
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default
On 11/01/2016 12:52 AM, Nordlöw via Digitalmars-d-learn wrote:
On Tuesday, 1 November 2016 at 07:15:19 UTC, Mike Parker wrote:
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default /etc/dmd.conf
should handle it correctly, but I can deal with it
On Friday, 21 October 2016 at 10:50:30 UTC, Vadim Lopatin wrote:
On Wednesday, 19 October 2016 at 16:01:37 UTC, Alfred Newman
wrote:
Hello,
I am trying to handle a SQLite3 table with D. During my
researchs, I discovered the lib
https://dlang.org/phobos/etc_c_sqlite3.html.
However, for any
Which way of measuring time in std.datetime should I used if I
want to benchmark a function by the amount of time spent in the
current thread, not wall-clock time?
On Tuesday, November 01, 2016 12:19:11 Steven Schveighoffer via Digitalmars-
d-learn wrote:
> On 11/1/16 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > On Tuesday, November 01, 2016 10:57:38 Steven Schveighoffer via
> >> Is there not some assumeNoThrow wrapper somewhere?
> >
> >
On 11/1/16 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Tuesday, November 01, 2016 10:57:38 Steven Schveighoffer via Digitalmars-
d-learn wrote:
On 10/31/16 6:29 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
assert(0, "format threw when it shouldn't be possible.");
On Tuesday, November 01, 2016 10:57:38 Steven Schveighoffer via Digitalmars-
d-learn wrote:
> On 10/31/16 6:29 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > On Monday, October 31, 2016 22:20:59 Kapps via Digitalmars-d-learn
wrote:
> >> Assuming you're sure it'll never throw. To enforce
On 10/31/16 6:29 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Monday, October 31, 2016 22:20:59 Kapps via Digitalmars-d-learn wrote:
Assuming you're sure it'll never throw. To enforce this, use try
{ } catch { throw new Error("blah"); }. You can still throw
errors, just not exceptions
On Monday, 31 October 2016 at 22:29:19 UTC, Jonathan M Davis
wrote:
On Monday, October 31, 2016 22:20:59 Kapps via
Digitalmars-d-learn wrote:
Assuming you're sure it'll never throw. To enforce this, use
try
{ } catch { throw new Error("blah"); }. You can still throw
errors, just not exceptions
On 10/31/16 3:24 PM, Ali Çehreli wrote:
On 10/31/2016 12:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
On 10/31/16 3:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}
Thanks.
IMO, it shouldn't. A string's
On Sunday, 30 October 2016 at 23:57:11 UTC, Ali Çehreli wrote:
While working on a solution for Alfred Newman's thread, I came
up with the following interim solution, which compiled but
failed:
auto parse(R, S)(R range, S separators) {
import std.algorithm : splitter, filter, canFind;
On Monday, 31 October 2016 at 22:10:30 UTC, Ali Çehreli wrote:
On 10/31/2016 12:08 PM, Gary Willoughby wrote:
Can someone please explain why the following assertion fails?
import std.stdio;
import std.conv;
void main(string[] args)
{
auto x = 1;
assert(hashOf(x.to!(string)) ==
On Tuesday, 1 November 2016 at 07:15:19 UTC, Mike Parker wrote:
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default
/etc/dmd.conf should handle it correctly, but I can deal with
it now.
Can this be fed as parameters to the DMD call
On Monday, 31 October 2016 at 19:20:21 UTC, Charles Hixson wrote:
but
dmd -defaultlib=libphobos2.so -fPIC test.d
works. It shouldn't be required (as in the default
/etc/dmd.conf should handle it correctly, but I can deal with
it now.
The need to manually add this to dmd.conf is a very
On Monday, 31 October 2016 at 22:20:59 UTC, Kapps wrote:
Wrap a body of the function to try {} catch {} and it'll work.
Assuming you're sure it'll never throw. To enforce this, use
try { } catch { throw new Error("blah"); }. You can still throw
errors, just not exceptions (as errors are not
On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote:
Is there a way to turn off nothrow or work around it? Because
to me it looks like nothrow prevents me from doing anything
useful.
extern(C) void onKeyEvent(GLFWwindow* window, int key, int
scancode, int action, int modifier)
43 matches
Mail list logo