February 19, 2014
On 02/18/2014 12:46 PM, simendsjo wrote:
> I've created two more videos, but they are pure live-coding D basics and
> probably of less interest to most of the users here:
> https://www.youtube.com/playlist?list=PLqABwcsDQUo59iBOM5DFtqbwrMhL4PWcQ
>
> I expect there will be made an announcement about that YouTube channel
> as soon as we upload a couple of more videos.

Cool!
April 06, 2014
On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote:
> .. preamble
>
> The rejectedsoftware repo is based on an earlier version of mine which in turn is based on the original by Steve Teale (britseye).
>
> (... lots of compiler errors ...)
>
> What you are seeing are missing dependencies. DMD won't figure out dependencies you are using without you specifying it in detail.
>
> You should be using dub directly rather than dmd. Specify your dependencies in the package.json file, and use "dub run" to run the application.
>
> I created a video tutorial a couple of days ago that might help you get started using dub: http://youtu.be/8TV9ZZteYEU

Following Nick advice I've completed my project by using dmd and specifying dependencies manually, it's a tiny project after all. Everything seems to work fine. So...

After seen your tutorials (at youtube, by the way very useful indeed) I'm now trying to port my code to use dub, again I have a doubt.

In my code, at 'dub.json' file I've wrote:
	"dependencies": {
            "mysql-native" : ">=0.0.12"
	}

When trying to build, I've got an error from mysql-native code:
$HOME/.dub/packages/mysql-native-0.0.12/source/mysql/connection.d(333): Error: cannot implicitly convert expression (t % 24) of type int to ubyte


But this error seems to be already solved in github repo for mysql-native.

I manually copy the files from my cloned copy of mysql-native into
$HOME/.dub/packages/mysql-native-0.0.12/source/mysql/

and now everything works fine.

Am I making an error when specifying my dependencies??


April 06, 2014
On 02/18/2014 01:29 PM, simendsjo wrote:
> On Tuesday, 18 February 201hanks for the nod. It's good to see that all
> those hours were
> not wast4 at 11:56:23 UTC, Steve Teale wrote:
>> On Tuesday, 18 February 2014 at 01:04:10 UTC, simendsjo wrote:
>>> >
>>> The rejectedsoftware repo is based on an earlier version of mine
>>> which in turn is based on the original by Steve Teale (britseye).
>>>
>> Thanks for the nod. It's good to see that all those hours were not
>> wasted.
>
> And this is a reminder that I should finish the rewrite to not let all
> those hours go to waste :) The code everyone uses is pretty much exactly
> your original code with many small refactorings like remove magic
> constants. So big thanks for doing all that work!

Please do, a concise and performant ORM (Datamapper) for MySQL is a huge selling point.
I remember some good ideas in http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/4526/.
April 06, 2014
On 4/6/2014 3:05 PM, salvari wrote:
>
> Following Nick advice I've completed my project by using dmd and
> specifying dependencies manually, it's a tiny project after all.
> Everything seems to work fine. So...
>
> After seen your tutorials (at youtube, by the way very useful indeed)
> I'm now trying to port my code to use dub, again I have a doubt.
>
> In my code, at 'dub.json' file I've wrote:
>      "dependencies": {
>              "mysql-native" : ">=0.0.12"
>      }
>
> When trying to build, I've got an error from mysql-native code:
> $HOME/.dub/packages/mysql-native-0.0.12/source/mysql/connection.d(333):
> Error: cannot implicitly convert expression (t % 24) of type int to ubyte
>
>
> But this error seems to be already solved in github repo for mysql-native.
>
> I manually copy the files from my cloned copy of mysql-native into
> $HOME/.dub/packages/mysql-native-0.0.12/source/mysql/
>
> and now everything works fine.
>
> Am I making an error when specifying my dependencies??
>

IMO, DUB really needs a way to specify a specific Git commit hash:
https://github.com/rejectedsoftware/dub/issues/51

I've tagged the current mysql-native HEAD as v0.0.13, so as soon as the dub repository sees the update (check http://code.dlang.org/packages/mysql-native ), you should be able to just do: "mysql-native" : ">=0.0.13"

April 06, 2014
On 04/06/2014 09:05 PM, salvari wrote:
>
> In my code, at 'dub.json' file I've wrote:
>      "dependencies": {
>              "mysql-native" : ">=0.0.12"
>      }
>
> When trying to build, I've got an error from mysql-native code:
> $HOME/.dub/packages/mysql-native-0.0.12/source/mysql/connection.d(333):
> Error: cannot implicitly convert expression (t % 24) of type int to ubyte
>
>
> But this error seems to be already solved in github repo for mysql-native.

You can use "~master" to get the latest version of a package.
http://code.dlang.org/package-format#version-specs
April 07, 2014
On Sunday, 6 April 2014 at 22:37:08 UTC, Martin Nowak wrote:
>
> You can use "~master" to get the latest version of a package.
> http://code.dlang.org/package-format#version-specs

