Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/4/2014 12:18 PM, Gary Willoughby wrote:

Tkd v1.0.0-beta

https://github.com/nomad-software/tkd
http://code.dlang.org/packages/tkd



Looks great, anxious to give this a try!

BTW, on the main readme page, the links into the API docs don't appear 
to be working (although it might be a GitHub issue).




Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/4/2014 12:44 PM, Nick Sabalausky wrote:

On 5/4/2014 12:18 PM, Gary Willoughby wrote:

Tkd v1.0.0-beta

https://github.com/nomad-software/tkd
http://code.dlang.org/packages/tkd



Looks great, anxious to give this a try!

BTW, on the main readme page, the links into the API docs don't appear
to be working (although it might be a GitHub issue).



I'm getting compile errors building the example (Win32 DMD 2.065.0):

> dub build --config=example
## Warning for package tkd, configuration example ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass 
custom flags

to the compiler, or use one of the suggestions below:

-Jsource/example/media: Use "stringImportPaths" to specify import paths 
in a compiler independent way


Checking dependencies in 'C:\DevProj\tkd'
Building configuration "example", build type debug
Running dmd (compile)...
source\tkd\interpreter\tcl.d(189): Error: not a property name.toStringz
source\tkd\interpreter\tcl.d(189): Error: not a property value.to!string
source\tkd\interpreter\tcl.d(189): Error: not a property to(value).toStringz
source\tkd\widget\common\value.d(45): Error: template instance 
tkd.interpreter.tcl.Tcl.setVariable!string error instantiating
source\example\example.d(36):instantiated from here: 
setValue!(Entry)
source\example\example.d(36): Error: template instance 
tkd.widget.entry.Entry.Value!(_valueVariable, string).setValue!(Entry) 
error instantiating
source\tkd\interpreter\tcl.d(93): Error: not a property format(script, 
_param_1, _param_2, _param_3).toStringz
source\tkd\interpreter\tcl.d(97): Error: not a property 
Tcl_GetStringResult(this._interpreter).to!string
source\tkd\dialog\colordialog.d(97): Error: template instance 
tkd.interpreter.tcl.Tcl.eval!(string, string, string) error instantiating
source\example\example.d(51):instantiated from here: 
show!(ColorDialog)
source\tkd\interpreter\tcl.d(93): Error: not a property format(script, 
_param_1, _param_2).toStringz
source\tkd\interpreter\tcl.d(97): Error: not a property 
Tcl_GetStringResult(this._interpreter).to!string
source\tkd\dialog\colordialog.d(101): Error: template instance 
tkd.interpreter.tcl.Tcl.eval!(string, string) error instantiating
source\example\example.d(51):instantiated from here: 
show!(ColorDialog)
source\tkd\interpreter\tcl.d(130): Error: not a property 
Tcl_GetStringResult(this._interpreter).to!string

source\tkd\interpreter\tcl.d(132): Error: not a property result.to!string
source\tkd\dialog\colordialog.d(104): Error: template instance 
tkd.interpreter.tcl.Tcl.getResult!string error instantiating
source\example\example.d(51):instantiated from here: 
show!(ColorDialog)
source\tkd\dialog\colordialog.d(104): Error: not a property 
this._tk.getResult
source\example\example.d(51): Error: template instance 
tkd.dialog.colordialog.ColorDialog.show!(ColorDialog) error instantiating
source\tkd\interpreter\tcl.d(93): Error: not a property format(script, 
_param_1, _param_2, _param_3, _param_4).toStringz
source\tkd\interpreter\tcl.d(97): Error: not a property 
Tcl_GetStringResult(this._interpreter).to!string
source\tkd\dialog\directorydialog.d(111): Error: template instance 
tkd.interpreter.tcl.Tcl.eval!(string, string, string, bool) error 
instantiating
source\example\example.d(65):instantiated from here: 
show!(DirectoryDialog)
source\tkd\interpreter\tcl.d(93): Error: not a property format(script, 
_param_1, _param_2, _param_3).toStringz
source\tkd\interpreter\tcl.d(97): Error: not a property 
Tcl_GetStringResult(this._interpreter).to!string

Error: Build command failed with exit code 1

Run 'dub help' for usage information.



Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/4/2014 2:39 PM, Gary Willoughby wrote:

On Sunday, 4 May 2014 at 18:20:01 UTC, Nick Sabalausky wrote:


I'm getting compile errors building the example (Win32 DMD 2.065.0):


Those errors are from the DMD -property flag being passed somewhere,
have a look and remove it if you're passing it.


Oh, I must have been running an old version of dub. It used to include 
-property by default but no longer does. Hmm, dub doesn't seem to be 
telling me its version...but I'm sure it's old, I'll update it.




Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/4/2014 3:11 PM, Nick Sabalausky wrote:

On 5/4/2014 2:39 PM, Gary Willoughby wrote:

On Sunday, 4 May 2014 at 18:20:01 UTC, Nick Sabalausky wrote:


I'm getting compile errors building the example (Win32 DMD 2.065.0):


Those errors are from the DMD -property flag being passed somewhere,
have a look and remove it if you're passing it.


Oh, I must have been running an old version of dub. It used to include
-property by default but no longer does. Hmm, dub doesn't seem to be
telling me its version...but I'm sure it's old, I'll update it.



Just updated to latest DUB release (v0.9.21), but now I'm getting this:

> dub build --force --config=example
x11: ["x11"]
tcltk: ["tcltk", "x11"]
tkd: ["tkd", "tcltk", "x11"]
Building x11 configuration "library", build type debug.
Running dmd...
Building tcltk configuration "library", build type debug.
Running dmd...
..\..\Users\Nick\AppData\Roaming\dub\packages\tcltk-8.6.1\.dub\build\library-debug-windows-x86-dmd-C9527B3CFF40A7D16A18C4624EF00288\tcltk.lib: 
Error: multiple definition of tcl_38_307: _Tcl_Main and Tcl_Main: _Tcl_Main
FAIL 
..\..\Users\Nick\AppData\Roaming\dub\packages\tcltk-8.6.1\.dub\build\library-debug-windows-x86-dmd-C9527B3CFF40A7D16A18C4624EF00288 
tcltk staticLibrary

Error executing command build: DMD compile run failed with exit code 1



Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/4/2014 3:55 PM, Gary Willoughby wrote:

On Sunday, 4 May 2014 at 19:19:57 UTC, Nick Sabalausky wrote:

Just updated to latest DUB release (v0.9.21), but now I'm getting this:


That's building with the config 'library'. If you want to run the
example build with:

dub --config=example

in the root of the tkd repo.


No, I did indeed use "--config=example", see my previous post. Even with 
your exact line above:


dub --config=example

I still get the same result.



Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-05 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/5/2014 4:58 AM, Gary Willoughby wrote:

On Sunday, 4 May 2014 at 19:19:57 UTC, Nick Sabalausky wrote:


-Jsource/example/media: Use "stringImportPaths" to specify
import paths in a compiler independent way



Error: multiple definition of tcl_38_307: _Tcl_Main and Tcl_Main:
_Tcl_Main


These errors should now be fixed in Tkd v1.0.1-beta.


Excellent. I just grabbed the latest, copied the dlls and setup scripts, 
and it works now.


I did find & file a couple issues though:
https://github.com/nomad-software/tcltk/issues/4
https://github.com/nomad-software/tkd/issues/11

Also, regarding DUB directory copying for the tcl init scripts, the docs 
mention a "postBuildCommands" which I would think could be used for that 
purpose (or for pretty much anything else).




Re: My D book is now officially coming soon

2014-05-06 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/6/2014 9:11 AM, Adam D. Ruppe wrote:

On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote:

Any way to see the TOC?


Hmm, not on the website yet but here it is.

> [snip]

Sounds awesome!



Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-08 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/8/2014 1:46 PM, Gary Willoughby wrote:


If you're building the next Steam or Spotify use Qt/Gtk.


Or better yet, don't. Steam's UI is terrible. Clicking search 
suggestions often does nothing, the search result paging is goofy as 
hell and very impractical, the whole thing's absurdly sluggish, in 
general ignores any and all system settings, menu dropdowns open upon 
hover instead of click, and, oh yea, my trackpad's scrolling gestures 
don't even fucking work on it (they work fine on nearly anything else).


That's all just off the top of my head. From what I've seen of Tk so 
far, Steam would have been *far* better if it had used it instead of 
going to the bother of reinventing everything really, really badly. 
(Well, at least Steam isn't all-green anymore like it used to be :/ )




Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-08 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/8/2014 4:35 PM, Ben Boeckel via Digitalmars-d-announce wrote:

On Thu, May 08, 2014 at 15:41:57 -0400, Nick Sabalausky via 
Digitalmars-d-announce wrote:

Or better yet, don't. Steam's UI is terrible. Clicking search
suggestions often does nothing, the search result paging is goofy as
hell and very impractical, the whole thing's absurdly sluggish, in
general ignores any and all system settings, menu dropdowns open upon
hover instead of click, and, oh yea, my trackpad's scrolling gestures
don't even fucking work on it (they work fine on nearly anything else).

That's all just off the top of my head. From what I've seen of Tk so
far, Steam would have been *far* better if it had used it instead of
going to the bother of reinventing everything really, really badly.
(Well, at least Steam isn't all-green anymore like it used to be :/ )


IIRC, Steam is a Java beast, so I wouldn't go off and blame Qt/Gtk for
that.

--Ben



I wasn't trying to blame Qt/Gtk (actually, I kinda like Qt stuff - I've 
heard it's not technically native UI, but hell if I can actually tell 
the difference. They've done a damn fine job.)


I was just saying Steam likely would have been better had they used 
something more sensible like Tk instead of going off rolling their own 
GUI. Qt probably would have work out alright, too. Not to say that Tk/Qt 
would have solved all of Steam's problems, but I imagine it would've 
likely been at least an improvement *even* if Tk isn't intended for 
non-simplistic stuff. A lot of that non-simple stuff isn't really a good 
idea anyway.




Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-05-08 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/8/2014 4:51 PM, Sönke Ludwig wrote:

Am 08.05.2014 21:41, schrieb Nick Sabalausky:

(...)my trackpad's scrolling gestures
don't even fucking work on it (they work fine on nearly anything else).



To be fair, some time ago I've had the joy to try and properly support
scrolling gestures properly for my UI framework and I wound up naming
the window class of my windows "OperaWindowClass", because that triggers
a special case path in the touchpad driver, which actually sends useful
window messages. I didn't find another way to get useful data. The whole
(Synaptics) driver is obviously nothing but a crapload of special case
junk to make the most popular applications and controls work, because
the people involved obviously don't manage to develop a standard API for

> pixel perfect scrolling.

Hmm, that may be so. I've yet to find one piece of OEM software that 
isn't (at best) barely-functional garbage. And I just noticed it 
apparently doesn't work in Tk even with its native controls, bizarrely 
enough. I honestly never would have even imagined that this stuff would 
actually manage to fail on native controls. It just seemed obvious that 
if there was anything *at all* it would work with, it would be native 
controls. What a mess.


OTOH, as little respect as I have for OEM software, I wouldn't be 
surprised if their hand is somewhat forced. If they'd done it by 
providing an API, nobody would bother to use the API. The only right way 
would be to integrate with existing OS support, but if the OS doesn't 
already provide that (I wouldn't know whether it does), then nothing's 
going to get companies like MS, Apple or likely even Canonical to 
actually give enough of a rat's ass to pull attention away from their 
own internal politics and agendas. Can't let nicely working user-facing 
features get in the way of corporate agendas and red tape, can they? ;)




Re: Livestreaming DConf?

2014-05-09 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/9/2014 3:48 PM, Andrei Alexandrescu wrote:


We at Facebook are very excited about the upcoming DConf 2014. In fact,
so excited we're considering livestreaming the event for the benefit of
the many of us who can't make it to Menlo Park, CA. Livestreaming
entails additional costs so we're trying to assess the size of the
online audience. Please follow up here and on twitter:


Yes please!!! I'd like some of that!



Re: Adam Simpkins replaces Manu Evans as speaker for DConf 2014

2014-05-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/14/2014 3:33 PM, Andrei Alexandrescu wrote:

Sadly Manu couldn't make the trip to DConf this year.


I'm both disappointed...


Adam Simpkins will replace him as a speaker. Adam is a senior engineer
at Facebook and will discuss opportunities and challenges using D at
Facebook.

http://dconf.org/2014/talks/simpkins.html



...and excited!


Re: Livestreaming DConf?

2014-05-15 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/15/2014 1:33 PM, Jesse Phillips wrote:

On Saturday, 10 May 2014 at 17:06:47 UTC, Joakim wrote:

I demand a telehuman stream:

http://youtube.com/watch?v=06tV60K-npw

Facebook has one of those, right? ;)


Haha, I'm disappointed they didn't go all the way back to landline.


Would've ruined the joke. Landline would have "just worked" :)


Re: Gearing up for DConf 2014

2014-05-19 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/19/2014 1:54 PM, Brian Schott wrote:

On Monday, 19 May 2014 at 17:18:27 UTC, Steven Schveighoffer wrote:

Would it be possible to have a separate space on the nametags for
"handles"?

-Steve


Hello, my name is INIGO MONTOYA YOU KILLED MY FATHER, PREPARE TO DIE


All of that on a name tag? Inconceivable!



Re: D's timeline

2014-05-20 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/20/2014 4:19 AM, Brad Roberts via Digitalmars-d-announce wrote:

I'm working on my presentation for the conference and I'm running out of
time.  I'd like to ask you guys for some help locating a few dates:

1) When 0.x transitioned from alpha to beta
2) Was there a beta to release candidate transition for 0.x -> 1.x? If
so, when?  I have the 1.00 release date, that one is easy.
3) When did the 2.x series switch similarly (alpha, beta, rc)?


