[Issue 13369] std.math.iLog10

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13369

bb.t...@gmx.com changed:

   What|Removed |Added

 CC||bb.t...@gmx.com

--- Comment #2 from bb.t...@gmx.com ---
Hi, bearophile.

Just a word to tell you that your spam is part of the history ;)

http://forum.dlang.org/post/nlqklojvykfuuuddw...@forum.dlang.org

Your bullshits are almost done.

Goodbye my friend, it's hard to die...

--


Re: DirectX 12 bindings.

2015-12-01 Thread extrawurst via Digitalmars-d

On Tuesday, 1 December 2015 at 14:45:57 UTC, Denis Gladkiy wrote:

Where can I find DirectX 12 bindings for D?


Pretty outdated: http://www.dsource.org/projects/ddirectx9
But maybe a good starting point?

--Stephan


"Getting involved" on dlang.org?

2015-12-01 Thread Chris via Digitalmars-d
Wouldn't it make sense to have "Getting involved" on the start 
page of dlang.org? Most OSS projects feature something like this 
on their homepages. In this way, if somebody feels like 
contributing to D, they get the how-to info straight away 
(preferably not on Wiki, but on dlang.org).


There is a lot of low hanging fruit, stuff that doesn't even 
require coding. We should make it as easy as possible for people 
to get started contributing (cf. [1]). Thus, it would make sense 
to structure a "Getting involved" page along these lines:


1. code (Phobos, dmd etc.)
2. enhancing the documentation
3. enhancing/extending the homepage

When I started with my first humble contributions, I could only 
make it happen, because I got tips here on the forum (and per 
email). But people should be able to dive right into it, after 
reading "Getting involved"


Any thoughts?

[1] http://forum.dlang.org/thread/mpom8f$2eta$1...@digitalmars.com


Re: Official Announcement: 'Learning D' is Released

2015-12-01 Thread bachmeier via Digitalmars-d-announce

On Tuesday, 1 December 2015 at 19:58:22 UTC, Ali Çehreli wrote:

On 12/01/2015 09:53 AM, Andrei Alexandrescu wrote:

Congratulations! You may want to announce it in social news as 
well

(twitter, facebook, reddit, hackernews). -- Andrei


https://www.reddit.com/r/programming/comments/3v0vw8/book_release_learning_d_by_michael_parker_is_now/

Mike, I hope you will be able stay on that Reddit thread with 
an "AMA".


And of course, congratulations! :)

Ali


He lives in Korea. They're 15 hours ahead of CDT, making it 5:30 
am right now. He may be asleep. (I used to live in Korea, so I 
dealt with this all the time.)


Re: This Week in D

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 17:36:06 UTC, Chris Wright wrote:

Gay *people*. Not gays.


Oh well, I'm norwegian. I am indifferent to such nuances, I don't 
get the difference :). I think "gay people" in norwegian could be 
offensive too depending on how you phrase it, it could mark 
distance as in "those gay people that are not like us".


I've always just assumed that when Kathy Griffin can yell "ALL MY 
GAYS!" from a stage to applause then it is what one are supposed 
to say.



Remind me to give you a cookie when you're in town.


I will!

clear -- first he said that the range was inclusive, and later 
he even pointed out that, because it was inclusive, it would 
reduce the number of swaps near the head of the list.


Oh whatever :^), it was sloppy. See below.

But doing an average case complexity for exactly one simple 
case where the only random variable is the random number 
generator is often pretty easy. And that's what Andrei did.


My position is that you cannot assume that you can move from 
there to the average analysis for the algorithm as a whole, but 
since this is such a boring topic, let's let it pass and then we 
can discuss it later when you bring me my cookie! :)




Re: Official Announcement: 'Learning D' is Released

2015-12-01 Thread Ali Çehreli via Digitalmars-d-announce

On 12/01/2015 12:33 PM, bachmeier wrote:

On Tuesday, 1 December 2015 at 19:58:22 UTC, Ali Çehreli wrote:

On 12/01/2015 09:53 AM, Andrei Alexandrescu wrote:


Congratulations! You may want to announce it in social news as well
(twitter, facebook, reddit, hackernews). -- Andrei


https://www.reddit.com/r/programming/comments/3v0vw8/book_release_learning_d_by_michael_parker_is_now/


Mike, I hope you will be able stay on that Reddit thread with an "AMA".

And of course, congratulations! :)

Ali


He lives in Korea. They're 15 hours ahead of CDT, making it 5:30 am
right now. He may be asleep. (I used to live in Korea, so I dealt with
this all the time.)


I know. I was about to say "don't publish on social news before he's 
awake" but the news was out already. :)


Ali



Re: Three people out of four dislike SDL

2015-12-01 Thread Gary Willoughby via Digitalmars-d
I think the default should be the obscure, hipster 
language that no-one has heard of and who's website is currently 
offline[1]. Using this language for dub configuration should 
increase the barrier-to-entry just enough to weed out the soft 
programmers who we don't need using D. Json is far too easy to 
learn and too many IDE's support it. We want real programmers who 
like hard work, damn it!


[1]: http://sdl.ikayzo.org/display/SDL/Language+Guide


Re: "Getting involved" on dlang.org?

2015-12-01 Thread bachmeier via Digitalmars-d

On Tuesday, 1 December 2015 at 21:01:17 UTC, Chris wrote:
Wouldn't it make sense to have "Getting involved" on the start 
page of dlang.org? Most OSS projects feature something like 
this on their homepages. In this way, if somebody feels like 
contributing to D, they get the how-to info straight away 
(preferably not on Wiki, but on dlang.org).


There is a lot of low hanging fruit, stuff that doesn't even 
require coding. We should make it as easy as possible for 
people to get started contributing (cf. [1]). Thus, it would 
make sense to structure a "Getting involved" page along these 
lines:


1. code (Phobos, dmd etc.)
2. enhancing the documentation
3. enhancing/extending the homepage

When I started with my first humble contributions, I could only 
make it happen, because I got tips here on the forum (and per 
email). But people should be able to dive right into it, after 
reading "Getting involved"


Any thoughts?

[1] http://forum.dlang.org/thread/mpom8f$2eta$1...@digitalmars.com


The wiki page is pretty good right now. A link to it from the 
home page titled "Getting Involved" would do the trick. I don't 
think it's a good idea to put anything more than necessary on 
dlang.org, because it takes an act of Congress to get it changed.


Re: Advent of Code

2015-12-01 Thread Ali Çehreli via Digitalmars-d

On 12/01/2015 08:08 AM, Regan Heath wrote:

Hi all,

Long time since I read/posted here but I saw this and thought it might
be good PR for D:
http://adventofcode.com/

Should also be fun.

Ciao,
Regan



My visit was short due to this:

 To play, please identify yourself via one of these services:

[github] [google] [twitter] [reddit]

Ali



Re: Three people out of four dislike SDL

2015-12-01 Thread CraigDillabaugh via Digitalmars-d

On Tuesday, 1 December 2015 at 19:15:25 UTC, Bubbasaur wrote:
On Tuesday, 1 December 2015 at 19:05:38 UTC, CraigDillabaugh 
wrote:

(S)onke (D)on't (L)ike JSON


Hey, you can make all joke you want, but please don't be harsh 
with Sonke, because his contribution is awesome, and back then, 
he asked for direction and people pointed SDLang.


Bubba.


Sorry if that came off as a dig at Sonke, it was not intended as 
such.  I prefer SDL to JSON and thus was very happy with his 
decision, so I consider myself one of his supporters in this case 
... and it just happened to fit with SDL.


Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d

On 12/01/2015 12:13 AM, Andrei Alexandrescu wrote:

On 11/30/15 9:47 PM, Timon Gehr wrote:

On 12/01/2015 03:33 AM, Timon Gehr wrote:

On 11/30/2015 09:57 PM, Andrei Alexandrescu wrote:

So now consider my square heaps. We have O(n) build time (just a bunch
of heapifications) and O(sqrt n) search.


How do you build in O(n)? (The initial array is assumed to be completely
unordered, afaict.)


(I meant to say: There aren't any assumptions on the initial ordering of
the array elements.)


That's quite challenging. (My O(n) estimate was off the cuff and
possibly wrong.) Creating the structure entails simultaneously solving
the selection problem (find the k smallest elements) for several values
of k. I'll post here if I come up with something. -- Andrei


OK, I think I have an answer to this in the form of an efficient algorithm.

First off: sizes 1+3+5+7+... seem a great choice, I'll use that for the 
initial implementation (thanks Titus!).


Second: the whole max heap is a red herring - min heap is just as good, 
and in fact better. When doing the search just overshoot by one then go 
back one heap to the left and do the final linear search in there.


So the structure we're looking at is an array of adjacent min-heaps of 
sizes 1, 3, 5, etc. The heaps are ordered (the maximum of heap k is less 
than or equal to the minimum of heap k+1). Question is how do we build 
such an array of heaps in place starting from an unstructured array of 
size n.


One simple approach is to just sort the array in O(n log n). This 
satisfies all properties - all adjacent subsequences are obviously 
ordered, and any subsequence has the min heap property. As an 
engineering approach we may as well stop here - sorting is a widely 
studied and well implemented algorithm. However, we hope to get away 
with less work because we don't quite need full sorting.


