On Monday, 17 December 2012 at 04:40:39 UTC, Mike Parker wrote:
First, please take all Derelict trouble-shooting problems to
the Derelict forums[1].
I'm posting here because I was unable to register with the
derelict forum.
I filled out the registration form and press the register button,
t
Thank you very much for doing the hard work on this. I find this kind of
information very important.
On 12/17/2012 12:46 PM, Dan wrote:
> Assume V is a non-template parameter type and v is a parameter of that
> type for any function. Also assume T is a template parameter type and t
> is a parame
Greetings!
I have this program that zips a file and everything works perfectly, if the
files are small enough. But, I am having to zip files that are getting more
and more extreme in size and I am running out of memory. Here is the output
when executing a small program to zip a folder:
0:
Greetings!
I have this program that zips a file and everything works
perfectly, if the
files are small enough. But, I am having to zip files that are
getting more
and more extreme in size and I am running out of memory. Here is
the output
when executing a small program to zip a folder:
0:
On Tuesday, 18 December 2012 at 01:24:43 UTC, Mike Parker wrote:
No, that's a bad idea. What if the C library you are using
maintains some sort of internal bookkeeping related to the
pointer? What if it keeps a copy of the pointer internally? If
the GC collects your D-side pointer, how is the
On Monday, 17 December 2012 at 22:47:33 UTC, bearophile wrote:
maarten van damme:
How do I make dmd output asm?
You can't, unfortunately. They closed this enhancement request
of mine because they say DMD is not designed for this.
On Linux there are several disassemblers, I use objdump. On
On Monday, 17 December 2012 at 22:08:08 UTC, Jeremy DeHaan wrote:
It's not the only way, but it's the easiest way.
What are some other ways? I am just curious.
You could use module destructors to cleanup at program exit and
use RAII via struct destructors for short-lived objects.
Also,
On Tuesday, 18 December 2012 at 00:59:12 UTC, Jeremy DeHaan wrote:
How/Where would I call this?
Right at the beginning of your main, but after trying it, I don't
think this is going to fix your problem anyway... I think it is
fonts. But:
import std.stdio;
extern(Windows) int SetConsoleOutp
@Adam D. Ruppe
I suggest you use string instead of dstring, because utf-8
(string) has better output support than utf-32 (dstring), and
both support the complete unicode character set.
Tried string and wstring. Both had the same results as my dstring.
On Windows, the api call SetConsoleOutpu
On Tue, Dec 18, 2012 at 01:29:55AM +0100, Jeremy DeHaan wrote:
> I was playing with unicode strings the other day, and have been
> searching for a way to correctly write unicode to the console.
>
> If I try something like:
>
> dstring String = "さいごの果実";
>
> writeln(String);
>
> Al
Jeremy DeHaan:
Is it possible to write the unicode string to the console
correctly?
What is your operating system?
On oldish Windows you have to set the console to Unicode or
nearly Unicode. I don't know about Windows7/8.
Bye,
bearophile
I suggest you use string instead of dstring, because utf-8
(string) has better output support than utf-32 (dstring), and
both support the complete unicode character set.
If string doesn't work, the question is: Windows or Linux?
On Windows, the api call SetConsoleOutputCP will help
http://msd
I was playing with unicode strings the other day, and have been
searching for a way to correctly write unicode to the console.
If I try something like:
dstring String = "さいごの果実";
writeln(String);
All I get is a bunch of nonsense as if it converts the dstring
into a regular st
Okay, thanks for the help folks.
On 12/18/2012 04:42 AM, js.mdnq wrote:
In any case, it seems your method does not work with methods? if I add
the `check()` to your approach-2 it fails with several strange errors.
Any ideas?
approach-2 can only combine struct fields (i.e., no method support - for
that you have to use approac
On Monday, 17 December 2012 at 15:46:22 UTC, anonymous wrote:
On Monday, 17 December 2012 at 15:10:24 UTC, js.mdnq wrote:
This i probably a rather dumb question but I've been up all
night and therefor have a really good excuse ;) (I can barely
see straight...)
Is opGet the reverse opAssign?
On Monday, 17 December 2012 at 22:24:58 UTC, r_m_r wrote:
On 12/17/2012 04:33 AM, js.mdnq wrote:
Well, it a slightly another way and close. Let me see if I can
come up
with something that expresses better what I'm after. It will
be a week
or two though till I get around to it probably.
OK. I
On 12/17/2012 02:47 PM, bearophile wrote:
maarten van damme:
How do I make dmd output asm?
You can't, unfortunately. They closed this enhancement request of mine
because they say DMD is not designed for this.
On Linux there are several disassemblers, I use objdump. On Windows
there are other
maarten van damme:
How do I make dmd output asm?
You can't, unfortunately. They closed this enhancement request of
mine because they say DMD is not designed for this.
On Linux there are several disassemblers, I use objdump. On
Windows there are other ones.
Bye,
bearophile
How do I make dmd output asm?
I wrote a simple test and for a simple int[] array it was 2,5 times slower.
2012/12/17 bearophile :
> maarten van damme:
>
>
>> it's odd that the resulting arraylist is slower to access at runtime
>> then the arraylist generated at runtime... Is there a reason for th
On 12/17/2012 04:33 AM, js.mdnq wrote:
Well, it a slightly another way and close. Let me see if I can come up
with something that expresses better what I'm after. It will be a week
or two though till I get around to it probably.
OK. I'll just leave this here for future reference:
http://dpaste.
It's not the only way, but it's the easiest way.
What are some other ways? I am just curious.
Also, if we were able to know the size of the object the pointer
is referring to, couldn't we then add it to the GC? It sounds
like a pretty complicated way, but wouldn't that be a good way if
it w
On Monday, 17 December 2012 at 21:12:16 UTC, bearophile wrote:
Are in, out, scope, std.typecons.Nullable,
std.typecons.Rebindable missing in your table?
Bye,
bearophile
Not at all - I cringe at the thought of dealing with those as
well now. But if you want to give them a go as well I'd be gl
On Monday, December 17, 2012 06:21:38 PM Dan wrote:
> For the code below, S is never copied even though a version of
> the function resolving to void x.foo!(x.S).foo(x.S) is called.
> How is this possible?
> Is it an optimization? I figure if I call a function that takes
> its parameter by value, t
maarten van damme:
it's odd that the resulting arraylist is slower to access at
runtime
then the arraylist generated at runtime... Is there a reason
for this?
In such cases, beside thinking some time about the topic, one
solution is to take a look at the asm.
Maybe it's the same problem as
On Monday, 17 December 2012 at 20:46:27 UTC, Dan wrote:
Sorry, here is the table more legible:
http://pastebin.com/0bFSL0Xz
Assume V is a non-template parameter type and v is a parameter of
that type for any function. Also assume T is a template parameter
type and t is a parameter of that type for any function. Is the
following table and set of guidelines below reasonable? What
other guidelines do you use or would m
Thanks, I'm really happy it works now.
it's odd that the resulting arraylist is slower to access at runtime
then the arraylist generated at runtime... Is there a reason for this?
Should I open bugreports for your testcases?
2012/12/17 bearophile :
>> I think it's a problem of nested delegates at
HGLOBAL data = GetClipboardData(CF_TEXT);
Oops, should be CF_UNICODETEXT (13)
On Monday, 17 December 2012 at 16:21:09 UTC, monarch_dodra wrote:
I'm a bit confused about how to interface with windows.h.
All I'm trying to do is retrieve some text from my clipboard to
print it.
Something like this:
HWND hwnd = ... // your window handle (or null)
if (OpenClipboard(hwnd))
On 12/17/12, Dan wrote:
> Is it an optimization?
I think it is. You can get rid of auto ref and you'll see it still
doesn't copy for the second case, e.g. change signature to:
void foo(S t);
And only this call copies:
foo(s);
This one doesn't copy:
foo(S(['x', 'y', 'z']));
The optimization ma
For the code below, S is never copied even though a version of
the function resolving to void x.foo!(x.S).foo(x.S) is called.
How is this possible?
Is it an optimization? I figure if I call a function that takes
its parameter by value, there should be a copy.
Thanks
Dan
--- Output
On 12/17/12, monarch_dodra wrote:
> Am I doing it wrong, or are is the amount of ported windows
> interface currently limited...
std.c.windows.windows is a very thin layer around the API. There are
better bindings here:
http://dsource.org/projects/bindings/wiki/WindowsApi
> Kinda lost here (The
I'm a bit confused about how to interface with windows.h.
All I'm trying to do is retrieve some text from my clipboard to
print it.
So far, I have this:
//
import std.stdio;
import core.sys.windows.windows;
extern (Windows)
{
HWND GetClipboardOwner();
BOOL OpenClipboard(HWND hWn
On Monday, 17 December 2012 at 15:10:24 UTC, js.mdnq wrote:
This i probably a rather dumb question but I've been up all
night and therefor have a really good excuse ;) (I can barely
see straight...)
Is opGet the reverse opAssign? I can't find any docs on it but
it does let me write converter
This i probably a rather dumb question but I've been up all night
and therefor have a really good excuse ;) (I can barely see
straight...)
Is opGet the reverse opAssign? I can't find any docs on it but it
does let me write converters from my type to another type.
e.g.,
struct X { int value
I think it's a problem of nested delegates at CT. But if this
is the problem, dmd used to give a more clear error message.
Two minimized programs that show the problems:
-
import std.algorithm: filter;
import std.array: array;
auto foo(in int x) {
return [1, 2].filter!(i => x)(
On Monday, 17 December 2012 at 07:54:08 UTC, F i L wrote:
I have an alternative in mind, but first, is there a possible
way for a Super class to ask about a derivative's members
during constructions? (I'm guessing not). Something like:
Not that I know of, no. Though maybe a templated construct
maarten van damme:
Here is a trimmed down version : http://dpaste.dzfl.pl/11170641
thanks for the quick reply.
It seems to work if you move ".array()" from
generateBitsetCache() to bitsetToRange(). I think it's a problem
of nested delegates at CT. But if this is the problem, dmd used
to gi
On Monday, 17 December 2012 at 14:06:30 UTC, Mike Parker wrote:
Now what i was thinking as a solution, would it be possible to
manually run the GC cleanup pass at the end of main this way
we know that the GC cleanup would run before main exits and
thus sfml gets unloaded. Although i believe thi
On Monday, 17 December 2012 at 12:08:29 UTC, Nekroze wrote:
Structs have their destructors called, as far as i understand,
as soon as you go out of the scope they are defined in. Not
sure how that works with structs that are members of a class
but i assume that has the same problems as a clas
On Monday, 17 December 2012 at 10:39:56 UTC, Jeremy DeHaan wrote:
I tried putting destroy in the destructor like the code I
wrote. Like I said, it gave me no memory errors, but I don't
actually know if it even does anything. I honestly think that
it is weird to not be able to rely on destruct
maarten van damme:
I always get "variable x cannot be read at compile time" in
this method :
auto bitsetToRange(in SudokuCell x) {
return boardSide.iota().filter!(i => (x >> i) &
1)().map!(x=>x+1)();
}
with SudokuCell beeing declared as:
alias ushort SudokuCell;
Why don't you show us
On Monday, 17 December 2012 at 12:08:29 UTC, Nekroze wrote:
Now what i was thinking as a solution, would it be possible to
manually run the GC cleanup pass at the end of main this way we
know that the GC cleanup would run before main exits and thus
sfml gets unloaded. Although i believe this st
On Monday, 17 December 2012 at 10:56:23 UTC, Jeremy DeHaan wrote:
Does that mean that putting some form of delete in a struct
destructor will be called to delete contents or is that still
considered unsafe?
And why don't classes have the same guarantee? Is it because
they are a reference typ
On Monday, 17 December 2012 at 09:42:50 UTC, maarten van damme
wrote:
I finally got around trying to finish my sudoksolver and I'm
pretty
happy with the result, except one little piece that screams for
ctfe
but I never seem to get it working.
I always get "variable x cannot be read at compile t
On Monday, 17 December 2012 at 09:52:08 UTC, Jacob Carlborg wrote:
On 2012-12-17 09:23, Jeremy DeHaan wrote:
And how does calling destroy/delete in a struct destructor
differ from
doing the same in a class destructor? I too would like to make
sure I am
not getting any memory leaks!
Because
Thanks for all the info, Mike. I come from a C# background, so I
have pretty much 0 experience when it comes to handling memory
myself(let alone working with a binding to another language) and
I haven't read my D book as much as I would like.
I'm not quite sure what you are referring to when y
On 2012-12-17 09:23, Jeremy DeHaan wrote:
And how does calling destroy/delete in a struct destructor differ from
doing the same in a class destructor? I too would like to make sure I am
not getting any memory leaks!
Because there are guarantees how and when a destructor for a struct is
called
I finally got around trying to finish my sudoksolver and I'm pretty
happy with the result, except one little piece that screams for ctfe
but I never seem to get it working.
I always get "variable x cannot be read at compile time" in this method :
auto bitsetToRange(in SudokuCell x) {
return bo
On 2012-12-17 08:54, F i L wrote:
@Adam D. Ruppe
Damn, I was afraid you where going to say to do something like that. It
doesn't really work for what I'm thinking about, but thanks for
confirming that my original code can't work.
I have an alternative in mind, but first, is there a possible way
On Monday, 17 December 2012 at 08:23:02 UTC, Jeremy DeHaan wrote:
I am somewhat confused by some things that are being talked
about in this thread.
Mike Parker said that this Image is handled by GC. Would that
mean that any class members are handled by the GC too? If so,
wouldn't the sfImage*
I am somewhat confused by some things that are being talked about
in this thread.
Mike Parker said that this Image is handled by GC. Would that
mean that any class members are handled by the GC too? If so,
wouldn't the sfImage* be collected by the GC?
If not, and you DO need to manually dele
53 matches
Mail list logo