Yes that's exactly what i needed, thanks!
On Saturday, 20 February 2016 at 05:55:26 UTC, Jon D wrote:
On Saturday, 20 February 2016 at 05:34:01 UTC, tcak wrote:
On Saturday, 20 February 2016 at 05:33:00 UTC, tcak wrote:
Is there any way (I checked core.memory already) to collect
report about memory usage from garbage collector? So, I c
On Saturday, 20 February 2016 at 05:34:01 UTC, tcak wrote:
On Saturday, 20 February 2016 at 05:33:00 UTC, tcak wrote:
Is there any way (I checked core.memory already) to collect
report about memory usage from garbage collector? So, I can
see a list of pointer and length information. Since getti
On Saturday, 20 February 2016 at 05:33:00 UTC, tcak wrote:
Is there any way (I checked core.memory already) to collect
report about memory usage from garbage collector? So, I can see
a list of pointer and length information. Since getting this
information would require another memory area in he
Is there any way (I checked core.memory already) to collect
report about memory usage from garbage collector? So, I can see a
list of pointer and length information. Since getting this
information would require another memory area in heap, it could
be like logging when report is asked.
My lon
I want a status icon for a Linux application. gtk.StatusIcon notes that
it's deprecated (and doesn't work on MATE 1.8.2).
What should I be using?
On 2/19/16 11:15 PM, Lisa wrote:
module main;
import std.stdio;
import std.math;
int main() {
int A, B, C;
writef("A = ");
readf("%lf", %A);
You want &A, not %A.
Also, note that you declared A, B, C as integers, but are using %lf
which is for doubles. However, readf is muc
Sadly the answer is no.
This is due to https://issues.dlang.org/show_bug.cgi?id=5710 which
apparently no-one is either willing or able to fix. The problem
afflicts dmd, l;dc2 and I suspect gdc.
cf. https://github.com/russel/Pi_Quadrature/tree/master/D
for some extra detail and some workarounds.
On Saturday, 20 February 2016 at 03:43:17 UTC, Ali Çehreli wrote:
On 02/19/2016 07:37 PM, Lisa wrote:
> import std.stdio;
> import std.math;
>
> int main()
> {
> double a, b, c, p;
>
> writef("Enter a: ");
> scanf("%d", &a);
scanf is not a safe function. It trusts the format stri
On 02/19/2016 07:37 PM, Lisa wrote:
> import std.stdio;
> import std.math;
>
> int main()
> {
> double a, b, c, p;
>
> writef("Enter a: ");
> scanf("%d", &a);
scanf is not a safe function. It trusts the format string and assumes
that 'a' really is what the programmer told it. (Fo
On Saturday, 20 February 2016 at 01:48:35 UTC, Ali Çehreli wrote:
On 02/19/2016 03:56 PM, Lisa wrote:
Can you please help me and explain how to create a program,
which would
find area of triangle and its perimeter?
It's great to have student questions on this forum. If you
don't mind telling
module main;
struct ThingOne
{
int thing = 1;
}
struct ThingTwo
{
float thing = 2;
}
struct Test
{
ThingOne thing()
{
return ThingOne();
}
ThingTwo thing()
{
return ThingTwo();
}
}
voi
On Thursday, 18 February 2016 at 08:18:20 UTC, Guillaume Piolat
wrote:
On Thursday, 18 February 2016 at 07:52:11 UTC, Joel wrote:
On Thursday, 18 February 2016 at 07:11:23 UTC, Joel wrote:
I had dub installed in a folder that meant I had to put 'sudo
dub' to run it. I've tried to fix the proble
On Friday, 19 February 2016 at 22:34:48 UTC, Chris Wright wrote:
I tested this a fair bit today, and I haven't been able to do
any of the nefarious things I expected to be able to do. No
overwriting variables in the caller's scope, no smashing stack
pointers, etc.
I was surprised by this re
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
which would find area of triangle and its perimeter?
And for everybody - I know how to find area and perimetr, but i
don't know how to write it on programming language)
Can i u
On Saturday, 20 February 2016 at 01:48:35 UTC, Ali Çehreli wrote:
On 02/19/2016 03:56 PM, Lisa wrote:
Can you please help me and explain how to create a program,
which would
find area of triangle and its perimeter?
It's great to have student questions on this forum. If you
don't mind telling
On 02/19/2016 06:26 PM, maik klein wrote:
> On Saturday, 20 February 2016 at 02:22:12 UTC, Ali Çehreli wrote:
>> On 02/19/2016 06:00 PM, maik klein wrote:
>>> How would I transpose
>>>
>>> float[3][2]
>>>
>>> to
>>>
>>> float[2][3]
>>>
>>> with http://dlang.org/phobos/std_range.html#.transposed
>
On Saturday, 20 February 2016 at 02:26:56 UTC, maik klein wrote:
On Saturday, 20 February 2016 at 02:22:12 UTC, Ali Çehreli
wrote:
On 02/19/2016 06:00 PM, maik klein wrote:
How would I transpose
float[3][2]
to
float[2][3]
with http://dlang.org/phobos/std_range.html#.transposed
Because s
On Saturday, 20 February 2016 at 02:22:12 UTC, Ali Çehreli wrote:
On 02/19/2016 06:00 PM, maik klein wrote:
How would I transpose
float[3][2]
to
float[2][3]
with http://dlang.org/phobos/std_range.html#.transposed
Because static arrays are not ranges, they must be used as
slices with the
On 02/19/2016 06:00 PM, maik klein wrote:
How would I transpose
float[3][2]
to
float[2][3]
with http://dlang.org/phobos/std_range.html#.transposed
Because static arrays are not ranges, they must be used as slices with
the help of []. The following code does the same thing in two differen
On 02/19/2016 06:18 AM, Voitech wrote:
> I was trying to use mixins for this i
> created some functions but this not working don't know why
Compilation errors or something else? pragma(msg) helps with debugging
generated code. You can also use unittest blocks to make sure that the
generated co
How would I transpose
float[3][2]
to
float[2][3]
with http://dlang.org/phobos/std_range.html#.transposed
On 02/19/2016 03:56 PM, Lisa wrote:
Can you please help me and explain how to create a program, which would
find area of triangle and its perimeter?
It's great to have student questions on this forum. If you don't mind
telling us, which teacher and school teaches or uses D? The only one
that
On Saturday, 20 February 2016 at 00:42:36 UTC, Chris Wright wrote:
How do you calculate the area of a triangle? Same way as you'd
do it by hand -- 1/2 base times height.
Getting the height can be tricky sometimes though, depending on
what information you know about the triangle.
I like to ch
On Sat, 20 Feb 2016 00:17:28 +, Lisa wrote:
> On Saturday, 20 February 2016 at 00:15:16 UTC, Chris Wright wrote:
>> On Sat, 20 Feb 2016 00:04:04 +, Lisa wrote:
>>
>>> On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
>
On Saturday, 20 February 2016 at 00:04:04 UTC, Lisa wrote:
On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
which would find area of triangle and its perimeter?
What
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
which would find area of triangle and its perimeter?
First, one can't find these unless something is given. So, what
is given: sides? angles? two-dimensional coordinates?
The
On Saturday, 20 February 2016 at 00:15:16 UTC, Chris Wright wrote:
On Sat, 20 Feb 2016 00:04:04 +, Lisa wrote:
On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
w
On Sat, 20 Feb 2016 00:04:04 +, Lisa wrote:
> On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
>> On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
>>> Can you please help me and explain how to create a program,
>>> which would find area of triangle and its perimeter?
>>
>> W
On Friday, 19 February 2016 at 23:09:11 UTC, Patience wrote:
On Friday, 19 February 2016 at 22:34:22 UTC, Adam D. Ruppe
wrote:
On Friday, 19 February 2016 at 22:29:32 UTC, Patience wrote:
Is there anything in D like
https://irony.codeplex.com/
https://github.com/Hackerpilot/libdparse/
I do
On Saturday, 20 February 2016 at 00:01:47 UTC, cym13 wrote:
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
which would find area of triangle and its perimeter?
What do you need help for exactly? What have you tried? What do
On Friday, 19 February 2016 at 23:56:29 UTC, Lisa wrote:
Can you please help me and explain how to create a program,
which would find area of triangle and its perimeter?
What do you need help for exactly? What have you tried? What do
you struggle with?
Can you please help me and explain how to create a program, which
would find area of triangle and its perimeter?
On Friday, 19 February 2016 at 22:34:22 UTC, Adam D. Ruppe wrote:
On Friday, 19 February 2016 at 22:29:32 UTC, Patience wrote:
Is there anything in D like
https://irony.codeplex.com/
https://github.com/Hackerpilot/libdparse/
I don't want to parse d code. I want a generic parser that is
wri
On Friday, 19 February 2016 at 11:34:33 UTC, John Colvin wrote:
On Thursday, 18 February 2016 at 23:28:43 UTC, Joel wrote:
On Thursday, 18 February 2016 at 16:33:51 UTC, John Colvin
wrote:
[...]
I don't think I put 'sudo brew' at any point (I can't
remember). I hope I haven't broken my OSX!
On Fri, 19 Feb 2016 21:57:46 +, Yuxuan Shui wrote:
> I don't think it's safe to convert between function pointer with
> different number of arguments... It's possible to mess up the stack
> frame.
I tested this a fair bit today, and I haven't been able to do any of the
nefarious things I exp
On Friday, 19 February 2016 at 22:29:32 UTC, Patience wrote:
Is there anything in D like
https://irony.codeplex.com/
https://github.com/Hackerpilot/libdparse/
Is there anything in D like
https://irony.codeplex.com/
On 02/19/2016 11:04 AM, Ali Çehreli wrote:
> can be templatized:
Not ready for prime time but now it's templatized:
import std.stdio;
import std.string;
import std.regex;
import std.typecons;
import std.conv;
import std.algorithm;
import std.range;
template regexClass(T) {
static if (is (T
On Friday, 19 February 2016 at 22:07:25 UTC, Chris Wright wrote:
If you want to cast function pointers successfully, you have to
know the D calling convention.
[snip]
I figured there was an explanation. Definitely "here be dragons"
territory. I hope I can figure out a better solution, but
On Friday, 19 February 2016 at 21:58:24 UTC, user001 wrote:
Well struct don't have it, but i would like something like it
but only for data, i don't need functions or anything like that
just data.
[...]
How about
struct A
{
int valueA;
}
struct B
{
A a;
int valueB;
alias a
On Friday, 19 February 2016 at 21:58:24 UTC, user001 wrote:
Well struct don't have it, but i would like something like it
but only for data, i don't need functions or anything like that
just data.
struct A
{
int valueA;
}
struct B
{
A a;
int valueB
On Fri, 19 Feb 2016 20:45:23 +, jmh530 wrote:
> I tried to use a cast (below) to modify the function pointer, but it is
> printing the second number instead of the first. I find this behavior
> strange...
If you want to cast function pointers successfully, you have to know the
D calling conv
Well struct don't have it, but i would like something like it but
only for data, i don't need functions or anything like that just
data.
struct A
{
int valueA;
}
struct B
{
A a;
int valueB;
}
struct C
{
B b;
int valueC;
On Friday, 19 February 2016 at 20:45:23 UTC, jmh530 wrote:
On Friday, 19 February 2016 at 15:00:51 UTC, jmh530 wrote:
This works.
But when I re-write foo to take that into account as in below,
I get an error that I can't implicitly convert int
function(int x) to int function(int x, int y).
This code snippet is from:
http://dlang.org/phobos/std_parallelism.html
---
import std.algorithm, std.parallelism, std.range;
void main() {
// Parallel reduce can be combined with
// std.algorithm.map to interesting effect.
// The following example (thanks to Russel Winder)
// ca
On Friday, 19 February 2016 at 15:00:51 UTC, jmh530 wrote:
This works.
But when I re-write foo to take that into account as in below,
I get an error that I can't implicitly convert int function(int
x) to int function(int x, int y).
I don't think I had looked at what you had done carefully
On 02/19/2016 10:10 AM, Nordlöw wrote:
Have anybody put together a generalised form of findSplit that can split
and decode using a compile time parameters somewhat like
"(1)-(2.0)".decode!("(", int, ")", char, "(", double, ")")
evaluates to
to a
tuple!(int, char, double)
with value
tuple(1,
Have anybody put together a generalised form of findSplit that
can split and decode using a compile time parameters somewhat like
"(1)-(2.0)".decode!("(", int, ")", char, "(", double, ")")
evaluates to
to a
tuple!(int, char, double)
with value
tuple(1, '-', 2.0)
On Friday, 19 February 2016 at 14:21:26 UTC, Kagamin wrote:
int bar(int x)
{
return x;
}
int baz(int x, int y)
{
return bar(x);
}
void main()
{
import std.stdio : writeln;
int function(int x, int y) foo_bar = &baz;
writeln(foo_bar(1, 2));
}
T
On Friday, 19 February 2016 at 11:26:56 UTC, Nicholas Wilson
wrote:
Like
alias fp1 = int function(int x);
alias fp2 = int function(int x, int y);
auto foo(T)(T f)
{
static if (is(T == fp2))
return f;
else static if (is(T == fp1))
{
return
On Friday, 19 February 2016 at 14:26:25 UTC, Steven Schveighoffer
wrote:
Try ub[0].length = 3. You are trying to change the length on
one of the static arrays.
yes, right these compile. I was surpised it wouldn't accept the
append with just an int.
int[1][][1] ubb;
ubb[0].
On 2/19/16 8:53 AM, Jay Norwood wrote:
On Friday, 19 February 2016 at 07:59:29 UTC, Jonathan M Davis wrote:
.. Or you could do something really wonky like
auto arr = new int[][2][](5);
which would be a dynamic array of length 5 which holds static arrays
of length 2 which hold dynamic array
On Friday, 19 February 2016 at 05:41:01 UTC, jmh530 wrote:
void main()
{
import std.stdio : writeln;
auto foo_bar = foo(&bar);
writeln(qux(1, 2, foo_bar)); //compiler error
writeln(qux(1, 2, &baz));
}
int bar(int x)
{
return x;
}
int baz(int x,
On 2/18/16 11:36 PM, Zekereth wrote:
On Friday, 19 February 2016 at 04:21:43 UTC, Zekereth wrote:
On Friday, 19 February 2016 at 04:16:23 UTC, Adam D. Ruppe wrote:
On Friday, 19 February 2016 at 04:08:02 UTC, Zekereth wrote:
How is seconds able to be read at compile time but unitType cannot?
Hi, I'm trying to create a proxy with automatic method generation
. Let say i hava Service object which can be Local service and
Remote service. f.e:
interface Service{
string serviceInfo();
}
interface LocalService:Service{
int doSmth(string param);
}
class LocalServiceImpl:LocalServic
On Thursday, 18 February 2016 at 01:14:00 UTC, ZombineDev wrote:
https://issues.dlang.org/show_bug.cgi?id=15661. I suggest
testing this code again with a newer compiler (see my answer in
the other thread -
http://forum.dlang.org/post/omfyqfulgyzbrxlzr...@forum.dlang.org).
Thanks -- I might ge
On Friday, 19 February 2016 at 01:30:13 UTC, H. S. Teoh wrote:
Suppose the array gets moved sometime after i=500 because it
ran out of space in the current memory location. Since there
is another slice middleSlice pointing at the old data, it's not
just a matter of *moving* the elements over t
https://dlang.org/phobos/std_container.html and corresponding
code in phobos. Though recently allocators were introduced and
containers are going to be written with support for allocators.
On Friday, 19 February 2016 at 07:59:29 UTC, Jonathan M Davis
wrote:
.. Or you could do something really wonky like
auto arr = new int[][2][](5);
which would be a dynamic array of length 5 which holds static
arrays of length 2 which hold dynamic arrays which are null.
In my case, int [1]
Hi,
I am looking for example of types where memory management is
manual, and the type supports operator overloading, etc. Grateful
if someone could point me to sample example code.
Thanks and Regards
Dibyendu
On Thursday, 18 February 2016 at 23:28:43 UTC, Joel wrote:
On Thursday, 18 February 2016 at 16:33:51 UTC, John Colvin
wrote:
[...]
I don't think I put 'sudo brew' at any point (I can't
remember). I hope I haven't broken my OSX!
[...]
Did you recently upgrade OS X? Anyway, you should proba
On Friday, 19 February 2016 at 05:41:01 UTC, jmh530 wrote:
I'm trying to write a function that will adjust the parameters
of a function pointer.
I think the problem is that it defaults to a delegate not that it
cannot be one
does clarifying this to the compiler work
Like
alias fp1 = int f
On Friday, February 19, 2016 06:54:51 Jay Norwood via Digitalmars-d-learn wrote:
> Strange to me that this compiles, since I would expect there to
> be some C-like limitation on the position of the unspecified
> dimension. Is allowing this somehow useful?
>
> int[1][][1] ub;
> writeln("ub",ub);
Y
64 matches
Mail list logo