Re: Turning fixed sized array into tuple

2024-05-04 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 4 May 2024 at 19:11:14 UTC, Nick Treleaven wrote: On Saturday, 4 May 2024 at 16:58:00 UTC, Dmitry Olshansky wrote: So I have a function: ```d size_t awaitAny(T...)(T args) { ... } ``` And I have: ``d Event*[4] events; `` How do I pass all 4 of events to awaitAny as tuple

Turning fixed sized array into tuple

2024-05-04 Thread Dmitry Olshansky via Digitalmars-d-learn
So I have a function: ```d size_t awaitAny(T...)(T args) { ... } ``` And I have: ``d Event*[4] events; `` How do I pass all 4 of events to awaitAny as tuple of arguments? -- Dmitry Olshansky CEO @ [Glow labs](https://glow-labs.pro) https://olshansky.me/about/

Re: Setting up CI for Dub project on Github

2024-04-08 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 8 April 2024 at 13:23:12 UTC, Richard (Rikki) Andrew Cattermole wrote: On 09/04/2024 1:20 AM, Dmitry Olshansky wrote: I haven’t done any research on the subject, would be nice if somebody pointed me to good example of how it’s done. — Dmitry Olshansky CEO @ Glowlabs https

Setting up CI for Dub project on Github

2024-04-08 Thread Dmitry Olshansky via Digitalmars-d-learn
I haven’t done any research on the subject, would be nice if somebody pointed me to good example of how it’s done. — Dmitry Olshansky CEO @ Glowlabs https://olshansky.me

Re: Limits of implicit conversion of class arrays

2024-03-23 Thread Dmitry Olshansky via Digitalmars-d-learn
allowed in Java). Once you cast the slice you can populate it with Derived2 objects that are not Derived, hence breaking type safety of the ds slice. — Dmitry Olshansky CEO @ Glow labs https://olshansky.me

Linker error, doing something wrong?

2023-07-09 Thread Dmitry Olshansky via Digitalmars-d-learn
curl_download.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: /usr/bin/cc failed with status: 1 Am I missing something? -- Dmitry Olshansky https://olshansky.me

Re: Easiest CI to build on github.com

2023-07-07 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 7 July 2023 at 10:29:14 UTC, Richard (Rikki) Andrew Cattermole wrote: I believe: https://github.com/dlang-community/setup-dlang Thx! — Dmitry Olshansky CEO @ Glow Labs https://olshansky.me https://t.me/glowlabs32

Easiest CI to build on github.com

2023-07-07 Thread Dmitry Olshansky via Digitalmars-d-learn
Simply enough dub test should pass. How do I go about it? — Dmitry Olshansky CEO @ Glow Labs https://olshansky.me https://t.me/glowlabs32

Re: IntelliJ D language plugin

2023-07-02 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 30 June 2023 at 16:26:26 UTC, Richard (Rikki) Andrew Cattermole wrote: I use it and contribute to it ;) Thanks to Rikki I was able to figure it out. — Dmitry Olshansky https://olshansky.me

IntelliJ D language plugin

2023-06-30 Thread Dmitry Olshansky via Digitalmars-d-learn
Have anyone had any luck with it? So far I'm trying to install DMD as SDK but it fails with not a valid D compiler home. -- Dmitry Olshansky https://olshansky.me

Re: Running LDC on a recent MacOS

2023-06-16 Thread Dmitry Olshansky via Digitalmars-d-learn
On Friday, 16 June 2023 at 16:14:19 UTC, Steven Schveighoffer wrote: On 6/16/23 11:56 AM, Dmitry Olshansky wrote: Any advice from MacOS users? Yep. Go into settings, then privacy and security. Make sure "App store and identified developers" is checked. On that page, you will se

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 12 April 2023 at 11:07:56 UTC, Richard (Rikki) Andrew Cattermole wrote: Did you compile the library with dub using ldc2? Yup, I do not have other compilers installed. -- Dmitry Olshansky

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
, built on Mar 12 2023) ERROR: strand found but it wasn't compiled with ldc Run-time dependency strand found: NO src/meson.build:22:0: ERROR: Dependency "strand" not found -- Dmitry Olshansky

Re: Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
/dependencies/dub.py i.e. ``dub build [[@]] []`` So use ``package:sub@1.0.2``. Also I just noticed meson doesn't support shared libraries from dub, so something to keep in mind. Oh, Rikki, you are so helpful. Thanks! -- Dmitry Olshansky

