On Tuesday, 5 April 2016 at 10:30:58 UTC, Suliman wrote:
http://www.symmetricds.org/issues/view.php?id=2439
http://www.postgresql.org/docs/9.5/static/ecpg-sql-set-autocommit.html -
doesn't look deprecated or anything.
On Tuesday, 5 April 2016 at 01:21:55 UTC, Thalamus wrote:
I am invoking an entry point in a D DLL from C# (via extern
(C)), and one of the parameters is a string. This works just
fine for ANSI, but I'm having trouble with the Unicode
equivalent.
When the message parameter is wchar*, wstring i
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
https://issues.dlang.org/show_bug.cgi?id=1983
Bug 1983 is about usage of delegates after creation, restrictions
during creation are enforced. AIU, OP wants to have const check
during creation.
AFAIK when you request a string, whatever value is there gets
converted to string. Or you can just add code to extract blobs,
that would be less effort than writing everything from scratch.
You can also look here
https://github.com/cruisercoder/dstddb/blob/master/src/std/database/odbc/database.d for an example of accessing ODBC from D (only strings are supported so far).
Latest version of what? ODBC bindings are in phobos:
http://dlang.org/phobos/etc_c_odbc_sql.html
Also there's ODBC driver
http://www.firebirdsql.org/en/devel-odbc-driver/ - you can use
it, phobos has ODBC bindings.
Mingw or windows platform SDK.
When a string is not an in parameter, it can't be declared `in
char[]`.
On Tuesday, 15 March 2016 at 17:12:44 UTC, Suliman wrote:
On Tuesday, 15 March 2016 at 15:01:09 UTC, Kagamin wrote:
The same as you would do it in C.
I do not know C :(
Please explain me what i should to do with this binding
C is mostly the same as low-level subset of D: primitive types,
p
The same as you would do it in C.
On Monday, 14 March 2016 at 14:19:27 UTC, stunaep wrote:
I'm on my phone but I think It said something like
Deprecation: module std.stdio not accessible from here. Try
import static std.stdio
That's fix for bug https://issues.dlang.org/show_bug.cgi?id=313
See the code where std.stdio is not ac
Oh, it was
https://github.com/D-Programming-Language/druntime/pull/1472
On Wednesday, 9 March 2016 at 18:35:31 UTC, KlausO wrote:
So maybe they should be declared as "extern GUID ..." because
they also seem to be defined in windows\lib\uuid.lib which
comes with DMD.
Declarations come from mingw and mingw doesn't have uuid.lib:
https://issues.dlang.org/show_bug.cg
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html#section-helloworld
- Hello world.
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html
- GStreamer Application Development Manual
http://docs.gstreamer.com/display/GstSDK/Bas
void diss(int n)(ref int[n] array) { }
But to consume array of any size, just take dynamic array as
parameter.
Oops, no, looks like you can't put HTTP in a class, because it
works with GC and is ref counted.
http://pastebin.com/JfPtGTD8 ?
Currently it crashes:
https://issues.dlang.org/show_bug.cgi?id=1180
On Friday, 19 February 2016 at 05:41:01 UTC, jmh530 wrote:
void main()
{
import std.stdio : writeln;
auto foo_bar = foo(&bar);
writeln(qux(1, 2, foo_bar)); //compiler error
writeln(qux(1, 2, &baz));
}
int bar(int x)
{
return x;
}
int baz(int x,
https://dlang.org/phobos/std_container.html and corresponding
code in phobos. Though recently allocators were introduced and
containers are going to be written with support for allocators.
On Tuesday, 9 February 2016 at 21:03:34 UTC, anonymous wrote:
What's up with that garbled text?
https://issues.dlang.org/show_bug.cgi?id=2742
http://dpaste.dzfl.pl/1f25ac34c1ee
You need Tuple, not Algebraic. Algebraic stores only one value of
one type from a set, like Variant.
On Saturday, 6 February 2016 at 08:07:42 UTC, NX wrote:
What language semantics prevent precise
Lack of resources. Precise GC needs to know which fields are
pointers. Somebody must generate that map. AFAIK there was an
experiment on that.
fast GC
Fast GC needs to be notified about pointe
I'd say support for this scenario is not implemented yet.
Yep, munching an Error by default is pretty nasty.
https://dlang.org/phobos/core_thread.html#.Thread.join
On Thursday, 4 February 2016 at 14:25:21 UTC, bachmeier wrote:
Unfortunately there is no such thing and it is unlikely to
exist in the next decade.
There is http://forum.dlang.org/post/mtsd38$16ub$1...@digitalmars.com
http://dpaste.dzfl.pl/f888feb6f743
On Sunday, 31 January 2016 at 02:58:28 UTC, Andrew Edwards wrote:
void notUsed(T)(T v) { return cast(void)0; };
since it always returns cast(void)0 regardless of the input.
But it cannot be that simple, so what am I missing?
Now notUsed has an unused parameter v.
Alias templates require stack pointer, init probably has it set
to null.
Try this:
FooType foo = FooType();
On Wednesday, 27 January 2016 at 22:39:54 UTC, Igor wrote:
Ultimately I want no GC dependency. Is there an article that
shows how this can be done?
You can link with gcstub
https://github.com/D-Programming-Language/druntime/blob/master/src/gcstub/gc.d it will replace GC completely.
On Tuesday, 26 January 2016 at 21:21:29 UTC, Igor wrote:
That shouldn't be the case. I allocate in a static method
called New once. I then deallocate in the destructor. Basically
just as one would do in C++.
You can't deallocate in destructor in C++, because an object can
be embedded in anoth
Um... A closed-source library is one thing, DLL is another thing,
DLL class library is a third thing, seamless linking of DLL class
library is a fourth thing. Well... see what you can get working.
You can try to write a trusted wrapper for one of curl functions
and ask for a review on forum. Maybe it will be fruitful.
On Friday, 22 January 2016 at 10:12:31 UTC, JR wrote:
(This holds for the normal desktop too, to a certain subjective
extent.)
The feedback thread is
https://forum.dlang.org/post/bmjujolcjxcabshiw...@forum.dlang.org
I find padding and font size ok on desktop:
http://abload.de/img/tmpr1px5.png
Why do you declare mutable constants?
Should be possible. Why not?
On Saturday, 19 December 2015 at 13:20:03 UTC, Marc Schütz wrote:
As this is going to be passed to a C function
No, ODBC API is designed with multilingual capability in mind, it
doesn't rely on null terminated strings heavily: all string
arguments support length specification.
Well, ISO 9075-3 doesn't use const qualifiers, but uses IN/OUT
qualifiers instead, e.g. ExecDirect function is declared as:
ExecDirect (
StatementHandle IN INTEGER,
StatementText IN CHARACTER(L),
TextLength IN INTEGER )
RETURNS SMALLINT
And in C header:
SQLRETURN SQLExecDire
I use dpaste to test compilation on linux.
They are promoted to int in arithmetic operations unless compiler
can prove the value doesn't exceed its range.
On Thursday, 10 December 2015 at 22:07:48 UTC, Entity325 wrote:
Usually the DMD compiler errors are very helpful, but I guess
nothing can be perfect. In this case, I have a class I'm trying
to declare. The class is intended to be a transport and storage
medium, to allow information to be passed
Allocators usually use global state. Such code is usually treated
as impure.
On Tuesday, 8 December 2015 at 16:40:04 UTC, Taylor Hillegeist
wrote:
However i seem to get jitter of around 1 ms. Is there anything
else i can do to improve?
Do you want to get precision better than period of thread
switches?
Oops, no.
next+=dur;
wait(next-now);
call();
prev=now;
call();
wait(prev+dur-now);
call();
Unfortunately in D constant doesn't mean constant :( it means
readonly: you can read it, but it can change in other ways.
Immutable means constant - doesn't change in any way.
I use this http://dpaste.dzfl.pl/b926ff181709 to simulate
reference types.
On Wednesday, 25 November 2015 at 04:09:29 UTC, magicdmer wrote:
fwide(core.stdc.stdio.stdout, 1);
setlocale(0, cast(char*)"china");
auto str = "你好,世界";
writeln(str);
Is it for microsoft runtime or for snn?
As an idiomatic option there can be `finally(exit)`,
`finally(success)` and `finally(failure)` that would mirror
semantics of scope guards.
On Saturday, 21 November 2015 at 13:57:01 UTC, Shriramana Sharma
wrote:
Hmm – I forgot Python has `else` for `for` and `while` too. But
it's a tad difficult to wrap one's mind around the meaning of
the word `else` in this particular context whereas it actually
means `nobreak`.
In a way `for`
On Thursday, 19 November 2015 at 10:04:37 UTC, Spacen Jasset
wrote:
char[] == null
vs
char[] is null
Is there any good use for char[] == null ? If not, a warning
might be helpful.
Actually char[] == null is a more usable one.
On Thursday, 19 November 2015 at 03:53:48 UTC, Meta wrote:
On Wednesday, 18 November 2015 at 23:53:01 UTC, Chris Wright
wrote:
---
char[] buffer;
if (buffer.length == 0) {}
---
This is not true. Consider the following code:
import std.stdio;
void main()
{
int[] a = [0, 1, 2];
On Monday, 16 November 2015 at 14:21:02 UTC, Ola Fosheim Grøstad
wrote:
No, to get a period of 2^19937 you need 19937 bits or 2-3 KiB…
;)
This computes out of context :) but...
On Monday, 16 November 2015 at 10:47:36 UTC, Marc Schütz wrote:
Hmmm... why is `unpredictableSeed` only a `uint`? Surely most
PRNGs have more than 32 bits of internal state?
Maybe it's only worth 32 random bits? There's a rangified example
too:
http://dlang.org/phobos/std_random.html#.Mersenn
On Saturday, 14 November 2015 at 12:14:42 UTC, Handyman wrote:
Of course. That's why I mentioned my purpose of using
Clock.currTime(), in the hope I got corrected in using the
right and offical seed method which I failed to find, which
brings me to another point.
Don't docs provide examples
On Friday, 13 November 2015 at 08:44:33 UTC, Vladimir Panteleev
wrote:
If only Microsoft would have adopted UTF-8 as an 8-bit
locale... if only.
Then you would need to do all TCHAR stuff from windows headers in
order to conditionally compile for utf-8 for say Windows 20 and
for utf-16 for pre
On Thursday, 12 November 2015 at 15:58:53 UTC, Jonathan M Davis
wrote:
It seems pretty wrong for the A versions to be the default
though...
For my money it's a plain bug in bindings :)
Still, even in C++ code, I've generally taken the approach of
using the W functions explicitly in order to a
On Friday, 13 November 2015 at 05:09:12 UTC, Mike Parker wrote:
I've gotten into the same habit. But it appears the switch to
dynamic loading has made it so that only the A versions or only
the W versions are available. You no longer get both.
https://github.com/D-Programming-Language/druntime
Looks like a bug in the compiler.
I wouldn't recommend release mode to paranoids. I personally use
`debug invariant` and `debug assert` for purely debugging code.
On Monday, 9 November 2015 at 19:42:53 UTC, J.Frank wrote:
- Can you flush() a range?
- Can you use select() on a range?
Maybe you should factor out a function that does pure data
processing on arbitrary ranges and manage sources of the ranges -
opening, flushing and closing files - in the c
It was intended for stricter properties. See
http://dlang.org/changelog/2.069.0.html#property-switch-deprecated Last iteration on it was http://wiki.dlang.org/DIP23
MSVCR is a C runtime. On Linux it will depend on a C runtime too.
streamint writebuffer(in ubyte[] buffer);
final streamint writebuffer(T)(in T* buffer, in streamint
count){
return this.writebuffer(cast(ubyte[])buffer[0..count]);
}
On Wednesday, 28 October 2015 at 11:48:27 UTC, pineapple wrote:
There's also a writebuffer method in the interface with this
signature, though:
streamint writebuffer(T)(in T* buffer, in streamint count);
Interface can't have templated virtual instance methods.
You chose quite advanced topic. Maybe you want to build common
skills in system programming first?
On Thursday, 22 October 2015 at 15:10:58 UTC, pineapple wrote:
What does if(isIntegral!T) do? It looks like it would verify
that the template type is a discrete number?
It doesn't verify, but filters: you can have several templates
with the same name, when filter doesn't match, compiler tries
http://dlang.org/hijack.html
You can write a helper:
XmlNode selectSingleNode(XmlNode src, string path)
{
XmlNode[] nodes = src.parseXPath(path);
return nodes.length==0 ? null : nodes[0];
}
Then:
string test1 = node.selectSingleNode(`//instanceId`).getCData();
If you don't want parent tag, then:
XmlNode[] searchlist2 = newdoc.parseXPath("//launchTime");
Select parent tags and get data from their child tags like
instanceId.
On Monday, 19 October 2015 at 04:49:25 UTC, holo wrote:
Why there is needed that "//" before tag?
That's an XPath expression.
How to drop tags from respond? I have such result of parsing by
id tag:
i-xx
I need only value. Is there some equivalent to ".text" from
std.xml?
Try getCDat
On Friday, 16 October 2015 at 10:35:23 UTC, Shriramana Sharma
wrote:
I understand that const can refer to either mutable or
immutable, so does this mean I should replace all occurrences
of `string` in arguments and return values of functions by
`const(char)[]`?
Use `inout` attribute for that:
http://dlang.org/phobos/std_stdio.html#.File.byLineCopy
On Thursday, 15 October 2015 at 21:00:37 UTC, Random D user wrote:
Right. Like a handle system or AA of ValueHandles in this case.
But I'll probably just hack up some custom map and reuse it's
mem. Although, I'm mostly doing this for perf (realloc) and not
mem size, so it might be too much effo
On Friday, 9 October 2015 at 04:04:42 UTC, bitwise wrote:
Ah, I see. I thought you meant illegal meant it won't compile.
Wouldn't it be more correct to say that it's undefined
behaviour?
I's probably not as undefined as in C case, i.e. it doesn't break
safety guarantees, only the application'
On Thursday, 8 October 2015 at 13:44:46 UTC, bitwise wrote:
That still doesn't explain what you mean about it being illegal
in other languages or why you brought up C# in the first place.
Illegal means the resulting program behaves incorrectly,
potentially leading to silent failures and data c
GC is chosen at link time simply to satisfy unresolved symbols.
You only need to compile your modified GC and link with it, it
will be chosen instead of GC from druntime, no need to recompile
anything else.
On Thursday, 8 October 2015 at 02:31:24 UTC, bitwise wrote:
If you have System.Collections.Generic.List(T) static class
member, there is nothing wrong with using it from multiple
threads like this:
The equivalent of your D example would be
class Foo {
static List numbers = new List();
On Sunday, 4 October 2015 at 04:24:55 UTC, bitwise wrote:
I use C#(garbage collected) for making apps/games, and while,
_in_theory_, the GC is supposed to protect you from leaks,
memory is not the only thing that can leak. Threads need to be
stopped, graphics resources need to be released, etc.
On Friday, 25 September 2015 at 15:19:27 UTC, bitwise wrote:
I know that all global variables are TLS unless explicitly
marked as 'shared', but someone once told me something about
'shared' affecting member variables in that accessing them from
a separate thread would return T.init instead of t
On Tuesday, 29 September 2015 at 09:11:15 UTC, John Colvin wrote:
Welcome to the weird and wonderful work of
http://dlang.org/expression.html#IsExpression
No, use template pattern matching instead:
struct A(int s){}
template B(T:A!s, int s){ enum B=s; }
static assert(B!(A!4)==4);
On Monday, 28 September 2015 at 16:36:47 UTC, ponce wrote:
OK, but why does that need to happen? I don't get why does
linking with MS linker implies a runtime dependency.
I thought we would be left out of these sort of problems when
using D :(
About universal CRT:
http://blogs.msdn.com/b/vc
http://wiki.dlang.org/Vision/2015H1 C++ integration was planned
to be available by the end of 2015. May be too optimistic still.
You can generate a union from allowed types, it will make copies
type safe too, sort of set!(staticIndexOf(T,
AllowedTypes))(rhs)... hmm... can it be an overload?
The bindings are translated from mingw headers, and mingw doesn't
supply libraries with precompiled GUIDs, only functions. But
bindings for GUIDs are pretty simple:
extern extern(System) CLSID CLSID_SWbemLocator;
Just copy the names you want.
On Monday, 21 September 2015 at 13:42:14 UTC, Nordlöw wrote:
Questions:
- Is the logic of opAssign and get ok for string?
- How does the inner workings of the GC harmonize with my calls
to `memcpy` in `opAssign()` here
https://github.com/nordlow/justd/blob/master/cameleon.d#L80
That line wo
On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote:
I get:
tym = x1d
Internal error: backend\cgxmm.c 547
Does anyone have a clue what might trigger this?
https://issues.dlang.org/show_bug.cgi?id=7951
https://issues.dlang.org/show_bug.cgi?id=12377
On Saturday, 19 September 2015
This compiles with enabled warnings:
---
int f()
{
while(true){}
assert(false);
}
---
On Thursday, 17 September 2015 at 15:45:10 UTC, Chris wrote:
I suppose it's an area most people (including myself) shy away
from. I know next to nothing about compiler implementation.
Sometimes it's just diagnosis of test failures.
Maybe compiler generates wrong code, try to debug at instruction
level.
On Wednesday, 16 September 2015 at 13:18:51 UTC, Meta wrote:
It's the exact same as in Java, and probably C# as well. I
don't know if there's any OOP language that overloads methods
between the base and super class.
https://ideone.com/En5JEc
https://ideone.com/aIIrKM No, there's nothing like
Well, arguably disjunctive combination doesn't make much sense
here, because renamed import disambiguates it all enough, but
makes it impossible to merge arbitrary namespaces ad hoc, a
feature I missed several times.
declare as
abstract void someFunction();
On Tuesday, 15 September 2015 at 09:19:29 UTC, John Colvin wrote:
It provides you only one char at a time instead of a whole
line. It will be quite constraining for your code if not
mind-bending.
http://dlang.org/phobos/std_string.html#.lineSplitter
File(fileName).byChunk(chunkSize).map!"cast
On Tuesday, 15 September 2015 at 08:53:37 UTC, Fredrik Boulund
wrote:
my favourite for streaming a file:
enum chunkSize = 4096;
File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner()
Is this an efficient way of reading this type of file? What
should one keep in mind when choosing chunk
On Tuesday, 15 September 2015 at 08:51:02 UTC, Fredrik Boulund
wrote:
Using char[] all around might be a good idea, but it doesn't
seem like the string conversions are really that taxing. What
are the arguments for working on char[] arrays rather than
strings?
No, casting to string would be i
On Friday, 11 September 2015 at 17:29:47 UTC, Prudence wrote:
I don't care about "maybe" working. Since the array is hidden
inside a class I can control who and how it is used and deal
with the race conditions.
Looks like destruction slipped out of your control. That is
solved by making array
501 - 600 of 926 matches
Mail list logo