There weren't really any alpha/beta/rc states for any of that. Neither 
formally nor informally. Back then, everything was all just "if it's 
good enough for you, then go ahead and use it". The stability was more 
of an ever-progressing (and occasionally regressing) gradient.


Also, 0.x -> 1.x was only an arbitrary "line in the sand". Version 1.000 
was just simply the name of the next regular release after 0.1xx 
(whatever the "xx" would have been, don't recall offhand). The 1.000 
moniker was more PR than technical.


Similarly, version 2.000 was just simply the next "mainline" release 
after it was decided to fork off a separate "no more breaking changes" 
branch (which is what 1.x *became* when 2.000 was released).


It was all definitely very much *not* "semantic versioning".


DAuth v0.6 - SHA-2 and Hash_DRBG

2014-05-22 Thread Nick Sabalausky via Digitalmars-d-announce
DAuth is a low-level authentication library which provides a 
simple-yet-flexible API, so your software can easily incorporate secure, 
upgradable user authentication based on salted password hashes.


By default, DAuth uses known-good hashing and randomization algorithms 
(currently SHA-512 and Hash_DRBG), but it accepts any Phobos-compatible 
hash digest or random number generator. You can have as much or as 
little control as you need, making DAuth suitable for both new projects 
and interfacing with any existing hashed-password store.


https://github.com/Abscissa/DAuth
http://code.dlang.org/packages/dauth

New in v0.6:

- Added SHA-2 (hash digest) and Hash_DRBG (cryptographically secure 
psuedo-random number generator), and set them as the new hash/RNG 
defaults. DAuth is only a temporary home for these - the SHA-2 
implementation has already been merged into phobos master, and I intend 
to prepare a pull request for the Hash_DRBG. But they're ready-to-use in 
DAuth in the meantime.


- Split DAuth into separate modules (using a "package.d" to preserve 
"import dauth;")


- Changed callbacks from functions to delegates.

- Fixed a few bugs, including an error in the dub package file.

Full changelog is here:
https://github.com/Abscissa/DAuth/blob/master/CHANGELOG.md


Re: DConf 2014 publishes schedule, opens registration

2014-05-23 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/23/2014 2:51 AM, Ali Çehreli wrote:

On 03/03/2014 04:13 PM, Ali Çehreli wrote:

 > On 03/03/2014 04:09 PM, Alessandro Stamatto wrote:
 >> Damn!
 >>
 >> No spoilers about the mysterious Scott Meyers talk, what is the last
 >> thing D needs?!?!?! Curious! 8-)
 >
 > Scott himself? ;)
 >
 > Ali

It turns out, I was right for the wrong reason. :)



You win DConf!


It was an excellent talk.



Indeed. *nods*.

It was the first Scott Meyers talk I'd seen. I knew he was a 
highly-regarded speaker, and now I totally see why.




Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-24 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/24/2014 3:49 PM, Adam D. Ruppe wrote:


thanks! Part of that was that I wanted to be deliberately
counter-culture. I almost never see anyone in these tech videos wearing
a tie, and while in the facebook building I think I was the only one
there too.

(the irony, a conservative business suit is my anti-authoritarian
apparel lolololol)



It seems a very "Talking Heads" irony, I like it :)



Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-24 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/24/2014 3:41 PM, Adam D. Ruppe wrote:


And good old mode 13h!



Real programmers used Mode X!

(I mainly used 13h though ;) )



Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-24 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/24/2014 3:49 PM, Adam D. Ruppe wrote:


thanks! Part of that was that I wanted to be deliberately
counter-culture. I almost never see anyone in these tech videos wearing
a tie, and while in the facebook building I think I was the only one
there too.

(the irony, a conservative business suit is my anti-authoritarian
apparel lolololol)



My favorite way to be counter-culture is to use slang terms in 
unexpected contexts. Like using a meme to make a point on a very 
technical topic. Or more commonly, well gee, I think deadpan delivery of 
anachronistic slang is just swell, dawg. Bonus pizzoints for mixing all 
those swingin' tubular eras...I really can dig that (Again, deadpan 
delivery be paramount). Or concocting me up some pluralities of 
formalism levels. Similarly, mixed cussing is golly good f**king fun.


Word.

(I really do like to deliberately use outdated slang, and the more 
deadpan the better.)




Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-24 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/25/2014 1:18 AM, Nick Sabalausky wrote:


Similarly, mixed cussing is golly...



s/golly/jolly/

Ugh...



Re: Video of my LDC talk @ FOSDEM'14

2014-05-26 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/26/2014 7:16 PM, Meta wrote:


Even better, install  with MPCHC and never need another video player
again.


Yes. This.



Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-26 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/26/2014 9:57 PM, Adam D. Ruppe wrote:

On Tuesday, 27 May 2014 at 01:42:27 UTC, Adam D. Ruppe wrote:

heh yeah, but I've been trying to quit cussing entirely.


oh a fun addendum to this, I told a friend of mine (whom I haven't
actually known that long) that I was trying to quit, and she was
incredulous that I even swore at all. She said "I can't picture you
swearing... there's a whole other side to you!"



Similar story here: I've never been one to shy away from swearing (not 
that I normally seek it out just for the heck of it or anything - though 
some might might that surprising ), but back in high school it seemed 
like *every* time I'd swear, there was always somebody around who'd get 
a deer-in-the-headlights look on their face and say "Nick! I've never 
heard you swear before!"


My mental-only response was always "Uhh, you must not have heard me talk 
much before..." ;)  Which was probably quite likely, mainly since...




BTW that's one thing about in-person conferences that is kinda
meta-fascinating too, seeing people rather than just email text. Even if
I knew what some of you look and sound like from previous videos or
pictures, it was still a bit of a surprise to meet there. Of course, at
the same time, while I'm fairly talkative and even a little forward on
emails, in person I tend to prefer to just hide in a corner until
someone approaches me, but even then just kinda slinker off and go back
to hiding before long so yeah.


Yea, same here. I can be a regular chatterbox in this NG, but in person 
I've always tended to be very quiet. Used to be *really* shy for a long 
time. Not quite so much now (HS and college developed a rebellious "fuck 
this shit"/"just don't give a rat's ass" ballsy streak in me), but I 
still tend toward the quiet and socially-awkward side whenever I'm not 
around people I already know really well.


I always chalked it up to the whole "nerd" thing: Inverse relationship 
in outgoingness between in-person vs semi-anonymous. (Although I'm 
probably closer to "otaku" nerd than "taped-glasses" nerd, FWIW). That, 
and on-the-fly comms is more difficult than "prep first then send" anyway.




Re: Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"

2014-05-27 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/27/2014 12:42 PM, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/


https://news.ycombinator.com/newest (search that page, if not found
click "More" and search again)

https://www.facebook.com/dlang.org/posts/855022447844771

https://twitter.com/D_Programming/status/471330026168651777


Andrei


What? Andrei's keynote isn't first? :(

Nonetheless, this Scott Meyers talk is fantastic (and a good choice for 
"first released").


Only one thing could've made this better: When the MC finishes his 
intro, there should be some heavy rock music and laser lights while 
Scott comes up on stage. :)  Oh well, maybe next year...Who's got the 
fog machine?




Re: Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"

2014-05-27 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/27/2014 6:10 PM, Johannes Totz wrote:

On 27/05/2014 18:43, "Ola Fosheim Grøstad"
" wrote:

On Tuesday, 27 May 2014 at 16:42:35 UTC, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/



Thanks, is it possible to put it on Youtube as well? Ustream stutters
every second from where I am which makes me feel sorry for the speaker…


http://rg3.github.io/youtube-dl/ helps with the stutter.



Or this FF extension (which is what I normally use):

http://www.downloadhelper.net/



Re: Adam D. Ruppe's "D Cookbook" now available!

2014-05-29 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/29/2014 8:45 AM, Adam D. Ruppe wrote:


One of the sections there talks about emulating random access on a
structure that doesn't really support it (a linked list) and focuses on
the hidden performance. That's the range-writer side of the same
range-consumer rule: don't try to get fancy and support something the
underlying data doesn't natively do because then you'll introduce bugs
and slowdowns that might be hard to find.


FWIW, and in the spirit of "maybe others could benefit too" (not sure 
whether your book touches on this or not):


I *used to be* strongly opposed to what you suggest there, deliberately 
not emulating accesses the data doesn't support. Even had a big long 
debate over it with Andrei. My reasoning was that you should be able to 
swap different data structures in and out to find the best performance, 
because *even if* you're relying on an operation the underlying data 
doesn't support, it could still be such a *small* and infrequent 
reliance that the localized performance hit is overshadowed by improved 
performance in the rest of your code.


Seemed a perfectly sound argument to be, but then I realized: It's 
trivial to write an adapter to emulate features on ranges or containers 
that don't support them. Not only is this more re-usable (ex: only need 
to write a particular method of "emulate random access" once), but far 
more importantly, this makes the feature-emulation EXPLICIT instead of 
hidden.


The upshot of that is, if a range or container doesn't support some 
feature, you can *still* trivially have an emulated drop-in-replacement, 
and it's equally easy (or even easier still) but BETTER because it's 
explicit, not hidden.




Re: [OT] Re: Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"

2014-05-29 Thread Nick Sabalausky via Digitalmars-d-announce

On 5/29/2014 9:14 AM, Steven Schveighoffer wrote:

On Thu, 29 May 2014 04:57:14 -0400, Alix Pexton
 wrote:


I couldn't resist looking up this debate, and its quite a fiery one
with no clear winner! There is no clear origin to the phrase and equal
arguments for and against both forms.


If you think I'll let it go you're mad, you got another thing comin'



Heh, I see I'm not the only one who's has that playing in their head 
through this whole conversation ;)


