Re: tiny web server in D

2011-07-14 Thread Dr.Smith
The program as such can regurgitate a web page provided these additional lines: string webpage = index.html; string output = HTTP/1.1 200 OK\r\n Content-Type: text/html; charset=UTF-8\r\n\r \n ~ to!string(read(webpage) ~ \r\n; This does not serve a page as localhost:port/webpage.html, but

Re: tiny web server in D

2011-07-14 Thread Dr.Smith
Thank you Adam, Your code is comprehensive. I will read it closely for ideas. I seek a minimalist approach for locally run applications.

tiny web server in D

2011-07-13 Thread Dr.Smith
While the following D program runs without compiler error, it seems unable to serve a web page. Is there a better way? import std.socket, std.string; void main() { Socket listener = new TcpSocket; assert(listener.isAlive); listener.bind(new InternetAddress(8080));

range violation

2011-02-28 Thread Dr.Smith
With multidimensional arrays greater than 150x150, I get a range violation at run time: core.exception.RangeError@pweight(54): Range violation Is this a bug? Is there a work-around?

Re: range violation

2011-02-28 Thread Dr.Smith
For example: double [string] data; double [200][1000] data2; for(int i = 0; i 200; i++) { for(int j = 0; j 1000; j++) { // fake multi-dim works string str = to!string(i) ~ , ~ to!string(j); data[str] = someNumber; // real multi-dim does not work data2[i][j]