Re: Why my app require MSVCR120.dll?

2015-11-06 Thread Kagamin via Digitalmars-d-learn
MSVCR is a C runtime. On Linux it will depend on a C runtime too.

Re: kxml - parsing AWS API xml respond

2015-10-19 Thread Kagamin via Digitalmars-d-learn
Select parent tags and get data from their child tags like instanceId.

Re: kxml - parsing AWS API xml respond

2015-10-19 Thread Kagamin via Digitalmars-d-learn
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

Re: kxml - parsing AWS API xml respond

2015-10-19 Thread Kagamin via Digitalmars-d-learn
If you don't want parent tag, then: XmlNode[] searchlist2 = newdoc.parseXPath("//launchTime");

Re: Threading Questions

2015-10-08 Thread Kagamin via Digitalmars-d-learn
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();

Re: Tell GC to use shared memory

2015-10-08 Thread Kagamin via Digitalmars-d-learn
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.

Re: Builtin array and AA efficiency questions

2015-10-16 Thread Kagamin via Digitalmars-d-learn
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

Re: Why can't function expecting immutable arg take mutable input?

2015-10-16 Thread Kagamin via Digitalmars-d-learn
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

Re: Why does File.byLine() return char[] and not string

2015-10-16 Thread Kagamin via Digitalmars-d-learn
http://dlang.org/phobos/std_stdio.html#.File.byLineCopy

Re: kxml - parsing AWS API xml respond

2015-10-20 Thread Kagamin via Digitalmars-d-learn
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();

Re: Overloading an imported function

2015-10-21 Thread Kagamin via Digitalmars-d-learn
http://dlang.org/hijack.html

Re: Threading Questions

2015-10-08 Thread Kagamin via Digitalmars-d-learn
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

Re: Threading Questions

2015-10-09 Thread Kagamin via Digitalmars-d-learn
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

Re: Threading Questions

2015-10-07 Thread Kagamin via Digitalmars-d-learn
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,

Re: How to get the current Timezone

2015-08-28 Thread Kagamin via Digitalmars-d-learn
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation ?

Re: multiline string literal with CRLF

2015-08-27 Thread Kagamin via Digitalmars-d-learn
Another option: Hello\r\n~ world;

Re: Status of Win32 C++ interop

2015-09-04 Thread Kagamin via Digitalmars-d-learn
See https://issues.dlang.org/show_bug.cgi?id=13889

Re: Casting away immutability

2015-09-04 Thread Kagamin via Digitalmars-d-learn
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.

Re: Status of Win32 C++ interop

2015-09-04 Thread Kagamin via Digitalmars-d-learn
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

Re: Is D suitable for my latest project?

2015-09-07 Thread Kagamin via Digitalmars-d-learn
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

Re: Abstractioning away main/winMain

2015-09-07 Thread Kagamin via Digitalmars-d-learn
On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote: Any ideas? See how vibe does it.

Re: Are there any Phobos functions to check file permissions on Windows and Posix?

2015-09-07 Thread Kagamin via Digitalmars-d-learn
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

Re: Status of Win32 C++ interop

2015-09-08 Thread Kagamin via Digitalmars-d-learn
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.

Re: Windows Resources

2015-09-06 Thread Kagamin via Digitalmars-d-learn
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.

Re: Interface "indexing"

2015-09-06 Thread Kagamin via Digitalmars-d-learn
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

Re: Interface "indexing"

2015-09-06 Thread Kagamin via Digitalmars-d-learn
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]();

Re: Windows Resources

2015-09-06 Thread Kagamin via Digitalmars-d-learn
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.

Re: Win32 bindings

2015-09-04 Thread Kagamin via Digitalmars-d-learn
https://github.com/etcimon/windows-headers

Re: Casting away immutability

2015-09-04 Thread Kagamin via Digitalmars-d-learn
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

Re: Better unittest failure output

2015-09-07 Thread Kagamin via Digitalmars-d-learn
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:

Re: Is D suitable for my latest project?

2015-09-09 Thread Kagamin via Digitalmars-d-learn
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?

Re: class destruction

2015-09-09 Thread Kagamin via Digitalmars-d-learn
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

Re: C++ Interop -- Two Questions

2015-09-09 Thread Kagamin via Digitalmars-d-learn
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.

Re: C++ Interop -- Two Questions

2015-09-09 Thread Kagamin via Digitalmars-d-learn
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

Re: shared array?

2015-09-13 Thread Kagamin via Digitalmars-d-learn
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

Re: Re-named & Selective Imports

2015-09-16 Thread Kagamin via Digitalmars-d-learn
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.