Here's the intuition: the collection of heaps can be seen as one large 
heap that has a DAG structure (as opposed to a tree). In the DAG, the 
root of heap k+1 is the child of all leaves of heap k (see 
http://imgur.com/I366GYS which shows the DAG for the 1, 3, 7, and 7 heaps).


Clearly getting this structure to respect the heap property is all 
that's needed for everything to work - so we simply apply the classic 
heapify algorithm to it. It seems it can be applied almost unchanged - 
starting from the end, sift each element down the DAG.


This looks efficient and minimal; I doubt there's any redundant work. 
However, getting bounds for complexity of this will be tricky. Classic 
heapify is tricky, too - it seems to have complexity O(n log n) but in 
fact has complexity O(n) - see nice discussion at 
http://stackoverflow.com/questions/9755721/how-can-building-a-heap-be-on-time-complexity. 
When applying heapify to the DAG, there's more restrictions and the 
paths are longer, so a sliver more than O(n) is expected.


Anyway, this looks ready for a preliminary implementation and some more 
serious calculations.


One more interesting thing: the heap heads are sorted, so when 
searching, the heap corresponding to the searched item can be found 
using binary search. That makes that part of the search essentially 
negligible - the lion's share will be the linear search on the last 
mile. In turn, that suggests that more heaps that are smaller would be a 
better choice. (At an extreme, if we have an array of heaps each 
proportional to log(n), then we get search time O(log n) even though the 
array is not entirely sorted.)



Andrei



Re: Three people out of four dislike SDL

2015-12-01 Thread rsw0x via Digitalmars-d
On Wednesday, 2 December 2015 at 01:10:07 UTC, Craig Dillabaugh 
wrote:
On Tuesday, 1 December 2015 at 23:34:12 UTC, Gary Willoughby 
wrote:

[...]


Thats why I want to rename it Simple Dead Language.

[...]


If it was to be renamed, I would much prefer an initialism not 
already taken.


Re: DirectX 12 bindings.

2015-12-01 Thread Rikki Cattermole via Digitalmars-d

On 02/12/15 3:45 AM, Denis Gladkiy wrote:

Where can I find DirectX 12 bindings for D?


There is https://github.com/evilrat666/directx-d
Which plans by the looks of things to support it eventually.
Right now it sits at DX11.


Re: Three people out of four dislike SDL

2015-12-01 Thread Craig Dillabaugh via Digitalmars-d
On Tuesday, 1 December 2015 at 23:34:12 UTC, Gary Willoughby 
wrote:
I think the default should be the obscure, hipster 
language that no-one has heard of and who's website is 
currently offline[1]. Using this language for dub configuration 
should increase the barrier-to-entry just enough to weed out 
the soft programmers who we don't need using D. Json is far too 
easy to learn and too many IDE's support it. We want real 
programmers who like hard work, damn it!


[1]: http://sdl.ikayzo.org/display/SDL/Language+Guide


Thats why I want to rename it Simple Dead Language.

Honestly though there is nothing to 'Learn'.  You look at the 
examples and write your config file.  Honestly, when you are 
editing the text based configuration file for some software do 
you seriously even ask yourself "What language is this written 
in".  Unless it is XML or JSON you would likely never know, and 
wouldn't bother to look it up.


For example what language is Nginx's config written in:

https://www.digitalocean.com/community/tutorials/understanding-the-nginx-configuration-file-structure-and-configuration-contexts

I have no idea!

And with SDL if you have a problem you can write a comment to 
yourself explaining how it works once you figure it out.  While 
JSON supposedly supports comments anyone who can't figure out SDL 
syntax clearly isn't smart enough to write comments in a JSON 
file :o)


Re: "Getting involved" on dlang.org?

2015-12-01 Thread Adam D. Ruppe via Digitalmars-d

On Tuesday, 1 December 2015 at 21:01:17 UTC, Chris wrote:
There is a lot of low hanging fruit, stuff that doesn't even 
require coding.


You know, I just want to point out that writing documentation is 
actually really quite hard... you need to know how it works, well 
enough to write about (which can be even harder than just writing 
it yourself, especially with the complex implementations in 
Phobos) while being able to write... and still knowing what new 
readers know and don't know so your documentation is readable to 
them.


I think the reason documentation is kinda poor in so many objects 
is that it is actually really hard to do.



BTW on the topic of documentation, I actually hired a junior 
programmer with no D experience to write some D tutorials with 
me. It was actually kinda eye opening to see all the things I 
take for granted being a stumbling block for her. The first draft 
she submitted to me looks almost ridiculously simplistic to me, 
but much the stuff I write looks ridiculously complicated to 
newer users and I'm just blind to that... so I think there's a 
lot of value in getting new people to write docs, it is also just 
really hard for them to do.


It is my hope that the partnership between me and my contractor 
on this will result in something that strikes the right balance 
(and hopefully, the project will buy us a new D user too :P ) but 
it really does take a lot of time and work.


Re: Is D ready for quants?

2015-12-01 Thread Sergei Degtiarev via Digitalmars-d

On Friday, 27 November 2015 at 23:26:27 UTC, karabuta wrote:
This question came into mind when I read this 
http://www.makeuseof.com/answers/which-programming-language-is-used-to-build-a-financial-trading-platform/
I've been developing trading systems on C++ for years and, in my 
opinion, yes, D seems to be one of the best suited languages for 
such projects.





Re: Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-12-01 Thread Vincent R via Digitalmars-d

On Tuesday, 1 December 2015 at 10:21:11 UTC, Luis wrote:

On Monday, 30 November 2015 at 09:23:33 UTC, Vincent R wrote:

On Friday, 27 November 2015 at 09:56:10 UTC, Kagamin wrote:
The bug report is 
https://issues.dlang.org/show_bug.cgi?id=15324


Just hope it will be fixed soon because I gave up D 7 years 
ago (too many bugs, war between phobos, tango, very young 
language) and now I realize it still very complicated to use 
it (at least on windows).


Yeah, on Linux simply just works. On Windows, there is more 
issues...


Not even sure it works on linux because on the bug report above, 
platform is linux...


Re: Wishlist for D

2015-12-01 Thread Suliman via Digitalmars-d

On Tuesday, 1 December 2015 at 16:43:55 UTC, Ozan wrote:

Hi

We all have experience with several programming languages and 
the great ideas implemented there. It is close to Xmas and I 
think the right time for wishes about future functions in D. 
Where is right place to put these inspirations on?


Shall we send them directly to the D Foundation presidents? The 
Secretary? A central mailbox?


Regards,  Ozan


Right place is write here


Re: Three people out of four dislike SDL

2015-12-01 Thread H. S. Teoh via Digitalmars-d
On Tue, Dec 01, 2015 at 01:43:41PM +, Ola Fosheim Grøstad via Digitalmars-d 
wrote:
> On Tuesday, 1 December 2015 at 13:40:59 UTC, terchestor wrote:
> >botched this one. If Walter made this one everybody would threaten to
> >leave D forever and want his head on a spike. But the mistake must be
> >fixed anyway.
> 
> You seriously think DUB is D's biggest problem? You don't even need it
> to make use of D.

I find this whole debate hilarious, actually.  We aren't even talking
about D itself, but about a tool that not everyone who uses D uses (I
don't use dub and don't see any future scenario where I might need to
use it), and that, a silly *configuration syntax* for said tool, and an
*optional* one at that. Seriously, you can't get closer to Parkinson's
law of triviality[1] than that. This isn't about semantics (that nobody
understands nor cares about, being the most pertinent issue in a
programming language and all that), not even the syntax of D itself, but
about the (optional!) syntax of an optional(!) tool that some people use
with D, and we're getting all worked up like the world is about to end
or something.

Simply hilarious.

[1] https://en.wikipedia.org/wiki/Parkinson's_law_of_triviality


T

-- 
Why is it that all of the instruments seeking intelligent life in the universe 
are pointed away from Earth? -- Michael Beibl


Re: This Week in D

2015-12-01 Thread Chris Wright via Digitalmars-d
On Tue, 01 Dec 2015 17:18:47 +, Ola Fosheim Grøstad wrote:

> On Tuesday, 1 December 2015 at 16:18:37 UTC, Chris Wright wrote:
>> Judging by who is labeled an SJW, I'm one, and mentioning the existence
>> of trans people in a context where their existence is relevant is
>> sufficient to be labeled an SJW.
> 
> Really? That sounds bad, hopefully this will pass. Sounds like the trans
> people are going through the same process as the gays did before them.
> People who have problems with it probably have some uncertainty about
> their own identity at some level.

Gay *people*. Not gays.

>> As for judging a programming language in three seconds...that's a bad
>> analysis of the situation. I left Nim in part because Araq was, shall
>> we say, less than friendly.
> 
> Oh well, but Araq is a mild breeze compared to the D citizens!!! There
> are plenty of people here that like to show off and prefer to go through
> the roof rather than having someone kindly bring them back to earth...

Araq is the leader of the project. His attitudes weigh much more strongly 
than those of other people in the community.

> But some of us are very reasonable!! Like I decided not to hit you back

Remind me to give you a cookie when you're in town.

> for wrongly claiming that my "O(N)" should have been "O(infinity)"

I believe you claimed O(N) searches would guarantee that the item reached 
the head of the list. His algorithm allowed you not to swap the position 
of the found element. He made this clear -- first he said that the range 
was inclusive, and later he even pointed out that, because it was 
inclusive, it would reduce the number of swaps near the head of the list.

Since it's possible for each search for an item not to result in a swap, 
it is not guaranteed that searching for the same item repeatedly will 
ever move that item to the head of the list.

> and
> that unqualified "big-oh" usually means "average complexity"

Context matters.

> (when lazy
> comp sci people use unqualified big-oh it always means worst case :-)
> But since I am going there anyway: average complexity analysis isn't
> something you can do on the back of a napkin

But doing an average case complexity for exactly one simple case where 
the only random variable is the random number generator is often pretty 
easy. And that's what Andrei did.


[Issue 14998] Cannot put a char into a char[]

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14998

--- Comment #6 from schneider.ced...@gmx.de ---
"Cannot put a  into a  because it is not a
" would not need to be special-cased since the
special-casing already happens in the template that retrieves the ranges
element type (if I am understanding correctly, maybe the code creating the
error message does not have all necessary information, though).

That aside, it certainly would have stopped me from opening this issue and
instead go and read some more about ranges and strings in D because that error
message clearly indicates that I am missing something. But I obviously do not
speak for everyone and improving on the situation by adding a better error
message is obviously not a fail-safe. I am pretty sure tiny things like that do
help, though, considering that changing the string-handling everywhere is
obviously not a possibility :-).

--


Re: This Week in D

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 15:04:48 UTC, Adam D. Ruppe wrote:
I actually think weekly pull request reports and such aren't 
all that interesting at all, that's why I like to do the tips 
and try to summarize things that might influence the future 
direction of D.


Yes, tips are really cool and probably a good reason for people 
to read it. Forward looking "tidbits" are good and fun too.


topics come up more for discussion. And not just length of 
discussion or frequency of threads, but the attitude we see 
inside from a few key members.


Sure.

TWID's audience includes visitors, but its core are already D 
users at varying levels of activity who don't necessarily know 
all these things but want to.


It _is_ challenging to write for many different types of readers, 
newbies vs oldbies, random visitors that want to know status quo 
and which one want to appear attractive to, computer scientists 
vs teenagers etc. It is indeed much easier to write for a narrow 
group.


Personally I feel the downside of having a weekly issue is that 
only a couple of things "happen" each week. So a random person or 
more passive D user will get less of a sense that "things are 
happening". The upside is that active D users get something 
predictable each week. I only write from the perspective of  
appealing to "critical programmers" at the front page.


