Am 23.08.2012 19:15, schrieb nocide:
struct has no default constructor and instances are initialized with the
init property.
Can I declare or override the init property for a custom defined struct?
Ok, the initializer forks fine for me,
but I've encounterd following situation: (simplified code
Is there n article that explains the different types of Ranges?
(InputRange, ForwardRange, etc) and their usage?
On 08/24/2012 09:39 AM, nocide wrote:
Am 23.08.2012 19:15, schrieb nocide:
struct has no default constructor and instances are initialized with the
init property.
Can I declare or override the init property for a custom defined struct?
Ok, the initializer forks fine for me,
but I've encounter
On Friday, 24 August 2012 at 10:44:28 UTC, Minas Mina wrote:
Is there n article that explains the different types of Ranges?
(InputRange, ForwardRange, etc) and their usage?
There are the docs[1] and this chapter of "Programming in D"[2]
1. http://dlang.org/phobos/std_range.html
2. http://ddil
On 08/24/2012 03:44 AM, Minas Mina wrote:
Is there n article that explains the different types of Ranges?
(InputRange, ForwardRange, etc) and their usage?
This chapter tries to do that:
http://ddili.org/ders/d.en/ranges.html
It contains a link to an article by Andrei as well.
Ali
--
D Pro
Am 24.07.2012 20:38, schrieb David:
I am writing a game engine, well I was using a float[] array to store my
vertices, this worked well, but I have to send more and more uv
coordinates (and other information) which needn't be stored as `float`'s
so I moved from a float-Array to a Vertex Array:
ht
Well, it may be also a way to ensure the function doesn't modify
the struct.
If I remember it correctly, you should write a .def file and
compile it with dlltool or something like that. It will create
the import library.
There was also a switch for gcc or ld to generate an import
library.
I've distiled what I understood from your source and the resulting
executable managed to solve the impossible one in 27 seconds while
your source takes 41 seconds.
I've probably violated every D guideline concerning the use of static,
pure, nothrow,... but it works perfectly :)
It does fail to com
On Friday, 24 August 2012 at 19:32:53 UTC, maarten van damme
wrote:
I've distiled what I understood from your source and the
resulting
executable managed to solve the impossible one in 27 seconds
while
your source takes 41 seconds.
I've probably violated every D guideline concerning the use of
On 08/23/2012 11:47 PM, Jacob Carlborg wrote:
How about this:
import std.stdio;
class Foo
{
auto forward (alias fn, Args...) (Args args)
{
return fn(args);
}
void bar (int a = 3)
{
writeln("bar ", a);
}
}
auto call (alias fn, T, Args...) (T t,
Check the dissassembly view of this line:
buffer[elements++] = Vertex(x, y, z, nx, ny, nz, u, v, u_biome, v_biome);
If you are using an old version of dmd it will allocate an block of
memory which has the size of Vertex, then it will fill the date into
that block of memory, and then memcpy it to
On 24-Aug-12 07:03, 1100110 wrote:
On linux this is not so difficult to do.
Those values are generally in /proc, and it seems to be portable across
pretty much every distro with a relatively recent kernel.
I have an extremely half-assed bit of code that prints the load average
and the totaly %
On Fri, 24 Aug 2012 15:42:21 -0500, Dmitry Olshansky
wrote:
On 24-Aug-12 07:03, 1100110 wrote:
On linux this is not so difficult to do.
Those values are generally in /proc, and it seems to be portable across
pretty much every distro with a relatively recent kernel.
I have an extremely hal
On Friday, 24 August 2012 at 19:32:53 UTC, maarten van damme
wrote:
I've distiled what I understood from your source and the
resulting
executable managed to solve the impossible one in 27 seconds
while
your source takes 41 seconds.
I've probably violated every D guideline concerning the use of
On 25-Aug-12 00:52, 1100110 wrote:
On Fri, 24 Aug 2012 15:42:21 -0500, Dmitry Olshansky
wrote:
On 24-Aug-12 07:03, 1100110 wrote:
On linux this is not so difficult to do.
Those values are generally in /proc, and it seems to be portable across
pretty much every distro with a relatively recen
Thank you very much.
I changed line 119 to an explicit cast to int and removed an unneeded
cast at line 63.
It now happily compiles with 64bit mode : http://dpaste.dzfl.pl/63666f07.
It's kind off odd though that compiling with -inline seems to slow it
a bit down.
I'm unsure if searching for the fi
> I'm unsure if searching for the field with the least possibilities was
> a smart move because now I have to carry that "taken" array through
> all my functions and optimize has to check the whole sudoku instead of
> a slice. (come to think of it, taken should've been named occupied)
I take that
maarten van damme:
http://dpaste.dzfl.pl/8a2aef5b
Some suggestions about the code:
- Put a space before and after operators, after a commas and
semicolon, around "..", etc.
- Compile with "-wi -property";
- Try to add pure/const/nothrow/immutable where possible;
- Minimize the need of cast()
On Fri, 24 Aug 2012 16:05:28 -0500, Dmitry Olshansky
wrote:
On 25-Aug-12 00:52, 1100110 wrote:
On Fri, 24 Aug 2012 15:42:21 -0500, Dmitry Olshansky
wrote:
On 24-Aug-12 07:03, 1100110 wrote:
On linux this is not so difficult to do.
Those values are generally in /proc, and it seems to be
I will try to replace the int[] of cachedBitsetToRange with
something more static, to reduce indirection.
Yeah, it's a bit faster, but not a lot:
http://dpaste.dzfl.pl/b04a0127
Bye,
bearophile
> Some suggestions about the code:
Thank you very much for your criticism, there are indeed a lot of
points where I have to improve on.
> - Put a space before and after operators, after a commas and semicolon,
> around "..", etc.
> - Compile with "-wi -property";
> - Try to add pure/const/nothrow/
On 08/24/2012 09:32 PM, maarten van damme wrote:
I've distiled what I understood from your source and the resulting
executable managed to solve the impossible one in 27 seconds while
your source takes 41 seconds.
It is 10s vs 13s with GDC on my machine.
and everythingPossible should also be changed to something ala 2 ^(side) -1
2012/8/25 Timon Gehr :
> On 08/24/2012 09:32 PM, maarten van damme wrote:
>>
>> I've distiled what I understood from your source and the resulting
>> executable managed to solve the impossible one in 27 seconds while
>> your source takes 41 seconds.
>>
>
> It is 10s vs 13s with GDC on my machine.
>
maarten van damme:
Is there a special reason I should use them in little programs
like these?
In my experience small programs contain lot of the issues and
ideas contained in large programs. Using things like "pure" and
"const/immutable" helps avoid/catch some bugs even in small
programs.
G
I saw something on the forum not too long ago about statically
checking to see if the current function is being executed at
compile time, but can't seem to find it now. Can it be done?
(Like static if (__ctfe__) or something)
I am running into an ICE on windows - Assertion Failure on such-and-such
line in mtype.c - and I am trying to get a test command for to reduce it
with the redoubtable dustmite.
Normally, 'abnormal program termination' is printed to the console;
however if I try to redirect stderr for greppage
On 08/25/2012 02:06 AM, cal wrote:
I saw something on the forum not too long ago about statically checking
to see if the current function is being executed at compile time, but
can't seem to find it now. Can it be done? (Like static if (__ctfe__) or
something)
if(__ctfe)
cal:
I saw something on the forum not too long ago about statically
checking to see if the current function is being executed at
compile time, but can't seem to find it now. Can it be done?
(Like static if (__ctfe__) or something)
It's named __ctfe, but unfortunately it's an (immutable) run-
On Saturday, 25 August 2012 at 00:13:44 UTC, Timon Gehr wrote:
On 08/25/2012 02:06 AM, cal wrote:
I saw something on the forum not too long ago about statically
checking
to see if the current function is being executed at compile
time, but
can't seem to find it now. Can it be done? (Like static
On 08/25/2012 02:15 AM, bearophile wrote:
cal:
I saw something on the forum not too long ago about statically
checking to see if the current function is being executed at compile
time, but can't seem to find it now. Can it be done? (Like static if
(__ctfe__) or something)
It's named __ctfe, b
On 08/25/2012 01:01 AM, Timon Gehr wrote:
On 08/24/2012 09:32 PM, maarten van damme wrote:
I've distiled what I understood from your source and the resulting
executable managed to solve the impossible one in 27 seconds while
your source takes 41 seconds.
It is 10s vs 13s with GDC on my machin
On 08/25/2012 02:38 AM, Timon Gehr wrote:
On 08/25/2012 01:01 AM, Timon Gehr wrote:
On 08/24/2012 09:32 PM, maarten van damme wrote:
I've distiled what I understood from your source and the resulting
executable managed to solve the impossible one in 27 seconds while
your source takes 41 seconds
On Friday, 24 August 2012 at 23:14:02 UTC, maarten van damme
wrote:
http://en.wikipedia.org/wiki/File:Sudoku_puzzle_hard_for_brute_force.jpg
It occurs to me that one of the main reasons why this particular
puzzle would be hard for brute force is that the first line is
blank and more than half
On 08/25/2012 02:51 AM, Chris Cain wrote:
On Friday, 24 August 2012 at 23:14:02 UTC, maarten van damme wrote:
http://en.wikipedia.org/wiki/File:Sudoku_puzzle_hard_for_brute_force.jpg
It occurs to me that one of the main reasons why this particular puzzle
would be hard for brute force is that t
On Saturday, 25 August 2012 at 00:51:23 UTC, Chris Cain wrote:
On Friday, 24 August 2012 at 23:14:02 UTC, maarten van damme
wrote:
http://en.wikipedia.org/wiki/File:Sudoku_puzzle_hard_for_brute_force.jpg
It occurs to me that one of the main reasons why this
particular puzzle would be hard for
how to get fully qualified name of a template function?
In the code below I want to get "util.mod.mymethod!(double)"
I tried everything (see below) to no avail, it just returns
"mymethod";
The closest I get is demangle(mangledName!(fun)), which shouldn't
be hard to convert to what I want, but de
related threads:
http://www.digitalmars.com/d/archives/digitalmars/D/learn/3530.html
from Don Clugston:
I have implemented compile-time demangle metafunctions:
static assert( prettynameof!(A)== "class main.A" );
static assert( qualifiednameof!(A) == "main.A" );
static assert( symbolnameof!(A
40 matches
Mail list logo