On Wednesday, 7 January 2015 at 08:58:35 UTC, Suliman wrote:
thanks!
Am I right understand that in next code scope(exit)
stmt.close(); occur after this execution? And it will close
connection so stmt in function become unavailable.
this(parseConfig parseconfig)
{
thanks!
Am I right understand that in next code scope(exit) stmt.close();
occur after this execution? And it will close connection so stmt
in function become unavailable.
this(parseConfig parseconfig)
{
[]
auto conn = ds.getConnection();
On Tuesday, 6 January 2015 at 23:32:25 UTC, Artur Skawina via
That shows a static struct, so I'm not sure it's the same
problem.
static structs with template alias parameters to local symbols
count as nested structs.
Your solution would likely work, but yes, I'm looking for
something less
When i try to run the following code
import std.stdio;
void main(){
auto a= new test!int();
a.add(0);
a.add(1);
}
class test(T){
void add(T e){
auto temp= new node();
writeln(new node, temp);
}
class node{
On Wednesday, 7 January 2015 at 10:37:18 UTC, Nick wrote:
When i try to run the following code
import std.stdio;
void main(){
auto a= new test!int();
a.add(0);
a.add(1);
}
class test(T){
void add(T e){
auto temp= new node();
Nick:
The two nodes have the same address, is this right?
What you are printing is the address of the reference in the
stack frame of add(). If you want to print the reference you can
use this:
import std.stdio;
class Test(T) {
static class Node {
T v;
}
void add(T
On Wednesday, 7 January 2015 at 10:56:09 UTC, John Colvin wrote:
On Wednesday, 7 January 2015 at 10:37:18 UTC, Nick wrote:
When i try to run the following code
import std.stdio;
void main(){
auto a= new test!int();
a.add(0);
a.add(1);
}
class test(T){
void
What you want is some kind of code obfuscation. The easiest
thing for
you is to use exe compression. It is not going to stop a
dedicated
attacker, but ordinary people will not be able to extract any
information from it.
And I guess as an alternative to the utility you linked to, you
Dne 7.1.2015 v 12:00 Laeeth Isharc via Digitalmars-d-learn napsal(a):
What you want is some kind of code obfuscation. The easiest thing for
you is to use exe compression. It is not going to stop a dedicated
attacker, but ordinary people will not be able to extract any
information from it.
On Wednesday, 7 January 2015 at 14:18:53 UTC, FrankLike wrote:
On Wednesday, 7 January 2015 at 11:00:54 UTC, Laeeth Isharc
wrote:
What you want is some kind of code obfuscation. The easiest
thing for
you is to use exe compression. It is not going to stop a
dedicated
attacker, but ordinary
On Wednesday, 7 January 2015 at 15:04:24 UTC, Paulo Pinto wrote:
On Wednesday, 7 January 2015 at 15:02:34 UTC, Laeeth Isharc
wrote:
Not true. If you're using a tree structure, you *should* use
pointers.
Unless you're using classes, which are by-reference, in which
case you
can just use the
On 8/01/2015 4:48 p.m., Jason den Dulk wrote:
Hi.
Package in question: fpdf
Dub version I'm using: 0.9.22
DMD version: 2.066.1 (64 bit)
Platform: Fedora 19 (64-bit).
I created the fpdf package, and it is dependant on the imageformats
package, but it won't compile. When I place a copy of
On 2015-01-07 20:48, Jonathan Marler wrote:
I've looked up the windows version helper functions
(http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx).
The problem is that these functions are not defined in DMD's
user32.lib. I could use the operating system's
Hi.
Package in question: fpdf
Dub version I'm using: 0.9.22
DMD version: 2.066.1 (64 bit)
Platform: Fedora 19 (64-bit).
I created the fpdf package, and it is dependant on the
imageformats package, but it won't compile. When I place a copy
of imageformats.d into the project source directory,
On Wednesday, 7 January 2015 at 23:27:19 UTC, anonymous wrote:
Don't do this without `dup`ing. Quoting the documentation:
Oh, whoops. I thought those special variadic args were always
allocated on the heap.
If you have just installed a newer compiler and trying to link
with older compiled code, then linking and other things can get
wrong. I suggest recompiling all of your code using the new
compiler.
On 01/06/2015 01:25 PM, Suliman wrote: On Tuesday, 6 January 2015 at
21:19:38 UTC, bearophile wrote:
Suliman:
void foo()
{
writeln(test);
writeln(mystring);
}
foo();
}
I guess you have to remove that line.
Bye,
bearophile
Why? I can't call function in
On Wednesday, 7 January 2015 at 20:25:10 UTC, Meta wrote:
struct Tree
{
this(string data, Tree[] children...)
{
this.data = data;
this.children = children;
Don't do this without `dup`ing. Quoting the documentation:
An implementation may construct the object or array
On Tuesday, 6 January 2015 at 20:49:34 UTC, Rene Zwanenburg wrote:
On Tuesday, 6 January 2015 at 20:26:25 UTC, ixid wrote:
Dmd latest non-beta, with the latest VisualD. Debug build.
Debug build and no additional or non default settings.
Hmm..
Did you verify that the D installation directory
On Wednesday, 7 January 2015 at 18:50:40 UTC, Jacob Carlborg
wrote:
On 2015-01-07 19:27, Jonathan Marler wrote:
I'm looking at the Windows multicast API. It has different
socket
options depending on if you are on Windows XP or Windows Vista
(and
later). Is there a way to tell at runtime
On Wednesday, 7 January 2015 at 16:17:47 UTC, Tobias Pankrath
wrote:
A slice seems overkill to refer to just one object, but is that
the best way ?
struct Tree
{
Tree[] children;
}
Is one way to do it.
You can add some nice sugar for this as well:
struct Tree
{
this(string data,
I'm trying to compile my software with the latest compiler, and
it spits out the following error:
$ make
...
rdmd --force --build-only -IBioD -g -L-Lhtslib -L-l:libhts.a
-L-l:libphobos2.a -ofbuild/sambamba.o main.d
...
On Wednesday, 7 January 2015 at 17:57:18 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Wed, Jan 07, 2015 at 05:16:13PM +, FrankLike via
Digitalmars-d-learn wrote:
To hide the infos you can also (I've seen people say that you
can use
a packer) encrypt the strings and decode them at
On Wednesday, 7 January 2015 at 18:27:48 UTC, bearophile wrote:
foreach (immutable e; [EnumMembers!T].sort().uniq)
Thanks!
FrankLike:
But now I want to know in a string (like hello.exe or
hello.a,or hello.dll or hello.lib ) whether contains any
of them: [exe,dll,a,lib].
Seems this:
http://rosettacode.org/wiki/File_extension_is_in_extensions_list#D
Bye,
bearophile
On Wednesday, 7 January 2015 at 10:56:07 UTC, bearophile wrote:
Nick:
The two nodes have the same address, is this right?
What you are printing is the address of the reference in the
stack frame of add(). If you want to print the reference you
can use this:
import std.stdio;
class
On Wednesday, 7 January 2015 at 11:00:54 UTC, Laeeth Isharc wrote:
What you want is some kind of code obfuscation. The easiest
thing for
you is to use exe compression. It is not going to stop a
dedicated
attacker, but ordinary people will not be able to extract any
information from it.
On Wednesday, 7 January 2015 at 14:33:16 UTC, Tobias Pankrath
wrote:
On Wednesday, 7 January 2015 at 14:18:53 UTC, FrankLike wrote:
On Wednesday, 7 January 2015 at 11:00:54 UTC, Laeeth Isharc
wrote:
What you want is some kind of code obfuscation. The easiest
thing for
you is to use exe
ref is a reserved keyword.
doh!
Thanks.
On Wednesday, 7 January 2015 at 15:11:57 UTC, John Colvin wrote:
On Wednesday, 7 January 2015 at 14:54:51 UTC, FrankLike wrote:
I want to know whether the string strs contains
'exe','dll','a','lib',in c#,
I can do : int index =
indexofany(strs,[exe,dll,a,lib]);
but in D: I must to do like
On Wednesday, 7 January 2015 at 19:48:16 UTC, Jonathan Marler
wrote:
On Wednesday, 7 January 2015 at 18:50:40 UTC, Jacob Carlborg
wrote:
On 2015-01-07 19:27, Jonathan Marler wrote:
I'm looking at the Windows multicast API. It has different
socket
options depending on if you are on Windows XP
On Wed, Jan 07, 2015 at 08:36:19PM +, Baz via Digitalmars-d-learn wrote:
On Wednesday, 7 January 2015 at 17:57:18 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
[...]
Note that these encryption/decryption schemes can only serve as
deterrent to the casual user, they do not prevent a
On 8/01/2015 9:10 a.m., Artem Tarasov wrote:
I'm trying to compile my software with the latest compiler, and it spits
out the following error:
$ make
...
rdmd --force --build-only -IBioD -g -L-Lhtslib -L-l:libhts.a
-L-l:libphobos2.a -ofbuild/sambamba.o main.d
...
Another schoolboy question.
Suppose I am constructing a tree (in this case it is an AST). In
C I would have a pointer for the child to find the parent, and an
array or linked list of pointers to find the children from the
parent.
Obviously, I could still use pointers, but that would not be
I want to know whether the string strs contains
'exe','dll','a','lib',in c#,
I can do : int index = indexofany(strs,[exe,dll,a,lib]);
but in D: I must to do like this:
findStr(strs,[exe,lib,dll,a]))
bool findStr(string strIn,string[] strFind)
{
bool bFind = false;
On Wednesday, 7 January 2015 at 14:54:51 UTC, FrankLike wrote:
I want to know whether the string strs contains
'exe','dll','a','lib',in c#,
I can do : int index =
indexofany(strs,[exe,dll,a,lib]);
but in D: I must to do like this:
findStr(strs,[exe,lib,dll,a]))
bool findStr(string
On Wednesday, 7 January 2015 at 16:23:38 UTC, John Colvin wrote:
On Wednesday, 7 January 2015 at 16:15:49 UTC, Tobias Pankrath
wrote:
http://dpaste.dzfl.pl/3bbdecfefa5c
I'm not sure about some of that. Bad casts w.r.t.
immutability etc.
How about:
http://dpaste.dzfl.pl/706ab2db9ce1
I
On Wed, 07 Jan 2015 16:38:23 +, Suliman wrote:
I except that writefln have some behavior as string concatenation, but
it does not.
IS there any way to put needed values in place of %s in string?
std.string.format interpolates string with the same behavior as writefln
but returns the
On Wednesday, 7 January 2015 at 16:38:25 UTC, Suliman wrote:
I need to construct complex SQL request, like:
string sql = (INSERT INTO test.geomagnetic (`date`,
`a_fredericksburg`, `fredericksburg`, `a_college`, `college`,
`a_planetary`, `planetary`) VALUES ('%s', '%s', '%s', '%s',
'%s',
std.algorithm.find has several overloads, one of which takes
multiple needles. The same is true for std.algorithm.canFind
Quoting from the relevant std.algorithm.find overload docs:
Finds two or more needles into a haystack.
string strs =hello.exe;
string[] s =[lib,exe,a,dll];
auto a =
I would keep the encryption inside a template to prevent
users from assigning it to a variable without triggering CTFE.
Why would that be a problem?
Because the plain text will be in the object file.
http://dpaste.dzfl.pl/95b17fff42c6
Take a look at the object file and you will find
Try this:
http://dlang.org/phobos-prerelease/std_algorithm#.findAmong
T
--
MACINTOSH: Most Applications Crash, If Not, The Operating System Hangs
On Wednesday, 7 January 2015 at 16:45:11 UTC, Tobias Pankrath
wrote:
On Wednesday, 7 January 2015 at 16:23:38 UTC, John Colvin wrote:
On Wednesday, 7 January 2015 at 16:15:49 UTC, Tobias Pankrath
wrote:
http://dpaste.dzfl.pl/3bbdecfefa5c
I'm not sure about some of that. Bad casts w.r.t.
On Tuesday, 6 January 2015 at 17:15:28 UTC, FrankLike wrote:
How to prevent sensitive information is displayed when the
extension 'exe' is modified to 'txt' on windows?
If you build a exe ,such as which can get Data from
DataBase,when you modify the exe's extension to 'txt',
and you open it
On Wednesday, 7 January 2015 at 15:57:18 UTC, FrankLike wrote:
On Wednesday, 7 January 2015 at 15:11:57 UTC, John Colvin wrote:
On Wednesday, 7 January 2015 at 14:54:51 UTC, FrankLike wrote:
I want to know whether the string strs contains
'exe','dll','a','lib',in c#,
I can do : int index =
I need to construct complex SQL request, like:
string sql = (INSERT INTO test.geomagnetic (`date`,
`a_fredericksburg`, `fredericksburg`, `a_college`, `college`,
`a_planetary`, `planetary`) VALUES ('%s', '%s', '%s', '%s', '%s',
'%s', '%s');, date[i], a_fredericksburg[i], fredericksburg[i],
Suliman:
I need to construct complex SQL request, like:
string sql = (INSERT INTO test.geomagnetic (`date`,
`a_fredericksburg`, `fredericksburg`, `a_college`, `college`,
`a_planetary`, `planetary`) VALUES ('%s', '%s', '%s', '%s',
'%s', '%s', '%s');, date[i], a_fredericksburg[i],
A slice seems overkill to refer to just one object, but is that
the best way ?
struct Tree
{
Tree[] children;
}
Is one way to do it.
http://dpaste.dzfl.pl/3bbdecfefa5c
I'm not sure about some of that. Bad casts w.r.t. immutability
etc.
How about:
http://dpaste.dzfl.pl/706ab2db9ce1
I would keep the encryption inside a template to prevent users
from assigning it to a variable without triggering CTFE.
How about:
http://dpaste.dzfl.pl/706ab2db9ce1
Thanks.
http://dpaste.dzfl.pl/3bbdecfefa5c
Thanks.
On Wednesday, 7 January 2015 at 16:15:49 UTC, Tobias Pankrath
wrote:
http://dpaste.dzfl.pl/3bbdecfefa5c
I'm not sure about some of that. Bad casts w.r.t. immutability
etc.
How about:
http://dpaste.dzfl.pl/706ab2db9ce1
I would keep the encryption inside a template to prevent users
from
On Wednesday, 7 January 2015 at 16:02:25 UTC, bearophile wrote:
FrankLike:
But now I want to know in a string (like hello.exe or
hello.a,or hello.dll or hello.lib ) whether contains any
of them: [exe,dll,a,lib].
Seems this:
http://rosettacode.org/wiki/File_extension_is_in_extensions_list#D
On Wed, Jan 07, 2015 at 05:16:13PM +, FrankLike via Digitalmars-d-learn
wrote:
To hide the infos you can also (I've seen people say that you can use
a packer) encrypt the strings and decode them at run-time (e.g
base64, a simple XOR, etc) and use the import() idiom:
Nordlöw:
How do I make
foreach (E; EnumMembers!T)
- iterate dynamically instead of statically (no loop unrolling)
and
- skip enumerator aliases?
Try:
foreach (immutable e; [EnumMembers!T].sort().uniq)
Bye,
bearophile
How do I make
foreach (E; EnumMembers!T)
- iterate dynamically instead of statically (no loop unrolling)
and
- skip enumerator aliases?
I'm looking at the Windows multicast API. It has different
socket options depending on if you are on Windows XP or Windows
Vista (and later). Is there a way to tell at runtime which
version of windows you are on? Note: I'm specifically talking
about runtime because I want the same binary to
On 2015-01-07 19:27, Jonathan Marler wrote:
I'm looking at the Windows multicast API. It has different socket
options depending on if you are on Windows XP or Windows Vista (and
later). Is there a way to tell at runtime which version of windows you
are on? Note: I'm specifically talking about
On Wednesday, 7 January 2015 at 18:50:40 UTC, Jacob Carlborg
wrote:
On 2015-01-07 19:27, Jonathan Marler wrote:
I'm looking at the Windows multicast API. It has different
socket
options depending on if you are on Windows XP or Windows Vista
(and
later). Is there a way to tell at runtime
On Wednesday, 7 January 2015 at 18:50:40 UTC, Jacob Carlborg
wrote:
On 2015-01-07 19:27, Jonathan Marler wrote:
I'm looking at the Windows multicast API. It has different
socket
options depending on if you are on Windows XP or Windows Vista
(and
later). Is there a way to tell at runtime
On Wed, Jan 07, 2015 at 02:52:51PM +, Laeeth Isharc via Digitalmars-d-learn
wrote:
Another schoolboy question.
Suppose I am constructing a tree (in this case it is an AST). In C I
would have a pointer for the child to find the parent, and an array or
linked list of pointers to find the
Not true. If you're using a tree structure, you *should* use
pointers.
Unless you're using classes, which are by-reference, in which
case you
can just use the class as-is. :-)
Thanks v much.
I just came to that realization also when I stepped away.
class node
{
string name;
On Wednesday, 7 January 2015 at 15:02:34 UTC, Laeeth Isharc wrote:
Not true. If you're using a tree structure, you *should* use
pointers.
Unless you're using classes, which are by-reference, in which
case you
can just use the class as-is. :-)
Thanks v much.
I just came to that realization
To hide the infos you can also (I've seen people say that you
can use a packer) encrypt the strings and decode them at
run-time (e.g base64, a simple XOR, etc) and use the import()
idiom:
https://p0nce.github.io/d-idioms/#Embed-a-dynamic-library-in-an-executable
to import the compiled
Please show the _clean_ input, followed by an output example.
Bye,
bearophile
to prevent visual corruption I had past it here:
http://www.everfall.com/paste/id.php?ftzy9lxr6yfy
Just FYI use prepared statements instead of string concatenation
for SQL queries.
You mean some tools, that
std.string.format interpolates string with the same behavior as
writefln
Thanks!
what if a_college[i] will contain ` char?
almost SQL have prepare statement...
67 matches
Mail list logo