We have many scripting engines available for use in D more or
less(lua, python, etc...).
Is there a D scripting engine that can be easily integrated into
a D project? A sort of "exec()". Something that works at
compile time and run time possibly? If is a static string
then it should be able
On Monday, 4 January 2016 at 19:04:48 UTC, Max Klyga wrote:
On 2016-01-04 18:40:03 +, Jason Jeffory said:
The fastest one would probably be Lua -
http://code.dlang.org/search?q=lua
But there are other options:
Python - http://code.dlang.org/packages/pyd
Javascript -
I think you are looking for something like this.
Context.getTarget will get you the surface the Context is drawing to,
this most likely isn't a ImageSurface.
So you will need to create an pixbuf from the returned surface, with the
Pixbuf you can then get the raw pixel data using
On Monday, 4 January 2016 at 19:27:48 UTC, Mike Wey wrote:
I think you are looking for something like this.
Context.getTarget will get you the surface the Context is
drawing to, this most likely isn't a ImageSurface.
So you will need to create an pixbuf from the returned surface,
with the
On Monday, 4 January 2016 at 18:04:34 UTC, TheDGuy wrote:
On Monday, 4 January 2016 at 17:33:28 UTC, Gerald wrote:
On Monday, 4 January 2016 at 16:13:50 UTC, TheDGuy wrote:
[...]
Yes, you need it. The extern (C) function is what GDK invokes
on idle. In any GUI application there is a lot of
On Monday, 4 January 2016 at 18:40:03 UTC, Jason Jeffory wrote:
We have many scripting engines available for use in D more or
less(lua, python, etc...).
Is there a D scripting engine that can be easily integrated
into a D project? A sort of "exec()". Something that
works at compile time and
On 2016-01-04 18:40:03 +, Jason Jeffory said:
We have many scripting engines available for use in D more or less(lua,
python, etc...).
Is there a D scripting engine that can be easily integrated into a D
project? A sort of "exec()". Something that works at compile
time and run time
On Monday, 4 January 2016 at 19:25:18 UTC, yawniek wrote:
On Monday, 4 January 2016 at 19:04:48 UTC, Max Klyga wrote:
On 2016-01-04 18:40:03 +, Jason Jeffory said:
The fastest one would probably be Lua -
http://code.dlang.org/search?q=lua
But there are other options:
Python -
I was writing an example to show that not every 'long' value can be
represented by a 'double'. (They are both 64 bits; but for 'double',
some of those bits are parts of the exponent, not the mantissa.)
Although my demonstration works with to!double, the compiler does
something different and
On 01/04/2016 12:22 AM, Ali Çehreli wrote:
> assert(l != l.to!double); // passes
> assert(l != cast(double)l);// FAILS
I've realized that I had the -m32 switch on unintentionally. The above
results are for when -m32 is used. (I am on a 64-bit system.)
Without -m32 both
On Monday, January 04, 2016 07:30:50 aki via Digitalmars-d-learn wrote:
> But wait, how does GC detect there still be a live reference to
> the object Foo?
> Because store is just a fix sized array of bytes.
> ubyte[size] store;
> GC cannot be aware of the reference, right?
As I understand it,
Sorry, the actual code is:
...
lines ~= ' '.repeat.take(newIndentCount).array;
...with character quotes. But it still fails with error described
in stack trace in Gcx.bigAlloc()
On Monday, 4 January 2016 at 10:50:17 UTC, Ur@nuz wrote:
Sorry, the actual code is:
...
lines ~= ' '.repeat.take(newIndentCount).array;
...with character quotes. But it still fails with error
described in stack trace in Gcx.bigAlloc()
What's your OS? On Linux x64, it works without any
Need some help)...
Having the following chunk of code:
string[] lines;
...
if( firstIndentStyle == IndentStyle.space )
{
lines ~= " ".repeat.take(newIndentCount).array;
}
else //Tabs
{
lines ~= "\t".repeat.take(newIndentCount).array; //This causes
strange 'memset' error
}
This code
On Sunday, 3 January 2016 at 17:30:15 UTC, Dibyendu Majumdar
wrote:
Does CMake recognise D in the enable_language command?
If not is there a workaround?
Thanks and Regards
Dibyendu
I suggest use dub instead of cmake. I did a try to use cmake some
time ago (a few years ago, before dub), and
On Monday, 4 January 2016 at 23:15:22 UTC, Guillaume Piolat wrote:
Can someone produce a _useful_ free function that uses inout?
There are useful getters using inout.
There are useless free functions using inout like
http://dpaste.dzfl.pl/d038012308ed
Adam D. Ruppe answered this on IRC:
On 01/04/2016 09:13 PM, TheDGuy wrote:
On Monday, 4 January 2016 at 19:27:48 UTC, Mike Wey wrote:
I think you are looking for something like this.
Context.getTarget will get you the surface the Context is drawing to,
this most likely isn't a ImageSurface.
So you will need to create an pixbuf
On 01/04/2016 06:31 AM, TheDGuy wrote:
> I tried it with "std.concurrency" like this:
>
> bool drawCallback(Scoped!Context cr, Widget widget){
> writeln("init");
> spawn(, cr, widget);
The first parameter to render() is Scoped!Context but render() takes a
Context:
> void
Can someone produce a _useful_ free function that uses inout?
There are useful getters using inout.
There are useless free functions using inout like
http://dpaste.dzfl.pl/d038012308ed
On Monday, 4 January 2016 at 21:42:16 UTC, Mike Wey wrote:
On 01/04/2016 09:13 PM, TheDGuy wrote:
[...]
I don't have any issues with either getPixelsWithLength and
savev.
for the savev call there is an missing \ just before test.jpg,
but that might be a copy and paste error?
For the
On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote:
On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote:
On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B.
wrote:
On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote:
Hello,
is there any way to get the pixel color
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
}
and I expected the logs to be seen in the
On Tuesday, 5 January 2016 at 02:59:04 UTC, sanjayss wrote:
On Tuesday, 5 January 2016 at 02:49:01 UTC, Mike wrote:
[...]
Thanks, that works. But the docs are confusing -- it gives the
impression that "sharedLog" is something associated with the
default logger -- so I would expect the above
On Tuesday, 5 January 2016 at 02:49:01 UTC, Mike wrote:
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
}
and I expected the logs to be seen in the logfile.log, but it
seems like my reading of the docs on this is
Hello,
I'm working on an event system, and I want to be able to check if
an event is a subclass of another event. How might I go about
this? In essence, I'm looking to compress this:
static if (E == UserInputEvent || E == MouseEvent || E ==
MouseButtonEvent || E == MouseReleasedEvent)
{
On 05/01/16 5:50 PM, Straivers wrote:
On Tuesday, 5 January 2016 at 04:41:45 UTC, Rikki Cattermole wrote:
On 05/01/16 5:37 PM, Straivers wrote:
Hello,
I'm working on an event system, and I want to be able to check if an
event is a subclass of another event. How might I go about this? In
On Tuesday, 5 January 2016 at 04:41:45 UTC, Rikki Cattermole
wrote:
On 05/01/16 5:37 PM, Straivers wrote:
Hello,
I'm working on an event system, and I want to be able to check
if an
event is a subclass of another event. How might I go about
this? In
essence, I'm looking to compress this:
On 05/01/16 5:37 PM, Straivers wrote:
Hello,
I'm working on an event system, and I want to be able to check if an
event is a subclass of another event. How might I go about this? In
essence, I'm looking to compress this:
static if (E == UserInputEvent || E == MouseEvent || E ==
On Monday, 4 January 2016 at 12:00:32 UTC, tcak wrote:
On Monday, 4 January 2016 at 10:50:17 UTC, Ur@nuz wrote:
Sorry, the actual code is:
...
lines ~= ' '.repeat.take(newIndentCount).array;
...with character quotes. But it still fails with error
described in stack trace in Gcx.bigAlloc()
On Mon, 2016-01-04 at 08:28 +, Luis via Digitalmars-d-learn wrote:
>
> I suggest use dub instead of cmake. I did a try to use cmake some
> time ago (a few years ago, before dub), and was a nightmare to
> get ir working on GNU/Linux and Windows. With dub , simply works
> fine with a simple
On Monday, 4 January 2016 at 12:20:09 UTC, Ur@nuz wrote:
On Monday, 4 January 2016 at 12:00:32 UTC, tcak wrote:
On Monday, 4 January 2016 at 10:50:17 UTC, Ur@nuz wrote:
Sorry, the actual code is:
...
lines ~= ' '.repeat.take(newIndentCount).array;
...with character quotes. But it still fails
On 02.01.2016 18:41, alkololl wrote:
On Saturday, 2 January 2016 at 16:42:46 UTC, Rainer Schuetze wrote:
On 02.01.2016 16:34, alkololl wrote:
On Saturday, 2 January 2016 at 01:44:46 UTC, Adam D. Ruppe wrote:
[...]
Thanks for your reply. I replaced my switch statement with the one
behind
On Monday, 4 January 2016 at 08:28:03 UTC, Luis wrote:
I suggest use dub instead of cmake. I did a try to use cmake
some time ago (a few years ago, before dub), and was a
nightmare to get ir working on GNU/Linux and Windows. With dub
, simply works fine with a simple json file.
CMake has
On Monday, 4 January 2016 at 12:40:23 UTC, Dibyendu Majumdar
wrote:
Thanks for suggesting dub, will check it out. Also premake
seems to support D so that is another option.
Another alternative is reggae which supports mixed code base:
https://github.com/atilaneves/reggae and can generate
When I was writing a small speed test - D versus Ruby,
calculating the first n prime numbers, I realized, that for small
n
Ruby may be faster, than compiling and executing with D.
But for n = 1,000,000 D outperforms Ruby by app. 10x.
Looking at the size of my prime executable, it was around
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
When I was writing a small speed test - D versus Ruby,
calculating the first n prime numbers, I realized, that for
small n
Ruby may be faster, than compiling and executing with D.
But for n = 1,000,000 D outperforms Ruby by
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
When I was writing a small speed test - D versus Ruby,
calculating the first n prime numbers, I realized, that for
small n
Ruby may be faster, than compiling and executing with D.
But for n = 1,000,000 D outperforms Ruby by
On 04.01.2016 09:22, Ali Çehreli wrote:
void main() {
const l = long.max;
assert(l != l.to!double); // passes
assert(l != cast(double)l);// FAILS
}
Is there a good explanation for this difference? I would expect both
expressions to be compiled the same way. (I am aware
Thank you, Jonathan. Now I understand.
On Monday, 4 January 2016 at 17:34:47 UTC, Kapps wrote:
union
{
ubyte[size] store;
// conservatively mark the region as pointers
static if (size >= (void*).sizeof)
void*[size / (void*).sizeof] p;
}
Interesting to know the way to make
On 05.01.2016 01:39, Dan Olson wrote:
I haven't played with any of the new GC configuration options introduced
in 2.067, but now need to. An application on watchOS currently has
about 30 MB of RAM. Is there any more documentation than the web page
https://dlang.org/spec/garbage.html or
On Monday, 4 January 2016 at 14:54:29 UTC, ric maicle wrote:
0U .. 4_294_967_296U
in the table Decimal Literal Types has a typo. Shouldn't the
range
end with 4_294_967_295U?
The x .. y syntax excludes y. So 0..3 covers 0, 1, 2. It excludes
3.
On 1/3/16 2:25 PM, Jacob Carlborg wrote:
On 2016-01-03 18:48, Steven Schveighoffer wrote:
class constructor requirements are much different from struct
constructor requirements. There's also no implicit constructor that
initializes all members as there is for structs.
To clarify, there's a
Hello,
i use GTKD to draw some stuff on a DrawingArea. Because it needs
some time to calculate i want to outsource those calculation so
that the GUI doesn't freeze.
I tried it with "std.concurrency" like this:
bool drawCallback(Scoped!Context cr, Widget widget){
writeln("init");
I was rereading the Integer Literals section and trying out some code
when I came across a couple of error messages on integer overflows.
I have reproduced the code below for reference.
void main()
{
// The maximum long value is ...807
// The following line produces an error message:
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
When I was writing a small speed test - D versus Ruby
The smallest possible ruby program has about ~5 MB of
dependencies, outside the operating system (the ruby runtime
itself).
The D program has none. It carries its
On Monday, 4 January 2016 at 14:31:04 UTC, TheDGuy wrote:
Hello,
i use GTKD to draw some stuff on a DrawingArea. Because it
needs some time to calculate i want to outsource those
calculation so that the GUI doesn't freeze.
I tried it with "std.concurrency" like this:
bool
On Monday, 04 January, 2016 10:58 PM, Adam D. Ruppe wrote:
On Monday, 4 January 2016 at 14:54:29 UTC, ric maicle wrote:
0U .. 4_294_967_296U
in the table Decimal Literal Types has a typo. Shouldn't the range
end with 4_294_967_295U?
The x .. y syntax excludes y. So 0..3 covers 0, 1, 2. It
On 1/4/16 10:33 AM, ric maicle wrote:
On Monday, 04 January, 2016 10:58 PM, Adam D. Ruppe wrote:
On Monday, 4 January 2016 at 14:54:29 UTC, ric maicle wrote:
0U .. 4_294_967_296U
in the table Decimal Literal Types has a typo. Shouldn't the range
end with 4_294_967_295U?
The x .. y syntax
On Monday, 4 January 2016 at 15:28:56 UTC, TheDGuy wrote:
On Monday, 4 January 2016 at 15:07:12 UTC, Luis wrote:
On Monday, 4 January 2016 at 14:31:04 UTC, TheDGuy wrote:
[...]
Before doing anything with threads and GTK, you should read
this :
On Monday, 4 January 2016 at 15:07:12 UTC, Luis wrote:
On Monday, 4 January 2016 at 14:31:04 UTC, TheDGuy wrote:
[...]
Before doing anything with threads and GTK, you should read
this :
http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/gtk-thread-awareness
Okay, so i
I wrote a demo for GtkD showing how multi-threading and D work
together, it's in the demos/gtkD/DemoMultithread folder of
GtkD, hopefully it will be helpful. However this example it is
based on using the GTk threadIdle callback which is generally
preferred over the locking methods you show
On Monday, 4 January 2016 at 14:51:59 UTC, Adam D. Ruppe wrote:
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
When I was writing a small speed test - D versus Ruby
The smallest possible ruby program has about ~5 MB of
dependencies, outside the operating system (the
On Monday, 4 January 2016 at 14:01:18 UTC, Basile B. wrote:
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
[...]
- if debug info are generated this increases the size.
- if bounds checking is turned off there is some code generated
for each array operation
- if
On Monday, 4 January 2016 at 17:33:28 UTC, Gerald wrote:
On Monday, 4 January 2016 at 16:13:50 UTC, TheDGuy wrote:
[...]
Yes, you need it. The extern (C) function is what GDK invokes
on idle. In any GUI application there is a lot of idle time
waiting for events, what the addThreadIdle
On Monday, 4 January 2016 at 16:13:50 UTC, TheDGuy wrote:
Thanks for your example code. Do i need those extern (C)
function?
Yes, you need it. The extern (C) function is what GDK invokes on
idle. In any GUI application there is a lot of idle time waiting
for events, what the addThreadIdle
On Monday, 4 January 2016 at 09:13:25 UTC, Jonathan M Davis wrote:
On Monday, January 04, 2016 07:30:50 aki via
Digitalmars-d-learn wrote:
But wait, how does GC detect there still be a live reference to
the object Foo?
Because store is just a fix sized array of bytes.
ubyte[size] store;
GC
On Monday, 4 January 2016 at 14:25:30 UTC, Marc Schütz wrote:
On Monday, 4 January 2016 at 12:20:09 UTC, Ur@nuz wrote:
On Monday, 4 January 2016 at 12:00:32 UTC, tcak wrote:
[...]
Yes. It's Ubuntu 14. It works when it's in the separate
example, but not working inside my project. The strange
On Monday, 4 January 2016 at 14:16:54 UTC, Marc Schütz wrote:
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke
wrote:
When I was writing a small speed test - D versus Ruby,
calculating the first n prime numbers, I realized, that for
small n
Ruby may be faster, than compiling and
On Monday, 4 January 2016 at 16:56:15 UTC, Martin Tschierschke
with the "same" Ubuntu release, I got an error, may be its 32
not 64 Bit?
Any hint?
Yeah, probably.
60 matches
Mail list logo