Oddly enough, my mind plays it as the Pat Boone cover (from "In a Metal 
Mood"). His version is surprisingly good.




Re: Real time captioning of D presentations

2014-06-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/2/2014 5:16 PM, Jonathan M Davis via Digitalmars-d-announce wrote:

On Mon, 02 Jun 2014 10:00:17 -0700
Walter Bright via Digitalmars-d-announce
 wrote:


Captioning also helps people who aren't native english speakers.


And native English speakers as well. It's not all that infrequent that I end
up temporarily turning on subtitles in a movie that I'm watching, because the
actor didn't say the line clearly enough.


Or because somebody in the production studio decided the music and sound 
effects needed to be at least 2x louder than the dialog. I've played 
games that had the same problem, too (but at least some of those will 
let you fix the studio's broken mixing). Ok, maybe that's not a problem 
for DConf, granted ;)


But yea, I use subtitles over english audio all the time, too (also a 
native speaker with no auditory disability).




Re: Interview at Lang.NEXT

2014-06-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/4/2014 2:33 PM, Craig Dillabaugh wrote:


But using function templates and the like you can still get fairly
'Python-like' code in D.  I find dealing with types to be one of the
areas that requires the 'least' amount of mental effort in software
development. I don't understand why people see 'untyped' languages as
simpler for the most part.


In my experience, using heavy dynamic typing throughout a program 
creates far more work (mainly debugging) than it avoids. Even in tiny 
~100 line programs, I've spent large amounts of time tracking down bugs 
a sane compiler would have immediately pointed out with a comparatively 
negligible amount of my effort spent on typing. Aside from C++ or Java, 
it's like you say: static types are one of the easiest parts to deal with.


Related note: I find it somewhat amusing (and a little depressing) that 
you can always identify the inexperienced programers by pulling out the 
"dynamic creates more debugging work" argument. The inexperienced (or 
experienced-but-still-sub-par) are always the ones who then try to tell 
you good programmers are better and more careful at avoiding silly 
mistakes. :) (And it's often stated using poor typing skills, too.)




Re: Interview at Lang.NEXT

2014-06-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/4/2014 3:43 PM, bearophile wrote:

Nick Sabalausky:


In my experience, using heavy dynamic typing throughout a program
creates far more work (mainly debugging) than it avoids. Even in tiny
~100 line programs, I've spent large amounts of time tracking down
bugs a sane compiler would have immediately pointed out with a
comparatively negligible amount of my effort spent on typing.


I think often this happens because you are trying to write Python/Ruby
code like you are using C++/Java, you assume the compiler will catch
certain kinds of bugs. If you write Python with the kind of coding
Python requires, taking more care of the things the Python interpreter
is not able to spot for you, you will use much less time to debug Python
code, and the overall coding time will be quite low. In Python you write
2-3 lines of tests every 1 line of code, and you test every functions
for the corner cases you can think of. You don't write more than few 3-6
lines of code without testing them immediately. So for certain aspects
you need more discipline to write Python, while for other things it
needs less. For small and medium programs this leads to sufficiently
correct Python code :-)



So let me get this straight: There are programmers out there who find 
the occasional type annotations on some declarations to be significantly 
more work than following a convention of nearly *quadrupling* the amount 
of code they have to write? Two to three lines of tests for every one 
line of real code is considered rapid development, "saving developer 
time", "just getting things done", etc? And all that's considered a 
"style" of coding?


You're right, I really don't understand that style of coding at all. ;)

Don't get me wrong, I am pretty big on unittests, but even still: If 
people are trying to save developer time by replacing each minor type 
annotation with several extra unittests (which are less reliable anyway 
- greater room for human error), then something's gone horribly wrong.


> It's usually quite hard to explain such
> differences in coding stile to people that are used to static typing.
>

That doesn't surprise me. It's also very difficult to explain 2+2==5 to 
people who are accustomed to basic arithmetic. ;)




Re: Chuck Allison's talk is up

2014-06-05 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/5/2014 4:24 PM, Mattcoder wrote:

On Thursday, 5 June 2014 at 19:36:36 UTC, Craig Dillabaugh wrote:

Are these eventually going to be posted for download somewhere (like
last year)?


Andrei said on reedit they will.


 My connection is just too slow for streaming.


But if you not want to wait, do this:

1) Add on your Chrome: "Video Downloader Professional" (Free).
2) Play the Video on ustream like you would do normally.
3) The extension will highlight, and now you can pick both: Low Or High
resolution *.flv file.

I use VLC player to play *.flv, but you can use another one.

Bye,

Matheus.


Or DownloadHelper if you're on FF:

https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/


Re: Chuck Allison's talk is up

2014-06-05 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/5/2014 7:51 PM, Olivier Henley wrote:

...

Sorry I know its annoying to have someone telling you guys what to do.


Not at all, it's a fair point you raise.

> I

would rather post a sticky thread, referencing Dicebot's channel, myself
but I'm brand new here and don't have any credentials to do so.



None of us have sticky-post credentials, this system doesn't actually 
support them. (The web interface at forums.dlang.org is really a 
front-end for an NNTP newsgroup served from news.digitalmars.org, which 
is how some of us access it. Heck, I'm posting this from Thunderbird 
right now.)




Re: Chuck Allison's talk is up

2014-06-05 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/5/2014 8:25 PM, Andrei Alexandrescu wrote:

On 6/5/14, 11:15 PM, Olivier Henley wrote:

I would love to spam my colleges here at Ubisoft Montreal with
DConf 2014 talks ... but UStream is blocked studio wide.

Is there any plans to mirror the talks somewhere else? We can
stream from Vimeo and Youtube.


Try https://archive.org/details/dconf2014-day01-talk03


p.s: My boss already agreed that I code my next tool in D. I'll
let you know in due time...


Fantastic. Keep us posted! -- Andrei


Yes, please do! Or at least to whatever extent is permitted. It'd be 
very cool to eventually hear that the next Splinter Cell, or Assassin's 
Creed, or whatever inevitably-major title from you guys was aided in 
some way by D. :)




Re: D Hackday this Friday

2014-06-06 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/6/2014 12:30 PM, Brad Anderson wrote:

On Friday, 6 June 2014 at 16:29:13 UTC, Brad Anderson wrote:


So is the plan to just comb over the issue tracker and fix easy issues
and close resolved or invalid issues?


I somehow mixed up "comb through" and "pore over" into a Trumpian
conflation.


:)

The bugtracker has a receding hairline, but the wig plugin doesn't quite 
fit the site.




Re: Offtopic: AMA (Was: Interview at Lang.NEXT)

2014-06-06 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/7/2014 12:21 AM, Craig Dillabaugh wrote:


Its all the fault of people texting on their cell phones and the like!
Too much work to write proper English words.  Amirite?


On those things, it *is* work! Even I've started giving up on proper 
grammar/capitalization/punctuation/spelling when texting (Not my normal 
comms choice, but I have a couple siblings that are of "everything must 
be in SMS form" age).


Oh well, at least we're not still entering text on number pads. I used 
to work on a WAP/WPL site (anyone remember those? anyone even *used* 
those? ;) ) Entering text was bad enough, but entering test-server URLs? 
Ugh. I never understood why the last Smash Bros game copied that cell 
phone text interface *intentionally*.




Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/10/2014 7:08 PM, Chris Cain wrote:


3. I'd also REALLY like to see seed support ranges/values giving ANY
type of integer and guarantee that few bytes are wasted (so, if it
supplies 64-bit ints and the generator's internal state array only
accepts 32-bit ints, it should spread the 64-bit int across two cells in
the array). I have working code in another language that does this, and
I wouldn't mind porting it to D for the standard library. I think this
would greatly simplify the seeding process in user code (since they
wouldn't have to care what the internal representation of the Random
state is, then).


Joseph and I have recently had some discussion on the idea of random 
streams which could work as you describe (The full discussion was in the 
digitalmars.D thread titled "isUniformRNG"). A finalized design would be 
dependent on Phobos's redesign of streams. But an unofficial design does 
exist, as it was needed for a crypto RNG I wrote[1][2]. An "RNG -> RNG 
stream" adapter could easily be written.


[1] Original version:
https://github.com/Abscissa/DAuth/blob/master/src/dauth/hashdrbg.d

[2] Phobos submission:
https://github.com/D-Programming-Language/phobos/pull/2208


4. I'd just like to say the idea of using ranges for seeds gets me giddy
because I could totally see a range that queries https://random.org for
true random bits to seed with, wrapped by a range that zeroes out the
memory on popFront. Convenient and safe (possibly? Needs review before I
get excited, obviously) for crypto purposes!


Personally, I wouldn't trust an internet-hosted RNG for crypto purposes 
as there's too many ways it could go wrong on either end. However, 
*mixing* it in as an additional source of entropy (together with a local 
source of non-determinism and a proper crypto-grade PRNG such as 
Hash_DRBG) sounds promising to me. Although I'm not a cryptography expert.



