On 25-Sep-12 06:18, bearophile wrote:
This line of code sorts two arrays in "lock step", according to the
items of the first array:
zip(first, second).sort!q{a[0] < b[0]}();
This code is handy, nice looking, short and sufficiently easy to
recognize once you have seen it before.
Analyzing asm
On Monday, 24 September 2012 at 22:13:51 UTC, Timon Gehr wrote:
On 09/24/2012 09:41 AM, monarch_dodra wrote:
> [SNIP]
I don't think this does what you think it does. The 'is(R r)'
declares r to be an alias for R. So 'r' is a type in that code
snippet.
Darn :(
Also, is(typeof(takeExactly(R,
On 25-Sep-12 00:10, TJB wrote:
Hello,
I am trying to save some data to compressed binary files. I have my
data in a struct, which I can write to a binary file just fine:
align(1) struct TradesBin {
Just a note: recently compiler changed so this align(1) have no effect
on the fields alignmen
On 2012-09-25 00:47, Sean Kelly wrote:
If you're passing via std.concurrency then you'll currently have to cast to
shared. I'd been considering allowing Unique!T to be sent as well, but haven't
done so yet.
Hey, if it's immutable why use std.concurrency at all? Just import the
module and u
On Tuesday, 25 September 2012 at 02:17:53 UTC, bearophile wrote:
This line of code sorts two arrays in "lock step", according to
the items of the first array:
zip(first, second).sort!q{a[0] < b[0]}();
Tangential to your point, but I hadn't seen the q{} syntax used
before. Are there reasons t
This line of code sorts two arrays in "lock step", according to
the items of the first array:
zip(first, second).sort!q{a[0] < b[0]}();
This code is handy, nice looking, short and sufficiently easy to
recognize once you have seen it before.
It's one case where D code is better than a Python
Since you're already set up with the Stream interface, try
creating a
MemoryStream instead of a BufferedFile. Write to the stream
just as you
are now, then use the .data() property (on MemoryStream's
superclass,
TArrayStream) to get an array of raw bytes. You can feed this
array into
the comp
On Sep 22, 2012, at 2:24 AM, Martin Drasar wrote:
> On 21.9.2012 19:01, Jacob Carlborg wrote:
>> Perhaps declaring the associative array as "shared". An alternative
>> would be to serialize the aa, pass it to another thread, and deserialize
>> it. That would though create a copy.
>
> Hi Jacob,
>
On Monday, 24 September 2012 at 16:32:45 UTC, monarch_dodra wrote:
On Monday, 24 September 2012 at 15:05:54 UTC, Jason Spencer
wrote:
I imagine there's a slick way to do this, but I'm not seeing
it.
I have a string of hex digits which I'd like to convert to an
array of 8 ubytes:
0123456789a
On 09/24/2012 09:41 AM, monarch_dodra wrote:
...
Regarding the ".init" issue, I hadn't thought of that, but it can
be worked around pretty easily with an is(R r):
template Hello(R)
if ( is(R r) &&
is(typeof(takeExactly(r, 1))) &&
is(R == typeof(takeExactly(r
On Mon, 24 Sep 2012 22:10:04 +0200, TJB wrote:
> Hello,
>
> I am trying to save some data to compressed binary files. I have my
> data in a struct, which I can write to a binary file just fine:
>
> align(1) struct TradesBin {
>int ttim; int prc;
>int siz; short g127; short corr; char[2]
Hello,
I am trying to save some data to compressed binary files. I have
my data in a struct, which I can write to a binary file just fine:
align(1) struct TradesBin {
int ttim;
int prc;
int siz;
short g127;
short corr;
char[2] cond;
char ex;
}
auto fout = new BufferedFile(outfi
On Monday, 24 September 2012 at 17:49:22 UTC, Ali Çehreli wrote:
On 09/24/2012 12:49 AM, monarch_dodra wrote:
> On Monday, 24 September 2012 at 07:25:28 UTC, Denis
Shelomovskij wrote:
>> 20.09.2012 15:35, monarch_dodra пишет:
>>>
>>> AFAIK, if the rules are the same in C++ (which they
probably ar
On 09/24/2012 12:49 AM, monarch_dodra wrote:
> On Monday, 24 September 2012 at 07:25:28 UTC, Denis Shelomovskij wrote:
>> 20.09.2012 15:35, monarch_dodra пишет:
>>>
>>> AFAIK, if the rules are the same in C++ (which they probably are),
then:
>>> "Any object constructed during argument passing wi
On Monday, 24 September 2012 at 00:16:33 UTC, freeman wrote:
Given:
void main () {
system("rdmd prog_one.d");
//... output from prog_one
system("rdmd prog_two.d");
//... output again from prog_one and new output from prog_two.
}
Any suggestions for getting rid of the ghost of prog_one?
On Monday, 24 September 2012 at 15:05:54 UTC, Jason Spencer wrote:
I imagine there's a slick way to do this, but I'm not seeing it.
I have a string of hex digits which I'd like to convert to an
array of 8 ubytes:
0123456789abcdef --> [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD,
0xEF]
I'm loo
I imagine there's a slick way to do this, but I'm not seeing it.
I have a string of hex digits which I'd like to convert to an
array of 8 ubytes:
0123456789abcdef --> [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD,
0xEF]
I'm looking at std.format.formattedRead, but the documentation
is...lighti
On Wed, 19 Sep 2012 16:25:46 -0400, Øivind wrote:
I am struggeling to get around the cycle detection kicking in when I
have static init in modules that depend on eachother.
I have seen some threads on 'fixes' for this, e.g. adding a @standalone
property to the module or similar. Has there
On Monday, 24 September 2012 at 11:39:08 UTC, monarch_dodra wrote:
Oh. I think I just got what your "reassign" was meant to do. I
think I see it now. I guess it does work nice actually.
I'd say that unfortunately, your *new* reassign is making the
assumption that it is possible to grab a refe
On Monday, 24 September 2012 at 10:53:47 UTC, comco wrote:
Yes, I don't claim that - the last thing is just nasty. It's
just playing with constructs seeing how far can we go. By the
way, now I use the reassign function all over the place! I'm
also very glad this discussion ends with a (remote
On Monday, 24 September 2012 at 07:00:37 UTC, monarch_dodra wrote:
On Sunday, 23 September 2012 at 21:44:20 UTC, comco wrote:
[SNIP]
Now we can implement our rotate in terms of reassign:
void rotate(node* u) {
auto v = u.right;
reassign(u.right, v.left, u);
}
This works and is g
On Monday, September 24, 2012 10:02:54 monarch_dodra wrote:
> Well, it does work...
>
> struct S
> {
> @disable this();
> }
>
> void foo(T)(T i)
> if ( is(T t))
> {}
>
> void main()
> {
> //S s; //Fail
> S s = void;
> foo(s); //Works
> }
>
> I think it makes sense that
On Monday, 24 September 2012 at 07:51:23 UTC, Jonathan M Davis
wrote:
On Monday, September 24, 2012 09:41:26 monarch_dodra wrote:
Regarding the ".init" issue, I hadn't thought of that, but it
can
be worked around pretty easily with an is(R r):
template Hello(R)
if ( is(R r) &&
On Monday, September 24, 2012 09:41:26 monarch_dodra wrote:
> Regarding the ".init" issue, I hadn't thought of that, but it can
> be worked around pretty easily with an is(R r):
>
>
> template Hello(R)
> if ( is(R r) &&
>is(typeof(takeExactly(r, 1))) &&
>is(R
On Monday, 24 September 2012 at 07:25:28 UTC, Denis Shelomovskij
wrote:
20.09.2012 15:35, monarch_dodra пишет:
AFAIK, if the rules are the same in C++ (which they probably
are), then:
"Any object constructed during argument passing will remain
valid for
the duration of the call. It will go ou
On Monday, 24 September 2012 at 07:07:16 UTC, Jonathan M Davis
wrote:
On Monday, September 24, 2012 08:21:46 monarch_dodra wrote:
template Hello(R)
if ( is(typeof(takeExactly(R.init, 1))) &&
is(R == typeof(takeExactly(R.init, 1)))
)
{
alias R Hello;
}
What is wrong wi
20.09.2012 15:35, monarch_dodra пишет:
On Thursday, 20 September 2012 at 09:31:45 UTC, Denis Shelomovskij wrote:
20.09.2012 13:27, Denis Shelomovskij пишет:
Is there any guaranties that `ScopeTemp` will not be destroyed before
`f` call because it isn't used?
---
...
f(ScopeTemp(...).value);
On Monday, September 24, 2012 08:21:46 monarch_dodra wrote:
> template Hello(R)
> if ( is(typeof(takeExactly(R.init, 1))) &&
> is(R == typeof(takeExactly(R.init, 1)))
> )
> {
> alias R Hello;
> }
> What is wrong with my proposed solution?
It may work, but again, it's rely
On Sunday, 23 September 2012 at 21:44:20 UTC, comco wrote:
[SNIP]
Now we can implement our rotate in terms of reassign:
void rotate(node* u) {
auto v = u.right;
reassign(u.right, v.left, u);
}
This works and is general enough, but notice the duplication
of u.right. I don't l
29 matches
Mail list logo