The ugly way is to create a @trusted function/lambda that coverts
the threadId to a string.
Not sure about the pretty way.
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
}
diff:
sharedLog = new FileLogger("logfile.log",
my guess is that
InitiatingPTrack.toString is not @safe
On Wednesday, 2 September 2015 at 06:57:12 UTC, drug wrote:
Before 2.067 I used std.experimental.logger in form of a dub
package. Because it included in 2.067 I stop using the dub
package but now I get the error:
Error: safe function
'std.experimental.logger.core.Logger.memLogFunctions!cast(Log
nice read, thank you
On Friday, 8 May 2015 at 11:00:01 UTC, Chris wrote:
I'm sure there is room for improvement.
It looks like your reading some kind of comma seperated values
(csv).
have a look at std.csv of phobos
```
foreach(record;
file.byLine.joiner("\n").csvReader!(Tuple!(string, string,
int)))
{
if("0X".std.string.indexOf("0x", CaseSensitive.no) == 0)
should work
On Monday, 30 March 2015 at 04:05:12 UTC, lobo wrote:
Thank you, lobo.
next version will have equal default LogLevel for all Logger.
https://github.com/D-Programming-Language/phobos/pull/3124
On Sunday, 29 March 2015 at 01:36:24 UTC, lobo wrote:
Hi,
I'm trying to use std.experimental.logger and I'd like the
logf(), tracef() style functions to log to a file and stdout.
(note: I can use sharedLog.logf(), sharedLog.tracef(), but I
prefer just logf())
So I did this:
shared static t
On Monday, 16 March 2015 at 22:19:52 UTC, Gary Willoughby wrote:
I guess it depends on the encoding?
No the character itself are encoding independent.
Some references:
http://stackoverflow.com/questions/23853489/generate-a-random-unicode-string
This will not work as the caller has to speci
On Monday, 16 March 2015 at 18:48:29 UTC, bearophile wrote:
Perhaps by rejection? I mean, generating a uint, test if it's a
character and repeat until the result is true.
hm, that must not even terminate.
... from all Unicode characters in an idiomatic D way?
(std.interal.unicode_*)
```
T genUnicodeString(T)(size_t minChars, size_t maxChars)
if(isSomeString!T) {
...
}
```
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.
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 a
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
b
use canFind like such:
bool a = canFind(strs,s) >= 1;
let the compiler figger out what the types of the parameter are.
as you properly know, ini files don't support sections arrays.
If you know all items at compile time, you could create structs
for all of them, but that is properly not what you're looking for.
On Saturday, 20 December 2014 at 08:09:06 UTC, Joel wrote:
On Monday, 13 October 2014 at 16:06:42 UTC, Robert burner
Schadek wrote:
On Saturday, 11 October 2014 at 22:38:20 UTC, Joel wrote:
On Thursday, 11 September 2014 at 10:49:48 UTC, Robert burner
Schadek wrote:
some self promo:
http://co
On Wednesday, 15 October 2014 at 21:15:14 UTC, Nordlöw wrote:
Comint exited abnormally with code 1 at Wed Oct 15 23:14:37
I'm stuck. Need help.
I will give it a try
On Tuesday, 14 October 2014 at 12:51:29 UTC, Nordlöw wrote:
Could you please give me a code example? I'm not skilled enough
in D to follow this description.
struct Range(T) {
Array!S array;
T opIndex(size_t i) {
return cast(T)array[i];
}
}
struct Array(T) {
Range!(const(T)) opS
On Saturday, 11 October 2014 at 22:38:20 UTC, Joel wrote:
On Thursday, 11 September 2014 at 10:49:48 UTC, Robert burner
Schadek wrote:
some self promo:
http://code.dlang.org/packages/inifiled
I would like an example?
go to the link and scroll down a page
hm, the problems seams to be that "inout Array" is not becoming
"const Array" and friends.
A blunt force solution would be to create a range as
Range!(ReturnType!Array...)(cast(Array!T)this, low, high);
and then do the correct casts in Range.
The ReturnType would be the ReturnType of opIndex of
On Tuesday, 16 September 2014 at 08:26:57 UTC, Ilya Yaroshenko
wrote:
How generate documentation for phobos PR?
http://wiki.dlang.org/Building_DMD has a section called building
the docs. I properly missed something while writing that, but it
is good starting point and the rest you will find i
On Sunday, 14 September 2014 at 13:30:28 UTC, Paul Z. Barsan
wrote:
Hello,
I want to use a cairo XlibSurface for painting in a project of
mine and I don't know what bindings should I use. I've started
with deimos.cairo which has a C-style syntax and works well on
my linux machine. After I hea
On Thursday, 11 September 2014 at 09:10:03 UTC, monarch_dodra
wrote:
There's an open request for it, and plans to have a "bool
maybeTo!(OUT, WHAT)(WHAT what, ref OUT out)", but we aren't
quite there yet.
The idea is that *once* we have that, then "to" would simply
become an "enforce!maybeTo
I like the "to" template a lot, but sometimes I want to make sure
beforehand that a call to it works. Is there anything in phobos
in missed to do that. And I don't want to try catch.
On Friday, 22 August 2014 at 09:33:10 UTC, Kagamin wrote:
Compile and run the tests with different version options.
that is not an option
How do I unit test version statements without fixing version in
place forever.
bool fun() {
version(Version1) return true;
else version(Version2) return true;
else return false;
}
version = Version1;
unittest {
assert(fun());
}
version = Version2;
unittest {
28 matches
Mail list logo