Using DUB packages with Meson

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
how to introduce library dependency on a specific DUB package. -- Dmitry Olshansky

Re: Help with registering dub package

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
is there, its just that it needs to be all in one. Thanks, Rikki! — Dmitry Olshansky

Help with registering dub package

2023-04-12 Thread Dmitry Olshansky via Digitalmars-d-learn
Could someone walk me through the steps of publish my dub package? I'm stuck with this: https://code.dlang.org/packages/strand For some reason code.dlang.org cannot find my semver tag I guess. -- Dmitry Olshansky

Re: How to build DMD/Phobos on Windows

2022-08-25 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 24 August 2022 at 21:11:42 UTC, rikki cattermole wrote: For dmd you use build.d that is in the repository. Hm, I guess the makefiles should be deleted? For phobos win64.mak (used for 32bit by default as well): "# Makefile to build D runtime library phobos{64,32mscoff}.lib

How to build DMD/Phobos on Windows

2022-08-24 Thread Dmitry Olshansky via Digitalmars-d-learn
It's been a long time but I've found some spare hours I want to devote to finally updating our std.uni to Unicode 14 (soon to migrate to 15 I guess). I downloaded source code of DMD/Phobos as usual and dropped them in the src folder of unpacked 7z distribution archive. Now time to build.

Re: Why The D Style constants are written in camelCase?

2018-05-09 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 9 May 2018 at 09:38:14 UTC, BoQsc wrote: The D Style suggest to camelCase constants, while Java naming conventions always promoted uppercase letter. Is there an explanation why D Style chose to use camelCase instead of all UPPERCASE for constants, was there any technical

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 14:25:58 UTC, Cym13 wrote: On Saturday, 21 April 2018 at 13:54:14 UTC, H. S. Teoh wrote: On Sat, Apr 21, 2018 at 01:30:55PM +, Cym13 via Digitalmars-d-learn wrote: On Saturday, 21 April 2018 at 12:08:09 UTC, Dmitry Olshansky wrote: [...] > Unboun

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 13:30:55 UTC, Cym13 wrote: On Saturday, 21 April 2018 at 12:08:09 UTC, Dmitry Olshansky wrote: On Saturday, 21 April 2018 at 07:37:50 UTC, Mike Franklin wrote: Does D have some way to dynamically allocate on the stack? I'm looking for something roughly equivalent

Re: dynamically allocating on the stack

2018-04-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Saturday, 21 April 2018 at 07:37:50 UTC, Mike Franklin wrote: Does D have some way to dynamically allocate on the stack? I'm looking for something roughly equivalent to the following C code. int doSomething(size_t len) { char stackBuffer[len + 1]; doSomethingElse(stackBuffer); }

Re: Is socket.send thread safe?

