On Sunday, 15 June 2014 at 09:08:10 UTC, Mike Wey wrote:
On 06/14/2014 06:37 PM, Reuben wrote:
It looks like the only difference is which version of Phobos
we link. I
think the reason for this might be that since my version of
gcc is
hardened, it uses -fPIE by default for linking.
(http://wiki
On Tuesday, 17 June 2014 at 19:02:34 UTC, Pavel wrote:
class A : B, C {
override void test() {}
override void test1() {}
}
If you swap the interfaces (class A: C, B), "a is b" will return
false, but "a is c" will return true. Clearly, this is a bug.
void main() {
A a = new A()
Can you come up with a D library solution to the following C++11 proposal:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3950.html
The idea is to be able to have standard comparison behavior for structs
without boilerplate. For example, if the ordering should consider all
members
On Wednesday, 18 June 2014 at 02:35:03 UTC, Ali Çehreli wrote:
Without any experience on this topic, I suspect this is what
you need:
http://dlang.org/phobos/core_thread.html#.thread_attachThis
Ali
That was exactly what I needed. Thanks.
"John Colvin" writes:
> On Tuesday, 17 June 2014 at 13:16:38 UTC, Jerry wrote:
>> "bearophile" writes:
>>
>>> Jerry:
>>>
If I do
f.readf("%s %s", &l, &i);
it fails if the whitespace is a tab.
>>>
>>> In you can use byLine, followed by a split, and then assignment of the
On Thursday, 5 June 2014 at 19:45:59 UTC, Alix Pexton wrote:
unittest
{
auto a = DataAndView(1);
assert (sameTail(a.data, a.view));
enum b = DataAndView(1);
assert (!sameTail(b.data, b.view));
}
Just a request of presentation. Please make expected assertions:
On 06/17/2014 06:43 PM, George Sapkin wrote:
So, me and my threads again :)
I have some threads being created by libuv using start_thread() from
libpthread calling into D code. D code (after some help from this forum)
has been properly shared and when called from D threads and tasks works
correc
On Tuesday, 17 June 2014 at 02:27:43 UTC, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM (Byte Order Mark). I had, "I thought", a nice way
of figuring out what type of encoding the file was (ASCII, UTF8
or UTF16) when the BOM was missing, b
So, me and my threads again :)
I have some threads being created by libuv using start_thread()
from libpthread calling into D code. D code (after some help from
this forum) has been properly shared and when called from D
threads and tasks works correctly. However when called by libuv
from out
I think it should be possible to run DustMite on some big project
like phobos to actually search for such internal errors.
On Tue, 17 Jun 2014 15:02:33 -0400, Pavel wrote:
Hello!
import std.stdio;
interface I {
}
interface B : I {
void test();
}
interface C : I {
void test1();
}
class A : B, C {
override void test() {}
override void test1() {}
}
void main() {
A a = new A
On Tuesday, 17 June 2014 at 07:53:51 UTC, monarch_dodra wrote:
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortO
Hello!
import std.stdio;
interface I {
}
interface B : I {
void test();
}
interface C : I {
void test1();
}
class A : B, C {
override void test() {}
override void test1() {}
}
void main() {
A a = new A();
I b = cast(B)a;
I c = cast(C)a;
w
Thanks, will work on fixes tonight.
The current method will not detect an error when the image type
is not mapped but a color map is present.
At least I assume that is not a valid TGA file?
A non-mapped image may contain a color map ;-0 it's simply
discarded.
As per your ideas
return t
On 06/17/2014 11:17 AM, George Sapkin wrote:
On Tuesday, 17 June 2014 at 17:18:36 UTC, Ali Çehreli wrote:
Shared data can be accessed by more than one thread. Unless it is
locked, other threads may see the array in an inconsistent state.
Ali
But that's a local copy of it, no? If it's not, wil
On Tuesday, 17 June 2014 at 17:18:36 UTC, Ali Çehreli wrote:
Shared data can be accessed by more than one thread. Unless it
is locked, other threads may see the array in an inconsistent
state.
Ali
But that's a local copy of it, no? If it's not, will making a
local copy solve this?
The origi
On 06/17/2014 08:51 AM, George Sapkin wrote:> Does making an array copy
with shared cast away make any sense?
>
> auto n = 10;
> auto sharedData = new shared SomeClass[n];
> foreach (i; 0..n) sharedData[i] = new shared SomeClass(i);
>
> auto nonSharedData = cast(SomeClass[]) sharedData[0..$];
> a
Does making an array copy with shared cast away make any sense?
auto n = 10;
auto sharedData = new shared SomeClass[n];
foreach (i; 0..n) sharedData[i] = new shared SomeClass(i);
auto nonSharedData = cast(SomeClass[]) sharedData[0..$];
auto sorted = sort!((a, b) => a.value < b.value)(nonSharedDa
On 6/17/14, 11:34 AM, George Sapkin wrote:
On Tuesday, 17 June 2014 at 04:38:24 UTC, Ali Çehreli wrote:
Good news: The code compiles with 2.066 after adding 'import
std.algorithm;' :)
Ali
Thanks, but where can I get 2.066? It seems it's not going to be
branched until June 30th.
Is there any
On Tuesday, 17 June 2014 at 04:38:24 UTC, Ali Çehreli wrote:
Good news: The code compiles with 2.066 after adding 'import
std.algorithm;' :)
Ali
Thanks, but where can I get 2.066? It seems it's not going to be
branched until June 30th.
Is there any way to resolve this now with 2.065?
On Tuesday, 17 June 2014 at 13:16:38 UTC, Jerry wrote:
"bearophile" writes:
Jerry:
If I do
f.readf("%s %s", &l, &i);
it fails if the whitespace is a tab.
In you can use byLine, followed by a split, and then
assignment of the pieces,
followed by to!int where necessary.
I actually can'
On Tuesday, 17 June 2014 at 12:54:39 UTC, Marc Schütz wrote:
On Tuesday, 17 June 2014 at 02:27:43 UTC, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM (Byte Order Mark). I had, "I thought", a nice way
of figuring out what type of encoding th
On Tuesday, 17 June 2014 at 07:49:59 UTC, monarch_dodra wrote:
On Tuesday, 17 June 2014 at 06:44:40 UTC, Jacob Carlborg wrote:
On 17/06/14 04:27, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM
(Byte Order Mark). I had, "I thought", a nice w
On Tuesday, 17 June 2014 at 06:44:40 UTC, Jacob Carlborg wrote:
On 17/06/14 04:27, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM
(Byte Order Mark). I had, "I thought", a nice way of figuring
out what
type of encoding the file was (ASCII, U
"bearophile" writes:
> Jerry:
>
>> If I do
>>
>> f.readf("%s %s", &l, &i);
>>
>> it fails if the whitespace is a tab.
>
> In you can use byLine, followed by a split, and then assignment of the pieces,
> followed by to!int where necessary.
I actually can't use byLine in this instance. I'm really
On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote:
This one depends on taste, but these helpers can be eliminated
by changing the Header definition a little. It's the same union
/ anonymous struct trick from the previous post, only this time
with bitfields:
http://dpaste.dzfl.pl/
On Tuesday, 17 June 2014 at 02:27:43 UTC, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM (Byte Order Mark). I had, "I thought", a nice way
of figuring out what type of encoding the file was (ASCII, UTF8
or UTF16) when the BOM was missing, b
The following:
1. created test C-dll in Cygwin (gcc -shared -o hello.dll hello.o)
2. used "implib.exe /s" to create .lib file
3. linked with D program "dmd test.d hello.lib"
Compiles, program starts but begins to hang as soon as it calls
the C function (which itself is never executed, no "hello
Jerry:
If I do
f.readf("%s %s", &l, &i);
it fails if the whitespace is a tab.
In you can use byLine, followed by a split, and then assignment
of the pieces, followed by to!int where necessary.
Bye,
bearophile
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
Well, techincally, the *syntax* is valid. If "
On Tuesday, 17 June 2014 at 06:44:40 UTC, Jacob Carlborg wrote:
On 17/06/14 04:27, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM
(Byte Order Mark). I had, "I thought", a nice way of figuring
out what
type of encoding the file was (ASCII, U
Hi all,
I'm porting some C++ code into D that uses istream to read lines like
label 3
where there can spaces or tabs between the 2 fields. In c++, this is:
string l;
int i;
istr >> l >> i;
What's the equivalent in D? It appears that D formatted read for
strings grabs everything up to a newli
32 matches
Mail list logo