MSVCR is a C runtime. On Linux it will depend on a C runtime too.
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
If you don't want parent tag, then:
XmlNode[] searchlist2 = newdoc.parseXPath("//launchTime");
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();
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, 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
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
http://dlang.org/phobos/std_stdio.html#.File.byLineCopy
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();
http://dlang.org/hijack.html
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
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
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,
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation ?
Another option:
Hello\r\n~
world;
See https://issues.dlang.org/show_bug.cgi?id=13889
On Friday, 4 September 2015 at 09:05:07 UTC, Marc Schütz wrote:
Note that you can however achieve immutability by using a
_private_ read-only mapping.
man pages say the behavior is unspecified.
On Friday, 4 September 2015 at 15:43:44 UTC, Szymon Gatner wrote:
but now using phobos64.lib from 2.068 distribution does not
even link properly with VC2015.
That's https://issues.dlang.org/show_bug.cgi?id=14849
On Sunday, 6 September 2015 at 15:15:03 UTC, chris stevens wrote:
I guess you're right it wouldn't be too difficult to do it all
using strings. The code generation I'd done before in c# I'd
used some 3rd person library where you build up an object model
rather than using strings.
Maybe with
On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote:
Any ideas?
See how vibe does it.
On Sunday, 6 September 2015 at 20:40:04 UTC, Gary Willoughby
wrote:
Are there any Phobos functions to check file permissions on
Windows and Posix? For example, I want to check if a file is
readable and/or writable in a cross-platform fashion. Does
anyone have an example?
Call fopen and check
On Tuesday, 8 September 2015 at 12:56:00 UTC, Laeeth Isharc wrote:
How does it work when external APIs expect objects from the C++
standard library? strings, and so on? How about funny pointer
types? shared_ptr etc? std::vector, std::list?
No, in current state nothing smart is supported.
On Sunday, 6 September 2015 at 02:37:21 UTC, Prudence wrote:
Obviously the issue is that I'm not using any resources yet it
is giving me such an error.
You do. See docs for lpszMenuName field. GUI projects generated
by Visual Studio include resource generation, that's why it works
for them.
On Sunday, 6 September 2015 at 17:32:11 UTC, Prudence wrote:
And to fire the event, instead of a huge switch(or essentially
the same), one can write one line of code or so and have D take
care of matching up things. (essentially for some enum value I
want a corresponding type to be associated
Well, you can have an array of event factories:
IEvent function()[2] factories = [ factory1, factory2 ];
IEvent factory1() { return new Event1(); }
IEvent factory2() { return new Event2(); }
Then use enum for indexing:
IEvent e = factories[NumEvent1]();
On Sunday, 6 September 2015 at 15:42:52 UTC, Prudence wrote:
So how does one actually include resources such as menu's (rc
files and all that) in a D project? Or am I stuff creating all
that stuff programmatically?
Just like in a C project: write, compile and link them.
https://github.com/etcimon/windows-headers
On Wednesday, 2 September 2015 at 04:04:54 UTC, Sergei Degtiarev
wrote:
I seems a little bit too easy to to shoot yourself in the foot.
Yes, cast is a little not fool-proof in this scenario.
On Thursday, 3 September 2015 at 13:28:54 UTC, Sergei Degtiarev
wrote:
Agree, however, memory
On Monday, 7 September 2015 at 12:16:14 UTC, anonymous wrote:
On Monday 07 September 2015 14:12, Bahman Movaqar wrote:
Thanks. This is indeed helpful. OT but where can I view the
documentation for `unittest` and `assert`?
unittest: http://dlang.org/unittest.html
assert:
On Tuesday, 8 September 2015 at 20:01:15 UTC, chris stevens wrote:
Thanks for the reply Kagamin, just had a quick look at dparse
and not sure how I could use it in the way you describe. Any
examples of this?
As I understand, you wanted to build an AST tree and format it to
string?
On Wednesday, 9 September 2015 at 07:19:58 UTC, Q wrote:
Besides, we live in 2015 and that is not C where I have to
clean my code manually, so this option would be ridiculous :D
The difference is that in C you need to manage POD memory too.
Manual management of non-POD resources is a problem
Static functions are declared with `static` storage class. This
looks so basic, it's even not documented in language spec, lol.
In D classes are reference types by default.
On Wednesday, 9 September 2015 at 13:17:53 UTC, Mike Parker wrote:
Yes, I get that. But how does that work when you're linking to
a C++ library and the translation of the C++ class to D is an
interface? Or is it possible now to link D classes directly
with C classes?
Classes and templates
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
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 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
On Friday, 11 September 2015 at 14:54:00 UTC, Prudence wrote:
But in this case it is static, so why does it matter? Do you
have any ideas how to wrap it or fix this?
It matters exactly because it is static. A code written for
single-threaded environment may not work correctly in shared
I get only one error:
Error: non-shared method std.container.array.Array!(void
delegate()).Array.~this is not callable using a shared object.
It will try to destruct the array on program termination, but it
requires the destructor to be aware of the shared context.
You can try to write a wrapper for the array that it aware of
concurrency.
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
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
Maybe compiler generates wrong code, try to debug at instruction
level.
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
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:
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 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
http://wiki.dlang.org/Vision/2015H1 C++ integration was planned
to be available by the end of 2015. May be too optimistic still.
This compiles with enabled warnings:
---
int f()
{
while(true){}
assert(false);
}
---
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
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.
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?
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.
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
prev=now;
call();
wait(prev+dur-now);
call();
Oops, no.
next+=dur;
wait(next-now);
call();
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?
Allocators usually use global state. Such code is usually treated
as impure.
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
They are promoted to int in arithmetic operations unless compiler
can prove the value doesn't exceed its range.
I use dpaste to test compilation on linux.
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
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.
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?
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 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 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 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`
As an idiomatic option there can be `finally(exit)`,
`finally(success)` and `finally(failure)` that would mirror
semantics of scope guards.
On Saturday, 28 May 2016 at 05:30:26 UTC, chmike wrote:
Would it be different if the object was declared const instead
of immutable ?
Sometimes compiler is able to figure out that const data is
immutable.
This is a bit frustrating because it is trivial to implement in
C and C++.
For a
Visual D has a tool to convert IDL files to D.
On Thursday, 26 May 2016 at 21:13:14 UTC, Era Scarecrow wrote:
To do what I want currently it's something like...
enum Size = 1024, Other = 128;
Data[Size][Other] staticarray; //stack allocation
Data[][] sliced = staticarray[];
scan(sliced, condition);
void scan(ref Data[][] data,
Another possibility is to use -m32mscoff switch
https://dlang.org/dmd-windows.html#switch-m32mscoff and use ms
toolchain for linking with PSDK import libraries.
https://forum.dlang.org/post/kcr2vn$21i6$1...@digitalmars.com
implib can work for extern(C), but is likely to fail even for
them.
Hmm... I wouldn't expect this to work, but still worth to report
in bugzilla.
On Friday, 27 May 2016 at 20:20:36 UTC, chmike wrote:
Is this code valid D or is the behavior undefined due to the
cast ?
A mutable object can be synchronized on:
synchronized(Category.instance){}
This will create and store a mutex in the object (sad but true,
design taken from java). If the
On Friday, 27 May 2016 at 15:28:42 UTC, Andrew Edwards wrote:
Have you tried with extern(C) yet?
extern(C) is for undecorated symbold
extern(Windows) adds the _ and @12 decorations (would be
__stdcall on C/C++ side)
The thought never crossed my mind. Tried it and it works like a
charm.
You can see how AutoImplement works for example
https://github.com/dlang/phobos/blob/master/std/typecons.d#L3269
try this:
struct X
{
byte[] data;
alias data this;
}
On Wednesday, 1 June 2016 at 07:29:56 UTC, abad wrote:
That does work, though I have to explicitly cast it in my
caller as well.
Like this:
doesNotLink(cast(const(char)**)baz2);
It's a bit troublesome as my code will include quite a lot of
calls like this.
Casting is not necessary with the
time_t is 64-bit on windows:
https://msdn.microsoft.com/en-us/library/1f4c8f33.aspx
On Friday, 17 June 2016 at 16:25:15 UTC, Vladimir Panteleev wrote:
If I were to import the time() function from MSVCR*.dll, what
size its return value would be?
MSVC runtime dll doesn't export `time` function, it exports
_time32 and _time64. `time` is a wrapper in the import library,
its
On Friday, 17 June 2016 at 13:21:04 UTC, Vladimir Panteleev wrote:
Windows does not have the concept of "time_t". The C runtime in
use does.
The D bindings don't copy that behavior.
D defining C runtime type different from C runtime causes this
error.
https://dlang.org/phobos/core_thread.html#.Thread.join
I'd say support for this scenario is not implemented yet.
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
http://dpaste.dzfl.pl/1f25ac34c1ee
You need Tuple, not Algebraic. Algebraic stores only one value of
one type from a set, like Variant.
Yep, munching an Error by default is pretty nasty.
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
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 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();
http://pastebin.com/JfPtGTD8 ?
Oops, no, looks like you can't put HTTP in a class, because it
works with GC and is ref counted.
void diss(int n)(ref int[n] array) { }
But to consume array of any size, just take dynamic array as
parameter.
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
Why do you declare mutable constants?
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:
301 - 400 of 899 matches
Mail list logo