Here is what I came up with
import gdkpixbuf.Pixbuf;
GdkPixbuf*[string] __ImageCache;
void SetImage(string imgName)(gtk.Image T)
{
import std.path, std.conv, gdkpixbuf.Pixbuf;
GError* err = null;
if (imgName !in __ImageCache)
{
GdkPixbufLoader*
On Saturday, 12 August 2017 at 01:16:35 UTC, HyperParrow wrote:
On Friday, 11 August 2017 at 22:21:53 UTC, Mr. Pib wrote:
[...]
Try a serialization library or inifiled. Some may even use a DB
with ORM for this.
https://code.dlang.org/packages/inifiled
On Friday, 11 August 2017 at 22:21:53 UTC, Mr. Pib wrote:
Does D have a persistent storage somewhere? I'd like something
easy to use that allows me to load and save settings to disk in
between executions of the program. I want to specify the
variable to be saved or loaded and a default value.
On Friday, 11 August 2017 at 21:58:20 UTC, Johnson wrote:
Just a thought, maybe the GC isn't cleaning up quick enough?
You are allocating and md5 digest each iteration.
Possibly, an opitimization is use use a collection of md5
hashes and reuse them. e.g., pre-allocate 100(you probably only
On Fri, Aug 11, 2017 at 11:34:04PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote:
> > int and I should be able to append an int without having to worry
> > about the value of the int.
>
> Appending an int to a string really ought
On Friday, 11 August 2017 at 23:34:04 UTC, Adam D. Ruppe wrote:
On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote:
int and I should be able to append an int without having to
worry about the value of the int.
Appending an int to a string really ought to just be a type
mismatch error.
On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote:
int and I should be able to append an int without having to
worry about the value of the int.
Appending an int to a string really ought to just be a type
mismatch error.
We might be able to convince the leadership to do that too,
On Friday, 11 August 2017 at 22:50:53 UTC, ketmar wrote:
Mr. Pib wrote:
Wow, that is pretty screwed up! I thought D was against
implicit conversions that might cause problems? I'm passing
an int and I should be able to append an int without having to
worry about the value of the int.
Mr. Pib wrote:
Wow, that is pretty screwed up! I thought D was against implicit
conversions that might cause problems? I'm passing an int and I should
be able to append an int without having to worry about the value of the
int. Instead D chose to do something very strange, awkward, and error
On Friday, 11 August 2017 at 04:17:32 UTC, ketmar wrote:
Mr. Pib wrote:
string Q(alias T, alias D)()
{
pragma(msg, T);
pragma(msg, D);
enum x = T~" = "~D~";";
pragma(msg, x);
}
mixin(Q!(`x`, 100)());
outputs, at compile time,
x
100
x = d;
there is no
Does D have a persistent storage somewhere? I'd like something
easy to use that allows me to load and save settings to disk in
between executions of the program. I want to specify the variable
to be saved or loaded and a default value.
e.g.,
Persist_Load(Some_variable, 100);
will load
On Friday, 11 August 2017 at 21:33:51 UTC, Arun Chandrasekaran
wrote:
I've modified the sample from tour.dlang.org to calculate the
md5 digest of the files in a directory using std.parallelism.
When I run this on a dir with huge number of files, I get:
On Friday, 11 August 2017 at 21:33:51 UTC, Arun Chandrasekaran
wrote:
I've modified the sample from tour.dlang.org to calculate the
[...]
RHEL 7.2 64 bit
dmd v2.075.0
ldc 1.1.0
I've modified the sample from tour.dlang.org to calculate the md5
digest of the files in a directory using std.parallelism.
When I run this on a dir with huge number of files, I get:
core.exception.OutOfMemoryError@src/core/exception.d(696): Memory
allocation failed
Since dirEntries returns
How to make http requests to unix socket? For example, in Docker
engine api,
curl --unix-socket /var/run/docker.sock
http:/v1.24/containers/json
On Friday, 11 August 2017 at 17:20:18 UTC, HyperParrow wrote:
[...]
I made a mistake but it's not about i, which is a global.
I meant "other.__dtor." just before the last assert.
This doesn't change the results.
hmm...indeed ;)
On Friday, 11 August 2017 at 17:24:17 UTC, HyperParrow wrote:
On Friday, 11 August 2017 at 17:10:14 UTC, bitwise wrote:
On Friday, 11 August 2017 at 17:02:20 UTC, HyperParrow wrote:
On Friday, 11 August 2017 at 16:53:02 UTC, bitwise wrote:
What do they do?
What's the difference?
Thanks
__xdtor() also calls the __dtor() that are mixed with template
On Friday, 11 August 2017 at 17:12:22 UTC, bitwise wrote:
On Friday, 11 August 2017 at 17:06:40 UTC, HyperParrow wrote:
[...]
int i;
struct Foo
{
template ToMix(){ ~this(){i;}}
~this(){++i;}
mixin ToMix;
}
void main()
{
Foo* foo = new Foo;
foo.__xdtor;
assert(i==3);
On Friday, 11 August 2017 at 17:06:40 UTC, HyperParrow wrote:
[...]
int i;
struct Foo
{
template ToMix(){ ~this(){i;}}
~this(){++i;}
mixin ToMix;
}
void main()
{
Foo* foo = new Foo;
foo.__xdtor;
assert(i==3);
Foo* other = new Foo;
foo.__dtor;
On Friday, 11 August 2017 at 17:02:20 UTC, HyperParrow wrote:
On Friday, 11 August 2017 at 16:53:02 UTC, bitwise wrote:
What do they do?
What's the difference?
Thanks
__xdtor() also calls the __dtor() that are mixed with template
mixins while __dtor() only call the __dtor() that matches to
On Friday, 11 August 2017 at 17:02:20 UTC, HyperParrow wrote:
On Friday, 11 August 2017 at 16:53:02 UTC, bitwise wrote:
What do they do?
What's the difference?
Thanks
__xdtor() also calls the __dtor() that are mixed with template
mixins while __dtor() only call the __dtor() that matches to
On Friday, 11 August 2017 at 16:53:02 UTC, bitwise wrote:
What do they do?
What's the difference?
Thanks
__xdtor() also calls the __dtor() that are mixed with template
mixins while __dtor() only call the __dtor() that matches to the
normal ~this(){}
What do they do?
What's the difference?
Thanks
On Friday, 11 August 2017 at 08:17:32 UTC, Vadim Lopatin wrote:
I'm using DCD as a library in DlangIDE.
All DCD calls are made from separate thread.
DCD works ok until some thread is created (e.g. to invoke DUB
for building).
/// call this function after DCD ModuleCache is instantiated to
On Thursday, 10 August 2017 at 19:10:05 UTC, Jiyan wrote:
Hey,
wanted to the following simple thing with vectorflow:
...
You'll want to end your stack with your wanted output size (1 -
being the sum).
Training it with the "square" function seems to give the best
result for simple additions.
On Thursday, 10 August 2017 at 19:10:05 UTC, Jiyan wrote:
Hey,
wanted to the following simple thing with vectorflow:
[...]
I'm worried there might not be many on the forums who can help
too much with vectorflow given how new it is. Maybe some in the
community are more familiar with neural
On Friday, 11 August 2017 at 04:50:48 UTC, rikki cattermole wrote:
On 11/08/2017 12:18 AM, David Zhang wrote:
I've been working on getting OpenGL to load on windows without
a library, and encountered something curious;
Context creation fails when I try to use the function pointer
retrieved
I'm using DCD as a library in DlangIDE.
All DCD calls are made from separate thread.
DCD works ok until some thread is created (e.g. to invoke DUB for
building).
After this operation DCD stops working correctly and can locate
symbols only from current source file.
Root cause:
If some another
On Friday, 11 August 2017 at 02:25:51 UTC, Mike Parker wrote:
On Thursday, 10 August 2017 at 23:38:42 UTC, Jiyan wrote:
[...]
Sounds like you used the script from the download page that
installs the compiler per user. It's designed to allow you to
have multiple versions installed in your
On Thursday, 10 August 2017 at 14:59:52 UTC, Adam D. Ruppe wrote:
On Thursday, 10 August 2017 at 14:55:06 UTC, Mike Wey wrote:
[...]
Oh, I see. My generator lists them on the index, but doesn't
recreate it each time, it just links. For example:
30 matches
Mail list logo