On Thursday, 14 March 2019 at 15:29:28 UTC, Ozan wrote:
Hi
In vibe.d / data / mongo / collection I found the function
* ensureIndex(Tuple!(string, int))[] field_orders)
What could be the right way to use "Tuple!(string, int))[]
field_orders"?
I tried different ways like [Tuple!(&quo
Hi
In vibe.d / data / mongo / collection I found the function
* ensureIndex(Tuple!(string, int))[] field_orders)
What could be the right way to use "Tuple!(string, int))[]
field_orders"?
I tried different ways like [Tuple!("a", 1), Tuple!("b", 2)]",
but com
On Thursday, 16 February 2017 at 22:44:58 UTC, Ali Çehreli wrote:
On 02/16/2017 02:05 PM, Jean Cesar wrote:
> So I used get methods and sets only as initial pattern to
netender the
> functioning of the language in relation to some concepts of
the same
Makes sense...
> how to leave a very
On 02/16/2017 02:05 PM, Jean Cesar wrote:
> So I used get methods and sets only as initial pattern to netender the
> functioning of the language in relation to some concepts of the same
Makes sense...
> how to leave a very small code with the largest number of
> Possible functionality type
I
On Thursday, 16 February 2017 at 02:17:49 UTC, Ali Çehreli wrote:
On 02/15/2017 05:49 PM, Jean Cesar wrote:
> So I'm a beginner in this language and have very little time
I started
> I'm interested in apprehending concepts of object orientation
> polymorphism inheritance, multiple inheritance
On 02/15/2017 05:49 PM, Jean Cesar wrote:
> So I'm a beginner in this language and have very little time I started
> I'm interested in apprehending concepts of object orientation
> polymorphism inheritance, multiple inheritance as in c ++
D is similar to C++ but also very different.
> but I
On Wednesday, 15 February 2017 at 23:40:41 UTC, Ali Çehreli wrote:
On 02/15/2017 03:20 PM, Jean Cesar wrote:
How do I make a class person where I use set and get methods
to imput
the user type:
I have some information here:
http://ddili.org/ders/d.en/input.html
You should also know how
On 02/15/2017 03:20 PM, Jean Cesar wrote:
How do I make a class person where I use set and get methods to imput
the user type:
I have some information here:
http://ddili.org/ders/d.en/input.html
You should also know how to read strings:
http://ddili.org/ders/d.en/strings.html
And this
How do I make a class person where I use set and get methods to
imput the user type:
Import std.stdio;
class person
{
private:
string name, address;
int age;
float height;
public:
void setNome()
{
write("Enter Your Name:");
// the problem is here how am I going to read the
On Sunday, 8 March 2015 at 21:41:44 UTC, FG wrote:
Except that with this solution you will confuse empty strings
with ints.
The idea was to only make it memory-safe without union.
On Sun, 08 Mar 2015 18:57:37 +, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
i hate annoying beginners too, but not to SUCH extent.
signature.asc
Description: PGP signature
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, five];
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, five];
As there's no mention of performance, what's wrong with a plain
old string array with a bit
On 2015-03-08 at 20:26, Meta wrote:
On Sunday, 8 March 2015 at 18:57:38 UTC, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
What in the world is that code doing? I'm having a hard time wrapping my head
around this.
It's a trick to reuse string internals to store an int.
A
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
On 2015-03-08 21:11:42 +, Paul said:
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store strings
and numbers at the same time?
string-int[] array = [4, five];
As there's no mention of performance, what's wrong
On Sunday, 8 March 2015 at 21:18:31 UTC, Max Klyga wrote:
On 2015-03-08 21:11:42 +, Paul said:
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
Is it possible to create such an array in which you can store
strings and numbers at the same time?
string-int[] array = [4, five
On Sunday, 8 March 2015 at 21:18:31 UTC, Max Klyga wrote:
OP is fighting a loosing battle in flame war on some obscure
forum. F# enthusiast trolls OP into solving stupid puzzles that
are trivial in F# (or any ML-family language) and clumsy in
C-family languages.
In language holy wars the
On Sunday, 8 March 2015 at 21:41:44 UTC, FG wrote:
On 2015-03-08 at 20:26, Meta wrote:
On Sunday, 8 March 2015 at 18:57:38 UTC, Kagamin wrote:
http://dpaste.dzfl.pl/2c8d4a7d9ef0 like this.
What in the world is that code doing? I'm having a hard time
wrapping my head around this.
It's a
On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote:
I can not understand, why this code works:
char s[2] = ['0', 'A'];
string ss = to!string(s);
writeln(parse!uint(ss, 16));
but this can deduces template:
char s[2] = ['0', 'A'];
writeln(parse!uint(to!string(s), 16));
On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote:
I can not understand, why this code works:
char s[2] = ['0', 'A'];
string ss = to!string(s);
writeln(parse!uint(ss, 16));
but this can deduces template:
char s[2] = ['0', 'A'];
writeln(parse!uint(to!string(s), 16));
On Saturday, 7 June 2014 at 21:15:37 UTC, monarch_dodra wrote:
On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote:
I can not understand, why this code works:
char s[2] = ['0', 'A'];
string ss = to!string(s);
writeln(parse!uint(ss, 16));
but this can deduces template:
char s[2]
On Sat, 07 Jun 2014 20:53:02 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I can not understand, why this code works:
char s[2] = ['0', 'A'];
string ss = to!string(s);
writeln(parse!uint(ss, 16));
but this can deduces template:
char s[2]
Hi,
All is in the title.
I need this to do a tupleof enhanced, that mean:
- .tupleof need an instance me i want to do this on type
diretcly
- .tupleof do not bind to member name i need this
for this i strat to this code:
import std.stdio;
import std.typecons;
import std.conv;
struct
On Sunday, 1 June 2014 at 13:34:20 UTC, bioinfornatics wrote:
Hi,
All is in the title.
I need this to do a tupleof enhanced, that mean:
- .tupleof need an instance me i want to do this on type
diretcly
- .tupleof do not bind to member name i need this
for this i strat to this code:
Maybe http://dlang.org/property.html#stringof helps.
On Sunday, 1 June 2014 at 13:52:27 UTC, Tobias Pankrath wrote:
Maybe http://dlang.org/property.html#stringof helps.
yes that help a lot thanks
I bam close to be done
import std.stdio;
import std.typecons;
import std.conv;
struct Coord
{
int x;
int y;
int z;
}
template toTuple(T){
static string maker(){
string statement = alias Tuple!(;
foreach(const memberName; __traits(allMembers, T)){
On Sunday, 1 June 2014 at 13:58:03 UTC, bioinfornatics wrote:
On Sunday, 1 June 2014 at 13:52:27 UTC, Tobias Pankrath wrote:
Maybe http://dlang.org/property.html#stringof helps.
yes that help a lot thanks
End of spam ( joke ^^)
I found it :-)
import std.stdio;
import std.typecons;
import
== Quote from Stewart Gordon (smjg_1...@yahoo.com)'s article
Further to what others have said, why use strings? There are only 12
possible chess pieces (black and white), plus blank, so probably the
most efficient approach is
char[8][8] board;
and use uppercase letters for white and
dcoder wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
This is what I think you should use:
string[int[2]]
snip
board[[0,0]] = Rook;
Further to what others have said, why use strings? There are only 12
possible chess pieces (black and white), plus blank, so
string[int[2]] board;
board[[0,0]] = Rook;
board[[0,1]] = Knight;
foreach( pos, val; board) {
writefln( %s: %s, pos, val);
}
Output:
2 9903680: Knight
2 9903696: Rook
Changing the declaration to
string[int[]] board;
makes it work (for me).
BR
/HF
Hello. I want to use associative arrays, but have a 2-d int array as my
index. so something like:
string[int[][]] chessboard;
chessboard[[0,0]] = Rook;
chessboard[[0,1]] = Knight;
Is this possible? I can declare chessboard without any compiler complaints,
but I haven't figured out how
== Quote from dcoder (dco...@devnull.com)'s article
Hello. I want to use associative arrays, but have a 2-d int array as my
index. so something like:
string[int[][]] chessboard;
chessboard[[0,0]] = Rook;
chessboard[[0,1]] = Knight;
Is this possible? I can declare chessboard without any
On 22/07/2010 22:57, dcoder wrote:
== Quote from dcoder (dco...@devnull.com)'s article
Hello. I want to use associative arrays, but have a 2-d int array as my
index. so something like:
string[int[][]] chessboard;
chessboard[[0,0]] = Rook;
chessboard[[0,1]] = Knight;
Is this possible? I can
== Quote from awishformore (awishform...@nospam.plz)'s article
How about string[][]? ;)
yes, heheh... you are right.
I'm over thinking things.
Sorry about the noise.
On Thu, 22 Jul 2010 16:57:59 -0400, dcoder dco...@devenull.dev wrote:
== Quote from dcoder (dco...@devnull.com)'s article
Hello. I want to use associative arrays, but have a 2-d int array as my
index. so something like:
string[int[][]] chessboard;
chessboard[[0,0]] = Rook;
chessboard[[0,1
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
This is what I think you should use:
string[int[2]]
Although, I'm not sure if you can then do something like:
chessboard[[0,1]] = Rook;
as the [0, 1] is typed as a dynamic array. If it does work, it may
actually create [0,1
38 matches
Mail list logo