Re: DlangUI translations

2016-04-23 Thread thedeemon via Digitalmars-d-learn
On Saturday, 23 April 2016 at 15:44:22 UTC, stunaep wrote: I am wondering how to use other languages and how to NOT use other languages. Did you see example1 from examples folder in dlangui? It has two languages and allows switching at runtime via menu.

Re: Any usable SIMD implementation?

2016-04-23 Thread Marco Leise via Digitalmars-d
Am Sat, 23 Apr 2016 10:40:12 + schrieb Johan Engelen : > I have a question perhaps you can comment on? > With LLVM, it is possible to specify something like "+sse3,-sse2" > (I did not test whether this actually results in SSE3 > instructions being used, but no SSE2 instructions).

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Marco Leise via Digitalmars-d
Am Sat, 23 Apr 2016 20:34:52 + schrieb Nordlöw : > On Saturday, 23 April 2016 at 17:28:21 UTC, Andrei Alexandrescu > wrote: > >> Yah, that's the canonical. I forgot why I chose (x & -x) > (x > >> - 1) over > >> it. -- Andrei > > So is there a way to check if popcnt

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread tsbockman via Digitalmars-d
On Saturday, 23 April 2016 at 21:04:52 UTC, Nordlöw wrote: On Saturday, 23 April 2016 at 20:42:25 UTC, Lass Safin wrote: CPUID: https://en.wikipedia.org/wiki/CPUID. You can check for the presence of a lot of instructions with this instruction. However this will only work on x86 and only

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread David Nadlinger via Digitalmars-d
On Saturday, 23 April 2016 at 20:34:52 UTC, Nordlöw wrote: So is there a way to check if popcnt builtin is available on current platform? As Andrei pointed out, it's not only popcnt being available, it's also it being fast. A function implementing the classic hand-written version compiles

Re: DMD internal: appendToModuleMember performance

2016-04-23 Thread David Nadlinger via Digitalmars-d
On Saturday, 23 April 2016 at 09:13:01 UTC, Johan Engelen wrote: Well, this 140k list has a removal very early on, so the linear search is going to happen >100k times from then on ;) No – only for searching the particular removed item (or other false positives due to hash collisions). —

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread safety0ff via Digitalmars-d
On Saturday, 23 April 2016 at 21:04:52 UTC, Nordlöw wrote: On Saturday, 23 April 2016 at 20:42:25 UTC, Lass Safin wrote: CPUID: https://en.wikipedia.org/wiki/CPUID. You can check for the presence of a lot of instructions with this instruction. However this will only work on x86 and only

[Issue 15951] Inefficiencies in struct initialization

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15951 --- Comment #3 from Andrei Alexandrescu --- (In reply to Walter Bright from comment #2) > Please don't use URL shorteners, as they 'expire' after a while and then the > historical record of bugzilla becomes lost. Better yet,

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 04/23/2016 04:50 PM, Adam D. Ruppe wrote: On Saturday, 23 April 2016 at 20:06:39 UTC, ag0aep6g wrote: On 23.04.2016 21:53, Andrei Alexandrescu wrote: Should we use a single ? -- Andrei That would look better in the case you linked, but it would be a step back with longer signatures. E.g.

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 04/23/2016 04:06 PM, ag0aep6g wrote: On 23.04.2016 21:53, Andrei Alexandrescu wrote: Should we use a single ? -- Andrei That would look better in the case you linked, but it would be a step back with longer signatures. E.g. http://dlang.org/phobos/std_algorithm_searching.html#.endsWith

Sparse Tensors, Sparse BLAS, LDA - Mir v0.15.2 Release

2016-04-23 Thread Ilya Yaroshenko via Digitalmars-d-announce
Release: https://github.com/libmir/mir/releases/tag/v0.15.2 GitHub: https://github.com/libmir/mir API: http://docs.mir.dlang.io/latest/index.html

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Nordlöw via Digitalmars-d
On Saturday, 23 April 2016 at 20:42:25 UTC, Lass Safin wrote: CPUID: https://en.wikipedia.org/wiki/CPUID. You can check for the presence of a lot of instructions with this instruction. However this will only work on x86 and only run-time. Code you give a complete code example in D, please or

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 23 April 2016 at 20:06:39 UTC, ag0aep6g wrote: On 23.04.2016 21:53, Andrei Alexandrescu wrote: Should we use a single ? -- Andrei That would look better in the case you linked, but it would be a step back with longer signatures. E.g.

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Lass Safin via Digitalmars-d
On Saturday, 23 April 2016 at 20:34:52 UTC, Nordlöw wrote: On Saturday, 23 April 2016 at 17:28:21 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1) over it. -- Andrei So is there a way to check if popcnt builtin is available on current

