I think this thread is not TOO old to use as a place to beg for
help :)
I've wandered into this nightmare, and I'm hoping someone who's
been down this road can point the way back to the light.
Summary: "no OPENSSL_Applink" runtime error when executing D
openssl application.
I have managed
On Monday, 24 September 2012 at 16:32:45 UTC, monarch_dodra wrote:
On Monday, 24 September 2012 at 15:05:54 UTC, Jason Spencer
wrote:
I imagine there's a slick way to do this, but I'm not seeing
it.
I have a string of hex digits which I'd like to convert to an
ar
I imagine there's a slick way to do this, but I'm not seeing it.
I have a string of hex digits which I'd like to convert to an
array of 8 ubytes:
0123456789abcdef --> [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD,
0xEF]
I'm looking at std.format.formattedRead, but the documentation
is...lighti
== Quote from bearophile (bearophileh...@lycos.com)'s article
> I suggest you to create a templated struct where the template
arguments are the element type and the number of dimensions.
Do you mean just the number of dimensions, or do you mean the size
along each dimension? Knowing just the # of
== Quote from bearophile (bearophileh...@lycos.com)'s article
> Jason Spencer:
> > Is there a better way to lay this out?
> Is this good enough for you?
It's certainly better. I'll have to look at how this plays with some
of my other usage, where dimensions come into p
I have the following sample program:
---
import std.algorithm, std.stdio;
real mean(T: Elem[], Elem)(T data) {
return reduce!("a + b")(0.0, data) / data.length;
}
real mean(T: Elem[][], Elem)(T data) {
real partSum = 0;
int count = 0;
foreach (row; data)
{
partSum += reduce!
I'm just trying to figure out what the error would be, exactly. That a
programmer, knowing the language specification, obeyed it and wrote an
expression using the shortest syntax?
Rhetoric aside, the result is not unambiguous, it just requires that the
reader understand precedence. That's an arg
== Quote from Jonathan M Davis (jmdavisp...@gmail.com)'s article
> For logic errors, efficiency isn't really an issue, since they
> shouldn't be happening. If they are, go fix your code and it won't
> be an issue.
That gets less true as the cost of a try block goes up. Even if logic
errors never
== Quote from Dmitry Olshansky (dmitry.o...@gmail.com)'s article
> Honestly, I'd suggest using exceptions instead of error codes.
This seems to be an increasingly common but still expensive suggestion
for error handling. Unless D has made great strides in exception
performance (which is entirely
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
> I was wrong, I looked through the runtime and did not find such a
function.
std.string has a repeat() function. Try:
import std.string;
void main()
{
string divider = repeat("-", 5);
writeln(divider);
}
Jason
== Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article
> --0016e6d58a039d35e2048c9aa7e2
>
> I thought they could only be symbols. That is, an alias is a 'link',
a sort
> of pointer to a symbol: a template name, a module name, a function
> name, etc.
Whatever confidence you inspired by
@bearophile:
Got it. Had it mostly worked out before reading, but this helps clarify
the static foreach part.
Thanks, gang!
Jason
== Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article
> Jason Spencer wrote:
> > == Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article
> >> Jason Spencer wrote:
> >
> >> > I nievely went and replaced "foreach (t;
Iota!(str_types.
== Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article
> Jason Spencer wrote:
> > I nievely went and replaced "foreach (t; Iota!(str_types.length))"
> > with "foreach (t; str_types.length)", since the length of that
> > array is known at c
Ok, I've gone over this, adapted it, and mostly understand it. I just
have one question left:
== Quote from bearophile (bearophileh...@lycos.com)'s article
> template Iota(int stop) {
> ...
> alias TypeTuple!(Iota!(stop-1), stop-1) Iota;
> }
> ...
> foreach (t; Iota!(str_types.length)
In writing templates that make heavy use of alias parameters, does
anyone else feel uneasy about whether the caller will pass a type, a
value, or a schmoo? I'm having a hard time getting my head around
how wide-open aliases are and trying to resist the urge to put in
thousands of static asserts to
That's COOL!
I'll have to look at these closer, but I definitely get what you're
doing. Thanks a million.
== Quote from bearophile (bearophileh...@lycos.com)'s article
> Simpler:
> import std.stdio: writeln;
> import std.typetuple: TypeTuple;
> template Iota(int stop) {
> static if (stop <=
== Quote from bearophile (bearophileh...@lycos.com)'s article
Thanks for all the suggestions!
A little more discussion:
> > So I need some slick way of mapping the run-time element size, row count,
> > and column count into a static array type to instantiate my template with.
> A basic brutal wa
Forgot a couple of things:
- this is all using D2.047.
- Another question (in reference to part 2 before): I'd like to
support about 4 base types and 5 or 6 different matrix sizes. So
that's roughly 20 type combinations for my template. But I decide
these based on command-line arguments at run
I'm working on a program to do statistics on matrices of different sizes, and
I've run into a handful of situations where I just can't seem to find the
trick I need. In general, I'm trying to make my functions work on static
arrays of the proper size, and template that up for the different sizes I
20 matches
Mail list logo