2018-03-27 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote: Can I send data over an std.socket on multiple threads without manual mutexing? If not, can I send data on a separate thread than receive? The docs for std.socket say nothing of it (which I guess means I should assume it is not thread

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 18:11:02 UTC, Dmitry Olshansky wrote: On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote: [...] No it just creates a pair of pointer to recs[0] + length of recs, like this: struct Array { size_t length; Record* ptr; } In D it’s typed as Record[] and has

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote: On Sunday, 18 March 2018 at 13:10:08 UTC, Dmitry Olshansky wrote: Do this to get the usual ptr + length: sort!((a, b) => to!string((*a).name) < to!string((*b).name))(recs[]); Also to!string would be computed on each compare ane

Re: core.stdc.stdlib._compare_fp_t and qsort

2018-03-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 March 2018 at 11:29:47 UTC, Joe wrote: On Monday, 12 March 2018 at 03:50:42 UTC, Joe wrote: On Monday, 12 March 2018 at 03:13:08 UTC, Seb wrote: Out of interest: I wonder what's your usecase for using qsort. Or in other words: why you can't use the high-level

Re: Networking library

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote: Can anyone point me in the direction of a library that provides very very lightweight (minimum overhead) asynchronous i/o routines for - shopping list 1. sending and receiving IPv4 / IPv6 packets, 2. sending receiving ICMP and 3,

Re: Garbage collected pointers?

2018-03-01 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: In the language spec here :- https://dlang.org/spec/garbage.html#pointers_and_gc It refers to a distinction between pointers to garbage collected memory and pointers that are not. In particular it says that with a non garbage

Re: forcing tabs in regex

2018-02-27 Thread Dmitry Olshansky via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 05:09:03 UTC, psychoticRabbit wrote: On Wednesday, 28 February 2018 at 01:06:30 UTC, dark777 wrote: Regex validates years bisexto and not bisextos in format: const std::regex

Re: multithread/concurrency/parallel methods and performance

2018-02-19 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 19 February 2018 at 14:57:22 UTC, SrMordred wrote: On Monday, 19 February 2018 at 05:54:53 UTC, Dmitry Olshansky wrote: The operation is trivial and dataset is rather small. In such cases SIMD with eg array ops is the way to go: result[] = values[] * values2[]; Yes, absolutely

Re: multithread/concurrency/parallel methods and performance

2018-02-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote: I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others

Re: Get largest heap object at runtime? ...tracking the leak

2018-01-21 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 21 January 2018 at 17:28:13 UTC, Andres Clari wrote: Hi, is there any way to get from the GC all allocated objects, so I can see their size and find where I'm leaking memory? Or perhaps a good tool to help with this issue... I tried building my program with "profile-gc" but I got

D on Power8 (PPC64)

2017-08-07 Thread Dmitry Olshansky via Digitalmars-d-learn
What is the status of the platform? I might be doing some number crunching on one of the power8 beasts, would be nice to have D working there. --- Dmitry Olshansky

Re: Is it ok to inherit multiple times same templated interface?

2017-01-15 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 15 January 2017 at 20:33:30 UTC, Alexandru Ermicioi wrote: Good day, Given following code example, where a templated interface Wr, and an implementation Im is present: From the standpoint of the compiler they are 3 distinct interfaces, so all is good. interface Wr(T) { T

Re: Build your own Trie entry table

2016-12-27 Thread Dmitry Olshansky via Digitalmars-d-learn
report for Phobos basically stating your use case and the visibility problem. Thanks Rémi Dmitry Olshansky

Re: Degenerate Regex Case

2015-04-25 Thread Dmitry Olshansky via Digitalmars-d-learn
. --- Dmitry Olshansky

Re: Profiling

2014-01-24 Thread Dmitry Olshansky
somewhere on dlang.org that explains how to use the profiler? http://digitalmars.com/ctg/trace.html see Dynamic Profiling With DMD Thanks, Philippe -- Dmitry Olshansky

Re: Get discarded data from std.regex.splitter (or something else?)

2014-01-16 Thread Dmitry Olshansky
and .length you can figure out what's in between. Also you can just use matchAll which too, does return slices. It could be seen as dropping all in between matches ;) -Steve -- Dmitry Olshansky

Re: module std.regex

2013-12-31 Thread Dmitry Olshansky
31-Dec-2013 00:03, Benji пишет: On Monday, 30 December 2013 at 19:27:43 UTC, Dmitry Olshansky wrote: 30-Dec-2013 22:08, Benji пишет: Hello, when I try to run following code: [snip] This is part of core developers discussion and isn't something easily tweaked (else it would've been already

Re: module std.regex

2013-12-30 Thread Dmitry Olshansky
immutable, which is something we should do anyhow. This is part of core developers discussion and isn't something easily tweaked (else it would've been already fixed). -- Dmitry Olshansky

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
other hidden costs I'd be glad to implement well motivated enhancement requests. P.S. This reminds me to put a roadmap of sorts on where std.regex is going and what to expect. -- Dmitry Olshansky

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
18-Dec-2013 23:54, Andrej Mitrovic пишет: On 12/18/13, Dmitry Olshansky dmitry.o...@gmail.com wrote: P.S. This reminds me to put a roadmap of sorts on where std.regex is going and what to expect. Btw one thing I'm not fond of is the format specifiers, in particular: $` part of input

Re: std.regex literal syntax (the \Q…\E escape sequence)

2013-12-18 Thread Dmitry Olshansky
19-Dec-2013 01:05, Andrej Mitrovic пишет: On 12/18/13, Dmitry Olshansky dmitry.o...@gmail.com wrote: The precedent is Perl. A heavy influencer on the (former) std.regex design. http://perldoc.perl.org/perlre.html#Capture-groups (grep for $') Ah, classic Perl. Write once - don't bother to read

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
*) With std.regex of Phobos this should just work. auto re = regex(`^(\w*)FOO\1$`); assert(barFOObar.match(re)); Syntax is like in JavaScript or Perl. How to do the samein Tango for D2 (or even phobos for D2)? -- Dmitry Olshansky

Re: tango -D2 regex

