Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread bls

Am 30.04.2012 08:38, schrieb Sönke Ludwig:

If you mean automatic generation of a REST interface for an existing D
interface, then it's definitely planned. I can imagine a sloppy version
where the HTTP method is always POST or can be POST/GET as desired by
the client. But I would also like to have a more expressive version,
where the HTTP method is inferred from the D method somehow and maybe it
would also be possible to specify a sub path for each method.

Sönke


Yes, this is what I am asking for. I think POST/GET is not enough.

Should be POST GET PUT DELETE

I would be fantastic if vibe.d can implement a REST SERVER following 
this guideline :


The JsonRestStore follows
RFC 2616 (http://www.ietf.org/rfc/rfc2616.txt) whenever possible to 
define to interaction with server. JsonRestStore uses an HTTP GET 
request to retrieve data, a PUT request to change items, a DELETE 
request to delete items, and a POST request to create new items. It is 
recommended that the server follow a URL structure for resources:


/{Table}/{id}

This URL will be used to retrieve items by identity and make 
modifications (PUT and DELETE). It is also recommended that a /{Table}/ 
URL is used to represent the collection of items for the store. When a 
query is performed, any query string is appended to the target URL to 
retrieve the results of the query. The JsonRestStore expects the results 
to be returned in an array (not in an object with an items property like 
some stores). The store will also POST to that URL to create new items.


When creating new items, the JsonRestStore will POST to the target URL 
for the store. If your server wants to assign the URL/location for the 
newly created item, it can do so by including a Location header in the 
response:


Location: http://mysite.com/Table/newid

The server can also assign or change properties of the object (such an 
id or default values) in the response to a POST (or any other request), 
by simply returning the updated JSON representation of the item in the 
body of the response.


Note that in PHP, sometimes setting the Location will erroneously 
trigger a 302 status code which will cause JsonRestStore to fail. Per 
RFC 2616, the correct response to a POST that creates a new resource is 
to return a 201 status code with the Location header. In PHP, you must 
set the status code as well as the Location header if you want to avoid 
a 302 response.


Re: Introducing vibe.d! SOAP .. REST?

2012-05-03 Thread bls

Am 03.05.2012 11:22, schrieb bls:

Should be POST GET PUT DELETE

I would be fantastic if vibe.d can implement a REST SERVER following
this guideline :


A very interesting read regarding implementing a rest server (PHP)

http://www.gen-x-design.com/archives/create-a-rest-api-with-php/

Bjoern


Re: Introducing vibe.d!

2012-05-02 Thread bls

Am 01.05.2012 23:46, schrieb Sönke Ludwig:

I made a post with Steve Teale's MySQL driver as an example:
http://vibed.org/blog/posts/writing-native-db-drivers

There were some hidden gotchas, but I hope the current port doesn't
break anything from the original code.


Looks good. Unfortunately I spend some time with MongoDB and I have to 
say : Amazing db. I thought key/value databases are just toys. At least 
regarding MongoDB is was completely wrong.



I have a problem with diet templates.
In order to use dojo dijit I need :

div class=mainlayout id=appLayout
   data-dojo-props=region: 'center', tabPosition: 'bottom'
   data-dojo-type=dijit.layout.TabContainer
/div

Is this doable in diet templates ?




Re: Introducing vibe.d!

2012-04-29 Thread bls

Great job. Thanks Soenke et al;


 - Built-in support for MongoDB and Redis databases


MySQL.
Like other folks here I need a SQL db, At least for MyQL 5.1 
there is a socket based solution from Steve Teale.

https://github.com/britseye/mysqln
Means no licence trouble, and probably easier to establish async 
support.


Quote
Additional drivers are easy to port to vibe.d because of the 
blocking API - basically the only thing that has to be done is to 
replace the socket calls (send(), recv(), connect() etc.) with 
the corresponding vibe functions.

EndQuote

Can you elaborate a bit more ? Maybe using the vibe.d blog.

There is also a socket based PostgreSQL driver available, but I 
have lost the link and dunno about the status quo.



A MIT licenced *D2 crypto lib worth a look :
http://www.dsource.org/projects/dcrypt/wiki/Features

*not up to date


Whishes:
diet template documentation.
diet template javascript example
server side QR-code generation.  (well may be I am able to 
contribute)


Re: Introducing vibe.d!

2012-04-29 Thread bls

On Sunday, 29 April 2012 at 08:52:09 UTC, simendsjo wrote:

On Sun, 29 Apr 2012 08:13:40 +0200, bls b...@orange.fr wrote:



There is also a socket based PostgreSQL driver available, but 
I have lost the link and dunno about the status quo.


This? https://github.com/pszturmaj/ddb


Exactly. Thanks for the pointer, It is pretty hard to create a 
common db- interface.


Re: UFCS for D

2012-03-30 Thread bls

On 03/30/2012 02:15 AM, Nick Sabalausky wrote:

Eh? Other people have voiced concerns over that since waaay back in even
pre-D1 times. In particular, many people have argued for allowing modules
with the same name as a package. Ie: you could have both module foo and
module foo.bar.


This is afaik similar to ADA child packages.
Quote :
Ada allows one to extend the functionality of a unit (package) with 
so-called children (child packages). With certain exceptions, all the 
functionality of the parent is available to a child. This means that all 
public and private declarations of the parent package are visible to all 
child packages.


Re: UFCS for D

2012-03-30 Thread bls

On 03/30/2012 05:06 AM, deadalnix wrote:

Le 30/03/2012 11:40, bls a écrit :

On 03/30/2012 02:15 AM, Nick Sabalausky wrote:

Eh? Other people have voiced concerns over that since waaay back in even
pre-D1 times. In particular, many people have argued for allowing
modules
with the same name as a package. Ie: you could have both module foo
and
module foo.bar.


This is afaik similar to ADA child packages.
Quote :
Ada allows one to extend the functionality of a unit (package) with
so-called children (child packages). With certain exceptions, all the
functionality of the parent is available to a child. This means that all
public and private declarations of the parent package are visible to all
child packages.


This sound interesting. And why not use public import for that ? It
wouldn't break any existing code, because it enlarge the field of
possibles.


Asking Nick or me ?

Anyway, you can't really compare the D module- and ADA package concept.
A D-ified ADA package could like like :

module Shelf {

module Disks {

}
module Books {

}
}

I am not an active ADA user but instead of having a single file you 
could use the D-ified Ada way...

module Shelf;
module Shelf.Disks;
module Shelf.Books;
instead. And I think this what Nick is talking about.

Having the same scoping rules.

http://en.wikibooks.org/wiki/Ada_Programming/Packages



Re: Adam Wilson is now a GSoC 2012 mentor!

2012-03-26 Thread BLS

On Monday, 26 March 2012 at 15:27:29 UTC, Andrei Alexandrescu
wrote:
We're very happy and honored to had Adam Wilson on board as a 
GSoC 2012 mentor. Adam brings solid project management 
experience and has a specific interest in the Mono-D project.


Please join me in welcoming Adam to the ranks of GSoC mentors!


Thanks,

Andrei


On 03/26/2012 08:27 AM, Andrei Alexandrescu wrote:
We're very happy and honored to had Adam Wilson on board as a 
GSoC 2012 mentor. Adam brings solid project management 
experience and has a specific interest in the Mono-D project.


Please join me in welcoming Adam to the ranks of GSoC mentors!


Thanks,

Andrei


Welcome Adam and congratulation Alex.

I am using Mono-D and I almost enjoy it.  One thing is for sure:
Code LookUp /
Intellisense is great in Mono-D, ,Code outline simply rox, and
MNono-D is (in this regard) light years ahead of Visual D.

The pure speed  in which Alex's code analyzer is working is just
xtreme amazing. Alex ? Benchmarks ?

But it is a GTK# and  MONO based project and this means it is
finally a C# project.

I am pretty sure that we will have a complete wxWidgets 2.9.3
binding in a few days/weeks.  (and we will have a TOOL to create
almost automatic wxWidgets 2.4. 2.5, 3.0 bindings)  incl. say Gtk
3.0 and iOS support)

