Re: Formatted date

2011-11-03 Thread Jonathan M Davis
On Thursday, November 03, 2011 16:58 Lishaak Bystroushaak wrote: > Hello. > > Is there any way how to format date with formating strings? Something > like strftime in python; > http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior Not currently. SysTime (and the other time p

Formatted date

2011-11-03 Thread Lishaak Bystroushaak
Hello. Is there any way how to format date with formating strings? Something like strftime in python; http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 14:50:31 -0400, Timon Gehr wrote: On 11/03/2011 07:15 PM, Steven Schveighoffer wrote: I could use this idea, I think, to implement a singly linked list in dcollections as well (the prospect of not having O(1) removal is what has stopped me). Thanks for the idea! Nice!

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 17:13:55 -0400, Timon Gehr wrote: On 11/03/2011 09:46 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 14:50:31 -0400, Timon Gehr wrote: On 11/03/2011 07:15 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 13:47:28 -0400, Timon Gehr wrote: On 11/03/2011 06:13

Re: std.container & ranges

2011-11-03 Thread Timon Gehr
On 11/03/2011 09:46 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 14:50:31 -0400, Timon Gehr wrote: On 11/03/2011 07:15 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 13:47:28 -0400, Timon Gehr wrote: On 11/03/2011 06:13 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 16:27:46 -0400, Dmitry Olshansky wrote: On 03.11.2011 22:37, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 14:08:31 -0400, Dmitry Olshansky wrote: On 03.11.2011 21:13, Steven Schveighoffer wrote: dcollections stipulates that all ranges/cursors can be verified in O(

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 14:50:31 -0400, Timon Gehr wrote: On 11/03/2011 07:15 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 13:47:28 -0400, Timon Gehr wrote: On 11/03/2011 06:13 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 22:37, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 14:08:31 -0400, Dmitry Olshansky wrote: On 03.11.2011 21:13, Steven Schveighoffer wrote: dcollections stipulates that all ranges/cursors can be verified in O(lgn) time or better to belong to a specific container. In some ca

Re: std.container & ranges

2011-11-03 Thread Timon Gehr
On 11/03/2011 07:15 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 13:47:28 -0400, Timon Gehr wrote: On 11/03/2011 06:13 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10

Re: std.container & ranges

2011-11-03 Thread Ali Çehreli
On Thu, 03 Nov 2011 22:08:31 +0400, Dmitry Olshansky wrote: > On 03.11.2011 21:13, Steven Schveighoffer wrote: >> The range type for a SList has a single pointer to the currently >> iterated node. How do you remove that node without having access to the >> head/previous pointer? >> >> > removeAfte

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 14:08:31 -0400, Dmitry Olshansky wrote: On 03.11.2011 21:13, Steven Schveighoffer wrote: dcollections stipulates that all ranges/cursors can be verified in O(lgn) time or better to belong to a specific container. In some cases, this adds an extra word to the range/cursor

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 13:47:28 -0400, Timon Gehr wrote: On 11/03/2011 06:13 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshan

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 21:13, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horribl

Re: std.container & ranges

2011-11-03 Thread Timon Gehr
On 11/03/2011 06:13 PM, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horr

Re: Double implicitly converted to real

2011-11-03 Thread bearophile
Charles McAnany Wrote: > I noticed that one of the guarantees in TDPL is that any code that is valid > in both C > and D should compile with the same result. This is almost true (there are few differences, in D fixed-size arrays are managed by value instead of by pointer, and global floating po

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 12:32:06 -0400, Christophe wrote: "Steven Schveighoffer" , dans le message (digitalmars.D.learn:30402), a The primitive for a container is remove(range). Ranges are essential to containers, and should be the major interface to them. Programmers have to learn ranges to

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horribly slow O(N^2). Personally, because of that I'd p

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horribly slow O(N^2). Personally, because of that I'd prefer hand-rolled intrusive singly-linked list any time of day.

Re: std.container & ranges

2011-11-03 Thread Christophe
"Steven Schveighoffer" , dans le message (digitalmars.D.learn:30402), a > The primitive for a container is remove(range). Ranges are essential to > containers, and should be the major interface to them. Programmers have to learn ranges to use containers. Hiding ranges is not helping them. But

Re: [beginner] Why nothing is printed to stdout ?

2011-11-03 Thread Kagamin
Nick Sabalausky Wrote: > > Seems like ./ tries to fix some sort of Namespace Pollution Hell when > > virtually every installed program ends up in path. > > It's also a safety/security matter. Imagine: > > $ cat ./ls > #!/bin/sh > rm ~ -rf > > Gee, let's see what's inside this directory...WTF?

Re: Double implicitly converted to real

2011-11-03 Thread deadalnix
Le 03/11/2011 15:39, Charles McAnany a écrit : Hi. I noticed that one of the guarantees in TDPL is that any code that is valid in both C and D should compile with the same result. But I'm seeing a different behavior here. I'm trying to find the smallest double for which the comparison x+1/x = x

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horribly slow O(N^2). Personally, because of that I'd prefer hand-rolled intrusive singly-linked list any time of day. To be honest, I don't understand this. A "remo

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Wed, 02 Nov 2011 19:24:03 -0400, Max Wolter wrote: On 11/2/2011 2:41 PM, Steven Schveighoffer wrote: I never said you couldn't (and I've even given examples of such implementations). It's just not neatly packaged into a method. But again, if the method is exactly the same as the effici

Re: std.container & ranges

2011-11-03 Thread Steven Schveighoffer
On Thu, 03 Nov 2011 03:41:27 -0400, Mike Parker wrote: On 11/2/2011 10:41 PM, Steven Schveighoffer wrote: Then your specific application can use std.algorithm.find to implement the equivalent. Only the algorithm body changes, not the usage of the algorithm. This is the root of the probl

Double implicitly converted to real

2011-11-03 Thread Charles McAnany
Hi. I noticed that one of the guarantees in TDPL is that any code that is valid in both C and D should compile with the same result. But I'm seeing a different behavior here. I'm trying to find the smallest double for which the comparison x+1/x = x is true. I take a number way too small, and a n

Re: std.container & ranges

2011-11-03 Thread Tobias Pankrath
Dmitry Olshansky wrote: > And more importantly, it still would be horribly slow O(N^2). > Personally, because of that I'd prefer hand-rolled intrusive > singly-linked list any time of day. > To be honest, I don't understand this. A "remove_if" for non-intrusive single-linked lists should be doa

Re: std.container & ranges

2011-11-03 Thread Jacob Carlborg
On 2011-11-03 08:41, Mike Parker wrote: On 11/2/2011 10:41 PM, Steven Schveighoffer wrote: Then your specific application can use std.algorithm.find to implement the equivalent. Only the algorithm body changes, not the usage of the algorithm. This is the root of the problem. How are we su

Re: std.container & ranges

2011-11-03 Thread Jonathan M Davis
On Thursday, November 03, 2011 16:41:27 Mike Parker wrote: > On 11/2/2011 10:41 PM, Steven Schveighoffer wrote: > > Then your specific application can use std.algorithm.find to implement > > the equivalent. Only the algorithm body changes, not the usage of the > > algorithm. > > This is the root o

Re: std.container & ranges

2011-11-03 Thread Mike Parker
On 11/2/2011 10:41 PM, Steven Schveighoffer wrote: Then your specific application can use std.algorithm.find to implement the equivalent. Only the algorithm body changes, not the usage of the algorithm. This is the root of the problem. How are we supposed to know that we need something fr

Re: how to use curl to download a file

2011-11-03 Thread Mike Parker
On 11/2/2011 9:43 PM, Ary Manzana wrote: On 11/1/11 11:49 PM, Mike Parker wrote: On 11/2/2011 3:20 AM, Frédéric Galusik wrote: Hi, As the curl documentation is a little bit ...wow. http://www.digitalmars.com/d/2.0/phobos/etc_c_curl.html Do someone have a simple example on how to download a si