Re: Why do abstract class functions require definitions?

2015-09-16 Thread Kagamin via Digitalmars-d-learn
declare as abstract void someFunction();

Re: Another, is it a bug?

2015-09-16 Thread Kagamin via Digitalmars-d-learn
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

Re: shared array?

2015-09-11 Thread Kagamin via Digitalmars-d-learn
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

Re: shared array?

2015-09-11 Thread Kagamin via Digitalmars-d-learn
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.

Re: shared array?

2015-09-11 Thread Kagamin via Digitalmars-d-learn
You can try to write a wrapper for the array that it aware of concurrency.

Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Kagamin via Digitalmars-d-learn
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

Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Kagamin via Digitalmars-d-learn
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

Re: Runtime error when calling a callback in a parallel Task

2015-09-17 Thread Kagamin via Digitalmars-d-learn
Maybe compiler generates wrong code, try to debug at instruction level.

Re: Speeding up text file parser (BLAST tabular format)

2015-09-15 Thread Kagamin via Digitalmars-d-learn
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

Re: Do users need to install VS runtime redistributable if linking with Microsoft linker?

2015-09-29 Thread Kagamin via Digitalmars-d-learn
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:

Re: Get template parameter value

2015-09-29 Thread Kagamin via Digitalmars-d-learn
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);

Re: Threading Questions

2015-10-01 Thread Kagamin via Digitalmars-d-learn
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

Re: Tutorial on C++ Integration?

2015-09-28 Thread Kagamin via Digitalmars-d-learn
http://wiki.dlang.org/Vision/2015H1 C++ integration was planned to be available by the end of 2015. May be too optimistic still.

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-18 Thread Kagamin via Digitalmars-d-learn
This compiles with enabled warnings: --- int f() { while(true){} assert(false); } ---

Re: Cameleon: Stricter Alternative Implementation of VariantN

2015-09-22 Thread Kagamin via Digitalmars-d-learn
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

Re: Has anyone created a D wrapper for wbemuuid.lib

2015-09-22 Thread Kagamin via Digitalmars-d-learn
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.

Re: Cameleon: Stricter Alternative Implementation of VariantN

2015-09-22 Thread Kagamin via Digitalmars-d-learn
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?

Re: Bloat with std.(string.)format?

2015-09-18 Thread Kagamin via Digitalmars-d-learn
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.

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-21 Thread Kagamin via Digitalmars-d-learn
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

Re: Real Time-ing

2015-12-08 Thread Kagamin via Digitalmars-d-learn
prev=now; call(); wait(prev+dur-now); call();

Re: Real Time-ing

2015-12-08 Thread Kagamin via Digitalmars-d-learn
Oops, no. next+=dur; wait(next-now); call();

Re: Real Time-ing

2015-12-09 Thread Kagamin via Digitalmars-d-learn
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?

Re: Container Purity

2015-12-09 Thread Kagamin via Digitalmars-d-learn
Allocators usually use global state. Such code is usually treated as impure.

Re: "is not callable using a non-shared object"

2015-12-11 Thread Kagamin via Digitalmars-d-learn
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

Re: Inferring an integer literal as ubyte

2015-12-14 Thread Kagamin via Digitalmars-d-learn
They are promoted to int in arithmetic operations unless compiler can prove the value doesn't exceed its range.

Re: Segfault while compiling simple program

2015-12-16 Thread Kagamin via Digitalmars-d-learn
I use dpaste to test compilation on linux.

Re: Problems with string literals and etc.c.odbc.sql functions

2015-12-19 Thread Kagamin via Digitalmars-d-learn
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

Re: Problems with string literals and etc.c.odbc.sql functions

2015-12-19 Thread Kagamin via Digitalmars-d-learn
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.

Re: Something about Chinese Disorder Code

2015-11-25 Thread Kagamin via Digitalmars-d-learn
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?

Re: Constness understanding

2015-11-30 Thread Kagamin via Digitalmars-d-learn
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.

Re: The best way to store a structure by reference

2015-11-27 Thread Kagamin via Digitalmars-d-learn
I use this http://dpaste.dzfl.pl/b926ff181709 to simulate reference types.

Re: char[] == null

2015-11-19 Thread Kagamin via Digitalmars-d-learn
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];

Re: char[] == null

2015-11-19 Thread Kagamin via Digitalmars-d-learn
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.

Re: D equivalent of Python's try..else