5. Another possible improvement would be something akin to a "remix"
function. It should work identically to reseeding, but instead of
setting the internal state to match the seed (as I see in
https://github.com/WebDrake/hap/blob/master/source/hap/random/generator.d#L485),
remixing should probably be XOR'd into the current state. That way if
you have a state based on some real entropy, you can slowly, over time,
drip in more entropy into the state.


Interesting that you mention that. Hash_DRBG does pretty much that 
(although it's a little more complicated than an simple XOR). While I'm 
not particularly familiar with any others, I'd imagine that's probably a 
typical behavior among cryptographic PRNGs in general.




Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/11/2014 2:41 AM, Joseph Rushton Wakeling wrote:

5. Another possible improvement would be something akin to a "remix"
function. It should work identically to reseeding, but instead of
setting the internal state to match the seed (as I see in
https://github.com/WebDrake/hap/blob/master/source/hap/random/generator.d#L485),
remixing should probably be XOR'd into the current state. That way if
you have a state based on some real entropy, you can slowly, over
time, drip in more entropy into the state.


Also a very interesting suggestion.  Is there a standard name for this
kind of procedure?



NIST's crypto-RNG papers just refer to it as "reseeding", so there might 
not be a standard name for it. FWIW, I've taken to calling it 
"accumulating entropy".




Re: DMD 2.066 Alpha

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/11/2014 9:19 AM, Andrew Edwards wrote:

On 6/11/14, 2:23 AM, deadalnix wrote:

I'll be there to test and bug report ! Thank for being the release
lieutenant.


In my world a lieutenant is absolutely useless. Given the tutelage and
guidance of solid staff non-commissioned officer, some day they will
become productive members of the community. If they don't find such a
mentor however, they will become loose cannons: destroying all in their
path.

I tend to see life from a different perspective. Officers, in general,
are quite useless. They are the "good idea fairies" who give little, if
any, consideration to the ramifications of their ideas/proposals and
will stop at nothing to see them come to fruition: regardless of
consequences. Worse still, they are absolutely incapable of implementing
the ideas/proposals they generate.



Reminds me of both MBAs and MASH ;)



Re: hap.random: a new random number library for D

2014-06-11 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/11/2014 12:35 PM, Kagamin wrote:


In some scenarios impredictability is not enough. For example, when you
generate a session id, an attacker doesn't have to predict it ahead of
time, he can guess it at any time later. And if they listen to radio
waves - that's an "open protocol", an attacker can setup antenna near
their antenna and get the same readings.


An interesting point.


Cryptographic PRNG and quantum
TRNG are better isolated, so it's harder to read them.


FWIW, a cryptographic PRNG isn't necessarily well-isolated. Being a 
PRNG, the isolation of a cryptographic PRNG is primarily limited to two 
main things:


- The isolation of its entropy source(s) (which are not normally part of 
a crypto-PRNG's specification - it's just left as "choose a good one"), and


- The patterns of how data is drawn from the PRNG.

If the entropy source is poorly isolated (via poor choice of entropy 
source, or a failure within the entropy source), and the requests being 
made to the PRNG are relatively predictable or even guessable (quite 
likely given the nature of software), then a cryptographic PRNG won't be 
any better isolated than, say, the digits of PI.


TL;DR: The isolation of a cryptographic PRNG is that of its external 
entropy source, not the cryptographic PRNG algorithm itself.




Re: hap.random: a new random number library for D

2014-06-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/12/2014 4:49 AM, Chris Cain wrote:


Also, it has suggestions for entropy on
Windows (CryptGenRandom) which is something that will be necessary as well.



It should be RtlGenRandom: It's used by CryptGenRandom, it 
loads/requires/involves far less unnecessary cruft, and it's 
well-established as *not* being something MS even *could* change/remove 
even if they wanted to (due to some of they ways MS themselves already 
rely on it):


http://blogs.msdn.com/b/michael_howard/archive/2005/01/14/353379.aspx

But this updated system entropy generator you suggest already exists:

https://github.com/D-Programming-Language/phobos/pull/2208/files#diff-713ce153554afc99a07767cc8ba940aeR1189
https://github.com/D-Programming-Language/phobos/pull/2208/files#diff-713ce153554afc99a07767cc8ba940aeR1106

It's also ready-to-use as part of DAuth (which I admit might need a new 
name to avoid confusion with the totally unrelated OAuth):


https://github.com/Abscissa/DAuth/blob/master/src/dauth/hashdrbg.d#L51
https://github.com/Abscissa/DAuth/blob/master/src/dauth/hashdrbg.d#L201

Naturally, it doesn't yet exist in hap.random because, as Joseph said, 
hap.random's "step one" is to match the current std.random as closely as 
possible. I'd be happy to put together a PR to adapt my RNG stuff above 
to hap.random whenever it would be desired.




Re: Lang.NEXT panel

2014-06-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/10/2014 12:35 PM, justme wrote:

On Wednesday, 4 June 2014 at 06:13:39 UTC, Andrei Alexandrescu wrote:

Of possible interest.
http://www.reddit.com/r/programming/comments/278twt/panel_systems_programming_in_2014_and_beyond/


Andrei


IMHO, the coolest thing was when Rob Pike told about the tool they made
for automatically upgrading user source code to their next language
version.

That should be quite easy to implement now in D, and once done, would
give much needed room for breaking changes we feel should be done. Pike
seemed to be extremely satisfied they did it.


Personally, I wouldn't be comfortable trusting such a tool. Besides, I 
find that upgrading a codebase to a newer language version is one of the 
most trivial tasks I ever face in software development - even in D.


It's a cute trick, but not a worthwhile use of development resources.



Re: DMD 2.066 Alpha

2014-06-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/12/2014 8:06 PM, Andrei Alexandrescu wrote:


and
final/virtual functions can already be done easily.



But "final:" can't.


Re: DMD 2.066 Alpha

2014-06-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/12/2014 8:06 PM, Andrei Alexandrescu wrote:


I don't think it's that important. And definitely there's no ignoring
going on. There are plenty of things that are plenty more important,



Wait, so now we're rejecting work that isn't at the right priority 
level? Some people did seem to find "final:" (and therefore "virtual") 
important to them, so this really seems to fly in the face of the DConf 
talk about D development involving people "scratching their own itches".




Re: DMD 2.066 Alpha

2014-06-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/12/2014 11:13 PM, Andrei Alexandrescu wrote:

On 6/12/14, 7:26 PM, Daniel Murphy wrote:



It
1. allows escaping final, which we can't do without it or an equivalent
2. does exactly what everybody expects
3. is already implemented
4. looks much nicer than your proposal

Why not just leave it in?  I'm already using it, and it makes
extern(C++) classes MUCH more readable (ie DDMD)


Please no new keyword for what can be done already. It's not
proportional response.



AFAIK, escaping final *can't* be done.



Re: DMD 2.066 Alpha

2014-06-13 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/13/2014 12:49 PM, Andrei Alexandrescu wrote:


Being able to negate the "final:"
label is nice to have but not a must. Adding a keyword for that doesn't
scale - it would mean we'd need to add one keyword to undo each label.



No it doesn't mean that. "virtual" is very well established 
industry-wide as the anti-final. Just because we accept that does not 
mean we can't still do @~pure, @nothrow(false) or whatever for the ones 
which don't already have well-established names.




Re: dmd front end now switched to Boost license

2014-06-13 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/13/2014 8:15 PM, Mathias LANG wrote:

On Friday, 13 June 2014 at 11:31:10 UTC, Dmitry Olshansky wrote:

13-Jun-2014 04:31, Walter Bright пишет:

https://github.com/D-Programming-Language/dmd/pull/3655


Heh, I had been under the impression was already Boost. :P



It's probably nice to have less restrictive license, but what we aim
to achieve with that?

Make commercial companies contribute to DMD more freely?
There is no problem even with GPL.
Let them build and sell their own products out of DMDFE?
Highly unlikely to be a profitable anyway, and we'd better get
back the patches.


Wild guess: DMD in fedora, debian et al. repositories ?


I doubt it. First, it's the backend that's not technically OSI, frontend 
was (apparently) GPL. Second, I can't imagine any Linux distro rejecting 
GPL - they'd have to boot the kernel and core utils, too.


Boost has kinda become the favored "D" license anyway, Phobos etc., so 
it probably has a lot to do with that. Kinda weird to have the compiler 
and stdlib under different licenses.




Re: dmd front end now switched to Boost license

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 3:58 AM, Joakim wrote:

On Saturday, 14 June 2014 at 06:07:08 UTC, Nick Sabalausky wrote:

I doubt it. First, it's the backend that's not technically OSI,
frontend was (apparently) GPL. Second, I can't imagine any Linux
distro rejecting GPL - they'd have to boot the kernel and core utils,
too.


Actually, the frontend was dual-licensed under the Artistic license and
the GPL and dmd binaries were provided under the former, as the GPL
doesn't allow linking against a non-GPL backend.  The GPL alternative
was likely for gdc to link the frontend against the GPL'd gcc backend.


Well, GPL and Artistic are both OSI anyway.



Re: dmd front end now switched to Boost license

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 10:18 AM, Dmitry Olshansky wrote:

14-Jun-2014 04:46, Walter Bright пишет:


3. Harmonization with usage of Boost in the runtime library


In other words simplify licensing, but again compiler and runtime
library do not have to have anything in common. There is no issue to
begin with.



Uhh, *no*.

Scenario A:
--
Them: "What license does D use?"

Us: "Well, it depends if you're talking about the compiler or Phobos, 
the standard library. Phobos is licensed under Boost, whereas the 
compiler is dual-licensed under both Artistic and one of the many GPLs. 
(Although the compiler's backend is a source-publicly-available 
proprietary due to insurmountable historical IP reasons. But GDC/LDC are 
fully OSS.)"


Them: "Uhh...what? And WHY? And WTF?"

Us: "You see, blah blah blah inclusion into user code blah blah Phobos 
templates blah blah blah GPL alternative blah blah GDC blah blah..."


Them: "Jeesus, nevermind..."
--

Scenario B:
--
Them: "What license does D use?"

Us: "Boost. (Although the compiler's backend is a 
source-publicly-available proprietary due to insurmountable historical 
IP reasons. But GDC/LDC are fully OSS.)"


Them: "Huh. Weird, but whatever."
--

I'll take B, thanks. ;)



Re: dmd front end now switched to Boost license

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 2:47 PM, David Nadlinger wrote:

On Saturday, 14 June 2014 at 18:43:59 UTC, Walter Bright wrote:

And there's another advantage I neglected to mention - it allows DMDFE
code to be moved into Phobos without issues.


I don't think Nick's argument is particularly compelling,


Granted, it isn't a very big technical/legal argument, but I don't think 
those are the only important criteria. The thing is, D's licensing 
overall (DMDFE/DMDBE/LDC/GDC/Phobos) is kinda complicated. So any 
simplification, as long as it doesn't restrict anyone, is a net 
improvement, even if it isn't earth-shattering.



but the DDMD
<-> Phobos connection definitely makes the change very worthwhile in my
opinion.



Yea, I agree too, I hadn't thought of that one either.


Re: dmd front end now switched to Boost license

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 2:52 PM, Iain Buclaw via Digitalmars-d-announce wrote:

On 14 June 2014 19:03, Nick Sabalausky via Digitalmars-d-announce
 wrote:


Uhh, *no*.

Scenario A:
--
[..snip..]
--

Scenario B:
--
[..snip..]
--

I'll take B, thanks. ;)



You should really practise explaining things in a more succinct manner. ;-)



I should! Heck, even I've noticed that.

I used to pride myself on terse writing. Then (for other reasons) I 
decided I needed to improve my writing skills. Verbosity became a bad 
side effect of that ;)




Re: dmd front end now switched to Boost license

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 2:52 PM, Dmitry Olshansky wrote:

14-Jun-2014 22:03, Nick Sabalausky пишет:


Scenario A:
--
Them: "What license does D use?"


Me: WAT? Language is not a product in itself.


While that's technically true, people often think of them as complete 
products anyway. Esp with so many of the newer languages now having a 
"main"/"official" compiler/lib.



What license C++ use then?
In short, everything they care about was and is Boost.





Re: DMD 2.066 Alpha

2014-06-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/14/2014 5:49 PM, Jonathan M Davis via Digitalmars-d-announce wrote:


and it becomes a question of whether the familiarity of using
virtual instead of !final or final(false) (or whatever we come up with) is
worth adding another keyword


FWIW, I don't think "virtual" is all that valuable as a user-defined 
keyword anyway. But, emphasis on "FWIW".




Re: Interview at Lang.NEXT

2014-06-16 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/16/2014 10:00 AM, Bruno Medeiros wrote:


Java, which dynamic
language proponents like to bash for it's verbosity


Static language proponents like to bash Java for its verbosity, too!



Re: Tkd - Cross platform GUI toolkit based on Tcl/Tk

2014-06-20 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/20/2014 4:37 AM, Kagamin wrote:

On Thursday, 19 June 2014 at 19:24:15 UTC, SomeRiz wrote:

Visual Studio like editor for TkD :/


Hmm... visual designers can usually build pixel-oriented GUI, tk uses
layouts, which work with code a little better.


While it's been awhile since I've used visual GUI designers much, I seem 
to remember them (at least the better ones anyway) being perfectly 
capable of doing resizable layouts. Any limitations seemed to have more 
to do with the widgets and GUI libs themselves rather than any inherent 
drawback to GUI designers in general. I seem to recall doing some 
resizable layouts even as far back as VB3.


Re: hap.random: a new random number library for D

2014-06-20 Thread Nick Sabalausky via Digitalmars-d-announce

On 6/19/2014 5:27 PM, Joseph Rushton Wakeling wrote:


I realized that it ought to be possible to allow a more direct drop-in
replacement for std.random by adding static opCalls to the classes which
were previously structs.

Thoughts on this, in favour, against ... ?


I'm on the fence:

Pro: Upgrade paths and backwards compatibility are great, especially for 
Phobos.


Con: If any semantics are changed (default ref/value passing is the only 
one that comes to mind), then maybe it would mask potential upgrade 
issues. Breakage would force users to notice the change and (hopefully) 
deal with it appropriately.


I don't personally see it as a big deal either way, though.



Re: Smile, you're on Wired

2014-07-07 Thread Nick Sabalausky via Digitalmars-d-announce

On 7/7/2014 12:06 PM, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/2a20h5/wired_magazine_discovers_d/



Excellent article! Best introduction to D I've ever seen.

Not only that, but it also helps dissuade the misleading belief that 
"Facebook is written in PHP", so I'm extra-happy with the article :)




Re: DConf 2014 Keynote: High Performance Code Using D by Walter Bright

2014-07-17 Thread Nick Sabalausky via Digitalmars-d-announce

On 7/16/2014 5:15 AM, Jaroslav Hron wrote:

On Tuesday, 15 July 2014 at 16:20:34 UTC, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/2aruaf/dconf_2014_keynote_high_performance_code_using_d/


https://www.facebook.com/dlang.org/posts/885322668148082

https://twitter.com/D_Programming/status/489081312297635840


Andrei


Is the presentation itself available somewhere?


https://archive.org/details/dconf2014-day03-talk01



Re: DMD v2.066.0-rc1

2014-08-09 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/7/2014 11:34 AM, Manu via Digitalmars-d-announce wrote:


It's not because it's hard, it's because it's perceived as totally
backwards, and it undermines the trust in the ecosystem. It's all about
perception.

