Re: countUntil with negated pre-defined predicate?

2020-05-02 Thread Harry Gillanders via Digitalmars-d-learn
On Saturday, 2 May 2020 at 18:23:30 UTC, Robert M. Münch wrote: Or is there an even better way to search for all "drawable unicode characters"? This depends on what you classify as drawable, and what you consider to be a character (the joys of Unicode), and why you want to search for them

Re: How can I open a Binary EXE with Hexadecimal?

2020-05-02 Thread wolframw via Digitalmars-d-learn
On Saturday, 2 May 2020 at 21:05:32 UTC, Baby Beaker wrote: save as "rb" again. This will not work. To be able to write to a binary file, you will have to use "wb".

Re: How can I open a Binary EXE with Hexadecimal?

2020-05-02 Thread welkam via Digitalmars-d-learn
On Saturday, 2 May 2020 at 21:05:32 UTC, Baby Beaker wrote: I need open a Binary EXE, it can be using "rb" mode and convert it to Hexadecimal for me make some changes and save as "rb" again. How can I make it? Thank you. You dont convert binary data to hexadecimal. You display it as

How can I open a Binary EXE with Hexadecimal?

2020-05-02 Thread Baby Beaker via Digitalmars-d-learn
I need open a Binary EXE, it can be using "rb" mode and convert it to Hexadecimal for me make some changes and save as "rb" again. How can I make it? Thank you.

Re: Idomatic way to guarantee to run destructor?

2020-05-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/2/20 3:08 PM, Robert M. Münch wrote: On 2020-05-02 18:18:44 +, Steven Schveighoffer said: On 5/2/20 4:44 AM, Robert M. Münch wrote: How would that help, because the class instance is now unusable anyway. So I have it around like a zombie and others might think: "Hey you look

Re: Idomatic way to guarantee to run destructor?

2020-05-02 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-05-02 18:18:44 +, Steven Schveighoffer said: On 5/2/20 4:44 AM, Robert M. Münch wrote: How would that help, because the class instance is now unusable anyway. So I have it around like a zombie and others might think: "Hey you look normal, let's get in contact" and then you are

Re: countUntil with negated pre-defined predicate?

2020-05-02 Thread Harry Gillanders via Digitalmars-d-learn
On Saturday, 2 May 2020 at 18:23:30 UTC, Robert M. Münch wrote: This works: countUntil!(std.uni.isWhite)("hello world")) How can I switch this to (not working); countUntil!(!std.uni.isWhite)("hello world")) without having to write my own predicate? Or is there an even better

Re: countUntil with negated pre-defined predicate?

2020-05-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/2/20 2:23 PM, Robert M. Münch wrote: This works: countUntil!(std.uni.isWhite)("hello world")) How can I switch this to (not working); countUntil!(!std.uni.isWhite)("hello world")) without having to write my own predicate? Or is there an even better way to search for all

countUntil with negated pre-defined predicate?

2020-05-02 Thread Robert M. Münch via Digitalmars-d-learn
This works: countUntil!(std.uni.isWhite)("hello world")) How can I switch this to (not working); countUntil!(!std.uni.isWhite)("hello world")) without having to write my own predicate? Or is there an even better way to search for all "drawable unicode characters"? -- Robert

Re: Idomatic way to guarantee to run destructor?

2020-05-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/2/20 4:44 AM, Robert M. Münch wrote: On 2020-04-30 17:45:24 +, Steven Schveighoffer said: You can use scope instead of auto, and it will then allocate the class on the stack, and destroy it as Ben Jones said. There is danger there, however, as it's very easy to store a class

Re: sort a string

2020-05-02 Thread notna via Digitalmars-d-learn
On Friday, 1 May 2020 at 19:25:43 UTC, Steven Schveighoffer wrote: Nice! Yeah, I was sloppy in my newsgroup coding, sorry. One minor nit here, the to!(dchar[])(word.dup), the dup is not necessary, you are going to end up allocating a temporary array and throwing it away. Just do

Re: a function like writeln that returns a string rather than writes to a file

2020-05-02 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 10:36:47 UTC, Ali Çehreli wrote: On 5/1/20 7:40 PM, dan wrote:> On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: >> On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn >> wrote: >>> I'm looking for a function something like writeln or

Re: Hided Subprocess in Dlang

2020-05-02 Thread Baby Beaker via Digitalmars-d-learn
On Saturday, 2 May 2020 at 15:42:20 UTC, Adam D. Ruppe wrote: On Saturday, 2 May 2020 at 15:37:09 UTC, Baby Beaker wrote: Error: none of the overloads of `spawnProcess` are callable using argument types `(string, File, File, File, Config)`, candidates are: The example is prolly out of date

Re: Hided Subprocess in Dlang

2020-05-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 2 May 2020 at 15:37:09 UTC, Baby Beaker wrote: Error: none of the overloads of `spawnProcess` are callable using argument types `(string, File, File, File, Config)`, candidates are: The example is prolly out of date try spawnProcess(program, null, Config.suppressConsole)

Re: Hided Subprocess in Dlang

2020-05-02 Thread Baby Beaker via Digitalmars-d-learn
On Saturday, 2 May 2020 at 15:20:36 UTC, Adam D. Ruppe wrote: On Saturday, 2 May 2020 at 14:06:55 UTC, Baby Beaker wrote: open the command prompt console running this other process. when calling the functions pass Config.suppressConsole to it. like in the doc example here

Re: Hided Subprocess in Dlang

2020-05-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 2 May 2020 at 14:06:55 UTC, Baby Beaker wrote: open the command prompt console running this other process. when calling the functions pass Config.suppressConsole to it. like in the doc example here http://dpldocs.info/experimental-docs/std.process.Config.html#suppressConsole

Hided Subprocess in Dlang

2020-05-02 Thread Baby Beaker via Digitalmars-d-learn
I am creating a program in Dlang with graphical user interface. I want this program to run a hidden sub-process in the background. But when I click the program to run this process using spamShell or executeShell, open the command prompt console running this other process. Please help me.

Re: a function like writeln that returns a string rather than writes to a file

2020-05-02 Thread Ali Çehreli via Digitalmars-d-learn
On 5/1/20 7:40 PM, dan wrote:> On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: >> On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn >> wrote: >>> I'm looking for a function something like writeln or write, but >>> instead of writing to stdout, it writes to a string

Re: Idomatic way to guarantee to run destructor?

2020-05-02 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-30 17:45:24 +, Steven Schveighoffer said: No, auto is declaring that there's about to be a variable here. In actuality, auto does nothing in the first case, it just means local variable. But without the type name, the type is inferred (i.e. your second example). This does not

Re: Idomatic way to guarantee to run destructor?

2020-05-02 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-30 17:04:43 +, Ben Jones said: I think you want to use scope rather than auto which will put the class on the stack and call its destructor: https://dlang.org/spec/attribute.html#scope Yes, thanks. -- Robert M. Münch http://www.saphirion.com smarter | better | faster