I thought that was deprecated (according to the format description at code.dlang.org)
April 07, 2014
Am 07.04.2014 02:35, schrieb Nick Sabalausky:
> On Sunday, 6 April 2014 at 22:37:08 UTC, Martin Nowak wrote:
>>
>> You can use "~master" to get the latest version of a package.
>> http://code.dlang.org/package-format#version-specs
>
> I thought that was deprecated (according to the format description at
> code.dlang.org)

Seems like that documentation change was uploaded a bit too early. The deprecation will come with 0.9.22 (there is a beta version available for download) and there will be two alternative mechanisms to use non-tagged versions of a package then; user/system wide overrides ("dub add-override ...") and using the new dub.selections.json file.
April 07, 2014
On Monday, 17 February 2014 at 22:54:58 UTC, salvari wrote:
> Hi all!
>
> After 14 years using Perl for programming at job I'm now learning D. (And enjoying it)
>
> We've been using Perl (at job) for years for loading input data (UTF files) into a database and using these data for different purposes.
>
> The volume of input data files has been constantly increasing along the years and, eventually, we need a faster solution, that's the reason to switch back to compiled languages, and D seemed interesting enough to give it a try. :-)
>
> As a newbie I've a few questions. I'm already using D and it's working fine, although I'm writing baby-D the performance improvement is impressive, I'm now trying to use mysql native access. It seems there are two possibilities:
>
> - https://github.com/simendsjo/mysqln
> - https://github.com/rejectedsoftware/mysql-native

Quite by accident/coincidence, I recently returned to my mysqln effort to see if it would still build with the latest dmd.

I had also reinstalled MySQL recently so it was a different version, and that resulted in a few tweaks to the unit tests. However, other than that, I had no great problem.

I then set about trying to minimize memory allocations, and hopefully get the thing to be a bit more speedy. I think I have made some improvements there.

Now I realize that the code is pretty impenetrable. It's dealing with a protocol that is really very basic, badly documented, and consists of streams of ubytes minimized as much as possible, probably by disparate authors. You don't know what the next byte might represent until you've looked at the current one in context, so that makes it as bad a candidate for an input range as UTF8, or worse.

However, on a return visit, I'm not inclined to change my mind about the higher level interactions. I think the ability to read a specific table row into a tuple of D types, or to populate a D struct is quite cool. Also result sets with multiple rows can constitute an input range, so the std.algorithm stuff should be fine for doing finer graded selection than that provided by the SQL query.

If you want to do database stuff that avoids knowledge of how to use SQL, then I'd say it could be wrapped to provide that sort of thing - but then I always hated Visual Basic.

If you give me a couple of weeks or less, I'll convert it into a tidy module that will build with dub, and then I will invite the D aficionados to tell me how I can improve the efficiency of the protocol handling, and the template stuff that I used. From previous experience, I'm fairly confident that I won't get any takers, so I'll just keep up with the newsgroup and do the best I can to keep up with idiomatic D usage, as long as it's not just to show how cleverly things can be done.

I still quite like it, and if I had to seriously write something in D that needed MySQL, I would use it in preference to my earlier attempt at a wrapper around the C library.

But thanks for the interest
Steve.
April 08, 2014
On 04/07/2014 07:27 PM, Steve Teale wrote:
> On Monday, 17 February 2014 at 22:54:58 UTC, salvari wrote:
>> Hi all!
>>
>> After 14 years using Perl for programming at job I'm now learning D.
>> (And enjoying it)
>>
>> We've been using Perl (at job) for years for loading input data (UTF
>> files) into a database and using these data for different purposes.
>>
>> The volume of input data files has been constantly increasing along
>> the years and, eventually, we need a faster solution, that's the
>> reason to switch back to compiled languages, and D seemed interesting
>> enough to give it a try. :-)
>>
>> As a newbie I've a few questions. I'm already using D and it's working
>> fine, although I'm writing baby-D the performance improvement is
>> impressive, I'm now trying to use mysql native access. It seems there
>> are two possibilities:
>>
>> - https://github.com/simendsjo/mysqln
>> - https://github.com/rejectedsoftware/mysql-native
>
> Quite by accident/coincidence, I recently returned to my mysqln effort
> to see if it would still build with the latest dmd.

This is great news. If you look at the simendsjo repo, there's a rewrite in progress, but it's still missing some key features.
The rejectedsoftware repo is the one in production use.

Here's a TODO: http://forum.dlang.org/post/zsfxoggzwkmqjzyxbwgc@forum.dlang.org

And a recent discussion on github: https://github.com/rejectedsoftware/mysql-native/issues/34#issuecomment-39708245

The code is still very much your own with some restructuring and cleanups, so hopefully you'll feel at home.
April 08, 2014
On 4/8/2014 2:51 AM, simendsjo wrote:
>
> This is great news. If you look at the simendsjo repo, there's a rewrite
> in progress, but it's still missing some key features.
> The rejectedsoftware repo is the one in production use.
>
> Here's a TODO:
> http://forum.dlang.org/post/zsfxoggzwkmqjzyxbwgc@forum.dlang.org
>

It looks like at least some of that TODO takes things beyond where the rejectedsoftware version is, which is good, of course. But what would you say are the things needed just to bring it up to parity with the rejectedsoftware version? (So we could declare it the new "official" and either replace or deprecate the current one.)