The Windows/Visual Studio development culture is pretty immature, and
expects nothing less than the level of polish and presentation that
Microsoft put into Visual Studio.
I have direct experience with hundreds of these sorts of developers. The
prevailing opinion is that Linux is rubbish for nerds, and if the ecosystem
presents itself in that style, it won't be taken seriously. You can't gain
the confidence of this community of developers unless you appeal to them on
their terms. First impressions and basic presentation are extremely
important to perception.
I think configuration friction in particular is extremely important to
eliminate; you are dealing with someone whose investment in D can be
measured in seconds, probably knows absolutely nothing about the ecosystem
technically, and is not yet sure if they even want to. Any friction between
them and a helpful little wizard that generates a hello world project for
them so they can start hacking about and see how it feels may quite
possibly dismiss it on contact.



While I (unfortunately) agree with everything you've said here, I can't 
help chiming in with one thing: Speaking as a programmer who's primarily 
used Windows ever since 3.1, anyone who earns a paycheck writing code 
*and* believes "Linux is rubbish for nerds"[1], needs to grow the fuck 
up, both professionally and intellectually. It's absolutely no different 
from a grown adult being a console fanboy. It's just pathetic and 
completely inexcusable for any so-called "professional".


[1] And you're right, such people *do* (inexplicably) exist. I've known 
some.




Re: DMD v2.066.0-rc1

2014-08-11 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/9/2014 10:57 AM, Dicebot wrote:

actually avoided learning anything out of the default comfort zone and
called that _professional attitude_.


People have some truly bizarre ideas about what constitutes 
professionalism. At a previous job I had, at one particular developer's 
meeting with one of the brass (it was a weekly meeting that primarily 
served to make this particular manager/co-owner feel like she was being 
useful - not that she ever was - by sticking her fingers where they 
didn't belong), by pure chance all the developers happened to be wearing 
shirts with collars. The manager made a big point about how happy she 
was to see that because (paraphrasing here) "shirt collars are 
professional".


Yea, forget competence, skill, ability, work ethic, demeanor...no, 
apparently "professionalism" involves..."shirt collars". Idiot.


That's not the only example of clothing-based naivety I've seen among 
people who *should* know better: It's truly disturbing how many 
businesspeople can be trivially fooled into thinking any old random con 
artist is a trustworthy professional, simply by the con artist walking 
into any dept store and buying a suit to wear. "Oh, I see he's wearing a 
suit. That means he must be very professional!"


People are morons.



Re: DMD v2.066.0-rc1

2014-08-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/11/2014 3:55 PM, Jonathan M Davis wrote:


The sad reality is that your physical appearance - including your
clothing - can have a big impact on how people perceive you, so in many
situations, wearing nicer clothing can have a definite impact. This is
particularly true when dealing with stuff like sales where you're
constantly having to deal with new people. That's not to say that
clothing makes the man, but impressions like that can matter, even if it
seems like they shouldn't. So, it makes a lot of sense for some folks to
wear nicer clothes - or "professional" clothes - as part of their job.
However, for engineers, it's ridiculous. We shouldn't normally be
interacting with anyone where it would matter. So, attire like t-shirt
and jeans should be fine. Our clothing should have little impact on our
job. And in most cases, if an engineering manager is pushing for that
sort of thing, I think that it's a very bad sign.



Yea, various things about appearance definitely have a subconscious 
effect on perception. That's a fairly deeply ingrained part of human 
nature, unfortunate as it may be.


But what really gets me is when people have it as a fully *conscious* 
belief, not just subconscious. Then my "WTF" meter just redlines.




Re: DMD v2.066.0-rc1

2014-08-14 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/7/2014 1:05 PM, Manu via Digitalmars-d-announce wrote:


I've never encountered anybody try and use MSC from the command line in
about 15 years professionally.


I've tried to. When using Marmalade. Marmalade's mandatory build system 
is very closed-off and VS-integrated, so when I needed to include other 
stuff into my workflow (forget exactly why/what), I had to invoke from a 
script. And it worked *very* poorly.


The fact that so few people use VS from the cmd line could partly be 
*because* it works so poorly:


Ex 1: There's a lot of apple fans who have rationalized all sorts of 
limitations as "good", or at least acceptable, long as the apple didn't 
support them. Then the moment apple would offer it, suddenly it'd be 
hailed as the greatest thing since sliced bread.


Ex 2: Linux users rarely use GUI file managers. I love GUI file 
managers, but when I'm on Linux, I find even I do a lot more of my file 
management on the cmdline than I normally would. I do that *because* 
linux file managers tend to be pretty bad (esp the Nautilus-based ones 
IMO). So I'm not surprised other Linux users aren't really into GUI file 
managers either.


We could be seeing a similar thing here. Something is shunned as "bad" 
*because* that particular world's version of it is very poorly done or 
otherwise unavailable.



That's what I mean about this culture; it's
the opposite of linux, and it outright rejects practises that are
linux-like.



While I don't doubt that's true of a lot of people in the industry, I 
have to question how much stubbornly clinging to ignorance can really 
count as a "culture". I'm tempted to claim that isn't culture at all, 
it's just pandemic pigheaded ignorance.




Re: COFF support for Win32 merged

2014-08-17 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/17/2014 5:57 AM, Jacob Carlborg wrote:

I though that this might be important enough to share on the announce list:

A pull request [1] by Rainer Schuetze which adds COFF support for Win32
has recently been merged by Walter. It seems to be enabled using the
-m32mscoff flag.

[1] https://github.com/D-Programming-Language/dmd/pull/3843



Wow! This is MAJOR! o_O



Re: D 2.066 is out. Enjoy!

2014-08-18 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/18/2014 7:07 PM, ketmar via Digitalmars-d-announce wrote:

On Mon, 18 Aug 2014 22:48:00 +
Vladimir Panteleev via Digitalmars-d-announce
 wrote:


I don't see how infrequent, stable releases are more likely to
provoke that reaction than frequent, unstable releases.

"stability" is something that cannot be achieved in living language.
and having official releases with new features is important to show
that project is alive and "mature".

i myself using dmd-git-head and heavily ;-) patched gdc, but when i
tried to convince my co-workers to use D, they looked at the page with
releases first. not feature list or some comparisons. neither to
"buglist". "as this is relatively young language, it must have frequent
releases with bugfixes and new features!" they tolerate some
regressions in some releases, but they want to see that releases.

don't ask me why they thinking like this. i don't know. but it's the
fact.



Well, people will invent *any* excuse to pass over anything they don't 
feel like bothering with. It sounds like that's probably what they were 
doing.




Re: D 2.066 is out. Enjoy!

2014-08-18 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/18/2014 7:14 PM, Dicebot wrote:


I also propose to start 2.067 beta branch right now and declare it yet
another bug-fixing release.


Seconded.



Re: COFF support for Win32 merged

2014-08-18 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/17/2014 5:57 AM, Jacob Carlborg wrote:

I though that this might be important enough to share on the announce list:

A pull request [1] by Rainer Schuetze which adds COFF support for Win32
has recently been merged by Walter. It seems to be enabled using the
-m32mscoff flag.

[1] https://github.com/D-Programming-Language/dmd/pull/3843



Heh, couldn't have come at a better time. I *just* hit this little 
nugget of fun:


Error 45: Too Much DEBUG Data for Old CodeView format



Re: D for the Win

2014-08-21 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/20/2014 5:39 PM, Peter Alexander wrote:

Ha, that opDollar thing in the HTML generator is the nastiest D hack
I've seen :-P


Yea, this *statement* really made me go o_O

   link[$.rel = "foobar", $.type = "text/css"];

That's a lot of syntax abuse there!

Still, if it works for him, great, who am I to complain? At the end of 
the day, it's just a tool.


Re: D for the Win

2014-08-21 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/20/2014 6:57 PM, Paulo Pinto wrote:

Am 21.08.2014 00:02, schrieb anonymous:


No, no, "Dlang Dlang Über Alles" is a take on "Deutschland
Deutschland über alles" (Germany Germany over everything), the
first verse of the national anthem as sung in Nazi times.

I was actually worried if the author is German. He's not,
thankfully. He's from Israel. From a German author that would be
an embracement of fascism. Coming from an Israeli, I don't really
know where to put it, probably completely benign.


As a Portuguese living in Germany, I would say not everyone knows that
outside Germany.

Specially the younger generations, they just use it because it sounds cool.



"Über Alles" always just makes me think of Hanzel und Gretyl: 
http://en.wikipedia.org/wiki/%C3%9Cber_Alles_%28album%29


Gotta love tongue-in-cheek psuedo-German metal ;)



DAuth v0.6.1 - Salted Hashed Password Library

2014-08-30 Thread Nick Sabalausky via Digitalmars-d-announce

An update to DAuth is out:

https://github.com/Abscissa/DAuth

Main Changes:
- Add support for DMD 2.066 (Now supports v2.064.2 through v2.066.0)
- Supports crypt(3)-style hash strings for MS5, SHA-256 and SHA-512.
- Improved README
- Improved API Reference - now uses ddox.

Full ChangeLog:
https://github.com/Abscissa/DAuth/blob/master/CHANGELOG.md

Coming on the horizon: DAuth will be rebranded as "InstaUser Basic". It 
will be one pillar of a broader multiple-lib project called InstaUser, 
which will also include optional higher-level tools "InstaUser Store" 
and "InstaUser Web".


Re: DAuth v0.6.1 - Salted Hashed Password Library

2014-08-30 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/30/2014 6:29 AM, Nick Sabalausky wrote:

An update to DAuth is out:

https://github.com/Abscissa/DAuth

Main Changes:
- Add support for DMD 2.066 (Now supports v2.064.2 through v2.066.0)
- Supports crypt(3)-style hash strings for MS5, SHA-256 and SHA-512.


Would you believe *MD5*, not MS5. Need sleep apparently... ;)



Re: Blog post on hidden treasure in the D standard library.

2014-08-30 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/30/2014 5:38 AM, Gary Willoughby wrote:


˙ǝƃɐnƃuɐן uʍo ɹıǝɥʇ ǝʇıɹʍ ɹo ʞɐǝds pןnoɥs ʎǝɥʇ ʍoɥ uo ǝןdoǝd ɥsıןƃuƎ
ʇɔǝɹɹoɔ oʇ ƃuıʎɹʇ sʎɐʍןɐ ǝɹɐ ǝןdoǝd ɥsıןƃuƎ-uou ʇɐɥʇ snoıɹɐןıɥ ʇı puıɟ
sʎɐʍןɐ I



I'm a native English speaker. Uncapitalized "I" makes a writer come 
across like a common leet-speak obsessed immature script kiddy. I know 
you're not one though, which makes it all the more puzzling.


Defend it all you want, argue that it doesn't matter...but it still 
makes yourself look bad. And for what worthwhile benefit?


(I think native speakers tend to gloss such things over because they've 
already seen it so much they've become accustomed to tuning out anyone 
writing in such styles.)


It's not my intent to be insulting here, but the level of insistence on 
deliberately using and defending such a trivial, and self-defeating, 
rebelling is just...really??




Re: DAuth v0.6.1 - Salted Hashed Password Library

2014-08-30 Thread Nick Sabalausky via Digitalmars-d-announce

On 8/30/2014 10:19 AM, Casey wrote:

Would it be possible to support bcrypt style password hashing? The one
key feature of it is that it encrypts/hashes the password many times to
slow down brute force attacks.  Hash algorithms are too fast to prevent
this.


DAuth is designed for everything to be overridable. So, while specific 
support for that is not currently built-in (I definitely want to add it 
though), you should still be able to use it.


The best way to do it:

All you need is a Phobos-compatible std.digest.digest[1]-style interface 
for bcrypt. You can wrap an existing bcrypt algorithm like this:


[1] http://dlang.org/phobos/std_digest_digest.html

--
import your_ordinary_bcrypt_module;
import std.digest.digest : WrapperDigest;

// Phobos's "template"-style
struct BCrypt
{
// Implement Phobos digest interface:
void start();
void put(scope const(ubyte)[] data...);
ubyte[SIZE_OF_YOUR_FINAL_HASH] finish();
}

// Phobos's OO-style
alias BCryptDigest = WrapperDigest!BCrypt;
--