So. wouldn't make more sense to ask Alex to port and enhance  his
code analyzer into D2  as GSOC project  to become part of a wxD2
driven IDE ?
I think, Yep.
Despite that,
Alex, thanks for Mono-D, very well done.
My 2 cents, Bjoern


Re: Adam Wilson is now a GSoC 2012 mentor!

2012-03-26 Thread bls

On 03/26/2012 01:11 PM, Kapps wrote:

And one of the very nice things about Mono-D is that the parser is
completely standalone. It would not be difficult to integrate into
Visual Studio in the future


Well, I am almost on Windows.(Not valid for all of us)
(AFAIK) almost everyting to integrate D into Visual Studio is done in D. 
(incl. IDL stuff) correct if I am wrong. So yes... Alex's code Analyser 
should fit. as NET assembly But as well as D shared linrary


Writing a State of the Art D2 IDE will not necessarily require  a 
million lines of code .


I am convinced that developing in wxD2*** code  will be very close to 
what you do in wxPython, maybe even smarter.


But I am loosing the point. Even if Alex carries on in Mono-D during 
GSOC it is a good thing. And.. if we are not able to translate C# stuff 
into D2 than the D2 design fails..




Re: Adam Wilson is now a GSoC 2012 mentor!

2012-03-26 Thread bls

Hi,
to make it absolutely sure !! I hope that Alex's project will make it.

(and as one who has worked on a concrete project with Alex, having 
several private phone conversations, I am sure that Alex will deliver 
pretty cool stuff. Most probably more than one might expect.)



On 03/26/2012 03:00 PM, Adam Wilson wrote:

ono is over a million, Visual Studio is almost as much as the Windows
Kernel (5m+ IIRC), and Eclipse ... well I don't what they are doing
wrong over there but the bloat is epic.
In other words, a good IDE is a massively complicated beast.
Integrations are much quicker and we don't have to reinvent the wheel
all over the place.



IMO this is questionable. What do you count as required LOC ?
Say this is what could be done by Plug-Ins.

SVN / GIT  support,
Database Explorer,
ER Designer
UML Designer
XML/XSL support
SOAP/REST support
etc.

So the core IDE has to support a flexible Doc/View Model a Plug-In 
Architecture, and Source code analysis.

Maybe an internal project-management that supports a build/make tool.
Debug Support.
Period.
All that visual stuff, say panel docking, gui persistence has not to be 
written from the scratch.. It is part of the GUI lib.


Exotic stuff,  You want the best ever Ultimate Development Environment.
Say you want Realtime developer collaboration/Video conferencing ... a 
piece of cake in Python (using async IO/ XMPP ) No rocket science at 
all.




I am convinced that developing in wxD2*** code  will be very close to
what you do in wxPython, maybe even smarter.

But I am loosing the point. Even if Alex carries on in Mono-D during
GSOC it is a good thing. And.. if we are not able to translate C#
stuff into D2 than the D2 design fails..



Actually, I'm porting the ANTLR Runtime from C# to D right now. The
languages are VERY similar, where the whole thing falls apart is the
standard library, or the fact that Phobos is brutally underpowered
compared to the .NET BCL. I wrote a List(T) class just to make the pain
stop.


Well, here I definitely should shut up.. std.collections... Anyway from 
time to time I think it would make sense to port the MOMO/NET collection 
stuff into D. Simply to make porting of dot net code possible without 
too much pain.  but that's an other story.


Thanks for being a Mentor for this Project.


Re: Pegged: Syntax Highlighting

2012-03-17 Thread bls

On 03/17/2012 01:53 PM, Philippe Sigaud wrote:

Does anyone have experience with other languages similar to D and that
offer AST-walking? Doesn't C# have something like this?
(I'll have a look at Scala macros)



Hi Philippe.
Of course the visitor pattern comes in mind.

Eclipse (Java) uses a specialized visitor pattern  called hierarchical 
visitor pattern to traverse the AST.


The classic visitor pattern has the following disadvantages :

-- hierarchical navigation -- the traditional Visitor Pattern has no 
concept of depth. As a result, visitor cannot determine if one composite 
is within another composite or beside it.


-- conditional navigation -- the traditional Visitor Pattern does not 
allow branches to be skipped. As a result, visitor cannot stop, filter, 
or optimize traversal based on some condition.


Interesting stuff at :

http://c2.com/cgi/wiki?HierarchicalVisitorPattern
You'll find some implementation details at the bottom of the doc.
hth Bjoern


Re: A tutorial on D templates: updates

2012-01-30 Thread bls

On 01/29/2012 12:44 PM, Philippe Sigaud wrote:

Hello,

I posted there a few weeks ago about a tutorial on D templates I put in github:

https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf

Since then, I received numerous mails, issues, advices and thanks. Thank to you 
all!

Following the ideas found in TDPL, I wrote a D script to extract and test all 
the samples
presented in the document. I'm proud to say that right now, all named (module 
XXX;) samples
compile, which makes for more than 200 modules tested! Indeed, you could see 
the entire document
as a huge package documentation :)

I also added explanations, new sections and a new appendix in D templates 
resources.

As before, do not hesitate to read, comment, post and even send pull requests, 
I'm all ears.

Bye,

Philippe


First of all thank you so much for this wonderful book!

I would like to ask for a little enhancement regarding mixin templates. 
see snippet.
The second mixin template RandomAccessList is slightly OT 'cause 
Ranges are also touched, but I think this could be very interesting stuff.
A third mixin template example which comes in mind is the Publisher 
subscriber pattern template.


snip.
import std.stdio;
import std.cstream;

void main(string[] args)
{
// showing mixin template scope.
auto bar = new Bar();
writeln(bar.onClick());
din.getc();
}

mixin template FooMixin()
{
void init()
{   
}
string onClick()
{
return Clicked;
}
}

class Foo
{
mixin FooMixin;
}
class Bar : Foo
{

}


// Something more interesting : Mixin templates and ranges

mixin template RandomAccessList()
{

alias typeof(this) Me;

//Either
static private Me[] MeArray;
//OR
private Me next, prev;

}
interface IRandomAccessRange {}

class Contacts : IRandomAccessRange // Contacts not Contact !
{
 mixin RandomAccessList;

}



Re: A tutorial on D templates: updates

2012-01-30 Thread bls

Hi Philippe,
Ok, something more interesting it combines suggestion 2)  and 3). Still 
a quick hack, not much tested, but I think the intention is clear.


The snippets show how a publisher subscriber pattern can be mixed in. 
Further it shows how a simple class could become a stack, queue, list etc.
The FooMixin was just to show (due to a question on D.Learn), how we can 
mimic partial C# classes.


import std.stdio;
import std.cstream;
import std.functional;

void main(string[] args)
{
auto  p = new PersonStack();

p.add(Hans, 42);// uses MIStack push(), MISubScriber notify()
din.getc();
}

mixin template MIPublisher()
{
alias void delegate(Object sender, string event) CallBack;
CallBack[] callBacks;

public void register(CallBack callBack)
{
callBacks ~= callBack;
}

// There is for sure a smarter solution to remove
public void unRegister(CallBack callBack)
{
for ( int i=0 ; !icallBacks.length ; i++ )
{
if (callBacks[i] == callBack)
{
callBacks = callBacks[0..i] ~ 
callBacks[i+1..callBacks.length];
--i;
}
}
}
// Notify ALL Subscribers
public void notify(string evt)
{

foreach ( CallBack callBack ; callBacks )
{
callBack( this, evt );
}
}
}

mixin template MIStack()
{
alias typeof(this) Me;
//alias Me[] Us;
static Me[] stack;


public:

bool empty()
{
return stack.length == 0;
}

int count()
{
return stack.length;
}

void push(Me element)
{
stack ~= element;
}

Me pop()
{
Me element = peek();
stack.length = stack.length - 1;
return element;
}

Me peek()
{
if ( stack.length == 0 )
{
// throw error
}
Me element = stack[stack.length-1];
return element;
}
}



class PersonStack
{
private string name;
private int age;

// Our Mixins
mixin MIStack;
mixin MIPublisher;

this()
{
// Register some subscribers (MIPublisher register function)
// I have used free functions to show the useful toDelegate()
register( toDelegate(DrawPersonBarChart) );
register( toDelegate(DrawPersonPieChart) );
}

// Push
void add(string name, int age)
{
this.name = name;
this.age = age;
// Push Person (MIStack push function.)
push(this);

// Notify all subscribers   
notify(Push);

}
// remove()
}

//Subscriber free functions
void DrawPersonBarChart(Object sender, string msg)
{
writeln(Bar  ~ msg);
}
void DrawPersonPieChart(Object sender, string msg)
{
writeln(Pie  ~ msg);
}


Re: Modern COM Programming in D

2012-01-25 Thread bls

On 01/24/2012 09:07 AM, Lionello Lunesu wrote:

Little over a year ago I held a tech talk at Microsoft about how I used
D to write readable COM code. A while back I thought I'd try to get
permission to share these slides, and what'dya know:

http://lunesu.com/index.php?/archives/126-Modern-COM-Programming-in-D.html

Direct link to the slides:
http://lunesu.com/uploads/ModernCOMProgramminginD.pptx

Let me know what you guys think!

Lionello.


Congratulations Lionello, This is not just a useful snippet. You have 
been able to explain all the D2 goodies in a reasonable context.


This code should have a home and live at Fine_Art_Of_D2_Programming.com
Very well done!
Thank You, Bjoern



Re: The book Programming in D is in beta

2012-01-12 Thread bls

Hi Ali,
Why not 1) just translate the example code into English. 2) Google 
Translate the text and 3) ask the native English speaking D community 
for a helping hand.
IMO the GOOGLE Turkish to English translation is translatable into 
readable English, without too much effort :)


So instead of wasting time with manual translation,  keep your book in 
sync with D2, add some examples..  It's an excellent book about D2 (and 
beside an exercise on how to write programming books in general)

A+
Bjoern

On 01/12/2012 12:51 AM, Ali Çehreli wrote:

I have continued the translation and added the following chapters:

* Floating Point Types
* Arrays
* Characters
* Slices and Other Array Features
* Strings

I have translated the following chapter as well, out of order:

* Templates

