On Sunday, 18 May 2014 at 18:55:59 UTC, Tim wrote:
Hi everyone,
is there any chance to modify a char in a string like:
As you've seen, you cannot modify immutables (string is an
immutable(char)[]). If you actually do want the string to be
modifiable, you should define it as char[] instead.
On Sunday, 1 June 2014 at 14:22:31 UTC, Joseph Rushton Wakeling
via Digitalmars-d-learn wrote:
I missed the debate at the time, but actually, I'm slightly
more concerned over the remark in that discussion that the new
uniform was ported from java.util.Random. Isn't OpenJDK
GPL-licensed ... ?
On Monday, 2 June 2014 at 18:46:18 UTC, Joseph Rushton Wakeling
via Digitalmars-d-learn wrote:
I'm really sorry, Chris, I was obviously mixing things up: on
rereading, the person in the earlier forum discussion (not PR
thread) who talks about porting from Java wasn't you. I'm very
glad to be
On Tuesday, 3 June 2014 at 03:17:10 UTC, Charles Parker wrote:
...
Thanx for any help - Charlie
Well one thing is that you don't need the type parameters on the
this function. You're basically creating a templated this inside
the templated class which is not what you want.
try this:
On Saturday, 7 June 2014 at 19:10:19 UTC, katuday wrote:
I am looking for something like boost::variant in C++
Like this?
http://dlang.org/phobos/std_variant.html
This is my attemot to create a compare object. But I don't know
how to use it together with .sort member function
Don't use the .sort property. Use std.algorithm.sort, which has a
less predicate (that should return a bool).
http://dlang.org/phobos/std_algorithm.html#sort
On Saturday, 7 June 2014 at 19:14:01 UTC, Chris Cain wrote:
This is my attemot to create a compare object. But I don't
know how to use it together with .sort member function
Don't use the .sort property. Use std.algorithm.sort, which has
a less predicate (that should return a bool).
On Saturday, 7 June 2014 at 20:04:41 UTC, Denis Martinez via
Digitalmars-d-learn wrote:
int ret = jack_set_process_callback(handle_, f, dg);
dg here is giving you a pointer to the dg variable sitting on
the stack. The stack is almost certainly getting overwritten at
some point.
On Saturday, 7 June 2014 at 21:40:08 UTC, Agora wrote:
Why is running slow?
One of the main reasons is because the number of permutations an
array has is n!. Thus the expected runtime is O(n!). That's a
slow, slow algorithm in general. In particular, your array with
length 11 has 39,916,800
On Saturday, 7 June 2014 at 22:01:25 UTC, Ali GOREN wrote:
Thank you. I can not resolve it in quicker time, right?
You might be able to come up with a faster way to permute, but
it's mostly pointless because it will always be very slow. Use
std.algorithm.sort if you want to sort quickly, as
On Tuesday, 10 June 2014 at 22:00:34 UTC, Ali Çehreli wrote:
http://stackoverflow.com/questions/10758811/c-syntax-for-functions-returning-function-pointers
int (*(*(*f3)(int))(double))(float);
f3 is a ...
Ali
f3 is a pointer to a function taking an int returning a pointer
to a function
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer
wrote:
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
strlen is only defined for char, not dchar:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/string.d#L44
On Tuesday, 24 June 2014 at 18:17:07 UTC, Danyal Zia wrote:
On Tuesday, 24 June 2014 at 17:59:41 UTC, Steven Schveighoffer
wrote:
const(dchar *)x = ...;
// assuming 0 terminated
dstring text = x[0..x.strlen].idup;
-Steve
const(dchar)* x = Hello\0;
dstring text = x[0..x.strlen].idup;
On Monday, 4 August 2014 at 12:05:31 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
OK, I get it. Just to be sure, there is no ThreadPool in Phobos
or in
core, right?
IIRC, there are fibers somewhere in core, I'll have a look. I
also
heard the vibe.d has them.
There is. It's called
On Saturday, 16 August 2014 at 22:36:51 UTC, 岩倉 澪 wrote:
void changeState(){
if(nextState != WaitState nextState != ExitState){
auto newState = cast(IState)
Object.factory(game.states.~nextState);
import std.exception;
enforce(newState);
// !!!
On Tuesday, 26 August 2014 at 14:55:08 UTC, nikki wrote:
I've been googling without luck, is there a way to do literate
programming in D?, similar to how it's done in Coffeescript ?
http://www.coffeescriptlove.com/2013/02/literate-coffeescript.html
basically me writing comments around code
On Saturday, 30 August 2014 at 07:33:38 UTC, Philippe Sigaud
wrote:
On Friday, 29 August 2014 at 23:58:19 UTC, Chris Cain wrote:
I used https://www.npmjs.org/package/literate-programming (+
pandoc) to do this when writing
https://dl.dropboxusercontent.com/u/2206555/uniformUpgrade.pdf
in
On Saturday, 20 September 2014 at 22:46:10 UTC, John Colvin wrote:
import core.stdc.stdio;
struct S
{
~this()
{
printf(%x\n.ptr, this);
}
}
void main()
{
S* sp = new S;
destroy(*sp);
S s;
destroy(s);
auto sa = new
On Friday, 26 September 2014 at 01:09:01 UTC, AsmMan wrote:
On Friday, 26 September 2014 at 00:53:24 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 26 Sep 2014 00:24:27 +
AsmMan via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
It made me a bit confusing. How is the
19 matches
Mail list logo