Re: using deimos.portaudio

2012-05-19 Thread Johannes Pfau
Am Sat, 19 May 2012 04:31:57 +0200 schrieb Samuele Carcagno sam.carca...@gmail.com: Hi, I'm try to use the deimos portaudio bindings https://github.com/D-Programming-Deimos/portaudio I've managed to compile and run the test demo provided with the module. It seems to work fine.

Re: How to test for equality of types?

2012-05-19 Thread Philippe Sigaud
On Fri, May 18, 2012 at 11:51 PM, Simen Kjaeraas simen.kja...@gmail.com wrote: Because Wrapper!(AliasStruct).Wrap does not exist. And _error_ is not equal to any other type. Yes. Wrap is included in the complete template name (Wrapper!(Wrap)) and has no independent existence. You _can_ get

unsynchronized access to primitive variables

2012-05-19 Thread luka8088
Hello to all, I would like to know if D guarantees that access to primitive variable is atomic ? I was looking for any source of information that says anything about unsynchronized access to primitive variables. What I want to know is if it is possible (in any way and any OS / hardware) for

Re: moveAt vs opIndex

2012-05-19 Thread maarten van damme
so would it be wrong to make movefront simply change the index the front is pointing at without removing a prime? And I'm coming from a java world so it would make sense to me to create that range as a class that implements a range but in most examples I see everyone using structs instead. what

Re: How to test for equality of types?

2012-05-19 Thread Matthias Walter
On 2012-05-19 09:05, Philippe Sigaud wrote: On Fri, May 18, 2012 at 11:51 PM, Simen Kjaeraas simen.kja...@gmail.com wrote: Because Wrapper!(AliasStruct).Wrap does not exist. And _error_ is not equal to any other type. Yes. Wrap is included in the complete template name (Wrapper!(Wrap))

Re: using deimos.portaudio

2012-05-19 Thread Samuele Carcagno
The missing symbol is a D symbol. You probably have to compile in 'deimos/portaudio.di', so in your 'dmd yourprogram.d' compile command add the full path to the di file: 'dmd yourprogram.d ../path/to/deimos/portaudio.di' Thanks, that was in fact the problem!

Re: ProjectEuler problem 35

2012-05-19 Thread Stewart Gordon
On 16/05/2012 10:46, Dmitry Olshansky wrote: snip Don't ever do that. I mean allocating memory in tight cycle. Instead use circular buffer. (just use the same array and wrap indexes) snip You might as well not use a string representation at all. At the beginning of the loop, calculate the

Re: How to test for equality of types?

2012-05-19 Thread Philippe Sigaud
On Sat, May 19, 2012 at 12:23 PM, Matthias Walter xa...@xammy.homelinux.net wrote: I would open a bug report with the following code which is a bit smaller than my first wrong version: = (...)  pragma(msg, typeof(w.aliasStruct).Alias.stringof); // - MyStruct  pragma(msg,

std.concurrency.send

2012-05-19 Thread japplegame
Multithreading in D confuses me more and more. import std.concurrency; import std.stdio; shared Tid tid; void main() { send(cast(Tid)tid, Hello, World); } void worker() { writeln(receiveOnly!string); } shared static this() { tid = cast(shared)spawn(worker); } I hate these explicit casts.

Re: ProjectEuler problem 35

2012-05-19 Thread maarten van damme
A huge optimization could be made by storing and int array of already found primes and test all primes smaller then half the to-test number. this will speed up a lot. Another huge improvement could be made with hardcoding everything up to the prime 3 and then iterate with intervals of 2 instead of

Re: moveAt vs opIndex

2012-05-19 Thread maarten van damme
and something partially unrelated, how do you copy a class by value?

Re: ProjectEuler problem 35

2012-05-19 Thread Jay Norwood
On Wednesday, 16 May 2012 at 09:26:45 UTC, Tiberiu Gal wrote: hi many claim their code solves the problem in order of ms ( c/pascal/haskell code) I used the blockwise parallel sieve described here, and measured nice speed-ups as described in his blog. It completes calculations within

vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a linux user (Fedora) they are any documentation to explain how install it? after take a look from source tree i think bin/vibe go to /usr/bin bin/views to /usr/share/vibe.d/ source/vibe to /usr/include/d/ i

Re: How to test for equality of types?

2012-05-19 Thread Matthias Walter
On 2012-05-19 15:28, Philippe Sigaud wrote: On Sat, May 19, 2012 at 12:23 PM, Matthias Walter xa...@xammy.homelinux.net wrote: I would open a bug report with the following code which is a bit smaller than my first wrong version: = (...) pragma(msg,

Re: ProjectEuler problem 35

2012-05-19 Thread Era Scarecrow
On Saturday, 19 May 2012 at 16:43:03 UTC, Jay Norwood wrote: On Wednesday, 16 May 2012 at 09:26:45 UTC, Tiberiu Gal wrote: hi many claim their code solves the problem in order of ms ( c/pascal/haskell code) I used the blockwise parallel sieve described here, and measured nice speed-ups

Re: vibe.d how build it / intall it?

2012-05-19 Thread David Nadlinger
On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a linux user (Fedora) they are any documentation to explain how install it? Did you notice the »Linux« section in the readme? Except for

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 13:26:20 UTC, japplegame wrote: Multithreading in D confuses me more and more. import std.concurrency; import std.stdio; shared Tid tid; void main() { send(cast(Tid)tid, Hello, World); } void worker() { writeln(receiveOnly!string); } shared static this() { tid

Re: Simplified socket creation and handling

2012-05-19 Thread Nathan M. Swan
On Friday, 18 May 2012 at 06:35:59 UTC, Jarl André wrote: I am a Java developer who is tired of java.nio and similar complex socket libraries. In Java you got QuickServer, the ultimate protocol creation centered socket library. You don't have to write any channels and readers and what not.

Re: directory wildcard

2012-05-19 Thread Arne
On Saturday, 19 May 2012 at 03:46:32 UTC, Jay Norwood wrote: Here is a link to some code for the wildArgv single level search that I'm using. https://github.com/jnorwood/file_utils This is roughly how I was using it, related to your example string[] argv; argv ~=

Re: std.concurrency.send

2012-05-19 Thread japplegame
You don't need to mark Tids as shared. Okay. I'm writting logger. Logger is global object and it is running in its own separate thread (for example, writting logs to remote database). My application has several threads and all of them want to log something. How to share this global logger

Limit number of compiler error messages

2012-05-19 Thread cal
Is there a way to limit the dmd compiler to outputting just the first few errors it comes across?

Re: vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Le samedi 19 mai 2012 à 21:40 +0200, David Nadlinger a écrit : On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a linux user (Fedora) they are any documentation to explain how

Re: vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Le dimanche 20 mai 2012 à 01:02 +0200, bioinfornatics a écrit : Le samedi 19 mai 2012 à 21:40 +0200, David Nadlinger a écrit : On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 21:13:14 UTC, japplegame wrote: You don't need to mark Tids as shared. Okay. I'm writting logger. Logger is global object and it is running in its own separate thread (for example, writting logs to remote database). My application has several threads and all of

Re: std.concurrency.send

2012-05-19 Thread japplegame
public: void startLogger(LogConstructorArgs args) { loggerTid = spawn(loggerThread, args); } void log(string msg, OtherOptions oo) { loggerTid.send(LogMsg(msg, oo)); } void stopLogger() { loggerTid.send(QuitMsg()); } private: Tid loggerTid; struct LogMsg { string msg;