On Friday, November 07, 2014 05:43:28 Andre via Digitalmars-d-learn wrote:
> Hi,
>
> following code fails with errors:
> class test.A member b is not accessible
>
> I am not sure, whether it should work or not?
>
> Kind regards
> André
>
> module app;
> import test;
>
> void main()
> {
> A.b("");
Hi,
following code fails with errors:
class test.A member b is not accessible
I am not sure, whether it should work or not?
Kind regards
André
module app;
import test;
void main()
{
A.b("");
}
module test;
class A
{
private void b(){}
static void b(string b){}
}
On Thu, 06 Nov 2014 22:45:23 -0500
Steven Schveighoffer via Digitalmars-d-learn
wrote:
> In an environment that you don't control, the default behavior is likely
> to print "Segmentation Fault" and exit. No core dump, no nothing.
>
> This leads to unhelpful bug reports, and seeing if you can ge
On 11/6/14 10:22 PM, ketmar via Digitalmars-d-learn wrote:
On Thu, 06 Nov 2014 20:13:02 +
"Nordlöw" via Digitalmars-d-learn
wrote:
On Wednesday, 5 November 2014 at 11:39:21 UTC, Marc Schütz wrote:
If you're on Linux, you can turn SEGVs into Errors:
import etc.linux.memoryerror;
On Thu, 06 Nov 2014 20:13:02 +
"Nordlöw" via Digitalmars-d-learn
wrote:
> On Wednesday, 5 November 2014 at 11:39:21 UTC, Marc Schütz wrote:
> > If you're on Linux, you can turn SEGVs into Errors:
> >
> > import etc.linux.memoryerror;
> > registerMemoryErrorHandler();
>
> Why isn't su
What's the current recommended way to read and write audio files?
I don't need to play it on the speakers or deal with anything
real time - just read a file's data into an array, fiddle with
it, and write it out to a file.
I found some other threads about audio files, but none recent,
mentio
One other thing. I know about `template this`, but I'm not sure
if that's a tenable solution or not in my case. In addition to
templating the struct or class, would I not also have to template
the constructor so it could pick up the type of `this` at the
declaration site?
On Thursday, 6 November 2014 at 23:43:19 UTC, Meta wrote:
How can I tell at the points marked in the above code if the
class or struct instance was declared as const, shared, etc.?
Is this possible?
You can't do that, but you can overload on const
void doSomething() const { called on const in
Say I have the following struct and object definitions:
struct Test1(T)
{
static if (???)
{
void doSomething()
{
writeln(typeof(this).stringof);
}
}
T t;
}
class Test2(T)
{
static if (???)
{
void doSomething()
{
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward range:
[
a11 + a21 + ... aM1,
a12 + a22 + ... aM2,
...
a1N +
On Thursday, 6 November 2014 at 22:02:09 UTC, John Colvin wrote:
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not
arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward ra
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward range:
[
a11 + a21 + ... aM1,
a12 + a22 + ... aM2,
...
a1N +
On Thursday, 6 November 2014 at 21:57:36 UTC, Steven
Schveighoffer wrote:
github blame is quite useful:
https://github.com/D-Programming-Language/phobos/blame/master/std/range.d#L668
The commit:
https://github.com/D-Programming-Language/phobos/commit/c717b503e7305a92410c23ca2bc2ea14b40f8aa2
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward range:
[
a11 + a21 + ... aM1,
a12 + a22 + ... aM2,
...
a1N +
On 11/6/14 4:19 PM, Meta wrote:
This is the code for std.range.put:
void put(R, E)(ref R r, E e)
{
//Why?
@property ref E[] EArrayInit(); //@@@9186@@@: Can't use (E[]).init
//First level: simply straight up put.
static if (is(typeof(doPut(r, e
{
doPut(r, e)
void popFront() { foreach (ref r; rr) r.popFront(); }
I think it should be
void popFront() { foreach (ref r; rr.save) r.popFront(); }
but I think OP wanted a ready-made phobos solution, w/o all the
range boilerplate...
exactly.
This is the code for std.range.put:
void put(R, E)(ref R r, E e)
{
//Why?
@property ref E[] EArrayInit(); //@@@9186@@@: Can't use
(E[]).init
//First level: simply straight up put.
static if (is(typeof(doPut(r, e
{
doPut(r, e);
}
//Optional optimization b
On 11/06/14 18:32, bearophile via Digitalmars-d-learn wrote:
> Marc Schütz:
>
>> We'd need something taking and returning a RoR that "mirrors" them
>> diagonally. Then we could simply apply `map!(r => r.sum)` on the result.
>
> A simple solution is to create a row of values, and then sum them co
On Nov 5, 2014 12:10 PM, "Bauss via Digitalmars-d-learn" <
digitalmars-d-learn@puremagic.com> wrote:
>
> Is there any way to track down access violations, instead of me having to
look through my source code manually.
Whenever you don't get a stack trace on Windows, it's 99% guaranteed you're
calli
On Wednesday, 5 November 2014 at 11:39:21 UTC, Marc Schütz wrote:
If you're on Linux, you can turn SEGVs into Errors:
import etc.linux.memoryerror;
registerMemoryErrorHandler();
Why isn't such a useful feature activated by default? Performance
reasons?
On 11/06/2014 08:47 AM, Suliman wrote:
We have to look at the documentation of the function. In this case the
possibilities are FileException and UTFException.
http://dlang.org/phobos/std_file.html#.readText
However, judging by their names, they are both descendants of
Exception, so what you
Marc Schütz:
We'd need something taking and returning a RoR that "mirrors"
them diagonally. Then we could simply apply `map!(r => r.sum)`
on the result.
A simple solution is to create a row of values, and then sum them
correctly while you scan the rows.
Bye,
bearophile
On Thursday, 6 November 2014 at 17:08:23 UTC, Justin Whear wrote:
This would sum along the wrong dimension. I think the correct
solution
will
make use of std.range.frontTraversal, but it will be a bit more
complex
due to
needing to sum every column. std.range.traversal would make it
easy, b
On Thursday, 6 November 2014 at 16:57:50 UTC, Marc Schütz wrote:
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not
arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward ra
On Thu, 06 Nov 2014 17:08:23 +, Justin Whear wrote:
> I think the correct solution
> will make use of std.range.frontTraversal, but it will be a bit more
> complex due to needing to sum every column. std.range.traversal would
> make it easy, but it requires random access.
That should be std.
On Thu, 06 Nov 2014 16:57:48 +, Marc Schütz wrote:
> On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame wrote:
>> I have rectangular forward range of forward ranges (not arrays):
>> [
>> [a11, a12, ... a1N],
>> [a21, a22, ... a2N],
>> ...
>> [aM1, aM2, ... aMN]
>> ]
>>
>> I n
On Thursday, 6 November 2014 at 15:53:27 UTC, Jack Applegame
wrote:
I have rectangular forward range of forward ranges (not arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward range:
[
a11 + a21 + ... aM1,
a12 + a22 + ... aM2,
...
a1N +
We have to look at the documentation of the function. In this
case the possibilities are FileException and UTFException.
http://dlang.org/phobos/std_file.html#.readText
However, judging by their names, they are both descendants of
Exception, so what you are doing will catch either of them.
I have rectangular forward range of forward ranges (not arrays):
[
[a11, a12, ... a1N],
[a21, a22, ... a2N],
...
[aM1, aM2, ... aMN]
]
I need lazy forward range:
[
a11 + a21 + ... aM1,
a12 + a22 + ... aM2,
...
a1N + a2N + ... aMN
]
Range of sum elements of every columns;
M, N - runti
On 11/05/2014 11:02 PM, Suliman wrote:
Replace that with something like writeln("caught") and you will see
that it is indeed caught. :) Printing the exception mimicks the
default behavior and you (and I) think that the exception is not
caught. :)
that's work, but I can not understand where I ca
On 11/5/14 7:54 AM, Ivan Kazmenko wrote:
Hi!
This gives an error (cannot deduce template function from argument types):
-
import std.algorithm;
void main () {
char [] c;
sort (c);
}
-
Why is "char []" so special that it can't be sorted?
Because sort works on ranges, and std
On 11/5/14 2:05 PM, Patrick Jeeves wrote:
On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone wrote:
unless delete is explicitly called, I don't believe the destructor
would ever be called, it would still have a reference in the static
foo_list object that would stop it from being collect
On 11/5/14 10:48 PM, Dmitriy wrote:
Hello, I'm in the middle of learning D. I can't find any definitive
information about what is the complexity of operator ~= when used for
adding an element to an array. Is it amortized O(1) or is it
implementation defined? (I hope it at worst O(n) though I have
On Thursday, 6 November 2014 at 10:52:32 UTC, Ivan Kazmenko wrote:
On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz
wrote:
On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko
wrote:
Hi!
This gives an error (cannot deduce template function from
argument types):
-
impor
Or the program doesn't find the address after IP 192.168.110.34...
Hi ppl! I want to scan the local network to find nodes with open
80 port.
code:
import core.thread, core.atomic;
import std.stdio, std.system, std.file, std.conv, std.datetime,
std.socket, std.socketstream, std.stream;
import vibe.core.log;
import vibe.d;
void main()
{
ushort port = 80
On Thursday, 6 November 2014 at 13:04:18 UTC, Marc Schütz wrote:
It's a bug: https://issues.dlang.org/show_bug.cgi?id=2043
As a workaround, you can nest the call in another lambda:
foreach(acc; accounts)
{
(Account acc) {
task(() { writeln(acc.id); }).executeInNewThr
On Thursday, 6 November 2014 at 10:53:32 UTC, Misu wrote:
Hi,
when I execute this code I have 7 7 7 as result, I think I
understand why.
How can I execute a special task for one element ?
import std.stdio;
import std.parallelism;
void main(string[] args)
{
class Account
{
On 2014-10-26 14:25, Etienne Cimon wrote:
On 2014-10-25 23:31, H. S. Teoh via Digitalmars-d-learn wrote:
Hmm. You can probably use __traits(getAllMembers...) to introspect a
library module at compile-time and build a hash based on that, so that
it's completely automated. If you have this availab
Misu:
void main(string[] args)
{
class Account
{
public this(int id) { this.id = id; }
int id;
}
...
This is not an answer to your question, but note:
void main() {
class Foo {}
static class Bar {}
pragma(msg, __traits(classI
On Wednesday, 5 November 2014 at 17:45:00 UTC, luminousone wrote:
abstract class foo {
static DList!foo foo_list;
~this(){ foo_list.remove(this); }
One note: when your program exits the runtime does a final GC
cycle and collects those things calling destructors/finalizers,
however the
On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz wrote:
On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko
wrote:
Hi!
This gives an error (cannot deduce template function from
argument types):
-
import std.algorithm;
void main () {
char [] c;
sort (c);
Hi,
when I execute this code I have 7 7 7 as result, I think I
understand why.
How can I execute a special task for one element ?
import std.stdio;
import std.parallelism;
void main(string[] args)
{
class Account
{
public this(int id) { this.id = id; }
43 matches
Mail list logo