2015-11-22 Thread Kagamin via Digitalmars-d-learn
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`

Re: D equivalent of Python's try..else

2015-11-22 Thread Kagamin via Digitalmars-d-learn
As an idiomatic option there can be `finally(exit)`, `finally(success)` and `finally(failure)` that would mirror semantics of scope guards.

Re: is my code to get CTFE instantiated object valid D ?

2016-05-28 Thread Kagamin via Digitalmars-d-learn
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

Re: Accessing COM Objects

2016-06-14 Thread Kagamin via Digitalmars-d-learn
Visual D has a tool to convert IDL files to D.

Re: Testing array ptr for offset 0...

2016-05-27 Thread Kagamin via Digitalmars-d-learn
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,

Re: Request assistance binding to Windows dsound.{lib, dll}

2016-05-27 Thread Kagamin via Digitalmars-d-learn
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.

Re: Request assistance binding to Windows dsound.{lib, dll}

2016-05-27 Thread Kagamin via Digitalmars-d-learn
https://forum.dlang.org/post/kcr2vn$21i6$1...@digitalmars.com implib can work for extern(C), but is likely to fail even for them.

Re: Alias this member shadowed by imported function identifier?

2016-05-27 Thread Kagamin via Digitalmars-d-learn
Hmm... I wouldn't expect this to work, but still worth to report in bugzilla.

Re: is my code to get CTFE instantiated object valid D ?

2016-05-27 Thread Kagamin via Digitalmars-d-learn
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

Re: Request assistance binding to Windows dsound.{lib, dll}

2016-05-27 Thread Kagamin via Digitalmars-d-learn
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.

Re: Derive interface from class?

2016-06-02 Thread Kagamin via Digitalmars-d-learn
You can see how AutoImplement works for example https://github.com/dlang/phobos/blob/master/std/typecons.d#L3269

Re: Testing array ptr for offset 0...

2016-05-26 Thread Kagamin via Digitalmars-d-learn
try this: struct X { byte[] data; alias data this; }

Re: Calling C++ code with pointer** argument

2016-06-01 Thread Kagamin via Digitalmars-d-learn
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

Re: Different struct sizeof between linux and windows

2016-06-17 Thread Kagamin via Digitalmars-d-learn
time_t is 64-bit on windows: https://msdn.microsoft.com/en-us/library/1f4c8f33.aspx

Re: Different struct sizeof between linux and windows

2016-06-20 Thread Kagamin via Digitalmars-d-learn
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

Re: Different struct sizeof between linux and windows

2016-06-17 Thread Kagamin via Digitalmars-d-learn
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.

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Kagamin via Digitalmars-d-learn
https://dlang.org/phobos/core_thread.html#.Thread.join

Re: Bug or intended?

2016-02-06 Thread Kagamin via Digitalmars-d-learn
I'd say support for this scenario is not implemented yet.

Re: Things that keep D from evolving?

2016-02-06 Thread Kagamin via Digitalmars-d-learn
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

Re: Dynamic Ctors ?

2016-02-08 Thread Kagamin via Digitalmars-d-learn
http://dpaste.dzfl.pl/1f25ac34c1ee You need Tuple, not Algebraic. Algebraic stores only one value of one type from a set, like Variant.

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Kagamin via Digitalmars-d-learn
Yep, munching an Error by default is pretty nasty.

Re: print function

2016-02-04 Thread Kagamin via Digitalmars-d-learn
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

Re: how to allocate class without gc?

2016-01-28 Thread Kagamin via Digitalmars-d-learn
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.

Re: C Macro deeper meaning?

2016-02-01 Thread Kagamin via Digitalmars-d-learn
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.

Re: Access Violation in @safe Code

2016-01-30 Thread Kagamin via Digitalmars-d-learn
Alias templates require stack pointer, init probably has it set to null. Try this: FooType foo = FooType();

Re: Curl HTTP segfault

2016-02-24 Thread Kagamin via Digitalmars-d-learn
http://pastebin.com/JfPtGTD8 ?

Re: Curl HTTP segfault

2016-02-24 Thread Kagamin via Digitalmars-d-learn
Oops, no, looks like you can't put HTTP in a class, because it works with GC and is ref counted.

Re: How to detect if an array if dynamic or static

2016-02-25 Thread Kagamin via Digitalmars-d-learn
void diss(int n)(ref int[n] array) { } But to consume array of any size, just take dynamic array as parameter.

Re: GStreamer and D

2016-02-26 Thread Kagamin via Digitalmars-d-learn
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

Re: `static` symbol needs to be `immutable` for compile-time access?

2016-01-22 Thread Kagamin via Digitalmars-d-learn
Why do you declare mutable constants?

Re: New forum mobile appearance feedback

2016-01-22 Thread Kagamin via Digitalmars-d-learn
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:

<    1   2   3   4   5   6   7   8   9   >