Re: PostgreSQL. Unknown parameter of configuration : "autocommit"

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

Re: Convert wchar* to wstring?

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

Re: Read only delegate

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

Re: Is there anybody who used FireBird DB?

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

Re: Is there anybody who used FireBird DB?

2016-03-30 Thread Kagamin via Digitalmars-d-learn
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).

Re: Is there anybody who used FireBird DB?

2016-03-30 Thread Kagamin via Digitalmars-d-learn
Latest version of what? ODBC bindings are in phobos: http://dlang.org/phobos/etc_c_odbc_sql.html

Re: Is there anybody who used FireBird DB?

2016-03-30 Thread Kagamin via Digitalmars-d-learn
Also there's ODBC driver http://www.firebirdsql.org/en/devel-odbc-driver/ - you can use it, phobos has ODBC bindings.

Re: Is there anybody who used FireBird DB?

2016-03-30 Thread Kagamin via Digitalmars-d-learn
Mingw or windows platform SDK.

Re: string and char[] in Phobos

2016-03-19 Thread Kagamin via Digitalmars-d-learn
When a string is not an in parameter, it can't be declared `in char[]`.

Re: Is there anybody who used FireBird DB?

2016-03-16 Thread Kagamin via Digitalmars-d-learn
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

Re: Is there anybody who used FireBird DB?

2016-03-15 Thread Kagamin via Digitalmars-d-learn
The same as you would do it in C.

Re: std.stdio.File.seek error

2016-03-14 Thread Kagamin via Digitalmars-d-learn
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

Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
Oh, it was https://github.com/D-Programming-Language/druntime/pull/1472

Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
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

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 http://docs.gstreamer.com/display/GstSDK/Bas

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: 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: Curl HTTP segfault

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

Re: What happens if memory allocation fails?

2016-02-20 Thread Kagamin via Digitalmars-d-learn
Currently it crashes: https://issues.dlang.org/show_bug.cgi?id=1180

Re: Modify Function Pointer to Take Additional Parameters

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

Re: Example of code with manual memory management

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

Re: why mkdir can't create tree of dirs?

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

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: 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 pointe

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: 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: 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: 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 would you implement this in D? (signals & slots)

2016-02-02 Thread Kagamin via Digitalmars-d-learn
http://dpaste.dzfl.pl/f888feb6f743

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: 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: free causes exception

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

Re: D Dll's usefulness

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

Re: Is memory-safe IO possible?

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

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: http://abload.de/img/tmpr1px5.png

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: Is memory-safe IO possible?

2016-01-22 Thread Kagamin via Digitalmars-d-learn
Should be possible. Why not?

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: 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 SQLExecDire

Re: Segfault while compiling simple program

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

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: "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 passed

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: 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: 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-08 Thread Kagamin via Digitalmars-d-learn
prev=now; call(); wait(prev+dur-now); call();

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: 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: 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: 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: 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: 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: Epoch time + msecs

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

Re: Epoch time + msecs

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

Re: Epoch time + msecs

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

Re: win32 from master: unicode functions by default?

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

Re: win32 from master: unicode functions by default?

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

Re: win32 from master: unicode functions by default?

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

Re: How to fix "Error symbol '.....' is already defined"

2015-11-12 Thread Kagamin via Digitalmars-d-learn
Looks like a bug in the compiler.

Re: Feature for paranoids

2015-11-10 Thread Kagamin via Digitalmars-d-learn
I wouldn't recommend release mode to paranoids. I personally use `debug invariant` and `debug assert` for purely debugging code.

Re: phobos: What type to use instead of File when doing I/O on streams?

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

Re: @property

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

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: I'm getting an unhelpful linker error, what've I got wrong?

2015-10-28 Thread Kagamin via Digitalmars-d-learn
streamint writebuffer(in ubyte[] buffer); final streamint writebuffer(T)(in T* buffer, in streamint count){ return this.writebuffer(cast(ubyte[])buffer[0..count]); }

Re: I'm getting an unhelpful linker error, what've I got wrong?

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

Re: asm+D build bootloader

2015-10-27 Thread Kagamin via Digitalmars-d-learn
You chose quite advanced topic. Maybe you want to build common skills in system programming first?

Re: Allowing arbitrary types for a function's argument and return type

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

Re: Overloading an imported function

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

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: 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: 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 getCDat

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 that:

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: 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 effo

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 application'

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 c

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: 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: 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, etc.

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 t

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: 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: http://blogs.msdn.com/b/vc

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: 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: 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
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

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 2015

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: 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: 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: 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 like

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: 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 File(fileName).byChunk(chunkSize).map!"cast

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 chunk

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 i

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 array

<    1   2   3   4   5   6   7   8   9   10   >