Re: Why does map take lambda as a template parameter

2016-04-23 Thread Lass Safin via Digitalmars-d-learn
On Saturday, 23 April 2016 at 20:06:39 UTC, xtreak wrote: map takes lambda as a template parameter and so does filter and many other functions. Sometimes they take something other than lambda as a template parameter. Eg. In case of to!int("5") int is a type and hence might need it as a

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Nordlöw via Digitalmars-d
On Saturday, 23 April 2016 at 17:28:21 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1) over it. -- Andrei So is there a way to check if popcnt builtin is available on current platform?

[Issue 15951] Inefficiencies in struct initialization

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15951 Walter Bright changed: What|Removed |Added CC|

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread ag0aep6g via Digitalmars-d
On 23.04.2016 21:53, Andrei Alexandrescu wrote: Should we use a single ? -- Andrei That would look better in the case you linked, but it would be a step back with longer signatures. E.g. http://dlang.org/phobos/std_algorithm_searching.html#.endsWith

Why does map take lambda as a template parameter

2016-04-23 Thread xtreak via Digitalmars-d-learn
map takes lambda as a template parameter and so does filter and many other functions. Sometimes they take something other than lambda as a template parameter. Eg. In case of to!int("5") int is a type and hence might need it as a template parameter but why does map and others take it as

Re: What does alias do?

2016-04-23 Thread ag0aep6g via Digitalmars-d-learn
On 23.04.2016 21:49, xtreak wrote: I am a D newbie from Python and I am trying to grok alias. Is alias like Python does as below L = [] myextend = L.extend L.myextend My Python isn't too great, but I think this is more similar to function pointers or delegates in D. Renaming imported

Re: What does alias do?

2016-04-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 23 April 2016 at 19:52:15 UTC, xtreak wrote: I just thought posting to forum will have more people to discuss on this. Sorry for the double post. There's no problem with posting to the forums and talking on IRC. Since the chat isn't searchable and disappears fast, the forums

Re: What does alias do?

2016-04-23 Thread xtreak via Digitalmars-d-learn
On Saturday, 23 April 2016 at 19:49:46 UTC, xtreak wrote: I am a D newbie from Python and I am trying to grok alias. Is alias like Python does as below L = [] myextend = L.extend L.myextend Renaming imported function from itertools import permutations as p p([1, 2], 2) Is D aliasing the

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 04/23/2016 03:50 PM, ag0aep6g wrote: On 23.04.2016 21:43, Andrei Alexandrescu wrote: http://dlang.org/phobos/std_experimental_allocator_building_blocks_affix_allocator.html#.AffixAllocator.goodAllocSize Looks like almost a full line in between. It is a full line (). Should we use a

Re: Line spacing for '///ditto' on the website

2016-04-23 Thread ag0aep6g via Digitalmars-d
On 23.04.2016 21:43, Andrei Alexandrescu wrote: http://dlang.org/phobos/std_experimental_allocator_building_blocks_affix_allocator.html#.AffixAllocator.goodAllocSize Looks like almost a full line in between. It is a full line ().

What does alias do?

2016-04-23 Thread xtreak via Digitalmars-d-learn
I am a D newbie from Python and I am trying to grok alias. Is alias like Python does as below L = [] myextend = L.extend L.myextend Renaming imported function from itertools import permutations as p p([1, 2], 2) Is D aliasing the same as above? How does aliasing types help like below

Re: An important pull request: accessing shared affix for immutable data

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 02/12/2016 02:12 PM, Andrei Alexandrescu wrote: https://github.com/D-Programming-Language/phobos/pull/3991 Finally I got around to update this. Please find holes in my logic. Updated documentation at:

Line spacing for '///ditto' on the website

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
Isn't it too large? http://dlang.org/phobos/std_experimental_allocator_building_blocks_affix_allocator.html#.AffixAllocator.goodAllocSize Looks like almost a full line in between. Should be 25% of a line or so. What do you all think? Andrei