Other languages also have websites that rub me the wrong way by 
being "too personal" too (which implies small and unfinished). I 
think Rust does pretty well by taking the "clean technical 
information hub" approach, but that has nothing to do with the 
newsletter. :)




Re: This Week in D

2015-12-01 Thread Sönke Ludwig via Digitalmars-d

Am 30.11.2015 um 13:52 schrieb Ola Fosheim Grøstad:

This Week in D is a valuable source for information, but it is also on
the front page and shapes how D is perceived.

It just doesn't look good or factual when it talks about "flame
throwing" and "flamewar". I don't think there has been anything that
warrants that kind of terminology this week. Other weeks, maybe, but
"flaming" usually refers to prolonged personal attacks.

Maybe one should reconsider the entertainment aspect of the newsletter
and stick to factual information that is relevant for the reader.



A slight correction regarding the background: vibe.d doesn't and didn't 
use SDLang at all, just DUB does. It's just that its exploration in the 
context of DUB started quite a while before it became the official 
package manager, but the vibe.d/DUB split happened before the whole 
SDLang topic.


Re: This Week in D

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d

On 12/01/2015 11:21 AM, Adam D. Ruppe wrote:

At least with a weekly thing, we look alive at first glance. There used
to be people who look at the homepage and think everything was dead
because the design isn't bootstrappy or whatever and thus obviously
unmaintained.


FWIW to me a weekly is the sweet spot. There could be weeks where few 
things happen, like in July or whatever. "Slow week. Walter on vacation 
in Tibet teaching monks D and conga. Andrei got a fish tank and argues 
existentialism with a clam. Martin reportedly wrote a small script only 
with his left pinky." -- Andrei




Wishlist for D

2015-12-01 Thread Ozan via Digitalmars-d

Hi

We all have experience with several programming languages and the 
great ideas implemented there. It is close to Xmas and I think 
the right time for wishes about future functions in D. Where is 
right place to put these inspirations on?


Shall we send them directly to the D Foundation presidents? The 
Secretary? A central mailbox?


Regards,  Ozan


Re: Wishlist for D

2015-12-01 Thread Chris via Digitalmars-d

On Tuesday, 1 December 2015 at 16:43:55 UTC, Ozan wrote:

Hi

We all have experience with several programming languages and 
the great ideas implemented there. It is close to Xmas and I 
think the right time for wishes about future functions in D. 
Where is right place to put these inspirations on?


Shall we send them directly to the D Foundation presidents? The 
Secretary? A central mailbox?


Santa Claus
1 Reindeer Street
North Pole


Regards,  Ozan


Or Adam can compile a wish list from a 300+ monster thread ;)



Re: This Week in D

2015-12-01 Thread CraigDillabaugh via Digitalmars-d

On Monday, 30 November 2015 at 20:07:10 UTC, Adam D. Ruppe wrote:

I'll change it to "thread" on the front page.


How about "Epic Bikeshedding Thread"?


Re: DirectX 12 bindings.

2015-12-01 Thread ZombineDev via Digitalmars-d

On Tuesday, 1 December 2015 at 14:45:57 UTC, Denis Gladkiy wrote:

Where can I find DirectX 12 bindings for D?


I'm working on a DirectX 12 binding (and I'll be making a Vulkan 
one, when Vulkan is released), but there's no ETA. I don't know 
if there are others also working on DirectX 12 bindings.


Re: Forum structure

2015-12-01 Thread Brad Anderson via Digitalmars-d
On Tuesday, 1 December 2015 at 14:45:04 UTC, Steven Schveighoffer 
wrote:
I would discourage adding any more groups. I don't really get 
the point of having so many groups, if you have a question, use 
the main group or the learn group. That is where all of us are 
paying attention.


+1

People are too quick to try to compartmentalize everything. It 
should only be done when the volume becomes a problem.


Re: This Week in D

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 16:18:37 UTC, Chris Wright wrote:
Judging by who is labeled an SJW, I'm one, and mentioning the 
existence of trans people in a context where their existence is 
relevant is sufficient to be labeled an SJW.


Really? That sounds bad, hopefully this will pass. Sounds like 
the trans people are going through the same process as the gays 
did before them. People who have problems with it probably have 
some uncertainty about their own identity at some level.


As for judging a programming language in three seconds...that's 
a bad analysis of the situation. I left Nim in part because 
Araq was, shall we say, less than friendly.


Oh well, but Araq is a mild breeze compared to the D citizens!!! 
There are plenty of people here that like to show off and prefer 
to go through the roof rather than having someone kindly bring 
them back to earth...


But some of us are very reasonable!! Like I decided not to hit 
you back for wrongly claiming that my "O(N)" should have been 
"O(infinity)" and that unqualified "big-oh" usually means 
"average complexity" (when lazy comp sci people use unqualified 
big-oh it always means worst case :-) But since I am going there 
anyway: average complexity analysis isn't something you can do on 
the back of a napkin, first you have to define a model for the 
input, then you have to transform it into something that can be 
dealt with, like a recurrence relation, then an integral that you 
solve analytically etc. So if it common for people around you to 
talk about average complexity analysis a lot then they probably 
have no idea what they are talking about. Average complexity is 
mostly of academic interest (publish or perish!) and insanely 
boring. In fact it is so boring, that the professor who taught 
the topic on my university started the lecture series by saying 
"I am sorry to say this, but this topic is very boring. I wish I 
could say that it will become better as we progress through this 
course, but it won't. It will remain boring throughout."


In the time it takes to do an average analysis of algorithm you 
can implement and benchmark it many times with much more useful 
results. So the next time you meet someone who boasts about their 
average analysis skills... be highly sceptical, they are probably 
bluffing. :^)


I guess this was off topic.



Re: need help with Windows CreateNamedPipe Security attributes process with undefined symbols at compile time

2015-12-01 Thread Jonathan Villa via Digitalmars-d-learn

On Tuesday, 1 December 2015 at 14:48:37 UTC, Adam D. Ruppe wrote:
On Tuesday, 1 December 2015 at 14:40:38 UTC, Jonathan Villa 
wrote:
MAN! what the heck? I changed the build from x86 to x64 and 
there's no more errors. Even without the new pragma line. 
Either way I would prefer x64 over x86.


64 bit should work better because then it uses the linker and 
dll definitions from Microsoft, which are more up to date.


The ones that come with 32 bit dmd are ancient... like Windows 
2000ish. We've known about this for ages but nobody has updated 
them



Ok, I'm fine with it; I'm gonna stick with x64, It looks like the 
better option.

Thanks all for your help ^^


Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d

On 12/01/2015 04:50 AM, Emil Kirschner wrote:

On Monday, 30 November 2015 at 20:13:15 UTC, Andrei Alexandrescu wrote:

Okasaki's book is a continued inspiration of data structures and
algorithms.
Start with a simple array of data. Then mentally decompose that array
into a concatenation of smaller arrays: first has size 1, second has
size 4, third has size 9, then 16, 25, 36, ... Generally the size of
these imaginary subarrays grows quadratically. And they're adjacent to
each other. The last array may be incomplete.

Please share any thoughts!


Andrei


Interesting, but isn't that basically a skip list with uneven sub-lists?
insert could be quite complex unless the entire data structure is backed
by a continuous or a continuous linked list.


Doesn't look like a skip list to me. -- Andrei


Re: Wishlist for D

2015-12-01 Thread BBaz via Digitalmars-d

On Tuesday, 1 December 2015 at 16:43:55 UTC, Ozan wrote:

Hi

We all have experience with several programming languages and 
the great ideas implemented there. It is close to Xmas and I 
think the right time for wishes about future functions in D. 
Where is right place to put these inspirations on?


Shall we send them directly to the D Foundation presidents? The 
Secretary? A central mailbox?


Regards,  Ozan


I just wish that the D lang members get that they'll become more 
and more reviewers...and that they'll accept this role. It 
shouldn't be so difficult since a slice of them don't code 
anymore anyway.


confere with:

http://forum.dlang.org/thread/uxyvbszhtpxobewgn...@forum.dlang.org

;)


Re: I hate new DUB config format

2015-12-01 Thread Chris Wright via Digitalmars-d
On Tue, 01 Dec 2015 12:22:32 +, Ola Fosheim Grøstad wrote:

> On Tuesday, 1 December 2015 at 12:07:51 UTC, Russel Winder wrote:
>> I think you are meaning Bazel here. http://bazel.io/
>>
>> I haven't had chance to play with it as yet, and it changes massively
>> every day – though I suspect it is the internal of the satisfaction
>> engine that change not the specification notation (which looks a bit
>> like a Python/SCons/Waf type thing). I will be playing with it over the
>> next few weeks, so more news later.
> 
> 
> That's interesting, I didn't know they were going to make it publicly
> available. The FAQ says it supports Java, Objective-C and C++ out of the
> box. So I guess that means there is infrastructure for adding other
> languages too.

So they open sourced Blaze. Interesting, but not very useful.

Bazel, like Blaze, wants to keep a very granular build unit with explicit 
dependencies. It aims to keep very little per-language logic in the build 
system. The tradeoff is that humans have to supply it all.

DUB aims to have very tight integration with D, and build granularity 
isn't a large goal. This means it's nearly useless for building any other 
language, and it would probably die if you tried to build a project with 
a million lines of code with it. But on the other hand, I can write a 
build file that just contains the project name and what dependencies it 
has and I'm off to the races.

