On Thursday, June 6, 2019 10:21:39 PM MDT rnd via Digitalmars-d-learn wrote:
> On Thursday, 6 June 2019 at 21:32:11 UTC, Jonathan M Davis wrote:
> > If any is not given a predicate, it defaults to just checking
> > whether the element itself is true (requiring that the element
> > be bool), which i
On Friday, 7 June 2019 at 04:39:14 UTC, rikki cattermole wrote:
On 07/06/2019 3:54 PM, rnd wrote:
How should I 'initialize python' ?
The example is probably a good place to begin.
https://github.com/ariovistus/pyd/blob/master/examples/simple_embedded/hello.d
Thanks for the link. After putt
On 07/06/2019 3:54 PM, rnd wrote:
Edit:
I tried above D program and got following error:
core.exception.AssertError@/home/abcde/.dub/packages/pyd-0.10.5/pyd/infrastructure/pyd/embedded.d(53):
python not initialized
??:? _d_assert_msg [0x5562d3f3c466]
/home/abcde/.dub/packages
On Thursday, 6 June 2019 at 21:32:11 UTC, Jonathan M Davis wrote:
If any is not given a predicate, it defaults to just checking
whether the element itself is true (requiring that the element
be bool), which is why Marco's suggestion works, but it's a
rather odd way to write the code and will be
Edit:
I tried above D program and got following error:
core.exception.AssertError@/home/abcde/.dub/packages/pyd-0.10.5/pyd/infrastructure/pyd/embedded.d(53):
python not initialized
??:? _d_assert_msg [0x5562d3f3c466]
/home/abcde/.dub/packages/pyd-0.10.5/pyd/infrastructure/pyd/e
I have a simple python script file which contains following 3
statements:
import pandas
df = pandas.read_csv('testfile.csv')
print(df[0:3])
Can I incorporate above in a D program?
I see there is pyd package for using python in D:
https://code.dlang.org/packages/pyd
Will following program work
On Thursday, June 6, 2019 2:52:42 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 6/6/19 4:49 PM, Steven Schveighoffer wrote:
> > Oh wait! It's not empty, it has an empty string as a single member!
> > That's definitely a bug.
>
> OK, not a bug, but not what I would have expected.
On Thursday, June 6, 2019 5:50:36 AM MDT rnd via Digitalmars-d-learn wrote:
> On Thursday, 6 June 2019 at 09:49:28 UTC, Jonathan M Davis wrote:
> > So, to start, the any portion should be something more like
> >
> > any!pred(ss);
> >
> > or
> >
> > ss.any!pred();
> >
> > or
> >
> > ss.any!pred;
> >
On 6/6/19 1:49 PM, Adam D. Ruppe wrote:
On Thursday, 6 June 2019 at 17:40:17 UTC, Machine Code wrote:
outside an unittest, this compiles fine:
struct A
try making it `static struct` instead
cannot implicitly convert expression "hehe" of type string to A
Why does inside a unittest it
On 6/6/19 4:49 PM, Steven Schveighoffer wrote:
Oh wait! It's not empty, it has an empty string as a single member!
That's definitely a bug.
OK, not a bug, but not what I would have expected. From docs:
"If T isn't a struct, class, or union, an expression tuple with an empty
string is return
On 6/6/19 4:43 PM, Steven Schveighoffer wrote:
On 6/6/19 4:22 PM, Amex wrote:
FieldNameTuple!T
std.traits.Fields!T
are non-empty when T is an interface!
An interface cannot contain fields and yet these return non-zero and
screws up my code. While I can filter for interfaces it makes me
wonde
On 6/6/19 4:22 PM, Amex wrote:
FieldNameTuple!T
std.traits.Fields!T
are non-empty when T is an interface!
An interface cannot contain fields and yet these return non-zero and
screws up my code. While I can filter for interfaces it makes me wonder
what else may slip through?
Is it a bug or w
On Thursday, 6 June 2019 at 20:22:26 UTC, Amex wrote:
Is it a bug or what is going on?
my suspicion is it is actually the pointer to the vtable getting
caught up in it but idk, i didn't really look, just guessing.
On Thursday, 6 June 2019 at 20:22:00 UTC, Amex wrote:
I i = new D();
It is a bizarre quirk, I think because interfaces do not
necessarily point to objects with RTTI (though this can be
statically determined, so I am not sure that is valid), but when
you do typeid on an interface, it gives th
FieldNameTuple!T
std.traits.Fields!T
are non-empty when T is an interface!
An interface cannot contain fields and yet these return non-zero
and screws up my code. While I can filter for interfaces it makes
me wonder what else may slip through?
Is it a bug or what is going on?
- x 0x004b71e0 {Interface for main.I} {m_init={length=0
ptr=0x}, name="main.I", vtbl={length=0 ptr=0x},
...} object.TypeInfo_Class {TypeInfo_Class}
[TypeInfo_Class]D0006: Error: Type resolve failed
m_init {length=0 ptr=0x}
On Thursday, 6 June 2019 at 17:40:17 UTC, Machine Code wrote:
outside an unittest, this compiles fine:
struct A
{
enum A foo = "hehe";
this(string a) { m_a = a; }
alias m_a this;
string m_a;
}
but if you wra
On Thursday, 6 June 2019 at 17:40:17 UTC, Machine Code wrote:
outside an unittest, this compiles fine:
struct A
try making it `static struct` instead
cannot implicitly convert expression "hehe" of type string to A
Why does inside a unittest it doesn't work? the constructor
this(s
outside an unittest, this compiles fine:
struct A
{
enum A foo = "hehe";
this(string a) { m_a = a; }
alias m_a this;
string m_a;
}
but if you wrap this a unittest {} and compile with
dmd -unittest -run foo.d
On Thursday, 6 June 2019 at 09:49:28 UTC, Jonathan M Davis wrote:
So, to start, the any portion should be something more like
any!pred(ss);
or
ss.any!pred();
or
ss.any!pred;
where pred is whatever the predicate is.
Apparently, following also works:
any(ss.map!(a => a > 127)) // as wr
On Thursday, 6 June 2019 at 11:08:18 UTC, Dukc wrote:
We were both wrong :-). It turned out that the correct way to
initialize a SecureD RSA private key is to feed contents of
.pem in without ANY processing.
Ah, they made it even easier :)
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote:
On Friday, 31 May 2019 at 10:35:46 UTC, Dukc wrote:
But then came a problem that I need to feed the key from .pem
to initialize RSA class.
Just base64 decode the PEM data (without the ) and feed it
to RSA.this(ubyte[] publicK
On Thursday, 6 June 2019 at 10:16:17 UTC, Jacob Carlborg wrote:
On Thursday, 6 June 2019 at 04:20:52 UTC, Andre Pany wrote:
Hi,
I want to enhance a unittest framework to also report the
results in SonarQube Generic Execution format. This format
lists the file paths.
The unittest framework l
On Thursday, 6 June 2019 at 04:20:52 UTC, Andre Pany wrote:
Hi,
I want to enhance a unittest framework to also report the
results in SonarQube Generic Execution format. This format
lists the file paths.
The unittest framework loops through the modules and collects
the module name and the un
On Thursday, June 6, 2019 3:01:11 AM MDT rnd via Digitalmars-d-learn wrote:
> I am trying to check if any character in the string is > 127 by
> following function:
>
> import std.algorithm.searching;
> import std.algorithm.iteration;
> bool isBinary(char[] ss){
>return (any!(map!(a => a > 127)(
On Thursday, 6 June 2019 at 09:01:11 UTC, rnd wrote:
I am trying to check if any character in the string is > 127 by
following function:
import std.algorithm.searching;
import std.algorithm.iteration;
bool isBinary(char[] ss){
return (any!(map!(a => a > 127)(ss)));
}
However, I am getting th
I am trying to check if any character in the string is > 127 by
following function:
import std.algorithm.searching;
import std.algorithm.iteration;
bool isBinary(char[] ss){
return (any!(map!(a => a > 127)(ss)));
}
However, I am getting this error:
Error: variable ss cannot be read at compil
You should declare methods too, see example
https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d
28 matches
Mail list logo