On Tuesday, April 10, 2012 13:06:08 Stewart Gordon wrote:
> On 09/04/2012 18:35, Andrej Mitrovic wrote:
> > On 4/9/12, Jonathan M Davis wrote:
> >> Posix positional arguments seem to work for writefln but not format for
> >> whatever reason. Report it as a
On 4/10/12, Andrej Mitrovic wrote:
> E.g. if I search for "format
> positional" I get this lone result:
>
> http://d.puremagic.com/issues/buglist.cgi?quicksearch=format+positional
I mean this result: http://d.puremagic.com/issues/show_bug.cgi?id=4927
te:
> You shouldn't submit bug reports without searching first anyway.
I did, but the default search box doesn't seem to search duplicate
reports (I didn't know this until now). E.g. if I search for "format
positional" I get this lone result:
http://d.puremagic.com/iss
On 09/04/2012 18:35, Andrej Mitrovic wrote:
On 4/9/12, Jonathan M Davis wrote:
Posix positional arguments seem to work for writefln but not format for
whatever reason. Report it as a bug.
Thanks, http://d.puremagic.com/issues/show_bug.cgi?id=7877
Andrej, are emails from Bugzilla not
On 4/10/2012 3:43 AM, Ali Çehreli wrote:
On 04/09/2012 10:35 AM, Andrej Mitrovic wrote:
On 4/9/12, Jonathan M Davis wrote:
Posix positional arguments seem to work for writefln but not format for
whatever reason. Report it as a bug.
Thanks, http://d.puremagic.com/issues/show_bug.cgi?id=7877
On Monday, 9 April 2012 at 17:24:35 UTC, Andrej Mitrovic wrote:
On 4/9/12, q66 wrote:
Positional specifier works just fine for me.
Which version are you using? I'm on 2.058.
git
On 04/09/2012 10:35 AM, Andrej Mitrovic wrote:
On 4/9/12, Jonathan M Davis wrote:
Posix positional arguments seem to work for writefln but not format for
whatever reason. Report it as a bug.
Thanks, http://d.puremagic.com/issues/show_bug.cgi?id=7877
Thanks. I hadn't seen this branch o
On 04/09/2012 10:24 AM, Andrej Mitrovic wrote:
On 4/9/12, q66 wrote:
Positional specifier works just fine for me.
Which version are you using? I'm on 2.058.
Positional parameters[*] are supported in 2.058. This example prints the
same argument in decimal, hexadecimal, octal, and binary:
On 4/9/12, Jonathan M Davis wrote:
> Posix positional arguments seem to work for writefln but not format for
> whatever reason. Report it as a bug.
Thanks, http://d.puremagic.com/issues/show_bug.cgi?id=7877
On Monday, April 09, 2012 19:08:54 Andrej Mitrovic wrote:
> import std.string;
>
> void main()
> {
> string foo = "foo";
> string bar = format("%s %s %s", foo);
> }
>
> format expects 3 arguments, but what I really want is foo to be used
>
On 4/9/12, q66 wrote:
> Positional specifier works just fine for me.
Which version are you using? I'm on 2.058.
On Monday, 9 April 2012 at 17:09:03 UTC, Andrej Mitrovic wrote:
import std.string;
void main()
{
string foo = "foo";
string bar = format("%s %s %s", foo);
}
format expects 3 arguments, but what I really want is foo to be
used
for all 3 specifiers and not repeat
import std.string;
void main()
{
string foo = "foo";
string bar = format("%s %s %s", foo);
}
format expects 3 arguments, but what I really want is foo to be used
for all 3 specifiers and not repeat 'foo' 3 times manually. Are there
any format specifiers t
On Thursday, 1 March 2012 at 10:09:55 UTC, bioinfornatics wrote:
and how convert bedInstances input array to BedData11[] ?
std.array.array()
Le jeudi 01 mars 2012 à 04:36 +0100, Jesse Phillips a écrit :
> On Thursday, 1 March 2012 at 02:07:44 UTC, bioinfornatics wrote:
>
> > It is ok i have found a way maybe is not an efficient way but
> > it works:
> > https://gist.github.com/1946669
> >
> > a minor bug exist for parse track line wil
On Thursday, 1 March 2012 at 02:07:44 UTC, bioinfornatics wrote:
It is ok i have found a way maybe is not an efficient way but
it works:
https://gist.github.com/1946669
a minor bug exist for parse track line will be fixed tomorrow.
time to
bed
Big thanks to all
You can edit a gist instea
fornatics a
> > > écrit :
> > >> Dear,
> > >>
> > >> I would like to parse this file:
> > >> http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
> >
> > > My problem is:
> > > - need to parse data in csv format
>
t; I would like to parse this file:
> >> http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
>
> > My problem is:
> > - need to parse data in csv format
> > - how manage with optional field
>
> It looks like the data is tab delimited so separator is a tab.
> There
On Wednesday, 29 February 2012 at 11:51:29 UTC, bioinfornatics
wrote:
Le mercredi 29 février 2012 à 12:42 +0100, bioinfornatics a
écrit :
Dear,
I would like to parse this file:
http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
My problem is:
- need to parse data in csv format
- how
data so they should be parsed
by hand.
browser position chr7:127471196-127495720
browser hide all
track name="ItemRGBDemo" description="Item RGB demonstration"
visibility=2 itemRgb="On"
My problem is:
- need to parse data in csv format
- how manage with optional field
Dear,
I would like to parse this file:
http://genome.ucsc.edu/goldenPath/help/ItemRGBDemo.txt
struct Bed{
stringchrom;// 0
size_tchromStart; // 1
size_tchromEnd; // 2
stringname; // 3
size_tscore;// 4
On Tue, 16 Aug 2011 13:23:26 +, teo wrote:
> What is the correct way in D to format a string like sprintf? I need to
> pad a number with zeroes. I tried to use std.format.format and
> std.string.format, but had some strange results.
You can go ahead and use the normal std.
On Tue, 16 Aug 2011 09:51:41 -0400, bearophile wrote:
> teo:
>
>> What is the correct way in D to format a string like sprintf? I need to
>> pad a number with zeroes. I tried to use std.format.format and
>> std.string.format, but had some strange results.
>
>
Is this what you're after?
import std.string;
void main()
{
auto str = format("%.4s", 4);
assert(str == "0004");
}
On Tue, 16 Aug 2011 09:32:47 -0400, Steven Schveighoffer
wrote:
On Tue, 16 Aug 2011 09:23:26 -0400, teo wrote:
What is the correct way in D to format a string like sprintf? I need to
pad a number with zeroes. I tried to use std.format.format and
std.string.format, but had some strange
teo:
> What is the correct way in D to format a string like sprintf? I need to
> pad a number with zeroes. I tried to use std.format.format and
> std.string.format, but had some strange results.
Why don't you show one or more complete runnable examples that show your
strange re
On Tue, 16 Aug 2011 09:23:26 -0400, teo wrote:
What is the correct way in D to format a string like sprintf? I need to
pad a number with zeroes. I tried to use std.format.format and
std.string.format, but had some strange results.
I think maybe std.string.format? I realize looking at the
What is the correct way in D to format a string like sprintf? I need to
pad a number with zeroes. I tried to use std.format.format and
std.string.format, but had some strange results.
> mm... ok.
> but why the line below doesn't compile?
>
> mixin(format("class %s {}", "A"));
Because format presumably can't be interpreted at compile time (yet) –
not all functions are necessarily CTFEable.
Yeah. format can only be used at runtime. If you w
Den 12-06-2011 18:37, Lloyd Dupont skrev:
mm... ok.
but why the line below doesn't compile?
mixin(format("class %s {}", "A"));
Because the mixin is evaluated at compile time. This means that
format(...) is evaluated at compile time which afaik is not supported.
I
On 2011-06-12 10:30, David Nadlinger wrote:
> On 6/12/11 6:37 PM, Lloyd Dupont wrote:
> > mm... ok.
> > but why the line below doesn't compile?
> >
> > mixin(format("class %s {}", "A"));
>
> Because format presumably can't
On 6/12/11 6:37 PM, Lloyd Dupont wrote:
mm... ok.
but why the line below doesn't compile?
mixin(format("class %s {}", "A"));
Because format presumably can't be interpreted at compile time (yet) –
not all functions are necessarily CTFEable.
David
mm... ok.
but why the line below doesn't compile?
mixin(format("class %s {}", "A"));
"bearophile" wrote in message news:it2pf5$1qh6$1...@digitalmars.com...
Apparently std.string.format() is not implemented / does not compile! :(
This works for me, DMD 2.053:
Lloyd Dupon:
> Apparently std.string.format() is not implemented / does not compile! :(
This works for me, DMD 2.053:
import std.stdio, std.string;
void main() {
int x = 10;
auto s = format("%d", 10);
writeln(">", s, "<");
}
Bye,
bearophile
Apparently std.string.format() is not implemented / does not compile! :(
Is there any sort of replacement?
Something which works like writefln() but output a string!
On 11/04/11 9:35 PM, Andrej Mitrovic wrote:
I realize runtime checks would be out of the question...
debug doRuntimeCheck();
:-)
On 4/12/11, bearophile wrote:
> Template functions may not require a bang+types if argument
> types can be inferred from the given arguments.
So isn't the string literal a candidate in this case?
Andrej Mitrovic:
> I thought templated functions can be called without a bang if an
> argument can be deduced to be available at compile time. I know I've
> read about this somewhere, either TDPL or the docs. So I thought that
> writef checks the string literal at compile time, not runtime.
I thi
I thought templated functions can be called without a bang if an
argument can be deduced to be available at compile time. I know I've
read about this somewhere, either TDPL or the docs. So I thought that
writef checks the string literal at compile time, not runtime.
Template shenanigans..
missing a format specifier. But it still accepts this code.
Is it possible for writef to statically check whether there's a format
specifier, assuming there's multiple arguments and the first argument is
a string literal?
I realize runtime checks would be out of the question, but I
On 4/12/11, Jesse Phillips wrote:
> On Tue, 12 Apr 2011 01:55:24 +0200, Andrej Mitrovic wrote:
>
>> On 4/12/11, Jesse Phillips wrote:
>>> Andrej Mitrovic Wrote:
>>>
%s doesn't stand for string in D.
>>>
>>> Yes it does.
>>
>> I was quoting bearophile's "it should error" post, you know that.
On Tue, 12 Apr 2011 01:55:24 +0200, Andrej Mitrovic wrote:
> On 4/12/11, Jesse Phillips wrote:
>> Andrej Mitrovic Wrote:
>>
>>> %s doesn't stand for string in D.
>>
>> Yes it does.
>
> I was quoting bearophile's "it should error" post, you know that.
I do now. Though it still stands for string
Jesse Phillips:
> Two complaints:
>
> fprintf? A leading f is for file.
> %s means format as a string not the type is a string.
Sorry, you are right, I am silly.
Bye,
bearophile
On 4/12/11, Jesse Phillips wrote:
> Andrej Mitrovic Wrote:
>
>> %s doesn't stand for string in D.
>
> Yes it does.
I was quoting bearophile's "it should error" post, you know that.
or: bar isn't a string!
Two complaints:
fprintf? A leading f is for file.
%s means format as a string not the type is a string.
> Bye,
> bearophile
Andrej Mitrovic Wrote:
> %s doesn't stand for string in D.
Yes it does.
> My issue is that the arguments don't get printed out due to missing
> specifiers. That is clearly a bug. But maybe it's not a huge bug since
> it's just printing that is involved.
I think it should do what it use to do w
%s doesn't stand for string in D.
My issue is that the arguments don't get printed out due to missing
specifiers. That is clearly a bug. But maybe it's not a huge bug since
it's just printing that is involved.
Andrej Mitrovic:
> I realize runtime checks would be out of the question, but I'm looking for
> compile-time checks when it's possible to do so.
GCC is often able to catch such bugs, but Walter has recently closed my
enhancement request about this :-(
http://d.puremagic.com/issues/show_bug.cgi?
There is a bug here:
import std.stdio;
void main()
{
int index;
writef("The index is", index);
}
Actually I found this bug in some example code:
http://d.puremagic.com/issues/show_bug.cgi?id=5836
writef is missing a format specifier. But it still accepts this code.
Is i
After some searching, I found the documentation here:
http://d.puremagic.com/issues/show_bug.cgi?id=3122
Shouldn't this be on the web site somewhere?
On Sunday 20 February 2011 21:26:05 Bekenn wrote:
> Is there a wstring version of string.format? I can't seem to find it
> anywhere...
There probably isn't one. A lot of functions are string-only and do not work
with char[], wchar[], dchar[], wstring, or dstring. That may or may not change
in t
Is there a wstring version of string.format? I can't seem to find it
anywhere...
%a looks neat as a lossless float formatter, but how do I get the float back
from the string?
On 09/08/2010 06:58 PM, Stanislav Blinov wrote:
> 08.09.2010 20:46, Tom Kazimiers wrote:
>> Great! I am looking forward to that release :-). Any idea when it will
>> be available?
>>
>> For the mean time I will, as proposed, make a separate function that
>> checks if there is a dot in it or not. T
08.09.2010 20:46, Tom Kazimiers wrote:
Great! I am looking forward to that release :-). Any idea when it will
be available?
For the mean time I will, as proposed, make a separate function that
checks if there is a dot in it or not. Then I take to!float and to!int,
respectively.
Cheers,
Tom
Tha
you could try
>> parse(). It might be more forgiving.
>>
>> - Jonathan M Davis
>
> No it wouldn't :)
> It's indeed a bug, and it happens if string contains e.g. single 0
> (other digits are parsed normally). It seems that parse for floating
> points tries to determine
Hi,
On 09/08/2010 05:38 PM, Don wrote:
> Pelle wrote:
>> On 09/08/2010 09:23 AM, Tom Kazimiers wrote:
>>> [ ..]
>>> Maybe a to!float that can cope with
>>> numbers without decimal point.
>>
>> You seem to have found a bug in to!float :-)
>>
>> to!float("123") works as expected, but to!float("0") b
Pelle wrote:
On 09/08/2010 09:23 AM, Tom Kazimiers wrote:
Hi,
I try to read data in from a file. This data consist mainly of numbers
and I have a hard time converting it to number type variables. Two data
lines could look like this
v 0 0 0
v 1.5 1.2 0
Now I want to parse those lines and call
On 09/08/2010 09:23 AM, Tom Kazimiers wrote:
Hi,
I try to read data in from a file. This data consist mainly of numbers
and I have a hard time converting it to number type variables. Two data
lines could look like this
v 0 0 0
v 1.5 1.2 0
Now I want to parse those lines and call a method, the
a float.
That way, you wouldn't have to keep worrying about it. Also, you could try
parse(). It might be more forgiving.
- Jonathan M Davis
No it wouldn't :)
It's indeed a bug, and it happens if string contains e.g. single 0
(other digits are parsed normally). It seems that parse fo
On Wednesday 08 September 2010 00:23:31 Tom Kazimiers wrote:
> Hi,
>
> I try to read data in from a file. This data consist mainly of numbers
> and I have a hard time converting it to number type variables. Two data
> lines could look like this
>
> v 0 0 0
> v 1.5 1.2 0
>
> Now I want to parse t
Hi,
I try to read data in from a file. This data consist mainly of numbers
and I have a hard time converting it to number type variables. Two data
lines could look like this
v 0 0 0
v 1.5 1.2 0
Now I want to parse those lines and call a method, the line in passed
(as char[]) to it:
int index =
"Jonathan M Davis" wrote in message
news:mailman.49.1280424679.13841.digitalmars-d-le...@puremagic.com...
> On Thursday, July 29, 2010 00:54:27 Nick Sabalausky wrote:
>> I could have sworn I saw Andrei say somewhere a while ago that Phobos2
>> supported posix-style
On Thursday, July 29, 2010 00:54:27 Nick Sabalausky wrote:
> I could have sworn I saw Andrei say somewhere a while ago that Phobos2
> supported posix-style indexed format specifiers. From what I could figure
> out from some searching that on the web, those are like "%1$s". Bu
I could have sworn I saw Andrei say somewhere a while ago that Phobos2
supported posix-style indexed format specifiers. From what I could figure
out from some searching that on the web, those are like "%1$s". But this
gives me a FormatException:
"%1$s".format("A"
Thanks!
With this I can go on for a bit :)
"Christopher Wright" wrote in message
news:gtrpo7$2h7...@digitalmars.com...
> Saaa wrote:
>> My first stab at the get function.
>> As you might see, I need help :D
>> Thanks!
>>
>> How do I make the function take a variadic argument and get its type?
>
Saaa wrote:
My first stab at the get function.
As you might see, I need help :D
Thanks!
How do I make the function take a variadic argument and get its type?
void get(in char[][] file, in char[] identifier, ...)
{
TypeInfo type = _arguments[0];
void* var = _argptr;
// e
My first stab at the get function.
As you might see, I need help :D
Thanks!
How do I make the function take a variadic argument and get its type?
//I guess the void pointer isn't the correct way, but I don't know any other
way
void get(in char[][] file, in char[] indentifier, void* var)
{
TypeI
ional array in JSON
we may never know :D
> You still have to parse and check everything since
> it remains a text based format.
I will be focussed on (safe) speed and not flexibility because as you
mention
otherwise it might be useless for the large arrays I wish to get/write
>
> I
Saaa wrote:
>
> I looked at the JSON format and it seems very inefficient at loading
arrays
> as it isn't limited to one type per array.
> This is nice when you want to save a small array with different typed
> elements but for my purposes this is kind of a performance p
"Saaa" wrote in message
news:gtlrs3$1b9...@digitalmars.com...
>
> I looked at the JSON format and it seems very inefficient at loading
> arrays as it isn't limited to one type per array.
> This is nice when you want to save a small array with different typed
> ele
I looked at the JSON format and it seems very inefficient at loading arrays
as it isn't limited to one type per array.
This is nice when you want to save a small array with different typed
elements but for my purposes this is kind of a performance problem.
This is why I will try an
301 - 372 of 372 matches
Mail list logo