Re: Distributor's whishlist and questions for D

2016-04-23 Thread Jacob Carlborg via Digitalmars-d
On 2016-04-21 03:01, Matthias Klumpp wrote: ## How complete are the free compilers? This is an important question, because we would need to know whether we can expect D code to be compiled by any compiler, or whether there are tradeoffs that must be made. This question is asking manly how

Re: How do you use D to launch/open a window?

2016-04-23 Thread Kagamin via Digitalmars-d-learn
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries

Re: How do you use D to launch/open a window?

2016-04-23 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-04-23 08:53, Mike Parker wrote: If you need a complete, cross-platform GUI toolkit, there are D bindings for Gtk (GtkD) and SWT (DWT). Technically DWT is not bindings to SWT. It's the full source completely translated to D. -- /Jacob Carlborg

Re: Why I can't pass to datetime.benchmark function with parameters?

2016-04-23 Thread Suliman via Digitalmars-d-learn
In the third example you're providing an integer as the function to benchmark, and foo is never mentioned. My error. I mean it should be: auto r = benchmark!(foo(4))(1); But thanks for answer!

[Issue 15951] Inefficiencies in struct initialization

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15951 Jack Stouffer changed: What|Removed |Added Keywords||performance

[Issue 11817] Structs with void initialized fields get initialized anyway

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11817 Jack Stouffer changed: What|Removed |Added Keywords||performance

[Issue 11331] Inefficient initialization of struct with members = void

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11331 Jack Stouffer changed: What|Removed |Added Keywords||performance

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-23 Thread Jack Stouffer via Digitalmars-d
On Saturday, 23 April 2016 at 08:30:32 UTC, Lodovico Giaretta wrote: Hi, I'm Lodovico Giaretta and I've been selected by the D Foundation for GSoC 2016. First of all, I'd like to thank the D Foundation for this fantastic opportunity. In particular, I'd like to thank Craig Dillabaugh and

Re: Are structs saved in multi-thread delegate call?

2016-04-23 Thread ag0aep6g via Digitalmars-d-learn
On 23.04.2016 07:35, ag0aep6g wrote: So the struct is destroyed at the end of DoDirSearch, despite there being a closure for it. Is the compiler doing the right thing here? Shouldn't the struct be considered alive until the closure gets garbage collected? I've filed an issue:

[Issue 15323] Module.members and .deferred3 should use data structure with fast lookup

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15323 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/cef279d5a192ca643593739661f385b1c3851106 fix Issue 15323 - Module.members and .deferred3 should use

[Issue 15952] New: struct in closure is destroyed when parent function returns

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15952 Issue ID: 15952 Summary: struct in closure is destroyed when parent function returns Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: DlangUI on Android