Amazon internally has a build system called Brazil. (My information is 
probably four years out of date now.) It's basically a multilanguage 
Maven, hampered by an ugly web interface and a concept of "version sets" 
-- which is essentially the same as dub.selections.json, but you have to 
maintain it manually. That model, minus the web interface and manually 
curating version selections, would work much better with most small to 
medium projects in the wild. Add a source distribution option (to avoid 
having to build N versions of the same library; we're not all on JIT) and 
Bob's your uncle.


Re: Collections question

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d

On 12/01/2015 09:35 AM, Marc Schütz wrote:

On Tuesday, 1 December 2015 at 14:15:47 UTC, Andrei Alexandrescu wrote:

On 12/1/15 4:55 AM, Marc Schütz wrote:

On Monday, 30 November 2015 at 18:18:38 UTC, Andrei Alexandrescu wrote:

* The one matter with the value/RefCounted approach is that RefCounted
cannot be made @safe.


That's just as true for internal refcounting.


I don't think that's the case. The way I wrote code, safety can be
achieved with a few controlled insertions of @trusted. -- Andrei


As long as you can pass the container and one of it's elements by
mutable ref, it's unsafe (see the RCArray discussion [1]). If you can
only access the elements by value (i.e. opIndex returns a copy), this
precondition isn't fulfilled, but otherwise, I see no way to prevent it
with the current language.

[1] http://forum.dlang.org/post/huspgmeupgobjubts...@forum.dlang.org


Ah, the good old assignment to reference. We need to prevent that from 
happening in safe code. Got any fresh ideas? -- Andrei


Re: Three people out of four dislike SDL

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d

On 12/01/2015 09:18 AM, Timon Gehr wrote:

On 12/01/2015 03:01 PM, Saurabh Das wrote:

now told that 75% of the community doesn't like the change.


I'm sorry to enter this discussion, but that's simply not what the poll
is saying. It should be very obvious that the poll is basically
meaningless.


Independent on the topic at hand - wondering what your reasoning is. I 
just took a look and there are 205 votes. Not a large number, but quite 
a lot more than any voting we saw in the past (when consensus was 
proclaimed after like 15 votes :o)). Intuitively I agree with you, but I 
wonder at what point numbers become large enough to capture meaning. 
Thx! -- Andrei


Re: Official Announcement: 'Learning D' is Released

2015-12-01 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 12/01/2015 01:17 AM, Mike Parker wrote:

Due to a minor mix up at the end of an otherwise enjoyable process, I
wasn't notified that 'Learning D' was released on Nov 27. Today, I
finally got that notification. Despite there already being a thread on
the topic here in this forum, please forgive me for taking the
opportunity to make my "official" announcement :)

'Learning D' is available from the publisher's website[1], where a
sample[2] can also be viewed for those who want to try before they buy.
It's also available from Amazon[3].

Thanks to Walter for kindly providing a Foreword and to all the
reviewers for their valuable feedback.

The source will be downloadable from the publisher's website, but I
intend to put up a repository on GitHub to make sure it stays up to
date. I'll be posting more about the book on my blog[4] in the near future.

If you know any C-family programmers who are interested in learning D,
this book was written with them in mind. I hope people find it useful.

[1] https://www.packtpub.com/application-development/learning-d
[2]
https://www.packtpub.com/packtlib/book/Application%20Development/9781783552481

[3]
http://www.amazon.com/Learning-D-Michael-Parker/dp/1783552484/ref=as_li_ss_tl?ie=UTF8=1448948127=8-1=learning+d=sl1=aldacron-20=b0490265742705a2e3dd6fd25536b006

[4] http://dblog.aldacron.net


Congratulations! You may want to announce it in social news as well 
(twitter, facebook, reddit, hackernews). -- Andrei


Re: Three people out of four dislike SDL

2015-12-01 Thread bachmeier via Digitalmars-d
On Tuesday, 1 December 2015 at 17:26:13 UTC, Andrei Alexandrescu 
wrote:

On 12/01/2015 09:18 AM, Timon Gehr wrote:

On 12/01/2015 03:01 PM, Saurabh Das wrote:

now told that 75% of the community doesn't like the change.


I'm sorry to enter this discussion, but that's simply not what 
the poll

is saying. It should be very obvious that the poll is basically
meaningless.


Independent on the topic at hand - wondering what your 
reasoning is. I just took a look and there are 205 votes. Not a 
large number, but quite a lot more than any voting we saw in 
the past (when consensus was proclaimed after like 15 votes 
:o)). Intuitively I agree with you, but I wonder at what point 
numbers become large enough to capture meaning. Thx! -- Andrei


One possibility is that you have to care enough to vote. It's 
hard to imagine that there is symmetry between those that dislike 
the new format and those that don't. And some members of the 
community don't even use Dub.


On other matters, 15 votes is fine, if they're the ones that care 
and have the background to form an opinion.


Re: Three people out of four dislike SDL

2015-12-01 Thread BLM768 via Digitalmars-d
On Tuesday, 1 December 2015 at 17:26:13 UTC, Andrei Alexandrescu 
wrote:
Independent on the topic at hand - wondering what your 
reasoning is. I just took a look and there are 205 votes. Not a 
large number, but quite a lot more than any voting we saw in 
the past (when consensus was proclaimed after like 15 votes 
:o)). Intuitively I agree with you, but I wonder at what point 
numbers become large enough to capture meaning. Thx! -- Andrei


Time for a proportion Z-test! Assuming that this poll represents 
a simple random sample (which it almost certainly doesn't, but 
it's the best we have), let's test the claim that at least 50% of 
the community dislikes the SDL format.


For reference, I'm using the poll data at the time of this post: 
124 for, 145 against.


According to my calculations, at a 95% confidence level, there's 
not sufficient evidence to reject the hypothesis that at least 
50% of the community dislikes the new format.


However, FWIW, we can say with very high confidence that at least 
25% of the whole community likes the new format.


Re: Three people out of four dislike SDL

2015-12-01 Thread Bubbasaur via Digitalmars-d
On Tuesday, 1 December 2015 at 17:26:13 UTC, Andrei Alexandrescu 
wrote:
Independent on the topic at hand - wondering what your 
reasoning is. I just took a look and there are 205 votes. Not a 
large number, but quite a lot more than any voting we saw in 
the past (when consensus was proclaimed after like 15 votes 
:o)). Intuitively I agree with you, but I wonder at what point 
numbers become large enough to capture meaning. Thx! -- Andrei


Really, do really believe in what you wrote?

So if you take a look right now, the "YES" option for the 
question: "Do you like new


DUB config format?" Is somehow "magically" winning the poll right 
now!


Bubba.


Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread rsw0x via Digitalmars-d
On Monday, 30 November 2015 at 20:13:15 UTC, Andrei Alexandrescu 
wrote:
Okasaki's book is a continued inspiration of data structures 
and algorithms.


[...]


Sort of reminds me of a modified Hashed Array Tree — not keen on 
the name, I think "Bucket Array" would have been better.

https://en.wikipedia.org/wiki/Hashed_array_tree


Re: Pirate King

2015-12-01 Thread tired_eyes via Digitalmars-d

On Wednesday, 2 December 2015 at 06:33:27 UTC, Bonnieabc wrote:

So, where is that spam report button?


[Issue 13369] std.math.iLog10

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13369

ag0ae...@gmail.com changed:

   What|Removed |Added

 CC||ag0ae...@gmail.com

--- Comment #3 from ag0ae...@gmail.com ---
(In reply to bb.temp from comment #2)
> Hi, bearophile.
> 
> Just a word to tell you that your spam is part of the history ;)
> 
> http://forum.dlang.org/post/nlqklojvykfuuuddw...@forum.dlang.org
> 
> Your bullshits are almost done.
> 
> Goodbye my friend, it's hard to die...

This is inappropriate. Please don't take personal matters to issue discussions,
and whatever the channel, please stay civil.

--


Pirate King

2015-12-01 Thread Bonnieabc via Digitalmars-d

Hi,guys!
Do you play games? What kind of game do you like?
I like rpg game,pirate king game is my favorite online game,the 
game is based on one piece manga,I am so like the comic! Now I am 
sailing on the sea and finding the treasure, it is so exciting! 
Do you want to join our team?

The official website of the game is: http://op2.joygames.me/


Re: Collections question

2015-12-01 Thread deadalnix via Digitalmars-d
On Tuesday, 1 December 2015 at 17:27:20 UTC, Andrei Alexandrescu 
wrote:
Ah, the good old assignment to reference. We need to prevent 
that from happening in safe code. Got any fresh ideas? -- Andrei


Disable owner when borrowing 'mutably', and not when borrowing 
'constly'.


Re: Advent of Code

2015-12-01 Thread drug via Digitalmars-d

On 02.12.2015 06:50, Charles wrote:

On Tuesday, 1 December 2015 at 22:57:38 UTC, Ali Çehreli wrote:

My visit was short due to this:

 To play, please identify yourself via one of these services:

[github] [google] [twitter] [reddit]

Ali


I was the same way earlier, but reddit doesn't need personal
information, so you can just make a throwaway account. Did the first
question and it was painfully simple.

 SPOILERS (stop reading here if you want to do it) !!!





 auto input = "arbitrarily long string of '(' and ')'";

 int floor;
 foreach(movement; input)
 floor += (movement == '(' ? 1 : -1);

 writeln(floor);
If you copy the input with spaces (like I did) the code above gives 
wrong result because the requirement is the input should contain only 
"(" and ")".


Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread Navin via Digitalmars-d
On Tuesday, 1 December 2015 at 22:48:56 UTC, Andrei Alexandrescu 
wrote:

On 12/01/2015 12:13 AM, Andrei Alexandrescu wrote:

On 11/30/15 9:47 PM, Timon Gehr wrote:

On 12/01/2015 03:33 AM, Timon Gehr wrote:

On 11/30/2015 09:57 PM, Andrei Alexandrescu wrote:
So now consider my square heaps. We have O(n) build time 
(just a bunch

of heapifications) and O(sqrt n) search.


How do you build in O(n)? (The initial array is assumed to 
be completely

unordered, afaict.)


(I meant to say: There aren't any assumptions on the initial 
ordering of

the array elements.)


That's quite challenging. (My O(n) estimate was off the cuff 
and
possibly wrong.) Creating the structure entails simultaneously 
solving
the selection problem (find the k smallest elements) for 
several values

of k. I'll post here if I come up with something. -- Andrei


OK, I think I have an answer to this in the form of an 
efficient algorithm.


First off: sizes 1+3+5+7+... seem a great choice, I'll use that 
for the initial implementation (thanks Titus!).


Second: the whole max heap is a red herring - min heap is just 
as good, and in fact better. When doing the search just 
overshoot by one then go back one heap to the left and do the 
final linear search in there.


So the structure we're looking at is an array of adjacent 
min-heaps of sizes 1, 3, 5, etc. The heaps are ordered (the 
maximum of heap k is less than or equal to the minimum of heap 
k+1). Question is how do we build such an array of heaps in 
place starting from an unstructured array of size n.


One simple approach is to just sort the array in O(n log n). 
This satisfies all properties - all adjacent subsequences are 
obviously ordered, and any subsequence has the min heap 
property. As an engineering approach we may as well stop here - 
sorting is a widely studied and well implemented algorithm. 
However, we hope to get away with less work because we don't 
quite need full sorting.


