using std.algorithm.topN with std.range.zip fails with undefined swap

2013-12-16 Thread Nikhil Padmanabhan
(apologies in advance if this posts multiple times, I messed up the sending email address the first time). Hi, Trying to compile : import std.stdio, std.range, std.algorithm; void main() { auto a = [2.0,1.0,3.0]; struct Point { double x; } auto b = [Point(4.0), Point(5.0), Point(6.0)]; topN!("

Re: migrating to 64 bit

2013-12-16 Thread Jordi Sayol
El 16/12/13 22:13, Stephen Jones ha escrit: > Thanks for your answers but I wasn't quite clear about what I asking. > Basically I am on a 64 bit os but I want to continue compiling for a 32 bit > os. I don't want to reconfigure Derelict because I already have all the > functionality I need from

package.d

2013-12-16 Thread Leandro Motta Barros
Hello, I have some code using the old "all.d" idiom, which I am changing to use the new "package.d" feature. Originally, I had something like this: // mylib/util.d: module mylib.util; class Foo { } // mylib/all.d: module mylib.all; public import mylib.util; // main.d: import mylib.all; void ma

Shouldn't SList in std.container hold an owner pointer to verify a range belongs to the list?

2013-12-16 Thread Andrej Mitrovic
Here's some improper code that is not checked properly by SList (meaning no assertions, not even in debug mode): - import std.stdio; import std.container; void main() { auto s1 = SList!string(["a", "b", "d"]); auto s2 = SList!string(["a", "b", "d"]); // note the s1[] instead of s

Re: how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 20:23:00 +0100, Jacob Carlborg wrote: On 2013-12-16 17:46, Marco Leise wrote: Hehe, I guess the whole purpose of the launcher is to run in 32-bit and detect at runtime if the 64-bit main executable can be run or the 32-bit version must be used. The only advantage of that i

Re: how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 17:04:18 -, Regan Heath wrote: ... Compile the launcher as 32bit, and use this global boolean "isWow64": ... Thanks, it's nice to have another option. What do you guys think are the possible advantages/disadvantages of either solution?

Re: how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
GetNativeSystemInfo worked. Thanks! The code ended being like this (it seems to be working both in x86 and x86_64): import std.file: exists, getcwd; import std.path: buildPath, dirName; import std.string: format, toStringz; import core.sys.windows.windows; enum X86 = 0; enum AMD64 = 9; immu

Re: migrating to 64 bit

2013-12-16 Thread Stephen Jones
Thanks for your answers but I wasn't quite clear about what I asking. Basically I am on a 64 bit os but I want to continue compiling for a 32 bit os. I don't want to reconfigure Derelict because I already have all the functionality I need from Derelict. Until dmd on Windows 64 bit is sorted out

Re: how to detect OS architecture?

2013-12-16 Thread Jacob Carlborg
On 2013-12-16 17:46, Marco Leise wrote: Hehe, I guess the whole purpose of the launcher is to run in 32-bit and detect at runtime if the 64-bit main executable can be run or the 32-bit version must be used. The only advantage of that is that only a 32bit launcher needs to be distributed. Perh

Embed Windows Internet Explorer

2013-12-16 Thread Andre
Hi, I try to embed Windows Internet Explorer into my application. Most of the coding should be availabe. During method navigate2 I get an empty white screen. No errors is thrown but also the web page is not loaded. Do you have some ideas? => Is use the windows headers from DSource and the dgui f

Re: tango -D2 regex

2013-12-16 Thread John Colvin
On Monday, 16 December 2013 at 07:46:30 UTC, seany wrote: I dont find any info on backtrack on tango-D2 regex. For example, I want to match things like barFOObar or bazFOObaz so I would use, in PCRE, ^(\w*)FOO($1)$, with $1 meaning the word (given by \w* that was matced in the first subpat

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
16-Dec-2013 12:06, seany пишет: On Monday, 16 December 2013 at 07:56:53 UTC, evilrat wrote: have you tried look the docs first? phobos regex patterns described here http://dlang.org/phobos/std_regex.html The only mention of backtrack is : bmatch it returns a regex object with a machine stat

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
16-Dec-2013 11:46, seany пишет: I dont find any info on backtrack on tango-D2 regex. For example, I want to match things like barFOObar or bazFOObaz so I would use, in PCRE, ^(\w*)FOO($1)$, with $1 meaning the word (given by \w* that was matced in the first subpattern (\w*) With std.regex

Re: how to detect OS architecture?

2013-12-16 Thread Regan Heath
On Mon, 16 Dec 2013 10:53:45 -, Hugo Florentino wrote: I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch the proper ex

Re: how to detect OS architecture?

2013-12-16 Thread Marco Leise
Am Mon, 16 Dec 2013 16:04:07 +0100 schrieb Jacob Carlborg : > On 2013-12-16 11:53, Hugo Florentino wrote: > > Hi, > > > > I am writing a launcher to make a Windows application portable, but > > since this application supports both x86 and x86_64, I would like to > > detect the architecture of the

Re: tango -D2 regex

2013-12-16 Thread JR
On Monday, 16 December 2013 at 07:46:30 UTC, seany wrote: I dont find any info on backtrack on tango-D2 regex. For example, I want to match things like barFOObar or bazFOObaz so I would use, in PCRE, ^(\w*)FOO($1)$, with $1 meaning the word (given by \w* that was matced in the first subpat

Re: Chaining std.algorithm

2013-12-16 Thread monarch_dodra
On Monday, 16 December 2013 at 04:45:40 UTC, John Carter wrote: When I try use find in map!"find!""" dmd whinges like crazy at me. First of all, you'd need to use: map!`find!""` , since you are nesting strings. As you wrote it, it looks like: map!"find!" ~ "" See the difference ? Second, unf

Re: how to detect OS architecture?

2013-12-16 Thread Gary Willoughby
On Monday, 16 December 2013 at 13:19:52 UTC, Hugo Florentino wrote: On Mon, 16 Dec 2013 12:59:52 +0100, John Colvin wrote: On Monday, 16 December 2013 at 11:56:07 UTC, Hugo Florentino wrote: On Mon, 16 Dec 2013 12:40:17 +0100, MrSmith wrote: I think this is what he want http://dlang.org/phobos

Re: how to detect OS architecture?

2013-12-16 Thread Jacob Carlborg
On 2013-12-16 11:53, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch the proper executable. The

Re: how to detect OS architecture?

2013-12-16 Thread Marco Leise
Am Mon, 16 Dec 2013 08:19:40 -0500 schrieb Hugo Florentino : > So currently D has no specific function for detecting the OS > architecture at runtime? I had not expected this. You are the first to raise this question. I guess most of us just install either a 32-bit version or a 64-bit version an

Re: how to detect OS architecture?

2013-12-16 Thread Marco Leise
Am Mon, 16 Dec 2013 12:59:52 +0100 schrieb "John Colvin" : > On Monday, 16 December 2013 at 11:56:07 UTC, Hugo Florentino > wrote: > > On Mon, 16 Dec 2013 12:40:17 +0100, MrSmith wrote: > >>> version(Windows) { > >>> // Windows code goes here > >>> } else { > >>> // Other OS code goes he

Re: How to link to libdl under linux

2013-12-16 Thread Marco Leise
Am Mon, 16 Dec 2013 11:09:52 +0100 schrieb "MrSmith" : > > You're still not linking ld properly. It would help > > tremendously if you could show the command line you're using. > > Otherwise all people can do is make guesses about what *might* > > be wrong. > > Oh, right. > Here is first with

Re: how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 12:59:52 +0100, John Colvin wrote: On Monday, 16 December 2013 at 11:56:07 UTC, Hugo Florentino wrote: On Mon, 16 Dec 2013 12:40:17 +0100, MrSmith wrote: I think this is what he want http://dlang.org/phobos/core_cpuid.html#.isX86_64 Thanks, that's precisely what I needed :

Re: [Repost] Link error?

2013-12-16 Thread Jack
On Monday, 16 December 2013 at 12:33:14 UTC, Mike Parker wrote: On 12/16/2013 9:07 PM, Jack wrote: Apparently I can't run link.exe. I've set up the paths as intended. Here: C:\D\dm\bin; C:\D\dmd2\windows\bin; I've been trying to build gtkd with -m64 and this happens. On Win7 64 bit. Help? When

Re: [Repost] Link error?

2013-12-16 Thread Mike Parker
On 12/16/2013 9:07 PM, Jack wrote: Apparently I can't run link.exe. I've set up the paths as intended. Here: C:\D\dm\bin; C:\D\dmd2\windows\bin; I've been trying to build gtkd with -m64 and this happens. On Win7 64 bit. Help? When compiling 64-bit with DMD, you need the Visual Studio toolchain

Re: How to link to libdl under linux

2013-12-16 Thread Mike Parker
On 12/16/2013 7:09 PM, MrSmith wrote: You're still not linking ld properly. It would help tremendously if you could show the command line you're using. Otherwise all people can do is make guesses about what *might* be wrong. Oh, right. Here is first with "/usr/lib32/libdl.a" -L-ldl andrey@andr

Re: how to detect OS architecture?

2013-12-16 Thread Mike Parker
On 12/16/2013 9:26 PM, Gary Willoughby wrote: On Monday, 16 December 2013 at 10:54:15 UTC, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my lau

Re: how to detect OS architecture?

2013-12-16 Thread Gary Willoughby
On Monday, 16 December 2013 at 10:54:15 UTC, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch th

Re: Language Support - Read and Write

2013-12-16 Thread Siavash Babaei
I am using Windows 7 Ultimate x64. Maybe PowerShell will do the trick!

[Repost] Link error?

2013-12-16 Thread Jack
Apparently I can't run link.exe. I've set up the paths as intended. Here: C:\D\dm\bin; C:\D\dmd2\windows\bin; I've been trying to build gtkd with -m64 and this happens. On Win7 64 bit. Help?

Re: how to detect OS architecture?

2013-12-16 Thread John Colvin
On Monday, 16 December 2013 at 10:54:15 UTC, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch th

Re: how to detect OS architecture?

2013-12-16 Thread John Colvin
On Monday, 16 December 2013 at 11:56:07 UTC, Hugo Florentino wrote: On Mon, 16 Dec 2013 12:40:17 +0100, MrSmith wrote: version(Windows) { // Windows code goes here } else { // Other OS code goes here } More here: http://dlang.org/version.html I think he wants determine at runtime wha

Re: how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 12:40:17 +0100, MrSmith wrote: version(Windows) { // Windows code goes here } else { // Other OS code goes here } More here: http://dlang.org/version.html I think he wants determine at runtime what architecture x86 or x64 processor supprots and launch appropriate

Re: how to detect OS architecture?

2013-12-16 Thread MrSmith
version(Windows) { // Windows code goes here } else { // Other OS code goes here } More here: http://dlang.org/version.html I think he wants determine at runtime what architecture x86 or x64 processor supprots and launch appropriate executable. I think this is what he want http:/

Re: how to detect OS architecture?

2013-12-16 Thread Jeroen Bollen
On Monday, 16 December 2013 at 10:54:15 UTC, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch th

Re: regarding spawnProcess and parameters in Windows

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 05:15:24 -0500, Hugo Florentino wrote: Now, suppose I have two versions of the application (myapp32.exe and myapp64.exe), and I want my launcher to launch either, based on the architecture it detected from the OS being run on. What could I do in this case, which is actually w

how to detect OS architecture?

2013-12-16 Thread Hugo Florentino
Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch the proper executable. How can I do this? Regards, Hugo

Re: regarding spawnProcess and parameters in Windows

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 18:59:52 +0900, Mike Parker wrote: On 12/16/2013 6:33 PM, Hugo Florentino wrote: ... Why does the console window appear and how can I prevent this? This is how Windows works. There are a couple of ways to eliminate the console. One is to use WinMain instead of main. That re

Re: How to link to libdl under linux

2013-12-16 Thread MrSmith
You're still not linking ld properly. It would help tremendously if you could show the command line you're using. Otherwise all people can do is make guesses about what *might* be wrong. Oh, right. Here is first with "/usr/lib32/libdl.a" -L-ldl andrey@andress-ubuntu:~/anchovy$ dmd -debug -gc

Re: How to link to libdl under linux

2013-12-16 Thread Mike Parker
On 12/16/2013 6:55 PM, MrSmith wrote: On Monday, 16 December 2013 at 07:36:12 UTC, Jacob Carlborg wrote: now i'm getting this error: deps/derelict-fi-master/lib/libDerelictFI.a(sharedlib_416_4ee.o): In function `_D8derelict4util9sharedlib13LoadSharedLibFAyaZPv': /home/andrey/anchovy/deps/der

Re: regarding spawnProcess and parameters in Windows

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 04:33:53 -0500, Hugo Florentino wrote: ... Why does the console window appear and how can I prevent this? I forgot to mention that I tried using "int main ()" and even "void main()" and removing returns, but the console window keeps appearing, which is rather annoying for

Re: regarding spawnProcess and parameters in Windows

2013-12-16 Thread Mike Parker
On 12/16/2013 6:33 PM, Hugo Florentino wrote: On Mon, 16 Dec 2013 02:04:10 +0100, Danny Arends wrote: However, something is bothering me: when running the launcher, it opens a console temporarily before launching the other process (even when I am not using std.stdio) and I cannot get rid of t

Re: How to link to libdl under linux

2013-12-16 Thread MrSmith
On Monday, 16 December 2013 at 07:36:12 UTC, Jacob Carlborg wrote: On 2013-12-16 01:54, Danny Arends wrote: Pass it depending if you use rdmd or dmd -L-ldl or -ldl It's -L-ldl regardless of it's rdmd or dmd. now i'm getting this error: deps/derelict-fi-master/lib/libDerelictFI.a(sharedl

Re: regarding spawnProcess and parameters in Windows

2013-12-16 Thread Hugo Florentino
On Mon, 16 Dec 2013 02:04:10 +0100, Danny Arends wrote: ... So I think this should work: spawnProcess([appexe,format("/INI=%s",appini)], ["",""],Config.suppressConsole); Hmm... that did not work either, it complained that the parameter was not correct. Actually, the syntax I was using should

Re: Error: import `typename` is used as a type

2013-12-16 Thread Dfr
Thank you, it's now works with full type name. On Monday, 16 December 2013 at 06:33:14 UTC, Dfr wrote: Hello, i struggling now to make my D program better organized. As suggested here https://github.com/bioinfornatics/MakefileForD, i put all source files to src. Here is my current directory

Re: tango -D2 regex

2013-12-16 Thread seany
On Monday, 16 December 2013 at 07:56:53 UTC, evilrat wrote: have you tried look the docs first? phobos regex patterns described here http://dlang.org/phobos/std_regex.html The only mention of backtrack is : bmatch it returns a regex object with a machine state, and last match, but it is sti

Re: Path to cmdfile?

2013-12-16 Thread evilrat
On Monday, 16 December 2013 at 07:33:47 UTC, Jeremy DeHaan wrote: I've been brain storming lately on some ideas to simplify building for the library I've been working on, and I wanted to do some experimenting using cmdfiles. Is there some way that I can pass a search path for these bad boys to

Re: tango -D2 regex

2013-12-16 Thread evilrat
On Monday, 16 December 2013 at 07:46:30 UTC, seany wrote: I dont find any info on backtrack on tango-D2 regex. For example, I want to match things like barFOObar or bazFOObaz so I would use, in PCRE, ^(\w*)FOO($1)$, with $1 meaning the word (given by \w* that was matced in the first subpat