On Jun 18, 2013, at 7:01 AM, Marco Leise wrote:
> Am Mon, 17 Jun 2013 10:46:19 -0700
> schrieb Sean Kelly :
>
>> On Jun 13, 2013, at 2:22 AM, Marco Leise wrote:
>>
>>> Here is an excerpt from a stack trace I got while profiling
>>> with OProfile:
>>>
>>> #0 sem_wait () from /lib64/libpthread
On Tuesday, 18 June 2013 at 18:53:34 UTC, Gary Willoughby wrote:
Below is an example snippet of code to test for performance of
regex matches. I need to parse a large log and extract data
from it and i've noticed a huge increase in time of the loop
when reading and using regex.
...
2nd attempted reply:
On 06/18/2013 12:40 PM, Steven Schveighoffer wrote:
On Tue, 18 Jun 2013 15:37:44 -0400, Charles Hixson
wrote:
(Sorry if this double posts. I'm having trouble getting through at
all.)
How should I compare immutable ints to ensure that they are actually
equal?
I was q
3rd or 4th try:
On 06/18/2013 12:40 PM, Steven Schveighoffer wrote:
On Tue, 18 Jun 2013 15:37:44 -0400, Charles Hixson
wrote:
(Sorry if this double posts. I'm having trouble getting through at
all.)
How should I compare immutable ints to ensure that they are actually
equal?
I was quite
On Tue, 18 Jun 2013 18:10:49 -0400, Stephen Jones
wrote:
I know I can cast, but how do I know what base class each b in the
foreach loop is?
Just an FYI, you are using the wrong terminology. In this case, Bar is
the base class, and Foo and Foos are the *derived* classes.
Other than th
I iterated on Ali's solution with more OOP to demonstrate
features you may find interesting.
import std.stdio;
interface IBar
{
@property int val();
}
class Bar : IBar
{
protected int _val;
@property int val()
{
return this._val;
}
}
cl
On Tuesday, 18 June 2013 at 21:43:17 UTC, Agustin wrote:
On Tuesday, 18 June 2013 at 21:39:35 UTC, Agustin wrote:
Hello!, i'm having a problem and i don't know how to fix it :(.
/**
* Define a common structure for any event.
*
* @author Wolftein
*/
public class Event(T) {
private bool
On 06/18/2013 03:10 PM, Stephen Jones wrote:
I am trying to do this:
import std.stdio;
import std.conv;
class Bar{
}
class Foo : Bar{
int val = 10;
}
class Foos : Bar{
int val = 20;
string str = "some more memory";
}
void main(){
Bar[] bars;
bars ~= new Foo();
b
On Tuesday, 18 June 2013 at 22:15:51 UTC, Ali Çehreli wrote:
On 06/18/2013 03:10 PM, Stephen Jones wrote:
I am trying to do this:
import std.stdio;
import std.conv;
class Bar{
}
class Foo : Bar{
int val = 10;
}
class Foos : Bar{
int val = 20;
string str = "some more memory";
}
vo
I am trying to do this:
import std.stdio;
import std.conv;
class Bar{
}
class Foo : Bar{
int val = 10;
}
class Foos : Bar{
int val = 20;
string str = "some more memory";
}
void main(){
Bar[] bars;
bars ~= new Foo();
bars ~= new Foos();
On Tue, 18 Jun 2013 17:41:57 -0400, Timothee Cour
wrote:
I'd like to do the following:
auto pipes = pipeShell(command, Redirect.stdout | Redirect.stderr);
while(true){
version(A1)
string line=pipes.stdout.readln;
version(A2)
auto line=pipes.stdout.readChunk(10);
version(A3)
auto line=
On Tuesday, 18 June 2013 at 21:39:35 UTC, Agustin wrote:
Hello!, i'm having a problem and i don't know how to fix it :(.
/**
* Define a common structure for any event.
*
* @author Wolftein
*/
public class Event(T) {
private bool cancelled_;
private shared static HandlerList
I'd like to do the following:
auto pipes = pipeShell(command, Redirect.stdout | Redirect.stderr);
while(true){
version(A1)
string line=pipes.stdout.readln;
version(A2)
auto line=pipes.stdout.readChunk(10);
version(A3)
auto line=pipes.stdout.readChar();
// do something with line
if(try
Hello!, i'm having a problem and i don't know how to fix it :(.
/**
* Define a common structure for any event.
*
* @author Wolftein
*/
public class Event(T) {
private bool cancelled_;
private shared static HandlerList!T handler_;
/**
* Return if the
19-Jun-2013 00:34, Jacob Carlborg пишет:
On 2013-06-18 21:22, Gary Willoughby wrote:
Thanks. Hmmm.. i get 500K (worse performance) using that. :/
D has basically the fastest regular expression library/module. It's
faster than V8.
As much as I'm appeased to hear this it's isn't simply "fast
18-Jun-2013 23:22, Gary Willoughby пишет:
enum alert = ctRegex!r"^Alert ([0-9]+)";
And then use it the same way.
Thanks. Hmmm.. i get 500K (worse performance) using that. :/
My bet would be allocations are taking the bulk of time. Any chance to
compile it with -profile?
Any more tips?
18-Jun-2013 22:53, Gary Willoughby пишет:
Below is an example snippet of code to test for performance of regex
matches. I need to parse a large log and extract data from it and i've
noticed a huge increase in time of the loop when reading and using regex.
...
auto alert = regex(r"^Aler
On 2013-06-18 21:22, Gary Willoughby wrote:
Thanks. Hmmm.. i get 500K (worse performance) using that. :/
D has basically the fastest regular expression library/module. It's
faster than V8.
Any more tips?
How about reading in larger chunks than single lines?
--
/Jacob Carlborg
Gary Willoughby:
Any more tips?
Try using the LDC2 compiler, with the ctRegex, and using the
correct compilation flags (like ldmd2 -O -release -inline
-noboundscheck).
If that fails one solution is to write your own finite state
machine where the state is encoded by the program counter, u
On Tue, 18 Jun 2013 15:37:44 -0400, Charles Hixson
wrote:
(Sorry if this double posts. I'm having trouble getting through at all.)
How should I compare immutable ints to ensure that they are actually
equal?
I was quite surprised to receive the following error message:
cbt2.d(732): Erro
(Sorry if this double posts. I'm having trouble getting through at all.)
How should I compare immutable ints to ensure that they are actually equal?
I was quite surprised to receive the following error message:
cbt2.d(732): Error: function object.Object.opEquals (Object o) is not
callable usi
enum alert = ctRegex!r"^Alert ([0-9]+)";
And then use it the same way.
Thanks. Hmmm.. i get 500K (worse performance) using that. :/
Any more tips?
On 06/18/2013 01:53 PM, Gary Willoughby wrote:
Below is an example snippet of code to test for performance of regex
matches. I need to parse a large log and extract data from it and i've
noticed a huge increase in time of the loop when reading and using regex.
...
auto alert = regex(r"
Below is an example snippet of code to test for performance of
regex matches. I need to parse a large log and extract data from
it and i've noticed a huge increase in time of the loop when
reading and using regex.
...
auto alert = regex(r"^Alert ([0-9]+)");
while ((lin
On Tue, Jun 18, 2013 at 6:01 AM, Steven Schveighoffer
wrote:
> On Mon, 17 Jun 2013 21:19:57 -0400, Timothee Cour <
> thelastmamm...@gmail.com> wrote:
>
> I understand your point, however I argued above that we should run a test
>> at compile time to detect cycles. It won't catch all cycles (becau
Adam D. Ruppe:
I can't reproduce the compiler crash you saw though.
Thank you. Then it's somehow just my compiler...
Bye,
bearophile
On Tuesday, 18 June 2013 at 09:22:05 UTC, bearophile wrote:
third is the one that triggers a crash of my DMD version. I am
keeping my compiler updated, I have compiled it yesterday, and
it crashes after giving the error:
test.d(28): Error: cannot modify const expression s
Now I don't know if
Am Mon, 17 Jun 2013 10:46:19 -0700
schrieb Sean Kelly :
> On Jun 13, 2013, at 2:22 AM, Marco Leise wrote:
>
> > Here is an excerpt from a stack trace I got while profiling
> > with OProfile:
> >
> > #0 sem_wait () from /lib64/libpthread.so.0
> > #1 thread_suspendAll () at core/thread.d:2471
>
Interesting thanks.
Ah right, so you use a function as a wrapper around the delegate.
Thanks.
On Tue, 18 Jun 2013 09:34:44 -0400, Namespace
wrote:
Be careful what hidden members you call, some of them are not what you
think they are.
For example?
For example, __dtor may not be the full destructor, but just the code
represented by ~this(). I think this is the case for structs.
Be careful what hidden members you call, some of them are not
what you think they are.
For example?
As a guide, you should take a look at the destroy function in
object to see the proper method of destroying things.
-Steve
On Tue, 18 Jun 2013 03:59:37 -0400, Namespace
wrote:
I'd be worried about whether it actually called the destructors of the
members
of the struct. IIRC, you actually have to play around with TypeInfo in
order
to be able to correctly manually destroy a struct rather than simply
calling
it
On Mon, 17 Jun 2013 21:19:57 -0400, Timothee Cour
wrote:
I understand your point, however I argued above that we should run a test
at compile time to detect cycles. It won't catch all cycles (because of
certain di files), but it will catch most of them (at least all of the
ones
not involvi
On Mon, 17 Jun 2013 18:38:34 -0400, Timothee Cour
wrote:
inside std.process it says:
// Pids are only meant to be constructed inside this module, so we make
the
constructor private.
However, this makes a number of useful functions from std.process useless
unless the processes were created
On Tuesday, 18 June 2013 at 10:57:00 UTC, Artur Skawina wrote:
On 06/18/13 03:51, TommiT wrote:
Change the call to bar(1, 3L); and it wouldn't even compile.
It's because all the types of _ForEach.tuple are the same as
the first element of TS...
I mean... the same as the type of MAP(TS[0])
T
Artur Skawina:
slicing a struct
does not (and can not) produce an auto-expanding tuple, unless
I'm missing
some recent language change...
Sorry, I have misunderstood the type, the [] works on typetuples.
Bye,
bearophile
On 06/18/13 03:51, TommiT wrote:
> On Monday, 17 June 2013 at 13:59:34 UTC, Artur Skawina wrote:
>>
>>struct _ForEach(alias MAP, TS...) {
>> NTup!(TS.length, typeof(MAP(TS[0].init))) tuple;
>>
>> this(TS values) {
>> foreach (i, ref v; values)
>> tuple[i] = MAP(
Just for you:
http://dpaste.1azy.net/3b46c669
This code works now perfect and works also with forward
referenced opaque structures.
Simen Kjaeraas:
Tried this with 2.063.2, and there are three errors in the code
- deserializeInto
should return its buffer, the switch on line 19 needs a
default: case, and
deserializeInto tries to modify its non-buffer argument (which
in this case is a
const string. None of these seem to be
On Tuesday, 18 June 2013 at 09:16:05 UTC, bearophile wrote:
Namespace:
Here my new version:
void Delete(T)(ref T var) if (isAssignable!(T, typeof(null))
&& !isStaticArray!T) {
...
That should fulfill all wishes. :)
Its name should start with a lowercase, according to the D
style
Namespace:
Here my new version:
void Delete(T)(ref T var) if (isAssignable!(T, typeof(null)) &&
!isStaticArray!T) {
...
That should fulfill all wishes. :)
Its name should start with a lowercase, according to the D style.
Bye,
bearophile
On Tuesday, 18 June 2013 at 00:20:38 UTC, Andrej Mitrovic wrote:
On Thursday, 30 May 2013 at 08:26:01 UTC, bioinfornatics wrote:
hi
Someone know if AnalyzeD could to be used from command line ?
i.e http://dconf.org/talks/rohe.html
I failed to find AnalyzeD source code
thanks
I think it's cl
Here my new version:
void Delete(T)(ref T var) if (isAssignable!(T, typeof(null)) &&
!isStaticArray!T) {
const bool isPtr = is(T : U*, U);
static if (isPtr && (is(U == struct) || is(U == class)))
.destroy(*var);
static if (is(T : U[], U))
On Monday, 17 June 2013 at 23:48:36 UTC, Ali Çehreli wrote:
On 06/17/2013 04:34 PM, Colin Grogan wrote:
> Wondering what way I'd go about this, I want to slice an
array into two
> arrays. First array containing every even index (i.e.
0,2,4,6,8..$)
> Second slice containing every odd index (i.e.
I'd be worried about whether it actually called the destructors
of the members
of the struct. IIRC, you actually have to play around with
TypeInfo in order
to be able to correctly manually destroy a struct rather than
simply calling
its __dtor method, but it's not something that I ever do, so I
On 2013-06-18, 05:00, bearophile wrote:
With your code I have found a dmd compiler bug, are you able and willing
to further reduce this?
Tried this with 2.063.2, and there are three errors in the code -
deserializeInto
should return its buffer, the switch on line 19 needs a default: case,
47 matches
Mail list logo