Here's the intuition: the collection of heaps can be seen as 
one large heap that has a DAG structure (as opposed to a tree). 
In the DAG, the root of heap k+1 is the child of all leaves of 
heap k (see http://imgur.com/I366GYS which shows the DAG for 
the 1, 3, 7, and 7 heaps).


Clearly getting this structure to respect the heap property is 
all that's needed for everything to work - so we simply apply 
the classic heapify algorithm to it. It seems it can be applied 
almost unchanged - starting from the end, sift each element 
down the DAG.


This looks efficient and minimal; I doubt there's any redundant 
work. However, getting bounds for complexity of this will be 
tricky. Classic heapify is tricky, too - it seems to have 
complexity O(n log n) but in fact has complexity O(n) - see 
nice discussion at 
http://stackoverflow.com/questions/9755721/how-can-building-a-heap-be-on-time-complexity. When applying heapify to the DAG, there's more restrictions and the paths are longer, so a sliver more than O(n) is expected.


Anyway, this looks ready for a preliminary implementation and 
some more serious calculations.


One more interesting thing: the heap heads are sorted, so when 
searching, the heap corresponding to the searched item can be 
found using binary search. That makes that part of the search 
essentially negligible - the lion's share will be the linear 
search on the last mile. In turn, that suggests that more heaps 
that are smaller would be a better choice. (At an extreme, if 
we have an array of heaps each proportional to log(n), then we 
get search time O(log n) even though the array is not entirely 
sorted.)



Andrei


Nice to see this interesting post and learn.

 I have a few questions.

1) This is offline datastructure since you don't know how the 
elements of the future are going to be ie dynamic. ie later 
elements from n to 2n can break or change your heaps as such in 
worst case or is it a dynamic data structure ?


2)  Searching in min or max heaps is bad isn't it ? Lets say we 
choose max heaps. Now we have the root as 10^9 in the second last 
heap ie around n^2 elements.  The children of it are 4*10^8 and 
5*10^8 . If i'm searching for say 4.5 *10^8 my job is easy but if 
i'm searching for 1000, i have to search in both the subtrees and 
it goes linear and becomes around n^2 in the worst case. Did i 
overlook anything ?


Instead of heaps, a single sorted array or breaking them into a 
series of sorted arrays ie skip lists kind of stuff  would be 
fine if it just want a offline Data structure ?


or is this some domain specific data Structure where you only/cre 
want max/min in some sequence ?







utils.toBulkString is not accesible from utils

2015-12-01 Thread Andre via Digitalmars-d-learn

Hi,

for following coding there is an error during compilation:

  module utils;

  package string toBulkString(string s)
  {
  import std.string: format;
  return "$%s\r\n%s\r\n".format(s.length, s);
  }

  unittest
  {
  string actual = "foobar".toBulkString();
  //...
  }

source\utils.d(11,39): Error: function utils.toBulkString is 
not accessible from module utils


The error disappears if I change the visibility attribute from 
package to private.

This seems to be a bug, is it?

Version: DMD v2.069.0-b2

Kind regards
André


Re: DLang users telegram group

2015-12-01 Thread Suliman via Digitalmars-d-announce
On Monday, 30 November 2015 at 10:58:34 UTC, Quentin Ladeveze 
wrote:

Hi everybody,

I just created a Telegram group for dlang users : 
https://telegram.me/joinchat/BeLaugMz35ZxQUq2fks4YQ


Feel free to join !


Russian group  https://telegram.me/joinchat/AtK90wNnU7mm0gx7yKo82w


Re: Advent of Code

2015-12-01 Thread Ali Çehreli via Digitalmars-d

On 12/01/2015 07:50 PM, Charles wrote:
> On Tuesday, 1 December 2015 at 22:57:38 UTC, Ali Çehreli wrote:
>> My visit was short due to this:
>>
>>  To play, please identify yourself via one of these services:
>>
>> [github] [google] [twitter] [reddit]
>>
>> Ali
>
> I was the same way earlier, but reddit doesn't need personal
> information, so you can just make a throwaway account.

I over-reacted. In fact, I have accounts on three of those, except 
twitter. Oh well...


Ali



Re: Can someone check this on win32 ?

2015-12-01 Thread Daniel Murphy via Digitalmars-d-learn

On 21/11/2015 10:46 PM, BBaz wrote:

Seems to be fixed:

__
import std.math;
void main() {real function(real) c = }
__


https://issues.dlang.org/show_bug.cgi?id=4541

At least it works on linux x86_64.




It works because of 
https://github.com/D-Programming-Language/phobos/pull/3599


But it only works for the std.math intrinsics, there are plenty of 
others without real bodies.


Re: DirectX 12 bindings.

2015-12-01 Thread Denis Gladkiy via Digitalmars-d
On Wednesday, 2 December 2015 at 02:05:22 UTC, Rikki Cattermole 
wrote:

On 02/12/15 3:45 AM, Denis Gladkiy wrote:

Where can I find DirectX 12 bindings for D?


There is https://github.com/evilrat666/directx-d
Which plans by the looks of things to support it eventually.
Right now it sits at DX11.


Last update was in 2014. What are the signs of upcoming DirectX 
12 support?


Re: DirectX 12 bindings.

2015-12-01 Thread Rikki Cattermole via Digitalmars-d

On 02/12/15 5:17 PM, Denis Gladkiy wrote:

On Wednesday, 2 December 2015 at 02:05:22 UTC, Rikki Cattermole wrote:

On 02/12/15 3:45 AM, Denis Gladkiy wrote:

Where can I find DirectX 12 bindings for D?


There is https://github.com/evilrat666/directx-d
Which plans by the looks of things to support it eventually.
Right now it sits at DX11.


Last update was in 2014. What are the signs of upcoming DirectX 12 support?


Okay I may have stretched it a little on that one.
But it shouldn't be too hard to do that last bit of work.


Re: Advent of Code

2015-12-01 Thread Charles via Digitalmars-d

On Tuesday, 1 December 2015 at 22:57:38 UTC, Ali Çehreli wrote:

My visit was short due to this:

 To play, please identify yourself via one of these services:

[github] [google] [twitter] [reddit]

Ali


I was the same way earlier, but reddit doesn't need personal 
information, so you can just make a throwaway account. Did the 
first question and it was painfully simple.


 SPOILERS (stop reading here if you want to do it) !!!





auto input = "arbitrarily long string of '(' and ')'";

int floor;
foreach(movement; input)
floor += (movement == '(' ? 1 : -1);

writeln(floor);


Re: Something about Chinese Disorder Code

2015-12-01 Thread Daniel Murphy via Digitalmars-d-learn

On 25/11/2015 2:16 PM, Rikki Cattermole wrote:

On 25/11/15 1:47 AM, Meta wrote:

I'm pretty sure you can just do:

wstring text = "my string";

Or

auto text = "my string"w;


The second one is correct yes.
I'm just assuming that it isn't compiled into the executable.


Either is fine.  Non-suffixed string literals have a default type of 
string, but implicitly convert to wstring/dstring at compile time.


vibed and thrift client

2015-12-01 Thread Nikolay via Digitalmars-d
I am using thrift client inside vibe.d application. Currently 
thrift uses standard blocking IO calls. So I use async thrift 
client inside vibed. Some other libraries (e.g. ddb postgres 
drive) have special build option for using vibe.d IO library 
(fiber friendly). I created request in Jira 
https://issues.apache.org/jira/browse/THRIFT-3459 for integration 
thrift with vibed async IO.


Jens Geyer (member of thrift team) wrote:
As long as we don't add any dependencies that are not optional, 
that's fine. If this is going to add a hard dependency to 
whatever library and this is by no means convertible into 
something that can be added optionally, I'm not so sure if we 
really want this. Speaking about Thrift in general, we try to 
keep it free from hard dependencies.
If this can be made optional in some way, either by just 
optionally adding it to the current D project, or (in the case 
where Thrift compiler support is needed) to bind this additional 
dependency to an compiler parameter (like thrift -gen 
d:add_support_for_XYZ) and some majority of users wants this, 
e.g. because XYZ is state of the art, that's a different thing.
Could you please elaborate somewhat more about why you think this 
is a good addition?

@other D users: Your opinion is also important here.

--

What do you think about integration vibe.d with thrift? Is vibed 
important enough for this request?


Re: vibed and thrift client

2015-12-01 Thread Chris Wright via Digitalmars-d
You would need to create vibe-aware alternatives to TSSLSocket and 
TSocket. You would need a server that can assign requests to new fibers. 
That's about it.

You could easily make this its own library. No need to modify thrift.


Re: vibed and thrift client

2015-12-01 Thread Nikolay via Digitalmars-d

On Wednesday, 2 December 2015 at 04:40:41 UTC, Chris Wright wrote:
You would need to create vibe-aware alternatives to TSSLSocket 
and TSocket. You would need a server that can assign requests 
to new fibers. That's about it.


You could easily make this its own library. No need to modify 
thrift.


Ok this looks as right solution. I was on wrong way.

Thanks


Re: Three people out of four dislike SDL

2015-12-01 Thread BLM768 via Digitalmars-d

On Tuesday, 1 December 2015 at 18:25:06 UTC, Bubbasaur wrote:

Really, do really believe in what you wrote?

So if you take a look right now, the "YES" option for the 
question: "Do you like new


DUB config format?" Is somehow "magically" winning the poll 
right now!


Bubba.


Huh. That changed quickly. My Z-test is already out of date. ;)


[Issue 14998] Cannot put a char into a char[]

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14998

--- Comment #7 from Steven Schveighoffer  ---
Except that's not exactly the reason. The reason is because no implementation
exists to support it. Quite literally, the compiler tried to find a suitable
mechanism, and couldn't.

Changing the error message to be more specific to this situation may read
confusingly for another case where that *isn't* the problem.

I think it's possible we could make a special message for these situations, the
code is already pretty dead set against allowing this (and has special cases to
handle it). I just don't know what the correct answer is.

I was just reading this on the docs:
http://dlang.org/phobos/std_range_primitives.html#.put

"r.putChar(e); R accepts some form of string or character. put will
transcode the character e accordingly."

