On Wednesday, 21 March 2018 at 18:50:38 UTC, Vino wrote:
Hi All,
Request your help in calling the windows command to delete all
file and folders recursively as the D function rmdirRecurse
does not delete file in the permission of the file is readonly
in windows 2008 R2
import std.process:
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked
through std.algorithm but didn't find anything.. Maybe I'm
blind.
What I would like to do is filter out all spaces in a string
and change the front letter to lower case
On Thursday, 22 March 2018 at 03:58:35 UTC, Seb wrote:
On Thursday, 22 March 2018 at 03:39:38 UTC, Jordan Wilson wrote:
auto a = iota(5).slide!(Yes.withPartial)(3);
auto b = iota(5).slide!(No.withPartial)(3);
assert (a.equal(b));
The assert passes, but I would expect it to fail? They both
are:
On Thursday, 22 March 2018 at 03:39:38 UTC, Jordan Wilson wrote:
auto a = iota(5).slide!(Yes.withPartial)(3);
auto b = iota(5).slide!(No.withPartial)(3);
assert (a.equal(b));
The assert passes, but I would expect it to fail? They both are:
[[0,1,2],[1,2,3],[2,3,4]]
Thanks,
Jordan
See:
https:
auto a = iota(5).slide!(Yes.withPartial)(3);
auto b = iota(5).slide!(No.withPartial)(3);
assert (a.equal(b));
The assert passes, but I would expect it to fail? They both are:
[[0,1,2],[1,2,3],[2,3,4]]
Thanks,
Jordan
On Wednesday, March 21, 2018 22:50:32 Ontonator via Digitalmars-d-learn
wrote:
> On Wednesday, 21 March 2018 at 06:39:22 UTC, ag0aep6g wrote:
> > On 03/21/2018 01:47 AM, Ontonator wrote:
> >> The following code does not compile:
> >>> [...]
> >>
> >> It gives the error:
> >>> [...]
> >>
> >> The a
On Wednesday, March 21, 2018 20:07:09 tipdbmp via Digitalmars-d-learn wrote:
> D's type declarations seem to read right to left.
>
>
> int an_integer;
>
> int[10] an_array_of_10_integers;
> int[10]* a_pointer_to_an_array_of_10_integers =
> &an_array_of_10_integers;
>
> int*[10] an_array_of_10_point
On Wednesday, 21 March 2018 at 06:39:22 UTC, ag0aep6g wrote:
On 03/21/2018 01:47 AM, Ontonator wrote:
The following code does not compile:
[...]
It gives the error:
[...]
The aliases do not have to be aliases, as long as there is
some reference to the class (e.g. method and variable
decl
On Wednesday, 21 March 2018 at 13:26:48 UTC, HeiHon wrote:
In Windows Security Center Settings (where you can disable
realtime scan) there is also an entry "Exclusions" (in german
windows "Ausschlüsse").
I added exclusions for the folder, where I installed dmd and
ldc and I added an exclusion f
On Wednesday, 21 March 2018 at 13:26:48 UTC, HeiHon wrote:
I added exclusions for the folder, where I installed dmd and
ldc and I added an exclusion for the folder, where I compile my
D programs. Now startup of dmd and freshly compiled programs is
fast again.
I've done this too now, thanks fo
On Wednesday, 24 December 2014 at 11:56:40 UTC, Suliman wrote:
Could anybody provide any simple examples of usage DerelictPQ.
I do not have experience of C, and I can't understand how to
use this driver.
I need just basics like connect, select and insert.
http://code.dlang.org/packages/dereli
On 2018-03-21 20:30, Russel Winder wrote:
Thanks to Adam and Ali, it was clear and obvious.
Please report and issue so it's not forgotten.
--
/Jacob Carlborg
On 2018-03-21 17:06, Russel Winder wrote:
No I wasn't. And it works a treat.
Cool :). I recommend having a look at the changelog and the usage
information (--help).
--
/Jacob Carlborg
On Wednesday, 21 March 2018 at 20:07:09 UTC, tipdbmp wrote:
D's type declarations seem to read right to left.
int an_integer;
int[10] an_array_of_10_integers;
int[10]* a_pointer_to_an_array_of_10_integers =
&an_array_of_10_integers;
int*[10] an_array_of_10_pointers_to_integers;
int*[10]* a_
On Wednesday, 21 March 2018 at 20:07:09 UTC, tipdbmp wrote:
I think this is a big improvement over C's "spiral" way of
reading types:
Yes, D is perfect and has achieved sanity where before there was
none.
You can read basically anything with little knowledge.
void function()[] array_of_funt
D's type declarations seem to read right to left.
int an_integer;
int[10] an_array_of_10_integers;
int[10]* a_pointer_to_an_array_of_10_integers =
&an_array_of_10_integers;
int*[10] an_array_of_10_pointers_to_integers;
int*[10]* a_pointer_to_an_array_of_10_pointers_to_integers =
&an_array_o
On Wed, Mar 21, 2018 at 07:30:28PM +, Russel Winder via Digitalmars-d-learn
wrote:
[...]
> But :-(
>
> Why does version have to be a keyword?
[...]
version(all) { ... }
version(none) { ... }
version(Posix) { ... }
version(Windows) { ... }
But yeah, using "ver
On Wed, 2018-03-21 at 18:11 +, Adam D. Ruppe via Digitalmars-d-
learn wrote:
> On Wednesday, 21 March 2018 at 18:00:38 UTC, Russel Winder wrote:
> > ubyte, "version", 5,
>
>
> version is a D keyword, so I would suggest trying "version_"
> there instead and see if it works. (I'm guess
On Wednesday, 21 March 2018 at 18:50:18 UTC, Adam D. Ruppe wrote:
On Wednesday, 21 March 2018 at 18:44:12 UTC, realhet wrote:
Compiling this I get an error: "formattedRead: cannot deduce
arguments from (string, string, float, float, float)"
What compiler version are you using? The newest versi
On Wednesday, 21 March 2018 at 18:53:39 UTC, steven kladitis
wrote:
int[] array3;
array3[0]=4;
array3 is empty. You are trying to set a value that doesn't
exist..
Hi All,
Request your help in calling the windows command to delete all
file and folders recursively as the D function rmdirRecurse does
not delete file in the permission of the file is readonly in
windows 2008 R2
import std.process: execute;
import std.array: empty;
auto RemoveDir () (
auto
import std.stdio;
void main(){
int[3] array1 = [ 10, 20, 30 ];
auto array2 = array1; // array2's elements are different
// from array1's
array2[0] = 11;
int[] array3;
//array4[0]=3;
array3[0]=4;
auto array4 = array3;
writeln(array1,'\n',array2,'\n',array3,'\n',array4);
}
-- windows 7 64 bit (
On Wednesday, 21 March 2018 at 18:44:12 UTC, realhet wrote:
Compiling this I get an error: "formattedRead: cannot deduce
arguments from (string, string, float, float, float)"
What compiler version are you using? The newest versions allow
this code, though the old ones require an intermediate v
On 03/21/2018 11:44 AM, realhet wrote:
float x,y,z;
if(formattedRead(" vertex -5.1 2.4 3.666".strip, "vertex %f %f
%f", x, y, z)){
writefln("v(%f, %f, %f)", x, y, z);
}
formattedRead wants to modify the source, so it takes it by reference,
which rvalues cannot be passed for.
On Wednesday, 21 March 2018 at 18:31:29 UTC, tipdbmp wrote:
I see. I guess the other would be:
{
int[8192] bar;
int[8192][string] foo;
foo["a"] = bar;
foo["a"][8191] = -1;
}
https://run.dlang.io/is/AK2X2t
Are you looking to use static arrays or dynamic? You can't use
the new
Hi,
I just got this problem and since an hour can't find answer to it.
float x,y,z;
if(formattedRead("vertex -5.1 2.4 3.666".strip, "vertex %f
%f %f", x, y, z)){
writefln("v(%f, %f, %f)", x, y, z);
}
Compiling this I get an error: "formattedRead: cannot deduce
arguments from (s
On Wednesday, 21 March 2018 at 16:22:45 UTC, Martin Tschierschke
wrote:
Is there an step by step introduction how to convert a C header
of an external lib into the right extern(C){} block?
A blog post or tutorial, or chapter in a D book? (I have those
from Packt Publishing)
(Especially I am
I see. I guess the other would be:
{
int[8192] bar;
int[8192][string] foo;
foo["a"] = bar;
foo["a"][8191] = -1;
}
On Wed, Mar 21, 2018 at 05:42:34PM +, rumbu via Digitalmars-d-learn wrote:
> I tried to define a template:
>
> enum isFoo(alias T) =
> T.stringof.length >= 3 && T.stringof[0..3] == "abc";
>
> int i;
> pragma(msg, isFoo!i);
>
> Error: string slice [0 .. 3] is out of bounds
> Error: templa
On 03/21/2018 11:00 AM, Russel Winder wrote:
> The code I am playing with generated by DStep involves lots of lots of
> structs with mixin bitfields. All of them seem to compile file, except
> one. How is it that:
>
> mixin(bitfields!(
> ubyte, "current_next", 1,
> ubyte, "v
On Wednesday, 21 March 2018 at 18:00:38 UTC, Russel Winder wrote:
ubyte, "version", 5,
version is a D keyword, so I would suggest trying "version_"
there instead and see if it works. (I'm guessing btw, the error
message was way to long and illegible, but this is an easy first
guess
The code I am playing with generated by DStep involves lots of lots of
structs with mixin bitfields. All of them seem to compile file, except
one. How is it that:
mixin(bitfields!(
ubyte, "current_next", 1,
ubyte, "version", 5,
ubyte, "one2", 2)); /* TS ID */
can resul
I tried to define a template:
enum isFoo(alias T) =
T.stringof.length >= 3 && T.stringof[0..3] == "abc";
int i;
pragma(msg, isFoo!i);
Error: string slice [0 .. 3] is out of bounds
Error: template object.__equals cannot deduce function from
argument types !()(string, string), candidates are
On Wednesday, 21 March 2018 at 16:22:45 UTC, Martin Tschierschke
wrote:
Is there an step by step introduction how to convert a C header
of an external lib into the right extern(C){} block?
A blog post or tutorial, or chapter in a D book? (I have those
from Packt Publishing)
While googling I
On Wednesday, 21 March 2018 at 12:07:49 UTC, Simen Kjærås wrote:
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
unittest {
assert("my capitalized string".capitalize ==
"myCapitalizedString");
}
auto capitalize(string s) {
import std.regex, std.uni;
return s.replaceAll
On Wednesday, 21 March 2018 at 12:53:56 UTC, Ali Çehreli wrote:
Here is another one that uses ForwardRange.
import std.range; // empty, take, save, chain, popFrontN;
import std.uni; // asLowerCase;
import std.algorithm; // equal, filter;
import std.conv; // text;
auto initialLowerCased(R)(R st
Martin Tschierschke wrote:
or tutorial
ok, tutorial:
1. learn C.
2. learn D.
3. DO IT!
;-)
Is there an step by step introduction how to convert a C header
of an external lib into the right extern(C){} block?
A blog post or tutorial, or chapter in a D book? (I have those
from Packt Publishing)
(Especially I am trying to get this used with D:
Montetdb C-API
https://www.monetdb.org/D
On Tue, 2018-03-20 at 14:18 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> […]
>
> Either way, it will require a lot of effort to pull off.
>
As Rust has shown appreciating that the quality of the error messages
define the quality of the compiler, the quality of the error message
from rustc
On Tue, 2018-03-20 at 22:08 +0100, Jacob Carlborg via Digitalmars-d-
learn wrote:
>
[…]
> Not sure if this will help, but are you aware that DStep can add a
> package to the module declaration using "--package"?
No I wasn't. And it works a treat.
--
Russel.
On Wednesday, 21 March 2018 at 15:53:32 UTC, tipdbmp wrote:
int[10][string] foo;
One option is to initialize like this
---
void main() {
int[10][string] foo;
if("a" !in foo)
foo["a"] = [0,0,0,0,0,0,0,0,0,0]; // set all to zero to create
the key
foo["a"][4] = 4; // now valid to s
// foo is an associative array/hashtable with
// key type: string
// value type: int[10]
//
int[10][string] foo;
// foo["a"] = new int[10]; // Range violation at runtime
// foo["a"][0] = 1; // Range violation at runtime
Hi!
How do I get past this?
static struct X {
int x;
private enum T = 1;
private alias M = string;
}
foreach (Member; __traits(allMembers, X)) {
pragma(msg, __traits(getProtection, __traits(getMember, X,
Member)));
}
Output:
public
private
c.d(1084): Error: argume
You may be wondering whether the United Nations employ an
interpreter for all dialects across the globe. It does not do so
as the presenters at the UN should make their dose he's in any
one of its 6 official languages, These official languages are
Spanish, French, English, Chinese, Arabic, and
On Tuesday, 20 March 2018 at 16:56:59 UTC, Dennis wrote:
On Tuesday, 20 March 2018 at 12:18:16 UTC, Adam D. Ruppe wrote:
On Tuesday, 20 March 2018 at 09:44:41 UTC, Dennis wrote:
This now leaves the question what's the best way to mitigate
this, because I would gladly get rid of the second of de
On 03/21/2018 04:30 AM, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked through
std.algorithm but didn't find anything.. Maybe I'm blind.
What I would like to do is filter out all spaces in a string and change
the front letter to lower case:
string m = "M
On Wednesday, 21 March 2018 at 12:01:01 UTC, Quantum Nerd wrote:
How is it possible that b in main() and r in the function
occupy the same memory?
I would expect the same behaviour as with c.
Can somebody with more experience shed some light on this?
I'm pretty sure you're seeing NRVO - Named
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked
through std.algorithm but didn't find anything.. Maybe I'm
blind.
What I would like to do is filter out all spaces in a string
and change the front letter to lower case
Hello everybody,
I am fairly new to the D language,
and I've been trying to understand the behaviour
of passing arrays to functions, especially also
static arrays.
There is an example that puzzles me:
import std.stdio;
double[3] sqr( double[3] v ) {
double[3] r;
writefln( "v (%20s) : %s",
Hey,
I'm struggling to find a way to achieve this. I've looked through
std.algorithm but didn't find anything.. Maybe I'm blind.
What I would like to do is filter out all spaces in a string and
change the front letter to lower case:
string m = "My Capital String";
string lower = m
On Wednesday, 21 March 2018 at 07:40:01 UTC, Dukc wrote:
...except that IEnumerables cannot popBack(), so can only do
that by doing an additional copy and reversing that. But I
quess there's no better alternative, short of doing it
C-style...
A random access range would be represented as ILis
On Tuesday, 20 March 2018 at 15:57:16 UTC, Kagamin wrote:
On Tuesday, 20 March 2018 at 15:06:14 UTC, Dukc wrote:
Won't quite do it, because that would not iterate backwards.
Linq has no chunking, so you would need to write it, maybe
similar to SelectMany, but with the opposite meaning.
...e
52 matches
Mail list logo