QR code based twitter --slightly OT

2012-03-02 Thread bls
Twitter messages are pretty limited, so I think it could make sense to implement a QR code based twitter like information-service. D could be the tool of choice, But does this idea makes sense at all ? I Think so, but would like to hear your opinion. TIA Bjoern

opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
How do I call opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, abc, 4L, 3.33); Instead I would prefer fm.list = (1, abc, 4L, 3.33); Is this somehow possible ? import std.variant; import

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
On 03/25/2012 02:04 PM, James Miller wrote: On 26 March 2012 09:45, blsbizp...@orange.fr wrote: How do I call opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, abc, 4L, 3.33); Instead I

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
On 03/25/2012 02:59 PM, James Miller wrote: Ok, so looking here:http://dlang.org/function.html, I have determined that, if you are using Variant arrays (though I'm not sure if you can do that using literals...) you can use the syntax from this example: Thanks James.. will give it tomorrow a

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
Thanks Artur, On 03/25/2012 03:18 PM, Artur Skawina wrote: On 03/25/12 22:45, bls wrote: How do I call opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, abc, 4L, 3.33); Instead I would

Re: Simulating multiple inheritance

2012-04-01 Thread bls
On 03/31/2012 10:05 AM, Andrej Mitrovic wrote: This is related to wrapping wxWidgets. One issue with the new wxWidgets 2.9.x series is that there seem to be more multiply-inherited classes than before As Jacob already said mixin templates and Interfaces are the way to go. I think you have to

Re: Simulating multiple inheritance

2012-04-01 Thread bls
On 03/31/2012 10:05 AM, Andrej Mitrovic wrote: One issue with the new wxWidgets 2.9.x series is that there seem to be more multiply-inherited classes than before A bit more complete snippet. interface Foo { void doFoo(); } // Foo implementation mixin template FooMixin() { alias

Re: C Bitfields in D

2010-12-08 Thread BLS
On 08/12/2010 02:23, Simen kjaeraas wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Cool! But, when is ctod.exe coming out? :p That should have been cpptod. ;) As soon as you write it. See d.announce SWIG for D :)

Re: use of D for ropes data structures

2011-10-19 Thread bls
On 10/19/2011 06:22 AM, Jay Norwood wrote: can someone propose the appropriate D features or libraries that would support a native D implementation of the ropes structures described in this Sgi C++ library. http://www.sgi.com/tech/stl/Rope.html From the library std.range -Iteration

Re: Using delegate for WindowProc - possible ?

2011-12-29 Thread bls
On 12/28/2011 03:45 PM, Tal wrote: Can I do something like this : __ extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) MyWinProcDelegate; this() { MyWinProcDelegate =Events; }

Re: Using delegate for WindowProc - possible ?

2011-12-29 Thread bls
On 12/28/2011 03:45 PM, Tal wrote: Can I do something like this : __ extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) MyWinProcDelegate; this() { MyWinProcDelegate =Events; }

Re: Using delegate for WindowProc - Is possible and fun!

2011-12-29 Thread bls
On 12/28/2011 03:45 PM, Tal wrote: Can I do something like this : __ extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) MyWinProcDelegate; this() { MyWinProcDelegate =Events; }

Re: Taking a function or delegate as argument.

2012-01-10 Thread bls
On 01/10/2012 06:53 AM, Jacob Carlborg wrote: On 2012-01-10 14:48, simendsjo wrote: On 10.01.2012 14:43, Mike Parker wrote: On 1/10/2012 10:05 PM, simendsjo wrote: If I want to have a method taking a callback function, I have to specify if it should take a function or delegate even if I don't

Re: OOP Windows

2012-01-16 Thread bls
On 01/16/2012 09:07 AM, Andrej Mitrovic wrote: Oh I thought that tutorial was about MFC/ATL, but it seems to use the regular C API. I might look into this to add it to the DWinProgramming project if it's worthwhile. I think it is worth a closer look. Especially Bartosz Milewski ActiveObject

Re: Partial classes