In the implementation of putChar, it specifically forbids r to be a dynamic
array. So we may want to add a note that R cannot be a dynamic array of char in
this position (I'm unsure why, since it is possible). I will note that before
the "putChar" function was added, it still didn't compile.

--


Re: Wiki article: Starting as a Contributor

2015-12-01 Thread Jack Stouffer via Digitalmars-d
On Monday, 3 August 2015 at 21:25:35 UTC, Andrei Alexandrescu 
wrote:
I had to set up dmd and friends on a fresh Ubuntu box, so I 
thought I'd document the step-by-step process:


http://wiki.dlang.org/Starting_as_a_Contributor


Due to a realization that there were three places were 
contributing info was held on the wiki, I have merged the pages 
into this one as best as I could. This page now holds everything 
someone should need to get started.


Re: Three people out of four dislike SDL

2015-12-01 Thread Bubbasaur via Digitalmars-d

On Monday, 30 November 2015 at 22:59:04 UTC, retard wrote:
Just voted at 
http://www.easypolls.net/poll.html?p=565587f4e4b0b3955a59fb67 - 
140 votes, 75% are against SDL. That should count for 
something? Sonke?


If you believe that, the votes changes "dramagically" and now 
it's 53% in favor of SDLang.


Bubba.


Re: Three people out of four dislike SDL

2015-12-01 Thread user via Digitalmars-d

It all started here 

http://forum.dlang.org/post/evxhpxfkeorrrkhqz...@forum.dlang.org
:-)

... or one of the posts in that thread, I mean.




Re: Three people out of four dislike SDL

2015-12-01 Thread CraigDillabaugh via Digitalmars-d

On Tuesday, 1 December 2015 at 18:25:06 UTC, Bubbasaur wrote:
On Tuesday, 1 December 2015 at 17:26:13 UTC, Andrei 
Alexandrescu wrote:

clip


So if you take a look right now, the "YES" option for the 
question: "Do you like new


DUB config format?" Is somehow "magically" winning the poll 
right now!


Bubba.


Hooray, way to go SDLang!!

I think what SDL needs is a re-branding!  A few options:

(S)imple (D)ead (L)anguage
(D)ead (S)imple (L)anguage   (Google's not going to like that 
either)

(S)onke (D)on't (L)ike JSON









Re: Formal Review of std.range.ndslice

2015-12-01 Thread Ilya Yaroshenko via Digitalmars-d

On Tuesday, 1 December 2015 at 16:03:51 UTC, Jack Stouffer wrote:
On Sunday, 29 November 2015 at 20:53:43 UTC, Jack Stouffer 
wrote:
On Monday, 16 November 2015 at 22:45:35 UTC, Jack Stouffer 
wrote:

This is the start of the two week formal review


Friendly reminder that the review ends tomorrow.


The two week review is over. Thank you to everyone who 
commented here or on the PR. Of course, even though the review 
is over, you can still make comments on the GitHub PR up until 
it's merged.


9il, please let me know if you want to start the voting right 
away or wait until your list is completed.


Thank you, Jack!

I plan to check English text and add 4D example for image 
processing and 5D example for computer vision first. They should 
help users to imagine use cases.


Plus looks like we need comparison between D.Slice and 
numpy.ndarray. Slice is more flexible, faster and generalised 
comparing with ndarray. In the same time Slice has not problems 
with extensions like numpy dose (as you have already noted) and 
it has tiny (in LOC) implementation. I hope that examples and the 
comparison would be moved later to DBlog (D needs blog!) with 
detailed explanation by another author (I can be reviewer).


Re: Dub use

2015-12-01 Thread Brad Anderson via Digitalmars-d

On Tuesday, 1 December 2015 at 18:43:17 UTC, Russel Winder wrote:
Dub appears to use only dmd, there appears to be no option fir 
the dub.sdl file to tell it to use ldc2. Or am I just missing 
something – very likely.


dub --compiler=ldc2


Re: Dub use

2015-12-01 Thread BBaz via Digitalmars-d

On Tuesday, 1 December 2015 at 18:45:25 UTC, BBaz wrote:
On Tuesday, 1 December 2015 at 18:43:17 UTC, Russel Winder 
wrote:


to:

Dub appears to use only dmd, there appears to be no option fir 
the dub.sdl file to tell it to use ldc2. Or am I just missing 
something – very likely.


I reply:

bolocks.

;)


bollocks, indeed.


Dub use

2015-12-01 Thread Russel Winder via Digitalmars-d
Dub appears to use only dmd, there appears to be no option fir the
dub.sdl file to tell it to use ldc2. Or am I just missing something –
very likely.

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



signature.asc
Description: This is a digitally signed message part


Re: Dub use

2015-12-01 Thread BBaz via Digitalmars-d

On Tuesday, 1 December 2015 at 18:43:17 UTC, Russel Winder wrote:

to:

Dub appears to use only dmd, there appears to be no option fir 
the dub.sdl file to tell it to use ldc2. Or am I just missing 
something – very likely.


I reply:

bolocks.

;)




Re: Wishlist for D

2015-12-01 Thread Jack Stouffer via Digitalmars-d

On Tuesday, 1 December 2015 at 16:43:55 UTC, Ozan wrote:

Hi

We all have experience with several programming languages and 
the great ideas implemented there. It is close to Xmas and I 
think the right time for wishes about future functions in D. 
Where is right place to put these inspirations on?


Shall we send them directly to the D Foundation presidents? The 
Secretary? A central mailbox?


Regards,  Ozan


If you have very specific ideas rather, you can always create an 
enhancement request at issues.dlang.org


Re: Three people out of four dislike SDL

2015-12-01 Thread Bubbasaur via Digitalmars-d
On Tuesday, 1 December 2015 at 19:05:38 UTC, CraigDillabaugh 
wrote:

(S)onke (D)on't (L)ike JSON


Hey, you can make all joke you want, but please don't be harsh 
with Sonke, because his contribution is awesome, and back then, 
he asked for direction and people pointed SDLang.


Bubba.




Re: Dub use

2015-12-01 Thread Russel Winder via Digitalmars-d
On Tue, 2015-12-01 at 18:45 +, Brad Anderson via Digitalmars-d
wrote:
> […]
> 
> dub --compiler=ldc2

Is there an in dub.sdl version of this?

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



signature.asc
Description: This is a digitally signed message part


Re: I hate new DUB config format

2015-12-01 Thread Russel Winder via Digitalmars-d
On Tue, 2015-12-01 at 17:24 +, Chris Wright via Digitalmars-d
wrote:
> […]
> Bob's your uncle.

Is Uncle Bob your uncle?


PS Sorry for that, I am in a weird state just now.

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



signature.asc
Description: This is a digitally signed message part


Re: Dub use

2015-12-01 Thread Mathias Lang via Digitalmars-d
2015-12-01 20:21 GMT+01:00 Russel Winder via Digitalmars-d <
digitalmars-d@puremagic.com>:

> On Tue, 2015-12-01 at 18:45 +, Brad Anderson via Digitalmars-d
> wrote:
> > […]
> >
> > dub --compiler=ldc2
>
> Is there an in dub.sdl version of this?
>
> --
> Russel.
>
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip:
> sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>
>
Nope. And there won't be any, as it would imply supporting the idea of
having packages that only compiles with a specific compiler (not very
future-proof).


Re: Dub use

2015-12-01 Thread Sönke Ludwig via Digitalmars-d

Am 01.12.2015 um 20:21 schrieb Russel Winder via Digitalmars-d:

On Tue, 2015-12-01 at 18:45 +, Brad Anderson via Digitalmars-d
wrote:

[…]

dub --compiler=ldc2


Is there an in dub.sdl version of this?



Not currently. dub.sdl is not ideal, because it would lead to 
ambiguities within the dependency graph, but dub.selections.json could 
be extended to support that.


What is also possible is to add a "defaultCompiler" field to 
~/.dub/settings.json to change the default compiler user-wide.


Re: Official Announcement: 'Learning D' is Released

2015-12-01 Thread Ali Çehreli via Digitalmars-d-announce

On 12/01/2015 09:53 AM, Andrei Alexandrescu wrote:


Congratulations! You may want to announce it in social news as well
(twitter, facebook, reddit, hackernews). -- Andrei


https://www.reddit.com/r/programming/comments/3v0vw8/book_release_learning_d_by_michael_parker_is_now/

Mike, I hope you will be able stay on that Reddit thread with an "AMA".

And of course, congratulations! :)

Ali



GC buckets in 2.067

2015-12-01 Thread Iain Buclaw via Digitalmars-d
When running the unittest program for druntime.

---
Program received signal SIGSEGV, Segmentation fault.
__memset_avx2 () at ../sysdeps/x86_64/multiarch/memset-avx2.S:101

backtrace:
#0  __memset_avx2 () at ../sysdeps/x86_64/multiarch/memset-avx2.S:101
#1  0x004d45a0 in gc.gc.GC.malloc(ulong, uint, ulong*,
const(TypeInfo)) (this=..., size=8, bits=0, alloc_size=0x7fffd428,
ti=0x714050 ) at
../../../../dev/libphobos/libd
runtime/gc/gc.d:459
#2  0x004c5948 in gc_qalloc (sz=8, ba=0, ti=0x714050
) at
../../../../dev/libphobos/libdruntime/gc/proxy.d:196
#3  0x004450de in core.memory.GC.qalloc(ulong, uint,
const(TypeInfo)) (sz=8, ba=0, ti=0x714050 )
at ../../../../dev/libphobos/libdruntime/core/memory.d:368
#4  0x00420e31 in _d_newitemT (_ti=0x714050
) at
../../../../dev/libphobos/libdruntime/rt/lifetime.d:1096
#5  0x00411f6c in _aaGetX (aa=0x77ed2090, keyti=0x7191a0
, valuesize=8, pkey=0x7fffd598) at
../../../../dev/libphobos/libdruntime/rt/aaA.d:172
#6  0x00449f6d in core.thread.ThreadGroup.create(void() delegate)
(this=0x77ed2080, dg=...) at
../../../../dev/libphobos/libdruntime/core/thread.d:3318
#7  0x004c28ed in core.sync.mutex.__unittestL241_1() () at
../../../../dev/libphobos/libdruntime/core/sync/mutex.d:262
#8  0x00445a7b in __foreachbody3 (this=0x7fffd790, m=0x71a9e0
) at
../../../../dev/libphobos/libdruntime/core/runtime.d:448
#9  0x00407c1e in object.ModuleInfo.__lambda2 (this=0x7fffd750,
m=0x71a9e0 ) at
../../../../dev/libphobos/libdruntime/object.d:1771
#10 0x0041c58d in rt.minfo.moduleinfos_apply(scope
int(immutable(object.ModuleInfo*)) delegate) (dg=...) at
../../../../dev/libphobos/libdruntime/rt/minfo.d:287
#11 0x00407beb in object.ModuleInfo.opApply(scope
int(object.ModuleInfo*) delegate) (dg=...) at
../../../../dev/libphobos/libdruntime/object.d:1770
#12 0x004457fa in runModuleUnitTests () at
../../../../dev/libphobos/libdruntime/core/runtime.d:438
#13 0x0041ab36 in runAll (this=0x7fffdbe0) at
../../../../dev/libphobos/libdruntime/rt/dmain2.d:428
#14 0x0041aad2 in rt.dmain2._d_run_main(int, char**, extern(C)
int(char[][]) function*).tryExec(scope void() delegate)
(this=0x7fffdbe0, dg=...) at
../../../../dev/libphobos/libdruntime/rt/dmain2.d:40
4
#15 0x0041aa2b in _d_run_main (argc=1, argv=0x7fffdd68,
mainFunc=0x402a60 ) at
../../../../dev/libphobos/libdruntime/rt/dmain2.d:437
#16 0x76ee6a40 in __libc_start_main (main=0x402910 , argc=1,
argv=0x7fffdd68, init=, fini=,
rtld_fini=, stack_end=0x7fffdd58) at libc-start.c:289
#17 0x00402969 in _start ()

