Hello
I would like advice in the most elegant way for doing this in D:
I have something like this:
struct A
{
int x;
int y;
}
A[] my_array;
And I would need something like this:
assert( my_array[0..n].x == [ my_array[0].x, my_array[1].x, ...
my_array[n-1].x ]);
assert( my_array[0..n].y == [
On Monday, 4 July 2016 at 20:54:53 UTC, Luke Picardo wrote:
if (curTime - lastMsgTime).total!"seconds") ...
Both are shared Durations.
also when I try to do
lastMsgTime = curTime;
Gives me
Error: non-shared method std.datetime.SysTime.opAssign is not
callable using a shared object.
cast `
On Monday, 4 July 2016 at 11:56:14 UTC, Rene Zwanenburg wrote:
On Monday, 4 July 2016 at 11:42:40 UTC, Rene Zwanenburg wrote:
...
I forgot to mention:
If you're on Windows compilation defaults to 32 bit, false
pointers can be a problem with D's current GC in 32 bit
applications. This isn't
On Tuesday, 5 July 2016 at 03:32:25 UTC, WhatMeWorry wrote:
Just learning Linux. Got my first vibe/dub project which dies
at:
[...]
You need to install sqlite3, or download and build it yourself,
to get libsqlite3.a. I don't use Ubuntu so not sure of the
package but you will be able to "apt
On Tue, Jul 05, 2016 at 03:32:25AM +, WhatMeWorry via Digitalmars-d-learn
wrote:
> $ sudo apt-get install sqlite3
I'm just guessing, but try install sqlite3-devel too
Just learning Linux. Got my first vibe/dub project which dies at:
Compiling diet template 'index.dt'...
Linking...
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
I downloaded DUB's d2sqlite3 and built it fine.
I've got sqlite3 on my system by default (came with Xu
On Monday, 4 July 2016 at 19:22:52 UTC, Johannes Loher wrote:
This looks really nice, but I have several occurences of this,
with different arrays (and lengths), so i would need to create
several of those structs. But it looks really clean :)
You can use a template to remove the boilerplate. H
if (curTime - lastMsgTime).total!"seconds") ...
Both are shared Durations.
also when I try to do
lastMsgTime = curTime;
Gives me
Error: non-shared method std.datetime.SysTime.opAssign is not
callable using a shared object.
Am 04.07.2016 um 19:24 schrieb ZombineDev:
> On Monday, 4 July 2016 at 14:31:41 UTC, Johannes Loher wrote:
>> In a project I am currently working on, I have lot's of code of the
>> following form:
>>
>> static immutable ubyte[4] sigma0 = [101, 120, 112, 97]; static
>> immutable ubyte[4] sigma1 = [
Am 04.07.2016 um 20:33 schrieb Ali Çehreli:
> On 07/04/2016 07:31 AM, Johannes Loher wrote:
>> In a project I am currently working on, I have lot's of code of the
>> following form:
>>
>> static immutable ubyte[4] sigma0 = [101, 120, 112, 97];
>> static immutable ubyte[4] sigma1 = [110, 100, 32,
On 07/04/2016 07:31 AM, Johannes Loher wrote:
> In a project I am currently working on, I have lot's of code of the
> following form:
>
> static immutable ubyte[4] sigma0 = [101, 120, 112, 97];
> static immutable ubyte[4] sigma1 = [110, 100, 32, 51];
> static immutable ubyte[4] sigma2 = [ 50,
On Monday, 4 July 2016 at 14:31:41 UTC, Johannes Loher wrote:
In a project I am currently working on, I have lot's of code of
the following form:
static immutable ubyte[4] sigma0 = [101, 120, 112, 97]; static
immutable ubyte[4] sigma1 = [110, 100, 32, 51]; static
immutable ubyte[4] sigma2
In a project I am currently working on, I have lot's of code of the
following form:
static immutable ubyte[4] sigma0 = [101, 120, 112, 97];
static immutable ubyte[4] sigma1 = [110, 100, 32, 51];
static immutable ubyte[4] sigma2 = [ 50, 45, 98, 121];
static immutable ubyte[4] sigma3 = [116, 10
On Sunday, 3 July 2016 at 22:00:39 UTC, MMJones wrote:
I like the term var better than auto. Is there a way to alias
auto?
If you really want to have Javascript-like semantics in D, you
try this:
https://github.com/adamdruppe/arsd/blob/master/jsvar.d
On Monday, 4 July 2016 at 11:42:40 UTC, Rene Zwanenburg wrote:
...
I forgot to mention:
If you're on Windows compilation defaults to 32 bit, false
pointers can be a problem with D's current GC in 32 bit
applications. This isn't an issue for the sample application
though, since you're not pu
On Monday, 4 July 2016 at 01:57:19 UTC, Hiemlick Hiemlicker wrote:
version(Windows)
void main()
{
import std.random;
while(getchar() != EOF)
{
auto x = new int[std.random.uniform(100, 1000)];
writeln("");
b
16 matches
Mail list logo