On Wednesday, 17 January 2018 at 13:36:26 UTC, Marc wrote:
I was looking for a library to use SQLite with D, found this
(https://code.dlang.org/packages/sqlite-d) but it has no
documentation or code example. I looked into files in the
source code and wrote this:
Database db =
On Friday, 21 April 2017 at 09:42:33 UTC, ketmar wrote:
Martin Tschierschke wrote:
Is it possible to define an alias for something like
mixin(import("local_function_file.d"));
to write only
use_local_function;
which will be translated to:
mixin(import("local_function_file.d"));
On Sunday, 19 February 2017 at 07:52:13 UTC, Max Samukha wrote:
class A {
this(T = this)() {
static assert(is(T == B));
}
}
class B {
}
auto b = new B;
Here, T becomes A, which may be reasonable but is completely
useless. Is there a way to obtain the type of the class (or
On Saturday, 18 February 2017 at 19:05:14 UTC, Jean Cesar wrote:
This is exactly what I want this code I did to understand how
would apply multiple inheritance in D, C # also process using
interfaces but the difference from C # to D is that C # already
in the base class you have to define it
On Saturday, 18 February 2017 at 12:56:51 UTC, wiki wrote:
On Saturday, 18 February 2017 at 09:33:25 UTC, biozic wrote:
A mixin can be used to provide an base implementation for the
methods of an interface, along with data members, so that you
don't have to define it in every class that
On Friday, 17 February 2017 at 23:35:33 UTC, Jean Cesar wrote:
On Friday, 17 February 2017 at 23:31:41 UTC, Adam D. Ruppe
wrote:
On Friday, 17 February 2017 at 23:11:25 UTC, Jean Cesar wrote:
so I changed the code to use interface but how would I do so
I could use the constructor in the same
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo wrote:
void foreach_loop()
{
foreach(n, elem; d[])
elem = a[n] * b[n] / c[n];
}
It's fast because the result of the operation (elem) is discarded
on each iteration, so it is probably optimized away.
On Monday, 30 January 2017 at 17:25:13 UTC, Nestor wrote:
On Monday, 30 January 2017 at 16:40:47 UTC, biozic wrote:
As an alternative, you could build an object file from
Sqlite's source code (e.g. the amalgamation file from Sqlite's
website) with a C compiler. Then you just build your D
On Monday, 30 January 2017 at 16:40:47 UTC, biozic wrote:
You could also try https://code.dlang.org/packages/d2sqlite3
with option "--all-included". This wasn't tested much though.
Sorry, this uses a dll on Windows.
On Monday, 30 January 2017 at 13:00:15 UTC, Nestor wrote:
Hi,
In Windows, is it possible embed a dll library into an
application (in this particular case, sqlite3.dll)? Notice I
don't mean storing the resource in the application to extract
it at runtime, but rather to produce a static
On Sunday, 15 January 2017 at 14:20:04 UTC, Nestor wrote:
On Sunday, 15 January 2017 at 14:04:39 UTC, Nestor wrote:
...
For example, take a baby born in february 29 of year 2000
(leap year). In february 28 of 2001 that baby was one day
short to one year.
Family can make a concession and
On Sunday, 15 January 2017 at 08:40:37 UTC, Nestor wrote:
I cleaned up the function a little, but it still feels like a
hack:
uint getAge(uint , uint mm, uint dd) {
import std.datetime;
SysTime t = Clock.currTime;
ubyte correction = 0;
if(
(t.month < mm) ||
( (t.month ==
On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote:
How do I separate IP parts with dlang?
I found this very cool trick, with C++:
http://stackoverflow.com/a/5328190
std::string ip ="192.168.1.54";
std::stringstream s(ip);
int a,b,c,d; //to store the 4 ints
char ch; //to
On Tuesday, 2 February 2016 at 22:56:28 UTC, jmh530 wrote:
I'm working on generating a binding to a C library. I've got
the .h file converted and can call some parts of the library
with no errors. However, I have reached a stumbling block in a
critical part.
The library requires passing
On Monday, 25 January 2016 at 06:37:13 UTC, Enjoys Math wrote:
class V(T) {
public:
this() {}
V opIndex(size_t i, size_t j) {
writeln("Hello, foo!");
return this;
}
}
main() {
auto v = new V!int();
auto u = v[3..4];// ERROR
}
Error:
no [] operator overload for
On Sunday, 17 January 2016 at 14:43:26 UTC, Borislav Kosharov
wrote:
Seeing that TickDuration is being deprecated and that I should
use Duration instead, I faced a problem. I need to get total
seconds like a float. Using .total!"seconds" returns a long and
if the duration is less than 1 second
On Sunday, 21 June 2015 at 09:34:51 UTC, kerdemdemir wrote:
Hi,
I need to find the index of maximum element so my code:
int indexOfMax(R)(R range)
{
alias Type = typeof(range.front().re); I don't like
.re here
Type max = 0;
size_t maxIndex = 0;
foreach (
On Sunday, 3 May 2015 at 09:28:40 UTC, Dennis Ritchie wrote:
On Sunday, 3 May 2015 at 09:04:07 UTC, tired_eyes wrote:
On Sunday, 3 May 2015 at 08:48:52 UTC, Dennis Ritchie wrote:
On Sunday, 3 May 2015 at 08:42:57 UTC, tired_eyes wrote:
Feels pretty silly, but I can't compile this:
import
On Friday, 1 May 2015 at 10:12:36 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:04:46 UTC, Namespace wrote:
How about this:
struct A {
int x = 42;
}
struct B {
int x = 7;
}
T factory(T)() {
return T();
}
void main()
{
auto a = factory!(A);
}
That's what I was looking for, I
On Friday, 1 May 2015 at 11:01:29 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:47:22 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:46:20 UTC, Chris wrote:
On Friday, 1 May 2015 at 10:27:16 UTC, biozic wrote:
On Friday, 1 May 2015 at 10:12:36 UTC, Chris wrote:
On Friday, 1 May 2015 at
On Friday, 1 May 2015 at 11:20:32 UTC, Chris wrote:
On Friday, 1 May 2015 at 11:11:28 UTC, biozic wrote:
On Friday, 1 May 2015 at 11:01:29 UTC, Chris wrote:
Thinking about it,
T factory(T)() {
return T();
}
is better suited for a factory (with static type checks).
But then I don't know
On Thursday, 23 April 2015 at 10:26:09 UTC, rumbu wrote:
On Thursday, 23 April 2015 at 10:06:45 UTC, John Colvin wrote:
On Thursday, 23 April 2015 at 09:48:21 UTC, Dennis Ritchie
wrote:
Hi,
Why the program can not return different types of data from
the conditional operator?
-
import
On Saturday, 18 April 2015 at 08:08:41 UTC, nrgyzer wrote:
Hi,
I've the following source:
import std.array : split;
import std.stdio : writeln;
void main()
{
string myString = Hello World;
string[] splitted = myString.split( );
}
But when I compile the code above, I'm getting the
On Sunday, 12 April 2015 at 21:34:21 UTC, H. S. Teoh wrote:
On Sun, Apr 12, 2015 at 02:33:03PM +, ketmar via
Digitalmars-d-learn wrote:
On Sun, 12 Apr 2015 14:18:21 +, JR wrote:
But the compiler has all the pieces of information needed to
see
it's wrong, doesn't it?
no, it
The code below doesn't compile. Why this error message?
---
struct Item {
int i;
}
struct Params {
Item* item;
this(int i) {
item = new Item(i); // line 9
}
}
struct Foo(Params params) {}
enum foo = Foo!(Params(1));
---
test.d(9): Error: Item(1) is not an lvalue
25 matches
Mail list logo