The easiest way (although maybe not most flexible) to handle BCrypt's 
"number of rounds" parameter would be to make it a compile-time argument 
for your struct, and then make a few convenience aliases:


--
struct BCrypt(int numRounds) {...}
alias BCrypt256 = BCrypt!256;
alias BCrypt1024 = BCrypt!1024; // Or whatever
--

Now you have a BCrypt that's fully compatible with Phobos's digest 
system. If you don't care about DAuth's hash string format, then that's 
all you need: Just pass the in digest to any function which takes it:


--
// Generate password hash
Hash!Bcrypt256 hash = makeHash!Bcrypt256(pass);
ubyte[] mySalt = hash.salt;
ubyte[SIZE_OF_YOUR_FINAL_HASH] myHash = hash.hash;
saveItAllToYourDB(mySalt, myHash);

// Test password against a hash
Hash!Bcrypt256 someHash;
someHash.salt = mySalt;
someHash.hash = myHash;
bool accessGranted = isSameHash!Bcrypt256(pass, someHash);
--

To fully integrate it with DAuth and be able to use DAuth's hash 
strings, you can pass Hash.toString() and parseHash() with custom 
callbacks for 'digestCodeOfObj' and 'digestFromDAuthCode'. Examples of 
this are provided in the API reference:


http://semitwist.com/dauth/dauth/core/Hash.toString.html
http://semitwist.com/dauth/dauth/core/parseHash.html

If you don't want to create a Phobos-style digest wrapper for bcrypt, 
you don't have to. You can just bypass makeHash/isSameHash entirely:


--
import dauth;
import std.digest.digest;
import your_bcrypt_lib;

auto makeBCryptHash(Password pass, int rounds)
{
// Digest is std.digest.digest.Digest, an OO interface
Digest dummyDigest;

Hash!Digest hash;
hash.salt = randomSalt();
hash.hash = do_the_bcrypt(h.salt ~ pass.data, rounds);

return hash;
}

bool isSameBCryptHash(Password pass, int rounds, Hash!Digest hash)
{
ubyte[] testHash = do_the_bcrypt(hash.salt ~ pass.data, rounds);
return lengthConstantEquals(testHash, hash.hash);
}

// Don't use Hash.toString() or parseHash() since you opted
// not to create a Phobos-style digest. Instead, just
// save/load hash.salt and hash.hash manually.
--

I really should add a tutorial page to the official docs showing all 
this "how to add support for another hashing algorithm".




Re: DVM - D Version Manager 0.4.3

2014-09-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 9/2/2014 3:46 PM, Jacob Carlborg wrote:

I just released a new version of DVM, 0.4.3.
[...]
Version 0.4.3
   New/Changed Features
* Add support for Dub
* Since issue 23 has been fixed this means that now both 32 and
64bit libraries are supported simultaneously

   Bugs Fixed
* Fix issue "unexpected redirect for method GET"
* Issue 23: Leave DMD directory structure as-is



Sweet!!! Been looking forward to this.



Re: String to binary conversion

2014-09-03 Thread Nick Sabalausky via Digitalmars-d-announce

On 9/3/2014 8:32 AM, clearion wrote:

I would like to write binary data to a file for an ancillary hash table
operation and then read it back using stream.rawRead(). How would I go
about converting a string to binary in D. I would prefer not to use any
third party libraries if I can. Thank You


This D.announce forum is for announcements. Questions about using D go 
in D.learn.


Re: DVM - D Version Manager 0.4.3

2014-09-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 9/4/2014 3:50 PM, Jordi Sayol via Digitalmars-d-announce wrote:


On Debian testing:


$ dvm install 2.065.0
Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
[>] 50581/49347 KB

Installing: dmd-2.065.0
An unknown error occurred:
tango.core.Exception.IOException@/home/doob/development/d/tango/tango/core/Exception.d(59):
 /home/jordi/.dvm/bin/dmd-2.065.0 :: No such file or directory
...


After manually created this directory and properly install dmd 2.065.0:


$ dvm use 2.065.0
$ dmd
bash: dmd: command not found


What I'm doing wrong?


dvm install dvm



Re: DVM - D Version Manager 0.4.3

2014-09-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 9/4/2014 4:51 PM, Jordi Sayol via Digitalmars-d-announce wrote:

El 04/09/14 a les 22:17, Nick Sabalausky via Digitalmars-d-announce ha escrit:

What I'm doing wrong?


dvm install dvm


On Debian testing (mate desktop) without ~/.dvm dir, dmd still not found:

$ dvm install dvm
$ dvm install 2.065.0
Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
[>] 50581/49347 KB

Installing: dmd-2.065.0
$ dvm use 2.065.0
$ dmd
bash: dmd: command not found


BTW Is there a reason to mandatory copy dvm to ~/.dvm/bin directory?



Hmm, may wanna check your .bashrc. Unless it's changed since last time I 
looked, the Posix versions of dvm work by adding code to .bashrc which 
set up "dmd" as an alias.


Then again, I'm not sure that should matter if you're manually running 
"dvm use ...".


Are you maybe not using bash?



[OT Security PSA] Shellshock: Update your bash, now!

2014-09-30 Thread Nick Sabalausky via Digitalmars-d-announce
Don't mean to be alarmist, but I'm posting this in case anyone else is 
like me and hasn't been paying attention since this news broke (AIUI) 
about a week ago.


Apparently bash has it's own "heartbleed" now, dubbed "shellshock". Warm 
fuzzy flashbacks of "TMNT: The Arcade Game" aside, this appears to be 
pretty nasty *and* it affects pretty much every version of bash ever 
released. And of course bash exists on practically everything, 
so...pretty big deal. Security sites, blogs-o'-spheres, cloudosphere, 
etc are all over this one. (Don't know how I managed to miss it until now.)


Patches have been issued (and likely more to come from what I gather), so:

Go update bash on all your computers and server, NOW. No, don't hit 
reply, do it now. Personally, I'd keep updating fairly frequently until 
the whole matter settles down a bit.


Since the security folks have been jumping at this, getting a fixed bash 
should be trivial. Debian already has patched versions in its repos 
(even for Debian 6 if you're using the LTS repo). Other distros likely 
have patched versions now too. So you have no excuse!


More info:
http://www.troyhunt.com/2014/09/everything-you-need-to-know-about.html
https://www.digitalocean.com/community/tutorials/how-to-protect-your-server-against-the-shellshock-bash-vulnerability
https://startpage.com/do/search?query=bash+shellshock


HOW TO CHECK/UPDATE:


Test for vulnerability like this (supposed to be one line):
$ env 'VAR=() { :;}; echo Bash is vulnerable!' 'FUNCTION()=() { :;}; 
echo Bash is vulnerable!' bash -c "echo Bash Test"


Update to a fixed bash:

Debian Testing (and probably Deb 7, though I don't have an installation 
of 7 to confirm):

$ sudo apt-get update && sudo apt-get install bash

Debian 6: (Including setting up the LTS repos):
$ sudo cat 'deb http://http.debian.net/debian squeeze-lts main contrib 
non-free' >> /etc/apt/sources.list
$ sudo cat 'deb-src http://http.debian.net/debian squeeze-lts main 
contrib non-free' >> /etc/apt/sources.list

$ sudo apt-get update && sudo apt-get install bash

Other OSes/distros are likely equally easy. Please, reply with examples 
to help ensure other people on the same OS/distro as you have no excuse 
not to update!


Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-09-30 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/01/2014 01:09 AM, Nick Sabalausky wrote:

Debian 6: (Including setting up the LTS repos):
$ sudo cat 'deb http://http.debian.net/debian squeeze-lts main contrib
non-free' >> /etc/apt/sources.list
$ sudo cat 'deb-src http://http.debian.net/debian squeeze-lts main
contrib non-free' >> /etc/apt/sources.list
$ sudo apt-get update && sudo apt-get install bash



Pffft, ok, so I'm a little brain-fried. Obviously those first two lines 
should be:


$ sudo echo 'deb http://http.debian.net/debian squeeze-lts main contrib 
non-free' >> /etc/apt/sources.list
$ sudo echo 'deb-src http://http.debian.net/debian squeeze-lts main 
contrib non-free' >> /etc/apt/sources.list


Keep or omit the "non-free" and "contrib" as you wish. Or, you know, 
just get off of Debian 6 to say, Debian 7 or something ;)




Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-10-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/01/2014 03:19 PM, Brad Roberts via Digitalmars-d-announce wrote:

On 10/1/2014 6:41 AM, JN via Digitalmars-d-announce wrote:

On Wednesday, 1 October 2014 at 05:09:45 UTC, Nick Sabalausky wrote:


Other OSes/distros are likely equally easy. Please, reply with
examples to help ensure other people on the same OS/distro as you have
no excuse not to update!


I find it ironic that it's another "big global" security hole about
which Windows users don't even have to be concerned about.


False.

All of my windows boxes needed to be updated.  One of the first things I
do on any new windows box is install cygwin to get a saner development
environment with bash as my shell.



Yea. I've been very tempted to put bash on my Win desktops as well. 
Heck, I may even have some old installation of msys/mingw bash still 
lying around somewhere.



I wouldn't be shocked at all if other windows apps bundle bash for one
reason or another too.  It might not come as part of the base install
(though given the huge pile of stuff that gets installed, I wouldn't put
huge bets on it not lurking off in a dark corner somewhere), but that's
not the end of the story.


Yup, Git comes to mind. (Or at least Git GUI?) Don't know whether that 
actually exposes any attack vectors, but I guess that's kinda the big 
question everyone's trying to find out, isn't it? "What are all the 
possible attack vectors of this flaw?" Some of them have been 
discovered, but who knows what else there may be.




Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-10-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/01/2014 02:42 PM, Kagamin wrote:


A have linux mint 12 installation with mint4win (wubi), on linux mint
forums I was told, that updating from the latest repository won't work.



I sympathize: 
http://www.linuxquestions.org/questions/linux-software-2/how-to-install-enlightenment-on-mint-15-a-4175492936/


That annoyance is why (aside from servers) I've switched to 
rolling-release distros. In my case, Debian Testing (which, as I've been 
told by others here, and can personally confirm, is much more stable 
than it's unfortunately-chosen name would suggest). I picked that one 
since I'm most familiar with the general Debian family of distros 
(apt-get and all). But I've heard good things about Arch too and may 
look into it.


FWIW, I don't think all release-based distros are quite as aggressive as 
Mint with abandoning older releases. Even the super-outdated Debian 6 
apparently still has some support via its LTS repos. I suspect Mint may 
need to do things that way just as a manpower issue. Mint's a popular 
distro, but I get the impression it's development is a relatively small 
grassroots thing with much more limited resources than say Debian or 
Ubuntu. (Of course, I could be wrong.)


Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-10-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/01/2014 01:38 PM, Iain Buclaw via Digitalmars-d-announce wrote:


One nice thing about Ubuntu is that they even give you access to
future kernel versions through what they call HWE.  In short, I can
run a 14.04 LTS kernel on a 12.04 server, so that I'm able to use
modern hardware and take advantage of software that uses features of
Linux that are actively worked on (like LXC) on an older software
stack.



Is there anything similar in Debian?



Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-10-03 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/01/2014 05:15 PM, Dicebot wrote:


[Mint] gained lot of popularity when
Ubuntu switched to Unity as default desktop environment and Fedora moved
with Gnome 3 - quite many users started looking for a distro with more
conservative defaults.


Yea, y'know, about that [entirely predictable] phenomenon: I've 
occasionally wondered whether Canonical, and the Gnome devs (the ones 
that didn't jump ship to Mate/Cinn), and heck even MS and Mozilla...if 
they've been *deliberately* trying to decrease their userbase.


I know personally that permitting optional settings is *not* as 
difficult as those organizations/devs make it out to be, *especially* 
when compared to the effort involved in completely redoing a whole damn 
UI. So it's really the only explanation I can come up with to explain 
Gnome3/Win8/FF3/FF4/FF29/Unity/etc other than just "they must've all 
gone nuts" ;)



However [Mint's] development / maintenance team does
not seem to match that popularity burst.


Yes, of course that isn't a complaint against Mint. Despite having left 
it, I do like Mint, FWIW. I just wanted to go rolling release (and 
really, the non-free stuff isn't all that difficult to get up and 
running on straight Debian at this point - a lot of it worked 
out-of-the-box for me, and even Flash was trivial to install after a 
one-minute web search).




mysql-native: Update, Status and Plans

2014-10-04 Thread Nick Sabalausky via Digitalmars-d-announce
The mysql-native lib (often abbreviated as "mysqln") is a low-level 
client library for MySQL and MariaDB, written entirely in D with no 
reliance on the official libmysql. It supports both Phobos and Vibe.d 
sockets.


Since Steve Teale's original release, mysql-native has seen many years 
(by D's young standards) of usage and updates, with various people (such 
as simendsjo, Sönke Ludwig and myself) assuming lead at various points 
to help keep it going strong, even if perhaps slightly under-the-radar. 
(And cheers to everyone else who has and/or continues to contribute.)


There have been some changes and updates lately which I'd like to 
formally announce:


New Home
--
The main active fork of mysql-native now has a slight change-of-address. 
Since the project is not directly related to Vibe.d (but simply has 
optional support for it), Sönke has recently spun it off from his 
"rejectedsoftware" group on GitHub to it's own GitHub group: "mysql-d".


So the new addresses are:

Web:https://github.com/mysql-d/mysql-native
Git/HTTPS:  https://github.com/mysql-d/mysql-native.git
Git/SSH:g...@github.com:mysql-d/mysql-native.git

The DUB repository at code.dlang.org has been updated to reflect this 
change, so it should be transparent and "just work" for DUB users.


New Release
---
A new release has just been tagged, v0.0.16. (Don't be fooled: Despite 
the scary-sounding "v0.0.x" label, people are successfully relying on it 
in real projects, and we do try to minimize breaking changes.)


The previous release, v0.0.15, marked the beginning of a deliberate 
trend for mysql-native:


After several years of miscellaneous updates and fixes, and the many 
versions of DMD the project has seen, mysql-native has outgrown its 
initial one-module design. It's also, admittedly, accumulated some 
amount of internal clutter and rough corners as well.


Sensing that, simendsjo did quite a bit of work in a separate fork, on a 
big cleanup and re-architecting of the library. That fork hasn't been 
completed, but to minimize divergence and duplicated maintenance efforts 
(and also to perform some much-needed cleanup on mainline) I've begun 
incorporating some of simendsjo's changes into the main mysql-native, 
with an emphasis on minimizing breakages.


The incorporation of those improvements began in v0.0.15 by resurrecting 
some bitrotted unittests, merging in many of simendsjo's new tests, and 
in general beginning a much stronger emphasis on proper testing 
(unit/regression/integration).


The merging of simendsjo's cleanups continues in v0.0.16 by splitting 
the increasingly-monolithic into a more manageable series of smaller 
modules. This is an internal change which shouldn't affect users of the 
library, but it lays the groundwork allowing the main library to be 
directly compared with simendsjo's redesign much more easily.


Changes in v0.0.16 (since v0.0.15):
- Split into multiple modules.
- Fix: When querying for a table's column metadata, limit the search to 
the appropriate schema.

- Fix #39: Unsupported SQL type NEWDECIMAL
- Fix #45: Retrieving table metadata fails with an exception for certain 
server versions.

- Fix #48: Unittests don't work on MariaDB 5.5
- Remove redundant (and outdated) "homepage" field from package.json.

New Horizons
-
(Too marketing-ish? ;) )

Formal priorities for mysql-native moving forward: I don't consider 
these to be ranked - they're all important right now, and ultimately 
somewhat general, but here are the primary focuses at this point:


- Professionalism: It's time for mysql-native to graduate from a 
functional "works for our purposes" utility to a well-presented 
newcomer-friendly library. At this point, that means having clearly 
stated project purpose and goals, updated DDOX-generated online 
documentation, improved readme and introductory material, changelog, and 
release announcements. Bug reports should be responded to promptly (even 
if not promptly addressed - the project does continue to face a manpower 
s a version bump to, at the very least, v0.1.x would probably be 
approprhortage). Also a version bump to, at the very least, v0.1.x would 
probably be appropriate at this point. ;)


- Cleanups: Continue merging in changes from simendsjo's 
cleanup/redesign branch with an emphasis on minimizing breakages. 
However, a few breaks may be needed, so in keeping with the 
professionalism point, semantic versioning system should be used.


- Robustness: Continued emphasis on unit/integration/regression tests, 
and on various combinations of OS and DB server versions (both MySQL and 
MariaDB).


- Usability: There have been many improvements in D since the library's 
initial design. I think we can improve some aspects of the API while 
still staying within the project's goals. This also ties into both 
simendsjo's work and having good documentation.


- Encourage Contributions: It's no secret that mysql-native faces a 
sh

Re: mysql-native: Update, Status and Plans

2014-10-04 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/04/2014 05:16 AM, Nick Sabalausky wrote:

- Professionalism: It's time for mysql-native to graduate from a
functional "works for our purposes" utility to a well-presented
newcomer-friendly library. At this point, that means having clearly
stated project purpose and goals, updated DDOX-generated online
documentation, improved readme and introductory material, changelog, and
release announcements. Bug reports should be responded to promptly (even
if not promptly addressed - the project does continue to face a manpower
s a version bump to, at the very least, v0.1.x would probably be
approprhortage). Also a version bump to, at the very least, v0.1.x would
probably be appropriate at this point. ;)


The irony of advocating increased professionalism while suffering a 
gigantic copy-paste mistake towards the end is not lost on me...


The above paragraph should be:

- Professionalism: It's time for mysql-native to graduate from a 
functional "works for our purposes" utility to a well-presented 
newcomer-friendly library. At this point, that means having clearly 
stated project purpose and goals, updated DDOX-generated online 
documentation, improved readme and introductory material, changelog, and 
release announcements. Bug reports should be responded to promptly (even 
if not promptly addressed - the project does continue to face a shortage 
of manpower). Also a version bump to, at the very least, v0.1.x would 
probably be appropriate at this point. ;)