In gc.d
---
 459├>memset(p + size, 0, *alloc_size - size);

p = (void *) 0x4c9fad <__gdc_exception_cleanup>
---

So the GC is trying to run memset on the address of a function.

It's caused by this line:

1796│ // Return next item from free list
1797├>bucket[bin] = (cast(List*)p).next;

Where:

*(cast(List*)p) = {next = 0x4c9fad <__gdc_exception_cleanup>, pool = 0x0}


Not sure what is going on, but it seems to happen after allocating memory a
couple dozen or so times.

David, did you get anything like this when moving to 2.067?


[Issue 15392] dmd object files fail to link with ld.gold

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15392

--- Comment #2 from Martin Nowak  ---
(In reply to Walter Bright from comment #1)
> The sections are not supposed to be order dependent.

Yeah, you're right, the problem is that ld.gold doesn't assign an output order
to the eh section.
https://sourceware.org/git/?p=binutils.git;a=blob;f=gold/layout.cc;hb=a0a1bb07cb2c03b7d34f12e734c6f363ddb7c7b2#l1386

--


Re: isAllocator

2015-12-01 Thread BBaz via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 03:05:34 UTC, Rikki Cattermole 
wrote:

On 01/12/15 3:23 AM, Tofu Ninja wrote:

On Monday, 30 November 2015 at 14:21:49 UTC, Tofu Ninja wrote:
Is there something like isInputRange for allocators, I tried 
looking

for something but couldn't find anything? If not, why not?


Aka, some way to check that type T is an allocator.


Doesn't look like it.

bool isAllocator(Alloc)() pure {
	return __traits(compiles, {IAllocator alloc = new 
CAllocatorImpl!Alloc;});

}

That should work however.


I think that `is(CAllocatorImpl!Alloc)` should work too then.


Re: Official Announcement: 'Learning D' is Released

2015-12-01 Thread Daniel Kozak via Digitalmars-d-announce
V Tue, 01 Dec 2015 06:17:15 +
Mike Parker via Digitalmars-d-announce
 napsáno:

> Due to a minor mix up at the end of an otherwise enjoyable 
> process, I wasn't notified that 'Learning D' was released on Nov 
> 27. Today, I finally got that notification. Despite there already 
> being a thread on the topic here in this forum, please forgive me 
> for taking the opportunity to make my "official" announcement :)
> 
> 'Learning D' is available from the publisher's website[1], where 
> a sample[2] can also be viewed for those who want to try before 
> they buy. It's also available from Amazon[3].
> 
> Thanks to Walter for kindly providing a Foreword and to all the 
> reviewers for their valuable feedback.
> 
> The source will be downloadable from the publisher's website, but 
> I intend to put up a repository on GitHub to make sure it stays 
> up to date. I'll be posting more about the book on my blog[4] in 
> the near future.
> 
> If you know any C-family programmers who are interested in 
> learning D, this book was written with them in mind. I hope 
> people find it useful.
> 
> [1] https://www.packtpub.com/application-development/learning-d
> [2] 
> https://www.packtpub.com/packtlib/book/Application%20Development/9781783552481
> [3] 
> http://www.amazon.com/Learning-D-Michael-Parker/dp/1783552484/ref=as_li_ss_tl?ie=UTF8=1448948127=8-1=learning+d=sl1=aldacron-20=b0490265742705a2e3dd6fd25536b006
> [4] http://dblog.aldacron.net

http://wiki.dlang.org/Books should be updated :)



Re: This Week in D

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 07:34:49 UTC, ketmar wrote:
that's great: less SJW and other unstable persons. if someone 
is judging *programming* *language* with 3-second look at the 
site... well, i'd better not have such person on board.


But Social Justice Warriors are great fun!!!

Here's the deal: there is usually a correlation between 
presentation and content. If the front page is professional, then 
there is some hope that the product is too. If there is no 
editorial control on the front page, then there probably is chaos 
elsewhere too... That's a fair assumption to make that often 
holds true.




Re: vibe.d-example illustrating Dynamic Textual Web-Interface

2015-12-01 Thread Sebastiaan Koppe via Digitalmars-d-learn

On Tuesday, 1 December 2015 at 07:04:25 UTC, Sönke Ludwig wrote:

Am 30.11.2015 um 11:08 schrieb Nordlöw:
Does anybody have a similar vibe.d-project to be inspired 
from, in this

regard?


This would be more targeted to the web interface generator 
(vibe.web.web), which is not affected by the changes mentioned 
above, but the interface is pretty similar. For a very simple 
example, you can have a look at this:

https://github.com/rejectedsoftware/vibe.d/tree/master/examples/web_ajax


I have seen a lot of sites using this approach. I feel that once 
complexity increases (more dynamics, popups, real-time 
validation, spa) it runs into some maintenance issues.


Let me elaborate. In the beginning all html is generated on the 
server. Then more features are added and slowly more html is 
generated/manipulated in the client. Now you have this 
split-brain were html is generated both on the server and the 
client, but both in different languages, with different template 
engines. To put it simply, it doesn't scale well.


The solution would be to shift the generation of html to the 
client (for example see trello, digital ocean, etc.). The only 
issue there is that the first page load takes longer. This can be 
solved by rendering the first page on the server. With nodeJS 
this is easy since you can reuse the same code, with D this is a 
little harder.


Re: This Week in D

2015-12-01 Thread BBaz via Digitalmars-d
On Tuesday, 1 December 2015 at 09:07:52 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 1 December 2015 at 07:34:49 UTC, ketmar wrote:
that's great: less SJW and other unstable persons. if someone 
is judging *programming* *language* with 3-second look at the 
site... well, i'd better not have such person on board.


But Social Justice Warriors are great fun!!!

Here's the deal: there is usually a correlation between 
presentation and content. If the front page is professional, 
then there is some hope that the product is too. If there is no 
editorial control on the front page, then there probably is 
chaos elsewhere too... That's a fair assumption to make that 
often holds true.


But the reallity is that the debat has happened. So, what do your 
propose ? To hide the reallity ?


More concretely, I accord you that maybe the word "flamewar" 
could be replaced by "animated debate"...but otherwise, pfft.





Re: I hate new DUB config format

2015-12-01 Thread Idan Arye via Digitalmars-d

On Tuesday, 1 December 2015 at 02:46:46 UTC, lobo wrote:
On Monday, 30 November 2015 at 21:05:08 UTC, Ola Fosheim 
Grøstad wrote:

On Monday, 30 November 2015 at 20:42:23 UTC, Suliman wrote:
Should we try to implement yet another language for writing 
building config?


No, I wasn't really talking about a build system for D, more 
like a hypothetic generic distributed build system for all 
languages. But I've read that Google uses a distributed build 
system for their big C++ applications. So people are working 
on such solutions already.


Maybe we should use any of existence language that may be 
very good for it, like Red. It have very small foot prints so 
it can be easy to embeded to build system.


I've never heard of Red, do you have a link?


Red started out as a Rebol 2 clone and last I checked (18 
months ago) it was still is Rebol 2 compatible.


http://www.red-lang.org/

bye,
lobo


Red is not Rebol2 compatible - it's outright impossible to have a 
single script file that'll run without errors on both Rebol2 and 
Red. The reason is that Rebol2 requires the first thing in the 
file to be a `REBOL` preamble, while Red requires it to be a 
`Red` preamble(though it's generous enough to allow a shebang 
before it). Since you can only have one preamble, and it can't be 
both `REBOL` and `Red`, I refuse to call them compatible even if 
every Rebol2 command can be copied to a Red script and run in 
there!


At any rate, please don't use any Rebol dialect in DUB(or for 
anything else, in that matter. Just - don't use it). Many 
languages have awkward quirks, but Rebol seems to be a collection 
of awkward quirks with a programming language somtimes 
accidentally hiding in between, created by someone who thought 
Perl is too readable and shell scripts have too strict type 
systems.


Re: Is there anyone willing to do the videos 18sex website?

2015-12-01 Thread Idan Arye via Digitalmars-d-announce

On Tuesday, 1 December 2015 at 02:14:07 UTC, Walter Bright wrote:

On 11/30/2015 2:18 PM, Jonny wrote:

On Sunday, 29 November 2015 at 12:23:16 UTC, tired_eyes wrote:

On Sunday, 29 November 2015 at 02:19:30 UTC, mcss wrote:
I want to find a partner to do the world's largest 18sex 
video site.


Lol, such an ambitious project! Dlang definetely needs a 
success story of that

kind :) Please keep us posted!


I'm sure if there was an incentive, like free sex with the 
female clients, then
it wouldn't be that difficult to amass a group of programmers 
to do the work!


This thread has gone far enough. Please stop.


Still more productive than the DUB format thread...


Re: This Week in D

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 09:33:12 UTC, BBaz wrote:
But the reallity is that the debat has happened. So, what do 
your propose ? To hide the reallity ?


Yeah! Be selective.

Just report facts that are of interest to a wider audience. There 
seems to be too little interesting content to fill a weekly.


