Re: Disable wrilten buf in docker

2024-03-13 Thread zoujiaqing via Digitalmars-d-learn
On Tuesday, 12 March 2024 at 15:44:08 UTC, Steven Schveighoffer wrote: On Tuesday, 12 March 2024 at 06:36:09 UTC, zoujiaqing wrote: Hi, my application use writeln in docker don't display. Python add -u disable it.

Re: Challenge: Make a data type for holding one of 8 directions allowing increment and overflow

2024-03-13 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
There appears to be a few things that you may not be aware of based upon this implementation. The cost of an add + increment then a bitwise and is only 2-4 cycles on a Haswell cpu. Depending upon if its working solely in registers (via inlining) or its operating on ram. The cost of a move

Re: Challenge: Make a data type for holding one of 8 directions allowing increment and overflow

2024-03-13 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 12 March 2024 at 06:38:28 UTC, Richard (Rikki) Andrew Cattermole wrote: By taking advantage of integer wrapping and a bitwise and, its quite a simple problem to solve! Challenge for the reader: add support for binary operations and toString support. Last night I pushed the

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread zoujiaqing via Digitalmars-d-learn
On Wednesday, 13 March 2024 at 22:16:13 UTC, Sergey wrote: On Wednesday, 13 March 2024 at 21:49:55 UTC, zoujiaqing wrote: this is bug in D. It seems like a bug in Hunt-framework. And Hunt - is an abandoned project. Hunt Framework call std.file rename function. but this function can't move

How to make a struct containing an associative array to deeply copy (for repeated usage in foreach) ?

2024-03-13 Thread rkompass via Digitalmars-d-learn
I want to make a custom dictionary that I may iterate through with foreach. Several times. What I observe so far is that my dict as a simple forward range is exhausted after the first foreach and I have to deeply copy it beforehand. With a simple associative array the exhaustion is not

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread Sergey via Digitalmars-d-learn
On Wednesday, 13 March 2024 at 21:49:55 UTC, zoujiaqing wrote: this is bug in D. It seems like a bug in Hunt-framework. And Hunt - is an abandoned project.

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, March 13, 2024 3:49:55 PM MDT zoujiaqing via Digitalmars-d-learn wrote: > On Wednesday, 13 March 2024 at 21:21:21 UTC, Jonathan M Davis > > wrote: > > On Wednesday, March 13, 2024 3:03:30 PM MDT zoujiaqing via > > > > Digitalmars-d-learn wrote: > >> upload file to server in docker,

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread zoujiaqing via Digitalmars-d-learn
On Wednesday, 13 March 2024 at 21:21:21 UTC, Jonathan M Davis wrote: On Wednesday, March 13, 2024 3:03:30 PM MDT zoujiaqing via Digitalmars-d-learn wrote: upload file to server in docker, but upload directory volume to host machine. Exception error: ``` Invalid cross-device link ``` Have

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, March 13, 2024 3:03:30 PM MDT zoujiaqing via Digitalmars-d-learn wrote: > upload file to server in docker, but upload directory volume to > host machine. > > Exception error: > ``` > Invalid cross-device link > ``` > > Have other function like move(a, b) ? > >

The std.file rename method fails in the docker environment.

2024-03-13 Thread zoujiaqing via Digitalmars-d-learn
upload file to server in docker, but upload directory volume to host machine. Exception error: ``` Invalid cross-device link ``` Have other function like move(a, b) ? https://github.com/huntlabs/hunt-framework/blob/master/source/hunt/framework/file/File.d#L102

Re: Challenge: Make a data type for holding one of 8 directions allowing increment and overflow

2024-03-13 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 13 March 2024 at 10:27:49 UTC, Basile B. wrote: The semantics of the operators are actually not as clear as that. What if you define ```d enum Direction { N = 1, NE, S = 45, SW } ``` ? Certainly! EnumMembers; can be used. The EnumMembers template from the std.traits

Re: Challenge: Make a data type for holding one of 8 directions allowing increment and overflow

2024-03-13 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 12 March 2024 at 05:38:03 UTC, Liam McGillivray wrote: I am in need of a data type for holding direction information; one of 8 directions on a single axis. They are named in terms of compass directions. If D had a 4-bit datatype, I would just use this and do `+=2` whenever I want