2013-12-16 Thread Dmitry Olshansky
try to match what bmatch returned?) Simply put match/bmatch will return a range of matches as they are found in the input. Each match is, in turn, a random access range that contains full match, followed by each sub-match in the pattern. -- Dmitry Olshansky

Re: std.algorithm.splitter improovement?

2013-12-14 Thread Dmitry Olshansky
] [hello, world] [hello, , world] Bye, bearophile -- Dmitry Olshansky

Running DMD tests

2013-12-08 Thread Dmitry Olshansky
dmitry@dmitry-VirtualBox ~/dmd2/src/dmd/test $ -- Dmitry Olshansky

Re: Linking order on Linux matters?

2013-11-25 Thread Dmitry Olshansky
, it's the norm on Linux now. Thanks! -- Dmitry Olshansky

Re: Can someone please explain -allinst?

2013-11-22 Thread Dmitry Olshansky
in C-T checks (static ifs etc.). Something in this logic is currently broken or implementation is lacking, hence the workaround switch. -- Dmitry Olshansky

Re: pure-ifying my code

2013-11-18 Thread Dmitry Olshansky
of just within an expression, I don't think that it actually ends up mattering much in practice, simply because it's generally rare to make the exact same call multiple times within a function. And if you do, it's trivial to save the result in a variable to be reused. -- Dmitry Olshansky

Re: Variable arguments with file and line information?

2013-11-17 Thread Dmitry Olshansky
inlining of std.ascii on ALL compilers. https://d.puremagic.com/issues/show_bug.cgi?id=10985 And it's not only std.ascii pretty much all non-templated stuff. We really, really need to improve the inliner. Amen. -- Dmitry Olshansky

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread Dmitry Olshansky
), some operations still lock the whole map. Rehashing still locks the whole thing I bet. -- Dmitry Olshansky

Re: Associative Array: reasonable limits?

2013-11-06 Thread Dmitry Olshansky
06-Nov-2013 00:36, Charles Hixson пишет: On 11/05/2013 05:34 AM, Dmitry Olshansky wrote: 05-Nov-2013 02:20, Charles Hixson пишет: On 11/03/2013 01:46 AM, Dmitry Olshansky wrote: 03-Nov-2013 02:37, Charles Hixson пишет: I'm contemplating an associative array that will eventually grow

Re: Associative Array: reasonable limits?

2013-11-03 Thread Dmitry Olshansky
probability. -- Dmitry Olshansky

Re: Type-specific overloads in Phobos

2013-11-03 Thread Dmitry Olshansky
). The moment you add an alias it's as if you declare it in your module, so it would fail to match on BigInt because of anti-hijacking. //this should work though: alias abs = std.math.abs; alias abs = std.bigint.abs; Thanks best wishes, -- Joe -- Dmitry Olshansky

Re: How to iterate using foreach on a class?

2013-11-01 Thread Dmitry Olshansky
is called on foreach aggregate if it's not a range or doesn't have opApply by itself. -- Dmitry Olshansky

Re: Error when trying to compile with --profile.

2013-10-31 Thread Dmitry Olshansky
. Do you have a small test case? Bye, bearophile -- Dmitry Olshansky

Re: selectively running unittest functions

2013-10-26 Thread Dmitry Olshansky
Dan -- Dmitry Olshansky

Re: extern template instantiation

