Re: What is PostgreSQL driver is most stable?

2017-03-19 Thread denizzzka via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 08:54:59 UTC, Paolo Invernizzi wrote: I'm curious: ddb does not support yet arbitrary precision numbers [1], does dpq support them? Does Dlang supports them?

Re: .opAssign disabled without @disable

2016-04-17 Thread denizzzka via Digitalmars-d-learn
As Alex Parrill says, on problem was in const member. But this is one of the problems, and after fix here still was an error. But alphaglosined found another problem! For some unknown reason here it is need to specify an empty postblit constructor. Full patch: https://github.com/denizzzka/r

Re: .opAssign disabled without @disable

2016-04-17 Thread denizzzka via Digitalmars-d-learn
On Sunday, 17 April 2016 at 06:42:39 UTC, denizzzka wrote: Tried to build small test app - is not reproduced. Also tried to reduce source: https://github.com/denizzzka/r-tree/tree/314f7f1cc1b6387915dc56dcb2d3ccbc63e19275/source In this source line 199 causes this error (https://github.com

Re: .opAssign disabled without @disable

2016-04-17 Thread denizzzka via Digitalmars-d-learn
Tried to build small test app - is not reproduced.

Re: .opAssign disabled without @disable

2016-04-16 Thread denizzzka via Digitalmars-d-learn
On Saturday, 16 April 2016 at 15:15:18 UTC, Alex Parrill wrote: Try removing the const from this line: debug private const bool isLeafNode = false; I suspect that D is disabling whole-structure assignment since allowing it would mean that the constant `isLeafNode` could be changed. Tried

Re: .opAssign disabled without @disable

