Re: D for Game Development

2015-08-08 Thread lobo via Digitalmars-d
On Friday, 7 August 2015 at 04:56:39 UTC, Rikki Cattermole wrote: *whispers* Hey hey you. You want tests? Well here is something you'll like[0]. Oh and check out[1]. [0] http://www.libpng.org/pub/png/pngsuite.html [1] http://forum.dlang.org/post/zxbexpwmirzdkewhq...@forum.dlang.org Well

Re: D for Game Development

2015-08-08 Thread Rikki Cattermole via Digitalmars-d
On 8/08/2015 8:05 p.m., lobo wrote: On Friday, 7 August 2015 at 04:56:39 UTC, Rikki Cattermole wrote: *whispers* Hey hey you. You want tests? Well here is something you'll like[0]. Oh and check out[1]. [0] http://www.libpng.org/pub/png/pngsuite.html [1]

Re: D for Game Development

2015-08-08 Thread ponce via Digitalmars-d
On Saturday, 8 August 2015 at 08:05:27 UTC, lobo wrote: Sorry I don't mean to sound harsh but that's the reality I'm in right now pushing D on teams in my workplace. It would be much simpler if there were quality (idiomatic) D interfaces to existing quality C/C++ libraries. Have you looked

Re: pthread_create oddity

2015-08-08 Thread Andrei Alexandrescu via Digitalmars-d
On 8/7/15 2:20 PM, Steven Schveighoffer wrote: On 8/7/15 1:36 PM, Andrei Alexandrescu wrote: I ran into an oddity of pthread_create, see https://github.com/D-Programming-Language/druntime/pull/1340. It appears that if stack size is not explicitly set, the 32-bit version of pthread_create fails.

Proposal : mnemonic for start index for slices

