On Fri, 20 Jul 2012 14:50:19 +0100, Namespace rswhi...@googlemail.com
wrote:
New question:
I have this code:
[code]
import std.stdio;
struct Test {
public:
this(int i = 0) {
writeln(CTOR);
}
this(this) {
writeln(COPY CTOR);
}
On Tue, 17 Jul 2012 15:23:05 +0100, bearophile bearophileh...@lycos.com
wrote:
Andrea Fontana:
class Known
{
void* data; // external data by c api
int type; // 0 for int, 1 for string, etc. ..
}
How can I implement a method like this?
Known known; // -- suppose
and without breaking the ABI. Regan Heath who
designed the Tango digest module, also said that digets are often used
with the factory pattern, which doesn't work with structs / templates.
Correction; I supplied some code which became the Tango digest modules,
someone else defined the final API
On Fri, 22 Jun 2012 15:55:12 +0100, Namespace rswhi...@googlemail.com
wrote:
If you have a null object you get an Access Violation without _any_
further information. That totally sucks.
It doesn't have to be that way.
A debug executable contains all sort of debugging information and a
On Tue, 12 Jun 2012 22:29:58 +0100, D Day damian...@hotmail.co.uk wrote:
Are there any implementations of this anywhere for D?
I really only care about the windows platform - and have considered
writing this myself with IOCP and std.socket, but I figure someone else
must have already done
On Thu, 07 Jun 2012 15:12:46 +0100, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 6/7/12, Kagamin s...@here.lot wrote:
If you define a
variable in the header, it will be included in each including
module and you'll get several instances of the variable and
symbol collision at link
On Sat, 02 Jun 2012 09:23:50 +0100, Jonathan M Davis jmdavisp...@gmx.com
wrote:
...and probably the same for C#, though I'm not sure
No, in C# you cannot call a static member function with a class instance,
see Static Members:
A static method, field, property, or event is callable on a
On Sat, 02 Jun 2012 19:25:05 +0100, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 6/2/12, Jonathan M Davis jmdavisp...@gmx.com wrote:
The trick is getting Walter to agree.
The trick is getting all the people that bought TDPL to burn their
books, because by the time all these new
On Tue, 05 Jun 2012 10:29:23 +0100, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Tuesday, June 05, 2012 11:08:03 Namespace wrote:
Currently i have all of my Files in the same Directory.
Now i will split them up in several specific Sub-Directories,
e.g. Graphics, System and so one. But i
On Wed, 23 May 2012 22:02:25 +0100, Paul phshaf...@gmail.com wrote:
This works, though it's ugly:
foreach(line; uniS.splitLines()) {
transcode(line, latinS);
fout.writeln((cast(char[]) latinS));
}
The Latin1String type, at the storage level, is a ubyte[]. By casting
to
On Wed, 16 May 2012 15:24:33 +0100, ref2401 refacto...@gmail.com wrote:
i have an array of ubytes. how can i convert two adjacent ubytes from
the array to an integer?
pseudocode example:
ubyte[5] array = createArray();
int value = array[2..3];
is there any 'memcpy' method or something else
I'm not sure if any of this is helpful but I've had a tinker and had some
measure of success :p
I think you have the following issues to resolve:
1. When you build the lib, you need to tell it that the progMain symbol is
to be found 'extern'ally.
2. When you build the exe, you have to make sure
On Mon, 23 Apr 2012 16:43:20 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
While dealing with unicode in my std.stream rewrite, I've found that
hand-decoding dchars is way faster than using library calls.
After watching Andrei's talk on generic and generative programming I have
: kbhit and Sleep are windows specific (sleep would be the unix
equivalent, not sure on one for kbhit).
Regan Heath
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
On Fri, 09 Mar 2012 11:12:44 -, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Friday, March 09, 2012 11:03:38 Regan Heath wrote:
On Fri, 09 Mar 2012 08:20:33 -, Chris Pons cmp...@gmail.com wrote:
Any idea why, system(PAUSE) does work?
As Jonathan says, assert throws AssertError
On Thu, 08 Mar 2012 06:12:44 -, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, March 08, 2012 06:38:48 Tyler Jameson Little wrote:
I would like to do something like this:
version (linux || BSD) {
// do something...
} else {
version (Windows) {
// do something
On Wed, 07 Mar 2012 17:29:25 -, Pedro Lacerda pslace...@gmail.com
wrote:
2012/3/7 Pedro Lacerda pslace...@gmail.com
Hi all,
I'm trying to handle disconnections transparently on SocketStream. I
thought something like this:
void send(ubyte[] buffer) in { assert(buffer.length 0); }
body {
A more efficient approach is to use async socket routines and an event
object.
So, in main you create a shared event object, then start the listen thread.
In listen you call an async select or accept, and then wait on that /and/
the shared event object.
To stop listen you set the shared
On Sat, 24 Dec 2011 16:46:18 -, RenatoL rex...@gmail.com wrote:
snippet:
int[] arr1 = [1,2,3,4,5];
int[5] arr2 = [1,2,3,4,5];
writeln(arr1.sizeof);
writeln(arr2.sizeof);
Output:
8
20
0 is ok to me but why 8??
It's a quirk of D that int[] is a reference type, so you get the size of
On Tue, 13 Dec 2011 17:58:57 -, Kai Meyer k...@unixlords.com wrote:
On 12/13/2011 10:39 AM, Vladimir Panteleev wrote:
On Tuesday, 13 December 2011 at 17:29:20 UTC, Kai Meyer wrote:
I get bytes_needed from the Content-Length header. The I get the
correct number of bytes from the
On Fri, 02 Dec 2011 17:24:11 -, Adam a...@anizi.com wrote:
Ok, fine, let me put it THIS way.
Suppose I use a parent library, and *I* don't update it.
The USER of my library provides an updated version for some
unrelated reason.
So, NOT testing that something is instantiable or not - JUST
On Fri, 02 Dec 2011 17:24:11 -, Adam a...@anizi.com wrote:
Ok, fine, let me put it THIS way.
Suppose I use a parent library, and *I* don't update it.
The USER of my library provides an updated version for some
unrelated reason.
So.. the user has:
Parent.dll
Your.dll
Their.exe
and
On Fri, 02 Dec 2011 17:43:04 -, Adam a...@anizi.com wrote:
I grant you that I should test it, and I never said otherwise. If
I'm attacking a strawman, it's the same one that was just put in
front of me as a misinterpretation of my argument.
Well, I believe I understand your argument and I
On Fri, 02 Dec 2011 17:44:44 -, Adam a...@anizi.com wrote:
Or I provide it as source, in which case, D *can* check it.
But it means that when the parent is changed, my class type and
instantiability implicitly changes, too.
True. This is a case I hadn't considered before. In this case
On Wed, 30 Nov 2011 23:35:58 -, NMS nathanms...@gmail.com wrote:
Is there a cross-platform way to create a new process and get its i/o
streams? Like java.lang.Process?
No. It different on windows and unix platforms, tho most/many of the unix
platforms are similar.
std.process is
On Thu, 01 Dec 2011 11:28:50 -, Dejan Lekic dejan.le...@gmail.com
wrote:
We talked about that too on IRC - the conclusion was - we should have
std.pipe module with (at least) AnonymousPipe, and NamedPipe classes.
Definitely. I will have a hunt for my misplaced code but it had some sort
On Thu, 01 Dec 2011 11:29:52 -, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
I can't find my thread in the archives yet, but I made a similar
inquiry a few days ago.
You can see a few examples for Windows here:
On Thu, 01 Dec 2011 17:50:48 -, Adam a...@anizi.com wrote:
Ok, starting to feel like I'm missing something obvious...
This:
void main() {
Child child = new Child;
}
also produces the (expected) error. Basically dmd was letting you get
away with the abstract class
On Sun, 06 Nov 2011 04:39:28 -, Jude Young 10equa...@gmail.com wrote:
Nice. Exactly what I was looking for.
I knew I was missing something tiny.
Now I just need to figure out why that works and I can say I've learned
something!
Thanks guys,
Jude
On Sat, Nov 5, 2011 at 5:38 AM, bearophile
On Wed, 12 Oct 2011 17:10:09 +0100, Trass3r u...@known.com wrote:
[DllImport(mydll.dll,
CallingConvention = CallingConvention.Cdecl,
SetLastError = false, CharSet = CharSet.Auto)]
private static extern bool concatenate(
string str1, //
On Fri, 07 Oct 2011 23:02:33 +0100, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
So I'm looking for some techniques or tricks (or, dare I say, design
patterns :x) you guys might have if you've ever ran into this kind of
problem.
The best I can come up with is a runtime solution:
import
On Wed, 05 Oct 2011 16:05:02 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Wed, 05 Oct 2011 10:38:58 -0400, Dsmith dsm...@nomail.com wrote:
In the core.thread library, there is a method isRunning() which takes a
thread.
To make code more portable, rather than use a system
On Mon, 03 Oct 2011 19:41:14 +0100, simendsjo simend...@gmail.com wrote:
It seems nginx is to blame here, and not me. I tried Lighttp and it
works. It gives several EWOULDBLOCK, but I can just handle these again
with no problem. I should have tried this sooner... I've used a lot of
time
On Sat, 01 Oct 2011 00:26:35 +0100, simendsjo simend...@gmail.com wrote:
Not sure if this is a problem with std.socket, nginx or my knowledge of
sockets. I'm pretty sure it's the last one.
I'm experimenting with fastcgi on nginx, and the socket stays in
TIME_WAIT even after I call
This might be a useful read..
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738547(v=vs.85).aspx
On Mon, 03 Oct 2011 12:57:56 +0100, simendsjo simend...@gmail.com wrote:
On 03.10.2011 11:36, Regan Heath wrote:
For a graceful close you're supposed to ensure there is no data
pending. To do that you:
shutdown(SD_SEND); // send only, not recv
enter a loop reading all data remaining
On Mon, 03 Oct 2011 17:33:57 +0100, simendsjo simend...@gmail.com wrote:
Yes. I've coded the client as follows:
1) start listening socket
2) wait for incoming connections or incoming data
3) receive(). If a socket returns 0 or -1, close it and process next
with data
4) read fastcgi request
On Fri, 30 Sep 2011 07:18:34 +0100, Jacob Carlborg d...@me.com wrote:
On 2011-09-29 19:31, Nick Sabalausky wrote:
Due to process separation, the following won't work:
script.sh:
#!/bin/sh
SOME_VAR=foobar
test.d:
import std.process;
void main()
{
system(./script.sh);
On Thu, 22 Sep 2011 22:18:29 +0100, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Thursday, September 22, 2011 14:10 Steven Schveighoffer wrote:
No, the parameter types can be const, and can accept mutable arguments.
The main point is, the return value has to be proven to be *unique*. The
On Mon, 19 Sep 2011 23:09:45 +0100, Simen Kjaeraas
simen.kja...@gmail.com wrote:
On Mon, 19 Sep 2011 23:20:47 +0200, bearophile
bearophileh...@lycos.com wrote:
A tiny puzzle I've shown on IRC. This is supposed to create an inverted
array of cards, but what does it print instead?
import
On Thu, 08 Sep 2011 16:33:49 +0100, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
E.g.:
import std.process;
void main()
{
auto res = shell(dmd bla.d);
}
where bla.d doesn't exist. This will throw an exception, but even if I
caught the exception I will still loose the error message.
On Tue, 05 Apr 2011 18:46:06 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Tue, 05 Apr 2011 13:24:49 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Fri, 01 Apr 2011 18:23:28 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
assert( !is null); // works on D. Try
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile bearophileh...@lycps.com
wrote:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you and Kagamin for the answers.
This may be slightly OT but I just wanted to raise
On Fri, 01 Apr 2011 13:38:45 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Fri, 01 Apr 2011 06:38:56 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile
bearophileh...@lycps.com wrote:
Steven Schveighoffer:
So essentially, you
On Fri, 11 Mar 2011 22:39:43 -, Stewart Gordon smjg_1...@yahoo.com
wrote:
On 11/03/2011 21:51, Steven Schveighoffer wrote:
snip
Presumably there's a reason that it's been provided for uint but not
ushort or ulong
I think things in std.intrinsic are functions that tie directly to
On Mon, 07 Mar 2011 11:26:25 -, yochi yoc...@gmail.com wrote:
Hello, I am trying to write an integer to a file, but when I open the
file it writes the char the number represents in ascii.
does anyone have a suggestion?
Post your code, people can then suggest changes. Also, some things to
Kyle Mallory wrote:
I'm trying to write a series of structs to a stream, which then has to
be sent over the wire within a single TCP packet, in order for the host,
an embedded device, to recognize the message. If there is too little,
or too much data for a given command (packet), the device
Frank Fischer wrote:
On 2010-03-31, Regan Heath re...@netmail.co.nz wrote:
Frank Fischer wrote:
If I compile the above example with
dmd main.d
Weird, that command line works fine for me, no errors.
Strange. I used the linux version 2.042, just downloaded.
Ahh.. I am on Windoze
101 - 148 of 148 matches
Mail list logo