On Saturday, 8 May 2021 at 02:33:44 UTC, Adam D. Ruppe wrote:
On Saturday, 8 May 2021 at 02:29:18 UTC, Stephen Miller wrote:
Is there an easy way to know what the system functions are?
they are imported.
Windows uses winsock:
http://phobos.dpldocs.info/source/std.socket.d.html#L50
posix uses
On Saturday, 8 May 2021 at 02:29:18 UTC, Stephen Miller wrote:
Is there an easy way to know what the system functions are?
they are imported.
Windows uses winsock:
http://phobos.dpldocs.info/source/std.socket.d.html#L50
posix uses their socket thing:
http://phobos.dpldocs.info/source/std.sock
On Saturday, 8 May 2021 at 01:48:22 UTC, Adam D. Ruppe wrote:
On Saturday, 8 May 2021 at 01:45:49 UTC, Stephen Miller wrote:
I am writing a tcp proxy server and I noticed that when a
socket is in non-blocking mode, it returns -1 if it doesn't
receive data, as opposed to 0.
It sets the `wouldH
I am writing a tcp proxy server and I noticed that when a socket
is in non-blocking mode, it returns -1 if it doesn't receive
data, as opposed to 0.
I wanted to track down the documentation or figure out what might
be going on, so I went to the dlang documentation page for
std.socket.Socket. Th
On Saturday, 8 May 2021 at 01:45:49 UTC, Stephen Miller wrote:
I am writing a tcp proxy server and I noticed that when a
socket is in non-blocking mode, it returns -1 if it doesn't
receive data, as opposed to 0.
It sets the `wouldHaveBlocked` flag in that case returning -1. 0
always means con
On Friday, 7 May 2021 at 22:21:09 UTC, Alain De Vos wrote:
Following code compiles without errors, only errors during
runtime
```
int main(){
int[2] a=new int[2];
int[] b=new int[0];
int[2] c=[1,2];
a=a~3;
b=b~3;
c=c~3;
c=b;
b=a
Following code compiles without errors, only errors during runtime
```
int main(){
int[2] a=new int[2];
int[] b=new int[0];
int[2] c=[1,2];
a=a~3;
b=b~3;
c=c~3;
c=b;
b=a;
a=c;
return 0;
}
```
On Friday, 7 May 2021 at 19:33:30 UTC, Basile B. wrote:
On Friday, 7 May 2021 at 18:07:45 UTC, Nick wrote:
The class grammar, as defined in the D language specification
...
is not clear to me how a user-defined type (such as a class or
interface) is also a 'BasicType' (as defined by the grammar
On 5/7/21 9:46 AM, Alain De Vos wrote:
I see,
https://dlang.org/phobos/core_stdc_time.html
does not contain the function : "clock_gettime"
Weird ...
stdc is about D bindings for C's std headers. I don't think
clock_gettime is a standard C function. grep'ping under /usr/include/dmd
reveals tha
On Friday, 7 May 2021 at 18:07:45 UTC, Nick wrote:
The class grammar, as defined in the D language specification
...
is not clear to me how a user-defined type (such as a class or
interface) is also a 'BasicType' (as defined by the grammar).
However, the compiler only accepts classes or interfa
On Friday, 7 May 2021 at 18:07:45 UTC, Nick wrote:
The class grammar, as defined in the D language specification
([Classes](https://dlang.org/spec/grammar.html#classes)), seems
to imply that a class can inherit from a fundamental type.
Explicitly, the specification says that a 'SuperClass' is a
The class grammar, as defined in the D language specification
([Classes](https://dlang.org/spec/grammar.html#classes)), seems
to imply that a class can inherit from a fundamental type.
Explicitly, the specification says that a 'SuperClass' is a
'BasicType'. And a 'FundamentalType' is a 'BasicTy
I see,
https://dlang.org/phobos/core_stdc_time.html
does not contain the function : "clock_gettime"
Weird ...
Probably renamed ...
On 5/7/21 1:25 AM, Andre Pany wrote:
> get the cpu time
For the sake of completeness, that kind of functionality is provided by
operating systems as well. For example, on Linux, it is common to run
the program through 'time' to get how much wall clock advanced, how much
time was spent actuall
On Friday, 7 May 2021 at 08:58:33 UTC, Dennis wrote:
On Friday, 7 May 2021 at 08:52:13 UTC, Dennis wrote:
If you want to use it on Windows as well, this is a code
snippet I wrote for that:
For completeness, the imports it uses:
```D
version(Windows) {
import core.sys.windows.windows;
On Friday, 7 May 2021 at 08:52:13 UTC, Dennis wrote:
If you want to use it on Windows as well, this is a code
snippet I wrote for that:
For completeness, the imports it uses:
```D
version(Windows) {
import core.sys.windows.windows;
import core.sys.windows.psapi: PROCESS_MEMORY_COUNTERS
On Friday, 7 May 2021 at 08:25:43 UTC, Andre Pany wrote:
Is there some equivalent function in Phobos to get the cpu time
on linux?
I don't think so, but you can use `core.sys.posix.sys.resource:
rusage`.
If you want to use it on Windows as well, this is a code snippet
I wrote for that:
```
On Friday, 7 May 2021 at 08:37:47 UTC, Imperatorn wrote:
On Friday, 7 May 2021 at 08:25:43 UTC, Andre Pany wrote:
Hi,
I try to convert some python code to D. On python I can get
the cpu time for the current
process using
``` python
dcpu: float = time.process_time()
```
Is there some equival
On Friday, 7 May 2021 at 08:25:43 UTC, Andre Pany wrote:
Hi,
I try to convert some python code to D. On python I can get the
cpu time for the current
process using
``` python
dcpu: float = time.process_time()
```
Is there some equivalent function in Phobos to get the cpu time
on linux?
Ki
Hi,
I try to convert some python code to D. On python I can get the
cpu time for the current
process using
``` python
dcpu: float = time.process_time()
```
Is there some equivalent function in Phobos to get the cpu time
on linux?
Kind regards
André
21 matches
Mail list logo