On Monday, 9 November 2020 at 08:06:54 UTC, Andrey wrote:
Hello,
Are here any differences in creation of dynamic array with
known size?
auto array = new wchar[](111);
and
wchar[] array;
array.length = 111;
In theory
auto array = new wchar[111]; // or new wchar[](111);
should do less wo
On Friday, 17 May 2019 at 18:02:04 UTC, kdevel wrote:
On Thursday, 16 May 2019 at 20:31:23 UTC, Vladimir Panteleev
wrote:
On Thursday, 16 May 2019 at 20:17:37 UTC, Steven Schveighoffer
[...]
hnsecs is more confusing than nanoseconds. People know what a
nanosecond is, a hecto-nano-second is n
On Thursday, 23 May 2019 at 18:37:17 UTC, H. S. Teoh wrote:
On Thu, May 23, 2019 at 06:20:23PM +, kdevel via
Digitalmars-d-learn wrote:
On Thursday, 23 May 2019 at 09:44:15 UTC, Cym13 wrote:
[...]
> To go fast, read/write bigger chunks.
Or use rawWrite instead of write (reduces the runtim
On Saturday, 17 November 2018 at 12:35:45 UTC, Daniel Kozák wrote:
On Saturday, 17 November 2018 at 11:48:56 UTC, Václav Kozák
wrote:
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do i
On Saturday, 17 November 2018 at 11:48:56 UTC, Václav Kozák wrote:
Hello, I have a column of type money in my database. I need to
pull the data from the db in my vibe.d backend, but it can't
handle such data type. How can I do it? Should I use some
library (which?)? Thanks.
You could use row.
V Wed, 03 May 2017 09:21:47 +
nkm1 via Digitalmars-d-learn
napsáno:
> On Wednesday, 3 May 2017 at 07:34:03 UTC, Daniel Kozák wrote:
> >
> > print in A is template:
> >
>
> What :)
> How does it interact with 'final'?
hmm obviously it is problem only with final
V Wed, 03 May 2017 09:21:47 +
nkm1 via Digitalmars-d-learn
napsáno:
> On Wednesday, 3 May 2017 at 07:34:03 UTC, Daniel Kozák wrote:
> >
> > print in A is template:
> >
>
> What :)
> How does it interact with 'final'?
final is not important here
V Wed, 03 May 2017 06:54:15 +
nkm1 via Digitalmars-d-learn
napsáno:
> Consider:
>
> import std.stdio;
>
> class A
> {
> final print() { writeln(this); } // no return type
> }
>
> class B : A
> {
> final void print() { writeln(this); }
> }
>
> void main()
> {
> auto b = new
V Tue, 25 Apr 2017 07:05:51 +
Suliman via Digitalmars-d-learn
napsáno:
> Just interesting. Is there any rational reasons for this decision?
No it isn't. File is only in std.stdio;
V Tue, 28 Feb 2017 15:15:00 +
Anton Pastukhov via Digitalmars-d-learn
napsáno:
> I can't see the logic in AA foreach order. Consider this code:
> ...
> Output:
> three
> two
> one
> four
>
> I was sure output should be
> one
> two
> three
> four
https://forum.dlang.org/post/xbanhtkvrizyqjci
V Thu, 16 Feb 2017 16:38:51 +
Chris via Digitalmars-d-learn
napsáno:
> In `std.file`, I haven't found a function that allows me to move
> or at least copy directories, as in `mv dir /toDir`. Do I have to
> go the awkward way over `rename` or something?
http://forum.dlang.org/post/uzoxwrxsg
V Thu, 09 Feb 2017 11:22:28 +
Suliman via Digitalmars-d-learn
napsáno:
> Docs says that:
> "The total size of a static array cannot exceed 16Mb."
> But when I am creation array of:
> int [1000_000] x; // 1000_000 is equal ~ 0,95MB
> app crush on start.
>
> Should it's reserve this memory wit
V Wed, 01 Feb 2017 14:09:41 +
aberba via Digitalmars-d-learn
napsáno:
> I can't find it. Like set_cookie() in php.
maybe this
http://vibed.org/api/vibe.http.server/HTTPServerResponse.setCookie
V Wed, 01 Feb 2017 14:09:41 +
aberba via Digitalmars-d-learn
napsáno:
> I can't find it. Like set_cookie() in php.
I am not sure but I use this in one of my projects
import vibe.http.client;
auto clientOCX = new RestInterfaceClient!I(host ~ path);
string sessionId = clientOCX.i
V Sun, 15 Jan 2017 14:48:12 +
Nestor via Digitalmars-d-learn napsáno:
> On Friday, 6 January 2017 at 11:42:17 UTC, Mike Wey wrote:
> > On 01/06/2017 11:33 AM, pineapple wrote:
> >> On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
>
> I'm not sure if this works quite as in
Geert via Digitalmars-d-learn
napsal Čt, led 5, 2017 v 3∶13 :
On Thursday, 5 January 2017 at 01:16:09 UTC, crimaniak wrote:
On Monday, 2 January 2017 at 15:29:08 UTC, Geert wrote:
Hi!
How can i create a full database backup using mysql-native for D?
Too common question. Do you have problems
Nestor via Digitalmars-d-learn
napsal St, led 4, 2017 v 8∶20 :
On Wednesday, 4 January 2017 at 18:48:59 UTC, Daniel Kozák wrote:
Ok, I've done some testing and you are right byLine is broken, so
please fill a bug
A bug? I was under the impression that this function was *intended*
to work onl
Daniel Kozák napsal St, led 4, 2017 v 6∶33 :
Nestor via Digitalmars-d-learn
napsal St, led 4, 2017 v 12∶03 :
Hi,
I was just trying to parse a UTF-16LE file using byLine, but
apparently this function doesn't work with anything other than
UTF-8, because I get this error:
"Invalid UTF-8 se
Nestor via Digitalmars-d-learn
napsal St, led 4, 2017 v 12∶03 :
Hi,
I was just trying to parse a UTF-16LE file using byLine, but
apparently this function doesn't work with anything other than UTF-8,
because I get this error:
"Invalid UTF-8 sequence (at index 1)"
How can I achieve what I
Anonymouse via Digitalmars-d-learn
napsal Út, led 3, 2017 v 12∶34 :
On Monday, 2 January 2017 at 21:07:37 UTC, Ignacious wrote:
[...]
Assuming Windows:
version(Windows)
shared static this()
{
import core.sys.windows.windows;
SetConsoleCP(65001);
SetConsoleOutputCP(65001);
}
W
V Tue, 22 Dec 2015 12:55:10 -0800
"H. S. Teoh via Digitalmars-d-learn"
napsáno:
> On Tue, Dec 22, 2015 at 08:54:35PM +0100, Daniel Kozák via
> Digitalmars-d-learn wrote:
> > V Tue, 22 Dec 2015 09:43:00 -0800
> > "H. S. Teoh via Digitalmars-d-learn"
> >
V Tue, 22 Dec 2015 21:10:54 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 20:52:07 UTC, rumbu wrote:
> > On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák
> > wrote:
> >> V Tue, 22 Dec 2015 18:11:24 +
> >> rumbu via Digitalmars-d-learn
> >>
> >>
V Tue, 22 Dec 2015 20:52:07 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák wrote:
> > V Tue, 22 Dec 2015 18:11:24 +
> > rumbu via Digitalmars-d-learn
> >
> > napsáno:
> >
> >> On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew C
V Tue, 22 Dec 2015 09:43:00 -0800
"H. S. Teoh via Digitalmars-d-learn"
napsáno:
> On Tue, Dec 22, 2015 at 05:23:11PM +, Andrew Chapman via
> Digitalmars-d-learn wrote: [...]
> > for({int i; i = 0;} i < num; i++) {
> > //string s = to!string(i);
> > Cust
V Tue, 22 Dec 2015 17:15:27 +
Andrew Chapman via Digitalmars-d-learn
napsáno:
> Sorry if this is a silly question but is the to! method from the
> conv library the most efficient way of converting an integer
> value to a string?
>
> e.g.
> string s = to!string(100);
>
> I'm seeing a prett
V Tue, 22 Dec 2015 18:39:16 +
Ivan Kazmenko via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 18:11:24 UTC, rumbu wrote:
> > On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
> > wrote:
> >> Sorry if this is a silly question but is the to! method from
> >> the
V Tue, 22 Dec 2015 18:11:24 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
> wrote:
> > Sorry if this is a silly question but is the to! method from
> > the conv library the most efficient way of converting an
> > integer value to a
V Mon, 21 Dec 2015 20:53:14 +
Jakob Jenkov via Digitalmars-d-learn
napsáno:
> On Monday, 21 December 2015 at 20:20:44 UTC, Stefan wrote:
> > How about https://github.com/dcarp/asynchronous ? Asyncio
> > Socket handling is sometimes quite nice. It's performance is
> > okay for nearly no effo
V Wed, 09 Dec 2015 21:10:43 +
Jon D via Digitalmars-d-learn
napsáno:
> There is a fair bit of range related code in the standard library
> structured like:
>
> auto MyRange(Range)(Range r)
> if (isInputRange!Range)
> {
> static struct Result
> {
>
V Wed, 28 Oct 2015 16:36:32 +
Vincent R via Digitalmars-d-learn
napsáno:
> On Wednesday, 28 October 2015 at 16:12:08 UTC, Vincent R wrote:
> > On Wednesday, 28 October 2015 at 16:09:02 UTC, Cauterite wrote:
> >> On Wednesday, 28 October 2015 at 16:04:52 UTC, Vincent R wrote:
> >>> [...]
V Sun, 20 Sep 2015 20:17:36 +
Dandyvica via Digitalmars-d-learn
napsáno:
> Hi all,
>
> I can't explain to myself this weird behavior:
>
> void main(string[] argv)
> {
> char[] line;
> auto fh = File(argv[1]);
> while (!fh.eof) {
> writef("before readln eof=%s
On Tue, 15 Sep 2015 13:56:36 +
Andrwe Brown via Digitalmars-d-learn
wrote:
> Hi,
>
> I'm trying to read a file line by line, and I get a
> core.exception.InvalidMemoryOperationError@(0), even after
> reducing the program to:
>
> import std.stdio;
>
> void main()
> {
>File f = File("
On Thu, 10 Sep 2015 11:38:35 +
"Gary Willoughby" wrote:
> On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote:
> > - RefCounted
> >
> > Only for D structs. std::shared_ptr works for all.
>
> RefCounted works with classes as well.
>
> http://dlang.org/phobos/std_typecons.html#.RefCo
On Thu, 27 Aug 2015 15:18:22 +
"Gary Willoughby" wrote:
> If you visit this link:
>
> http://dlang.org/phobos/std_traits.html#isCallable
>
> There is this paragraph:
>
> "Detect whether T is a callable object, which can be called with
> the function call operator (...)."
>
> What is thi
On Thu, 27 Aug 2015 13:26:11 +
vitus via Digitalmars-d-learn wrote:
> On Thursday, 27 August 2015 at 13:14:24 UTC, Daniel Kozák wrote:
> >
> > On Thu, 27 Aug 2015 13:01:02 +
> > vitus via Digitalmars-d-learn
> > wrote:
> >>
> >
> > works ok for me
>
> V tom je ten problém :)
Jo mas p
On Thu, 27 Aug 2015 13:01:02 +
vitus via Digitalmars-d-learn wrote:
> On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote:
> > enum A = 1;
> > enum B = C; //Error
> > static if(A)
> > enum C = 0;
> > enum D = C; //OK
> >
> > Is order supposed to matter here?
>
> Beter:
>
> enu
On Fri, 07 Aug 2015 12:29:26 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 11:45:00 UTC, Daniel Kozak wrote:
> > On Friday, 7 August 2015 at 09:12:32 UTC, yawniek wrote:
> >> [...]
> >
> > Can you try it without write operation (comment out all write)?
> > And than try it without uncompr
On Fri, 07 Aug 2015 08:42:45 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 08:24:11 UTC, Daniel Kozák wrote:
>
> > can you try it with ldc?
> >
> > ldc[2] -O -release -boundscheck=off -singleobj app.d
>
>
> ldc 0.15.2 beta2
> 2.86s user 0.55s system 77% cpu 4.392 total
>
> v2.068-dev
On Fri, 07 Aug 2015 08:13:01 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 08:05:01 UTC, Daniel Kozák wrote:
> > import
> > std.zlib,
> > std.file,
> > std.stdio,
> > std.conv;
> >
> > void main(string[] args)
> > {
> > auto f = File(args[1], "rb");
> > auto uncompressor = new
On Fri, 07 Aug 2015 08:13:01 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 08:05:01 UTC, Daniel Kozák wrote:
> > import
> > std.zlib,
> > std.file,
> > std.stdio,
> > std.conv;
> >
> > void main(string[] args)
> > {
> > auto f = File(args[1], "rb");
> > auto uncompressor = new
On Fri, 7 Aug 2015 09:43:25 +0200
Daniel Kozák wrote:
>
> On Fri, 07 Aug 2015 07:36:39 +
> "yawniek" wrote:
>
> > On Friday, 7 August 2015 at 07:29:15 UTC, Daniel Kozák wrote:
> > > Which compiler and version. There has been some performance
> > > problem with IO on OSX, it should be fix
On Fri, 07 Aug 2015 08:01:27 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 07:48:25 UTC, yawniek wrote:
> > On Friday, 7 August 2015 at 07:43:25 UTC, Daniel Kozák wrote:
> > the fastest version i could come up so far is below.
> > std.conv slows it down.
> > going from a 4kb to a 4mb buff
On Fri, 07 Aug 2015 07:19:43 +
"yawniek" wrote:
> hi,
>
> unpacking files is kinda slow, probably i'm doing something wrong.
>
> below code is about half the speed of gnu zcat on my os x machine.
> why?
>
> why do i need to .dup the buffer?
It depends. In your case you don't need to.
by
On Fri, 07 Aug 2015 07:36:39 +
"yawniek" wrote:
> On Friday, 7 August 2015 at 07:29:15 UTC, Daniel Kozák wrote:
> > Which compiler and version. There has been some performance
> > problem with IO on OSX, it should be fixed in 2.068 release
>
> i'm on master. v2.068-devel-8f81ffc
> also cha
On Fri, 07 Aug 2015 07:19:43 +
yawniek via Digitalmars-d-learn
wrote:
> hi,
>
> unpacking files is kinda slow, probably i'm doing something wrong.
>
> below code is about half the speed of gnu zcat on my os x machine.
> why?
>
> why do i need to .dup the buffer?
> can i get rid of the cas
On Tue, 04 Aug 2015 10:29:55 +
"岩倉 澪" wrote:
> On Tuesday, 4 August 2015 at 08:35:10 UTC, Dicebot wrote:
> > auto output = receiveOnly!(immutable(Bar)[]);
>
> Won't message passing like this result in an expensive copy
No it will copy only struct containing length and pointer to data,
On Tue, 28 Jul 2015 02:16:56 +
"lobo" wrote:
> Hi all,
>
> I have a bunch of unittests for template code taking any numeric
> type. Because I'm lazy I just use the approxEqual for both
> floating point and integer comparisons in these tests.
>
> In DMD 2067.1 everthing compiled OK but in
On Tue, 28 Jul 2015 08:50:53 +0200
Daniel Kozák wrote:
>
> On Tue, 28 Jul 2015 02:16:56 +
> "lobo" wrote:
>
> I would say it is a compiler bug.
>
> consider this:
>
> bool some(real x, real y) {
> return true;
> }
>
> bool some(float x, float y) {
> return true;
> }
>
> vo
On Tue, 28 Jul 2015 02:16:56 +
"lobo" wrote:
> Hi all,
>
> I have a bunch of unittests for template code taking any numeric
> type. Because I'm lazy I just use the approxEqual for both
> floating point and integer comparisons in these tests.
>
> In DMD 2067.1 everthing compiled OK but in
On Tue, 21 Jul 2015 12:27:55 +
"yawniek" wrote:
> whats the proper way to use/wrap C functions that expect a error
> string buffer
> e.g.:
> somefun(T param1, char* errstr, size_t errstr_size)
> in D ?
>
dynamic:
auto buf = new char[size];
somefun(param1, buf.ptr, buf.length);
or
some
On Thu, 16 Jul 2015 07:57:10 +
aki via Digitalmars-d-learn wrote:
> I can't resolve the compile errors:
>
> import core.thread;
> class DerivedThread : Thread {
> int count = 0;
> this() {
> super(&run);
> }
> private void run() {
> inc();
On Thu, 16 Jul 2015 00:18:30 +
seashell86 via Digitalmars-d-learn
wrote:
> So I've been mostly just toying around with D as it seems like it
> will end up being a strong language for game development both now
> and even moreso in the future. That being said, I'm perplexed by
> using this
On Wed, 15 Jul 2015 15:45:43 +
"rumbu" wrote:
> struct S { int a, b; }
> auto s = cast(S)10;
> //compiles and sets s.a to 10.
>
> It works also for any other type, if the structure contains a
> member of that type in the first position.
>
> Is this normal behaviour?
Yes, this is OK
If y
On Wed, 15 Jul 2015 11:57:01 -0400
Steven Schveighoffer wrote:
> On 7/15/15 11:45 AM, rumbu wrote:
> > struct S { int a, b; }
> > auto s = cast(S)10;
> > //compiles and sets s.a to 10.
> >
> > It works also for any other type, if the structure contains a
> > member of that type in the first posi
Same problem still extreamly slow
On Wed, 01 Jul 2015 03:28:01 +
"rsw0x" wrote:
> On Tuesday, 30 June 2015 at 15:18:36 UTC, Jack Applegame wrote:
> > Just creating a bunch (10k) of sleeping (for 100 msecs)
> > goroutines/tasks.
> >
> > Compilers
> > go: go version go1.4.2 linux/amd64
>
On Mon, 29 Jun 2015 05:04:36 -0700
Jonathan M Davis via Digitalmars-d-learn
wrote:
> On Sunday, June 28, 2015 11:37:59 Jack Applegame via
> Digitalmars-d-learn wrote:
> > I don't see any reason why it should not compile.
> >
> > import std.array;
> > import std.range;
> > import std.algorithm;
>
On Fri, 26 Jun 2015 11:11:15 +
Chris via Digitalmars-d-learn wrote:
> I have still some classes lying around in my code. As threading
> is becoming more and more of an issue, classes and OOP in general
> turn out to be a nuisance. It's not so hard to turn the classes
> into structs, a lot
On Fri, 26 Jun 2015 11:11:15 +
Chris via Digitalmars-d-learn wrote:
> I have still some classes lying around in my code. As threading
> is becoming more and more of an issue, classes and OOP in general
> turn out to be a nuisance. It's not so hard to turn the classes
> into structs, a lot
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-learn
wrote:
> On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer
> wrote:
> >
> > Does this work for you, or is there a further expectation?
> >
> > auto asTuple() { return Tuple!(int, "a", ...)(a, b,
> > stringV
On Tue, 16 Jun 2015 13:01:09 +
via Digitalmars-d-learn wrote:
> On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote:
> > On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote:
> >> On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote:
> >>> BOOL result = SHGetFolderPath(null, 0x23, nul
On Tue, 16 Jun 2015 12:26:45 +
C2D via Digitalmars-d-learn wrote:
> Hi,
> I encountered the following error:
>
> Error: function files.SHGetFolderPath (void* hwndOwner, int
> nFolder, void* hToken, uint dwFlags, char* pszPath) is not
> callable using argument types (typeof(null), int, typ
On Tue, 16 Jun 2015 11:45:22 +
Dennis Ritchie via Digitalmars-d-learn
wrote:
> Maybe not everyone needs these features. But, unfortunately, I
> often use a lot of imported modules. And use every time the word
> `import` very bad.
>
> version (none) {
> import std.math,
> std.conv,
On Thu, 11 Jun 2015 11:43:25 +
via Digitalmars-d-learn wrote:
> On Thursday, 11 June 2015 at 08:33:46 UTC, Daniel Kozák wrote:
> > On Wed, 10 Jun 2015 20:22:17 +
> > Adel Mamin via Digitalmars-d-learn
> >
> > wrote:
> >
> >> ubyte[5] a = 0xAA; // Fine. Five 0xAA bytes.
> >> auto a2 = n
On Thu, 11 Jun 2015 09:01:04 +
Yuxuan Shui via Digitalmars-d-learn
wrote:
> A x = scoped!A(10);
use auto x = scoped!A(10);
On Wed, 10 Jun 2015 20:22:17 +
Adel Mamin via Digitalmars-d-learn
wrote:
> ubyte[5] a = 0xAA; // Fine. Five 0xAA bytes.
> auto a2 = new ubyte[5]; // Fine. Five 0 bytes.
> Now, let's say, I want to allocate an array of a size, derived at
> run time, and initialize it to some non-zero value at
On Mon, 08 Jun 2015 11:32:07 +
Kagamin via Digitalmars-d-learn
wrote:
> On Monday, 8 June 2015 at 10:59:45 UTC, Daniel Kozák wrote:
> > import std.conv;
> > import std.utf;
> > import std.datetime;
> > import std.stdio;
> >
> > void f0() {
> > string somestr = "some not so long utf8 stri
On Mon, 08 Jun 2015 10:51:53 +
weaselcat via Digitalmars-d-learn
wrote:
> On Monday, 8 June 2015 at 10:49:59 UTC, Ilya Yaroshenko wrote:
> > On Monday, 8 June 2015 at 10:42:00 UTC, Kadir Erdem Demir wrote:
> >> I want to use my char array with awesome, cool std.algorithm
> >> functions. Sin
On Mon, 08 Jun 2015 10:41:59 +
Kadir Erdem Demir via Digitalmars-d-learn
wrote:
> I want to use my char array with awesome, cool std.algorithm
> functions. Since many of this algorithms requires like slicing
> etc.. I prefer to create my string with Utf32 chars. But by
> default all strin
On Mon, 08 Jun 2015 10:41:59 +
Kadir Erdem Demir via Digitalmars-d-learn
wrote:
> I want to use my char array with awesome, cool std.algorithm
> functions. Since many of this algorithms requires like slicing
> etc.. I prefer to create my string with Utf32 chars. But by
> default all strin
On Thu, 04 Jun 2015 07:03:30 +
tcak via Digitalmars-d-learn wrote:
> [code]
> char[] test(){
> auto t = new char[5];
>
> return t;
> }
> [/code]
>
> Is the test function returning just a pointer from heap or does
> copy operation?
>
this is same as:
auto t = new char[](5)
it wi
On Wed, 27 May 2015 09:20:52 +
drug via Digitalmars-d-learn wrote:
> Could somebody share his thoughts on the subject?
> Would it be efficient? Is it possible to avoid memory copying to
> provide immutability? To avoid cache missing ring buffer should be
> like array, not list, so it's possi
On Wed, 27 May 2015 05:48:11 +
zhmt via Digitalmars-d-learn wrote:
> I am writing a echoclient, as below:
>
> Ptr!Conn conn = connect("127.0.0.1",8881);
> ubyte[100] buf;
> for(int i=0; i {
> scope string str = format("%s",i);
> conn.write((cast(ubyte*)str.ptr)[0..str.length]);
chveighoffer via Digitalmars-d-learn
> >> wrote:
> >>
> >>> On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
> >>> >
> >>> > On Wed, 20 May 2015 17:23:05 -0700
> >>> > Ali Çehreli via Digitalmars-d-learn
> >
On Thu, 21 May 2015 08:54:54 -0400
Steven Schveighoffer via Digitalmars-d-learn
wrote:
> On 5/21/15 2:35 AM, Daniel Kozák via Digitalmars-d-learn wrote:
> >
> > On Wed, 20 May 2015 17:23:05 -0700
> > Ali Çehreli via Digitalmars-d-learn
> > wrote:
> >
> &g
On Wed, 20 May 2015 17:23:05 -0700
Ali Çehreli via Digitalmars-d-learn
wrote:
> On 05/20/2015 04:10 PM, Mike Parker wrote:
> > On Wednesday, 20 May 2015 at 13:46:22 UTC, Daniel Kozák wrote:
> >> DOC say `may not have` not `must not have` ;-)
> >>
> >
> > OK, if that's the intent, it needs to be
DOC say `may not have` not `must not have` ;-)
On Wed, 20 May 2015 13:24:22 +
Mike Parker via Digitalmars-d-learn
wrote:
> On Wednesday, 20 May 2015 at 09:35:43 UTC, Daniel Kozak wrote:
>
> > DOCS: http://dlang.org/template.html#function-templates
> > says: Function template type parameter
On Wed, 20 May 2015 06:31:11 +
Mike Parker via Digitalmars-d-learn
wrote:
> I don't understand why this behaves as it does. Given the
> following two templates:
>
> ```
> void printVal(T)(T t) {
> writeln(t);
> }
> void printVal(T : T*)(T* t) {
> writeln(*t);
> }
> ```
>
> I f
On Mon, 11 May 2015 09:40:28 +
tcak via Digitalmars-d-learn wrote:
> On Monday, 11 May 2015 at 09:20:50 UTC, Daniel Kozák wrote:
> >
> > On Mon, 11 May 2015 09:09:07 +
> > tcak via Digitalmars-d-learn
> > wrote:
> >
> >
> > I think synchronize(this) prevents GC from collect memory
>
>
On Mon, 11 May 2015 09:40:28 +
tcak via Digitalmars-d-learn wrote:
> On Monday, 11 May 2015 at 09:20:50 UTC, Daniel Kozák wrote:
> >
> > On Mon, 11 May 2015 09:09:07 +
> > tcak via Digitalmars-d-learn
> > wrote:
> >
> >
> > I think synchronize(this) prevents GC from collect memory
>
>
On Mon, 11 May 2015 09:09:07 +
tcak via Digitalmars-d-learn wrote:
> [code]
> import std.stdio;
>
> class Connection{
> private void other() shared{}
>
> public void close() shared{
> synchronized( this ){
> other();
> }
>
On Thu, 07 May 2015 10:46:19 +
Lemonfiend via Digitalmars-d-learn
wrote:
> On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote:
> > On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote:
> >>
> >> On Thu, 07 May 2015 10:33:44 +
> >> Vadim Lopatin via Digitalmars-d-learn
> >
On Thu, 07 May 2015 10:33:44 +
Vadim Lopatin via Digitalmars-d-learn
wrote:
> struct S
> {
> int i;
>
> auto foo2(T)(int j) {
> i=j;
> }
>
> static S foo(T)(int j) {
> S s;
> s.foo2!T(j);
> return s;
> }
> }
>
> void main()
> {
On Thu, 07 May 2015 10:19:42 +
Lemonfiend via Digitalmars-d-learn
wrote:
> Is it not possible to have a static function template with the
> same name as the non-static version?
>
> struct S
> {
> int i;
>
> auto foo(T)(int j) {
> i=j;
> }
>
> static auto foo(
On Thu, 07 May 2015 10:19:42 +
Lemonfiend via Digitalmars-d-learn
wrote:
> Is it not possible to have a static function template with the
> same name as the non-static version?
>
> struct S
> {
> int i;
>
> auto foo(T)(int j) {
> i=j;
> }
>
> static auto foo(
On Thu, 16 Apr 2015 20:18:40 +
Panke via Digitalmars-d-learn wrote:
> >
> > Yep, but problem is almost no one expect this, or know this. We
> > definitely
> > should do better.
>
> How?
Improve doc at least. But it would be fine to have something like dump function
(equivalent of php var_
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
> Hi.
> I want to call a C library function that returns a data buffer as
> a void*. How do I convert the resulting void* into something I
> can process in D?
>
> //I have the following function from the GDAL
On Wed, 15 Apr 2015 04:24:20 +
Craig Dillabaugh via Digitalmars-d-learn
wrote:
> Hi.
> I want to call a C library function that returns a data buffer as
> a void*. How do I convert the resulting void* into something I
> can process in D?
>
> //I have the following function from the GDAL
On Thu, 09 Apr 2015 11:04:47 -0400
Steven Schveighoffer via Digitalmars-d-learn
wrote:
>
> Note that the "bad" behavior (which was just fixed BTW) is
> if(somearr), which used to mean if(somearr.ptr), and now it's a
> compiler error.
>
> -Steve
Yeah, because of this I must change almost 1k lin
On Thu, 09 Apr 2015 11:04:47 -0400
Steven Schveighoffer via Digitalmars-d-learn
wrote:
>
> Note that the "bad" behavior (which was just fixed BTW) is
> if(somearr), which used to mean if(somearr.ptr), and now it's a
> compiler error.
>
> -Steve
Yeah, because of this I must change almost 1k lin
On Thu, 09 Apr 2015 11:45:30 +
tcak via Digitalmars-d-learn wrote:
> I have written a function as follows:
>
> public bool setCookie(
> string name,
> string value,
> long maxAgeInSeconds = long.min,
> string expiresOnGMTDate=null,
> string path=null,
> s
On Wed, 18 Mar 2015 15:35:03 +0100
"Robert M. Münch via Digitalmars-d-learn"
wrote:
> Hi, can something like this (I borrowed the C pre-processor idea) be
> done with variadic mixins?
>
> #define log(variadic-arg) sys-log("%s:%s" + variadic-arg[0],
> __FILE__, __LINE__, variadic-arg[1..$]);
>
On Tue, 17 Mar 2015 11:25:00 -0700
Ali Çehreli via Digitalmars-d-learn
wrote:
> On 03/17/2015 11:21 AM, "岩倉 澪" wrote:
> > I often hear it advised to avoid using enum with arrays because they
> > will allocate at the usage point, but does this also apply to
> > strings? strings are arrays, so nai
On Thu, 12 Mar 2015 13:35:18 +
ayush via Digitalmars-d-learn wrote:
> On Thursday, 12 March 2015 at 13:13:40 UTC, Dennis Ritchie wrote:
> > On Thursday, 12 March 2015 at 13:01:31 UTC, ayush wrote:
> >> Is D a lot like c++?
> >
> > Enough.
> >
> >> So should i focus on one or learn both toget
On Wed, 11 Mar 2015 10:05:39 +
zhmt via Digitalmars-d-learn wrote:
> I want to know how to locate the position of crashing in dlang?
>
> for example: there is stack dump in c, exception stack in java,
> they could help to locate the root of problems.
>
D has these too, you just need to
On Wed, 11 Mar 2015 10:05:39 +
zhmt via Digitalmars-d-learn wrote:
> I want to know how to locate the position of crashing in dlang?
>
> for example: there is stack dump in c, exception stack in java,
> they could help to locate the root of problems.
>
D has these too, you just need to
On Wed, 18 Feb 2015 07:23:24 +
Muahmmad Adel via Digitalmars-d-learn
wrote:
> I have searched online and I found no way for dividing D Module
> between multiple files.
>
> While other languages move to making classes distributed on
> multiple files (like C#'s partial classes), D is moving
V Tue, 10 Feb 2015 11:44:09 +
Vlasov Roman via Digitalmars-d-learn
napsáno:
> On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:
> > Vlasov Roman:
> >
> >> I have the quite computer with 2 GB RAM. At compilation with
> >> dub and dmd of small project this pair eating about 1.4~1
V Tue, 27 Jan 2015 04:38:57 +
David Monagle via Digitalmars-d-learn
napsáno:
> Hi guys,
>
> I'm a former C++ developer and really enjoying working with D
> now. I have a question that I hope some of you may be able to
> answer.
>
> class Parent {
>@property string typeName() {
>
V Tue, 13 Jan 2015 13:56:05 +
tcak via Digitalmars-d-learn
napsáno:
> On Tuesday, 13 January 2015 at 13:53:11 UTC, tcak wrote:
> > I have written the following code:
> >
> > test.d
> > ==
> > import core.thread;
> > import std.stdio;
> >
> > void threadFunc(){
> >
V Tue, 13 Jan 2015 13:53:09 +
tcak via Digitalmars-d-learn
napsáno:
> I have written the following code:
>
> test.d
> ==
> import core.thread;
> import std.stdio;
>
> void threadFunc(){
> writeln("Thread func");
> }
>
> public static this(){
> auto t
1 - 100 of 113 matches
Mail list logo