The automatic tests for a PR failed for a target that I could not test
myself: 32-bit build on Darwin_64_32.
https://auto-tester.puremagic.com/show-run.ghtml?projectid=1=2940199=20802787=true
Testing attach_detach
timelimit -t 10 ./generated/osx/debug/32/attach_detach
On Tuesday, 12 December 2017 at 07:33:47 UTC, Ivan Trombley wrote:
Is there some way that I can make this array immutable?
static float[256] ga = void;
static foreach (i; 0 .. 256)
ga[i] = (i / 255.0f) ^^ (1 / 2.2f);
Check
https://dlang.org/phobos/std_exception.html#assumeUnique
Is there some way that I can make this array immutable?
static float[256] ga = void;
static foreach (i; 0 .. 256)
ga[i] = (i / 255.0f) ^^ (1 / 2.2f);
On Monday, December 11, 2017 15:38:44 H. S. Teoh via Digitalmars-d-learn
wrote:
> On Mon, Dec 11, 2017 at 11:35:53PM +, Seb via Digitalmars-d-learn
> wrote: [...]
>
> > D style would be to use sth. like this (instead of try/catch):
> >
> > ```
> > scope(failure) {
> >
> > e.msg.writeln;
> >
On Tuesday, 12 December 2017 at 02:15:13 UTC, codephantom wrote:
just playing around with this
also...in case you only want to read n bytes..
// ---
module test;
import std.stdio, std.file, std.exception;
import std.datetime.stopwatch;
void main()
{
string
On Monday, 11 December 2017 at 20:51:41 UTC, Jordi Gutiérrez
Hermoso wrote:
I'd like to read from a file, one byte at a time, without
loading the whole file in memory.
just playing around with this
//
module test;
import std.stdio, std.file, std.exception;
void
On Thursday, 7 December 2017 at 19:30:13 UTC, Tofu ninja wrote:
Is there a binding for it? Just a question, trying to convince
people at work to use D and that is something they asked about.
Guess not
On Monday, 11 December 2017 at 14:13:41 UTC, Dukc wrote:
On Sunday, 10 December 2017 at 08:18:17 UTC, Ali Çehreli wrote:
This page is very good:
https://wiki.dlang.org/Starting_as_a_Contributor
I need clarifications
Another oddity: Someone has apparently made DRuntime build to
use
On Monday, 11 December 2017 at 20:58:25 UTC, Jordi Gutiérrez
Hermoso wrote:
I don't quite understand what to do if getopt throws. I would
have hoped for something like
I might have already said this to you on IRC but the way I'd do
it (if you must do this) is:
void main(string[] args) {
On Monday, 11 December 2017 at 06:43:46 UTC, Ali Çehreli wrote:
On 12/10/2017 12:36 AM, Seb wrote:
> [...]
is no harm
> [...]
Thanks. I don't care anymore. :)
>> [...]
should have
>> [...]
a comment
>> [...]
necessary
>> [...]
message should
> [...]
second part
> [...]
opened a PR and
> [...]
On Mon, Dec 11, 2017 at 11:35:53PM +, Seb via Digitalmars-d-learn wrote:
[...]
> D style would be to use sth. like this (instead of try/catch):
>
> ```
> scope(failure) {
> e.msg.writeln;
> 1.exit;
> }
> ```
Frankly, much as I love UFCS syntax, I think this is taking it a little
too far.
On Monday, 11 December 2017 at 21:24:41 UTC, Mike Wey wrote:
try
{
auto helpInformation = getopt(
args,
"input|i", "The input", ,
"output|o", "The output",
);
if (helpInformation.helpWanted)
{
On Saturday, 9 December 2017 at 19:26:26 UTC, David Nadlinger
wrote:
but "free" references don't exist in the language.
To the point! Thanks!
On Monday, 11 December 2017 at 21:24:41 UTC, Mike Wey wrote:
On 11-12-17 21:58, Jordi Gutiérrez Hermoso wrote:
[...]
I would use something like this, print the help information for
--help, print an error for invalid arguments:
```
try
{
auto helpInformation = getopt(
On Monday, 11 December 2017 at 22:58:53 UTC, Jordi Gutiérrez
Hermoso wrote:
On Monday, 11 December 2017 at 21:21:51 UTC, Steven
Schveighoffer wrote:
Use the undead repository:
Wow, really? Is the removal of stream from D some kind of error
that hasn't been corrected yet?
Well of course you
On Monday, 11 December 2017 at 20:51:41 UTC, Jordi Gutiérrez
Hermoso wrote:
I'd like to read from a file, one byte at a time, without
loading the whole file in memory.
I was hoping I could do something like
auto f = File("somefile");
foreach(c; f.byChar) {
process(c);
}
but
On Monday, December 11, 2017 22:58:53 Jordi Gutiérrez Hermoso via
Digitalmars-d-learn wrote:
> On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer
>
> wrote:
> > Use the undead repository:
> Wow, really? Is the removal of stream from D some kind of error
> that hasn't been corrected
On 12/11/17 5:58 PM, Jordi Gutiérrez Hermoso wrote:
On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer wrote:
Use the undead repository:
Wow, really? Is the removal of stream from D some kind of error that
hasn't been corrected yet?
No, it was removed because it was
Thanks for your reply, that clears it up.
On Monday, 11 December 2017 at 21:13:11 UTC, Steven Schveighoffer
wrote:
3. Stop using Windows ;)
Haha, if only the rest of the userbase would follow.
On Monday, December 11, 2017 19:28:47 rumbu via Digitalmars-d-learn wrote:
> Is there any way to overload specific floating point operators?
> https://dlang.org/spec/expression.html#floating-point-comparisons
If those haven't been deprecated yet, they almost certainly will be. It was
decided that
On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer
wrote:
Use the undead repository:
Wow, really? Is the removal of stream from D some kind of error
that hasn't been corrected yet?
On 11-12-17 21:58, Jordi Gutiérrez Hermoso wrote:
but instead, the docstring from getopt is only generated if all
arguments are valid, i.e. when it's the least needed because the user
already knew what to input.
What's the proper style, then? Can someone show me a good example of how
to use
On 12/11/17 3:51 PM, Jordi Gutiérrez Hermoso wrote:
I'd like to read from a file, one byte at a time, without loading the
whole file in memory.
I was hoping I could do something like
auto f = File("somefile");
foreach(c; f.byChar) {
process(c);
}
but there appears to be
On 12/11/17 10:40 AM, Dennis wrote:
I'm on Windows and I recently got confused by how Phobos functions
handle newlines.
```
void main() {
import std.stdio;
import std.path : buildPath, tempDir;
auto path = buildPath(tempDir(), "test.txt");
auto file = new File(path, "w");
On Monday, 11 December 2017 at 19:46:04 UTC, Vino wrote:
import std.algorithm;
import std.container.array;
import std.file: SpanMode, dirEntries, isDir ;
import std.stdio: writefln, writeln;
import std.typecons: Tuple, tuple;
import std.range: chain;
void main () {
auto FFs =
I don't quite understand what to do if getopt throws. I would
have hoped for something like
int arg1;
string arg2;
auto parser = getopt("opt1", "docstring 1", , "opt2",
"docstring 2", );
try {
auto opts = parser.parse(args)
}
except(BadArguments) {
On Monday, 11 December 2017 at 20:44:06 UTC, Eugene Wissner wrote:
On Monday, 11 December 2017 at 20:40:09 UTC, vit wrote:
This code doesn't compile with -dip1000:
struct Foo{
int foo;
ref int bar(){
return foo;
}
}
Error: returning `this.foo` escapes a reference to
I'd like to read from a file, one byte at a time, without loading
the whole file in memory.
I was hoping I could do something like
auto f = File("somefile");
foreach(c; f.byChar) {
process(c);
}
but there appears to be no such way to do it anymore. Instead,
the stdlib seems
On Monday, 11 December 2017 at 20:40:09 UTC, vit wrote:
This code doesn't compile with -dip1000:
struct Foo{
int foo;
ref int bar(){
return foo;
}
}
Error: returning `this.foo` escapes a reference to parameter
`this`, perhaps annotate with `return`
How can be
This code doesn't compile with -dip1000:
struct Foo{
int foo;
ref int bar(){
return foo;
}
}
Error: returning `this.foo` escapes a reference to parameter
`this`, perhaps annotate with `return`
How can be annotated this parameter with 'return ref' ?
On 12/11/2017 08:28 PM, rumbu wrote:
Is there any way to overload specific floating point operators?
https://dlang.org/spec/expression.html#floating-point-comparisons
Those don't seem to work anymore. At least since 2.073, dmd rejects them
and says to use std.math.isNaN instead. Looks like
On Monday, 11 December 2017 at 19:23:40 UTC, Seb wrote:
On Monday, 11 December 2017 at 16:15:14 UTC, Vino wrote:
On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote:
[...]
Hi Biotronic,
I tried your code with multiple folder's , but no luck the
output is not sorted.
Program:
Is there any way to overload specific floating point operators?
https://dlang.org/spec/expression.html#floating-point-comparisons
I'm using a decimal data type (a struct) and one of the possible
values is NaN, that's why I need these operators.
I know also that this also was discussed, but is
On Monday, 11 December 2017 at 16:15:14 UTC, Vino wrote:
On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote:
[...]
Hi Biotronic,
I tried your code with multiple folder's , but no luck the
output is not sorted.
Program:
import std.algorithm: filter, map, sort;
import
On Monday, 11 December 2017 at 15:54:11 UTC, Biotronic wrote:
On Monday, 11 December 2017 at 15:33:08 UTC, Vino wrote:
On Monday, 11 December 2017 at 15:15:47 UTC, Biotronic wrote:
[...]
Hi,
I tired that but no luck, below is the output, in your code
you have one folder "auto folders =
On Monday, 11 December 2017 at 15:33:08 UTC, Vino wrote:
On Monday, 11 December 2017 at 15:15:47 UTC, Biotronic wrote:
On Monday, 11 December 2017 at 14:52:35 UTC, Vino wrote:
Example Program and Output
import std.algorithm: filter, map, sort;
import std.container.array;
import std.file:
On Monday, 11 December 2017 at 15:33:08 UTC, Vino wrote:
I tired that but no luck, below is the output, in your code
you have one folder "auto folders = ["D:\\Dev"];" if you have
multiple folder then output is not sorted.
Works on my machine. Of course, since time toSimpleString returns
I'm on Windows and I recently got confused by how Phobos
functions handle newlines.
```
void main() {
import std.stdio;
import std.path : buildPath, tempDir;
auto path = buildPath(tempDir(), "test.txt");
auto file = new File(path, "w");
file.write("hello there!\n");
On Monday, 11 December 2017 at 15:15:47 UTC, Biotronic wrote:
On Monday, 11 December 2017 at 14:52:35 UTC, Vino wrote:
Example Program and Output
import std.algorithm: filter, map, sort;
import std.container.array;
import std.file: SpanMode, dirEntries, isDir ;
import std.range: chain;
import
On Monday, 11 December 2017 at 14:52:35 UTC, Vino wrote:
Example Program and Output
import std.algorithm: filter, map, sort;
import std.container.array;
import std.file: SpanMode, dirEntries, isDir ;
import std.range: chain;
import std.stdio: writefln;
import std.typecons: Tuple, tuple;
void
On Monday, 11 December 2017 at 14:25:16 UTC, Vino wrote:
On Monday, 11 December 2017 at 13:58:49 UTC, Vino wrote:
Hi All,
Request your help in tuple array sorting, I have a function
which returns tuple values as below so how do i sort this type
of array based on the time stamp(Acceding
On Monday, 11 December 2017 at 13:58:49 UTC, Vino wrote:
Hi All,
Request your help in tuple array sorting, I have a function
which returns tuple values as below so how do i sort this type
of array based on the time stamp(Acceding order) .
Eg:
C:\Temp\EXPORT\dir2 2017-Sep-06 16:06:58
On Sunday, 10 December 2017 at 08:18:17 UTC, Ali Çehreli wrote:
This page is very good:
https://wiki.dlang.org/Starting_as_a_Contributor
I need clarifications
Another oddity: Someone has apparently made DRuntime build to use
../dmd/generated/windows/32/dmd instead of the "system" dmd
Hi All,
Request your help in tuple array sorting, I have a function
which returns tuple values as below so how do i sort this type of
array based on the time stamp(Acceding order) .
Eg:
C:\Temp\EXPORT\dir2 2017-Sep-06 16:06:58
C:\Temp\BACKUP\dir2 2017-Sep-09 22:44:11
C:\Temp\TEAM\dir1
On Monday, 11 December 2017 at 03:53:25 UTC, Josh wrote:
The POST C code was:
/* Sample code generated by the curl command line tool
**
* All curl_easy_setopt() options are documented at:
* https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
Maybe off-topic but you can
On Monday, 11 December 2017 at 10:50:17 UTC, biocyberman wrote:
For someone using NFS or some other remote filesystems, one may
have experienced many times the nasty silent hang. For example,
if I run `ls /mnt/remote/nfsmount`, and the remote NFS server
is down while /mnt/remote/nfsmount was
On Sunday, 10 December 2017 at 06:01:49 UTC, Ali Çehreli wrote:
On 12/09/2017 06:19 PM, Vino wrote:
[...]
When no seed value is specified, fold (and reduce) take the
first element as the seed. When the range is empty, then there
is a run-time failure:
For someone using NFS or some other remote filesystems, one may
have experienced many times the nasty silent hang. For example,
if I run `ls /mnt/remote/nfsmount`, and the remote NFS server is
down while /mnt/remote/nfsmount was mounted, it will take very
long time or forever for the `ls`
48 matches
Mail list logo