How compile program with curl support?

2013-08-22 Thread ilya-stromberg
I try to compile program with curl support, but I have error: import std.net.curl; void main() { } rdmd main.d /usr/lib/x86_64-linux-gnu/libphobos2.a(curl.o): In function `_D3std3net4curl4Curl19_sharedStaticCtor34FZv': std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticCtor34FZv+0xf): u

Re: How compile program with curl support?

2013-08-22 Thread ilya-stromberg
On Thursday, 22 August 2013 at 10:24:49 UTC, David wrote: What should I do to get curl support? OS is Linux Ubuntu 12.10. Install libcurl-dev http://packages.ubuntu.com/de/lucid/libcurl-dev Add "-L-lcurl" to your commandline Thanks for help. Correct answer was here: http://forum.dlang.org/po

Re: How compile program with curl support?

2013-08-22 Thread ilya-stromberg
On Thursday, 22 August 2013 at 13:20:44 UTC, evilrat wrote: why do u link phobos when compiler do this for you? Because without it doesn't work: $ dmd -L-lcurl main.d /usr/lib/x86_64-linux-gnu/libphobos2.a(curl.o): In function `_D3std3net4curl4Curl19_sharedStaticCtor34FZv': std/net/curl.d:(.t

Re: How compile program with curl support?

2013-08-24 Thread ilya-stromberg
On Thursday, 22 August 2013 at 16:28:32 UTC, David wrote: Can't reproduce this: ─[dav1d@archbox][/tmp]╼ cat c.d import std.net.curl; void main() {} ─[dav1d@archbox][/tmp]╼ dmd c.d -L-lcurl ─[dav1d@archbox][/tmp]╼ So I only get these errors when *not* linking against curl. It looks like regre

Support implicit conversion between types