mysql-native v0.1.0 - Bugfixes

2014-10-05 Thread Nick Sabalausky via Digitalmars-d-announce

A few bugfixes:

- Fixed: Tests don't compile on DMD 2.064.2
- Fix a couple DDoc warnings (Hopefully fixing #23)
- Fix #24: BIT type didn't work and caused hangs/errors
- Fix #33: TEXT/TINYTEXT/etc types should be string, not ubyte[] like 
BLOB is (Thanks to RuShire)

- Fix #42: Can't login with empty password

Since fixing the TEXT types to return string instead of ubyte[] is a 
potentially-breaking change (it broke a couple minor things in the tests 
- now fixed of course), I've taken the opportunity to (finally!) advance 
mysql-native beyond v0.0.x: It's now v0.1.0 :)


I'm also, somewhat regretfully, deprecating support for DMD 2.063.2 and 
below. It's apparently *been* broken on those older versions anyway (and 
would be disruptive to fix) and AFAICS nobody seems to have noticed 
until I actually tried it earlier today. So I don't think it will be 
particularly missed.


https://github.com/mysql-d/mysql-native


Re: [OT Security PSA] Shellshock: Update your bash, now!

2014-10-05 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/05/2014 04:54 AM, eles wrote:

On Thursday, 2 October 2014 at 11:12:12 UTC, Kagamin wrote:

On Thursday, 2 October 2014 at 07:43:54 UTC, eles wrote:

update-manager -d

It works.


Does it perform package upgrade? The comments are rather scary:
---
Hi, I have installed Linux mint 15 with Mint4Win as Dual boot with
Windows 7.
Then upgraded it to Mint 16 and it was running fine.
But when I upgrade to Mint 17 (Qiana), after restarting the partition
loop0 (or loopback0 or something like that) fails to load.
It shows an error like, Press I to ignore, S to skip or M for manual
recovery.


Hi,

A bit of news here, as just updated my knoledge about Linux Mint & Linux
Mint Debian Edition.

In short, from this discussion and its comments:

http://segfault.linuxmint.com/2014/08/upcoming-lmde-2-to-be-named-betsy/

Linux Mint Debian abandons its (semi-)rolling model and will basically
become just a kind of Ubuntu, but based on Debian Stable (Ubuntu, AFAIK,
is based on Debian Unstable). The will require full-upgrades every 2
years, but the upgrades shall be smooth (no reinstall required). For two
years, you will not need to do such upgrade, just the basic security
upgrades and some updates (mainly browser and email clients).

Linux Mint, starting from version 17, marks a departure from previous
releases (this is why you migh have encountered difficulties in
upgrading) by keeping the same code base (Ubuntu 14.04 LTS) for the next
5 years. So, during this time, it will basically be a
rolling-distribution, as some software will get updated just as regular
(security fixes etc.) happens. Probably, after those 5 years, they will
change the code base to the next Ubuntu LTS, which will start a new
5-years long upgrade.



Very interesting. This is pretty major news for Mint. Not sure how I 
feel about it, but it's certainly worth knowing. Glad you posted.



One piece of advice: Debian Testing might seem (by the name) more secure
than Debian Unstable. The truth is that the latter is more up-to-date
and receives security fixes first (they are entering the Debian Unstable
first, then they are pre-validated before going in Debian Testing).
More, Debian Unstable is not as unstable as its name might tell but,
yes, it requires you messing sometimes (read: maybe once every three
months) with the apt-get and vim. But is not such a big deal.


When I got a new laptop a few weeks ago to stick linux on (yay!), and 
was deciding on distro, I did read that thing about Deb unstable getting 
security updates slightly earlier than Deb testing.


Personally, I ended up opting for Deb testing anyway because the 
"cooldown period" of a few days (for non-security releases) was very 
appealing to me. Sort of a minor little mini-guardrail between me and 
the bleeding edge. Y'know - just in case. And TBH, as big a deal as 
security is, I'm even more concerned about system instability anyway 
(not that I don't trust Deb "unstable" to still be reasonably stable, 
I'm sure it is). But that's just me.


Anyway, since Deb testing does apparently still have a "fast track" for 
major security fixes (via umm..."testing-updates" IIRC), even if it 
isn't *as* prompt as Deb unstable, that pretty much clinched the deal 
for me ;).


FWIW.

It's my first experience with rolling-release, so we'll see how it goes, 
but so far so good.


So far the biggest irritation is just simply the lack of TortoiseGit and 
*good* integration between BeyondCompare and Dolphin. But of course, 
that has nothing to do with choosing deb testing ;) A few other rough 
edges (to be expected), but man am I loving a lot of things about 
finally jumping to linux as a primary system after a full 20 *mostly* 
good years of windows. (Aside from a couple admittedly great, but minor, 
improvements - Win 8/8.1 is *HORRID*. And that's not even the one that 
finally pushed me away anyway - two years of Win7 and I was "Ok, that's 
freaking it, I NEED day-to-day linux now, fuck the new post-XP MS, can't 
take anymore of this goofy straightjacketed Apple-wannabe crap.")


Wow, sorry for the rambling, didn't really mean to venture so far with 
all that ;)


Anyway, yea. Linux distros. Lots of info about them :)



Re: DUB 0.9.22 released

2014-10-06 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/06/2014 02:15 PM, Sönke Ludwig wrote:

Am 06.10.2014 13:36, schrieb bioinfornatics:

Thanks for your works,

One question, what about makefile support ?

Regards


It's still in need for a volunteer. The implementation itself should be
pretty straightforward (by inheriting from the ProjectGenerator class),
but I currently have too much higher priority stuff on my table to get
that done (plus generally severely limited time due to an accumulation
of work and non-work related things).


I don't suppose there's documentation on the ProjectGenerator class? I 
was (briefly) looking into subclassing that for a "compiler cmdline 
args" output that I think would be helpful, but based on a (again, 
rather brief) glance at and its subclasses I had some trouble grokking 
how it worked. I'll have to take a look again though.