2012-01-30 Thread bls
On 01/29/2012 01:43 PM, Mars wrote: Hello everybody. Quick question, is there anything like C#'s partial classes in D? Mars As already said template mixins are close to partial classes. A snippet. HTH import std.stdio, std.cstream; void main(string[] args) { auto bar = new Bar();

Re: Class Initialization

2012-01-31 Thread bls
On 01/31/2012 12:41 PM, Trass3r wrote: *whispers gee dee c* windows binaries please...

whois bulk queries, how to

2008-11-08 Thread BLS
Hi I want to do bulk queries on whois engines. Everthing works fine for a single request. whois(suneido.com) for instance. The problem is that the whois servers are disconnecting after 1 request. I know about a few desktop whois apps which are able to do bulk queries.. Questions is what is the

Re: Print a PDF

2008-12-09 Thread BLS
John schrieb: BCS Wrote: Reply to John, Hello! I'm wanting to use D to send a PDF to a printer. Is there an easy way to do this? Also, I may need to set which tray to go to and whether it should duplex or not. Could someone help me out? THANKS! You would do it the same way that it would

C++ operator new

2009-01-25 Thread BLS
Hi, I wonder if this is doable in D ? class Cpp { public: void* operator new(size_t n); void* operator new(size_t n, void* p) { return p; } } Just guessing that operator new means this in D class D { new(uint n); new(uint

Re: How to check for internet connectivity and download file?

2009-04-27 Thread BLS
Tyro[a.c.edwards] wrote: I've used Burton Radons' urllib in the past to get download files from the internet, however the library has atrophied and can no longer be used with DMD v2.029 (not how long it's been this way because I haven't tried to compile it since 2006). I'm wondering if

Re: Simple file manipulation

2009-05-20 Thread BLS
Sam Hu wrote: I looked up in D2 in std.stdio,std.file,std.cstream and std.stream and try to find a very simple method which can read from a file once a value other than once an entire row.I just can not find it maybe this idea is wrong.Say how to simply read write key/value pairs to and

Re: [SO] memory paging with D

2009-06-29 Thread BLS
BCS wrote: http://stackoverflow.com/questions/1057219/memory-paging-with-d I'm using D/Tango for catalog indexing, is there any library to aid with memory (RAM) paging for a dictionary which is in memory and can go up to 10gb while performing indexing? Why not using SQLite as memory db ?

Re: Regex

2009-07-09 Thread BLS
Vladimir Voinkov wrote: std.regex can't be used in compile time function call. It's quite frustrating... see dsource.org .. afaik there is a compile time regex project. hth

Re: Regex

2009-07-10 Thread BLS
Robert Fraser wrote: BLS wrote: Vladimir Voinkov wrote: std.regex can't be used in compile time function call. It's quite frustrating... see dsource.org .. afaik there is a compile time regex project. hth http://www.dsource.org/projects/scregexp But the generated functions aren't CTFE

Re: Pointer to method C++ style

2009-07-23 Thread BLS
Sergey Gromov wrote: Use case: I'm writing an ActiveX plug-in for a dynamic language. The class Component : IUnknown WOW! But shouldn't you use class Component : IDispatch { HRESULT QueryInterface( REFIID riid, LPVOID * ppvObj) {}; ULONG AddRef() {}; ULONG Release(){}; //

Re: Pointer to method C++ style

2009-07-23 Thread BLS
Sergey Gromov wrote: Thu, 23 Jul 2009 12:37:42 +0200, BLS wrote: Sorry, I'm not a guru at all, so ActiveX was a misnomer. What I'm writing is a simple in-process server DLL which implements a couple of interfaces. Oh, that's sad. :( well, especially in this case I would suggest to have

char* to string

2009-11-04 Thread BLS
HI, I would like to use some pbobos string based functions within an DLL. Unfortunately all I can do is to pass char* parameters from the callee side. Now I want to use f.i. std.regex export extern(windows) char* xxx() //Heck were is Jarret when I need him most ? D2,beside Björn

Re: char* to string

2009-11-04 Thread BLS
On 05/11/2009 00:11, BLS wrote: char* xxx() better char* xxx(char* a, char* b) { string A = }

gap buffer in D2

2009-11-04 Thread BLS
yep, mean it... has somebody done it before...to me it seems to be not as trivial as it looks on the very first view. (speed matters)

Re: gap buffer in D2

2009-11-04 Thread BLS
On 05/11/2009 01:04, Spacen Jasset wrote: BLS wrote: yep, mean it... has somebody done it before...to me it seems to be not as trivial as it looks on the very first view. (speed matters) Did one in C once for an editor (of course). Does that count? I might be able to find the code. It might

Re: templates

2010-04-19 Thread BLS
On 19/04/2010 20:16, Ellery Newcomer wrote: Hello. Say I have a [struct] template T, which takes a param S. Any T!(S) satisfies a certain template constraint W, so I can use any T!(S) the same way. I want to be able to store heterogeneous T!(S) in a single list. Is there any good way to

@porperty problem..

2010-06-28 Thread BLS
Hi I have a forward reference pb in conjunction with @property. Err msg is : forward refrence to inferred return type of function call s1.servername. any ideas ? beside, where are the @property docs ? thanks, bjoern final class LoadBalancer { private static LoadBalancer lb;

Re: @prorperty problem..

2010-06-28 Thread BLS
On 28/06/2010 22:37, BLS wrote: forward refrence to inferred return type of function call s1.servername. any ideas ? beside, where are the @property docs ? thanks, bjoern ok moving the inner Server class (see prev. msg) in front of LoadBalancer works.. seems to be a forward reference bug

Re: @porperty problem..

2010-06-28 Thread BLS
On 28/06/2010 22:47, Steven Schveighoffer wrote: houldn't this be @property Server nextServer() { Ouch, you are right.. Interesting enough that @property nextServer() { return ...} compiles without giving any error message.. Anyway it seems to be a forward reference bug. moving the inner

Re: @porperty problem..

2010-06-28 Thread BLS
On 28/06/2010 22:58, Steven Schveighoffer wrote: I wasn't aware that @property implies auto. I guess that makes sense, but I didn't consider it anything but a hint to the compiler about how it could be called, not that did anything with the type. Hm, this snippet does not compile : class

Re: @porperty problem..

2010-06-28 Thread BLS
On 28/06/2010 23:00, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/function.html#property-functions -Steve Makes sense :) thanks

Re: @porperty problem..

2010-06-28 Thread BLS
On 29/06/2010 00:07, Simen kjaeraas wrote: Maybe it's because you haven't added string to the setter? Just grasping at straws here. -- Simen Hi Simen, yes, thats the prob. I just have not found the @property docs.. thanks for all the help.. This snippet works now as expected.. D properties

@property and interfaces

2010-06-29 Thread BLS
Just wonder how to translate this C# snippet into D.. //C# public interface IBindingList { bool AllowEdit { get; } } //D2 interface IBindingList { @property bool allowEdit(); } Is this correct ? I think in C# AllowEdit() takes tare that you don't implement a

Re: @property and interfaces

2010-06-29 Thread BLS
; @property { bool AllowEdit() { return _allowEdit; } //bool AllowEdit(bool enable) { return _allowEdit = enable; } } } bjoern On 29/06/2010 12:11, BLS wrote: Just wonder how to translate this C# snippet into D.. //C# public interface IBindingList

Re: @property and interfaces

2010-06-29 Thread BLS
On 29/06/2010 12:32, Jonathan M Davis wrote: So, there certainly won't be any restriction on having a getter or setter in a class if an interface it implements declared only one. It's just that you'll only be able to use the one that's part of the interface if you're using a reference of the

Re: @property and interfaces

2010-06-29 Thread BLS
On 29/06/2010 14:08, Steven Schveighoffer wrote: Besides, try to do this in C#: @property int value() {return _x;} @property int value(int x) { return _x = x;} @property int value(string s) { return _x = to!int(s);} :) D's properties are so much better... -Steve Ok, convinced ;)

Re: @property and interfaces

2010-06-29 Thread BLS
Hi bearophile, sorry for my ignorance, but what is the difference between @disable and simply deleting the line ? where can I read more about @disable ? thanks, bjoern

C# Indexers. how to implement them in D.. also property related.

2010-06-29 Thread BLS
Hi, in C# you can do some thing like this. public interface IDataErrorInfo { // INDEXER string this[string columnName] { get; } } } how to translate this into D2 ? thanks in advance, bjoern

Re: C# Indexers. how to implement them in D.. also property related.

2010-06-29 Thread BLS
On 29/06/2010 15:27, Steven Schveighoffer wrote: string opIndex(string columnName); yeah this is what I did, too.. However defined as ; interface I1 { string opIndex(string columnName); } is a no go. So can we say operator overloading within interfaces is not allowed in D2 ? thanks

Re: C# Indexers. how to implement them in D.. also property related.

2010-06-29 Thread BLS
On 29/06/2010 15:35, BLS wrote: On 29/06/2010 15:27, Steven Schveighoffer wrote: string opIndex(string columnName); yeah this is what I did, too.. However defined as ; interface I1 { string opIndex(string columnName); } is a no go. So can we say operator overloading within interfaces

dcollections problem

2010-06-29 Thread BLS
Hi - probably Steve :) I have problem in compiling a little programm using dcollection.LinkList. (similar problem appears when I use dcollections.ArrayList) D2.047 Linker error.. Error 1 Error 42: Symbol Undefined _D12dcollections8LinkList7__arrayZ Error 2 Error 42: Symbol

Re: dcollections problem

2010-06-29 Thread BLS
On 29/06/2010 20:19, Steven Schveighoffer wrote: Are you linking against dcollections? It looks like you are not... No. BTW, you can use dcollections' ticket tracking system for things like this instead of sending to the newsgroup :) Will do. Thanks Steve bjoern

dcollections how to LinkList // port c# code

2010-06-29 Thread BLS
Hi, in C# this is common. private ListServer _servers; _servers = new ListServer { new Server{ Name = ServerI, IP = 120.14.220.18 }, new Server{ Name = ServerII, IP = 120.14.220.19 }, new Server{ Name = ServerIII, IP = 120.14.220.20 }, new Server{

Re: dcollections how to LinkList // port c# code

2010-06-29 Thread BLS
On 29/06/2010 22:12, Steven Schveighoffer wrote: For now, can you do something like this? sl = new ServerList; sl.add([ new Server(ServerI, 120.14.220.18), new Server(...) ... ]); Hi Steve, I think this should work, however I got very strange err. msg. in file ArrayList.d Have

Re: dcollections how to LinkList // port c# code

2010-06-29 Thread BLS
On 29/06/2010 23:49, Steven Schveighoffer wrote: One thing to note, ArrayList *does* accept an array as a constructor, and it will actually use that array as its storage. This is so you can wrap an array as a ArrayList and get the full dcollections functionality from it. Hi Steve This is why

dcollections ArrayList conating array of classes/structs

2010-06-30 Thread BLS
Hi, IMHO ArrayList has a bug. Just declaring ArrayList!B bl, raises an error. But maybe I am wrong.. Nevertheless I 've filed a ticket. In case that I switch from class to struct also std.algorithm is involved. class AListTest { alias ArrayList!B BList; BList bl;

dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
Hi, I have a problem with a mixin template. More exact with an Arraylist!T within a mixin template. Given. void main() { auto p = new Person(Hans, 32); p ~= new Person(Steve, 40); p ~= new Person(Bjoern, 101); } class Person { private string _name;

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
On 01/07/2010 22:59, Steven Schveighoffer wrote: On Thu, 01 Jul 2010 15:36:53 -0400, BLS windev...@hotmail.de wrote: Hi, I have a problem with a mixin template. More exact with an Arraylist!T within a mixin template. Given. void main() { auto p = new Person(Hans, 32); p ~= new Person(Steve, 40

Re: dcollections ArrayList pb with mixin template

2010-07-01 Thread BLS
On 02/07/2010 00:26, bearophile wrote: Steven Schveighoffer: I think a member initializer has to be a constant expression, like int i = 1. Anything else has to be done in the constructor. There are the static constructors too, for modules, structs, classes. Bye, bearophile Hi bearophile,

MS VirtualFree(), VirtualAlloc()

2010-07-02 Thread BLS
Hi, for reasons I don't completely understand I would like to implement a BIP Buffer in D2. ;) well async IO is the use case .. I think. How can I allocate/free buffer-space from virtual memory ? What I am looking for is a way to do platform independent allocating of memory from the virtual

Re: MS VirtualFree(), VirtualAlloc()

2010-07-03 Thread BLS
On 02/07/2010 20:11, BLS wrote: Hi, for reasons I don't completely understand I would like to implement a BIP Buffer in D2. ;) well async IO is the use case .. I think. How can I allocate/free buffer-space from virtual memory ? What I am looking for is a way to do platform independent

std.pattern.. templated publisher subscriber pattern, adding events to collections

2010-07-06 Thread BLS
Hi, Andrei brings in the idea of std.pattern. Seems that this module is stalled; Unfortunately ! However I would like to enhance collection classes (likewise dcollections) with a Publisher - Subscriber pattern (signal - slot, or observer pattern) , if you prefer) Hope the idea of enhancing

Re: std.pattern.. templated publisher subscriber pattern, adding events to collections

2010-07-06 Thread BLS
Okay a bit better snippet than before. snippet should be almost functional.. /* Hi, Andrei brings in the idea of std.pattern. Seems that this module is stalled; Unfortunately ! However I would like to enhance collection classes (likewise dcollections) with a Publisher - Subscriber pattern

Re: std.pattern.. templated publisher subscriber pattern, adding events to collections

2010-07-06 Thread BLS
Hi Dimitry, thanks for the feedback! Please have a look at the new snippet (just posted) msg is a ref parameter cause it is filled in our example from Stack. The Publisher mixin HOST. In other words. Where ever you mixin the Publisher template a message will be broad casted to all

Re: std.pattern.. templated publisher subscriber pattern, adding events to collections

2010-07-08 Thread BLS
@ Dmitry Thanks for all the feedback Dmitry. Seems that we have similar projects in mind :) (maybe we can talk about the GUI project.. mine is similar to win32++ at http://sourceforge.net/projects/win32-framework/)

Re: Grokking concurrency, message passing and Co

2010-07-12 Thread BLS
On 12/07/2010 10:35, Justin Spahr-Summers wrote: On Mon, 12 Jul 2010 00:03:53 +0200, BLSwindev...@hotmail.de wrote: On 11/07/2010 21:29, Philippe Sigaud wrote: I tried this because I was reading an article on Scala's actors, where they talk about millions of actors. I guess they are quite

Re: Grokking concurrency, message passing and Co

2010-07-12 Thread BLS
On 12/07/2010 14:18, Lars T. Kyllingstad wrote: I'm pretty sure they will be soon, perhaps even in the next release: http://www.dsource.org/projects/druntime/changeset/321 -Lars Thanks Lars.. Good news ! Hope the auto x = whatever(); // thing for ddoc is also solved than..

Re: Generic collection/element function signatures in D2 versus D1

2010-09-05 Thread BLS
On 05/09/2010 02:16, Jonathan M Davis wrote: void foo(T)(T[] collection, T elem) { // Blah, whatever } I am curious, how this will look and feel once inout is working ? inout void foo(T)(inout(T)[] collection, inout T elem) { // Blah, whatever} }

alias this ...

2010-09-06 Thread BLS
// ..snip point3D p; // Da p.x = 10; p.y = 20; p.z = 100; point3D = = new point3D(10,20,30) // Njet //etc } struct point { int x; int y; } struct point3D { point p; alias p this; int z; // NOPE :( /*static point3D opcall(int _x, int _y, int

Re: alias this ...

2010-09-06 Thread BLS
On 06/09/2010 22:36, BLS wrote: point3D = = new point3D(10,20,30) // Njet //etc should be point3D p3 = new point3D(10,20,30) // Njet sorry

Re: [SO] D support for COM

2010-09-14 Thread BLS
On 13/09/2010 20:58, Jesse Phillips wrote: There is a question on using COM with D and how it simplifies using COM[1]. I haven't done it myself and don't have any examples. http://stackoverflow.com/questions/3698910/d-support-for-com http://www.dsource.org/projects/juno/wiki Juno contains a