Re: Deimos (How to port a header)

2013-01-31 Thread Jacob Carlborg
On 2013-01-31 21:42, Marco Leise wrote: Maybe Deimos (the GitHub presence) could use a dry piece of text that explains how to convert a header. I have just had the need for xcb for example, but no idea how a good header translation is supposed to look like, if all files need to be converted alrea

Re: Understanding the GC

2013-01-31 Thread monarch_dodra
On Thursday, 31 January 2013 at 23:53:26 UTC, Steven Schveighoffer wrote: A destructor should ONLY be used to free up resources other than GC allocated memory. Because of that, it's generally not used. It should be used almost as a "last resort". For example, a class that holds a file desc

Re: Understanding the GC

2013-01-31 Thread Jeremy DeHaan
On Thursday, 31 January 2013 at 23:53:26 UTC, Steven Schveighoffer wrote: On Thu, 31 Jan 2013 18:27:59 -0500, Jeremy DeHaan wrote: On Wednesday, 30 January 2013 at 10:29:26 UTC, monarch_dodra wrote: To add to that, you also have to keep in mind that when the program terminates (even legally)

Regarding issue 9428

2013-01-31 Thread bearophile
Is someone willing and able to test if this is a regression? http://d.puremagic.com/issues/show_bug.cgi?id=9428 Bye, bearophile

Re: Understanding the GC

2013-01-31 Thread Steven Schveighoffer
On Thu, 31 Jan 2013 18:27:59 -0500, Jeremy DeHaan wrote: On Wednesday, 30 January 2013 at 10:29:26 UTC, monarch_dodra wrote: To add to that, you also have to keep in mind that when the program terminates (even legally), instead of running a *full* collect cycle, the program just leaves, a

Re: Understanding the GC

2013-01-31 Thread Jeremy DeHaan
On Wednesday, 30 January 2013 at 10:29:26 UTC, monarch_dodra wrote: To add to that, you also have to keep in mind that when the program terminates (even legally), instead of running a *full* collect cycle, the program just leaves, and lets the OS clear any allocated memory. This is both faster,

Re: maybe i got a bug

2013-01-31 Thread Ali Çehreli
On 01/31/2013 02:27 PM, bioinfornatics wrote: > On Thursday, 31 January 2013 at 22:20:25 UTC, Ali Çehreli wrote: >> This is not related to your actual problem but I have noticed that you >> have side-effects in your FastqReader.front. I think you will benefit >> from a design where front simply re

Re: maybe i got a bug

2013-01-31 Thread bioinfornatics
On Thursday, 31 January 2013 at 22:20:25 UTC, Ali Çehreli wrote: This is not related to your actual problem but I have noticed that you have side-effects in your FastqReader.front. I think you will benefit from a design where front simply returns the front element and all of the side-effects ar

Re: maybe i got a bug