A more condensed bi-weekly would look more interesting to 
visitors.




Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread Emil Kirschner via Digitalmars-d
On Monday, 30 November 2015 at 20:13:15 UTC, Andrei Alexandrescu 
wrote:
Okasaki's book is a continued inspiration of data structures 
and algorithms.
Start with a simple array of data. Then mentally decompose that 
array into a concatenation of smaller arrays: first has size 1, 
second has size 4, third has size 9, then 16, 25, 36, ... 
Generally the size of these imaginary subarrays grows 
quadratically. And they're adjacent to each other. The last 
array may be incomplete.


Please share any thoughts!


Andrei


Interesting, but isn't that basically a skip list with uneven 
sub-lists? insert could be quite complex unless the entire data 
structure is backed by a continuous or a continuous linked list.


Re: Collections question

2015-12-01 Thread Marc Schütz via Digitalmars-d
On Monday, 30 November 2015 at 18:18:38 UTC, Andrei Alexandrescu 
wrote:
* The one matter with the value/RefCounted approach is that 
RefCounted cannot be made @safe.


That's just as true for internal refcounting.


Re: I hate new DUB config format

2015-12-01 Thread Chris via Digitalmars-d

On Tuesday, 1 December 2015 at 04:54:23 UTC, James Hofmann wrote:
Although I admit to coming in late to a big bikeshed-fest, I 
have some opinions on configuration file formats from having 
seen younger, non-technical end users try to configure their 
own game servers. The support cost of misconfiguration due to 
syntax error is enormous. Gob-stoppingly huge. It is day after 
day of


Q: hey it's broke fix it
A: you forgot to add a double quote in your config file

And so when the file format is pressed into the role of primary 
UI, and is touched directly by hundreds or thousands of people, 
who want to write things that are more than a few trivial 
lines, relying only on JSON, which biases towards parser and 
programmer friendliness, not towards forgiving syntax, is not 
the right trade-off for total human effort and the stress 
levels of project maintainers. Those files are source code and 
need the additional care and forgiving structure of a source 
code language. If you want externally-generated configurations, 
then JSON is the right move, but it is not a complete design - 
it's passing the buck to users.


Yes, _all_ configuration file formats become a mess once you do 
non-trivial stuff. However, for what you describe above, you 
shouldn't have users edit JSON directly. If you deal with UI 
stuff, have hundreds and thousands of people working on it, 
people who are non-technical, you should use automated WYSIWYG 
tools like Glade. Even a technical person might have difficulties 
making non-trivial changes to huge configuration files manually.


[snip]



FWIW, I'm tempted to take the side of "make JS the default, 
compile existing SDL and JSON to JS when run, add compilers for 
TOML or YAML if there's demand". If you make code your lowest 
common denominator, nothing else matters, and JS is the 
de-facto lowest common denominator of code, today. Someone 
presented with a config whose syntax they don't know can tell 
Dub to port it to JS and edit that instead, and so over time 
all configs end up being a blob of JS code, in the same way 
that the "light"/"heavy" markup situation is resolved by 
gradually converting everything into the heavy format even if 
it didn't start there. That is OK. Dub might run a bit slower, 
and there are some security issues raised from it, but the 
world is unlikely to blow up because someone wrote "clever" JS 
in their Dub config.


Also, people will see the option of coding JS and go, "Now I 
can write a build system on top of Dub, and it can use my own 
config format, way better than SDL or YAML or TOML! Everyone's 
gonna love this!" The D and Dub maintainers smile innocently 
and say nothing...


Ain't gonna happen. I don't think anyone is interested in making 
DUB dependent on JS or any other 3rd party scripting language, 
e.g. Lua (which I like) or Ruby. I suppose DUB will always rely 
on home made D solutions, and it should.


Re: This Week in D

2015-12-01 Thread BBaz via Digitalmars-d
On Tuesday, 1 December 2015 at 09:47:05 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 1 December 2015 at 09:33:12 UTC, BBaz wrote:
But the reallity is that the debat has happened. So, what do 
your propose ? To hide the reallity ?


Yeah! Be selective.

Just report facts that are of interest to a wider audience. 
There seems to be too little interesting content to fill a 
weekly.


A more condensed bi-weekly would look more interesting to 
visitors.


Ok, I understand your position now. I don't agree but I get your 
your point.


Re: An interesting data structure with search time O(sqrt n)

2015-12-01 Thread Marko Mikulicic via Digitalmars-d
On Monday, 30 November 2015 at 20:13:15 UTC, Andrei Alexandrescu 
wrote:
Okasaki's book is a continued inspiration of data structures 
and algorithms.


[...]



Hi,

You might find relevant ideas in 
https://cs.uwaterloo.ca/research/tr/1979/CS-79-31.pdf and 
http://www.sciencedirect.com/science/article/pii/002280900379 
.


Cheers,
Marko



[Issue 15390] 'abstract' should override final:

2015-12-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15390

--- Comment #2 from Manu  ---
(In reply to Infiltrator from comment #1)
> I don't know whether I agree with your statement "naturally, this is the
> first line in any D class", but I agree that final: and abstract: should
> override each other as public:, protected:, etc. do.
> 
> I assume that you are currently working around this buy having all of your
> abstracts up the top before your final: line?

Yeah. It's fine for now, it's just a awkward.

In this case, the D class is an extern(C++) mirror of the C class, which means
if I rearrange the virtual functions, the vtables no longer match. Obviously I
have to take care to not rearrange the order of the virtuals, but it's harder
to prove this when I can no longer diff the C++ and D code (which are almost
identical in terms of lines). Since the D class must be rearranged, it's much
harder to compare it to the C++ version, and I don't see a good reason for that
nuisance.

Of course, the common case is that 'final:' appear at the top of every class,
for reasons that I'm trying to stop repeating ;)

--


Re: OT: Denis is back! :)

2015-12-01 Thread Iain Buclaw via Digitalmars-d
On 1 December 2015 at 00:21, Ali Çehreli 
wrote:

> On 11/30/2015 03:15 PM, Denis Koroskin wrote:
>
> Forget the algorithms! Denis is back... :)
>
>
Hurray!


Re: This Week in D

2015-12-01 Thread Chris via Digitalmars-d

On Monday, 30 November 2015 at 20:07:10 UTC, Adam D. Ruppe wrote:

I'll change it to "thread" on the front page.


I liked this line

"And, the thread many of you have been waiting to hear about... "

Which was exactly how I felt, after reading about the other 
threads :-) This bit of news was more for those who participated 
in the thread (or were crazy enough to read it!), kind of like an 
in-joke. No harm in there.


I was interested in seeing how you (Adam) would sum it up, and I 
have to say you did a pretty good job.


Re: Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-12-01 Thread Luis via Digitalmars-d

On Monday, 30 November 2015 at 09:23:33 UTC, Vincent R wrote:

On Friday, 27 November 2015 at 09:56:10 UTC, Kagamin wrote:
The bug report is 
https://issues.dlang.org/show_bug.cgi?id=15324


Just hope it will be fixed soon because I gave up D 7 years ago 
(too many bugs, war between phobos, tango, very young language) 
and now I realize it still very complicated to use it (at least 
on windows).


Yeah, on Linux simply just works. On Windows, there is more 
issues...


Re: I hate new DUB config format

2015-12-01 Thread Ola Fosheim Grøstad via Digitalmars-d

On Tuesday, 1 December 2015 at 02:46:46 UTC, lobo wrote:
Red started out as a Rebol 2 clone and last I checked (18 
months ago) it was still is Rebol 2 compatible.


http://www.red-lang.org/


Thanks!



Re: I hate new DUB config format

2015-12-01 Thread Atila Neves via Digitalmars-d
On Tuesday, 1 December 2015 at 05:39:26 UTC, Craig Dillabaugh 
wrote:
On Tuesday, 1 December 2015 at 04:54:23 UTC, James Hofmann 
wrote:

[...]


Sorry, I think that most of what you said made good sense, but 
I am a bit confused by the quoted bit.  So you want the DUB 
config files written in full-blown JavaScript? Then DUB and the 
other tools would need a JavaScript compiler built-in.


You can use dub packages and write descriptions of how to build 
them in Javascript with reggae. Today.


Atila


Forum structure

2015-12-01 Thread Luis via Digitalmars-d
Being DUB very important for D language... why there isn't an 
entry for DUB on ecosystem ?


Also, looks that DWT isn't very active. Not should be a "GUI" 
entry to talk about GtkD, TkD and other GUI toolkits, instead 
focusing on one that looks that no body uses ?


PD: I don't know the true state of DWT, but GtkD and TkD simply 
just works.


Re: I hate new DUB config format

2015-12-01 Thread Luis via Digitalmars-d

On Tuesday, 1 December 2015 at 10:27:45 UTC, Atila Neves wrote:
On Tuesday, 1 December 2015 at 05:39:26 UTC, Craig Dillabaugh 
wrote:
On Tuesday, 1 December 2015 at 04:54:23 UTC, James Hofmann 
wrote:

[...]


Sorry, I think that most of what you said made good sense, but 
I am a bit confused by the quoted bit.  So you want the DUB 
config files written in full-blown JavaScript? Then DUB and 
the other tools would need a JavaScript compiler built-in.


You can use dub packages and write descriptions of how to build 
them in Javascript with reggae. Today.


Atila


A example of this would be nice. Also... you can grab with dub a 
dependency package that is build with reggae ?


Re: I hate new DUB config format

2015-12-01 Thread lobo via Digitalmars-d

On Tuesday, 1 December 2015 at 09:43:24 UTC, Idan Arye wrote:
Red is not Rebol2 compatible - it's outright impossible to have 
a single script file that'll run without errors on both Rebol2 
and Red. The reason is that Rebol2 requires the first thing in 
the file to be a `REBOL` preamble, while Red requires it to be 
a `Red` preamble(though it's generous enough to allow a shebang 
before it). Since you can only have one preamble, and it can't 
be both `REBOL` and `Red`, I refuse to call them compatible 
even if every Rebol2 command can be copied to a Red script and 
run in there!




Meh, beyond s/Rebol/Red all my R2 code runs with Red.

At any rate, please don't use any Rebol dialect in DUB(or for 
anything else, in that matter. Just - don't use it). Many 
languages have awkward quirks, but Rebol seems to be a 
collection of awkward quirks with a programming language 
somtimes accidentally hiding in between, created by someone who 
thought Perl is too readable and shell scripts have too strict 
type systems.


Actually I find Rebol has less quirks than most languages. It 
does have one alien looking syntax though.


bye,
lobo


  1   2   >