On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote:
// This is where things breaks
{
ubyte[] buff = new ubyte[16];
buff[0..ATA_STR.length] = cast(ubyte[])(ATA_STR);
// read the string back from the buffer, stripping
whitespace
string stringFromBuffer =
You fill first few chars with data from
ATA_STR but the rest 10 bytes of the array are still part of
the string
Edit: you fill first 5 chars and have 11 bytes of zeroes in the
tail. My counting skill is too bad. ;)
On 17/10/14 07:38, maarten van damme via Digitalmars-d-learn wrote:
While d can be complex, there's nothing preventing you from starting out
simple and not using all features at first.
I don't understand why it's not suitable for a beginner if you use this
approach...
For some reasons, in my vi
On Friday, 17 October 2014 at 05:38:51 UTC, maarten van damme via
Digitalmars-d-learn wrote:
While d can be complex, there's nothing preventing you from
starting out
simple and not using all features at first.
I don't understand why it's not suitable for a beginner if you
use this
approach...
On 17/10/14 03:05, ketmar via Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 00:52:14 +
MachineCode via Digitalmars-d-learn
wrote:
I don't understand. If at least it were C but java? why not D
itself?
C is *awful* as "beginner's language". never ever let people start with
C if you don't h
On 17/10/14 09:29, thedeemon via Digitalmars-d-learn wrote:
On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote:
// This is where things breaks
{
ubyte[] buff = new ubyte[16];
buff[0..ATA_STR.length] = cast(ubyte[])(ATA_STR);
// read the string back from the
Are you sure your package/dub.json is valid JSON? You can check
it here:
http://jsonlint.com/
Atila
On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote:
Any way of using dub (on Windows or OSX). I've been trying it
lately, but not much success.
1. (In the command prompt or Terminal), I
Ola Fosheim Grøstad:
The IDE support is probably a bit better with Java/C#
The importance of the IDE for the first language is
controversial. I think it's not so important.
and using a statically typed language as your first language
has advantages,
While no one has determined scientifi
On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 00:52:14 +
MachineCode via Digitalmars-d-learn
wrote:
I don't understand. If at least it were C but java? why not D
itself?
C is *awful* as "beginner's language". never ever let people
On Friday, 17 October 2014 at 08:33:46 UTC, bearophile wrote:
The IDE support is probably a bit better with Java/C#
The importance of the IDE for the first language is
controversial. I think it's not so important.
Perhaps it depends on the person and the language, but I would
think autocomp
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks l
On Friday, 17 October 2014 at 09:31:45 UTC, Chris wrote:
An "instantly rewarding" language is Lua (lua.org).
In basic you can easily get simple graphics too, it's really
interesting for learning, because your program can perform simple
visual tasks:
http://www.freebasic.net/wiki/wikka.php?wakk
On Fri, 17 Oct 2014 10:10:09 +0200
spir via Digitalmars-d-learn wrote:
> What you say here applies, I guess, to many other points. I applaud
> Ali for writing a tutorial like his but... Check it (just the first
> pages is enough) for literally the dozens of notions one must know
> and master for
On Fri, 17 Oct 2014 04:51:14 +
via Digitalmars-d-learn wrote:
> I personally think Logo, Processing and Scheme would be more fun
> as learning tools, but they are throw-away languages.
yet Scheme will teach how to write functional code. it's a valuable
knowledge for D programmer.
signature
On Fri, 17 Oct 2014 13:13:36 +
Kagamin via Digitalmars-d-learn
wrote:
> In IDE you press F5 and see the program running.
with REPL you typing code, pressing "enter" and see the code running.
signature.asc
Description: PGP signature
On Friday, 17 October 2014 at 08:44:00 UTC, Paulo Pinto wrote:
On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 00:52:14 +
MachineCode via Digitalmars-d-learn
wrote:
I don't understand. If at least it were C but java? why not D
itsel
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks l
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 10:10:09 +0200
spir via Digitalmars-d-learn
wrote:
computer programming is the literacy of the new age.
Let's say, computer knowledge. There are also database
administrators, package main
On Fri, 17 Oct 2014 14:33:57 +
eles via Digitalmars-d-learn wrote:
> On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
> Digitalmars-d-learn wrote:
> > On Fri, 17 Oct 2014 10:10:09 +0200
> > spir via Digitalmars-d-learn
> > wrote:
>
> > computer programming is the literacy of the new
On Friday, 17 October 2014 at 08:31:04 UTC, spir via
Digitalmars-d-learn wrote:
On 17/10/14 09:29, thedeemon via Digitalmars-d-learn wrote:
On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote:
// This is where things breaks
{
ubyte[] buff = new ubyte[16];
buff[0..ATA_S
On Fri, 17 Oct 2014 15:24:21 +
Lucas Burson via Digitalmars-d-learn
wrote:
> So given the below buffer would I use fromStringz (is this in the
> stdlib?) to cast it from a null-terminated buffer to a good
> string? Shouldn't the compiler give a warning about casting a
> buffer to a string
On Fri, 17 Oct 2014 18:30:43 +0300
ketmar via Digitalmars-d-learn
wrote:
> > Shouldn't the compiler give a warning about casting a
> > buffer to a string without using fromStringz?
nope. such casting is perfectly legal, as D strings can contain
embedded '\0's.
signature.asc
Description: PGP si
On Friday, 17 October 2014 at 14:38:39 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 14:33:57 +
eles via Digitalmars-d-learn
wrote:
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Fri, 17 Oct 2014 10:10:09 +0200
> spir via Digitalm
On Fri, 17 Oct 2014 15:40:24 +
Chris via Digitalmars-d-learn wrote:
> But then people won't trust them bloody machines an inch anymore!
> :-)
most people believe that technology is magic. yes, maybe it's too cruel
to ruin their illusions...
signature.asc
Description: PGP signature
. D is pristine clean and immensely powerful.
. D is arguably the actual state-of-the-art programming language.
. Ali's book is a gem. Clear, concise and complete.
http://ddili.org/ders/d.en/
. D is the best investment you can make for your career, right
now.
. D has Java beans for breakf
On Friday, 17 October 2014 at 14:00:43 UTC, ketmar via
Digitalmars-d-learn wrote:
yet Scheme will teach how to write functional code. it's a
valuable knowledge for D programmer.
I think spending a few days with Scheme is valuable for all
programmers.
By being a minimal language you get down
On Friday, 17 October 2014 at 15:30:52 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 15:24:21 +
Lucas Burson via Digitalmars-d-learn
wrote:
So given the below buffer would I use fromStringz (is this in
the stdlib?) to cast it from a null-terminated buffer to a
good string
This is
I'm looking for suggestions for a GUI library, to create a
somewhat light GUI that can also be created without too much
fuss, and support for Windows & Linux.
The GUI I'm looking to make would be one that is just one window,
with support for tabs (just like the ones in the properties page
for ite
I haven't touched any key on a keyboard and haven't pressed
*Send* but message was posted somehow.
Thanks. Checking for UTF-8 continuation bytes is good idea. Also
I agree that UTF-16 is more difficult. I will keep it for future
release when implementation will start to work properly on UTF-8
I'm starting a new project, and I plan on creating a C interface
in case other languages want to use it. I remember reading
something(but my googlefu is weak today) about having to
initialize the runtime if you are using D inside another
language. Can anyone confirm this is the case?
I just w
I highly recommend gtkD.
It works on Windows, OSX, and Linux and provides a very nice OO
interface to Gtk+.
http://gtkd.org/
On Friday, 17 October 2014 at 16:41:21 UTC, Jeremy DeHaan wrote:
I highly recommend gtkD.
It works on Windows, OSX, and Linux and provides a very nice OO
interface to Gtk+.
http://gtkd.org/
ooo looks pretty good. I'll go try it out;
Thanks, Jeremy!
I'm curious as to why using scope to allocate classes on the
stack was marked for future deprecation.
I mean, sure it could be potentially unsafe, but the new library
solution (using std.typecons.scoped) does the exact same thing
and is just as unsafe for the same reasons, is it not? I would
Am 17.10.2014 um 16:14 schrieb Jessica Rauth:
On Friday, 17 October 2014 at 08:44:00 UTC, Paulo Pinto wrote:
On Friday, 17 October 2014 at 01:05:37 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 00:52:14 +
MachineCode via Digitalmars-d-learn
wrote:
I don't understand. If
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote:
I'm starting a new project, and I plan on creating a C
interface in case other languages want to use it. I remember
reading something(but my googlefu is weak today) about having
to initialize the runtime if you are using D inside
On Friday, 17 October 2014 at 16:34:04 UTC, K.K. wrote:
I'm looking for suggestions for a GUI library, to create a
somewhat light GUI that can also be created without too much
fuss, and support for Windows & Linux.
The GUI I'm looking to make would be one that is just one
window,
with support
On Friday, 17 October 2014 at 16:56:50 UTC, Jeremy DeHaan wrote:
I'm curious as to why using scope to allocate classes on the
stack was marked for future deprecation.
It was never implemented correctly (it is supposed prove it never
leaves the scope, and is thus safe to be on the stack), so ra
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote:
I remember reading something(but my googlefu is weak today)
about having to initialize the runtime if you are using D
inside another language. Can anyone confirm this is the case?
Yeah, unless the main() is in D, you need to run
On Friday, 17 October 2014 at 17:14:30 UTC, K.K. wrote:
Sorry if this isn't the most helpful answer but.. Do you have
Adam Ruppe's book?
buy my book too, and write amazon reviews :P
A lot of the topics in there were chosen because there are
questions that come up somewhat often on this forum
On Friday, 17 October 2014 at 17:18:34 UTC, Adam D. Ruppe wrote:
On Friday, 17 October 2014 at 16:35:46 UTC, Jeremy DeHaan wrote:
I remember reading something(but my googlefu is weak today)
about having to initialize the runtime if you are using D
inside another language. Can anyone confirm thi
On Thursday, 16 October 2014 at 19:19:21 UTC, John Colvin wrote:
On Thursday, 16 October 2014 at 18:39:50 UTC, nrgyzer wrote:
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example("example1", 1)
void myFunction()
{
//
On Fri, 17 Oct 2014 16:08:04 +
Lucas Burson via Digitalmars-d-learn
wrote:
> The buffer is populated from a scsi ioctl so it "should" be only
> ascii and null-terminated but it's a good idea to harden the code
> a bit.
> Thank you for your help!
i developed a habit of making such buffers on
Basicly what I am trying to do is have a function template that
will generate its parameters to be arrays of the types of a type
tuple.
So for instance the parameters of f!(int, char) would be (int[],
char[])...
No matter what I try, the compiler vomits all over me...
On Fri, 17 Oct 2014 17:44:47 +
Tofu Ninja via Digitalmars-d-learn
wrote:
> Basicly what I am trying to do is have a function template that
> will generate its parameters to be arrays of the types of a type
> tuple.
>
> So for instance the parameters of f!(int, char) would be (int[],
> cha
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote:
Not sure if what I wrote made sense, instead I will just post the
code that is vomiting on me...
template arrayType(T)
{
alias arrayType = T[];
}
template multiAccess(Args ...)
{
auto multiAccess(int i, staticMap!(a
On 10/17/2014 10:44 AM, Tofu Ninja wrote:
Basicly what I am trying to do is have a function template that will
generate its parameters to be arrays of the types of a type tuple.
So for instance the parameters of f!(int, char) would be (int[], char[])...
No matter what I try, the compiler vomits
On Friday, 17 October 2014 at 17:55:14 UTC, Ali Çehreli wrote:
Yeah.. I dont think I was clear the first time...
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote:
Also my inability to get this working is probably rooted in my
lack of understanding of the differences between tuple vs Tuple
vs TypeTuple vs expression tuples ...
On Fri, 17 Oct 2014 17:57:57 +
Tofu Ninja via Digitalmars-d-learn
wrote:
> On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote:
>
> Not sure if what I wrote made sense, instead I will just post the
> code that is vomiting on me...
still can't grasp what you want to achieve. do you
On Fri, 17 Oct 2014 17:44:47 +, Tofu Ninja wrote:
> Basicly what I am trying to do is have a function template that will
> generate its parameters to be arrays of the types of a type tuple.
>
> So for instance the parameters of f!(int, char) would be (int[],
> char[])...
>
> No matter what I
On Friday, 17 October 2014 at 18:22:12 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 17:57:57 +
Tofu Ninja via Digitalmars-d-learn
wrote:
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote:
Not sure if what I wrote made sense, instead I will just post
the cod
On 10/17/2014 11:35 AM, Tofu Ninja wrote:
> I am not even sure any more, I am starting to get lost in the tuple
> madness...
You want to write a function that takes an index and a number of arrays;
and returns an N-ary Tuple where N matches the number arrays passed to
the function: :p
asse
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote:
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote:
Not sure if what I wrote made sense, instead I will just post
the code that is vomiting on me...
You forgot the imports.
template arrayType(T)
{
alias arrayTyp
On Friday, 17 October 2014 at 16:39:38 UTC, Uranuz wrote:
I haven't touched any key on a keyboard and haven't pressed
*Send* but message was posted somehow.
Scan for rootkits...
On Friday, 17 October 2014 at 19:03:42 UTC, anonymous wrote:
On Friday, 17 October 2014 at 17:57:58 UTC, Tofu Ninja wrote:
On Friday, 17 October 2014 at 17:44:48 UTC, Tofu Ninja wrote:
Not sure if what I wrote made sense, instead I will just post
the code that is vomiting on me...
You forgot
On Fri, 17 Oct 2014 19:13:51 +
eles via Digitalmars-d-learn wrote:
> On Friday, 17 October 2014 at 16:39:38 UTC, Uranuz wrote:
> > I haven't touched any key on a keyboard and haven't pressed
> > *Send* but message was posted somehow.
>
> Scan for rootkits...
or touchpad. ;-)
signature.asc
On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote:
I had the imports, I just didn't post them. My problem is most
likely that I used Tuple! instead of tuple... which is probably
because the differences between the like 20(exaggeration)
different types of tuples in D are confusing as
On Fri, 17 Oct 2014 11:56:31 -0700, Ali Çehreli wrote:
> You want to write a function that takes an index and a number of arrays;
> and returns an N-ary Tuple where N matches the number arrays passed to
> the function: :p
http://dlang.org/phobos/std_range.html#transversal
On Friday, 17 October 2014 at 19:32:40 UTC, anonymous wrote:
On Friday, 17 October 2014 at 19:18:29 UTC, Tofu Ninja wrote:
I had the imports, I just didn't post them. My problem is most
likely that I used Tuple! instead of tuple... which is
probably because the differences between the like
20(
On Fri, 17 Oct 2014 20:25:26 +, Tofu Ninja wrote:
> Yeah, the part that fixed it was Tuple! to tuple. Thanks for the help. I
> think this fixes my problem.
I think std.range.transversal already provides the functionality you're
looking for.
http://dlang.org/phobos/std_range.html#transversal
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
Digitalmars-d-learn wrote:
that's why i'm sure that basic programming must be teached in
school.
hey, the whole our civilization will collapse without computers!
computer programming is the literacy of the new age.
This is nonsense and I s
On Fri, 17 Oct 2014 20:40:37 +
Joakim via Digitalmars-d-learn
wrote:
> On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via
> Digitalmars-d-learn wrote:
> > that's why i'm sure that basic programming must be teached in
> > school.
> > hey, the whole our civilization will collapse without
On Friday, 17 October 2014 at 08:32:13 UTC, Atila Neves wrote:
Are you sure your package/dub.json is valid JSON? You can check
it here:
http://jsonlint.com/
Atila
On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote:
Any way of using dub (on Windows or OSX). I've been trying it
lately, b
On Friday, 17 October 2014 at 22:01:22 UTC, Joel wrote:
On Friday, 17 October 2014 at 08:32:13 UTC, Atila Neves wrote:
Are you sure your package/dub.json is valid JSON? You can
check it here:
http://jsonlint.com/
Atila
On Thursday, 16 October 2014 at 22:22:14 UTC, Joel wrote:
Any way of usin
On Friday, 17 October 2014 at 21:20:29 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 17 Oct 2014 20:40:37 +
Joakim via Digitalmars-d-learn
wrote:
This is nonsense and I see it repeated all the time, with
code.org and other efforts. Do you know how to fix your car,
washing machine,
On Fri, 17 Oct 2014 23:31:45 +
Joakim via Digitalmars-d-learn
wrote:
> You do realize that most people are clueless about how to fix
> those also, right?
most people are stupid.
> Would you require that how to fix all that
> mechanical stuff be taught in schools too?
but it is! or at least
On Sat, 18 Oct 2014 03:05:58 +0300
ketmar via Digitalmars-d-learn
wrote:
p.p.s. just in case: i'm not talking about personalities here, sorry if
i was offencive.
signature.asc
Description: PGP signature
On Friday, 17 October 2014 at 17:40:09 UTC, ketmar via
Digitalmars-d-learn wrote:
i developed a habit of making such buffers one byte bigger than
necessary and just setting the last byte to 0 before
converting. this
way it's guaranteed to be 0-terminated.
Perfect, great idea. Below is my ut
On Sat, 18 Oct 2014 00:32:09 +
Lucas Burson via Digitalmars-d-learn
wrote:
> On Friday, 17 October 2014 at 17:40:09 UTC, ketmar via
> Digitalmars-d-learn wrote:
>
> > i developed a habit of making such buffers one byte bigger than
> > necessary and just setting the last byte to 0 before
>
On Sat, 18 Oct 2014 00:32:09 +
Lucas Burson via Digitalmars-d-learn
wrote:
p.s. it's ok to take '.length' from 'null' array. compiler is smart
enough.
signature.asc
Description: PGP signature
Hi, everyone, first post here. I'm trying to learn to parse D
code.
The line "alias StorageClassesopt BasicType Declarator" in
http://dlang.org/grammar#AliasDeclaration is apparently missing a
semicolon after Declarator.
If that line is not missing a semicolon, could someone please
explain
On Sat, 18 Oct 2014 00:52:22 +
Solomon E via Digitalmars-d-learn
wrote:
> The line "alias StorageClassesopt BasicType Declarator" in
> http://dlang.org/grammar#AliasDeclaration is apparently missing a
> semicolon after Declarator.
this line should be removed altogether to stop people using
On Friday, 17 October 2014 at 17:21:11 UTC, Adam D. Ruppe wrote:
On Friday, 17 October 2014 at 17:14:30 UTC, K.K. wrote:
Sorry if this isn't the most helpful answer but.. Do you have
Adam Ruppe's book?
buy my book too, and write amazon reviews :P
A lot of the topics in there were chosen becau
On Saturday, 18 October 2014 at 00:52:23 UTC, Solomon E wrote:
Hi, everyone, first post here. I'm trying to learn to parse D
code.
Just in case, I'll remind these two projects that might be
helpful:
https://github.com/Hackerpilot/libdparse
https://github.com/Hackerpilot/DGrammar
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks l
On 18/10/2014 3:00 p.m., RBfromME wrote:
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D lang as a
general purposing language to learn, yet the D overview indicates that
java would be a better language to learn for your f
Thank you both. That DGrammar project has some different names
for the nonterminals in its grammar, and a different arrangement,
but it confirms there should be a semicolon with any alias
statement. I'm just trying to parse D when I read it myself so
far, and figure out how the grammar works a
On Sat, 18 Oct 2014 02:54:21 +
Solomon E via Digitalmars-d-learn
wrote:
> Thank you both. That DGrammar project has some different names
> for the nonterminals in its grammar, and a different arrangement,
> but it confirms there should be a semicolon with any alias
> statement. I'm just tr
79 matches
Mail list logo