Re: D on TV - FLOSS Weekly 311

2014-10-08 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/08/2014 10:41 PM, Walter Bright wrote:

On 10/8/2014 6:25 PM, John wrote:

I wish you had some lighting on you. You are hardly visible!


It's to hide the scars where my head was sewed back on.


"Getting the brain out was the easy part. The hard part was getting the 
brain out!" - Hubert Farnsworth


Re: Searching for a tool to use D for web development with Apache

2014-10-12 Thread Nick Sabalausky via Digitalmars-d-announce

On 10/12/2014 12:46 PM, TSalm wrote:

Hello,

Does it exist a project to use D in web development with Apache; not for
CGI scripts, but rather like what PHP does ?



Not really sure exactly what you mean by "like what PHP does", but yes, 
Vibe.d is generally considered fantastic: http://vibed.org/


Someone should be able to help you get it set up with Apache over at 
Vibe's forums.



Thanks in advance for your help.

I hope this is the correct forum to post my question on. Sorry if not.



This digitalmars.D.announce forum is for announcements. This question 
would go in digitalmars.D.






Re: Heady House Hunting with D

2015-01-13 Thread Nick Sabalausky via Digitalmars-d-announce

On 01/13/2015 10:56 PM, Rikki Cattermole wrote:

On 14/01/2015 4:46 p.m., Philpax wrote:

Hey everyone,

I recently wrote a blog post about how I used D/vibe.d to help find a
new house. I haven't publicized it anywhere else yet, so I'm looking
forward to what the D community has to say! You can check it out here:
http://philpax.me/blog/heady-house-hunting-with-d



Definitely would be interesting to see this as a full blown comparison
site, like there is for flight.


Yea, definitely. The listing sites from the realty companies are truly 
horrible (and a very solid case IMO for why the web should be 
plain-old-data, not "dynamic"/"rich"-content). A sane front-end for all 
their goofy bloated half-broken crap would be great for anyone facing 
the royal pain of house hunting.




mysql-native: API Refresh RC

2017-01-29 Thread Nick Sabalausky via Digitalmars-d-announce
I've been working on a big refresh of mysql-native's API, to take care 
of various issues that have appeared with it. It involves some major 
breaking changes (although I've tried to keep old interfaces around for 
the moment, but marked deprecated), so I wanted to post it before 
committing to it so those interested have a change to take a look, give 
feedback, catch problems, etc.


Summary of these changes:

API overhauled for better safety, reliability and ease-of-use. 
Deprecated and replaced entire Command struct with better design. Better 
handling of null. Various bugs fixed and more rigorously tested.


--

For right now, the changes are in a separate fork, here:

https://github.com/Abscissa/mysql-native-experimental

The readme there has sample code and an overview of the new interface.

Changelog: 
https://github.com/Abscissa/mysql-native-experimental/blob/master/CHANGELOG.md


API ref: http://semitwist.com/mysql-native-docs/v0.2.0-preview1

---

So take a look, let me know if there's any big issues with it. If all 
looks good, this will soon be released as mysql-native v0.2.0.


Re: mysql-native: API Refresh RC

2017-01-30 Thread Nick Sabalausky via Digitalmars-d-announce

On 01/30/2017 02:49 AM, Sönke Ludwig wrote:


What about directly going for 1.0.0? At least after it has gotten enough
real-world exposure, I'd say that the first API overhaul is a good
opportunity for that.


Good point.



Re: mysql-native: API Refresh RC

2017-02-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/01/2017 05:04 AM, Suliman wrote:

Plz update dub package on code.dlang.org


It's deliberately not in the main mysql-mative package just yet. I will 
put it there once people have a chance to try this, and it becomes clear 
there aren't any big problems with the redesign.


For now, this preview can be used like this:

$ git clone https://github.com/Abscissa/mysql-native-experimental.git
$ dub add-local mysql-native-experimental

And then, when you're doing using this preview:

$ dub remove-local mysql-native-experimental



Re: mysql-native: API Refresh RC

2017-02-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/01/2017 10:34 AM, Suliman wrote:

On Wednesday, 1 February 2017 at 14:06:39 UTC, Suliman wrote:

Am I right understand that Connection instance should created at
constructor and be one single for all class (and it will be reused by
fibers) or am I wrong?

If yes, where I should to close it? To put
scope(exit) c.close();

In destructor?

If yes, does it behavior should be same as for working in vibed pool
and without?


I'm not sure I understand the question here.

Whether you should use a vibed connection pool or not is completely up 
to you and your program. And the choice of when to create the 
connection, and when to close the connection, is also up to your own 
program's needs.


If you're using a connection pool, you shouldn't need to worry about 
closing the connection. The whole point is that the connections stay 
open until you need to use one again. When your program ends, then 
connections will close by themselves.




If I right understand class MysqlDB do not throw any exceptions, So I
can't understand how to handle wrong connection.

if(connection is null)
{
 try // useless
 {
 connection = mydb.lockConnection();
 }
 catch(Exception e)
 {
 writeln(e.msg);
 }
}


mydb.lockConnection() does create a new connection if it needs to. And 
that WILL throw an exception if there's a problem connecting to the DB 
server. So your code above WILL catch an exception if the connection 
information (server address/port/login/etc) is wrong.


Side note: That reminds me, I need to rename the MysqlDB class (and the 
mysql.db module). It's a connection pool (using vibe-d's connection 
pool), but their names make that very unclear.





Re: mysql-native: API Refresh RC

2017-02-01 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/01/2017 01:54 PM, Suliman wrote:

Also I can't understand what is SQL Command and what exec is doing if
it's returning ulong?




"struct Command" should not be used. It is old, and a bad design. This 
new release attempts to replace it with a better design. Hopefully, 
"struct Command" will be deleted in a later release.


The "exec" functions are for commands like INSERT, UPDATE, DELETE, 
CREATE, etc (it is *not* for SELECT). It is for things that do NOT 
return actual rows of data. The "exec" functions return "rows affected" 
- the number of rows that were affected by your INSERT, or UPDATE, etc. 
Usually people ignore that number, but it's information the server sends 
back, and is sometimes useful to some people. For example, SQL 
administration tools usually tell you "# rows affected" after you run an 
INSERT/UPDATE/etc.


If you are doing a SELECT, then you do NOT use "exec", you use "query" 
for SELECT. "query" returns a set of rows.


Summary:
-

SELECT: Use query() or querySet() or queryRow(), etc.

INSERT/UPDATE/DELETE/CREATE/DROP: Use exec(). Return value tells you how 
many rows were added/changed/deleted/etc.




Re: mysql-native: preview2

2017-02-01 Thread Nick Sabalausky via Digitalmars-d-announce

Made a couple more long-needed changes while I'm at it:

https://github.com/Abscissa/mysql-native-experimental
Tag: v0.2.0-preview2

- For better clarity, renamed `mysql.db.MysqlDB` to `mysql.pool.MySqlPool`.

- Package mysql.connection no longer acts as a package.d, publicly 
importing other modules. To import all of mysql-native, use `import mysql;`




Re: mysql-native: API Refresh RC

2017-02-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/02/2017 03:23 AM, Suliman wrote:

mydb.lockConnection() does create a new connection if it needs to. And
that WILL throw an exception if there's a problem connecting to the DB
server. So your code above WILL catch an exception if the connection
information (server address/port/login/etc) is wrong.


But it does not. I am getting Access Violation instead of the exception
if connection credentials is wrong:

Authentication failure: Access denied for user 'root'@'111.111.111.111'
(using password: YES)

object.Error@(0): Access Violation

0x004436C0 in void database.Database.connect() at
D:\code\CMS\source\database.d(34)
0x00403130 in _Dmain at D:\code\CMS\source\app.d(17)
0x00593C6F in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x00593C33 in void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll()
0x00593B34 in _d_run_main
0x004433CC in main at D:\code\CMS\source\app.d(7)
0x005F0929 in mainCRTStartup
0x769262C4 in BaseThreadInitThunk
0x774D0FD9 in RtlSubscribeWnfStateChangeNotification
0x774D0FA4 in RtlSubscribeWnfStateChangeNotification
Program exited with code 1



Ahh, ok, that's a bug. Will fix.




Re: mysql-native: API Refresh RC

2017-02-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/02/2017 07:10 AM, aberba wrote:


* Moreover, how do I close a connection or does it auto close?



It closes in its destructor (although AIUI there are times when dtors 
don't get run). But it can be closed manually with Connection.close();



* Does it support mysql_real_escape_string() like in php? This factor-in
the db encoding to do he appriate encoding for '/\" ...


There is a function like that one that was contributed, 
mysql.escape.mysql_escape:


https://github.com/Abscissa/mysql-native-experimental/blob/master/source/mysql/escape.d#L4

But, it's better to use prepared statements, because then no escaping is 
needed, and there's no worry about forgetting to escape:


Prepared prepared = prepare(connection, "SELECT * FROM `someTable` WHERE 
i=? AND s=?");

prepared.setArgs(7, "hello");
ResultRange results = prepared.query();

The prepared statement is reference counted and will automatically be 
released when there are no references to it left.




Re: mysql-native: API Refresh RC

2017-02-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/02/2017 03:23 AM, Suliman wrote:

mydb.lockConnection() does create a new connection if it needs to. And
that WILL throw an exception if there's a problem connecting to the DB
server. So your code above WILL catch an exception if the connection
information (server address/port/login/etc) is wrong.


But it does not. I am getting Access Violation instead of the exception
if connection credentials is wrong:

Authentication failure: Access denied for user 'root'@'111.111.111.111'
(using password: YES)

object.Error@(0): Access Violation

0x004436C0 in void database.Database.connect() at
D:\code\CMS\source\database.d(34)
0x00403130 in _Dmain at D:\code\CMS\source\app.d(17)
0x00593C6F in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x00593C33 in void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll()
0x00593B34 in _d_run_main
0x004433CC in main at D:\code\CMS\source\app.d(7)
0x005F0929 in mainCRTStartup
0x769262C4 in BaseThreadInitThunk
0x774D0FD9 in RtlSubscribeWnfStateChangeNotification
0x774D0FA4 in RtlSubscribeWnfStateChangeNotification
Program exited with code 1



I'm unable to reproduce this problem. Are you trying to use the 
connection after it fails to connect? It looks like that's what's 
happening, you're using a null reference.




Re: mysql-native: API Refresh RC

2017-02-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/02/2017 04:33 AM, Suliman wrote:

ResultSet querySet(Connection conn, string sql, ColumnSpecialization[]
csa = null)

Could you explain last parameter?

`ColumnSpecialization[] csa = null`. I can't understand how to use it.



The vast majority of the time, you don't need to worry about that 
parameter, just omit it. It's just for if the fields you're pulling from 
the DB are very, very large and you want to handle the data as it comes 
in, rather than waiting for all the data to download. If you want to 
know more, it's in the documentation here:


http://semitwist.com/mysql-native-docs/v0.2.0-preview1/mysql/protocol/extra_types/ColumnSpecialization.html



Also I think it's better to remove old deprecated methods at all,
because it's add only mess.


They're still there for new just for backwards compatibility. But they 
are deprecated and will be removed in a later release.


Re: mysql-native: preview2

2017-02-02 Thread Nick Sabalausky via Digitalmars-d-announce

On 02/02/2017 02:22 AM, Suliman wrote:
> Am I right understand that if I use pool I can create connection
> instance one time in DB class constructor end every new connection
> will be created on demand?

No. You create the pool once (wherever/whenever you want to). Then, 
every time you want to use the database you obtain a connection by 
calling MySqlPool.lockConnection.




Ok, I read articles about pool, as I understood it's depend on of the
implementation. For example method `close` in pool mode should not close
connection, but return it to pool.



Calling 'close' will always close the connection. If you got you 
connection from the pool, then it will automatically return to the pool 
when you're no longer using it. No need to do anything special for that.



Could you tell about your implementation. Also actual question is can I
open connection in constructor (during class instance creation) ?


You can open a connection in a constructor if you wish. Or wherever you 
want to.


  1   2   3   >