08.08.2015 01:34, Ali Çehreli пишет:
On 08/07/2015 06:59 AM, drug wrote:
What is the best way to create range from uniform() function (in other
words create a generator based on some function, returning, say, scalar,
not range)? I did http://dpaste.dzfl.pl/53e3d9255cd7 but I'm not sure
it's the
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
I've put all my progress into
https://github.com/D-Programming-Language/phobos/pull/3534
On Friday, 7 August 2015 at 22:34:40 UTC, Ali Çehreli wrote:
There is an undocumented (why?) Generator struct and generate()
functin in std.range:
It's new in 2.068, that's why it's missing in the current docs.
It's already in the prerelease docs:
http://dlang.org/phobos-prerelease/std_range
On Sunday, 2 August 2015 at 10:04:54 UTC, nikolai wrote:
Yes, I was so excited about Dlang that i forgot to paste the
error:
Here's the link to imagescreen http://prntscr.com/7zwe6h
Can't help you with your problem, but I have another tip:
Shift-right-click inside a dir-> open cmd window here
On Saturday, 8 August 2015 at 00:39:57 UTC, 岩倉 澪 wrote:
On Friday, 7 August 2015 at 22:13:35 UTC, 岩倉 澪 wrote:
"message" is local to the delegate that receiveTimeout takes.
I want to use "message" outside of the delegate in the
receiving thread. However, if you send an immutable value from
the
I'm writing a program that rotates numbers then asks the user if
a new set of numbers should be rotated. I'm having trouble using
a Foreach loop to fill a dynamic array with the elements to be
rotated.
Here's my code, I add a TAB when a loop is inside a loop and and
do that too to the stateme
Here's what happens :
How many elements need to be used? 5
Input the element : 1 1
Input the element : 1 2
Input the element : 1 3
Input the element : 1 4
Input the element : 1 5
How many positions do you wish to rotate ? 3
The original patter is : 5 0 0 0 0
The final is : 0 0 0 5 0
Do you want t
On Saturday, 8 August 2015 at 15:57:15 UTC, Binarydepth wrote:
Here's what happens :
How many elements need to be used? 5
Input the element : 1 1
Input the element : 1 2
Input the element : 1 3
Input the element : 1 4
Input the element : 1 5
How many positions do you wish to rotate ? 3
The origi
On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote:
You can fix it like the following:
foreach(num, element; liaOrig) {//Data input loop
writefln("num: %s current element: %s liaOrig.length: %s",
num, element, liaOrig.length);
write("In
On Friday, 7 August 2015 at 23:01:33 UTC, Ali Çehreli wrote:
Thank you very much for the kind words. Which format are you
using? It is good to hear that it is acceptable as an ebook, as
I've always targetted HTML and then PDF for the print version
(which should be purchasable "any day now"
On Saturday, 8 August 2015 at 18:24:48 UTC, Binarydepth wrote:
On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote:
Now 'num' is just an iterative number starting from 0 (the
.init value of an int), while the actual element value is
stored in 'element'. I added the writefln() stat
I'm playing around with the range based operations and with raw
file io. I couldn't figure out a way to get rid of the outer
foreach loops.
Nice execution time of 537 msec for this, which creates and reads
back a file of about 160MB (20_000_000 doubles).
import std.algorithm;
import std.st
On Saturday, 8 August 2015 at 18:28:25 UTC, Binarydepth wrote:
This is the new code :
foreach(num; 0..liEle) {//Data input loop
write("Input the element : ", num+1, " ");
readf(" %d", &liaOrig[num]);
}
Even better :
foreach(num; 0..liaOrig.len
On 08/08/2015 04:11 PM, Jay Norwood wrote:
I'm playing around with the range based operations and with raw file
io. I couldn't figure out a way to get rid of the outer foreach loops.
When the body of the foreach loop performs something, then
std.algorithm.each can be useful:
import std.algo
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote:
{
auto f = File(fn,"wb");
iota(10.5, 20_000_010.5, 1.0)
.chunks(100)
.each!(a => f.rawWrite(a.array));
}
Ali
Thanks. There are many examples of numeric to string data output
in t
I'm just learning D. Something I often do in C# is have an
IEnumerable (Range) of some type that is then conditionally
filtered. It looks like this:
IEnumerable> foo = bar;
if (baz)
{
foo = foo.Where(d => d["key"] == value);
}
I'm trying to do the same in D. Here's what I want to do:
Ran
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote:
// NOTE: No need to tell rawRead the type as double
iota(10, 20_000_000 + 10, n)
.each!(a => f.rawRead(dbv));
}
Ali
Your f.rawRead(dbv) form compiles, but f.rawRead!(dbv) results in
an error msg in c
On 08/08/2015 07:07 PM, Jay Norwood wrote:
> On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote:
>> // NOTE: No need to tell rawRead the type as double
>> iota(10, 20_000_000 + 10, n)
>> .each!(a => f.rawRead(dbv));
>> }
>>
>> Ali
>
> Your f.rawRead(dbv) f
18 matches
Mail list logo