http://ddili.org/ders/d.en/index.html

Ali

On 11/13/2011 11:00 PM, Ali Çehreli wrote:
  I have been translating my Turkish D book D Programlama Dili to
  English under the title Programming in D. I have decided to make its
  current state available online:
 
  http://ddili.org/ders/d.en/index.html
 
  I will make more chapters available as they get translated.
 
  As the book is for the novice programmer, the chapters that have been
  translated so far will not be very interesting to you. For that reason,
  I have decided to skip a number of chapters and translate two from the
  later ones as well:
 
  Exceptions:
 
  http://ddili.org/ders/d.en/exceptions.html
 
  Ranges:
 
  http://ddili.org/ders/d.en/ranges.html
 
  I hadn't known that my English was so poor. :) Please be patient; the
  text is being edited by an expert English speaker and will continuously
  be updated as it gets corrected.
 
  I welcome any feedback at acehr...@yahoo.com and of course here.
 
  Thank you,
  Ali





Re: gl3n - linear algebra and more for D

2011-12-04 Thread bls

On 12/04/2011 03:39 PM, bearophile wrote:

This seems the 15th D implementation of certain things I've seen so far. Also 
to avoid further duplication I'd like 2D/3D/4D vectors (for game or graphics 
purposes) in Phobos.


Isn't he a nice guy ?
Since 5, maybe 6, years bearophile is complaining that D is not Python. 
And in case that bearophile is not in the mood to complain he fires up 
some obscure benchmarks or he is telling you why language X Y Z is 
better than D. Pretty annoying imho.


My 2 cents

OK, Somehow your announcement implicates that you've implemented a 
DirectX wrapper.  gl3n provides all the math you need to work with 
OpenGL, DirectX or just vectors and matrices,,,


True ? Avail. ?
Bjoern


Re: D:YAML 0.2 released

2011-10-15 Thread bls

Am 15.10.2011 19:06, schrieb Kiith-Sa:

I've just released D:YAML 0.2 . This release brings emitting functionality

...

