On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote:
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
char ch; //to temporaril
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
char ch; //to temporarily store the '.'
s >> a >> ch >> b >> ch >> c >> ch >> d;
std::co
On Saturday, 10 December 2016 at 03:36:11 UTC, Adam D. Ruppe
wrote:
On Saturday, 10 December 2016 at 03:29:18 UTC, unDEFER wrote:
But it works under Linux
That's just because the underlying C function handles the case.
But the D function makes no promises about that:
std.file.remove's docume
On Saturday, 10 December 2016 at 01:30:52 UTC, Jonathan M Davis
wrote:
On Saturday, December 10, 2016 01:19:45 unDEFER via
Digitalmars-d-learn wrote:
Well, much as I'd love to rag on Windows for doing dumb and
annoying stuff with file locks (which they do do), in this
case, your code wouldn't
On Saturday, 10 December 2016 at 03:29:18 UTC, unDEFER wrote:
But it works under Linux
That's just because the underlying C function handles the case.
But the D function makes no promises about that:
std.file.remove's documentation says "removes the file", leaving
what it does to directories
On Saturday, 10 December 2016 at 01:28:13 UTC, SonicFreak94 wrote:
On Saturday, 10 December 2016 at 01:19:45 UTC, unDEFER wrote:
remove("D:\\TEST");
Try rmdir instead.
But it works under Linux
On Saturday, 10 December 2016 at 02:39:33 UTC, timotheecour wrote:
Have a look at what `trace -E d_executable args` and `trace -E
c++_executable args`
print on startup and grep for dlopen calls and the like.
do you mean strace?
I have trace on OSX but I'm asking for linux.
Looking at the cod
Have a look at what `trace -E d_executable args` and `trace -E
c++_executable args`
print on startup and grep for dlopen calls and the like.
do you mean strace?
I have trace on OSX but I'm asking for linux.
On 12/09/2016 05:34 PM, Stefan Koch wrote:
On Friday, 9 December 2016 at 18:52:59 UTC, Ali Çehreli wrote:
I thought I needed something like staticIota in a unittest to effect
static foreach over a number range and I found one in druntime's
implementation:
https://github.com/dlang/druntime/blob
On Friday, 9 December 2016 at 18:52:59 UTC, Ali Çehreli wrote:
I thought I needed something like staticIota in a unittest to
effect static foreach over a number range and I found one in
druntime's implementation:
https://github.com/dlang/druntime/blob/master/src/core/internal/traits.d#L106
(
On Saturday, December 10, 2016 01:19:45 unDEFER via Digitalmars-d-learn
wrote:
> Hello!
>
> $ cat try.d
> import std.file;
>
> void main ()
> {
> mkdir("D:\\TEST");
> remove("D:\\TEST");
> }
>
> $ ./try.exe
>
> std.file.FileException@std\file.d(731): D:\TEST: Access Denied.
> ---
On Saturday, 10 December 2016 at 01:19:45 UTC, unDEFER wrote:
remove("D:\\TEST");
Try rmdir instead.
On Friday, 9 December 2016 at 21:20:12 UTC, Martin Krejcirik
wrote:
On Friday, 9 December 2016 at 16:50:05 UTC, unDEFER wrote:
And in mini program it works and shows diagnostic message.
Where my diagnostic message in more complicate program???
Try redirecting stdout and stderr to a file(s). Th
On Friday, 9 December 2016 at 20:35:07 UTC, Ali Çehreli wrote:
Assuming boundschecking is turned off, I think you get unlucky
in the mini program and happen to hit a '\0' byte.
No, no.. the program built in debug mode with dub.
Hello!
$ cat try.d
import std.file;
void main ()
{
mkdir("D:\\TEST");
remove("D:\\TEST");
}
$ ./try.exe
std.file.FileException@std\file.d(731): D:\TEST: Access Denied.
What I don't know about removing directories in Windows?
Why I can't remove directory
On Friday, 9 December 2016 at 16:50:05 UTC, unDEFER wrote:
And in mini program it works and shows diagnostic message.
Where my diagnostic message in more complicate program???
Try redirecting stdout and stderr to a file(s). There are cases
when the console itself can crash.
On 12/09/2016 08:50 AM, unDEFER wrote:
> On Friday, 9 December 2016 at 14:29:38 UTC, unDEFER wrote:
>> I'm afraid that the problem that my program wants to say something,
>> but there is no "flush" so message leaves in the buffer.
>
> I have found, it was code like:
>
> string path = "C:";
> strin
I thought I needed something like staticIota in a unittest to effect
static foreach over a number range and I found one in druntime's
implementation:
https://github.com/dlang/druntime/blob/master/src/core/internal/traits.d#L106
(I wonder why that one is implemented in divide-and-conquer fashi
On Friday, 9 December 2016 at 14:29:38 UTC, unDEFER wrote:
I'm afraid that the problem that my program wants to say
something, but there is no "flush" so message leaves in the
buffer.
I have found, it was code like:
string path = "C:";
string parent = path[0..path.lastIndexOf("\\")];
And in
On Thursday, 8 December 2016 at 23:08:35 UTC, Jonathan M Davis
wrote:
I've seen that in C++ code all the time, especially if you're
dealing with
smart pointers, because otherwise you have to do stuff like
(*iter)->foo()
instead of just var->foo().
Smart pointers weren't introduced until C++11
I'm afraid that the problem that my program wants to say
something, but there is no "flush" so message leaves in the
buffer.
My issue isn't about @property, it just shows 3 cases where i
think that dmd is missing a check for alias this.
Even if D didnt had @property or parentesis less function call,
due to alias opCall this it should be possible to call opCall
without parentesis.
On Friday, 9 December 2016 at 10:08:24 UTC, unDEFER wrote:
On Friday, 9 December 2016 at 09:42:52 UTC, unDEFER wrote:
Exceptions works good, and prints debug message always. It is
not exception..
I have tried to add try/catch around full loop of the program.
It doesn't work. And program has inf
On Thursday, 8 December 2016 at 22:09:14 UTC, Jonathan M Davis
wrote:
On Thursday, December 08, 2016 16:54:57 Adam D. Ruppe via
Digitalmars-d- learn wrote:
[...]
Yeah, it's pretty common for folks to slap @property on
functions to make it clear that it's intended to be used as a
property and
On Friday, 9 December 2016 at 09:42:52 UTC, unDEFER wrote:
Exceptions works good, and prints debug message always. It is
not exception..
I have tried to add try/catch around full loop of the program.
It doesn't work. And program has infinite loop.
But maybe it is unhandled signal?
I have foun
On Friday, 9 December 2016 at 09:29:36 UTC, rikki cattermole
wrote:
On 09/12/2016 10:26 PM, unDEFER wrote:
An exception/error might be thrown, try catching Error's in the
threads function.
Also try adding an infinite loop to it.
Exceptions works good, and prints debug message always. It is no
On 09/12/2016 10:26 PM, unDEFER wrote:
Hello!
I'm starting port my program to Windows _without_ Cygwin and found big
trouble.
My main thread exits unexpectedly without any diagnostic messages. The
second thread still lives when it happens.
The visual studio debugger say that thread exits with cod
Hello!
I'm starting port my program to Windows _without_ Cygwin and
found big trouble.
My main thread exits unexpectedly without any diagnostic
messages. The second thread still lives when it happens.
The visual studio debugger say that thread exits with code 2.
What it maybe?
28 matches
Mail list logo