2016-04-16 Thread denizzzka via Digitalmars-d-learn
On Saturday, 16 April 2016 at 11:48:56 UTC, denizzzka wrote: source/package.d(109,31): Error: function rtree.RAMNode!(Box!(int, 2), ubyte).RAMNode.opAssign is not callable because it is annotated with @disable source/package.d(110,26): Error: function rtree.RAMNode!(Box!(int, 2), ubyte

.opAssign disabled without @disable

2016-04-16 Thread denizzzka via Digitalmars-d-learn
Hi! DMD and LDC2 complain about disabled opAssign, but I am not used @disable and depend package "gfm" also isn't uses @disable. Steps to reproduce: git clone https://github.com/denizzzka/r-tree.git cd r-tree git checkout 803eed22 dub test Fetching gfm 6.0.0 (getting select

Re: Can't Compile Global Semaphores?

2016-03-21 Thread denizzzka via Digitalmars-d-learn
On Monday, 27 July 2015 at 20:12:10 UTC, John Colvin wrote: Yes, but then core.sync.semaphore doesn't support being shared, so... I don't really understand how https://github.com/D-Programming-Language/druntime/blob/master/src/core/sync/semaphore.d#L356 is managing to avoid this Since

dub dustmite: Initial test fails

2016-02-23 Thread denizzzka via Digitalmars-d-learn
Hi! I have a code with segfault. I decided to try to take advantage with dub dustmite: $ dub dustmite ~/ssd/pgator_dustmite0 --program-status=139 -- --config=my_pgator.conf --debug=true WARNING: A deprecated branch based version specification is used for the dependency vibe-d-postgresql.

Re: Vibe: I found the problem, but don't know how to fix it

2012-11-01 Thread denizzzka
On Thursday, 1 November 2012 at 18:25:22 UTC, Lubos Pintes wrote: Hi, Some time ago I reported on D.Anounce, that Vibe apps are not working on my system, they failed with an exception. So I diagnosed a bit and found the following: There is a folder on my system

How to add n items to TypeTuple?

2012-11-01 Thread denizzzka
For example, adding 3 strings to type tuple t: foreach( i; 0..2 ) alias TypeTuple!( t, string ) t; // this is wrong code and result should be: TypeTuple!( string, string, string );

Re: How to add n items to TypeTuple?

2012-11-01 Thread denizzzka
Great! Thanks!

UTF-8 strings and endianness

2012-10-29 Thread denizzzka
Hi! How to convert D's string to big endian? How to convert to D's string from big endian?

Re: UTF-8 strings and endianness

2012-10-29 Thread denizzzka
On Monday, 29 October 2012 at 15:22:39 UTC, Adam D. Ruppe wrote: UTF-8 isn't affected by endianness. Ok, thanks!

Re: UTF-8 strings and endianness

2012-10-29 Thread denizzzka
On Monday, 29 October 2012 at 15:46:43 UTC, Jordi Sayol wrote: Al 29/10/12 16:17, En/na denizzzka ha escrit: Hi! How to convert D's string to big endian? How to convert to D's string from big endian? UTF-8 is always big emdian. Yes. (I thought that the problem in this place

Re: UTF-8 strings and endianness

2012-10-29 Thread denizzzka
On Monday, 29 October 2012 at 15:46:43 UTC, Jordi Sayol wrote: Al 29/10/12 16:17, En/na denizzzka ha escrit: Hi! How to convert D's string to big endian? How to convert to D's string from big endian? UTF-8 is always big emdian. oops, what? Q: Is the UTF-8 encoding scheme the same

How to place char* of stringZ to ubyte[]?

2012-10-29 Thread denizzzka
immutable ubyte[] valueBin = cast(immutable(ubyte[])) toStringz(s); // s is string type Error: e2ir: cannot cast toStringz(s) of type immutable(char)* to type immutable(ubyte[])

Re: How to place char* of stringZ to ubyte[]?

2012-10-29 Thread denizzzka
On Monday, 29 October 2012 at 17:51:56 UTC, bearophile wrote: denizzzka: immutable ubyte[] valueBin = cast(immutable(ubyte[])) toStringz(s); // s is string type Error: e2ir: cannot cast toStringz(s) of type immutable(char)* to type immutable(ubyte[]) One way to do it: import std.stdio

Re: How to place char* of stringZ to ubyte[]?

2012-10-29 Thread denizzzka
On Monday, 29 October 2012 at 18:50:58 UTC, bearophile wrote: denizzzka: I am trying to send to remote host utf8 text with zero byte at end (required by protocol) What if your UTF8 string coming from D already contains several zeros? Incredible situation because it is text-based protocol

How to start new command with arguments, pass data to its stdin read its output?

2012-10-23 Thread denizzzka
Something like execv() but with stdin/stdout?

Re: How to start new command with arguments, pass data to its stdin read its output?

2012-10-23 Thread denizzzka
On Tuesday, 23 October 2012 at 11:34:35 UTC, denizzzka wrote: Something like execv() but with stdin/stdout? Something like popen(), not execv().

Re: How to start new command with arguments, pass data to its stdin read its output?

2012-10-23 Thread denizzzka
On Tuesday, 23 October 2012 at 12:19:08 UTC, Adam D. Ruppe wrote: On Tuesday, 23 October 2012 at 11:34:35 UTC, denizzzka wrote: Something like execv() but with stdin/stdout? If you're on linux i have a little file that might help: http://arsdnet.net/dcode/exec.d int exec( string program

synchronization + nothrow

2012-10-20 Thread denizzzka
How I can synchronize changing of array in the functions with nothrow? Handmade spinlock or something better?

how to create a local copy of shared pointer?

2012-10-15 Thread denizzzka
void main() { struct S { int payload; } S* s = new shared (S); // Why this is a illegal? } Error: cannot implicitly convert expression (new shared(S)) of type shared(S)* to S*

Re: how to create a local copy of shared pointer?

2012-10-15 Thread denizzzka
On Monday, 15 October 2012 at 15:27:03 UTC, thedeemon wrote: On Monday, 15 October 2012 at 15:15:57 UTC, denizzzka wrote: S* s = new shared (S); // Why this is a illegal? Error: cannot implicitly convert expression (new shared(S)) of type shared(S)* to S* Because shared(S) and S

Re: how to create a local copy of shared pointer?

2012-10-15 Thread denizzzka
Thanks!

Re: Is there a thread safe single linked list?

2012-10-13 Thread denizzzka
On Friday, 12 October 2012 at 23:30:39 UTC, Sean Kelly wrote: I would be grateful if someone share singly linked list based on cas() There's a sample Stack and SList implementation in the concurrency chapter: http://www.informit.com/articles/printerfriendly.aspx?p=1609144 Of course, I

Re: Is there a thread safe single linked list?

2012-10-13 Thread denizzzka
Not that the titanic but the authors, probably, have used Java and another type of cas result returns.

Re: Is there a thread safe single linked list?

2012-10-12 Thread denizzzka
or dynamic array with this methods

Re: Is there a thread safe single linked list?

2012-10-12 Thread denizzzka
Thanks for answer! After investigation came to the conclusion that here is needed not synchronized-based solution. I am need compare-and-swap single linked list because it will be used in callback proc from C, and it cannot be throwable, but synchronized contains throwable _d_monitorenter

Re: Is there a thread safe single linked list?

2012-10-12 Thread denizzzka
I would be grateful if someone share singly linked list based on cas() Ok, this is a good opportunity to learn how to write such by oneself :-)

Best way to store postgresql's numeric type in D?

2012-10-10 Thread denizzzka
It is up to 131072 digits before the decimal point; up to 16383 digits after the decimal point.

Re: version(debug)

2012-10-07 Thread denizzzka
On Sunday, 7 October 2012 at 01:20:49 UTC, Jonathan M Davis wrote: On Saturday, October 06, 2012 23:49:23 denizzzka wrote: I am on dmd 2.060 debug {} else {} was not obvious for me - I thought that debug is a kind of qualifer. I wouldn't expect you to try either version(debug) or debug

How to create immutable struct?

2012-10-06 Thread denizzzka
I am have struct with constructor: immutable struct Cell { ... } And I trying to create instance of this struct: immutable (Cell)* s = new Cell( v, s); compiler returns error: Error: cannot implicitly convert expression (new Cell(v,s)) of type Cell* to immutable(Cell)* How to pass

Re: How to create immutable struct?

2012-10-06 Thread denizzzka
I should just create immutable constructor :-)

version(debug)

2012-10-06 Thread denizzzka
Why version(assert){ int i = 1; } else { int k = 1; } causes error: Error: identifier or integer expected, not assert ? This is bug or feature? http://dlang.org/version.html says what it is correct code, because assert in the list of Predefined Version Identifiers How I can solve this

Re: version(debug)

2012-10-06 Thread denizzzka
huh, text should be from upper letter: Assert, Debug

Re: version(debug)

2012-10-06 Thread denizzzka
On Saturday, 6 October 2012 at 19:16:26 UTC, Jonathan M Davis wrote: On Saturday, October 06, 2012 20:42:01 Alex Rønne Petersen wrote: version (assert) is a very recent addition to the compiler and is not in 2.060. Which would probably explain why it's not working for him, since presumably,

Re: connect to an SQL Server database

2012-10-06 Thread denizzzka
On Saturday, 6 October 2012 at 12:35:05 UTC, Minas wrote: Is there a library that I can use to connect to an SQL Server database? (I need to use it on both linux and windows). I am write one for PostgreSQL right now: https://github.com/denizzzka/dpq2

Re: connect to an SQL Server database

2012-10-06 Thread denizzzka
On Saturday, 6 October 2012 at 22:08:48 UTC, denizzzka wrote: On Saturday, 6 October 2012 at 12:35:05 UTC, Minas wrote: Is there a library that I can use to connect to an SQL Server database? (I need to use it on both linux and windows). I am write one for PostgreSQL right now: Ops

How to create library with exported functions

2012-10-05 Thread denizzzka
Hi! I am make a yet another attempt to create an interface to PostgreSQL from the D: https://github.com/denizzzka/dpq2 I can not understand how do I compile it into a library and create .di headers file. Currently, make debug uses dmd -lib and creates libpq.di file, but its file contains

Re: How to create library with exported functions

2012-10-05 Thread denizzzka
(sorry for my English) Hi! I am make a yet another attempt to create an interface to PostgreSQL from the D: https://github.com/denizzzka/dpq2 I can not understand how do a compile it into a library and create .di headers file. Currently, make debug uses dmd -lib and creates libpq.di file

Re: How to create library with exported functions

2012-10-05 Thread denizzzka
I tried to add: export { /* module code except imports*/} but nothing has changed.

Re: How to create library with exported functions

2012-10-05 Thread denizzzka
solved! problem was in -Hf compiler switch