Re: Basically want to make a macro script

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 04:56:39 + Casey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: D has nothing to do with your task, WinAPI does. and you'll need alot of expirience in reverse engineering, 'cause f... punkbuster shits it's pants almost for anything. it's a rootkit, and

Easy way to monitor gc activity?

2014-11-12 Thread Tofu Ninja via Digitalmars-d-learn
Basicly what the title said. What is an easy way to monitor gc activity? I am finding it hard to know when and where the gc is running and how much. Preferably I would like a way to do it in app so I can make adjustments based on gc load. Also I would prefer to not have to recompile the

Re: Easy way to monitor gc activity?

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 10:43:32 UTC, Tofu Ninja wrote: What is an easy way to monitor gc activity? Here's mine: https://bitbucket.org/infognition/dstuff/src/ A little module that allows you to track all GC allocations.

Re: Russian translation of the range term?

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 11:50:18 UTC, Ivan Kazmenko wrote: Hi! I'm unsure what is the Russian equivalent for the term range, as in D range, the generalization of a pair of iterators. I think последовательность (sequence) is the most appropriate, because the defining characteristic

Re: Russian translation of the range term?

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 11:38:50 + thedeemon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: some languages like F# and Clojure use this term (often shortened to 'seq') послед. rotfl. signature.asc Description: PGP signature

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 22:31:17 UTC, Maxime Chevalier-Boisvert wrote: I've made it so they unregister themselves in their destructor. ... However, this only works if I can assume that the GC will first call the destructor on an object, then free the object, that this is done in a

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 04:06:11 UTC, Algo wrote: Could this work? class VM { static List[VM*] _gcRootLists; List* gcRootList; ~this() { _gcRootLists.remove(this); No. Hash-table operations may try to allocate or free memory which is not allowed during a GC

Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread Chris via Digitalmars-d-learn
The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because in separate thread). // Later core.stdc.stdlib.free(cast(short *)data); (short* data is provided by the C library, where the memory is allocated) On Linux it works fine and never crashes, in

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because in separate thread). // Later core.stdc.stdlib.free(cast(short *)data); (short*

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because in separate thread). // Later core.stdc.stdlib.free(cast(short *)data); (short*

Re: alias overloaded function template

2014-11-12 Thread Lemonfiend via Digitalmars-d-learn
The problem is not the alias. The error message is about using the same identifier for two different things: C:\...\temp_0186F968.d(13,1): Error: declaration foo(T)(T t, int i) is already defined. I'm not sure what is giving you that particular error. Without the alias it compiles and runs

Re: Easy way to monitor gc activity?

2014-11-12 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 11:29:01 UTC, thedeemon wrote: On Wednesday, 12 November 2014 at 10:43:32 UTC, Tofu Ninja wrote: What is an easy way to monitor gc activity? Here's mine: https://bitbucket.org/infognition/dstuff/src/ A little module that allows you to track all GC

Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
I did 2 steps from http://d-apt.sourceforge.net/ $ sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list $ sudo apt-get update sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring sudo apt-get update And now

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread Chris via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 14:11:35 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread Kagamin via Digitalmars-d-learn
With GC you usually have two destructors: one for managed resources and one for unmanaged resources. Destructor for managed resources should be run on live objects as soon as you don't need the resource, it calls unmanaged destructor too. Unmanaged destructor (finalizer) is called by GC during

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread eles via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 14:36:19 UTC, Kagamin wrote: With GC you usually have two destructors: Which is why this approach is so cumbersome. At least, in non-GC you only have just one kind of destructor.

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread Chris via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 14:11:35 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12

Re: Can't install dub on Debian

