Re: Csharp para Digital Mars D[AJUDA]

2017-07-24 Thread Nick B via Digitalmars-d-learn

On Monday, 24 July 2017 at 22:15:05 UTC, dark777 wrote:
Eu tenho um projeto em windows form C# feito no virual studio 
um amigo meu e eu criamos para a semana academica ele faz 
cadastros e marca a presença das visitas na semana por um id de 
quem ja pagou pelas palestras queria portar ele para D.


Que biblioteca para forms vcs me recomendam para desenvolver o 
mesmo?


o que eu teria que dar mais atenção em Csharp para portar para 
a linguagem D?



PS: ele é desktop mas faz redirecionamento para um banco de 
dados mysql para salvar os dados direto no servidor...


translation via Google translate ...

I have a project in windows form C # made in the virtual studio a 
friend of mine and I created for the academic week he makes 
registrations and marks the presence of the visits in the week by 
an id of who already paid for the talks wanted to port him to D.


What library for forms vcs recommend me to develop the same?

What would I have to pay more attention in Csharp to port to the 
D language?



PS: it is desktop but it does redirect to a mysql database to 
save the data directly on the server ...


Re: short programme from "Programming in D" by Ali Cehreli.

2016-06-15 Thread Nick B via Digitalmars-d-learn
On Tuesday, 14 June 2016 at 16:09:00 UTC, Steven Schveighoffer 
wrote:

On 6/14/16 11:44 AM, Ali Çehreli wrote:

On 06/14/2016 04:52 AM, Nick B wrote:



Further, when the format string is a literal like the one used 
in the
program, the compiler can in theory determine at compile time 
that the

format string does not match the rest of the arguments:

readf (" %s, ");
// "No argument for %s"

This is a desired feature but dmd does not have this yet. 
Since dmd
provides the front end to gdc and ldc, they don't have this 
feature either.


I will log a feature request with Walter.

Nick



Re: short programme from "Programming in D" by Ali Cehreli.

2016-06-14 Thread Nick B via Digitalmars-d-learn

On Tuesday, 14 June 2016 at 09:53:03 UTC, cym13 wrote:

On Tuesday, 14 June 2016 at 09:39:05 UTC, Nick B wrote:

On Tuesday, 14 June 2016 at 09:28:18 UTC, cym13 wrote:

On Tuesday, 14 June 2016 at 09:17:35 UTC, Nick B wrote:
Hi, Can anyone assist me with the short D programme. It is 
taken straight from  "Programming in D" by Ali Cehreli.  The 
code below is the solution,  on page 684.

The  Exercise is on Page 27, item 2 half way down the page.

[snip]



It then printed as much of a stack trace as it could, not very 
useful as you didn't do much but it's there.


You gave it garbage and it threw an error. Compiler bugs are a 
reality but not *that* common ;-)


Thanks for the assistance. I assumed that the compiler  would at 
least throw a line number, to hint at where the problem was.




Re: short programme from "Programming in D" by Ali Cehreli.

2016-06-14 Thread Nick B via Digitalmars-d-learn

On Tuesday, 14 June 2016 at 09:28:18 UTC, cym13 wrote:

On Tuesday, 14 June 2016 at 09:17:35 UTC, Nick B wrote:
Hi, Can anyone assist me with the short D programme. It is 
taken straight from  "Programming in D" by Ali Cehreli.  The 
code below is the solution,  on page 684.

The  Exercise is on Page 27, item 2 half way down the page.

[...]


Misplaced quote in your readf.


Thank you.  Question: is this a compiler bug ?


short programme from "Programming in D" by Ali Cehreli.

2016-06-14 Thread Nick B via Digitalmars-d-learn
Hi, Can anyone assist me with the short D programme. It is taken 
straight from  "Programming in D" by Ali Cehreli.  The code below 
is the solution,  on page 684.

The  Exercise is on Page 27, item 2 half way down the page.

The problem is that the program crashes, when it runs.   The only 
thing I have changed is the placement of the curly brackets on 
new lines, otherwise the code is the same.  My text editor is 
Sublime 3 - Build 3114.


DMD32 D Compiler v2.069.2
Running on Win 7
result:
Microsoft Windows [Version 6.1.7601]
DMD32 D Compiler v2.069.2

C:\Users\Joan\Prog\Source>page27b
Roll the dice .
3

object.Exception@C:\Users\Joan\Prog\D\dmd2\windows\bin\..\..\src\phobos\std\form
at.d(594): Enforcement failed

0x00403849
0x004037F4
0x0040251F
0x00402472
0x0040858F
0x00408553
0x00408454
0x00404C83
0x76DA338A in BaseThreadInitThunk
0x777B9902 in RtlInitializeExceptionChain
0x777B98D5 in RtlInitializeExceptionChain

C:\Users\Joan\Prog\Source>

***

Here is all the source:

import std.stdio;
void main ()
{
writeln  ("Roll the dice .");
int die ;
readf (" %s, ");

if ((die == 1) || (die == 2) || (die == 3))
{
writeln("You won");
}
else if ((die == 4) || (die == 5) || (die == 6))
{
writeln("I won");
}
else
{
writeln("ERROR: ", die , "is invalid");
}
}


Note, this source below, take from the code samples .zip file 
works correctly !!


module if_solution_3;

import std.stdio;

void main() {
write("What is the value of the die? ");
int die;
readf(" %s", );

if ((die == 1) || (die == 2) || (die == 3)) {
writeln("You won");

} else if ((die == 4) || (die == 5) || (die == 6)) {
writeln("I won");

} else {
writeln("ERROR: ", die, " is invalid");
}
}

with Thanks
Nick


Re: Valgrind

2015-04-20 Thread Nick B via Digitalmars-d-learn

On Monday, 20 April 2015 at 17:25:55 UTC, John Colvin wrote:

On Monday, 20 April 2015 at 16:58:18 UTC, Robert M. Münch wrote:

On 2015-04-20 13:29:57 +, John Colvin said:






Were the causes ever analyzed? I'm a bit wondering why it 
happens on floating point stuff...


valgrind doesn't have full support for x87 code, which dmd 
emits all over the place.


There is company is Germany, which does Valgrind consultancy,

http://www.open-works.net/contact.html

which could fix this issue, if you are prepared to throw some 
money their way.


Nick