On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
import core.stdc.stdio;
import std.algorithm : min;
extern (C) void main()
{
char[256] buf;
buf[] = '\0';
auto str = "hello world";
auto ln = min(buf.length, str.length);
buf[0..ln] = str[0..ln];
printf("%s\n
On Saturday, 25 November 2017 at 02:32:17 UTC, Fra Mecca wrote:
I have noticed that whenever j contains a string with a space
in it, spawnprocess splits the string into another argument.
That shouldn't happen.
If you are on Windows, note that processes do not see the command
line as an array
I have this snipper of code:
auto pid = spawnProcess([exe, j], po.readEnd, pi.writeEnd,
std.stdio.stderr);
where exe is the executable name and j is argv[1].
I have noticed that whenever j contains a string with a space in
it, spawnprocess splits the string into another argument.
In this w
On Friday, November 24, 2017 20:43:14 A Guy With a Question via Digitalmars-
d-learn wrote:
> On Friday, 24 November 2017 at 14:43:24 UTC, Adam D. Ruppe wrote:
> > On Friday, 24 November 2017 at 14:30:44 UTC, A Guy With a
> >
> > Question wrote:
> >> I would have expected 0 to be the default value.
On Friday, 24 November 2017 at 14:43:24 UTC, Adam D. Ruppe wrote:
On Friday, 24 November 2017 at 14:30:44 UTC, A Guy With a
Question wrote:
I would have expected 0 to be the default value. What's the
logic behind having them being NaN by default?
It gives you a runtime error (sort of) if you
On 11/22/17 7:35 PM, Jonathan M Davis wrote:
On Thursday, November 23, 2017 00:17:46 A Guy With a Question via
Digitalmars-d-learn wrote:
here as non-static, nested class is associated with a specific
instance of the class and has access to that class instance via
its outer member.
- Jonathan M
On 11/23/17 12:57 AM, Nicholas Wilson wrote:
On Wednesday, 22 November 2017 at 15:07:08 UTC, Tim Hsu wrote:
I am a C++ game developer and I want to give it a try.
It seems "this" in Dlang is a reference instead of pointer.
How can I pass it as void *?
void foo(void *);
class Pizza {
public:
On 2017-11-24 16:09, Adam D. Ruppe wrote:
Thanks, this gets me started.
Do you happen to know if there is anything like "pragma(lib)" for the
-framework argument? (I don't use dub, so I took your config there to
make my own command line, but it would be nice if I didn't have to
specify the f
On Thursday, 23 November 2017 at 17:28:43 UTC, Jacob Carlborg
wrote:
I have a simple example [2] of an application that shows a
window with a WebKit view, i.e. and embedded browser.
Thanks, this gets me started.
Do you happen to know if there is anything like "pragma(lib)" for
the -framework
On Friday, 24 November 2017 at 14:30:44 UTC, A Guy With a
Question wrote:
I would have expected 0 to be the default value. What's the
logic behind having them being NaN by default?
It gives you a runtime error (sort of) if you use an
uninitialized variable.
You ARE supposed to explicitly in
I would have expected 0 to be the default value. What's the logic
behind having them being NaN by default?
https://dlang.org/spec/type.html
On Fri, 24 Nov 2017 12:02:47 +, doc wrote:
> I'm trying recursively find files, and have some trouble to catch
> exceptions if have no permission to read directory.
>
...
>
> std.file.FileException@std/file.d(3798):
> /tmp/systemd-private-8338348a306b4d589e3f6ba2bfd0c8fe-systemd-
timesyncd.s
Nice, thank you!
24.11.2017 15:53, SrMordred пишет:
On Friday, 24 November 2017 at 12:36:42 UTC, Daniel Kozak wrote:
Should print something like this:
std.concurrency.OwnerTerminated@std/concurrency.d(223): Owner terminated
Yes, it was, I was aware of this and put some sleep after that too.
(immutable (int)[
On Friday, 24 November 2017 at 12:36:42 UTC, Daniel Kozak wrote:
Should print something like this:
std.concurrency.OwnerTerminated@std/concurrency.d(223): Owner
terminated
Yes, it was, I was aware of this and put some sleep after that
too.
(immutable (int)[] v)
OK that parenteshis was th
import std.stdio;
import std.traits;
int main(string[] args)
{
immutable int[] arr = [1,2,3,4,5];
writeln(ImplicitConversionTargets!(typeof(arr)).stringof);
return 0;
}
On Fri, Nov 24, 2017 at 1:36 PM, Daniel Kozak wrote:
> Should print something like this:
> std.concurrency.OwnerTerminated@std
Should print something like this:
std.concurrency.OwnerTerminated@std/concurrency.d(223): Owner terminated
Because main thread is terminated, because types do not match
this will work
import std.stdio;
import std.concurrency;
void fun()
{
receive( (immutable (int)[] v) => writeln(v) );
}
int ma
On Friday, 24 November 2017 at 12:05:16 UTC, SrMordred wrote:
immutable int[] arr = [1,2,3,4,5];
auto t = spawn({ receive( (immutable int[] v) => writeln(v)
);});
t.send(arr);
whats the problem here?
Nothing prints out
immutable int[] arr = [1,2,3,4,5];
auto t = spawn({ receive( (immutable int[] v) => writeln(v) );});
t.send(arr);
whats the problem here?
I'm trying recursively find files, and have some trouble to catch
exceptions if have no permission to read directory.
[code]
void main() {
import std.file,std.stdio;
auto farray = dirEntries("/tmp", "*.{d,py,pl,sh}",
SpanMode.breadth);
foreach (f; farray){writeln(f);}}
[/code]
std.file.FileEx
On Friday, 24 November 2017 at 09:59:13 UTC, Vino wrote:
if (args.length < 1 || args.length > 2) {
writeln(args[0].baseName, ":No Arguments Provided");
exit(-1);
}
When you pass no arguments, this won't execute as args.length
will still be 1, the only argument
On Friday, 24 November 2017 at 09:59:13 UTC, Vino wrote:
if (args.length < 1 || args.length > 2) {
If args.length is 1 it will call
string op = args[1];
However, args[1] accesses the second element. Due to above if
statement args[1] can be called even though only args[0] exists.
Hi All,
Request your help on the below program, when I execute the
program without passing any arguments it is throwing Range
violation errors
Error:
core.exception.RangeError@test.d(21): Range violation
0x004068CC
0x00408CF3
0x00408CB7
0x00408BB8
0x0040558F
0x74FE336A in
23 matches
Mail list logo