2014-11-12 Thread Andre Kostur via Digitalmars-d-learn
On 2014-11-12, 5:39 AM, Suliman wrote: I did 2 steps from http://d-apt.sourceforge.net/ [snip] The following packages have unmet dependencies: dub : Depends: dmd-bin but it is not going to be installed or dmd but it is not installable PreDepends: multiarch-support

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread Kagamin via Digitalmars-d-learn
It can work with only managed destructor - that's how it's usually done. Finalizer only guards against slow resource leak when you forget to free them.

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 14:42:38 UTC, eles wrote: Which is why this approach is so cumbersome. At least, in non-GC you only have just one kind of destructor. It's not necessarily very cumbersome. Standard library usually provides necessary integration:

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread Chris via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote: On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via if you can extend C DLL, just add wrapper for `free()` there. so you will not call `free()` from D, but call C DLL function which will free the memory. it's a good practice

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 16:03:08 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote: On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via if you can extend C DLL, just add wrapper for `free()` there.

Re: Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
root@66898:~# apt-get install multiarch-support Reading package lists... Done Building dependency tree Reading state information... Done Package multiarch-support is not available, but is referred to by another packag e. This may mean that the package is missing, has been obsoleted, or is only

Re: insertInPlace differences between compilers

2014-11-12 Thread John McFarlane via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 00:31:31 UTC, Jesse Phillips wrote: On Tuesday, 11 November 2014 at 20:53:51 UTC, John McFarlane wrote: I'm trying to write a struct template that uses `insertInPlace`. However, it doesn't work with certain template type / compiler combinations. Consider the

Re: Basically want to make a macro script

2014-11-12 Thread Israel via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: also, you came to the right place. PB is extremely paranoid and even more so about autohokey, so if you program your own native macro, its not very likely it will catch it.

Re: Basically want to make a macro script

2014-11-12 Thread Israel via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 08:02:06 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 04:56:39 + Casey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: D has nothing to do with your task, WinAPI does. and you'll need alot of expirience in reverse

Re: Russian translation of the range term?

2014-11-12 Thread Chris Williams via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 11:38:52 UTC, thedeemon wrote: On Tuesday, 11 November 2014 at 11:50:18 UTC, Ivan Kazmenko wrote: Hi! I'm unsure what is the Russian equivalent for the term range, as in D range, the generalization of a pair of iterators. I think последовательность

Re: Basically want to make a macro script

2014-11-12 Thread Casey via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 08:02:06 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 04:56:39 + Casey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: D has nothing to do with your task, WinAPI does. and you'll need alot of expirience in reverse

Re: Basically want to make a macro script

2014-11-12 Thread Casey via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote: On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: also, you came to the right place. PB is extremely paranoid and even more so about autohokey, so if you program your own native macro, its not very likely it will catch it.

Re: Russian translation of the range term?

2014-11-12 Thread Jack Applegame via Digitalmars-d-learn
интервал, область

Experience report on installing dmd 2.066.1 on OSX

2014-11-12 Thread Ali Çehreli via Digitalmars-d-learn
A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running xattr. Is that expected on OSX? Thank you, Ali

Re: Basically want to make a macro script

2014-11-12 Thread Israel via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 19:43:49 UTC, Casey wrote: On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote: On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: also, you came to the right place. PB is extremely paranoid and even more so about autohokey, so if you

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-12 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running xattr. Is that expected on OSX? Thank you, Ali Works

Re: Basically want to make a macro script

2014-11-12 Thread Casey via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 23:35:33 UTC, Israel wrote: On Wednesday, 12 November 2014 at 19:43:49 UTC, Casey wrote: On Wednesday, 12 November 2014 at 19:29:26 UTC, Israel wrote: On Wednesday, 12 November 2014 at 04:56:40 UTC, Casey wrote: also, you came to the right place. PB is

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-12 Thread Israel via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 23:44:43 UTC, John Colvin wrote: On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/12/14 5:38 PM, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running xattr. Is that expected on OSX? Huh? I just downloaded the dmg, double clicked the

Re: Basically want to make a macro script

2014-11-12 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume Ptyhon or C++ would be good choices,

Re: Basically want to make a macro script

2014-11-12 Thread Israel via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume Ptyhon or C++ would be good choices, any chance you can recommend a forum for these or something?

