Hi guys,
I've the following code:
abstract class a {}
class b : a { this(a* myAttr = null) {} }
class c : a { this(a* myAttr = null) {} }
void main()
{
auto myb = new b();
auto myc = new c();
}
DMD says "Constructor c.this(a* myAttr = null) is not callable
using argument types (b*)".
On Tuesday, 18 October 2016 at 17:49:16 UTC, Adam D. Ruppe wrote:
On Tuesday, 18 October 2016 at 17:39:45 UTC, Nrgyzer wrote:
But it's not working. I'm always getting the following error:
What happens if you go to that HTTPS url in your normal web
browser?
I kinda expect the server isn't
Hi everyone,
I'm trying to retrieve some data from a url using curl. I'm using
the following code here:
void main()
{
ubyte[] data;
CURL* curl = curl_easy_init();
curl_easy_setopt(curl, CurlOption.url, "Url>".toStringz);
curl_easy_setopt(curl,
Hi,
I'm looking for a function that converts my hex-string to a
binary representation. In Python I write the following:
myHex = 123456789ABCDEF
myBin = myHex.decode('hex')
But how to do the same in D? Is there any function?
Thanks for suggestions!
On Friday, 24 April 2015 at 18:45:55 UTC, Jesse Phillips wrote:
On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote:
Hi,
I'm looking for a function that converts my hex-string to a
binary representation. In Python I write the following:
myHex = 123456789ABCDEF
myBin = myHex.decode('hex
On Saturday, 18 April 2015 at 13:00:59 UTC, Steven Schveighoffer
wrote:
On 4/18/15 4:18 AM, nrgyzer wrote:
array.d(1510): Error not a property splitter(range, sep).array
sample.d(6): Error template instance std.array.split!(string,
char)
error instantiating
Are you using -property switch
Hi,
I've the following source:
import std.array : split;
import std.stdio : writeln;
void main()
{
string myString = Hello World;
string[] splitted = myString.split( );
}
But when I compile the code above, I'm getting the following
error:
Error: template instance
On Saturday, 18 April 2015 at 08:13:00 UTC, Rikki Cattermole
wrote:
On 18/04/2015 8:08 p.m., nrgyzer wrote:
Hi,
I've the following source:
import std.array : split;
import std.stdio : writeln;
void main()
{
string myString = Hello World;
string[] splitted = myString.split
On Sunday, 19 October 2014 at 22:22:05 UTC, Joakim wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import my.static.library.binding;
static this()
{
foreach ( m; __traits(allMembers
On Monday, 20 October 2014 at 16:05:14 UTC, nrgyzer wrote:
On Sunday, 19 October 2014 at 22:22:05 UTC, Joakim wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import
This solved the problem for the first time, BUT - I don't know if
it's a bug or a feature - I ran into another problem. I'm having
the following few lines:
module example;
private
{
string[string] myPrivateArray;
}
static this()
{
foreach ( m; __traits(allMembers, example) )
{
On Monday, 20 October 2014 at 17:37:34 UTC, nrgyzer wrote:
This solved the problem for the first time, BUT - I don't know
if it's a bug or a feature - I ran into another problem. I'm
having the following few lines:
module example;
private
{
string[string] myPrivateArray;
}
static
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import my.static.library.binding;
static this()
{
foreach ( m; __traits(allMembers, example) )
{
static if ( isCallable!(mixing(m) )
{
// ... do something here
}
}
}
void
On Sunday, 19 October 2014 at 14:48:18 UTC, monarch_dodra wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
static if ( isCallable!(mixing(m) )
mixing ?
void main() { /* do something here */ }
What exactly are you doing here
On Sunday, 19 October 2014 at 17:14:14 UTC, monarch_dodra wrote:
On Sunday, 19 October 2014 at 16:09:41 UTC, nrgyzer wrote:
mixing should be replaced with mixin: static if (
isCallable!(mixin(m) )
My main is empty in both cases. So nothing done in my main
(currently).
Posting full code
On Thursday, 16 October 2014 at 19:19:21 UTC, John Colvin wrote:
On Thursday, 16 October 2014 at 18:39:50 UTC, nrgyzer wrote:
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example(example1, 1)
void myFunction
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example(example1, 1)
void myFunction()
{
// do something
}
module mod.example2;
@example(example2, 2)
void myFunction()
{
// do something
}
I'm using the struct to
Hi guys,
I'm having some trouble using the treeset implementation of
Steven (dcollections) in conjunction with __gshared. When I do
the following:
class Entry
{
int value;
this(int v)
{
value = v;
}
int opCmp(Object o)
{
On Thursday, 21 August 2014 at 23:29:56 UTC, Idan Arye wrote:
On Thursday, 21 August 2014 at 23:05:48 UTC, Ali Çehreli wrote:
I don't think it is a concern as JSON does not encode types.
It is up to the receiver how to interpret the data. Here is
the output of the program above:
On Tuesday, 19 August 2014 at 20:33:00 UTC, monarch_dodra wrote:
On Monday, 18 August 2014 at 13:51:14 UTC, nrgyzer wrote:
Hi all,
I've the following code snipped:
import std.bigint;
void main(string[] args)
{
BigInt i = 12345;
if (args.length 1
On Thursday, 21 August 2014 at 17:39:16 UTC, Ali Çehreli wrote:
On 08/21/2014 04:12 AM, nrgyzer wrote:
I'm using the goto-command to exit my function
if an error (not necessarily an exception) occured.
Sorry to repeat myself but if an exception occurs in code
before the goto, the exit code
Hi everyone,
I'm facing a problem with the JSON functions. I've to communicate
with another PC using JSON. Here's a simple snipped which shows
my problem:
import std.json;
import std.stdio;
void main()
{
double d = 1.23456789;
JSONValue j = d;
sendToRemote(toJSON(j));
}
On Monday, 18 August 2014 at 17:47:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Mon, 18 Aug 2014 13:51:12 +
nrgyzer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
When I try to compile this sample application I'm getting the
following error:
sample.d(7): Error
Hi all,
I've the following code snipped:
import std.bigint;
void main(string[] args)
{
BigInt i = 12345;
if (args.length 1)
{
goto Exit;
}
i = BigInt(67890);
Exit:
return;
}
When I try to compile this sample
On Monday, 31 March 2014 at 19:05:11 UTC, Matt Soucy wrote:
On 03/31/2014 02:59 PM, nrgyzer wrote:
Hi guys,
I updated my dmd version from 2.0.63 to 2.0.65 and having some
trouble
with my JSON-definitions. The code below worked in 2.0.63 but
not in
2.0.65:
JSONValue oJson = JSONValue
Hi guys,
I updated my dmd version from 2.0.63 to 2.0.65 and having some
trouble with my JSON-definitions. The code below worked in 2.0.63
but not in 2.0.65:
JSONValue oJson = JSONValue();
oJson.type = JSON_TYPE.OBJECT; // FAILS
oJson.object[myEntry] = JSONValue();
oJson.object[myEntry].type
On Monday, 24 March 2014 at 05:32:30 UTC, Vladimir Panteleev
wrote:
On Sunday, 23 March 2014 at 20:12:38 UTC, nrgyzer wrote:
Hi guys,
I'm experimenting with sockets and having trouble to detect
when the remote side closes the connection. Here's my code:
// Client:
module client;
import
Hi guys,
I'm experimenting with sockets and having trouble to detect when
the remote side closes the connection. Here's my code:
// Client:
module client;
import std.socket;
void main()
{
TcpSocket s = new TcpSocket();
s.connect(new InternetAddress(localhost, 8080));
Hi guys,
I'm updated from DMD 2.060 to 2.061 and I just run into some
trouble by using associative arrays. Let's say I've the following
few lines:
string[string] myValues;
ref string getValue(string v) {
return myValues[v];
}
void main() {
getValue(myValue) = myString;
}
I get a
On Friday, 8 February 2013 at 19:24:55 UTC, simendsjo wrote:
On Friday, 8 February 2013 at 17:16:15 UTC, Nrgyzer wrote:
Hi guys,
I'm updated from DMD 2.060 to 2.061 and I just run into some
trouble by using associative arrays. Let's say I've the
following few lines:
string[string] myValues
On Friday, 8 February 2013 at 20:30:00 UTC, Maxim Fomin wrote:
On Friday, 8 February 2013 at 20:10:32 UTC, Nrgyzer wrote:
void main() {
int[string] b;
b[hello] = 3;
}
This works for both versions... but I don't know why using a
method with ref-return value doesn't work anymore.
Thanks
Hi guys,
after some hours I successfully compiled wxD without errors. When
I try to compile a simple example like the hello example I get
the following message:
dmd -c -version=wx28 -version=__WXMSW__ -version=ANSI -I..\..
Hello.d
dmd -g -of..\..\bin\Hello.exe Hello.obj ..\..\wxd.lib
On Saturday, 22 December 2012 at 22:28:57 UTC, Adam D. Ruppe
wrote:
On Saturday, 22 December 2012 at 22:14:28 UTC, nrgyzer wrote:
is it possible to get a list of all inherited classes from a
base class like this:
Yes, though it isn't compile time - gotta be runtime.
ClassInfo
Hi guys,
I know... there's a lib for curl but I'm using an old CURL-binding for D...
I've the following problem: I'm sending my login data to
a web page and I want store the response of curl_easy_perform() in a string. So
I'm using the following few lines to do that:
string temp;
size_t
Hi,
I've the following enumeration:
enum path : string {
log1 = /var/log1,
log2 = /var/log2
}
Now... when I try to do the following:
string subDirectory = example;
string newPath = buildPath(path.log1, subDirectory);
I get the following errors:
Error: template std.path.buildPath does
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
nrgyzer:
Is this a bug in std.path.buildPath() or is there anything I'm
doing wrong?
The signature of buildPath is:
immutable(C)[] buildPath(C)(const(C[])[] paths...);
But your inputs aren't of the same type. Named enum create
I'm trying to do the following:
module myModule;
int calculate(T)(int a, int b) if(T == add) {
return a + b;
}
int calculate(T)(int a, int b) if(T == subtract) {
return a - b;
}
But when I try to run the following code, I get template myModule.calculate
does not match any function
Hm... yes - works. I simply rewrote my method-header and it just works, too...
but thanks :)
== Auszug aus Dmitry Olshansky (dmitry.o...@gmail.com)'s Artikel
On 21.04.2012 22:46, H. S. Teoh wrote:
On Sat, Apr 21, 2012 at 09:41:18PM +0400, Dmitry Olshansky wrote:
On 21.04.2012 21:24, nrgyzer wrote:
Hi guys,
I'm trying to use std.regex to parse a string like the following
Hi guys,
I'm trying to use std.regex to parse a string like the following:
string myString = preOuter {if condition1} content1 {if condition2} content2
{elseif condition3} content3 {else}any other content{/if}{/if} postOuter;
Is there any chance to use std.regex to parse the string above? I
Thanks for DMagick... works great, except toBlob(). When I try the following:
Image example = new Image(Geometry(100, 100), new ColorRGB(0, 255, 0));
example.toBlob();
I get an access violation. Do I anything wrong or is it a bug? (I'm using
Imagick
6.7.6, DMD64 and CentOS)
I'm working on IPC's. I already figured out that the implementation depends on
the operation system. Is there any solution to support both - windows posix
systems? I'm developing on a win-machine and don't want to re-write my app on
linux. As I saw on dlang.org, std.process of Phobos (prerelease)
]);
cs.sendTo(HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello
World);
cs.close();
}
On Thu, Feb 9, 2012, at 07:31 PM, Nrgyzer wrote:
Hi guys,
I wrote the following few lines:
private {
import std.socket;
}
void main() {
Socket s = new
: 11\r\n\r\nHello World);
cs.close();
}
But... how can I make sure that I got all data sent by the client/browser?
== Auszug aus DNewbie (r...@myopera.com)'s Artikel
nrgyzer,
please check the return value of 'receive'.
http://dlang.org/phobos/std_socket.html#receive
On Fri, Feb 10
Hi,
I used Stream.read(out float) to read bytes of my stream. It worked for 2.056,
but when I try to compile my code using 2.057 I get the following message:
((shared(float)))
matches both:
std.stream.Stream.read(out float x)
and:
std.stream.Stream.read(out real x)
Because of
Hi guys,
I get an internal error in \ztc\cgcs.c 352 when I try to do the following:
HashMap!(uint, float[2]) example;
void main() {
example = new HashMap!(uint, float[2])();
example.set(0, [10.f, 20.f]);
example.set(10, [100.f, 200.f]);
foreach (ref c; example.keys)
Hi guys,
is there any way to use shared members without casting them? Fox example:
class Example {
private shared HashSet!(string) ex;
...
this() {
ex = cast(shared) new HashSet!(string)();
}
void write() {
foreach (ref c; cast(HashSet!(string)) ex) {
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 18 Aug 2011 06:47:32 -0400, nrgyzer nrgy...@gmail.com
wrote:
== Auszug aus Robert Clipsham (rob...@octarineparrot.com)'s
Artikel
On 16/08/2011 20:17, nrgyzer wrote:
Hi everyone,
I've the following
== Auszug aus Robert Clipsham (rob...@octarineparrot.com)'s Artikel
On 16/08/2011 20:17, nrgyzer wrote:
Hi everyone,
I've the following:
private static ubyte[][2][hash_t] classInstances;
this() {
classInstances[toHash()] = new ubyte[2]; // does not work
}
I want
Hi everyone,
I've the following:
private static ubyte[][2][hash_t] classInstances;
this() {
classInstances[toHash()] = new ubyte[2]; // does not work
}
I want insert every class instance into the hashmap. Every class
instance should be contained in the map after the constructor was
Hi guys,
I'm trying to read a property of a class like:
class MyClass {
private ubyte pToRead;
@property ubyte toRead() { return pToRead; }
}
...
File f = new File(...);
MyClass c = new MyClass();
f.read(c.toRead);
...
but when I compile my code, I always get:
executable.d(389):
== Auszug aus nrgyzer (nrgy...@gmail.com)'s Artikel
Hi guys,
I'm trying to read a property of a class like:
class MyClass {
private ubyte pToRead;
@property ubyte toRead() { return pToRead; }
}
...
File f = new File(...);
MyClass c = new MyClass();
f.read(c.toRead);
...
but when
Hi guys,
the most applications using there own icons for the exe-file. I'm
currently using external tools to set my own icon for the exe, but is
there any chance to automatically set the icon using the dmd compiler?
as an argument to dmd.
On Mon, Aug 1, 2011 at 10:27 AM, Nrgyzer nrgy...@gmail.com wrote:
Hi guys,
the most applications using there own icons for the exe-file. I'm
currently using external tools to set my own icon for the exe,
but is
there any chance to automatically set the icon using
== Auszug aus Adam Ruppe (destructiona...@gmail.com)'s Artikel
Browsers speak HTTP, which is a higher level protocol than
plain sockets.
If you connect to your app with a simpler program, like nc,
you'll probably see the message.
If you want to serve web pages, consider one of these options:
Hi guys,
I'm trying to work with sockets but I've some trouble with them. I
implemented a really simple Socket which should simply send a text
message after accepting the request. My code is the following:
module server;
import std.socket;
void main() {
TcpSocket server = new
== Auszug aus Adam Ruppe (destructiona...@gmail.com)'s Artikel
Browsers speak HTTP, which is a higher level protocol than
plain sockets.
If you connect to your app with a simpler program, like nc,
you'll probably see the message.
If you want to serve web pages, consider one of these options:
== Auszug aus Mafi (m...@example.org)'s Artikel
Am 07.07.2011 23:23, schrieb nrgyzer:
Hi guys,
I'm trying to read a string from a text file which contains a
value of an enumeration like:
enum MyEnum : string {
Entry_1 = abc,
Entry_2 = def,
Entry_3 = ghi,
}
Stream
Hi guys,
I'm trying to read a string from a text file which contains a value of an
enumeration like:
enum MyEnum : string {
Entry_1 = abc,
Entry_2 = def,
Entry_3 = ghi,
}
Stream s = new File(myFile.ext, FileMode.In);
uint len;
s.read(len);
string entry = cast(string)
Hi there,
is there any possibility to get a sliced array from another array
between two ranges like:
int[uint] myArray;
myArray[10] = 1000;
myArray[20] = 2000;
myArray[30] = 3000;
myArray[40] = 4000;
myArray[50] = 5000;
int[] newArray = myArray[= 20 .. = 40]; // not able to do this
On Mon, 13 Jun 2011 12:15:40 -0400, nrgyzer nrgy...@gmail.com
wrote:
Hi there,
is there any possibility to get a sliced array from another array
between two ranges like:
int[uint] myArray;
myArray[10] = 1000;
myArray[20] = 2000;
myArray[30] = 3000;
myArray[40] = 4000
On Mon, 13 Jun 2011 14:52:24 -0400, nrgyzer nrgy...@gmail.com
wrote:
On Mon, 13 Jun 2011 12:15:40 -0400, nrgyzer nrgy...@gmail.com
wrote:
Hi there,
is there any possibility to get a sliced array from another
array
between two ranges like:
int[uint] myArray;
myArray[10
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Mon, 13 Jun 2011 15:44:01 -0400, nrgyzer nrgy...@gmail.com
wrote:
On Mon, 13 Jun 2011 14:52:24 -0400, nrgyzer nrgy...@gmail.com
wrote:
On Mon, 13 Jun 2011 12:15:40 -0400, nrgyzer
nrgy...@gmail.com
wrote:
Hi
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Mon, 16 May 2011 15:32:43 -0400, useo unkn...@unknown.com
wrote:
Hey guys,
is there any chance to create an abstract constructor like:
abstract class ABC {
abstract this();
}
DMD always says ...this
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Mon, 16 May 2011 16:12:05 -0400, nrgyzer nrgy...@gmail.com
wrote:
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Mon, 16 May 2011 15:32:43 -0400, useo unkn...@unknown.com
wrote:
Hey guys
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 05 May 2011 17:03:51 -0400, Nrgyzer nrgy...@gmail.com
wrote:
Hey guys,
I'm trying to call toHash() in a class which receives an interface
class as input param. But I always get Error: no property
'toHash
Hey guys,
I'm trying to call toHash() in a class which receives an interface
class as input param. But I always get Error: no property 'toHash'
for type
My code looks like:
module iFBlock;
private {
import std.stream;
}
interface IFBlock {
public {
void write(Stream);
}
}
== Auszug aus David Nadlinger (s...@klickverbot.at)'s Artikel
On 3/26/11 11:08 PM, bearophile wrote:
I suggest to copy your code, and then keep removing lines from
your copy, making sure it keep showing the same compiler error. In
some time you will probably be able to produce a small program,
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
nrgyzer:
In my tests, that code above doesn't produces the assertion
failure,
but my original source code looks very similar.
You may have to start over then. I suggest to duplicate the whole
code, and then start on the copied
Hey guys,
I got Assertion failure: '!vthis-csym' on line 703 in file 'glue.c'
after I add LinkList!(uint) myList; to my source file. I figured out
that the same bug was already reported on http://lists.puremagic.com/
pipermail/digitalmars-d-bugs/2010-October/019237.html
Ticket 4129 describes a
I'm trying to read a png file and I'm having some trouble with the
chunk-size. Each chunk of a png file begins with a 4 byte (unsigned)
integer. When I read this 4 byte integer (uint) I get an absolutely
incorrect length. My code currently looks like:
void main(string args) {
File f = new
== Auszug aus Sequ (u...@example.net)'s Artikel
Quoted from Nrgyzer:
On windows you've to create a folder called lib
before you run the command above - I currently
can't say it exactly if it's needed on linux, too.
I did need to create a 'lib' directory before running 'make -
flinux.mak DC
== Auszug aus Stewart Gordon (smjg_1...@yahoo.com)'s Artikel
What compiler version/platform are you using? I had to fix some errors
before it would
compile on mine (1.066/2.051 Windows).
On 19/02/2011 13:42, Nrgyzer wrote:
snip
Now... and with writefln(%s, cast(ubyte[]) convertToUTF8
== Auszug aus Siqu (u...@example.net)'s Artikel
Hi,
I'm trying to figure out how I could get a simple OpenGL/GLUT
program working
in DMD2. As an attachment, I've added a C version of what I'd like
to do. I'd
compile the C version using:
gcc simple.c -lglut -lGLU -o simple
I've found a few
== Auszug aus spir (denis.s...@gmail.com)'s Artikel
On 02/19/2011 02:42 PM, Nrgyzer wrote:
== Auszug aus Stewart Gordon (smjg_1...@yahoo.com)'s Artikel
On 13/02/2011 21:49, Nrgyzer wrote:
snip
It compiles and works as long as the returned char-array/string
of f.readLine() doesn't
== Auszug aus Stewart Gordon (smjg_1...@yahoo.com)'s Artikel
On 13/02/2011 21:49, Nrgyzer wrote:
snip
It compiles and works as long as the returned char-array/string of
f.readLine() doesn't
contain non-UTF8 character(s). If it contains such chars, writeln() doesn't
write
anything
Hey guys,
I've the following source:
module filereader;
import std.file;
import std.stdio : writeln;
void main(string[] args) {
File f = new File(myFile.ext, FileMode.In);
while(!f.eof()) {
writeln(convertToUTF8(f.readLine()));
}
f.close();
}
Hey guys,
I'm trying to iterate over an enumeration which contains strings like
the this:
enum FileName : string {
file1 = file1.ext,
file2 = file2.ext
}
I already found this article: http://lists.puremagic.com/pipermail/
digitalmars-d/2007-July/021920.html but it's an enum which contains
== Auszug aus Jesse Phillips (jessekphillip...@gmail.com)'s Artikel
Nrgyzer Wrote:
Hey guys,
I'm trying to iterate over an enumeration which contains strings
like
the this:
enum FileName : string {
file1 = file1.ext,
file2 = file2.ext
}
I already found this article: http
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
Nrgyzer:
Is there any chance to cast/convert this array to an indexed
array or
is it possible to iterate over specific indices? I know that
there is
something like next() for the foreach-statement but when the array
contains
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com
wrote:
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
Nrgyzer:
Is there any chance to cast/convert this array to an indexed
array
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 03 Feb 2011 10:41:16 -0500, Nrgyzer nrgy...@gmail.com wrote:
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 03 Feb 2011 09:35:44 -0500, Nrgyzer nrgy...@gmail.com
wrote:
== Auszug aus
== Auszug aus Stanislav Blinov (bli...@loniir.ru)'s Artikel
03.02.2011 19:34, Nrgyzer пишет:
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
This only works if you rarely remove elements (removal in an
array is an O(n) operation).
-Steve
I already thought about using
Hey guys,
I have an associative array like this: T[hash_t] myArray; (T means
the template type).
Is there any chance to cast/convert this array to an indexed array or
is it possible to iterate over specific indices? I know that there is
something like next() for the foreach-statement but when
Hey,
how can I interrupt/suspend threads in D2? core.thread only provides
start(), join() and similar, but nothing like interrupt() in JAVA.
I have a thread which sleeps for some seconds. Does join() interrupts
the Thread.sleep()-call? I don't want that the user have to wait some
seconds because
Hey guys,
I already posted a thread in the wrong section (digitalmars.D instead of
digitalmars.D.learn) - sorry for that. I'm looking for a solution to suspend/
interrupt threads which are sleeping.
In the last few minutes I figured out some things I didn't understand exactly. I
tested thread
Nrgyzer nrgy...@gmail.com wrote:
The result is: true which means that testInstance of type a is
null -
but I
already created a instance and if I write writeln(testInstance is
null); after
Thread.yield(); in the main, it says false which means
testInstance is
a valid
instance
I just used implib libmysql.lib libmysql.dll /system but it produces
the same errors.
Thanks, but didn't help to change to implib /system libmysql.lib
libmysql.dll - some errors.
This solved the problems, thanks - but, when the line mysql =
mysql_init(null); produces an access violation.
Hey guys,
I've the following class:
abstract class Drawable {
public {
uint getHeight() { ... }
uint getWidth() { ... }
abstract {
void draw(T = void*)(uint zPos, T obj = null);
}
}
}
Ah, okay - remove override is enough.
Thanks :)
I just figured out that this doesn't work, when I use a array with
super class as base type, for example: Drawable[] textures;
Then, I'll get the following error:
Error: function draw!(void*).draw non-virtual functions cannot be
abstract.
I just implemented the draw-function as empty function,
The sense is that I have different, drawable classes/object - for
example a simple texture (not clickable) and a button (clickable).
When the user clicks the mouse, the obj-param which is defined by
using draw!(T = void*)(uint zPos, T obj = null) will be saved in a
template-struct which should
Hey guys,
I've used D1 in the past and D1 seems to check for correct function
pointers. In D2 I can pass any function pointer to an function, for
example:
...
void example(void function(int, int) fp) {
...
}
...
void callback1(int x, int y) {
}
void callback2() {
}
...
example(callback1); //
Hey guys,
I'm writing a console based tool for windows. To receive the users input, I
try to use getch() but the compiler always says Error: undefined identifier
getch. When I use getchar() it compiles successfully, but getchar() doesn't
returns after a single input.
Is there any equivalent
Okay, but what function can I use to get the pressed key?
kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I
always get the error, that kbhit (or similar functions) are not
available.
import std.stdio;
import std.c.stdlib;
import std.c.windows.windows;
void main(string[] args) {
Great, thanks :)
Hey guys,
I want encode and decode binary files like images, documents and similar file
types to use it in an binary xml. For those I created a
simple command line tool which encode or decode an file.
The encoding of files will be processed by these lines:
...
ubyte[] buffer;
buffer.length =
Hello guys,
I have an enumeration which contains symbols of different currencies
like the following:
enum CURRENCY : wchar {
DOLLAR = '$',
EURO = '�',
YEN = ...
}
When I try to append it to a string like
char[] myString = Currency: ~ CURRENCY.DOLLAR
I get the
1 - 100 of 124 matches
Mail list logo