On Wednesday, 12 March 2014 at 03:37:49 UTC, ed wrote:
Thanks for explaining this, it makes sense what you said. But
I'm still not sure why my original Example 1 worked.
~~~
// This works OK and converts long[4] to int[] then implicitly
to int[2][2]
long[4] a=[1,2,3,4];
int[2][2] b = to!(int[
On Wed, Mar 12, 2014 at 02:53:41AM +, David Eagen wrote:
> On Wednesday, 12 March 2014 at 02:46:30 UTC, David Eagen wrote:
> >Is there a way to determine the compiler version at compile time?
> >Something like:
> >
> >static if(DMD_VERSION >= 2.066) {
> > virtual int foo();
> >} else {
> > in
On Wednesday, 12 March 2014 at 02:14:45 UTC, bearophile wrote:
ed:
I am trying to convert a 1D array to a 2D array
If you have a dynamic array (1D), you can convert it to a
dynamic array of dynamic arrays (2D) using chunks:
void main() {
import std.stdio, std.range, std.algorithm;
Thanks! your solution is more robust (minus some caveats i mentioned) and
also trivially extends to variadics.
On Tue, Mar 11, 2014 at 2:07 PM, monarch_dodra wrote:
> On Tuesday, 11 March 2014 at 05:37:25 UTC, Timothee Cour wrote:
>
>> void writelnIfNotEmpty(T)(T a){
>> auto file_pos=get_filepos
On Wednesday, 12 March 2014 at 02:46:30 UTC, David Eagen wrote:
Is there a way to determine the compiler version at compile
time? Something like:
static if(DMD_VERSION >= 2.066) {
virtual int foo();
} else {
int foo();
}
Naturally I found it as soon as I posted
std.compiler : version
Is there a way to determine the compiler version at compile time?
Something like:
static if(DMD_VERSION >= 2.066) {
virtual int foo();
} else {
int foo();
}
ed:
I am trying to convert a 1D array to a 2D array
If you have a dynamic array (1D), you can convert it to a dynamic
array of dynamic arrays (2D) using chunks:
void main() {
import std.stdio, std.range, std.algorithm;
int[] a = [1, 2, 3, 4, 5, 6];
int[][] b = a.chunks(2).arra
Hi All,
I am trying to convert a 1D array to a 2D array using to! and was
wondering if someone could explain to me why this first example
works but the second example does not compile:
Example 1:
~~~
import std.conv;
long[4] a=[1,2,3,4];
int[2][2] b = to!(int[])(a);
assert(b == [[1,2],[3,4]])
On Tuesday, 11 March 2014 at 14:44:51 UTC, Andre Kostur wrote:
Hi, I'm trying a prototype project at work and have been trying
to find a good example of network programming in D. What I'm
trying to do is have a separate thread to deal with the socket
(calls .accept() for example), but I'd also
On Tuesday, 11 March 2014 at 05:37:25 UTC, Timothee Cour wrote:
Thanks,
that indeed works in many cases but there are still others (eg
what if
empty() prints, say in debug mode: writelnIfNotEmpty would not
print the
debug information even though writeln() would execute that
debug code and
pri
On Sunday, 9 March 2014 at 09:06:51 UTC, John Colvin wrote:
std.container isn't great and hasn't received enough attention.
There are plans to improve it, but I believe we're waiting on
std.allocator and possibly a higher level layer on top of it
before any significant revamp is made. It is per
On Tuesday, 11 March 2014 at 05:37:25 UTC, Timothee Cour wrote:
void writelnIfNotEmpty(T)(T a){
auto file_pos=get_filepos(stdin);
write(a);
if(get_filepos(stdin)!=file_pos)
writeln;
}
You could simply create an sink that forwards to stdout, while
keeping state:
//
import std.stdio, std.f
On 2014-03-11 16:12, Paolo Invernizzi wrote:
Hi all,
I'm wondering if it is possible to directly interface with the
objective-c runtime, as I've read [1] and I have some random crashes in
my code right now.
Yes, it's possible since the Objective-C runtime is plain C functions.
You need to sho
Hi all,
I'm wondering if it is possible to directly interface with the
objective-c runtime, as I've read [1] and I have some random
crashes in my code right now.
Someone can share some experience? I'm on 10.9...
Thanks,
Paolo
[1] http://d.puremagic.com/issues/show_bug.cgi?id=9931
Hi, I'm trying a prototype project at work and have been trying
to find a good example of network programming in D. What I'm
trying to do is have a separate thread to deal with the socket
(calls .accept() for example), but I'd also like the thread to be
responsive to the OwnerTerminated messag
On Tue, 11 Mar 2014 05:15:45 -0400, Saurabh Das
wrote:
On Tuesday, 11 March 2014 at 09:10:56 UTC, John Colvin wrote:
Internal compiler errors are always bugs. Please report it here:
https://d.puremagic.com/issues/enter_bug.cgi?product=D
Oh okay. Will surely do that.
(Yay my first bug
On Tuesday, 11 March 2014 at 09:10:56 UTC, John Colvin wrote:
Internal compiler errors are always bugs. Please report it
here: https://d.puremagic.com/issues/enter_bug.cgi?product=D
Oh okay. Will surely do that.
(Yay my first bug report ever!)
On Tuesday, 11 March 2014 at 08:43:11 UTC, Saurabh Das wrote:
Hello,
Consider this simple file 'byLineError.d':
import std.stdio;
void main()
{
auto f = File("test");
f.byLine.popFront();
}
When I compile:
dmd byLineError.d --- succeeds
dmd -inline byLineError.d --- fails with 'Inte
The title should have read "Getting a compiler _error_ with
'-inline'. Is this valid?"
:((
On Tuesday, 11 March 2014 at 08:22:40 UTC, dennis luehring wrote:
->8-
what do you need?
->8-
Well, I should connect to result.mdb database and performs some
queries, i.e.
select * from result order by id
select * from task where result_id=22
...
se
Hello,
Consider this simple file 'byLineError.d':
import std.stdio;
void main()
{
auto f = File("test");
f.byLine.popFront();
}
When I compile:
dmd byLineError.d --- succeeds
dmd -inline byLineError.d --- fails with 'Internal error:
backend/cod2.c 2200'
Using dmd version "DMD64 D
Am 11.03.2014 09:06, schrieb Orfeo:
Thank you for github link, I had tried only with mdbtools on
http://mdbtools.sourceforge.net/...
So, it seems that I can connect using libmdb or odbc ...
so everything is fine? or "I can not"
have you any suggestions?
answer the question
what do you n
On Tuesday, 11 March 2014 at 07:52:33 UTC, dennis luehring wrote:
->8---
what is not enough?
->8---
Thank you for github link, I had tried only with mdbtools on
http://mdbtools.sourceforge.net/...
So, it seems that I can connect using libmdb or odbc ... have you
any suggestions?
I've run across an annoying bug in DMD. Apparently unittests
compiled in a static library are not run in the executable. This
pretty much makes them useless to me since for the project I'm
working on, all business code is in static libraries. The
executable project is only a shell to test the l
Am 11.03.2014 08:37, schrieb Orfeo:
I should extract and process data from Microsoft Access database,
and
mdbtools is not enough.
Is there a library that I can use to query Access?
Thanks
"mdbtools is not enough"
what is not enough?
what "version" of mdbtools do you use
https://github.com/
I should extract and process data from Microsoft Access database,
and
mdbtools is not enough.
Is there a library that I can use to query Access?
Thanks
26 matches
Mail list logo