what do you think about bringing in (adapt) your YAML tool into the 
Orange  serialisation library. (orange.. 
https://github.com/jacob-carlborg/orange)


Sounds probably not too interesting but in conjunction with the upcoming 
std.database/ ORM  stuff Serialisation/De-Serialisation will become 
pretty important .


// occupied snippet from Orange ..
class Foo
{
int a;
}

void main ()
{
auto foo = new Foo; // create something to serialize
foo.a = 3; // change the default value of a

auto archive = new YAMlArchive!(char); // create an yaml archive
auto serializer = new Serializer(archive); // create the serializer

serializer.serialize(foo);


std.database a design suggestion

2011-10-10 Thread bls

Hi, what do you people think about using the GoF
Factory (design) pattern ?
F.I.

abstract class Database {

//common database stuff
public abstract void connect(string user, string pw);
// execSql(); prepare() etc...
}

abstract class DatabaseFactory {

   public abstract Database GetDatabase();
}

class PostgreSQL:Database {

// common
   public override void connect(string user, string pw) {

   }
   //PostgreSQL specific
   public void funkyPGstuff() {}
}

class PostreSQLFactory:DatabaseFactory {

   public override Database GetDatabase() {

  return new PostgreSQL();

   }
}

class MySQL:Database {

// common
   public override void connect(string user, string pw) {

   }
   //MySQL specific
   public void funkyMySQLstuff() {}
}

class MySQLFactory:DatabaseFactory {

   public override Database GetDatabase() {

  return new MySQL();

   }
}


Re: D Database Connectivity

2011-05-24 Thread bls

Am 24.05.2011 06:32, schrieb Mandeep Singh Brar:

Sorry, I couldnt get what you are trying to say. the project ddbc
already has an implementation of java.sql.ResultSet. In fact most of
the methods of jdbc have been retained except that some might not be
implemented by specific drivers.

Thanks
Mandeep


Sorry for making unnecessary noise Mandeep,
I should have a closer look on what's already done before making 
suggestions.

Bjoern


Re: D Database Connectivity

2011-05-23 Thread bls

Am 23.05.2011 08:49, schrieb Mandeep Singh Brar:

I have tried to port the jdbc drivers of postgres and sqlite along
with libodbcxx to D2/phobos. The library ddbc, having an API similar
to JDBC has been uploaded to dsource.org/projects/ddbc.


First of all : Well done.
I think it was Adam Ruppe (apologies in case that I am wrong with the 
name) who has created a quit appealing Java like ResultSet 
Implementation. Wouldn't it be cool to bring this stuff together ?


Bjoern


Re: Announcing: D support in SWIG

2010-12-10 Thread BLS

On 08/12/2010 20:35, Andrej Mitrovic wrote:

I did a configure with:
--with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
swig.


Guess you mean ..
--with-d2-compiler=C:/DMD/dmd2/windows/bin/dmd.exe

Bjoern


Re: Announcing: D support in SWIG

2010-12-09 Thread BLS

On 09/12/2010 23:47, Andrej Mitrovic wrote:

I'm thinking maybe we should have a SWIG interfaces project on
dsource, if one doesn't exist yet. If someone made SWIG interfaces for
some big library it would be cool to share it at one place so anyone
could download them.


Vote++ A discussion Forum would be nice too.
I am just trying to figure out what to do with :

operator HWND() const;






Re: Announcing: D support in SWIG

2010-12-09 Thread BLS

On 10/12/2010 01:27, klickverbot wrote:

Discussing SWIG and D is an entirely different topic, for which there
are many possible options: a newly created digitalmars.D.bindings NG, a
forum hosted somewhere (DSource, …), Stackoverflow (tagged »swig« and
»d« or maybe even »swig-d«), the Swig-user mailing list, and probably a
few more I didn't think of right now.


Whatever it is, or will be, I don't care. It is just that IMHO we need a 
discussion platform.


I think it is not only an egoistic point view to ask for support. I 
guess serious questions will make SWIG 4 D more reliable.


Just a suggestion : why not use the D WIKI for FAQ, Documentation links 
and HOW TOs. Probably we could also to publish the SWIG 4 D documentation.


I would further like to suggest that we! add a real world 
windows_sample.i plus windows_sample.h file in order to explain how to 
deal with HWND, LPCTSTR, DWORD  respective

CWnd* GetCWndFromMap(HWND hWnd); etc..

will send you a short(promised) email David
Once again, thanks for such a nice piece of work.
Bjoern






Re: Announcing: D support in SWIG

2010-12-09 Thread BLS

On 10/12/2010 01:27, klickverbot wrote:

Regarding your specific problem: Generally speaking, operator
overloading is WIP (hopefully I find time to implement it for D2 during
the weekend), but implicit conversions can't really be mapped to D
anyway, so just use the %rename directive of SWIG to map the implicit
conversion operator to a regular member function like »asHwnd()«.



Whatever it is, or will be, I don't care. It is just that IMHO we need a 
discussion platform.


I think it is not an egoistic point of view to ask for support. I guess 
serious questions will make SWIG 4 D more reliable.


Just a suggestion : why not use the D WIKI for FAQ, Documentation links 
and HOW TO s.


I would further like to suggest that we! add a real world 
windows_sample.i plus windows_sample.h file in order to explain how to 
deal with HWND, LPCTSTR, DWORD  respective

CWnd* GetCWndFromMap(HWND hWnd); etc..

will send you a short(promised) email David
Once again, thanks for such a nice piece of work.
Bjoern





Re: Announcing: D support in SWIG

2010-12-09 Thread BLS

On 10/12/2010 01:27, klickverbot wrote:

Regarding your specific problem: Generally speaking, operator
overloading is WIP (hopefully I find time to implement it for D2 during
the weekend), but implicit conversions can't really be mapped to D
anyway, so just use the %rename directive of SWIG to map the implicit
conversion operator to a regular member function like »asHwnd()«.


Using the %rename directive sound reasonable... I'll give it a try.
thanks, bjoern


Re: Announcing: D support in SWIG

2010-12-08 Thread BLS

On 08/12/2010 18:48, Andrej Mitrovic wrote:

On 11/24/10, BLSwindev...@hotmail.de  wrote:

Hi David,
let me shake your hands and say Thank You, GREAT work.

It was a bit difficult to build SWIG SVN on Windows.


Just finding those automake/autoconf/bison binaries is a detectives' work.

How did u build from svn?


If I recall correctly, I've just installed MinGW, and MSYS
calling svn, make,makeinstall. There was however a problem with pcre (I 
am using 8.10) I found the solution by reading the error message from 
make regarding pcre very careful. Sorry that all I can tell you atm.

beside, to start msys via menu look for MinGW Shell
hth bjoern


Re: Announcing: D support in SWIG

2010-11-24 Thread BLS

Hi David,
let me shake your hands and say Thank You, GREAT work.

It was a bit difficult to build SWIG SVN on Windows. However. it was 
doable and as soon as I have some free time I will try make a few tests 
on a Win C++ GUI project.

Bjoern

On 21/11/2010 18:27, klickverbot wrote:

In a nutshell, SWIG is a »glue code« generator, allowing you to access
C/C++ libraries from various target languages, including C#, Go, Java,
Ruby, Python … and, since I merged my work into SWIG trunk a few days
ago, also D, both version 1 and 2.

I have put up a short description of it at my blog
(http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/), but
to give it a whirl, just head over to the SWIG SVN and build it from
there (http://swig.org/svn.html).

I would be glad if some brave souls could go ahead and test it in
real-world use cases before it is officially released with SWIG for the
first time (SWIG 2.0.2, date yet to be determined), so that any major
bugs can be ironed out before.

If you have any questions or suggestions, feel free to post them here,
drop me a line, or ask right away in #D at freenode. While I am quite
busy at the moment, I'd be happy to help you with any issues
(particularly happy if they concern the SWIG side of implementing
enhancements, obviously, but also simple usage questions). Besides that,
as always, it would be nice just to hear about what you are using this for.

Happy coding,
David




Re: dcollections 2.0b

2010-09-06 Thread BLS

On 24/08/2010 17:45, Steven Schveighoffer wrote:

dcollections second beta version 2.0b is up.

This fixes a few bugs, and adds some features such as passing in
elements on construction. See the full changelog here:

http://www.dsource.org/projects/dcollections/wiki/ChangeLog

This release is long overdue, sorry to those of you waiting for these
fixes. I've had a very busy summer!

-Steve


Thanks for the update Steve. Once gain, a fantastic collection lib !!

Erm., I hoped for more.. at least for a nitty gritty tutorial - when 
and how to use cursors - ArrayLists/Arrays


Bjoern


Re: TDPL sales up from July

2010-08-30 Thread BLS

On 29/08/2010 23:29, Andrei Alexandrescu wrote:

On 08/29/2010 03:07 PM, Daniel de Kok wrote:

On Thu, 26 Aug 2010 22:39:31 -0700, Andrei Alexandrescu wrote:

I thought this might be of interest to the community - as of today,
August sales of TDPL from erdani.com redirected to Amazon have exceeded
those in July. The data is only indicative of a trend if anything, as it
only represents a fraction of the total sales.


That's excellent news! Do you have any idea how sales compare to other
non-mainstream PL books (say Real-World Haskell)?

Still have to pick up a copy. It seems that local bookstores have it in
stock :).

-- Daniel


Hi Daniel!

I don't have solid comparison data. One indication is the Amazon sales
rank (lower is better). At this moment TDPL has rank 86,607 and
Real-World Haskell has rank 133,809.

Andrei


Amazon Bestsellers Rank: #52,179 Aug/30


Re: Orange - a serialization library

2010-07-27 Thread BLS

On 25/07/2010 16:08, Jacob Carlborg wrote:

This if the first release of the Orange serialization library


XML D2/Phobos problem solved ?

Bjoern



Re: Plot2Kill 0.02

2010-07-18 Thread BLS

On 18/07/2010 22:36, dsimcha wrote:

heat maps


Sorry for my ignorance,
What are heat maps good for ?

Since I am more biz software guy, here my question.

Let's say I have this relation
A Project can have several Cost Centers.
A Cost Center can have several cost items.

I our sample . Project -P- has  say, 10 cost centers.
Cost Center no 1 takes already 60 percent.
The other cost centers (2-10) just take between 10 (blue) and 20 (green) 
percent.


-- So I want to color cost center no 1 related items in red.. . and the 
max percentage item in cost center no 2 dark red.

CC No 1 = {5,20,20,15}

Is this what a heat map is made for ?

and sorry ,  best example I am able to give atm..
bjoern


Re: Plot2Kill 0.02

2010-07-18 Thread BLS

On 19/07/2010 00:28, dsimcha wrote:

You've pretty much got it.


Thanks for your enlightening explanation. I think your plotting tool is 
also very valuable in standard business environments!


I was just a second too late..so sorry for answering twice and making so 
much noise.   bjoern


Re: Plot2Kill 0.02

2010-07-18 Thread BLS

On 19/07/2010 00:44, dsimcha wrote:

This can already be done programmatically (see Figure.xlim() and Figure.ylim()),


will have a look.


but is not exposed yet via the default plot window GUI.  This will be exposed 
when
I decide how I want to expose it.  The most obvious answer is dragging, but the
question then becomes, how do you zoom back out?


Scaling : The solution which comes immediately in mind is by using a 
scale factor. (1.0 by default)


I think the more interesting part is creating a rectangular area within 
your graph. ( I mean press left mouse button and create a rectangle) 
figure out which are the min. and max. values for each of the series, 
depending on the rectangle area. (series  == ranges, I guess)


Dragging ? Not sure what you mean.

bjoern


Re: SQLite 3.6.23.1 wrapper + connector

2010-07-18 Thread BLS

On 19/07/2010 00:57, dsimcha wrote:

  Given that sqlite is in the public domain,
maybe Phobos should eventually include SQLite + a nice D-ish wrapper for it, so
that people can use it w/o creating dependency hell in their projects.


Agreed, even a very popular and commercial multi OS RAD Tool called 
Real Basic comes bundled with SQLite.  Let's use this excellent tool 
instead of the thick openrj stuff, we had before.

-bjoern


Re: Fedora 14 to include D compiler

2010-07-13 Thread BLS

On 13/07/2010 19:57, Walter Bright wrote:

http://www.reddit.com/r/programming/comments/cp2qj/fedora_14_to_include_llvmbased_d_compiler/



Good thing ! IMHO it would makes sense if a cool application like 
*DReactor could be bundled.

*Like Tango, a very impressive and interesting library.

A+
Bjoern


Re: D Programlama Dili is almost finished

2010-07-06 Thread BLS

On 28/05/2010 19:40, Ali Çehreli wrote:

It is a Turkish D2 book.

I know that this news is not very useful for the members of this forum,
but I am proud to announce that my D book targeting the Turkish reader
is almost complete.

It is for the novice programmer. Complete with exercises and solutions,
it starts with the assignment operator and gradually builds other
concepts. (I must say that D is an easy language to teach to novice
programmers.)

Since starting in July 2009, I've been making the chapters freely
available at http://ddili.org/ders/d/

The free pdf version is around 520 pages these days.

After finishing the final two chapters, I will get back to bringing the
information up to date, e.g. the new operator overloading syntax should
replace the old one.

On a personal note, as far as I know, this book has been the first in
computer technology where Turkish precedes any similar work in English. :)

Thank you,
Ali


Hi Ali,
Excellent work. The automated Turkish-English Google translation is 
remarkable readable.


I also gave Turkish-German a try... A disaster :) Finally 
Turkish-French, which is also a disaster. Main reason is that the code 
snippets are translated too.



