On Friday, 9 January 2015 at 07:50:53 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 06:17:53 UTC, Andre wrote:
Hi,
Should following coding work?
string lpad(ubyte length, long n)
{
import std.string: rightJustify;
import std.conv: to;
return rightJustify(to!stri
On Friday, 9 January 2015 at 06:18:53 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Friday, January 09, 2015 00:20:07 Foo via
Digitalmars-d-learn wrote:
On Thursday, 8 January 2015 at 23:06:39 UTC, Nordlöw wrote:
> On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
> Digitalmars-d
On Friday, 9 January 2015 at 06:17:53 UTC, Andre wrote:
Hi,
Should following coding work?
string lpad(ubyte length, long n)
{
import std.string: rightJustify;
import std.conv: to;
return rightJustify(to!string(n), length, '0');
}
enum lpad14(long n) = lpad(14, n
On Fri, 09 Jan 2015 07:10:14 +
FrankLike via Digitalmars-d-learn
wrote:
> On Thursday, 8 January 2015 at 15:15:59 UTC, Robert burner
> Schadek wrote:
> >
> > use canFind like such:
> > bool a = canFind(strs,s) >= 1;
> >
> > let the compiler figger out what the types of the parameter are.
Hello.
disclaimer: please, ignore compiler inlining abilities while you are
reading this post. i'll give some reasoning later.
let's imagine that we have such function:
void putPixel (int x, int y, uint color) {
if ((color&0xff) == 0) {
// replace pixel
} else if ((color&0xff) !
On Thursday, 8 January 2015 at 15:15:59 UTC, Robert burner
Schadek wrote:
use canFind like such:
bool a = canFind(strs,s) >= 1;
let the compiler figger out what the types of the parameter are.
canFind is work for such as :
bool x = canFind(["exe","lib","a","dll"],"a" );
but can't work fo
On Thu, 08 Jan 2015 23:06:38 +
"Nordlöw" via Digitalmars-d-learn
wrote:
> On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
> Digitalmars-d-learn wrote:
> > how can it? compiler doesn't know what the code is supposed to
> > do. if
> > compilers will know such things someday, we can st
Hi,
Should following coding work?
string lpad(ubyte length, long n)
{
import std.string: rightJustify;
import std.conv: to;
return rightJustify(to!string(n), length, '0');
}
enum lpad14(long n) = lpad(14, n);
void main()
{
lpad14(123);
}
There is follow
On Friday, January 09, 2015 00:20:07 Foo via Digitalmars-d-learn wrote:
> On Thursday, 8 January 2015 at 23:06:39 UTC, Nordlöw wrote:
> > On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
> > Digitalmars-d-learn wrote:
> >> how can it? compiler doesn't know what the code is supposed to
> >> d
On Thursday, 8 January 2015 at 23:06:39 UTC, Nordlöw wrote:
On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
Digitalmars-d-learn wrote:
how can it? compiler doesn't know what the code is supposed to
do. if
compilers will know such things someday, we can stop writing
programs
altogether,
On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
Digitalmars-d-learn wrote:
how can it? compiler doesn't know what the code is supposed to
do. if
compilers will know such things someday, we can stop writing
programs
altogether, as compilers will be able to write any program for
us. ;-)
On 07/01/15 16:02, Laeeth Isharc via Digitalmars-d-learn wrote:
class node
{
string name;
node ref;
}
Small recommendation (apart from the reserved word issue which you fixed): it's
generally considered good D style to give structs and classes names that start
with capital letters,
On Thu, Jan 08, 2015 at 07:13:28PM +, Paulo Pinto via Digitalmars-d-learn
wrote:
> On Thursday, 8 January 2015 at 17:42:23 UTC, H. S. Teoh via
> Digitalmars-d-learn wrote:
[...]
> >Vim supports syntax highlighting.
> >
> >But I don't use it either -- I find it distracts from clarity of
> >thou
On Thursday, 8 January 2015 at 17:42:23 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Thu, Jan 08, 2015 at 11:29:29AM +, Laeeth Isharc via
Digitalmars-d-learn wrote:
>this conversation is so funny: well what's wrong with this .
>It's a
>keyword...
>Aa Ha ha ha ha , rol.
>Seriously, is
On 01/08/2015 09:40 AM, H. S. Teoh via Digitalmars-d-learn wrote:
> Vim supports syntax highlighting.
>
> But I don't use it either -- I find it distracts from clarity of
> thought. I use plain vanilla vim in a text-only terminal.
I am halfway there: I use syntax highlighting in Emacs but I chos
On Thu, Jan 08, 2015 at 11:29:29AM +, Laeeth Isharc via Digitalmars-d-learn
wrote:
>
> >this conversation is so funny: well what's wrong with this . It's a
> >keyword...
> >Aa Ha ha ha ha , rol.
> >Seriously, is it so complicated to use a D editor ? I mean with
> >syntax color...
>
> Man afr
On Thu, 08 Jan 2015 15:59:10 +
"Nordlöw" via Digitalmars-d-learn
wrote:
> On Thursday, 8 January 2015 at 15:49:46 UTC, Dragos Carp wrote:
> > On Thursday, 8 January 2015 at 15:45:27 UTC, Nordlöw wrote:
> >> Is
> >>
> >>key in aa ? aa[key] : ValueType.init;
> >>
> >> the most efficient way
On Thursday, 8 January 2015 at 15:49:46 UTC, Dragos Carp wrote:
On Thursday, 8 January 2015 at 15:45:27 UTC, Nordlöw wrote:
Is
key in aa ? aa[key] : ValueType.init;
the most efficient way to maybe return a value from an
associative array aa?
aa.get(key, ValueType.init)
That was too eas
On 1/8/15 12:15 AM, Meta wrote:
On Wednesday, 7 January 2015 at 23:27:19 UTC, anonymous wrote:
Don't do this without `dup`ing. Quoting the documentation:
Oh, whoops. I thought those special variadic args were always allocated
on the heap.
Nope,
Which makes it annoying, what if the argument
On Thursday, 8 January 2015 at 15:45:27 UTC, Nordlöw wrote:
Is
key in aa ? aa[key] : ValueType.init;
the most efficient way to maybe return a value from an
associative array aa?
aa.get(key, ValueType.init)
On 1/7/15 3:10 PM, Artem Tarasov wrote:
I'm trying to compile my software with the latest compiler, and it spits
out the following error:
$ make
<...>
rdmd --force --build-only -IBioD -g -L-Lhtslib -L-l:libhts.a
-L-l:libphobos2.a -ofbuild/sambamba.o main.d
<...>
/tmp/.rdmd-1000/rdmd-main.d-5E103
Is
key in aa ? aa[key] : ValueType.init;
the most efficient way to maybe return a value from an
associative array aa?
use canFind like such:
bool a = canFind(strs,s) >= 1;
let the compiler figger out what the types of the parameter are.
I just saw this post, which is essentially the same question as
Basile Burg's. I hope that a college (in France?) is teaching D
and that this is a homework assignment. Cool stuff! :)
Maybe using templates to create properties is a bit overkill in
this example. But I could not solve what I thou
On Wednesday, 7 January 2015 at 17:08:55 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
Try this:
http://dlang.org/phobos-prerelease/std_algorithm#.findAmong
T
Thank you,it can work. but it's not what I want.
---test.d--
import std.stdio, std.algorithm,std.s
On Wednesday, 7 January 2015 at 17:08:55 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
Try this:
http://dlang.org/phobos-prerelease/std_algorithm#.findAmong
T
You mean ? The result is not that I want to get!
---test.d--
import std.stdio, std.algorithm,std.s
On Thursday, 8 January 2015 at 10:11:38 UTC, Danny wrote:
Hi,
sigh, so I have to annoy you with the truth...
On Tuesday, 6 January 2015 at 17:15:28 UTC, FrankLike wrote:
How to prevent sensitive information is displayed when the
extension 'exe' is modified to 'txt' on windows?
By not putting
On Wednesday, 7 January 2015 at 20:10:35 UTC, Artem Tarasov wrote:
I'm trying to compile my software with the latest compiler, and
it spits out the following error:
$ make
<...>
rdmd --force --build-only -IBioD -g -L-Lhtslib -L-l:libhts.a
-L-l:libphobos2.a -ofbuild/sambamba.o main.d
<...>
/tm
On Thursday, 8 January 2015 at 11:29:30 UTC, Laeeth Isharc wrote:
this conversation is so funny: well what's wrong with this .
It's a keyword...
Aa Ha ha ha ha , rol.
Seriously, is it so complicated to use a D editor ? I mean
with syntax color...
Man afraid to ask stoopid questions stays st
this conversation is so funny: well what's wrong with this .
It's a keyword...
Aa Ha ha ha ha , rol.
Seriously, is it so complicated to use a D editor ? I mean with
syntax color...
Man afraid to ask stoopid questions stays stoopid. And compiler
error message far from informative.
Not every
Hi,
sigh, so I have to annoy you with the truth...
On Tuesday, 6 January 2015 at 17:15:28 UTC, FrankLike wrote:
How to prevent sensitive information is displayed when the
extension 'exe' is modified to 'txt' on windows?
By not putting it in in the first place. Everything else is no
good in t
Hello!
I'm trying to generate documentation for a library.
I like result of DDOX generation - nice navigation by modules and
classes.
But I cannot figure out how to generate custom pages (e.g. from
.dd .d Ddoc), and how to add links to custom pages to all
generated pages, e.g. like on Vibe.d d
On Tuesday, 6 January 2015 at 16:02:24 UTC, Laeeth Isharc wrote:
I downgraded dmd and now have a different problem with tango at
link stage, which is progress of a sort. (I updated the
ticket).
Do you have to compile it yourself? Arch comes with dstep in
their package repository, put there
what's wrong with the code above ? i get an error no
identifier for declarator node. (I have not used classes
much, since structs often seem to be enough for what I need
to do mostly).
ref is a reserved keyword.
--
Paulo
this conversation is so funny: well what's wrong with this .
It
On Thursday, 8 January 2015 at 01:22:54 UTC, Rikki Cattermole
wrote:
Have you got opEqual's defined?
Its wanting that and toHash I think.
Yes, I have opEquals defined. I've just tried to add dummy toHash
(returning a constant), but it doesn't help :(
OK, it seems I'll have to stick with 2.06
35 matches
Mail list logo