On Saturday, 10 January 2015 at 02:10:04 UTC, Jesse Phillips
wrote:
On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote:
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro
Link to answer in D:
Hi all,
I was wondering what's the most D-idiomatic way of dealing with a
C library (or rather writing wrappers for a C library) that does
its own GC via reference counting. The objects are identified and
passed around by integer ids only; most functions like find me
an object foo in object
On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote:
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro
Link to answer in D:
http://codegolf.stackexchange.com/a/44417/13362
On 1/9/15 6:10 PM, Jesse Phillips wrote:
On Friday, 9 January 2015 at 13:50:29 UTC, eles wrote:
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro
Link to answer in D:
http://codegolf.stackexchange.com/a/44417/13362
On Fri, 09 Jan 2015 15:36:21 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan 2015 13:54:00 +
Robert burner Schadek via Digitalmars-d-learn
On Friday, 9 January 2015 at 15:57:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan 2015 15:36:21 +
FrankLike via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan 2015 13:54:00 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 9 January 2015 at 13:25:17 UTC, ketmar via
Digitalmars-d-learn wrote:
if you
On Friday, 9 January 2015 at 07:52:50 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 07:50:53 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 06:17:53 UTC, Andre wrote:
Hi,
Should following coding work?
string lpad(ubyte length, long n)
{
import std.string: rightJustify;
iday, 9 January 2015 at 07:41:07 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan 2015 07:10:14 +
FrankLike via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 8 January 2015 at 15:15:59 UTC, Robert burner
Schadek wrote:
use canFind like such:
On Friday, January 09, 2015 07:51:27 Foo via Digitalmars-d-learn wrote:
On Friday, 9 January 2015 at 06:18:53 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Friday, January 09, 2015 00:20:07 Foo via
Digitalmars-d-learn wrote:
You know, that you kan reuse the result of the in
On Fri, 09 Jan 2015 09:36:01 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Sorry,it's only a example .Thank you work hard,but it's
not what I want.
'indexOfAny ' function should do this work.
”he is at home ,[home,office,”sea,plane], in
Thanks a lot.
Kind regards
André
On Friday, 9 January 2015 at 07:59:51 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 07:52:50 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 07:50:53 UTC, Daniel Kozak wrote:
On Friday, 9 January 2015 at 06:17:53 UTC, Andre wrote:
Hi,
Should
import std.stdio;
import std.typecons;
void main()
{
alias TL = Tuple!(int, long, float);
foreach (i, T; TL)
writefln(TL[%d] = %s, i, typeid(T));
}
Why is this not working?
D:\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(419): Error:
need 'this' for '_expand_field_0' of type 'int'
Huh, looking at the answers on the website, they're mostly using
regular expressions. Weaksauce. And wrong - they don't find ALL
the links, they find the absolute HTTP urls!
On Friday, 9 January 2015 at 16:55:30 UTC, Justin Whear wrote:
Was excited to give it a try, then remembered...std.xml :(
Well, as the author of my dom.d, I think it counts as a first
party library when I use it!
---
import arsd.dom;
import std.net.curl;
import std.stdio, std.algorithm;
On Sunday, 21 December 2014 at 07:43:14 UTC, FrankLike wrote:
On Thursday, 20 November 2014 at 10:48:17 UTC, Suliman wrote:
I am playing with dco. And it's look very helpful for tiny
projects.
I can't understand is it's possible to add to dco.ini Jpath?
I am talking about something like:
On Fri, 09 Jan 2015 13:50:28 +, eles wrote:
https://codegolf.stackexchange.com/questions/44278/debunking-
stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro
Was excited to give it a try, then remembered...std.xml :(
On Fri, 09 Jan 2015 17:18:42 +, Adam D. Ruppe wrote:
Huh, looking at the answers on the website, they're mostly using regular
expressions. Weaksauce. And wrong - they don't find ALL the links, they
find the absolute HTTP urls!
Yes, I noticed that. `script src=http://app.js`/script` isn't
struct S
{
void* p;
}
void main()
{
S s;
auto a = cast(void*)s; //Error: e2ir: cannot cast s of type S
to type void*
}
Is there are a good reason for this being disallowed?
On Friday, 9 January 2015 at 18:25:42 UTC, John Colvin wrote:
struct S
{
void* p;
}
void main()
{
S s;
auto a = cast(void*)s; //Error: e2ir: cannot cast s of type
S to type void*
}
Is there are a good reason for this being disallowed?
You'd expect `cast(void*)s == s.p`? That
On 01/09/2015 10:25 AM, John Colvin wrote:
struct S
{
void* p;
}
void main()
{
S s;
auto a = cast(void*)s; //Error: e2ir: cannot cast s of type S to
type void*
}
Is there are a good reason for this being disallowed?
I know two options:
a)
alias p this;
b)
auto
On Friday, 9 January 2015 at 18:35:56 UTC, anonymous wrote:
On Friday, 9 January 2015 at 18:25:42 UTC, John Colvin wrote:
struct S
{
void* p;
}
void main()
{
S s;
auto a = cast(void*)s; //Error: e2ir: cannot cast s of type
S to type void*
}
Is there are a good reason for this being
On 01/09/2015 10:42 AM, Jonathan Marler wrote:
import std.stdio;
import std.typecons;
void main()
{
alias TL = Tuple!(int, long, float);
foreach (i, T; TL)
writefln(TL[%d] = %s, i, typeid(T));
}
Why is this not working?
D:\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(419):
On 1/9/15 1:50 PM, John Colvin wrote:
On Friday, 9 January 2015 at 18:35:56 UTC, anonymous wrote:
On Friday, 9 January 2015 at 18:25:42 UTC, John Colvin wrote:
struct S
{
void* p;
}
void main()
{
S s;
auto a = cast(void*)s; //Error: e2ir: cannot cast s of type S to
type void*
This
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
std.regex can use CTFE to compile regular expressions (yet it
sometimes
slower than non-CTFE variant), and i mean that we compile
regexp before
doing alot of searches, not before each single search. if you
have
On Fri, 09 Jan 2015 14:11:49 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
std.regex can use CTFE to compile regular expressions (yet it
sometimes
slower
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro
On Friday, 9 January 2015 at 13:25:17 UTC, ketmar via
Digitalmars-d-learn wrote:
if you *really* concerned with speed here, you'd better
consider using
regular expressions. as regular expression can be precompiled
and then
search for multiple words with only one pass over the source
string. i
On Fri, 09 Jan 2015 13:54:00 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 9 January 2015 at 13:25:17 UTC, ketmar via
Digitalmars-d-learn wrote:
if you *really* concerned with speed here, you'd better
consider using
regular
be creative! ;-)
import std.algorithm, std.stdio;
void main () {
string s = he is at plane;
if (findAmong!((string a, string b) = b.canFind(a))([s],
[home, office, sea, plane]).length) {
writeln(got it!);
} else {
writeln(alas...);
}
}
or:
import
On Fri, 09 Jan 2015 12:46:53 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
The code is the best,and it's better than indexOfAny in C#:
import std.algorithm, std.stdio;
void main ()
{
auto places = [ home, office, sea,plane];
auto strWhere = He
On Friday, 9 January 2015 at 10:02:53 UTC, ketmar via
Digitalmars-d-learn wrote:
import std.algorithm, std.stdio;
void main () {
string s = he is at home;
if ([home, office, sea, plane].canFind!((a, string
b) = b.canFind(a))(s)) {
writeln(got it!);
} else {
On Fri, 09 Jan 2015 13:06:09 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 9 January 2015 at 10:02:53 UTC, ketmar via
Digitalmars-d-learn wrote:
import std.algorithm, std.stdio;
void main () {
string s = he is at home;
if
On Friday, 9 January 2015 at 14:21:04 UTC, ketmar via
Digitalmars-d-learn wrote:
heh. regexps *are* fast enough. it's hard to beat well-optimised
generated thingy on a complex grammar. ;-)
I don't see your point, anyway I think he got his help or at
least some help.
34 matches
Mail list logo