2013-01-31 Thread bioinfornatics
On Thursday, 31 January 2013 at 22:02:15 UTC, Ali Çehreli wrote: On 01/31/2013 01:42 PM, bioinfornatics wrote: > On Thursday, 31 January 2013 at 21:31:08 UTC, Ali Çehreli wrote: >> On 01/31/2013 08:59 AM, bioinfornatics wrote: >> > I think when i iterate over a phobos range : >> > foreach( state

Re: maybe i got a bug

2013-01-31 Thread bioinfornatics
On Thursday, 31 January 2013 at 21:31:08 UTC, Ali Çehreli wrote: On 01/31/2013 08:59 AM, bioinfornatics wrote: > I think when i iterate over a phobos range : > foreach( state, letter; fastq ) > and if fastq instance is called into this loop as done at line 181 is > not the same instance Correct.

Deimos (How to port a header)

2013-01-31 Thread Marco Leise
Maybe Deimos (the GitHub presence) could use a dry piece of text that explains how to convert a header. I have just had the need for xcb for example, but no idea how a good header translation is supposed to look like, if all files need to be converted already on the first go and other questions, li

Re: gtkD GUI design

2013-01-31 Thread Johannes Pfau
Am Thu, 31 Jan 2013 12:38:41 +0100 schrieb "SaltySugar" : > I want to do a GUI like this: > http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg > > But I've got the following result: > http://www.part.lt/img/f4a238595048be7c23655b02477aabd8447.jpg > > > Thanks. I'd recommend using g

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-01-31 Thread Philippe Sigaud
On Thu, Jan 31, 2013 at 6:47 PM, Joseph Rushton Wakeling wrote: > On 01/31/2013 05:58 PM, Philippe Sigaud wrote: >> >> Could you please update the wiki accordingly? (If you don't have an >> account, it takes 5 secs to get one, I did that a few weks ago) > > > Yea, I've been slow about getting act

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-01-31 Thread Joseph Rushton Wakeling
On 01/31/2013 05:58 PM, Philippe Sigaud wrote: Could you please update the wiki accordingly? (If you don't have an account, it takes 5 secs to get one, I did that a few weks ago) Yea, I've been slow about getting active on the Wiki, apologies for that. I've updated the page to include the DM

Re: Trying to understand how "shared" works in D

2013-01-31 Thread Sparsh Mittal
Thanks a lot. VERY VERY helpful.

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-01-31 Thread Philippe Sigaud
On Thu, Jan 31, 2013 at 1:05 PM, Joseph Rushton Wakeling wrote: > On 01/30/2013 01:58 PM, timewulf wrote: >> >> It took me some time to realize, that it was dmd-2.60 that caused the >> errors: To compile the libraries out of 2.61 or git, one needs a recent >> compiler. > > > More specifically, you

Re: Understanding the GC

2013-01-31 Thread Sean Kelly
GG.reserve can be handy for this. It tells the GC to pre allocate a block of memory from the OS. On Jan 31, 2013, at 7:12 AM, "Steven Schveighoffer" wrote: > On Wed, 30 Jan 2013 03:15:14 -0500, Mike Parker wrote: > >> My understanding is that the current implementation only runs collections

Re: Trying to understand how "shared" works in D

2013-01-31 Thread Matej Nanut
First of all, "const" is usually used as just a bridge between immutable and plain types. You should probably use "immutable" there. As for sharing, immutable variables are implicitly shared, since they can never change (const variables CAN change somewhere else in the program). Your globalVa

Trying to understand how "shared" works in D

2013-01-31 Thread Sparsh Mittal
I wrote this code. My purpose is to see how shared works in D. I create a global variable (globalVar) and access it in two different threads and it prints fine, although it is not shared. So, can you please tell, what difference it makes to use/not-use shared (ref. http://www.informit.com/ar

Re: Understanding the GC

2013-01-31 Thread Steven Schveighoffer
On Wed, 30 Jan 2013 03:15:14 -0500, Mike Parker wrote: My understanding is that the current implementation only runs collections when memory is allocated. Meaning, when you allocate a new object instance, or cause memory to be allocated via some built-in operations (on arrays, for example)

Re: gtkD GUI design

2013-01-31 Thread FG
On 2013-01-31 14:33, SaltySugar wrote: I have two more questions; First, how to remove an arrow on the window's bottom? By making the window fixed-size, not scalable? Second, when I run my program it runs together with console. I want to run only window of application. How to do it? This ha

Re: gtkD GUI design

2013-01-31 Thread FG
On 2013-01-31 13:35, SaltySugar wrote: Thanks, setBorderWidth() is working but button's size isn't changing. I don't have a working gtk environment to test it, but try this: (maybe hBox2 isn't even needed and you could vBox.add(algn1);) import gtk.MainWindow; import gtk.Label; imp

Re: gtkD GUI design

2013-01-31 Thread SaltySugar
On Thursday, 31 January 2013 at 12:35:44 UTC, SaltySugar wrote: On Thursday, 31 January 2013 at 12:21:55 UTC, FG wrote: On 2013-01-31 12:38, SaltySugar wrote: HBox hBox = new HBox(false, 3); HBox hBox1 = new HBox(false, 3); VBox vBox = new VBox(false, 5); Button bt

Re: Looking for command for synchronization of threads

2013-01-31 Thread Sparsh Mittal
Thank you very much for the code. It works fine and is extremely useful.

Re: gtkD GUI design

2013-01-31 Thread SaltySugar
On Thursday, 31 January 2013 at 12:21:55 UTC, FG wrote: On 2013-01-31 12:38, SaltySugar wrote: HBox hBox = new HBox(false, 3); HBox hBox1 = new HBox(false, 3); VBox vBox = new VBox(false, 5); Button btnLog = new Button("LOGIN --->"); Label lblNick = new

Re: gtkD GUI design

2013-01-31 Thread FG
On 2013-01-31 12:38, SaltySugar wrote: HBox hBox = new HBox(false, 3); HBox hBox1 = new HBox(false, 3); VBox vBox = new VBox(false, 5); Button btnLog = new Button("LOGIN --->"); Label lblNick = new Label("User: "); Entry txtNick = new Entry(

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-01-31 Thread Joseph Rushton Wakeling
On 01/30/2013 01:58 PM, timewulf wrote: It took me some time to realize, that it was dmd-2.60 that caused the errors: To compile the libraries out of 2.61 or git, one needs a recent compiler. More specifically, you should be compiling Phobos and druntime releases (or latest up-to-date git sour

Re: Looking for command for synchronization of threads

2013-01-31 Thread FG
On 2013-01-31 03:29, Sparsh Mittal wrote: Thanks. I wrote this: [...] It compiles but barrier does not get released. Can you please point out the fault. Pardon my mistake. I searched whole web, there are almost no examples of it online. Barrier doesn't release because you've only called wait()

Re: gtkD GUI design

2013-01-31 Thread SaltySugar
On Thursday, 31 January 2013 at 11:43:14 UTC, SaltySugar wrote: On Thursday, 31 January 2013 at 11:41:52 UTC, SaltySugar wrote: On Thursday, 31 January 2013 at 11:38:42 UTC, SaltySugar wrote: I want to do a GUI like this: http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg But I've

Re: gtkD GUI design

2013-01-31 Thread SaltySugar
On Thursday, 31 January 2013 at 11:38:42 UTC, SaltySugar wrote: I want to do a GUI like this: http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg But I've got the following result: http://www.part.lt/img/f4a238595048be7c23655b02477aabd8447.jpg My Code: import gtk.MainWindow; import

Re: gtkD GUI design

2013-01-31 Thread SaltySugar
On Thursday, 31 January 2013 at 11:41:52 UTC, SaltySugar wrote: On Thursday, 31 January 2013 at 11:38:42 UTC, SaltySugar wrote: I want to do a GUI like this: http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg But I've got the following result: http://www.part.lt/img/f4a238595048be7c

Re: unnecessary casts

2013-01-31 Thread monarch_dodra
On Thursday, 31 January 2013 at 00:03:43 UTC, Timon Gehr wrote: On 01/30/2013 11:49 PM, Namespace wrote: Is the compiler (dmd) fit enough to detect and avoid unnecessary casts? ... Well, 'unnecessary casts' are a no-op anyway. (Yes, afaik DMD will even eliminate them from the AST.) There i

gtkD GUI design

2013-01-31 Thread SaltySugar
I want to do a GUI like this: http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg But I've got the following result: http://www.part.lt/img/f4a238595048be7c23655b02477aabd8447.jpg My Code: import gtk.MainWindow; import gtk.Label; import gtk.Button; import gtk.VBox; import gtk.HBox;

Re: Looking for command for synchronization of threads

2013-01-31 Thread qznc
On Wednesday, 30 January 2013 at 22:58:36 UTC, Sparsh Mittal wrote: Background: I am implementing an iterative algorithm in parallel manner. The algorithm iteratively updates a matrix (2D grid) of data. So, I will "divide" the grid to different threads, which will work on it for single iterat

Re: How does array assignment for different sized types work?

2013-01-31 Thread FG
On 2013-01-31 10:47, Timon Gehr wrote: The reason is that array literals have special conversion rules It's because floating point literals are double by default. In the first assignment float type can be deduced from v1. To make the second one work, you can explicitly make them float: flo

Re: How does array assignment for different sized types work?

2013-01-31 Thread Timon Gehr
On 01/31/2013 05:48 AM, estew wrote: void main() { float[3] v1 = [1.0, 2.0, 3.0];// No error float[3] v = [1.0, 2.0, 3.0].dup; // Fails at runtime with error message } ... It fails at compile time? The reason is that array literals have special conversion rules: Eg: bool[] x

Re: unnecessary casts

2013-01-31 Thread Namespace
Thanks. It's not that I'm worried about, I was only curious. :)

Re: How does array assignment for different sized types work?

2013-01-31 Thread estew
There are dynamic arrays and static arrays. Dynamic arrays are reference types, static arrays are value types. You have declared a static array. http://dlang.org/arrays.html Got it. Thanks very much for the help.