On Monday, 23 September 2024 at 20:02:25 UTC, Craig Dillabaugh
wrote:
On Monday, 23 September 2024 at 19:52:02 UTC, Craig Dillabaugh
wrote:
Why does the following program:
snip
Opps, sorry. I was expecting 7680 (not -1 or 5568).
After a bit of research I see this is the same behavior as C
On Monday, 23 September 2024 at 19:52:02 UTC, Craig Dillabaugh
wrote:
Why does the following program:
\
import std.stdio;
int main(string[] args) {
uint Q = 7681;
writeln("Val = ", -1 % Q);
return 0;
}
\
Print
On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize
some purchases. It's the kind of thing I could probably write
in a couple of hours in C#/Java + html/css/javascript. However,
something keeps drawing me to D and as this is a simpl
On Wednesday, 22 April 2020 at 18:35:49 UTC, CraigDillabaugh
wrote:
On Wednesday, 22 April 2020 at 18:23:48 UTC, Anonymouse wrote:
On Wednesday, 22 April 2020 at 17:48:18 UTC, Craig Dillabaugh
wrote:
clip
File an issue if you have the time, maybe it will get
attention. Unreported bugs can
So perhaps I am the only person in the world using std.json, but
I was wondering
if the following code should work.
=
import std.json;
import std.conv;
import std.stdio;
struct Person {
string name;
float income;
t
On Saturday, 15 February 2020 at 11:32:42 UTC, AlphaPurned wrote:
I've tried 10 different ways with split and splitter, I've used
all the stuff that people have said online but nothing works. I
always get a template mismatch error.
Why is something so easy to do so hard in D?
auto toks = std.
On Friday, 5 July 2019 at 12:00:15 UTC, Binarydepth wrote:
I've considering learning full D. I remembered that D is not
recommended as a first language, So I read time ago.
So my question, is learning C and Python a good intro before
learning D?
TY
Ali's book is targeted at beginners (see
On Wednesday, 7 February 2018 at 03:25:05 UTC, rikki cattermole
wrote:
On 06/02/2018 8:46 PM, Craig Dillabaugh wrote:
On Tuesday, 6 February 2018 at 18:46:54 UTC, H. S. Teoh wrote:
[...]
clip
[...]
clip
[...]
Wouldn't it be more accurate to say OO is not the correct tool
for ever
On Tuesday, 6 February 2018 at 18:46:54 UTC, H. S. Teoh wrote:
On Tue, Feb 06, 2018 at 06:33:02PM +, Ralph Doncaster via
Digitalmars-d-learn wrote:
clip
OO is outdated. D uses the range-based idiom with UFCS for
chaining operations in a way that doesn't require you to write
loops yourse
On Monday, 4 December 2017 at 20:43:27 UTC, Dirk wrote:
Hi!
I defined an interface:
interface Medoid {
float distance( Medoid other );
uint id() const @property;
}
and a class implementing that interface:
class Item : Medoid {
float distance( Item i ) {...}
uint id() const @pr
On Thursday, 15 June 2017 at 13:41:07 UTC, MGW wrote:
On Thursday, 15 June 2017 at 13:16:24 UTC, CRAIG DILLABAUGH
wrote:
The purpose - search of changes in file system.
Sorting is a slow operation as well as hashing. Creation of a
tree, is equally in sorting.
So far the best result:
string
On Thursday, 15 June 2017 at 11:48:54 UTC, Ivan Kazmenko wrote:
On Thursday, 15 June 2017 at 06:06:01 UTC, MGW wrote:
There are two arrays of string [] mas1, mas2; Size of each
about 5M lines. By the size they different, but lines in both
match for 95%. It is necessary to find all lines in an a
On Wednesday, 27 July 2016 at 14:56:13 UTC, Suliman wrote:
On Wednesday, 27 July 2016 at 12:47:14 UTC, chmike wrote:
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
clip
Sorry, its my issue I am thinging about polygons, but for me
would be enought points.
The problem is next. I am
On Wednesday, 27 July 2016 at 09:39:18 UTC, Suliman wrote:
On Wednesday, 27 July 2016 at 08:40:15 UTC, chmike wrote:
The algorithm is to draw a horizontal (or vertical) half line
starting at your point and count the number of polygon edges
crossed by the line. If that number is even, the point
On Wednesday, 6 July 2016 at 02:33:02 UTC, ketmar wrote:
On Wednesday, 6 July 2016 at 02:19:47 UTC, Craig Dillabaugh
wrote:
[...]
this is true for any dynamic array, including AAs. until
something is added to array, it actually a `null` pointer. i.e.
arrays (and AAs) generally consisting of
On Wednesday, 6 July 2016 at 02:03:54 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 July 2016 at 01:58:31 UTC, Craig Dillabaugh
wrote:
*(keyvalue) ~ value; // This line fails.
That should prolly be ~= instead of ~.
Ahh, I was so close. Thank you that seems to do the trick.
However
How can I create (and update) and associative array where the key
is a string, and the value is a dynamic array of integers?
For example:
void insertValue( int[][string]aa, string key, int value )
{
int[]* keyvalue;
keyvalue = ( key in aa );
if ( keyvalue !is null )
{
*
On Wednesday, 6 April 2016 at 19:01:58 UTC, Craig Dillabaugh
wrote:
On Wednesday, 6 April 2016 at 15:10:45 UTC, Andre wrote:
clip
Not so up to date on D's OOP stuff, but don't you want create()
to be protected, not private. You can typically access a
private method through a
On Wednesday, 6 April 2016 at 15:10:45 UTC, Andre wrote:
Hi,
With 2.071 following coding does not compile anymore and
somehow I feel it should compile.
The issue is with line "cat.create();".
Cat is a sub type of Animal. Animal "owns" method create and I
want to call the method
create within
On Thursday, 24 December 2015 at 00:16:16 UTC, rsw0x wrote:
On Tuesday, 22 December 2015 at 21:38:22 UTC, ZombineDev wrote:
On Tuesday, 22 December 2015 at 17:49:34 UTC, Jakob Jenkov
wrote:
clip
removed C++ because it just dwarfs the others.
D, as I expected, has a massive following in Japan
On Tuesday, 4 August 2015 at 08:18:58 UTC, John Colvin wrote:
On Tuesday, 4 August 2015 at 03:20:38 UTC, Craig Dillabaugh
wrote:
I can now run it with:
LD_LIBRARY_PATH=/home/craig2/code/gdal-2.0.0/lib64 ./gdaltest
But it appears the LD_LIBRARY_PATH hack is causing havoc with
other libraries
On Tuesday, 4 August 2015 at 04:21:27 UTC, Joakim Brännström
wrote:
On Tuesday, 4 August 2015 at 03:20:38 UTC, Craig Dillabaugh
wrote:
clip
Linkers, so fun they are...
https://wiki.debian.org/RpathIssue
As you can see in the search order RPATH takes precedence over
LD_LIBRARY_PATH.
If we
On Tuesday, 4 August 2015 at 02:45:21 UTC, Joakim Brännström
wrote:
On Tuesday, 4 August 2015 at 02:26:17 UTC, Craig Dillabaugh
wrote:
So how can I force my application to link to my local copy of
GDAL2 at /home/craig2/code/gdal-2.0.0/lib64. Any help is
appreciated.
Hi,
I recently ran into
er, I also have the older GDAL libraries
(1.11) installed system wide on my machine.
My GDAL bindings have the following dub.json file:
{
"name": "gdald",
"description": "D bindings for the Geospatial Data Abstraction
Library (GDAL).",
&qu
On Friday, 10 July 2015 at 03:38:49 UTC, Craig Dillabaugh wrote:
I am trying to bind to a C union with a number of nested
structs declared as follows:
typedef union {
int Integer;
struct {
int nCount;
int *paList;
} IntegerList;
struct
I am trying to bind to a C union with a number of nested structs
declared as follows:
typedef union {
int Integer;
struct {
int nCount;
int *paList;
} IntegerList;
struct {
int nCount;
GIntBig *paList;
} Integer64List;
}
On Wednesday, 15 April 2015 at 04:43:39 UTC, Daniel Kozák wrote:
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
Hi.
I want to call a C library function that returns a data buffer
as a void*. How do I convert the resulting void* into
something I can
Hi.
I want to call a C library function that returns a data buffer as
a void*. How do I convert the resulting void* into something I
can process in D?
//I have the following function from the GDAL C library.
extern(C) CPLErr GDALReadBlock( GDALRasterBandH, int, int, void*
);
So I have (GB
On Saturday, 21 March 2015 at 21:53:00 UTC, H. S. Teoh wrote:
On Sat, Mar 21, 2015 at 05:48:40PM +, Craig Dillabaugh via
Digitalmars-d-learn wrote:
Motivated by this thread:
http://forum.dlang.org/thread/measc3$qic$1...@digitalmars.com
I was hoping to see if I could do some work on the
Motivated by this thread:
http://forum.dlang.org/thread/measc3$qic$1...@digitalmars.com
I was hoping to see if I could do some work on the Phobos
documentation, but I am curious to know what the easiest way for
someone with limited/no ddoc experience to get involved in this
would be. I check
On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
yes,java is good lang,but i dont think it's better than c#,if
no oracle or google support java will less and less.
C# is a good and easy lang.
i like C# .
but,C# cant compiled to native code.
So far, I have been searching for a language,
On Tuesday, 3 June 2014 at 17:41:27 UTC, Chris Saunders wrote:
Thanks, I somehow missed the vibe.d forums...
I'd need an ldc solution in the end, but trying dmd is a good
idea. The result is some kind of link error to libevent?:
"""
dub build
vibe-d: ["vibe-d", "libevent", "openssl"]
test: [
On Tuesday, 3 June 2014 at 16:16:10 UTC, Chris Saunders wrote:
I've made my first attempt to use dub/vibe.d and I'm running
into some issues I can't find on the list.
I'm on Ubuntu 14.04/x86_64, using the latest stable dub
(0.9.21). I can create a new dub project:
“””
$ dub init test vibe.d
On Friday, 16 May 2014 at 01:16:46 UTC, Craig Dillabaugh wrote:
On Thursday, 15 May 2014 at 22:25:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
I am a volunteer developer with the well-known 3D CAD FOSS
project BRL-CAD:
http://brlcad.org
I have wanted to use D for a long time but I
using DUB. For
example here is the DUB config file for one of my library
bindings (in my case I used a static library though):
{
"name": "shplib",
"description": "D bindings for Shapelib. Shapefile
reader.",
"ho
On Saturday, 26 April 2014 at 13:30:41 UTC, Adam D. Ruppe wrote:
On Saturday, 26 April 2014 at 08:45:59 UTC, Craig Dillabaugh
wrote:
Can anyone tell me what I am dong wrong.
In this case, I'd close the pipe when you're done.
pipes.stdin().writeln("Hello world");
I want to be able to write to the stdin stream of an external
process using std.process. I have the following small test app.
myecho.d
--
import std.stdio;
void main(string[] args)
{
foreach (line; stdin.byLine()) {
std
On Thursday, 24 April 2014 at 12:17:42 UTC, Nicolas wrote:
I have a json string saved in a file ( example of json tweeter
answer:
https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline
). I am trying to read the whole json answer and print specific
data ("created_at", "retweet_count",
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote:
I have a program in C++ that I am translating to D as a way to
investigate and learn D. The program is used to process
potentially hundreds of TB's of financial transactions data so
it is crucial that it be performant. Right now the C++ versi
On Thursday, 20 February 2014 at 10:28:45 UTC, simendsjo wrote:
http://youtu.be/wFqHTCBt72M
Thanks for posting these. They are well done. What text editor
are you using, emacs?
On Wednesday, 19 February 2014 at 23:45:12 UTC, Etienne Cimon
wrote:
On 2014-02-19 17:15, Craig Dillabaugh wrote:
However, I would still be interested in finding out where I
could get a
listing of what the various exit codes mean ... or do I need
to delve
into the DMD source code?
That
On Thursday, 20 February 2014 at 08:10:06 UTC, simendsjo wrote:
On Wednesday, 19 February 2014 at 22:15:47 UTC, Craig
Dillabaugh wrote:
(...)
I just realized that I tried to build this on my Linode, where
DMD tends to choke and die with anything Vibe-d related (basic
Linodes have very little
On Wednesday, 19 February 2014 at 22:07:55 UTC, Craig Dillabaugh
wrote:
I am trying to build a small application (I am using DUB) and
when I try to build, I get the following output:
dub build
dub: /usr/lib64/libcurl.so.4: no version information available
(required by dub)
vibe-d: ["v
I am trying to build a small application (I am using DUB) and
when I try to build, I get the following output:
dub build
dub: /usr/lib64/libcurl.so.4: no version information available
(required by dub)
vibe-d: ["vibe-d", "libevent", "openssl"]
vibe-d: ["vibe-d", "libevent", "openssl"]
libd: [
On Friday, 14 February 2014 at 16:47:32 UTC, John Colvin wrote:
On Friday, 14 February 2014 at 16:40:31 UTC, Craig Dillabaugh
wrote:
On Friday, 14 February 2014 at 16:00:09 UTC, Robin wrote:
this(size_t rows, size_t cols) {
this.dim = Dimension(rows, cols);
this.data = new T
On Friday, 14 February 2014 at 16:00:09 UTC, Robin wrote:
this(size_t rows, size_t cols) {
this.dim = Dimension(rows, cols);
this.data = new T[this.dim.size];
enum nil = to!T(0);
foreach(ref T element; this.data) element = nil;
}
I am no expert at optimizing D co
On Tuesday, 4 February 2014 at 16:13:33 UTC, Dicebot wrote:
On Tuesday, 4 February 2014 at 16:02:33 UTC, Craig Dillabaugh
wrote:
However if I run /sbin/ifconfig I get:
enp7s0Link encap:Ethernet HWaddr 50:E5:49:9B:29:49
inet addr:10.1.101.52 Bcast:10.1.101.255
Mask
On Tuesday, 4 February 2014 at 15:48:50 UTC, Vladimir Panteleev
wrote:
On Tuesday, 4 February 2014 at 13:02:26 UTC, TheFlyingFiddle
wrote:
I'm trying to find my own ip address using std.socket with
little success. How would i go about doing this? (It should be
a AddressFamily.INET socket)
Thi
type to support only
floating-point values, so you can see here how types can be
restricted to FP (see line 50).
https://github.com/craig-dillabaugh/phobos/blob/master/std/complex.d
Thats my fork of the Phobos libraries, likely a bit out of date,
but I was too lazy to look up the prope URL.
On Thursday, 30 January 2014 at 09:03:47 UTC, Gary Willoughby
wrote:
On Thursday, 30 January 2014 at 03:28:57 UTC, Craig Dillabaugh
wrote:
So, there is a module core.stdc.config (referenced here):
http://dlang.org/interfaceToC.html
That is presumably part of the D Standard library. I am
On Thursday, 30 January 2014 at 07:26:51 UTC, Jacob Carlborg
wrote:
On 2014-01-30 05:42, Mike Parker wrote:
All of the core.* modules are part of DRuntime, not Phobos.
Unfortunately none of the core.stdc.* modules are documented.
It's understandable that duplicating the documentation of the
So, there is a module core.stdc.config (referenced here):
http://dlang.org/interfaceToC.html
That is presumably part of the D Standard library. I am curious
to know why no mention of this library is included at:
http://dlang.org/phobos/index.html
Is it not part of Phobos? Are there standard
On Tuesday, 7 January 2014 at 20:52:40 UTC, H. S. Teoh wrote:
On Tue, Jan 07, 2014 at 08:38:10PM +, Craig Dillabaugh
wrote:
[...]
As someone with little experience with functional programming,
I am
just curious - having browsed through the thread - if the
various
solutions proposed here
On Friday, 3 January 2014 at 17:38:16 UTC, Gary Willoughby wrote:
Simplest way to create an array from an associative array which
its contains keys and values?
For example if i have an associative array like this:
["one":"1", "two":"2"]
What's the easiest way to create a dynamic array that lo
On Thursday, 12 December 2013 at 17:34:13 UTC, FreeSlave wrote:
On Thursday, 12 December 2013 at 14:55:28 UTC, Craig Dillabaugh
wrote:
I am not sure if this belongs in D.learn, but it might be of
interest. I was writing some C++ code for a project at work
and have a class that stores image
I am not sure if this belongs in D.learn, but it might be of
interest. I was writing some C++ code for a project at work and
have a class that stores image data from a file. The image data
can be in just about any numeric (int/float/complex) type, so I
wanted a 'wrapper' class/struct that cou
On Saturday, 7 December 2013 at 23:35:49 UTC, Ali Çehreli wrote:
On 12/07/2013 03:11 PM, Rémy Mouëza wrote:
> the last pointer, `double * padfMaxBound` is actually a
pointer to an array
> of 4 elements:
Great sleuthing! :)
This thread is a good example of "C's Biggest Mistake":
http://www.dr
hough one might
reasonably assume that the bounds on a multidimensional dataset
would have more than one dimension.
Thank you.
On 12/07/2013 04:29 PM, Craig Dillabaugh wrote:
Hello,
I recently wrote bindings to the C-library Shapelib (it
reads/writes a
common file format used in Geograp
Hello,
I recently wrote bindings to the C-library Shapelib (it
reads/writes a common file format used in Geographic Information
Systems).
I've been trying to write a small test program to make sure my
bindings 'work' and I've come across a bizarre memory bug. I
THINK I've identified the co
On Sunday, 1 December 2013 at 18:51:51 UTC, Gary Willoughby wrote:
On Sunday, 1 December 2013 at 03:20:49 UTC, Craig Dillabaugh
wrote:
On Saturday, 30 November 2013 at 14:53:35 UTC, Gary Willoughby
wrote:
I'm porting some C headers and wondered how would i convert
the following to D:
#d
On Sunday, 1 December 2013 at 04:11:57 UTC, Simen Kjærås wrote:
On 2013-12-01 04:46, Craig Dillabaugh wrote:
Since questions about calling C from D seem to be popular
today, I
thought I would throw this one out there.
I am trying to call a C function which takes as parameters
several
arrays
Since questions about calling C from D seem to be popular today,
I thought I would throw this one out there.
I am trying to call a C function which takes as parameters
several arrays of doubles. It is valid to have some arrays
passed a NULL pointers in the C code.
To call this from D I've com
On Saturday, 30 November 2013 at 14:53:35 UTC, Gary Willoughby
wrote:
I'm porting some C headers and wondered how would i convert the
following to D:
#define pthread_self() GetCurrentThreadId()
#define pthread_handler_t void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
#defin
On Wednesday, 27 November 2013 at 07:30:58 UTC, Jacob Carlborg
wrote:
On 2013-11-27 02:26, Craig Dillabaugh wrote:
2. Once I think my bindings are stable I would like to add
them to
Deimos or DUB registries. Are there any recommendations for
testing
bindings? I checked through some other
On Wednesday, 27 November 2013 at 02:36:01 UTC, Jesse Phillips
wrote:
Don't have answers. Do you still get segfault removing
SHPClose( hShp );
Yep.
Other comment:
writeln("Bounds = [" ~to!string(pad_min_bound) ~ ","
~ to!string(pad_max_bound) ~ "]");
writeln("B
I recently created bindings to the C libary shapelib.
http://shapelib.maptools.org/
I generated my own bindings by hand, and another set of bindings
with DStep.
I created a small test program to test my bindings. My current
test program in its entirety is:
import std.stdio;
import std.str
On Tuesday, 26 November 2013 at 01:31:11 UTC, bearophile wrote:
Craig Dillabaugh:
What do you mean by an 'immutable' data structure. The linked
article talks about Persistent data structures. Are these the
same thing?
When I saw "Immutable" I figured it didn't su
On Tuesday, 26 November 2013 at 01:21:49 UTC, Craig Dillabaugh
wrote:
On Tuesday, 26 November 2013 at 00:28:34 UTC, bearophile wrote:
clip
Bye,
bearophile
What do you mean by an 'immutable' data structure. The linked
article talks about Persistent data structures. Are these
On Tuesday, 26 November 2013 at 00:28:34 UTC, bearophile wrote:
Bartosz Milewski has written the second article about immutable
data structures in C++11, this time about Red-Black trees:
http://bartoszmilewski.com/2013/11/25/functional-data-structures-in-c-trees/
The C++11 code with few small c
On Sunday, 24 November 2013 at 14:04:32 UTC, Jacob Carlborg wrote:
On 2013-11-24 14:58, Craig Dillabaugh wrote:
I have clang installed on my machine. Is there anyway to
point dstep to
the right headers when I invoke it?
Yes, use the -I flag. In addition to the listed flags, DStep
accept
On Sunday, 24 November 2013 at 13:01:15 UTC, Gary Willoughby
wrote:
On Friday, 22 November 2013 at 14:35:45 UTC, Craig Dillabaugh
wrote:
I am trying to use DStep on OpenSuse 12.3. I downloaded one of
the binaries (it was for Debian, so I guess that is my
problem),
and when I run DStep I get
On Sunday, 24 November 2013 at 13:05:04 UTC, Jacob Carlborg wrote:
On 2013-11-24 06:37, Craig Dillabaugh wrote:
Thanks. That is how I started out trying to fix it (Well, I
used
symlinks rather than copy the files, but basically the same).
I got it
to stop complaining about stddef.h and
On Saturday, 23 November 2013 at 20:16:32 UTC, Jacob Carlborg
wrote:
On 2013-11-22 15:35, Craig Dillabaugh wrote:
I am trying to use DStep on OpenSuse 12.3. I downloaded one of
the binaries (it was for Debian, so I guess that is my
problem),
and when I run DStep I get the following error
I am trying to use DStep on OpenSuse 12.3. I downloaded one of
the binaries (it was for Debian, so I guess that is my problem),
and when I run DStep I get the following error:
craigkris@linux-s9qf:~/code/DShape/D> dstep shapefil.h
File(850DF8, "")/usr/include/stdio.h:33:11: fatal error:
'stddef.
On Friday, 22 November 2013 at 10:27:12 UTC, bearophile wrote:
Craig Dillabaugh:
Do you want to use a ubyte instead of a byte here?
See:
http://d.puremagic.com/issues/show_bug.cgi?id=3850
Bye,
bearophile
Yes it is pretty easy to mix that up. A lot of my work is with
images with single
On Wednesday, 20 November 2013 at 13:48:37 UTC, Orvid King wrote:
On 11/20/13, Craig Dillabaugh
wrote:
On Wednesday, 20 November 2013 at 13:29:54 UTC, Dicebot wrote:
What I mean is that std.json does not seem to be written with
such usage mode in mind, it is more about direct DOM
manipulation
On Wednesday, 20 November 2013 at 13:29:54 UTC, Dicebot wrote:
What I mean is that std.json does not seem to be written with
such usage mode in mind, it is more about direct DOM
manipulation/construction. So probably examples should probably
not highlight how bad it is at tasks it is really bad
On Wednesday, 20 November 2013 at 13:20:48 UTC, Dicebot wrote:
For tasks that imply conversion between D types and JSON text
(alike to serialization), vibe.d module is really much superior
because it provides functions like
http://vibed.org/api/vibe.data.json/serializeToJson which "just
work"
On Monday, 26 March 2012 at 07:14:50 UTC, Ali Çehreli wrote:
On 03/25/2012 08:26 AM, AaronP wrote:
Could I get a "hello, world" example of parsing json? The docs
look
simple enough, but I could still use an example.
For what it's worth, I've just sent the following program to a
friend before
On Tuesday, 19 November 2013 at 12:53:50 UTC, bearophile wrote:
Craig Dillabaugh:
// Assume images are of the same dimensions. Result is
// saved in Out.
void add(T,U,V)(Image!T A, Image!U B, Image!V Out) {
...
}
Take a look at the "out" annotation in D.
Anyway, thanks
this question came up in some C++ work I am doing, but since the
solutions are likely nicer in D, I wanted to ask how it could be
solved in D.
First for some motivation. I am doing image processing work
where the images are simply an array of data, where the data type
can be any numeric type. Th
On Monday, 18 November 2013 at 20:32:25 UTC, Philippe Sigaud
wrote:
On Mon, Nov 18, 2013 at 9:20 PM, seany
wrote:
I read that book, but dont find this constructtion, that is
why the
question.
IIRC I talk a bit about function templates in my tutorial. JR
gave the
link (thanks!), another, mor
On Friday, 1 November 2013 at 20:08:15 UTC, Philippe Sigaud wrote:
What I'm trying to explain is that reduce takes two arguments:
the growing
value and the current front. In your case, the current front is
indeed a
2-tuple, but that's an unrelated issue.
You're trying to get:
reduce!( (firstE
On Friday, 1 November 2013 at 18:44:23 UTC, Philippe Sigaud wrote:
reduce!( (result, elem) => result + (elem[0]-elem[1])^^2
)(zippedRange, 0)
This is really where my problem arose. I understood everything
up
to here, but I sort of had this idea, "hey zip returns a tuple
so
that somehow the
On Friday, 1 November 2013 at 09:31:41 UTC, Philippe Sigaud wrote:
On Thu, Oct 31, 2013 at 8:59 PM, Craig Dillabaugh <
cdill...@cg.scs.carleton.ca> wrote:
Thanks, I will try both your, and Bearophile's ideas and see
if I
can figure out how they work.
reduce takes a range
(sum,pair) => sum +
(pair[0]-pair[1])^^2
)(zip(pt1, pt2)));
}
void main()
{
double[] arr1 = [0.0, 1.0, 0.1];
double[] arr2 = [1.0, -1.0, 0.0];
writeln(euclid_dist(arr1,arr2));
}
On Thu, Oct 31, 2013 at 8:12 PM, Craig Dillabaugh <
cdill...@cg.scs.carleton.ca> wrote:
clip
I am trying to calculate the Euclidean Distance between two
points. I currently have the following function (that doesn't
compile):
double euclid_dist( double[] pt1, double[] pt2 ) {
assert( pt1.length == pt2.length );
return sqrt(
zip(pt1, pt2).reduce!(function(e) { return
(e[1]-e[0]
On Wednesday, 30 October 2013 at 20:23:58 UTC, Ali Çehreli wrote:
On 10/30/2013 01:11 PM, Craig Dillabaugh wrote:
> I am writing code that uses a structure containing an array of
> points where the points may be of arbitrary dimension (though
> generally small). I would like to be abl
On Wednesday, 30 October 2013 at 20:19:11 UTC, Adam D. Ruppe
wrote:
It won't really work on the command line alone, but the way I
do it is a two step thing. First, make the thing use a config
module:
import myproject.config;
alias Thing Thing_Impl!dim;
then you go ahead and use Thing, which
Hello,
I am writing code that uses a structure containing an array of
points where the points may be of arbitrary dimension (though
generally small). I would like to be able to pass the point
dimension to my structure as a template parameter.
One solution is to create instances of these structu
On Saturday, 5 October 2013 at 02:42:54 UTC, Jonathan M Davis
wrote:
On Friday, October 04, 2013 16:12:14 Craig Dillabaugh wrote:
I guess the more fundamental question is, what is the purpose
of
the documentation? Is it a quick reference for D users, or is
it
a resource for people trying to
On Thursday, 3 October 2013 at 21:58:18 UTC, Jonathan M Davis
wrote:
On Thursday, October 03, 2013 22:57:22 Craig Dillabaugh wrote:
On Thursday, 3 October 2013 at 19:49:07 UTC, Jonathan M Davis
wrote:
> On Thursday, October 03, 2013 20:57:20 Craig Dillabaugh
> wrote:
>> On Thursda
On Thursday, 3 October 2013 at 19:49:07 UTC, Jonathan M Davis
wrote:
On Thursday, October 03, 2013 20:57:20 Craig Dillabaugh wrote:
On Thursday, 3 October 2013 at 18:12:01 UTC, Jonathan M Davis
clip
>
> - Jonathan M Davis
Fair enough. As you point out the fix is pretty simple.
Howe
On Thursday, 3 October 2013 at 18:12:01 UTC, Jonathan M Davis
wrote:
On Thursday, October 03, 2013 15:22:28 Craig Dillabaugh wrote:
It seems that std.file should include a writeText() function
for
the sake of consistency that is the above alias. When you come
across readText() in the
On Thursday, 3 October 2013 at 02:57:50 UTC, Andrej Mitrovic
wrote:
On 10/3/13, Craig Dillabaugh
wrote:
void main( string[] args ) {
string str = "Hello";
write( "file.txt", str );
string hello_file = readText("file.txt");
writeln( hello_file );
On Thursday, 3 October 2013 at 00:04:31 UTC, Jonathan M Davis
wrote:
On Thursday, October 03, 2013 01:39:38 Craig Dillabaugh wrote:
Hello,
I have the following program:
import std.file;
import std.stdio;
void main( string[] args ) {
string str = "Hello";
write( "file.txt&q
On Thursday, 3 October 2013 at 00:04:31 UTC, Jonathan M Davis
wrote:
On Thursday, October 03, 2013 01:39:38 Craig Dillabaugh wrote:
Hello,
I have the following program:
import std.file;
import std.stdio;
void main( string[] args ) {
string str = "Hello";
write( "file.txt&q
On Wednesday, 2 October 2013 at 23:39:39 UTC, Craig Dillabaugh
wrote:
Hello,
I have the following program:
import std.file;
import std.stdio;
void main( string[] args ) {
string str = "Hello";
write( "file.txt", str );
string hello_file = readText("file.txt&q
Hello,
I have the following program:
import std.file;
import std.stdio;
void main( string[] args ) {
string str = "Hello";
write( "file.txt", str );
string hello_file = readText("file.txt");
writeln( hello_file );
}
When I try to compile this I get:
test.d(6): Error: std.stdio.wr
On Sunday, 29 September 2013 at 14:16:21 UTC, 1100110 wrote:
https://xkcd.com/979/
Please. You are somebodies hero.
Did you actually run into the same problem? If so, glad I could
help.
1 - 100 of 138 matches
Mail list logo