Re: Memory usage of dmd

2014-11-12 Thread olivier henley via Digitalmars-d-learn
All this is very interesting. Thx for the scripts, thx for pointing systemd. We need to document that stuff somewhere... more indexable.

Re: Can't install dub on Debian

2014-11-12 Thread olivier henley via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 16:19:23 UTC, Suliman wrote: root@66898:~# apt-get install multiarch-support Reading package lists... Done Building dependency tree Reading state information... Done Package multiarch-support is not available, but is referred to by another packag e. This may

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that, it seems as it might work. If D would be too hard to get working, what would you recommend? I would assume

Re: Basically want to make a macro script

2014-11-12 Thread Israel via Digitalmars-d-learn
On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that, it seems as it might work. If D would

Re: insertInPlace differences between compilers

2014-11-12 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 19:25:49 UTC, John McFarlane wrote: That makes sense. In the case that `c` is a class, do you think I'd have any luck if I made it immutable? The quick answer is that it doesn't help. DMD still doesn't like me using insertInPlace. This is a little disappointing

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 3:45 p.m., Israel wrote: On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On Wednesday, 12 November 2014 at 23:40:09 UTC, Casey wrote: I'll look into that,

Re: Basically want to make a macro script

2014-11-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 02:45:34 UTC, Israel wrote: Do you have plans for making win32 bindings for the sendkeys? I'm pretty sure it just calls this function: http://msdn.microsoft.com/en-us/library/ms646310%28v=vs.85%29.aspx with appropriate input prepared. As to listen to

Re: passing duck-typed objects and retaining full type information

2014-11-12 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote: Now what i want to do is pass some such container object to an interface function: interface MyInterface { void filterCollisions(S)(S collisionCandidates) if(canRemoveFromContainer!S) } You can't. This is one of the major

Get full class name at compile time - Not yet implemented

2014-11-12 Thread Andre via Digitalmars-d-learn
Hi, I currently have some issues to get the full class name at compile time by the variable which might point to null. With .stringof I get the class name without the module. It seems typeid(typeof()) is the solution, but DMD throws the error: source\app.d(10): Error: typeid(app.A).name is

Re: Get full class name at compile time - Not yet implemented

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 6:22 p.m., Andre wrote: Hi, I currently have some issues to get the full class name at compile time by the variable which might point to null. With .stringof I get the class name without the module. It seems typeid(typeof()) is the solution, but DMD throws the error:

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-12 Thread Joakim via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running xattr. Is that expected on OSX? Looks like they're now

Re: Get full class name at compile time - Not yet implemented

2014-11-12 Thread Andre via Digitalmars-d-learn
perfekt, thanks a lot. Kind regards André On Thursday, 13 November 2014 at 05:37:26 UTC, Rikki Cattermole wrote: On 13/11/2014 6:22 p.m., Andre wrote: http://dlang.org/phobos/std_traits.html#fullyQualifiedName

Re: Basically want to make a macro script

2014-11-12 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 02:58:02 UTC, Rikki Cattermole wrote: On 13/11/2014 3:45 p.m., Israel wrote: On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at 01:35:28 UTC, Israel wrote: On

Re: Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
If you haven't found the problem yet, please post: 1. what is the architecture of your machine? $ lscpu 2. what is the debian version? $ lsb_release -a root@66898:~# lscpu Architecture: x86_64 CPU op-mode(s):32-bit, 64-bit CPU(s):4 Vendor ID:

Re: Basically want to make a macro script

2014-11-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/11/2014 7:18 p.m., Casey wrote: On Thursday, 13 November 2014 at 02:58:02 UTC, Rikki Cattermole wrote: On 13/11/2014 3:45 p.m., Israel wrote: On Thursday, 13 November 2014 at 02:00:11 UTC, Rikki Cattermole wrote: On 13/11/2014 2:37 p.m., Casey wrote: On Thursday, 13 November 2014 at