2015-08-08 Thread Temtaime via Digitalmars-d
Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[idx + 123 * 10..# + 1]; // # == start index # is for

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Rikki Cattermole via Digitalmars-d
On 9/08/2015 1:08 a.m., Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub = arr[idx + 123 * 10..# +

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Idan Arye via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub =

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread John Colvin via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub =

Re: Visual Studio Code

2015-08-08 Thread Andrei Alexandrescu via Digitalmars-d
On 8/7/15 4:07 PM, bitwise wrote: On Monday, 3 August 2015 at 00:24:56 UTC, bitwise wrote: Just stumbled upon this: https://code.visualstudio.com/ I see support for Rust and Go, but no D. If you download it, there is a little smiley/frowny in the bottom right corner for feedback/feature

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread Shammah Chancellor via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub =

Re: D for Game Development

2015-08-08 Thread karabuta via Digitalmars-d
On Friday, 7 August 2015 at 20:24:54 UTC, jmh530 wrote: On Friday, 7 August 2015 at 17:40:16 UTC, deadalnix wrote: [...] I wouldn't think what you're saying is controversial...just a lot of work to do well. [...] +2000

Re: D for Game Development

2015-08-08 Thread Manu via Digitalmars-d
On 6 August 2015 at 21:46, Rikki Cattermole via Digitalmars-d digitalmars-d@puremagic.com wrote: On 6/08/2015 11:30 p.m., Manu via Digitalmars-d wrote: On 6 August 2015 at 21:23, Rikki Cattermole via Digitalmars-d digitalmars-d@puremagic.com wrote: On 6/08/2015 11:18 p.m., Manu via

Re: Proposal : mnemonic for start index for slices

2015-08-08 Thread ChangLong via Digitalmars-d
On Saturday, 8 August 2015 at 13:08:08 UTC, Temtaime wrote: Hi ! I want to add some sugar to D : sometimes it's necessary to use complex start index. For example: auto sub = arr[idx + 123 * 10..idx + 123 * 10 + 1]; Proposal is to add a mnemonic for start index, for instance : auto sub =

Re: D for Game Development

2015-08-08 Thread Rikki Cattermole via Digitalmars-d
On 9/08/2015 2:40 p.m., Manu via Digitalmars-d wrote: On 6 August 2015 at 21:46, Rikki Cattermole via Digitalmars-d digitalmars-d@puremagic.com wrote: On 6/08/2015 11:30 p.m., Manu via Digitalmars-d wrote: On 6 August 2015 at 21:23, Rikki Cattermole via Digitalmars-d

Re: D for Game Development

2015-08-08 Thread rsw0x via Digitalmars-d
On Sunday, 9 August 2015 at 02:41:00 UTC, Manu wrote: ... This pretty much hit the nail on the head on why dmd needs deprecated. I'm tired of seeing 'BUT IT WORKS ON WINDOWS' as an excuse. I don't care if it works on windows, it produces code slower than interpreted lua. Exactly what use

Re: D for Game Development

2015-08-08 Thread Walter Bright via Digitalmars-d
On 8/8/2015 7:40 PM, Manu via Digitalmars-d wrote: 1. DMD has unsatisfactory codegen for anything other than debug builds. Do you mean the codegen is slower? But consider that the bottleneck in most programs is a small section of code. Taking a good look at the generated code for that and

[Issue 14871] Linker errors with 2.068.0-rc1

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14871 --- Comment #12 from Daniel Kozak kozz...@gmail.com --- Changlog comment is better than nothing --

[Issue 14888] New: std.zlib.uncompress should take const(void)[] instead of void[]

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14888 Issue ID: 14888 Summary: std.zlib.uncompress should take const(void)[] instead of void[] Product: D Version: D2 Hardware: x86_64 OS: Windows Status:

[Issue 14507] Installer doesn't configure VS2010 properly; missing mspdb100.dll

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14507 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de ---

[Issue 14885] ideas for prettier and more useful backtraces

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14885 Adam D. Ruppe destructiona...@gmail.com changed: What|Removed |Added CC|

[Issue 12750] VS2010 profiler doesn't seem to work

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12750 --- Comment #6 from Manu turkey...@gmail.com --- Yup, it's all good. We've recently switched to 2013 at work, and I'm starting to make the change at home too _ --

[Issue 14507] Installer doesn't configure VS2010 properly; missing mspdb100.dll

2015-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14507 --- Comment #2 from Manu turkey...@gmail.com --- At the time I logged this bug, the paths you mention were not present in the executable paths setting (a fresh install). I had to manually add them. The option to override sc.ini does seem to be

Re: Concurrency Confusion

2015-08-08 Thread sigod via Digitalmars-d-learn
On Saturday, 8 August 2015 at 01:24:04 UTC, 岩倉 澪 wrote: On Saturday, 8 August 2015 at 00:39:57 UTC, 岩倉 澪 wrote: receiveTimeout(0.msecs, (immutable Bar[] bar){ baz = cast(Bar[])bar; }); Whoops, that should be: receiveTimeout(0.msecs,

Re: Using std.random.uniform as a range

2015-08-08 Thread drug via Digitalmars-d-learn
08.08.2015 01:34, Ali Çehreli пишет: On 08/07/2015 06:59 AM, drug wrote: What is the best way to create range from uniform() function (in other words create a generator based on some function, returning, say, scalar, not range)? I did http://dpaste.dzfl.pl/53e3d9255cd7 but I'm not sure it's the

Re: Template-Parameterized Variadic isInstaceOf

2015-08-08 Thread Nordlöw
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote: To implement a new trait isSortedRange(R, pred) needed for SortedRange specializations I need a variant of I've put all my progress into https://github.com/D-Programming-Language/phobos/pull/3534

Re: Using std.random.uniform as a range

2015-08-08 Thread via Digitalmars-d-learn
On Friday, 7 August 2015 at 22:34:40 UTC, Ali Çehreli wrote: There is an undocumented (why?) Generator struct and generate() functin in std.range: It's new in 2.068, that's why it's missing in the current docs. It's already in the prerelease docs:

Re: How to run opengl tutorials

2015-08-08 Thread QAston via Digitalmars-d-learn
On Sunday, 2 August 2015 at 10:04:54 UTC, nikolai wrote: Yes, I was so excited about Dlang that i forgot to paste the error: Here's the link to imagescreen http://prntscr.com/7zwe6h Can't help you with your problem, but I have another tip: Shift-right-click inside a dir- open cmd window here

Re: Concurrency Confusion

2015-08-08 Thread Chris via Digitalmars-d-learn
On Saturday, 8 August 2015 at 00:39:57 UTC, 岩倉 澪 wrote: On Friday, 7 August 2015 at 22:13:35 UTC, 岩倉 澪 wrote: message is local to the delegate that receiveTimeout takes. I want to use message outside of the delegate in the receiving thread. However, if you send an immutable value from the

Dynamic array and foreach loop

2015-08-08 Thread Binarydepth via Digitalmars-d-learn
I'm writing a program that rotates numbers then asks the user if a new set of numbers should be rotated. I'm having trouble using a Foreach loop to fill a dynamic array with the elements to be rotated. Here's my code, I add a TAB when a loop is inside a loop and and do that too to the

Re: Dynamic array and foreach loop

2015-08-08 Thread Binarydepth via Digitalmars-d-learn
Here's what happens : How many elements need to be used? 5 Input the element : 1 1 Input the element : 1 2 Input the element : 1 3 Input the element : 1 4 Input the element : 1 5 How many positions do you wish to rotate ? 3 The original patter is : 5 0 0 0 0 The final is : 0 0 0 5 0 Do you want

Re: Dynamic array and foreach loop

2015-08-08 Thread DarthCthulhu via Digitalmars-d-learn
On Saturday, 8 August 2015 at 15:57:15 UTC, Binarydepth wrote: Here's what happens : How many elements need to be used? 5 Input the element : 1 1 Input the element : 1 2 Input the element : 1 3 Input the element : 1 4 Input the element : 1 5 How many positions do you wish to rotate ? 3 The

Re: Dynamic array and foreach loop

2015-08-08 Thread Binarydepth via Digitalmars-d-learn
On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote: You can fix it like the following: foreach(num, element; liaOrig) {//Data input loop writefln(num: %s current element: %s liaOrig.length: %s, num, element, liaOrig.length);

Re: assigning a struct object to an array

2015-08-08 Thread Reflexive via Digitalmars-d-learn
On Friday, 7 August 2015 at 23:01:33 UTC, Ali Çehreli wrote: Thank you very much for the kind words. Which format are you using? It is good to hear that it is acceptable as an ebook, as I've always targetted HTML and then PDF for the print version (which should be purchasable any day

Re: Dynamic array and foreach loop

2015-08-08 Thread Binarydepth via Digitalmars-d-learn
On Saturday, 8 August 2015 at 18:24:48 UTC, Binarydepth wrote: On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote: Now 'num' is just an iterative number starting from 0 (the .init value of an int), while the actual element value is stored in 'element'. I added the writefln()

file rawRead and rawWrite in chunks example

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
I'm playing around with the range based operations and with raw file io. I couldn't figure out a way to get rid of the outer foreach loops. Nice execution time of 537 msec for this, which creates and reads back a file of about 160MB (20_000_000 doubles). import std.algorithm; import

Re: Dynamic array and foreach loop

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
On Saturday, 8 August 2015 at 18:28:25 UTC, Binarydepth wrote: This is the new code : foreach(num; 0..liEle) {//Data input loop write(Input the element : , num+1, ); readf( %d, liaOrig[num]); } Even better : foreach(num; 0..liaOrig.length

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Ali Çehreli via Digitalmars-d-learn
On 08/08/2015 04:11 PM, Jay Norwood wrote: I'm playing around with the range based operations and with raw file io. I couldn't figure out a way to get rid of the outer foreach loops. When the body of the foreach loop performs something, then std.algorithm.each can be useful: import

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: { auto f = File(fn,wb); iota(10.5, 20_000_010.5, 1.0) .chunks(100) .each!(a = f.rawWrite(a.array)); } Ali Thanks. There are many examples of numeric to string data output in the

Specify variable type for range of associative arrays.

2015-08-08 Thread Christopher Davies via Digitalmars-d-learn
I'm just learning D. Something I often do in C# is have an IEnumerable (Range) of some type that is then conditionally filtered. It looks like this: IEnumerableDictionarystring, string foo = bar; if (baz) { foo = foo.Where(d = d[key] == value); } I'm trying to do the same in D. Here's

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: // NOTE: No need to tell rawRead the type as double iota(10, 20_000_000 + 10, n) .each!(a = f.rawRead(dbv)); } Ali Your f.rawRead(dbv) form compiles, but f.rawRead!(dbv) results in an error msg in

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Ali Çehreli via Digitalmars-d-learn
On 08/08/2015 07:07 PM, Jay Norwood wrote: On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: // NOTE: No need to tell rawRead the type as double iota(10, 20_000_000 + 10, n) .each!(a = f.rawRead(dbv)); } Ali Your f.rawRead(dbv) form compiles,