-bjoern





Re: dcollections 1.0 and 2.0a beta released

2010-05-23 Thread BLS

Fantastic work Steve,
Pretty good design IMHO, not sure why .. but somehow the collection 
battle reminds me to


Steve Vai vs Ry Cooder
vbg
Bjoern


Re: dmd 2.042 release

2010-03-31 Thread BLS

On 19/03/2010 19:01, Walter Bright wrote:

This is necessary to fix a memory corruption problem with arrays
introduced in 2.041.


http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.042.zip

Thanks to the many people who contributed to this update!


Especially thanks for the DLL fix(es).
I've just created a very simple test dll in XP/Vista/7 and everything 
looks fine.


Well I am going to enhance that test a bit in that I am using D TLS 
variables and WINDOWS hooks.. see how it works..,  I am not too 
pessimistic so far :)

Bjoern


Re: Tango 0.99.9 Kai released

2010-02-14 Thread BLS

On 10/02/2010 00:26, Lars Ivar Igesund wrote:

* !HomeFolder module



What de heck is * !HomeFolder module

Thanks for enlightenment..

Like Bobef already said we need  D2 support de..s..pera..te..ly  I 
think we have a good idea against 3 times constness.. NO ?





Re: dmd 1.056 and 2.040 release

2010-02-05 Thread BLS

On 30/01/2010 08:13, Walter Bright wrote:


http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.056.zip


http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.040.zip

Thanks to the many people who contributed to this update!


Instead of complaining (as usual) I would like to say Thank You for 
opening the complete D source code.
It is pretty clear that since D is open sourced we got much more fixes, 
and, not to forget, another level of ideas regarding future development 
tasks.


well done. Bjoern


Re: Code Poet with DWT ?

2009-12-01 Thread BLS

On 01/12/2009 14:09, John wrote:

Move on man, wxWidgets is doing the job for the project so keep it.

If someone wants later on to rewrite Code Poet using DWT or QtD, no
problem, let him do it.

I think D needs desperately a good IDE+Debugger (no offense Descent)
and I hope Code Poet to fill this gap.

I regret having done my original question.