2013-10-24 Thread Dmitry Olshansky
. -- Dmitry Olshansky

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
;DR: use static and/or auto with ctRegex not enum. -- Dmitry Olshansky

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
). -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
that even if the base pointer of the block hasn't changed, the GC hasn't reallocated the block to somebody else. So this part is still yet to be solved. T -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
12-Sep-2013 20:51, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 07:50:25PM +0400, Dmitry Olshansky wrote: 12-Sep-2013 17:51, H. S. Teoh пишет: [...] struct WeakPointer(T) { enum size_t mask = 0xdeadbeef; union Impl { T* ptr

Re: Greedy memory handling

2013-09-12 Thread Dmitry Olshansky
13-Sep-2013 00:11, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 11:13:30PM +0400, Dmitry Olshansky wrote: 12-Sep-2013 20:51, H. S. Teoh пишет: On Thu, Sep 12, 2013 at 07:50:25PM +0400, Dmitry Olshansky wrote: [...] Better option is to have finalizer hooked up to set some flag. Then _after_

Re: Greedy memory handling

2013-09-11 Thread Dmitry Olshansky
an enhancement if there isn't one already. -- Dmitry Olshansky

Re: Greedy memory handling

2013-09-11 Thread Dmitry Olshansky
that is allocated is *still your old* block. -- Dmitry Olshansky

Re: Freshly Compiled DMD + Visual Studio

2013-08-27 Thread Dmitry Olshansky
separate compilation and old object files can't find matching symbols in the new runtime library. From what I can tell, it looks like it cannot link in druntime correctly... But I'm not really an expert. -- Dmitry Olshansky

Re: wmemchar for unix

2013-08-27 Thread Dmitry Olshansky
probably not a good idea). It would be awesome to have pure D analogs for memchr, memcpy and its ilk that won't be so limiting (as in types used) but would guarantee top performance. -- Dmitry Olshansky

Re: wmemchar for unix

2013-08-27 Thread Dmitry Olshansky
27-Aug-2013 23:31, H. S. Teoh пишет: On Tue, Aug 27, 2013 at 11:18:50PM +0400, Dmitry Olshansky wrote: 27-Aug-2013 18:41, H. S. Teoh пишет: [snip] I'm not sure if dmd does that optimization. If you really feel inclined, you could do static if (X86) and throw in an asm block (but that would

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-08-17 Thread Dmitry Olshansky
a,b; uint n=formattedRead(s,%s %s,a,b); assert(a==a1 b==a2 a3); Seems like a1_a2 a3 with _ being matched as space in format string between %s and %s. Why %s is not stopping on any whitespace as is (like scanf) I'm not 100% sure. On Mon, May 20, 2013 at 10:44 PM, Dmitry Olshansky

Re: How do you profile your apps under windows?

2013-08-09 Thread Dmitry Olshansky
usually outputs trace.log somewhere in the folder launched. -- Dmitry Olshansky

Re: Getting number of messages in MessageBox

2013-08-06 Thread Dmitry Olshansky
MessageBox seems to be hidden... This is sadly intentional. The reasons must be due to some efficient concurrent queues not being able to produce reliable item count if at all. However this seems at odds with setMaxMailboxSize ... -- Dmitry Olshansky

Re: Interesting line in the recent Dr Dobbs article about profiling?

2013-07-26 Thread Dmitry Olshansky
. I've found valgrind --tool=callgrind + kcachegrind to be quite awesome. Other options are the usual profilers of your OS/CPU vendor: perf, AMD CodeAnalyst, Intel VTune -- Dmitry Olshansky

Re: Should I Use std.ascii.isWhite or std.uni.isWhite?

2013-07-26 Thread Dmitry Olshansky
dig into Unicode characters and properties, there is this nice tool: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AN%3A%5Dg= (e.g. this link shows all of 'N' = Number characters) -- Dmitry Olshansky

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
21-Jul-2013 00:46, Namespace пишет: On Saturday, 20 July 2013 at 20:22:56 UTC, Dmitry Olshansky wrote: 21-Jul-2013 00:19, Namespace пишет: Let us assume we have a method of a class which is used often and the method is called periodically and must allocate every time a array between 100

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
21-Jul-2013 00:42, Ali Çehreli пишет: On 07/20/2013 01:22 PM, Dmitry Olshansky wrote: 21-Jul-2013 00:19, Namespace пишет: Let us assume we have a method of a class which is used often and the method is called periodically and must allocate every time a array between 100 and 4000

Re: Often repeated array allocations

2013-07-21 Thread Dmitry Olshansky
/ big? No one size fits all. Measure and profit. -- Dmitry Olshansky

Re: Often repeated array allocations

2013-07-20 Thread Dmitry Olshansky
the memory is released. But I want to hear other opinions. :) 5. Keep a TLS scratch pad buffer (static class member) for said 100-4000 floats and re-use it. -- Dmitry Olshansky

Re: Types of regex

2013-07-15 Thread Dmitry Olshansky
version string/OS/package ? -- Dmitry Olshansky

Re: memcpy in D

2013-06-30 Thread Dmitry Olshansky
the _same_ GLIBC. -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
in such a scenario? Are there any tips you can share to speed things up? There are also compiler flags to fiddle with (dmd): -O -release -inline -noboundscheck Thanks. -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
? -- Dmitry Olshansky

Re: Tips on making regex more performant?

2013-06-18 Thread Dmitry Olshansky
it at DConf. -- Dmitry Olshansky

Re: Strange error when importing std.regex

