Hello all,
I would really appreciate some assistance on this. The intent is to
create a vocabulary/flashcard program with proper pronunciations.
Pronunciations are saved as individual mp3 files which I want to
play whenever a new term is displayed. My current attempt is simply
to get the the file
Thanks,
The problem was that mciSendString was immediately returning control
to the caller after being called. This simple change fixed the
problem:
mciSendString("play myFile wait");
Hello,
What is the proper way to read a directory such that file names are not
garbled? Here is the example I borrowed form the std.file documentation.
Screen shots of folder is attached. Thanks.
void main(string[] args)
{
bool callback(DirEntry* de)
{
if (de.i
On 11/5/2010 10:51 PM, Kagamin wrote:
Tyro[a.c.edwards] Wrote:
Hello,
What is the proper way to read a directory such that file names are not
garbled? Here is the example I borrowed form the std.file documentation.
Screen shots of folder is attached. Thanks.
void main(string[] args
On 11/6/2010 2:10 AM, Dmitry Olshansky wrote:
On 05.11.2010 18:25, Tyro[a.c.edwards] wrote:
On 11/5/2010 10:51 PM, Kagamin wrote:
Tyro[a.c.edwards] Wrote:
Hello,
What is the proper way to read a directory such that file names are not
garbled? Here is the example I borrowed form the std.file
On 2/25/2011 3:33 AM, Jesse Phillips wrote:
Well using one language you aren't familiar with to learn another is probably
not the best strategy.
For one thing C++ uses namespaces and D uses modules. They are both about
name-space but are very different approaches. If you want to learn about
m
class Class{}
void main()
{
Class myClass;
Class* pClass0 = &myClass; // OK
Class* pClass1 = new Class; // Error: cannot implicitly convert [8]
// expression (new Class) of type t.Class
// to test.Class*
Class* pClass2 = &(new
On 2/27/2011 8:10 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] wrote:
class Class{}
void main()
{
Class myClass;
Class* pClass0 = &myClass; // OK
Class* pClass1 = new Class; // Error: cannot implicitly convert [8]
// expression (new Class) of type t.Class
// to test.Class*
Class* pCl
On 2/27/2011 8:52 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLong (hwnd);
.
.
.
switch(msg)
{
case FirstMatch:
pCtrl = new Controller (hwnd, reinterpret_cast (lParam));
break;
}
}
I&
On 2/27/2011 9:46 AM, Tyro[a.c.edwards] wrote:
On 2/27/2011 8:52 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLong (hwnd);
.
.
.
switch(msg)
{
case FirstMatch:
pCtrl = new Controller
On 2/27/2011 10:39 PM, Steven Schveighoffer wrote:
On Sat, 26 Feb 2011 19:46:18 -0500, Tyro[a.c.edwards]
wrote:
On 2/27/2011 8:52 AM, Simen kjaeraas wrote:
Tyro[a.c.edwards] wrote:
I'm trying to convert some c++ code that defines
T func(par...)
{
Controller * pCtrl = WinGetLong
The bellow code attempts to use LoadStringA() to initialize _buf.
However, regardless of what form _buf takes, the body of the if
statement is always executed. I've attempted to use every type of string
available in D to include char* _buf[MAX_RESSTRING+1] and setting
_buf[MAX_RESSTRING] = '\0'
On 2/28/2011 9:58 PM, Steven Schveighoffer wrote:
On Mon, 28 Feb 2011 07:34:39 -0500, Tyro[a.c.edwards]
wrote:
The bellow code attempts to use LoadStringA() to initialize _buf.
However, regardless of what form _buf takes, the body of the if
statement is always executed. I've attempted t
On 2/28/2011 11:08 PM, J Chapman wrote:
== Quote from Tyro[a.c.edwards] (nos...@home.com)'s article
Both implementations results in error code 1812 being returned from
GetLastError. explanation of the code reads:
ERROR_RESOURCE_DATA_NOT_FOUND
1812 (0x714)
The spec
== Quote from Denis Koroskin (2kor...@gmail.com)'s article
> On Mon, 28 Feb 2011 19:35:47 +0300, Tyro[a.c.edwards]
> wrote:
> > On 2/28/2011 11:08 PM, J Chapman wrote:
> >> == Quote from Tyro[a.c.edwards] (nos...@home.com)'s article
> >>> Both imple
== Quote from Denis Koroskin (2kor...@gmail.com)'s article
> On Tue, 01 Mar 2011 02:08:48 +0300, Tyro[a.c.edwards]
> wrote:
> > == Quote from Denis Koroskin (2kor...@gmail.com)'s article
> >> On Mon, 28 Feb 2011 19:35:47 +0300, Tyro[a.c.edwards]
> >
> &
On 3/1/2011 7:18 PM, Bekenn wrote:
On 3/1/2011 12:25 AM, Tyro[a.c.edwards] wrote:
Nevertheless, execution haults
at the very next line following/catch and Create() never returns.
CreateWindow sends a few messages to your window proc; anything
interesting happening there?
Not sure how to
On 3/1/2011 8:25 PM, Tyro[a.c.edwards] wrote:
On 3/1/2011 7:18 PM, Bekenn wrote:
On 3/1/2011 12:25 AM, Tyro[a.c.edwards] wrote:
Nevertheless, execution haults
at the very next line following/catch and Create() never returns.
CreateWindow sends a few messages to your window proc; anything
Not very elegant but this should get the job done:
000 module strip;
001 import std.algoritm : countUntil;
002 import std.array: strip;
003 import std.file : read;
004 import std.string : splitlines;
005 import std.stdio: writeln;
006
007 void main(string[] args)
008 {
009 bool s
The following patch addresses the following issues:
1) fixed improper handling of nested and multiline comments that
do not take up a complete line.
2) eliminate extra blank lines where unit tests and comments are
removed.
Replace lines 31 & 32 with:
# auto n = countUntil(line, "+/");
# if(n !=
Messed that up again: see embeded change. Wish I could just copy
and pase but that's not possible with my current setup.
== Quote from Tyro[a.c.edwards] (nos...@home.com)'s article
> The following patch addresses the following issues:
> 1) fixed improper handling of nested and mu
On 7/13/2011 11:35 PM, Trass3r wrote:
Am 13.07.2011, 16:02 Uhr, schrieb Steven Schveighoffer
:
void h() {}
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(alias g = f)()
{
g();
}
}
As a workaround, is there a reason you need blub to be parameterized?
I mean, f is alr
On 7/14/2011 12:24 AM, Trass3r wrote:
Am 13.07.2011, 16:58 Uhr, schrieb Tyro[a.c.edwards] :
Don't know it this is the right answer or a possible bug but it does
the trick:
void h() { import std.stdio; write("h()"); }
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
v
On 7/14/2011 12:24 AM, Trass3r wrote:
Am 13.07.2011, 16:58 Uhr, schrieb Tyro[a.c.edwards] :
Don't know it this is the right answer or a possible bug but it does
the trick:
void h() { import std.stdio; write("h()"); }
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
v
While attempting to build the DFL libraries, I encountered the following
three errors:
[1] tabcontrol.d(18): Error: class dfl.tabcontrol.TabPage use of
dfl.control.Control.opEquals(Control ctrl) hidden by TabPage is deprecated
[2] tabcontrol.d(18): Error: class dfl.tabcontrol.TabPage use of
On 7/23/2011 7:49 PM, bearophile wrote:
Tyro[a.c.edwards]:
[3] imagelist.d(22): Error: class
dfl.imagelist.ImageList.ImageCollection use of
dfl.imagelist.ImageList.ImageCollection.ListWrapArray!(Image,_images,_adding,_added,_blankListCallback,_removed,false,false,false).insert(int
index, Image
Hi all,
I've just installed DMD 2.058 and attempted to compile a little
script but was greeted with the following error:
gcc: Invalid argument
I used the .dmg installer from http://www.dlang.org/download.html
and issued the command:
dmd average
Is there something I'm missing?
Thanks,
And
On Sunday, 19 February 2012 at 11:39:15 UTC, kraybourne wrote:
On 2/19/12 09:20 , Tyro[a.c.edwards] wrote:
Hi all,
I've just installed DMD 2.058 and attempted to compile a
little script
but was greeted with the following error:
gcc: Invalid argument
I used the .dmg installer from
Hi,
I hoping someone could whip up an example of how to check if it's possible to
connect to a given site: eg. ftp.digitalmars.com and display a message if
unsuccessful. If one is already available, could someone please point me to it?
Thanks,
Andrew
Per Jarrett Billingsley's advice, the following is provided:
I am using DMD v2.028 w/Phobos 2
Thanks again.
Tyro[a.c.edwards] Wrote:
> Hi,
>
> I hoping someone could whip up an example of how to check if it's possible to
> connect to a given site: eg. ftp.digital
Jarrett Billingsley Wrote:
> Please, *please* indicate whether you are using Phobos 1, Phobos 2, or Tango.
>
> It's hard enough trying to read your mind about what you're trying to
> do. It's even harder when there are two or three completely different
> solutions to it.
Jarrett,
I've always u
Jarrett Billingsley Wrote:
> Please, *please* indicate whether you are using Phobos 1, Phobos 2, or Tango.
>
> It's hard enough trying to read your mind about what you're trying to
> do. It's even harder when there are two or three completely different
> solutions to it.
Jarrett,
I've always u
Is it yet possible to statically initialize an associative array? If so,
please point me to the documentation. I am using DMD v2.028.
Thanks,
Andrew
Is it yet possible to statically initialize an associative array? If so,
please point me to the documentation. I am using DMD v2.028.
Currently I'm able to do this:
import std.stdio;
string[string] types;
static this(){
types = [ "void":"void", "bool":"bool" ];
}
void main(){
writeln(
Attempting to compile the following from snippet
auto r = iota(0, 10, 1);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
from the documentation, I encountered following error
range.d(1184): Error: this._input.opIndex(index) is not an lvalue
Looking at the code I find "retu
Attempting to compile the following from snippet
auto r = iota(0, 10, 1);
assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][]));
from the documentation, I encountered following error
range.d(1184): Error: this._input.opIndex(index) is not an lvalue
Looking at the code I find "return _inpu
I've used Burton Radons' "urllib" in the past to get download files from the
internet, however the library has atrophied and can no longer be used with DMD
v2.029 (not how long it's been this way because I haven't tried to compile it
since 2006).
I'm wondering if someone could point me to an ex
d with Tango many years now and got away from D1
as soon D2 forked back in 2007.
> -[Unknown]
>
>
> Tyro[a.c.edwards] wrote:
> > I've used Burton Radons' "urllib" in the past to get download files from
> > the internet, however the library has atrophied an
On 4/27/2009 5:14 PM, Unknown W. Brackets wrote:
If you want both HTTP and FTP, it's definitely worth using a library for
it. There are a lot of options, but almost all of them are out of date I
suppose for 2.x...
I've always hated curl, but you might look at how hard it is to get/make
d headers
I'm on a Japanese system attempting to input/output Japanese Characters
and cannot seem to accomplish it. How would I read
"憲法記念日 理念と現実、広がる格差" from stdin/file and output the same
to stdout/file?
Thanks,
Andrew
On 5/3/2009 7:41 AM, Georg Wrede wrote:
Tyro[a.c.edwards] wrote:
I'm on a Japanese system attempting to input/output Japanese Characters
and cannot seem to accomplish it. How would I read
"憲法記念日 理念と現実、広がる格差" from stdin/file and output the
same to stdout/file?
import std.st
One cannot necessarily rely on particular font being available on a system, and
for security reasons asminsistrators restrict instalation of fonts (among other
things) onto systems in a network. I would like to know if it is possible to
embed a font into my code so that I know that it will alway
On 5/6/2009 12:30 PM, Daniel Keep wrote:
Tyro[a.c.edwards] wrote:
One cannot necessarily rely on particular font being available on a system, and for
security reasons asminsistrators restrict instalation of fonts (among other things) onto
systems in a network. I would like to know if it is
On 5/6/2009 1:39 PM, grauzone wrote:
Use
ubyte[] fontbytes = cast(ubyte[])import("yourfont.ttf");
This will take care of making sure the font is available. How do you
instruct the library (DFL in this case) that this variable contains the
font or that after you write it back to the hard drive
On 5/6/2009 9:50 PM, John C wrote:
Tyro[a.c.edwards] Wrote:
When I do this, how do I ensure that the program is able to locate the
font after extraction without "installing" it?
I think AddFontResource from the SDK will do that.
http://msdn.microsoft.com/en-us/library/dd183326(V
http://www.digitalmars.com/d/2.0/phobos/std_random.html#uniform
Above documentation provides the following example:
Random gen(unpredictableSeed);
// Generate an integer in [0, 1023]
auto a = uniform(0, 1024, gen);
// Generate a float in [0, 1)
auto a = u
I am looking for a D version of scanf() but I'm sure there is no such
thing so I tried contrived one. I am sure I missed a slew of obvious
things and that this cannot be used for much more than a little toy on
my personal computer. I would like to make it usable for others so I am
asking for so
On 5/11/2009 2:35 PM, grauzone wrote:
Tyro[a.c.edwards] wrote:
I am looking for a D version of scanf() but I'm sure there is no such
thing so I tried contrived one. I am sure I missed a slew of obvious
There's readf() in std.stream. I think you have to use std.cstream : din
to u
On 5/20/2009 6:19 PM, BLS wrote:
Sam Hu wrote:
I looked up in D2 in std.stdio,std.file,std.cstream and std.stream and
try to find a very simple method which can read from a file once a
value other than once an entire row.I just can not find it maybe this
idea is wrong.Say how to simply read & wr
I am able to display the GIF but all animation ceases. How would I activate
this feature?
Thanks,
Andrew
50 matches
Mail list logo