2013-09-04 Thread ilya-stromberg
I have some code like this: struct Foo { this(int i) { //do something useful } } void bar(Foo f) { //do something else } void main() { Foo f = 5;//works bar(f);//works bar(Foo(5));//works bar(5);

Re: Support implicit conversion between types

2013-09-04 Thread ilya-stromberg
On Wednesday, 4 September 2013 at 19:44:17 UTC, Namespace wrote: What's about: void bar(int i) { bar(Foo(i)); } ? No, I wrote very simple example. I have 10 "from" types and a lot of different "bar" functions. Your way will be more painful then explicit conversion.

Re: Support implicit conversion between types

2013-09-04 Thread ilya-stromberg
On Wednesday, 4 September 2013 at 20:14:06 UTC, Kozzi wrote: So you can use templates, something like this: I know, it will work. But I really have **a lot of** different "bar" functions, so that way will be painful. So, the question is: what should I add to "Foo" struct to allow implicit c

Re: User defined attributes use

2013-09-15 Thread ilya-stromberg
On Sunday, 15 September 2013 at 18:31:40 UTC, simendsjo wrote: On Sunday, 15 September 2013 at 17:34:06 UTC, matovitch wrote: Hi everyone, I read the documentation about user defined attributes, but I don't see their uses. Ok, it'a a template expression you can link to a declaration, but what

Re: User defined attributes use

2013-09-16 Thread ilya-stromberg
On Monday, 16 September 2013 at 15:12:05 UTC, Maxim Fomin wrote: On Monday, 16 September 2013 at 10:29:12 UTC, matovitch wrote: All your examples are great, thank you ! Is there a way to omit validate such that the compiler would call it implicitly ? For example : class C { ... } void fun(@

Re: User defined attributes use

2013-09-16 Thread ilya-stromberg
On Monday, 16 September 2013 at 17:50:16 UTC, Maxim Fomin wrote: Ideally structs should have default constructors (hello to those who miss them - problem #2) which could initialize class instance. Do you know why D structs don't have default constructors? I really miss.

Re: User defined attributes use

2013-09-16 Thread ilya-stromberg
On Monday, 16 September 2013 at 19:28:22 UTC, Andrei Alexandrescu wrote: On 9/16/13 11:56 AM, Namespace wrote: And I agree absolute, to disable default CTor's by struct's was a huge mistake. But D is full of those. ;) They are not disabled. It seems many people are having trouble with gettin

Re: User defined attributes use

2013-09-16 Thread ilya-stromberg
On Monday, 16 September 2013 at 20:16:45 UTC, Namespace wrote: And maybe also for delete: we need something to delete the memory manually. And we need built-in memory allocators, not only GC.

Re: User defined attributes use

2013-09-20 Thread ilya-stromberg
On Monday, 16 September 2013 at 07:36:13 UTC, simendsjo wrote: I don't have a full example without adding a lot of code, but this partial example might give you the gist of it. // This is the type that validates struct matches(string mustMatch) { alias re = ctRegex!(mustMatch); static

Re: CommonType and non-built-in types

2013-10-01 Thread ilya-stromberg
On Tuesday, 1 October 2013 at 17:56:17 UTC, Dicebot wrote: Definition of common type is pretty simple - it is a type both types can be implicitly converted to. For `int` and `BigInt` common type should be `BigInt` if it was possible to define that implicit conversion. AFAIK it is not possible a

Re: D / GtkD for SQL Server

2013-10-20 Thread ilya-stromberg
On Sunday, 20 October 2013 at 08:13:35 UTC, John Joyus wrote: I am learning D and itching to create some small tools (basically Windows executables) for our internal use, but any tool I think of creating also needs some support for SQL Server! So my question is: 1). Does D has any support for

Re: D / GtkD for SQL Server

2013-10-31 Thread ilya-stromberg
On Sunday, 27 October 2013 at 00:06:35 UTC, John Joyus wrote: On 10/25/2013 04:04 AM, Gary Willoughby wrote: 1). Does D has any support for MSSQL? See here: http://forum.dlang.org/thread/qcxoafwuachwnnwqk...@forum.dlang.org Thanks for the link, but what I meant by MSSQL is Microsoft SQL Se

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-14 Thread ilya-stromberg
On Thursday, 14 November 2013 at 17:36:09 UTC, Jacek Furmankiewicz wrote: In our Java code, we make heavy use of ConcurrentHashMap for in-memory caches: Try to look dcollections: http://www.dsource.org/projects/dcollections Also, Vibe.d has own hashmap: https://github.com/rejectedsoftware/vibe

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-14 Thread ilya-stromberg
On Thursday, 14 November 2013 at 20:00:10 UTC, Jacek Furmankiewicz wrote: I looked at the dcollections docs, but none of their collections seem thread safe. The vibe.d I guess is because it is meant to be used from async I/O in a single thread...but once you add multi-threading to an app I am g

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-14 Thread ilya-stromberg
On Thursday, 14 November 2013 at 21:16:15 UTC, TheFlyingFiddle wrote: If that is the case are you not limited in the way you can update the map eg only in a single block? Yes, it's probably not the best example. It's valid if you have only 1 synchronized block for map. But you can use someth

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-14 Thread ilya-stromberg
On Thursday, 14 November 2013 at 21:31:52 UTC, Jacek Furmankiewicz wrote: hashmap per thread is not an option. The cache may be a few GBs of data, there is no way we can duplicate that data per thread. Not to mention the start up time when we have to warm up the cache. How often do you chang

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-14 Thread ilya-stromberg
On Thursday, 14 November 2013 at 22:12:10 UTC, Jacek Furmankiewicz wrote: On Thursday, 14 November 2013 at 21:36:46 UTC, ilya-stromberg wrote: On Thursday, 14 November 2013 at 21:31:52 UTC, Jacek Furmankiewicz wrote: How often do you change the data? Probably, you should use `immutable

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread ilya-stromberg
On Friday, 15 November 2013 at 15:21:59 UTC, Jacek Furmankiewicz wrote: So what happens when the "write" operation is doing map[1] = map[1].editData(5); and at the same time 50 threads are simultaneously reading the value in map[1]?. Is that reassignment operation thread safe? Or would I ge

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread ilya-stromberg
On Friday, 15 November 2013 at 16:36:56 UTC, Jacek Furmankiewicz wrote: How can you achieve lock-free reads with the synchronized MyMap approach? In this case you can use Readers-writer lock http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock It allows multiple reads and single write. I t

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread ilya-stromberg
On Friday, 15 November 2013 at 17:09:54 UTC, Dicebot wrote: On Friday, 15 November 2013 at 17:03:15 UTC, ilya-stromberg wrote: I don't know any D implementation of Readers-writer lock, but you can ask this question - maybe it already exist. http://dlang.org/phobos/core_sync_rwmutex

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread ilya-stromberg
On Friday, 15 November 2013 at 17:46:41 UTC, Russel Winder wrote: If D programmers are being told to use locks in applications code, then the D programming model and library are failing. Or the advice is wrong ;-) It's possible to implement lock-free data structures in D, you can use core.at

Re: What is the closest to ConcurrentHashMap and NavigableMap in Java?

2013-11-15 Thread ilya-stromberg
On Friday, 15 November 2013 at 18:16:17 UTC, Jacek Furmankiewicz wrote: taskPool looks like the closest equivalent in D that I could find. Yes, that's sad truth: if you want to use D, be ready make something yourself. BTW, why did you decide to migrate to D? Any problems with Java?

Re: Efficient string concatenation?

2013-11-16 Thread ilya-stromberg
On Friday, 15 November 2013 at 23:51:42 UTC, Jacek Furmankiewicz wrote: Thanks for the book! I printed it, all 673 pages of it. Immense work you have there. I think it's good to listen a little critics from newcomers. I belive that it helps Ali Cehreli to improve the book. Also, you can use

Re: Compiling an app to a single binary - possible?

2013-11-17 Thread ilya-stromberg
On Sunday, 17 November 2013 at 18:40:34 UTC, Jacek Furmankiewicz wrote: It is possible to import an entire folder and subfolders of assets? (e.g. static HTML with all of its pieces, i.e. CSS, JSS. etc) Are we talking about Vibe.d? Yes, it's possible: http://vibed.org/docs shared static this()

Re: Compiling an app to a single binary - possible?

2013-11-17 Thread ilya-stromberg
On Monday, 18 November 2013 at 00:12:57 UTC, Jacek Furmankiewicz wrote: In this case is the content of "./public" compiled directly into the executable (let's say the way all web resources are compiled into a Java WAR file), or does it have to be a separate folder on the filesystem, deployed al

Any library with string encoding/decoding support?

2014-01-20 Thread ilya-stromberg
Do you know any library with string encoding/decoding support? I need more encodings than provides `std.encoding`.

Any library with OAuth support?

2014-01-22 Thread ilya-stromberg
Do you know any library with OAuth support?

Re: Any library with OAuth support?

2014-01-22 Thread ilya-stromberg
On Wednesday, 22 January 2014 at 14:54:00 UTC, Adam D. Ruppe wrote: On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg wrote: Do you know any library with OAuth support? I did one extremely biased toward what I needed to do: Do you have OAuth server implementation?

Re: Any library with OAuth support?

2014-01-29 Thread ilya-stromberg
On Wednesday, 22 January 2014 at 11:58:17 UTC, Rikki Cattermole wrote: On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg wrote: Do you know any library with OAuth support? Not currently. But I can add it to my todo list for Cmsed[0]. [0] https://github.com/rikkimax/Cmsed Yes

Throw exception on segmentation fault in GNU/Linux

2014-04-22 Thread ilya-stromberg via Digitalmars-d-learn
What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know how to do it.

Re: Throw exception on segmentation fault in GNU/Linux

2014-04-22 Thread ilya-stromberg via Digitalmars-d-learn
On Tuesday, 22 April 2014 at 14:49:58 UTC, Dicebot wrote: On Tuesday, 22 April 2014 at 09:58:45 UTC, ilya-stromberg wrote: What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know ho