2013-06-12 Thread Dmitry Olshansky
on this. http://d.puremagic.com/issues/ std.algorithm.splitter(arr, 1); Bye, bearophile -- Dmitry Olshansky

Re: shared vs __gshared

2013-06-10 Thread Dmitry Olshansky
-in ops to prevent confusion and require folks to just use core.atomic directly for lock-free or alternatively cast+mutex for lock-based. -- Dmitry Olshansky

Re: regex with literal (ie automatically replace '(' with '\(', etc) )

2013-05-30 Thread Dmitry Olshansky
differently (\$ vs $$). According to this: http://dlang.org/phobos/std___regex.html#.replace http://dlang.org/phobos/std_regex.html#.replace you can use the same escape sequences for both (\c - c in the replacement string). -- Dmitry Olshansky

Re: regex with literal (ie automatically replace '(' with '\(', etc) )

2013-05-30 Thread Dmitry Olshansky
a specialised one. -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
? -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
)[] fmt, ref Args args) { foreach(i, v; args) args[i] = i; } void main(){ int i, j, k; readf(abc, i, j, k); assert(i == 0); assert(j == 1); assert(k == 2); } -- Dmitry Olshansky

Re: why doesn't formattedRead take args by ref instead of by pointer?

2013-05-20 Thread Dmitry Olshansky
and (thank god) there wasn't decision to allow r-value as plain ref. -- Dmitry Olshansky

Re: cast(size_t)c != 0, but c is null

2013-05-15 Thread Dmitry Olshansky
do it: cast(void*)c class C { auto opCast(T:void*)() { return null; } } So - no - a simple cast to void* won't always work, as the op can be overloaded, even if only by accident. You can insert a cast to Object first. -Steve -- Dmitry Olshansky

Re: What sync object should i use?

2013-05-14 Thread Dmitry Olshansky
(). Not a single crash. Doesn't prove anything, it could happen that you just miss a notification, for instance. Another common case is that it so happens that wait will (with luck) always happen before any of notify and notifications come spaced out in time. -- Dmitry Olshansky

Re: What sync object should i use?

2013-05-14 Thread Dmitry Olshansky
that under Win32 calling notify() before wait() internally signals the condition and then calling wait() returns immediately and actually does not wait. This is the expected behavior and is actually how Win32 events work. On Tuesday, 14 May 2013 at 08:58:31 UTC, Dmitry Olshansky wrote: Have to lock

Re: What sync object should i use?

2013-05-14 Thread Dmitry Olshansky
14-May-2013 21:02, Steven Schveighoffer пишет: On Tue, 14 May 2013 04:58:27 -0400, Dmitry Olshansky dmitry.o...@gmail.com wrote: 14-May-2013 08:33, Heinz пишет: BTW, given recent discussion on memory barriers, I think my previous statement that the mutex does not need to be locked to call

Re: Structure's inheritance

2013-05-12 Thread Dmitry Olshansky
table for structs. why multiple alias this not supported? i know it was broken in 2.060 but with 2.061 it was fixed right? It's not even on the horizon. It must be single alias this that finally started working (around that time ~ 2.061). -- Dmitry Olshansky

Re: Quadratic time to sort in a simple case?

2013-04-24 Thread Dmitry Olshansky
23-Apr-2013 05:17, Xinok пишет: On Saturday, 20 April 2013 at 16:35:25 UTC, Dmitry Olshansky wrote: And this all is good but TimSort allocates O(N) memory. The constant in front of N is smallish less then 1.0 but it could cause some grief. Worst case is O(n/2), but it starts small and doubles

Re: Quadratic time to sort in a simple case?

2013-04-24 Thread Dmitry Olshansky
unstable sort can do the job faster (at the very least not slower) then a good stable sort. I'm looking forward to a version of Introsort that Xinok has in mind as a Q-sort fix. -- Dmitry Olshansky

Re: Quadratic time to sort in a simple case?

2013-04-20 Thread Dmitry Olshansky
easier than the wrong way. And this all is good but TimSort allocates O(N) memory. The constant in front of N is smallish less then 1.0 but it could cause some grief. -- Dmitry Olshansky

Re: Quadratic time to sort in a simple case?

2013-04-19 Thread Dmitry Olshansky
20-Apr-2013 01:03, Ivan Kazmenko пишет: With n = 30_000 as in the example, this takes time of the order of a second on a modern computer, which is clearly O(n^2). I am using DMD 2.062. Optimization flags if any? -- Dmitry Olshansky

  1   2   3   4   5   >