On 1/04/2015 7:19 p.m., Suliman wrote:
Rikki, could you explain? I did not understand where it can help me
Here is some example code. While I've only implemented one
InputRange!string instance. You would probably have one, for just zip's
and another raw text files. Keep in mind it returns onl
Rikki, could you explain? I did not understand where it can help
me
On 1/04/2015 6:15 p.m., Suliman wrote:
The situation is next:
I have got the function that get arrays of lognames and logfullname:
void loginsert(string [] lognames, string [] logfullname)
{
if(logfullname[i].endsWith("txt"))
{
auto file = File(logfullname[i], "r");
Maybe there is way to access of element of archive in the same
way as to txt file? I looked, but it's seems that constructor
accept only path to file. But I can't understand how to set path
to unpacked element of archive.
Not quite. You'll note that I am creating the elements in the
associative array, not just iterating over them; some of them
just happen to be duplicates. FWIW: That foreach happens to be
over an input stream.
The situation is next:
I have got the function that get arrays of lognames and
logfullname:
void loginsert(string [] lognames, string [] logfullname)
{
if(logfullname[i].endsWith("txt"))
{
auto file = File(logfullname[i], "r");
foreach (line; fi
On Wednesday, 1 April 2015 at 03:11:58 UTC, Mark Isaacson wrote:
I'm presently trying to create the value of a key in an
associative array if it does not exist, and then maintain a
reference/pointer to the value. This is what I came up with,
but it seems really crufty and I feel that there must
I'm presently trying to create the value of a key in an
associative array if it does not exist, and then maintain a
reference/pointer to the value. This is what I came up with, but
it seems really crufty and I feel that there must be a cleaner
way:
Value[string] assocArray;
foreach (...) {
On Wednesday, 1 April 2015 at 01:09:11 UTC, Charles wrote:
Are the default libraries in dmd2\windows\lib not current or
something?
Those only cover a small number of DLLs, and even those partially.
http://www.dsource.org/projects/bindings/wiki/WindowsApi
Thanks for this! I guess my brain was wrong thinking it'd be in
http://code.dlang.org if it was still being maintained.
For some functions, you'll need import libraries. You can get
them from the same project as in the above link, crea
On Tuesday, 31 March 2015 at 17:20:05 UTC, Charles wrote:
Hi guys,
What is the best (and/or official) source for win32 bindings?
http://www.dsource.org/projects/bindings/wiki/WindowsApi
So, perhaps, a better question is what do you use for win32
bindings? Are there any additional dependencie
On Tuesday, 31 March 2015 at 17:20:05 UTC, Charles wrote:
Hi guys,
What is the best (and/or official) source for win32 bindings?
I know there's this github project:
https://github.com/AndrejMitrovic/DWinProgramming; however, it
hasn't been touched in about 2 years. It's currently linked on
t
On Tuesday, 31 March 2015 at 22:00:39 UTC, weaselcat wrote:
On Tuesday, 31 March 2015 at 20:56:09 UTC, Laeeth Isharc wrote:
Trying on a different beefier machine with 2.066 and 2.067
release versions installed:
1mm allocations:
2.066: 0.844s
2.067: 0.19s
10mm allocations
2.066: 1m 17.2 s
2.0
On Tuesday, 31 March 2015 at 20:56:09 UTC, Laeeth Isharc wrote:
Trying on a different beefier machine with 2.066 and 2.067
release versions installed:
1mm allocations:
2.066: 0.844s
2.067: 0.19s
10mm allocations
2.066: 1m 17.2 s
2.067: 0m 1.15s
So numbers were ballpark right before, and all
On Tuesday, 31 March 2015 at 20:56:09 UTC, Laeeth Isharc wrote:
Trying on a different beefier machine with 2.066 and 2.067
release versions installed:
1mm allocations:
2.066: 0.844s
2.067: 0.19s
10mm allocations
2.066: 1m 17.2 s
2.067: 0m 1.15s
So numbers were ballpark right before, and all
On Tuesday, 31 March 2015 at 01:40:54 UTC, weaselcat wrote:
was this ever solved?
I did some research and saw static immutable ones suggested a
few times, but they can't be chained AFAIK.
Reference counted exceptions.
Not solved.
Trying on a different beefier machine with 2.066 and 2.067
release versions installed:
1mm allocations:
2.066: 0.844s
2.067: 0.19s
10mm allocations
2.066: 1m 17.2 s
2.067: 0m 1.15s
So numbers were ballpark right before, and allocation on this
micro-benchmark much faster.
Thank you.
On 3/31/15 11:23 AM, Adam D. Ruppe wrote:
On Tuesday, 31 March 2015 at 15:12:54 UTC, ref2401 wrote:
Could anyone describe me what this initialization does, please?
It skips the initialization entirely, leaving the memory random instead
of making it zeroes (or NaN or whatever the .init is of th
Hi guys,
What is the best (and/or official) source for win32 bindings?
I know there's this github project:
https://github.com/AndrejMitrovic/DWinProgramming; however, it
hasn't been touched in about 2 years. It's currently linked on
the wiki (http://wiki.dlang.org/D_for_Win32).
I'm also awa
On Tue, Mar 31, 2015 at 03:23:11PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
[...]
> 3) You are initializing a private member with default construction
> turned off. Here, "Struct s;" wouldn't compile because of the disabled
> default constructor, but you need to set it up anyway. So you
On Tuesday, 31 March 2015 at 16:10:07 UTC, Adam D. Ruppe wrote:
On Tuesday, 31 March 2015 at 15:59:53 UTC, John Colvin wrote:
Like almost never? I can't think of any reason to ever do that.
I mentioned it because of this story:
https://www.schneier.com/blog/archives/2008/05/random_number_b.ht
On Tuesday, 31 March 2015 at 15:59:53 UTC, John Colvin wrote:
Like almost never? I can't think of any reason to ever do that.
I mentioned it because of this story:
https://www.schneier.com/blog/archives/2008/05/random_number_b.html
I'm sure there's better ways to do it, but since a similar
t
On Tuesday, 31 March 2015 at 15:23:12 UTC, Adam D. Ruppe wrote:
2) you want some kind of random data, like if you are using it
to seed a random number. There's often better ways of doing
this, but =void might work in some cases.
Like almost never? I can't think of any reason to ever do that.
On Tuesday, 31 March 2015 at 15:12:54 UTC, ref2401 wrote:
struct MyStruct {
// stuff
}
void main(string[] args) {
MyStruct s1 = void;
}
Could anyone describe me what this initialization does, please?
When do I need to use the void initialization?
By default variables are initi
On Tuesday, 31 March 2015 at 15:12:54 UTC, ref2401 wrote:
Could anyone describe me what this initialization does, please?
It skips the initialization entirely, leaving the memory random
instead of making it zeroes (or NaN or whatever the .init is of
the actual type, typically zero though).
struct MyStruct {
// stuff
}
void main(string[] args) {
MyStruct s1 = void;
}
Could anyone describe me what this initialization does, please?
When do I need to use the void initialization?
On 1/04/2015 2:54 a.m., Vitaly wrote:
Hi, I am new in this language. Have anybody dynamic linking libusb with
dmd2 on windows. I know ther is a project libusb-d but this project is
for posix system. As I understand for windows I nid to add .lib file to
project, but there is a problem with COFF an
Hi, I am new in this language. Have anybody dynamic linking
libusb with dmd2 on windows. I know ther is a project libusb-d
but this project is for posix system. As I understand for windows
I nid to add .lib file to project, but there is a problem with
COFF and OMF compatibility. Is it possible
On Tue, Mar 31, 2015 at 11:57:49AM +, w0rp via Digitalmars-d-learn wrote:
> Mutual tail call optimisation doesn't work in C++ either.
>
> Because it's not a language feature in C++ or D. It is not required by
> the standards of either language. It's an optimisation which compilers
> apply. I a
On Tuesday, 31 March 2015 at 12:49:36 UTC, Vlad Levenfeld wrote:
Is there any way (or could there be any way, in the future) of
getting the code from lambda expressions as a string?
I've noticed that if I have an error with a lambda that looks
like, say
x=>x+a
the error message will come u
Is there any way (or could there be any way, in the future) of
getting the code from lambda expressions as a string?
I've noticed that if I have an error with a lambda that looks
like, say
x=>x+a
the error message will come up referring to it as
(x) => x + a
so some level of processing h
On Tuesday, 31 March 2015 at 11:51:26 UTC, drug wrote:
import std.datetime;
import std.stdio;
void main()
{
long.max.SysTime.toISOExtString.writeln;
}
dmd 2.065 (dpaste.dzfl.pl):
+29228-09-14T02:48:05.4775807
dmd v2.067-devel-c6b489b (using Digger):
-29227-04-20T00:11:54.5224191
could
On Tuesday, 31 March 2015 at 12:01:52 UTC, ketmar wrote:
gdc does, as this is gcc backend optimisation.
Thanks.
On Tue, 31 Mar 2015 11:57:49 +, w0rp wrote:
> You might want to try GDC or LDC. I am not certain if they implement
> tail call optimisations, but they might do, and it seems like a good
> optimisation to have. I'm sure this has been discussed before.
gdc does, as this is gcc backend optimisat
Mutual tail call optimisation doesn't work in C++ either.
Because it's not a language feature in C++ or D. It is not
required by the standards of either language. It's an
optimisation which compilers apply. I am guessing you are using
DMD, which might not offer the best optimisations for runti
Hi,
This code does not work:
import std.stdio;
bool odd(int n);
bool even(int n);
bool even(int n) {
if (n == 0)
return true;
else
return odd(n - 1);
}
bool odd(int n) {
if (n == 0)
return false;
else
import std.datetime;
import std.stdio;
void main()
{
long.max.SysTime.toISOExtString.writeln;
}
dmd 2.065 (dpaste.dzfl.pl):
+29228-09-14T02:48:05.4775807
dmd v2.067-devel-c6b489b (using Digger):
-29227-04-20T00:11:54.5224191
could somebody confirm it?
oops - scratch that. may have made a mistake with versions and
be comparing 2.067 with some unstable dev version.
On Tuesday, 31 March 2015 at 11:46:41 UTC, Laeeth Isharc wrote:
I was curious to see if new DMD had changed speed on Maxime
Chevalier-Boisvert's allocation benchmark here:
http:/
I was curious to see if new DMD had changed speed on Maxime
Chevalier-Boisvert's allocation benchmark here:
http://pointersgonewild.com/2014/10/26/circumventing-the-d-garbage-collector/
I haven't had time to look at the Phobos test suite to know if
this was one of those that were included, but
On Tuesday, 31 March 2015 at 04:59:35 UTC, Jeremy DeHaan wrote:
Hey all,
I am finally working on moving out of dmd territory and playing
with gdc and ldc. I was hoping that I could get some links to
some example command lines. I'm mainly interested command lines
regarding linking to libraries
41 matches
Mail list logo