Hello, so I've been experimenting with the framework and I tried
to implement a game that has more than two windows.
The first window is the main game and the second window is a
smaller one with the various commands you can select.
So I tried to render sprites onto the first window and the
it's seems that next block is execute even if is rs.next() is
false:
writeln("rs.next()-->", rs.next());
if(!rs.next()) //if user do not in DB
{
// is execute even if rs.next() is false
writeln("Executed, but rs.nst was set to false");
}
The output:
rs.next()-->false
Executed, but rs.nst was
On Saturday, 12 December 2015 at 12:36:10 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 12:14:30 UTC, Vadim Lopatin
wrote:
On Saturday, 12 December 2015 at 12:06:21 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:53:51 UTC, Suliman wrote:
On Saturday, 12 December 2015 at
DMD v2.069.2-b1 on Linux.
import std.algorithm;
int a = max(5, 6);// works, a == 6
int b = max!(int, int)(5, 6); // works, manual instantiation
int c = 5.max(6); // works, UFCS call
I would like to use the last syntax, but with an alias.
alias
On Saturday, 12 December 2015 at 10:36:12 UTC, drug wrote:
12.12.2015 13:28, Suliman пишет:
it's seems that next block is execute even if is rs.next() is
false:
writeln("rs.next()-->", rs.next());
if(!rs.next()) //if user do not in DB
{
// is execute even if rs.next() is false
On Saturday, 12 December 2015 at 11:31:18 UTC, Suliman wrote:
Oh sorry! I used wrong host! All ok!
Yes, there was issue with host name, but it's do not solve
problem. Second DB have same fields and I still getting false
instead moving into while loop
On Saturday, 12 December 2015 at 12:06:21 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:53:51 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:31:18 UTC, Suliman wrote:
Oh sorry! I used wrong host! All ok!
Yes, there was issue with host name, but it's do not solve
problem.
On 12.12.2015 08:44, Suliman wrote:
string query_string = (`SELECT user, password FROM otest.myusers where
user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`);
Don't piece queries together without escaping the dynamic parts.
Imagine what happens when the user enters an apostrophe in
On Saturday, 12 December 2015 at 13:18:12 UTC, anonymous wrote:
On 12.12.2015 08:44, Suliman wrote:
string query_string = (`SELECT user, password FROM
otest.myusers where
user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`);
Don't piece queries together without escaping the dynamic
12.12.2015 13:28, Suliman пишет:
it's seems that next block is execute even if is rs.next() is false:
writeln("rs.next()-->", rs.next());
if(!rs.next()) //if user do not in DB
{
// is execute even if rs.next() is false
writeln("Executed, but rs.nst was set to false");
}
The output:
On Saturday, 12 December 2015 at 12:14:30 UTC, Vadim Lopatin
wrote:
On Saturday, 12 December 2015 at 12:06:21 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:53:51 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:31:18 UTC, Suliman wrote:
Oh sorry! I used wrong host! All ok!
On Saturday, 12 December 2015 at 12:43:36 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 12:36:10 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 12:14:30 UTC, Vadim Lopatin
wrote:
On Saturday, 12 December 2015 at 12:06:21 UTC, Suliman wrote:
On Saturday, 12 December 2015 at
On Saturday, 12 December 2015 at 12:43:36 UTC, SimonN wrote:
DMD v2.069.2-b1 on Linux.
import std.algorithm;
int a = max(5, 6);// works, a == 6
int b = max!(int, int)(5, 6); // works, manual instantiation
int c = 5.max(6); // works, UFCS call
I would
On Saturday, 12 December 2015 at 12:43:36 UTC, SimonN wrote:
DMD v2.069.2-b1 on Linux.
import std.algorithm;
int a = max(5, 6);// works, a == 6
int b = max!(int, int)(5, 6); // works, manual instantiation
int c = 5.max(6); // works, UFCS call
I would
Oh sorry! I used wrong host! All ok!
On Saturday, 12 December 2015 at 11:53:51 UTC, Suliman wrote:
On Saturday, 12 December 2015 at 11:31:18 UTC, Suliman wrote:
Oh sorry! I used wrong host! All ok!
Yes, there was issue with host name, but it's do not solve
problem. Second DB have same fields and I still getting false
instead
On Sat, 12 Dec 2015 07:44:40 +, Suliman wrote:
>>> string query_string = (`SELECT user, password FROM otest.myusers where
>>> user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`);
>>
>> Don't piece queries together without escaping the dynamic parts.
>> Imagine what happens when the
https://github.com/D-Programming-Language/phobos/blob/master/std/meta.d#L790
Looks like an AliasSeq can contain a template identifier too. So should I
understand that AliasSeq in general can refer to any identifier and any
value? Hitherto I thought it was any *type* and any value...
--
Hello. Re my posting just now re AliasSeq being able to contain a template
identifier too, I wonder whether it is possible to have a std.traits
template to identify whether something is a template or not?
In connection with this, while is() is there to determine whether something
is a type or
By putting it in the top level. I believe this is intentional
but I don't remember the reasoning.
On Saturday, 12 December 2015 at 13:34:09 UTC, ZombineDev wrote:
This is due to limitation of function-local aliases. If you put
the alias outside it will work:
On Saturday, 12 December 2015 at 14:17:52 UTC, Shriramana Sharma
wrote:
Hello. Re my posting just now re AliasSeq being able to contain
a template identifier too, I wonder whether it is possible to
have a std.traits template to identify whether something is a
template or not?
In connection
On Saturday, 12 December 2015 at 14:15:37 UTC, Shriramana Sharma
wrote:
https://github.com/D-Programming-Language/phobos/blob/master/std/meta.d#L790
Looks like an AliasSeq can contain a template identifier too.
So should I understand that AliasSeq in general can refer to
any identifier and
On Saturday, 12 December 2015 at 23:50:55 UTC, Xinok wrote:
On Saturday, 12 December 2015 at 23:36:43 UTC, cym13 wrote:
...
So, in your example:
int product(const ref int[] arr) {
import std.array: array;
import std.algorithm: reduce;
arr = arr.reduce!((p, i) => p*i).array;
}
On 12/12/2015 06:15 AM, Shriramana Sharma wrote:
>
https://github.com/D-Programming-Language/phobos/blob/master/std/meta.d#L790
>
> Looks like an AliasSeq can contain a template identifier too. So should I
> understand that AliasSeq in general can refer to any identifier and any
> value?
On Sunday, 13 December 2015 at 00:02:11 UTC, cym13 wrote:
Now that I think about it, it's true that it would make no
sense whatsoever to return a range as reduce is typically used
to return a single value... At least it makes perfect sense.
Thanks alot, this helped alot. But I have another
On Sunday, 13 December 2015 at 00:36:29 UTC, Namal wrote:
On Sunday, 13 December 2015 at 00:02:11 UTC, cym13 wrote:
Now that I think about it, it's true that it would make no
sense whatsoever to return a range as reduce is typically used
to return a single value... At least it makes perfect
Hello guys,
I am still uncertain how to do it right when it comes to lambda
functions. For instance: how do I multiply all the elements in an
array ?
int product(const ref int[] arr){
int p = 1;
foreach(i;arr)
p*=i;
return p;
}
On Saturday, 12 December 2015 at 23:10:21 UTC, Namal wrote:
Hello guys,
I am still uncertain how to do it right when it comes to lambda
functions.
If you are looking for the functionnal way I'd advise that you
start by
looking up three functions in a language-agnostic way: filter,
map and
On Saturday, 12 December 2015 at 23:36:43 UTC, cym13 wrote:
...
So, in your example:
int product(const ref int[] arr) {
import std.array: array;
import std.algorithm: reduce;
arr = arr.reduce!((p, i) => p*i).array;
}
A good post overall but you got reduce wrong. In D, reduce
On Saturday, 12 December 2015 at 23:50:55 UTC, Xinok wrote:
On Saturday, 12 December 2015 at 23:36:43 UTC, cym13 wrote:
...
So, in your example:
int product(const ref int[] arr) {
import std.array: array;
import std.algorithm: reduce;
arr = arr.reduce!((p, i) => p*i).array;
}
On Saturday, 12 December 2015 at 23:59:01 UTC, cym13 wrote:
On Saturday, 12 December 2015 at 23:50:55 UTC, Xinok wrote:
On Saturday, 12 December 2015 at 23:36:43 UTC, cym13 wrote:
...
So, in your example:
int product(const ref int[] arr) {
import std.array: array;
import
31 matches
Mail list logo