John,
ATM there is nothing available in DWT which compares to WXAUI.(the 
docking manager)... and seriously no IDE can live without that. ( It 
depends on the implementation, but in general you can say that a plug-in 
based IDE requires that feature desperately.


I ask Frank (keinfarbon) if there is a chance to implement it. But Frank 
teaches me that this is more an RCP feature than a SWT, respective DWT, 
thingy.


Another reason why /I/ would not choose DWT as IDE GUI toolkit (atm) is 
that DWT creates pretty fat binaries.

And finally (sorry Frank) DWT is too Java-esque.

my 2 cents





Re: Code Poet, an IDE for D

2009-11-29 Thread BLS

On 11/11/2009 04:22, Jeremie Pelletier wrote:

Among other things, I started writing an IDE for D from scratch and
opened a SourceForge project for it a few minutes ago, I'll also open a
dsource project to link to the sf one in the following days.

Jeremie


Very good name, pretty cool looking tool.
a few notes :

I think in order to create an IDE which supports larger projects you 
should integrate a Source Code Management System.


D2 becomes reality , so drop D1 support.

Publish the Plug-In Interface ASAP.












Re: Code Poet, an IDE for D

2009-11-29 Thread BLS

On 29/11/2009 17:24, Adil Baig wrote:

The reason Tango wasn't ported to D2 is because D2 still in flux and has
been for a few years. Tango is an essential part of most D projects, and
as such, cannot be built on a moving target.



Tango is not even in sync with D1.






Re: bugzilla 424 - Unexpected OPTLINK Termination - solved!

2009-11-04 Thread BLS

On 03/11/2009 23:18, Walter Bright wrote:

Yigal Chripun wrote:

Once Optlink is moved to C and than D, it could grow new features like
link-time optimizations.


It does open up a lot of possibilities.

One I think would be of big benefit is for two COMDATs with different
names, but the same contents, being merged. This would eliminate a lot
of template bloat.


I think this could give DWT the necessary new breath...


Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS

Walter Bright wrote:

Christian Kamm wrote:

Christian Kamm wrote:

Is there a difference between
template Foo(T : U) {} and
template Foo(T) if(is(T : U)) {} ?



Walter Bright wrote:

Yes. Constraints determine the list of candidate template declarations,
but do not participate in the partial ordering of candidates to
determine the 'best' match.


Thanks for the explanation!

I expect the reason is that for constrained templates it is impossible 
to determine whether all valid template arguments for one would lead 
to a valid instantiation of another?





That's a good technical reason, but I also felt that the current way 
just made intuitive sense.


The current Template specialization implementation is doing a best fit 
search anyway, so why constraints are not able to use the same mechanism. ?


So, instead of IFTI we should have EFTI*, driven by constraints.
*The name is rather confusing so fuzzy templates are probably better.

bearophile brings in several times Scala/OCAML like pattern matching. 
Why not using that for constraints ?


IMO the current D constraints implementation is nice and easy, but I 
thing there is much more hidden power in that idea.


Thanks for ignoring my ignorance..


Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS

bearophile wrote:

BLS:
bearophile brings in several times Scala/OCAML like pattern matching. 
Why not using that for constraints ?

I have no idea how that works, though Bartosz has been looking into it.
O well, I am pretty sure that bearophile is willing to give you any 
information you need  :)


Pattern matching is handy and it can be powerful, for example I've seen OCaML 
code that uses it to implement a AVL search tree in about 15 lines of code. But 
probably it also adds lot of complexity to a language like D, so there are more 
important things to add to D2 now (like good concurrency).

Bye,
bearophile


I see your point... you are doing bio informatics..so speed matters.. 
for me the things are a bit different...


But I guess that you'll agree with me that Scala pattern matching has a 
reasonable syntax. (Not necessarily talking about How difficult is it 
from a compiler author's view)


object MatchTest2 extends Application {
  def matchTest(x: Any): Any = x match {
case 1 = one
case two = 2
case y: Int = scala.Int
  }
  println(matchTest(two))
}




Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS

Walter Bright wrote:

BLS wrote:

Walter Bright wrote:

BLS wrote:

(more intuitive than is not ..ahem.. is not a good enough reason)


I think it is a very good reason. Of course, we can argue about if it 
is actually intuitive or not.


ok. but that's only  eye candy, no ?






I once drove a tractor that you stepped on the gas to stop it, and 
released the pedal to get it to go. I nearly drove the thing through the 
owner's boat. Missed it by about an inch.


OK!, this  argument is simply _too_ good.  have.togive..up





Re: C++0x Concepts - Dead?

2009-07-15 Thread BLS

Christian Kamm wrote:

BLS Wrote:
I have somehow the idea that D constraints and template specialization 
should merge.


I also feel that specialization may just be a special case of constraints -
with the added benefit that implicit function template instantiation works.



will see what Walter is thinking.
Maybe we can call that stuff later on ... meta generics ? Now serious , 
looking a bit ahead, complete templated decision trees are /at least/ 
imaginable.



Is there a difference between
template Foo(T : U) {} and 
template Foo(T) if(is(T : U)) {} ?



erm, give me an hour or so.. :)


Re: C++0x Concepts - Dead?

2009-07-13 Thread BLS

Walter Bright wrote:
There are unconfirmed reports that this morning, the C++0x standards 
group in Frankfurt voted to kill Concepts.


Who cares. Or, in other words ; do you consider D constraints as can't 
life without feature ?

