Re: Python and D (PyD)

2017-11-28 Thread Fat_Umpalumpa via Digitalmars-d-learn
you need to tell the compiler where to look to find pyd (which it can't find in '/Library/D/dmd/src/phobos' or '/Library/D/dmd/src/druntime/import'). If you are invoking the compiler yourself use the `-I` switch (`-Ipath/to/pyd`). Or if you are using dub (I recommend this) make sure that is is

Re: Storing Formatted Array Value

2017-11-28 Thread Petar via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 07:08:12 UTC, Vino wrote: Hi All, Request your help, with the below code I am able to print the value of the array without brackects , but can some on help me on hot to store this output to a variable Program: import std.stdio; import std.container; void ma

Re: Python and D (PyD)

2017-11-28 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 06:34:53 UTC, Fat_Umpalumpa wrote: Hello, I have searched these forums a bit to see if it is possible to use python libraries such as matplotlib which I have enough experience with, and wish to continue using this wonderful library within D. Maybe there are gre

Storing Formatted Array Value

2017-11-28 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, with the below code I am able to print the value of the array without brackects , but can some on help me on hot to store this output to a variable Program: import std.stdio; import std.container; void main() { auto test = Array!string("Test1", "Test2"); writ

Re: Email validation

2017-11-28 Thread Vino via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 05:22:34 UTC, Dmitry wrote: On Wednesday, 29 November 2017 at 03:49:56 UTC, codephantom wrote: string domainRequired = "@hotmail.com"; string emailAddress = "vino.bhee...@hotmail.com"; emailAddress.endsWith(domainRequired) ? writeln("domain ok")

Python and D (PyD)

2017-11-28 Thread Fat_Umpalumpa via Digitalmars-d-learn
Hello, I have searched these forums a bit to see if it is possible to use python libraries such as matplotlib which I have enough experience with, and wish to continue using this wonderful library within D. Maybe there are great D graphing libraries, but I have zero experience with them. I ca

Strange error when compiling with dmd, not with ldc

2017-11-28 Thread Fra Mecca via Digitalmars-d-learn
I have this struct: immutable struct Configuration { string title; string baseurl; string url; string email; string author; string parser; string target; string urlFormat; string urlFormatCmd; short port; string[] ignore; string[] extensions;

Re: Web servers in D

2017-11-28 Thread rikki cattermole via Digitalmars-d-learn
On 29/11/2017 5:51 AM, Hasen Judy wrote: On Tuesday, 12 September 2017 at 12:34:26 UTC, aberba wrote: On Friday, 25 August 2017 at 05:25:09 UTC, Hasen Judy wrote: What libraries are people using to run webservers other than vibe.d? Don't get me wrong I like the async-io aspect of vibe.d but I

Re: Web servers in D

2017-11-28 Thread Hasen Judy via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 12:34:26 UTC, aberba wrote: On Friday, 25 August 2017 at 05:25:09 UTC, Hasen Judy wrote: What libraries are people using to run webservers other than vibe.d? Don't get me wrong I like the async-io aspect of vibe.d but I don't like the weird template language a

Re: Email validation

2017-11-28 Thread Dmitry via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 03:49:56 UTC, codephantom wrote: string domainRequired = "@hotmail.com"; string emailAddress = "vino.bhee...@hotmail.com"; emailAddress.endsWith(domainRequired) ? writeln("domain ok") : writeln("invalid domain"); Also you need check that o

Re: Email validation

2017-11-28 Thread codephantom via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, Can you please provide me some example on who to validate an email address as the document dose not have an example for the same Ex: vino.bhee...@hotmail.com Conditions : The domain should contain only "hotmail.com" The ema

Re: Email validation

2017-11-28 Thread codephantom via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 22:42:27 UTC, Mike Wey wrote: isMail only checks the formatting of the email address and optionally if the domain has a MX record. I don't believe MX validation (checkDns) is implemented yet.

Re: Email validation

2017-11-28 Thread codephantom via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, Can you please provide me some example on who to validate an email address as the document dose not have an example for the same Ex: vino.bhee...@hotmail.com Conditions : The domain should contain only "hotmail.com" The ema

Re: Floating point types default to NaN?

2017-11-28 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 01:25:47 UTC, Michael V. Franklin wrote: On Wednesday, 29 November 2017 at 01:24:21 UTC, A Guy With a Question wrote: I was just more curious of the design decisions that were made. So am I. I'm trying to get to the heart of in the the PR comments. Mike

Re: Floating point types default to NaN?

2017-11-28 Thread Michael V. Franklin via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 01:24:21 UTC, A Guy With a Question wrote: I was just more curious of the design decisions that were made. So am I. I'm trying to get to the heart of in the the PR comments. Mike

Re: Floating point types default to NaN?

2017-11-28 Thread A Guy With a Question via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 20:00:53 UTC, Michael V. Franklin wrote: On Monday, 27 November 2017 at 23:05:55 UTC, Michael V. Franklin wrote: I think I'm going to implement a feature gate to require explicit initialization. It would be better to be strict up front and relax it as flow con

Re: Really? -- Error: function `object.Throwable.message` is not nothrow

2017-11-28 Thread A Guy With a Question via Digitalmars-d-learn
On Wednesday, 29 November 2017 at 00:52:41 UTC, A Guy With a Question wrote: .msg worked. I will let you all live. Thanks!

Re: Really? -- Error: function `object.Throwable.message` is not nothrow

2017-11-28 Thread A Guy With a Question via Digitalmars-d-learn
.msg worked. I will let you all live.

Re: Really? -- Error: function `object.Throwable.message` is not nothrow

2017-11-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 28, 2017 23:48:06 Adam D. Ruppe via Digitalmars-d-learn wrote: > On Tuesday, 28 November 2017 at 23:41:28 UTC, A Guy With a > > Question wrote: > > What's the clean way to extract the message that passes the > > nothrow argument? Do I really have to embed another try catch? >

Re: Really? -- Error: function `object.Throwable.message` is not nothrow

2017-11-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 23:41:28 UTC, A Guy With a Question wrote: What's the clean way to extract the message that passes the nothrow argument? Do I really have to embed another try catch? I didn't even know it had a `message`... you should be able to pull the `.msg` member directly t

Really? -- Error: function `object.Throwable.message` is not nothrow

2017-11-28 Thread A Guy With a Question via Digitalmars-d-learn
What's the clean way to extract the message that passes the nothrow argument? Do I really have to embed another try catch?

Re: Email validation

2017-11-28 Thread codephantom via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 19:32:40 UTC, Vino wrote: Can you provide me a example, as the link does not have any examples. From, Vino.B btw... yes documentation is an acknowledged issue with regards to phobos...but..that aside...it can also be useful (and wise) to look at the unit t

Re: Email validation

2017-11-28 Thread Mike Wey via Digitalmars-d-learn
On 28-11-17 20:32, Vino wrote: On Tuesday, 28 November 2017 at 18:51:50 UTC, Rene Zwanenburg wrote: On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, You can do this easily using the std.net.isemail module: https://dlang.org/phobos/std_net_isemail.html Hi Rene,  Can you p

Re: Floating point types default to NaN?

2017-11-28 Thread Michael V. Franklin via Digitalmars-d-learn
On Monday, 27 November 2017 at 23:05:55 UTC, Michael V. Franklin wrote: I think I'm going to implement a feature gate to require explicit initialization. It would be better to be strict up front and relax it as flow control analysis becomes more mature. Well, I implemented it (https://githu

Re: Email validation

2017-11-28 Thread Vino via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 18:51:50 UTC, Rene Zwanenburg wrote: On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, You can do this easily using the std.net.isemail module: https://dlang.org/phobos/std_net_isemail.html Hi Rene, Can you provide me a example, as the link

Problems with ctRegex

2017-11-28 Thread crimaniak via Digitalmars-d-learn
First problem: it doesn't understand enums, it seems to be a bug: ``` enum TopicMask : string { divider = "/", oneLevelMask = "+", multiLevelMask = "#", system = "$", level = "[^"~divider~oneLevelMask~multiLevelMask~"]*", publishMask = "^("~divider~

Re: Email validation

2017-11-28 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, You can do this easily using the std.net.isemail module: https://dlang.org/phobos/std_net_isemail.html

Email validation

2017-11-28 Thread Vino via Digitalmars-d-learn
Hi All, Can you please provide me some example on who to validate an email address as the document dose not have an example for the same Ex: vino.bhee...@hotmail.com Conditions : The domain should contain only "hotmail.com" The email address should contain the symbol "@" From, Vino.B

Re: Reading a File

2017-11-28 Thread Vino via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 18:34:51 UTC, Steven Schveighoffer wrote: On 11/28/17 1:10 PM, Vino wrote: Hi All,   Need your help, I have file which contains 3 lines, I need to ignore the line's which does not have the sign "=", in the blow example the 3rd  line(FileName2) and store the re

Re: Reading a File

2017-11-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/28/17 1:10 PM, Vino wrote: Hi All,   Need your help, I have file which contains 3 lines, I need to ignore the line's which does not have the sign "=", in the blow example the 3rd  line(FileName2) and store the result in a array, I was able to ignore the line which contains '#" and empt

Reading a File

2017-11-28 Thread Vino via Digitalmars-d-learn
Hi All, Need your help, I have file which contains 3 lines, I need to ignore the line's which does not have the sign "=", in the blow example the 3rd line(FileName2) and store the result in a array, I was able to ignore the line which contains '#" and empty lines , but need to help on how

Re: R.filter!(..).sort!(..)

2017-11-28 Thread Timoses via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 14:04:40 UTC, Steven Schveighoffer wrote: Would be an awesome project to add to D. Oh yes, it sounds yummy..

Re: Basic questions about D lang?

2017-11-28 Thread Ali Çehreli via Digitalmars-d-learn
On 11/28/2017 05:51 AM, Jayam wrote: > Can we compile our program to multi platform? Most definitely! D is great in multi-threaded programming. (I hope that was the question. :) ) Ali

Re: Basic questions about D lang?

2017-11-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/28/17 8:52 AM, Jayam wrote: On Tuesday, 28 November 2017 at 13:42:05 UTC, Stefan Koch wrote: On Tuesday, 28 November 2017 at 13:39:11 UTC, Jayam wrote: Is D language open source? Do this have GUI Desktop application support ? Do this have web api support ? Can we compile our program to mu

Re: R.filter!(..).sort!(..)

2017-11-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/28/17 8:57 AM, Arjan wrote: On Tuesday, 28 November 2017 at 13:24:09 UTC, Steven Schveighoffer wrote: On 11/28/17 8:10 AM, Arjan wrote: [...] The library is correctly telling you that your filtered range is not random access. It can't be, because it lazily applies the filter (that is,

Re: R.filter!(..).sort!(..)

2017-11-28 Thread Arjan via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 13:24:09 UTC, Steven Schveighoffer wrote: On 11/28/17 8:10 AM, Arjan wrote: [...] The library is correctly telling you that your filtered range is not random access. It can't be, because it lazily applies the filter (that is, it filters on each element as you

Re: Basic questions about D lang?

2017-11-28 Thread Jayam via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 13:42:05 UTC, Stefan Koch wrote: On Tuesday, 28 November 2017 at 13:39:11 UTC, Jayam wrote: Is D language open source? Do this have GUI Desktop application support ? Do this have web api support ? Can we compile our program to multi program ? yes yes some (dlang

Re: Basic questions about D lang?

2017-11-28 Thread Jayam via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 13:42:08 UTC, rikki cattermole wrote: On 28/11/2017 1:39 PM, Jayam wrote: Is D language open source? Yes 100% Do this have GUI Desktop application support ? Sure but probably not to the level you expect. Do this have web api support ? Ugh what? Be more s

Re: Basic questions about D lang?

2017-11-28 Thread rikki cattermole via Digitalmars-d-learn
On 28/11/2017 1:39 PM, Jayam wrote: Is D language open source? Yes 100% Do this have GUI Desktop application support ? Sure but probably not to the level you expect. Do this have web api support ? Ugh what? Be more specific. Can we compile our program to multi program ? Okay that de

Re: Basic questions about D lang?

2017-11-28 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 13:39:11 UTC, Jayam wrote: Is D language open source? Do this have GUI Desktop application support ? Do this have web api support ? Can we compile our program to multi program ? yes yes some (dlang-ui for example) yes some (vibe.d or arsd) I don't know what you m

Basic questions about D lang?

2017-11-28 Thread Jayam via Digitalmars-d-learn
Is D language open source? Do this have GUI Desktop application support ? Do this have web api support ? Can we compile our program to multi program ?

Re: R.filter!(..).sort!(..)

2017-11-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/28/17 8:10 AM, Arjan wrote: When applying a sort!() on a filtered range I get this compiler error: Error: template std.algorithm.sorting.sort cannot deduce function from argument types !((a, b) => a.name < b.name)(FilterResult!(__lambda3, RangeT!(Array!(IssueType, candidates are: C:\

Re: R.filter!(..).sort!(..)

2017-11-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 13:10:15 UTC, Arjan wrote: Iaw is the compiler error msg wrong? Or i'm I wrong? filter isn't random access because it doesn't even know how many elements are in there, much less where they are, until it loops through and does the comparisons to know which items

R.filter!(..).sort!(..)

2017-11-28 Thread Arjan via Digitalmars-d-learn
When applying a sort!() on a filtered range I get this compiler error: Error: template std.algorithm.sorting.sort cannot deduce function from argument types !((a, b) => a.name < b.name)(FilterResult!(__lambda3, RangeT!(Array!(IssueType, candidates are: C:\D\dmd2\windows\bin\..\..\src\pho

Re: D program in Windows Task Scheduler.

2017-11-28 Thread rjframe via Digitalmars-d-learn
On Tue, 28 Nov 2017 09:44:39 +, Vino wrote: > Hi All, > > I have small D program which run's perfectly when i run it > manually, but when I schedule the same via windows task scheduler and > choose the option "Run whether user is logged on or not" the program > does not execute, the task sc

Re: Tried C++ to D. Wrong result.

2017-11-28 Thread Dmitry via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 09:01:47 UTC, Temtaime wrote: https://pastebin.com/xJXPBh0n Converted it and it works as expected. What did you use for it? In future I'll be needed to convert some more C++ code. P.S. /And it works wrong, because uses unsafe pointer (ubyte *image). So, it takes

D program in Windows Task Scheduler.

2017-11-28 Thread Vino via Digitalmars-d-learn
Hi All, I have small D program which run's perfectly when i run it manually, but when I schedule the same via windows task scheduler and choose the option "Run whether user is logged on or not" the program does not execute, the task scheduler job log return code 4294967295(Invalid argument).

Re: Tried C++ to D. Wrong result.

2017-11-28 Thread Temtaime via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 06:46:18 UTC, Dmitry wrote: On Monday, 27 November 2017 at 19:01:28 UTC, Ali Çehreli wrote: P.S. I think you have an unnecessary 'ref' on the D version because a slice is already a reference to elements: Fixed, thank you. https://pastebin.com/xJXPBh0n Converted