2016-04-23 Thread Chris via Digitalmars-d-announce
On Saturday, 23 April 2016 at 02:48:10 UTC, Vadim Lopatin wrote: On Friday, 22 April 2016 at 18:49:24 UTC, Laeeth Isharc wrote: This is a very exciting development. (And impressive in the 'consequent' department, as the Germans say - you said you would have DlangUI ported to Android some

Re: Why I can't pass to datetime.benchmark function with parameters?

2016-04-23 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 23 April 2016 at 15:11:13 UTC, Suliman wrote: Working: void main() { auto r = benchmark!(foo)(1); } [...] Do not working: void main() { auto r = benchmark!(foo())(1); } [...] Error: expression foo() is void and has no value Do not working: void main() { auto r =

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 04/23/2016 11:29 AM, Andrei Alexandrescu wrote: On 4/23/16 10:41 AM, Dmitry Olshansky wrote: On 23-Apr-2016 16:04, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess

Re: Linker error for d.o: relocation R_X86_64_32 against `__dmd_personality_v0'

2016-04-23 Thread Basile B. via Digitalmars-d-learn
On Saturday, 23 April 2016 at 17:06:07 UTC, rcorre wrote: On Saturday, 23 April 2016 at 00:55:07 UTC, rcorre wrote: On Friday, 22 April 2016 at 10:25:34 UTC, Chris wrote: [...] No luck with cmain.d. Its definitely an environmental problem -- I have an almost identical Archlinux desktop that

Re: Linker error for d.o: relocation R_X86_64_32 against `__dmd_personality_v0'

2016-04-23 Thread rcorre via Digitalmars-d-learn
On Saturday, 23 April 2016 at 00:55:07 UTC, rcorre wrote: On Friday, 22 April 2016 at 10:25:34 UTC, Chris wrote: On Friday, 22 April 2016 at 09:49:02 UTC, Rene Zwanenburg wrote: On Thursday, 21 April 2016 at 16:29:14 UTC, rcorre wrote: - What happens when you compile a binary without phobos

Re: XDG-APP and D

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Saturday, 23 April 2016 at 15:13:15 UTC, Anonymouse wrote: But that's more or less what he's saying though, if you read his original blog post. Just to add further: while I have a lot of doubts about the motives behind the original blogpost (which I feel misleads by omission on several

[Issue 11169] __traits(isAbstractClass) prematurely sets a class to be abstract

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11169 Kenji Hara changed: What|Removed |Added Keywords||pull, rejects-valid ---

DlangUI translations

2016-04-23 Thread stunaep via Digitalmars-d-learn
I am wondering how to use other languages and how to NOT use other languages. I have all of the UI of my program translated to Russian, and I have the languages loading from the resource files, but I have no idea how to switch the language to Russian. Also, when adding file names to a

Re: XDG-APP and D

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Saturday, 23 April 2016 at 15:13:15 UTC, Anonymouse wrote: But that's more or less what he's saying though, if you read his original blog post. His gripe isn't that it's defect security-wise, but rather that it's being marketed as capital-s Safe. Except that his original blogpost is just

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 10:41 AM, Dmitry Olshansky wrote: On 23-Apr-2016 16:04, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess https://dlang.org/phobos/std_math.html#.truncPow2 or

Re: How do you use D to launch/open a window?

2016-04-23 Thread thedeemon via Digitalmars-d-learn
On Friday, 22 April 2016 at 21:13:31 UTC, anonymousuer wrote: What code is needed to tell D to open a window? Thank you in advance. import dlangui; mixin APP_ENTRY_POINT; extern (C) int UIAppMain(string[] args) { Window window = Platform.instance.createWindow("Window caption", null);

Boosting D evolution

2016-04-23 Thread O-N-S via Digitalmars-d
Hi We often had discussions about D versus this or that lang which is better evoled, because of more libs or more awareness in the www. Important drivers are technology like rails for ruby and organisations like Google for Go. I asked today about strategies of the D foundation, which is

Re: mir.random - my GSoC project

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 23 April 2016 at 14:17:19 UTC, Seb wrote: I am very proud to be selected as a GSoC stipend for the D foundation. Congratulations, Seb! This project is about adding non-uniform random generators to mir and hopefully eventually to Phobos. This is a very welcome contribution.

Why I can't pass to datetime.benchmark function with parameters?

2016-04-23 Thread Suliman via Digitalmars-d-learn
Working: void main() { auto r = benchmark!(foo)(1); } void foo() { } Do not working: void main() { auto r = benchmark!(foo())(1); } void foo() { } Error: expression foo() is void and has no value Do not working: void main() { auto r = benchmark!(4)(1); } void foo(int i) {

Re: XDG-APP and D

2016-04-23 Thread Anonymouse via Digitalmars-d-announce
On Saturday, 23 April 2016 at 13:56:45 UTC, Joseph Rushton Wakeling wrote: On Saturday, 23 April 2016 at 11:29:29 UTC, NX wrote: I will just leave it here: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ This is FUD. There are no

Re: DlangUI on Android

2016-04-23 Thread FrankLike via Digitalmars-d-announce
On Saturday, 23 April 2016 at 14:35:55 UTC, Vadim Lopatin wrote: On Saturday, 23 April 2016 at 12:45:01 UTC, FrankLike wrote: On Saturday, 23 April 2016 at 11:42:49 UTC, Vadim Lopatin wrote: [...] Thank you. But why nothing to be shown,only black color? Probably something is wrong with

Re: Enabling Only Top-Level Unittests

2016-04-23 Thread Basile B via Digitalmars-d-learn
On Friday, 22 April 2016 at 18:18:39 UTC, Basile B. wrote: I think a DMD option should be added to allow the tests to be compiled but never called, something like -runTests. Because the first solution is much more attractive. Actually the first solution works with:

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Dmitry Olshansky via Digitalmars-d
On 23-Apr-2016 16:04, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess https://dlang.org/phobos/std_math.html#.truncPow2 or https://dlang.org/phobos/std_math.html#.nextPow2 could be reused, but I bet

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-23 Thread Seb via Digitalmars-d
On Saturday, 23 April 2016 at 08:30:32 UTC, Lodovico Giaretta wrote: Hi, I'm Lodovico Giaretta and I've been selected by the D Foundation for GSoC 2016. First of all, I'd like to thank the D Foundation for this fantastic opportunity. In particular, I'd like to thank Craig Dillabaugh and

Re: DlangUI on Android

2016-04-23 Thread Vadim Lopatin via Digitalmars-d-announce
On Saturday, 23 April 2016 at 12:45:01 UTC, FrankLike wrote: On Saturday, 23 April 2016 at 11:42:49 UTC, Vadim Lopatin wrote: [...] Thank you. But why nothing to be shown,only black color? Probably something is wrong with OpenGL. E.g. OpenGL ES3 is not supported. Log can should failed

Re: Performance issue in struct initialization

2016-04-23 Thread Basile B via Digitalmars-d
On Saturday, 23 April 2016 at 14:10:06 UTC, Basile B wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first

Re: Google Summer of Code

2016-04-23 Thread Seb via Digitalmars-d-announce
On Saturday, 23 April 2016 at 11:18:05 UTC, Joseph Rushton Wakeling wrote: Sebastian Wilzbach Science for D - a non-uniform RNG For obvious reasons, I'm particularly interested in this one. Do I take it right that the project will be based on this research paper?

mir.random - my GSoC project

2016-04-23 Thread Seb via Digitalmars-d
Hi all, I am very proud to be selected as a GSoC stipend for the D foundation. Most of you already know me from github (@wilzbach) and IRC (greenify). In my GSoC project I will contribute to Dlang’s upcoming numerical library mir [1]. You probably heard about mir from the new ndslice [2]

Re: Performance issue in struct initialization

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 10:10 AM, Basile B wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first example you've forget to

Re: Performance issue in struct initialization

2016-04-23 Thread Basile B via Digitalmars-d
On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first example you've forget to assign void:

Re: DConf 2016 offical presentation template

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/22/16 3:50 AM, poliklosio wrote: On Wednesday, 20 April 2016 at 07:53:53 UTC, Benjamin Thaut wrote: Is there a official presentation template for Dconf 2016? If not it would be greate if someone could create one. Many programmers (me included) are not good with picking colors and thus

Re: Performance issue in struct initialization

2016-04-23 Thread rikki cattermole via Digitalmars-d
On 24/04/2016 1:37 AM, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei That opEquals that is generated looks awfully big as well. Also form what I've read you could get a

Re: Direct link to D Foundation

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 23 April 2016 at 13:57:28 UTC, Andrei Alexandrescu wrote: I think it should have a separate page on dlang.org (no subdomain necessary), e.g. https://dlang.org/foundation. -- Personally I'd see the use of a subdomain as a useful way to separate between pages about the language

Re: Direct link to D Foundation

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 3:20 AM, Ozan Nurettin Süel wrote: Hi I was looking for a direct link to our D Foundation, to know about what are the current projects and the future topics. First try: http://www.dfoundation.net/ , a non-profit organization in india Second try: Back to dlang.org Third try: Something

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 9:54 AM, Andrei Alexandrescu wrote: On 4/23/16 9:06 AM, Vladimir Panteleev wrote: On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. popcnt(x) <= 1 ? Would

Re: XDG-APP and D

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Saturday, 23 April 2016 at 11:29:29 UTC, NX wrote: I will just leave it here: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ This is FUD. There are no security risks with snappy packages that there aren't with any other

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 9:06 AM, Vladimir Panteleev wrote: On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. popcnt(x) <= 1 ? Would be interesting to see how it compares to the

[Issue 11817] Structs with void initialized fields get initialized anyway

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11817 Adam D. Ruppe changed: What|Removed |Added CC|

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 9:04 AM, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess https://dlang.org/phobos/std_math.html#.truncPow2 or https://dlang.org/phobos/std_math.html#.nextPow2 could be reused, but I bet

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Nordlöw via Digitalmars-d
On Saturday, 23 April 2016 at 13:06:58 UTC, Vladimir Panteleev wrote: On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. popcnt(x) <= 1 ? Great. My solution: /**

Performance issue in struct initialization

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei

[Issue 15951] Inefficiencies in struct initialization

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15951 --- Comment #1 from Andrei Alexandrescu --- Related: https://issues.dlang.org/show_bug.cgi?id=11817 --

[Issue 15951] New: Inefficiencies in struct initialization

2016-04-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15951 Issue ID: 15951 Summary: Inefficiencies in struct initialization Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. popcnt(x) <= 1 ?

Re: http://asm.dlang.org/ down

2016-04-23 Thread Basile B via Digitalmars-d
On Saturday, 23 April 2016 at 12:43:49 UTC, Andrei Alexandrescu wrote: Do we have anyone on this? Thx! -- Andrei (warning self-promotion) In the meantime it's time to discover asm introspection with dbeaengine (https://github.com/BBasile/dbeaengine).

Checking if an Integer is an Exact Binary Power

2016-04-23 Thread Nordlöw via Digitalmars-d
Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess https://dlang.org/phobos/std_math.html#.truncPow2 or https://dlang.org/phobos/std_math.html#.nextPow2 could be reused, but I bet there's a more efficient way of

Re: DlangUI on Android

2016-04-23 Thread FrankLike via Digitalmars-d-announce
On Saturday, 23 April 2016 at 11:42:49 UTC, Vadim Lopatin wrote: [...] Thank you. But why nothing to be shown,only black color?

http://asm.dlang.org/ down

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
Do we have anyone on this? Thx! -- Andrei

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread Ivan Kazmenko via Digitalmars-d-learn
On Saturday, 23 April 2016 at 10:40:13 UTC, salvari wrote: It seems to be really simple, I read the columns name with no problem. But as soon as the program parses the first line of data, the array containing the columns names seems to be overwrited. Another possibility yet not mentioned is

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-23 Thread Lodovico Giaretta via Digitalmars-d
On Saturday, 23 April 2016 at 11:03:03 UTC, Ed wrote: Your D style is 90% Phobos compatible. There are few details you need to fix before writing more: you tend to forget the space after "if", "foreach" and "while". You'll see that actually this space makes the things more beautiful because

Re: DlangUI on Android

2016-04-23 Thread Vadim Lopatin via Digitalmars-d-announce
On Saturday, 23 April 2016 at 11:21:10 UTC, FrankLike wrote: On Friday, 22 April 2016 at 17:02:20 UTC, Vadim Lopatin wrote: Does it crash instantly or shows app GUI for some time? Is your smartphone arm-based? test-runner.apk is ok,but DLangUITetrisExample.apk and DlangUIHelloWorld.apk ,only

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread salvari via Digitalmars-d-learn
On Saturday, 23 April 2016 at 11:13:19 UTC, Nicholas Wilson wrote: On Saturday, 23 April 2016 at 10:57:04 UTC, salvari wrote: Fixed!!! Thanks a lot. :-) But I have to think about this. I don't understand the failure. stdin.byLine() reuses its buffer. so the old arrays in columns point to

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread salvari via Digitalmars-d-learn
On Saturday, 23 April 2016 at 11:18:08 UTC, rikki cattermole wrote: On 23/04/2016 10:57 PM, salvari wrote: Fixed!!! Thanks a lot. :-) But I have to think about this. I don't understand the failure. .dup duplicates memory. What this means is, it allocates a new block of memory and copies

Re: XDG-APP and D

2016-04-23 Thread NX via Digitalmars-d-announce
I will just leave it here: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/

Re: DlangUI on Android

2016-04-23 Thread FrankLike via Digitalmars-d-announce
On Friday, 22 April 2016 at 17:02:20 UTC, Vadim Lopatin wrote: Does it crash instantly or shows app GUI for some time? Is your smartphone arm-based? test-runner.apk is ok,but DLangUITetrisExample.apk and DlangUIHelloWorld.apk ,only shows black color. HTC Android 5.02 ,it's arm-based,Not ok,

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread rikki cattermole via Digitalmars-d-learn
On 23/04/2016 10:57 PM, salvari wrote: Fixed!!! Thanks a lot. :-) But I have to think about this. I don't understand the failure. .dup duplicates memory. What this means is, it allocates a new block of memory and copies the values across. What byLine does is, read up to \n and copies it

Re: Google Summer of Code

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d-announce
On Friday, 22 April 2016 at 22:43:43 UTC, CraigDillabaugh wrote: I am pleased to announce that the D Foundation has been awarded 4 slots for the 2016 Google Summer of Code. https://summerofcode.withgoogle.com/organizations/5078256051027968/ Congratulations to everyone involved -- this is

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 23 April 2016 at 10:57:04 UTC, salvari wrote: Fixed!!! Thanks a lot. :-) But I have to think about this. I don't understand the failure. stdin.byLine() reuses its buffer. so the old arrays in columns point to the data in byLine's buffer and they get overwritten by subsequent

Re: DlangUI on Android

2016-04-23 Thread FrankLike via Digitalmars-d-announce
On Friday, 22 April 2016 at 17:02:20 UTC, Vadim Lopatin wrote: On Friday, 22 April 2016 at 15:02:32 UTC, FrankLike wrote: You can downlowd sample APK: https://sourceforge.net/projects/crengine/files/DlangUI/ DlangUI Tetris example now works ok on Android (arm, android4.4+) Android5.02 ,Not

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-23 Thread Ed via Digitalmars-d
On Saturday, 23 April 2016 at 08:30:32 UTC, Lodovico Giaretta wrote: This is my first experience at GSoC and also my first collaboration with a big open source project, so if you have any suggestion about my proposal or my early implementation, feel free to tell me. Thank you very much to

Re: stc.experimental.ndslice -> sci.ndslice

2016-04-23 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 23 April 2016 at 09:57:20 UTC, Ilya Yaroshenko wrote: On Friday, 22 April 2016 at 22:11:27 UTC, Joseph Rushton Wakeling wrote: On Sunday, 17 April 2016 at 09:09:52 UTC, Ilya Yaroshenko wrote: On Sunday, 17 April 2016 at 08:49:53 UTC, Seb wrote: On Sunday, 17 April 2016 at 07:35:19

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread salvari via Digitalmars-d-learn
Fixed!!! Thanks a lot. :-) But I have to think about this. I don't understand the failure.

Re: Newbie: Error parsing csv file with very long lines

2016-04-23 Thread rikki cattermole via Digitalmars-d-learn
On 23/04/2016 10:40 PM, salvari wrote: Hello all! I'm trying to read a csv file (';' as separator) with very long lines. It seems to be really simple, I read the columns name with no problem. But as soon as the program parses the first line of data, the array containing the columns names seems

Newbie: Error parsing csv file with very long lines

2016-04-23 Thread salvari via Digitalmars-d-learn
Hello all! I'm trying to read a csv file (';' as separator) with very long lines. It seems to be really simple, I read the columns name with no problem. But as soon as the program parses the first line of data, the array containing the columns names seems to be overwrited. I'm using dmd:

Re: Any usable SIMD implementation?

2016-04-23 Thread Johan Engelen via Digitalmars-d
On Monday, 18 April 2016 at 00:27:06 UTC, Joe Duarte wrote: Someone else said talked about marking "Broadwell" and other generation names. As others have said, it's better to specify features. I wanted to chime in with a couple of additional examples. Intel's transactional memory

Re: Using D in Android App

2016-04-23 Thread Joakim via Digitalmars-d-learn
On Saturday, 16 April 2016 at 04:04:24 UTC, Justice wrote: Is it difficult to create a D business like app and connect it to android through java for the interface? Not difficult, but it hasn't really been done yet. I don't anticipate JNI causing much of a problem, but I need to look into

Re: stc.experimental.ndslice -> sci.ndslice

2016-04-23 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 22 April 2016 at 22:11:27 UTC, Joseph Rushton Wakeling wrote: On Sunday, 17 April 2016 at 09:09:52 UTC, Ilya Yaroshenko wrote: On Sunday, 17 April 2016 at 08:49:53 UTC, Seb wrote: On Sunday, 17 April 2016 at 07:35:19 UTC, Ilya Yaroshenko wrote: [...] Another idea would be to go

  1   2   >