(no offense.. just think it's not that remarkable)


Re: Incorporating LINQ, State Diagrams Templating and Package Extension Into Java

2009-06-23 Thread BLS

Raju Renjit. G wrote:

This paper gives a method to incorporate table like data types into any programming 
languages (any language that does not have structs or classes, for example fortran). 
When such a thing is done it is very easy to incorporate SQL directly into the 
language. I mean I do not use any specialized classes to implement this (for the 
time being I do not have any other name for it. So I use the name LINQ.) So this 
proposal can be used with int, float, etc. LINQ to SQL is also done without any 
specialized classes. The title of that sub section is ``Passing SQL statements 
without quotes. It is just a trick and there is nothing complicated in it. 
That would make it similar to writing SQL statements on the interface of a database. 
And the proposal is not specific to any database like Oracle or MySQL or SQL Server. 
The next section contains a proposal for  incorporating state diagrams as a feature 
of an Object oriented PL in an object oriented way except for polymorphism. In the  
prop
osal the actions for each transitions in the diagrams can be written elsewhere. So something can be used to encapsulate only the underlying graph and the transitions can be written elsewhere (It is almost like drawing the diagram on paper. But a program cannot use pictures. So it is almost like drawing a graph.). The next section contains a proposal for incorporating templating as feature of a programming language in an object oriented way. If this is incorporated into a language, then compilation will become: First execute an object oriented program by the complier which in turn generates the actual program to be complied (well, all these done programatically and not retrieved from a database). So this will enable code reuse. The next section contains something like the generalized switch statement, array and list transformations, temporary expressions, the match loop etc. They are not complex. Please visit http://arxiv.org/abs/cs/0504025 . Also you will find an elegant way 
to have operator overloading in it. And also a new framework for object oriented programming languages.


What does that mean for D ?


Re: MiniD 2 - Might as well be done

2009-06-16 Thread BLS
Why not writing a book about D, Jarrett ? The MiniD documents are 
excellent.
In fact you, respective what you write, reminds me to Jesse Liberty + 
Humor. (well,... maybe C++ in 21 days was already a joke) but 
nevertheless Jesse's book was a kind of eye opener to me simply because 
it shows that is IS possible to explain difficult stuff in a smart way.

 So why not JB on D...?
In case of doubt : I am willing to send you a bottle of fine Cognac to 
give the book a very first go. (not kidding)


However, guess like anybody else, I just can say: Thanks for this 
interesting new language.

Björn



Re: Split digitalmars.D newsgroup into .D and .D2 newsgroups?

2009-05-15 Thread BLS

BCS wrote:

Hello BLS,


(I think it is not really top secret to talk about what is in use.
1) OCAML, 2) C and 3) ADA ... )


The only surprise there (if any) is OCAML. *Everyone* uses C and, last I 
heard, Ada is still the #1 choice for Bugs==DeadBodiesOrWorse 
development. From what I've heard, it's actually a darn nice language to 
work in if you are going to be doing all the engineering process stuff 
anyway.




Hello BCS :)

http://www.astree.ens.fr/
This is something Walter definitely should read too.

What's the story :

ASTRÉE is written in Objective Caml and is about 44000 lines long (plus 
external libraries). We needed a language with good performance (speed 
and memory usage) on reasonable equipment, easy support for advanced 
data structures, and type and memory safety. OCaml also allows for 
modular, clear and compact source code and makes it easy to work with 
recursive structures such as syntax trees


Björn


Re: Split digitalmars.D newsgroup into .D and .D2 newsgroups?

2009-05-15 Thread BLS

Georg Wrede wrote:



It'd be nice if some of them came to this NG.



will meet one of the leading guys this summer, let's see.


(FWIW, I'd sure prefer to fly with ADA or D, than with C.) :-)



So you better fly with Boeing !

ASTREE is a static analyzer for C programs that proves the absence of 
run-time errors in critical embedded software.
It has been applied to the flight control software of the Airbus 340 and 
380 airplanes. 


ASTREE is written in OCAML.  // http://www.astree.ens.fr/

Björn


Re: Split digitalmars.D newsgroup into .D and .D2 newsgroups?

2009-05-12 Thread BLS

Walter Bright wrote:

Is this a good idea?


No, promoting D also means having a couple of newsgroup entries each day.
Otherwise you'll have several 10 entries a month D newsgroups and this 
imo not very appealing to new visitors.

In other words, Bier erm, quantity rulez.
Björn


Re: Split digitalmars.D newsgroup into .D and .D2 newsgroups?

2009-05-12 Thread BLS

Andrei Alexandrescu wrote:

Walter Bright wrote:

BLS wrote:
No, promoting D also means having a couple of newsgroup entries each 
day.
Otherwise you'll have several 10 entries a month D newsgroups and 
this imo not very appealing to new visitors.

In other words, Bier erm, quantity rulez.


Yeah, I had second thoughts along those same lines.



Beer or ... :)


I think -users and -developers should work. It works for Boost very well.

Andrei


May be I am wrong, but the Boost respective CPP community is atm not 
comparable to the D community.

I mean let's wait a while.

F.I. I am in contact with airbus industries since 2.5 years and I can 
assure you they have an eye on D.
(I think it is not really top secret to tell you that 1) OCAML, 2) C and 
3) ADA are in use... so far)

Björn


Re: Split digitalmars.D newsgroup into .D and .D2 newsgroups?

2009-05-12 Thread BLS

Andrei Alexandrescu wrote:

Walter Bright wrote:

BLS wrote:
No, promoting D also means having a couple of newsgroup entries each 
day.
Otherwise you'll have several 10 entries a month D newsgroups and 
this imo not very appealing to new visitors.

In other words, Bier erm, quantity rulez.


Yeah, I had second thoughts along those same lines.




you mean Beer or ... :)

I think -users and -developers should work. It works for Boost very well.

Andrei


May be I am wrong, but the Boost respective CPP community is atm not 
comparable to the D community.

I mean let's wait a while.

F.I. I am in contact with airbus industries since 2.5 years and I can 
assure you they have an eye on D.

(I think it is not really top secret to talk about what is in use.
1) OCAML, 2) C and 3) ADA ... )

Björn


Off topic

2009-05-12 Thread BLS

Derek Parnell wrote:

On Tue, 12 May 2009 15:59:05 -0500, Andrei Alexandrescu wrote:


Walter Bright wrote:

BLS wrote:

No, promoting D also means having a couple of newsgroup entries each day.
Otherwise you'll have several 10 entries a month D newsgroups and 
this imo not very appealing to new visitors.

In other words, Bier erm, quantity rulez.

Yeah, I had second thoughts along those same lines.

I think -users and -developers should work. It works for Boost very well.


I'm not used to Boost groups, so who is expected to post to -users? Are
they users of D (that is, application developers)? Who posts to
-developers? Are they the people developing D itself or
application/tool/library developers (otherwise known as users of D)?



Derek, may I contact you by Skype ?
I will stay for about 6 month in Brisbane to fulfill a software contract.
Live in Europe, Time difference GMT +8.

Björn  nanali at  wanadoo dot ...  fr


Re: Open source dmd on Reddit!

2009-03-08 Thread BLS

Daniel Keep wrote:


As for the IDE issue, I'm increasingly of the opinion that this is a
shortcoming of IDEs.  For example, I've never seen an IDE that got
script in HTML right.


Netbeans 6.5
Björn