On Tuesday, 22 February 2022 at 00:44:58 UTC, jmh530 wrote:
On Tuesday, 22 February 2022 at 00:36:38 UTC, bachmeier wrote:
[snip]
Yes. std.random is another. I gave up out on the current one.
Luckily I already had external libraries for that before I
started using D.
Have you tried mir.rand
On Tuesday, 22 February 2022 at 00:36:38 UTC, bachmeier wrote:
[snip]
Yes. std.random is another. I gave up out on the current one.
Luckily I already had external libraries for that before I
started using D.
Have you tried mir.random?
On Monday, 21 February 2022 at 22:58:17 UTC, Ali Çehreli wrote:
On 2/21/22 09:34, bachmeier wrote:
> I may have to look for an alternative
> JSON library for D. std.json is not the most fun independent
of this issue.
std.json is a very good module. At work, we had to write
additional code to c
On 2/21/22 14:58, Ali Çehreli wrote:
> std.json is a very good module.
Correction: std.json is NOT a very good module.
Ali
On Monday, 21 February 2022 at 15:13:52 UTC, Kagamin wrote:
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote:
Why are we even escaping them by default, it should be the
other way around, that slashes are only escaped if you ask for
it; that's how it literally is in almost every JSON lib
On 2/21/22 09:34, bachmeier wrote:
> I may have to look for an alternative
> JSON library for D. std.json is not the most fun independent of this
issue.
std.json is a very good module. At work, we had to write additional code
to cover its defficiencies.
Looking forward to versioning in Phob
On Monday, 21 February 2022 at 17:50:56 UTC, bachmeier wrote:
I looked at the source for `parseJSON` and I see references
only to `JSONOptions.strictParsing` and
`JSONOptions.specialFloatLiterals`. I may be missing something,
but I don't see any option to iterating over every element and
unes
ot;: "path/file"}`,
JSONOptions.doNotEscapeSlashes));
}
```
but the output is
```
{"a":"path\/file"}
```
Is there a way to avoid the escaping of the forward slash? Is
there some reason I should want to escape the forward slash?
The options are applied on parsing
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote:
Why are we even escaping them by default, it should be the
other way around, that slashes are only escaped if you ask for
it; that's how it literally is in almost every JSON library.
Escaping slashes as a default is a huge mistake IMHO
s));
}
```
but the output is
```
{"a":"path\/file"}
```
Is there a way to avoid the escaping of the forward slash? Is
there some reason I should want to escape the forward slash?
The options are applied on parsing or output but do not stay
with the item! So just because
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote:
Why are we even escaping them by default, it should be the
other way around, that slashes are only escaped if you ask for
it; that's how it literally is in almost every JSON library.
Really? I always see escaped slashes in JSON, e.g. wi
On Monday, 21 February 2022 at 03:42:55 UTC, bachmeier wrote:
I tried this
```
import std.json, std.stdio;
void main() {
writeln(parseJSON(`{"a": "path/file"}`,
JSONOptions.doNotEscapeSlashes));
}
```
but the output is
```
{"a":"path\/file"}
```
Is there a way to avoid the escaping of
``
Is there a way to avoid the escaping of the forward slash? Is
there some reason I should want to escape the forward slash?
The options are applied on parsing or output but do not stay with
the item! So just because you parsed without allowing escapes on
slashes doesn't mean the output
I tried this
```
import std.json, std.stdio;
void main() {
writeln(parseJSON(`{"a": "path/file"}`,
JSONOptions.doNotEscapeSlashes));
}
```
but the output is
```
{"a":"path\/file"}
```
Is there a way to avoid the escaping of the forward slash? Is
there some reason I should want to escap
hat's unfortunate, because my next enhancement
was to start parsing streams as they come in from stdin. (doh!)
So I've learned my lesson and will RTFM closer next time, but now I'm
casting about for a solution. Two ideas, either:
1. Find a different StAX-ish parser that works wi
nhancement was to start parsing streams as they
come in from stdin. (doh!)
So I've learned my lesson and will RTFM closer next time, but now
I'm casting about for a solution. Two ideas, either:
1. Find a different StAX-ish parser that works with `InputRange`
(and buffers internally
On Tuesday, 24 March 2020 at 14:10:19 UTC, WebFreak001 wrote:
On Tuesday, 24 March 2020 at 11:15:24 UTC, matheus wrote:
On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote:
I'm creating a connection to the db and conn.exec(sql
On Tuesday, 24 March 2020 at 11:15:24 UTC, matheus wrote:
On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote:
I'm creating a connection to the db and conn.exec(sql)
It depends on the library but it is almost always easier to
On 3/24/20 7:15 AM, matheus wrote:
On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote:
I'm creating a connection to the db and conn.exec(sql)
It depends on the library but it is almost always easier to do it
right than to d
On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote:
I'm creating a connection to the db and conn.exec(sql)
It depends on the library but it is almost always easier to do
it right than to do it the way you are.
like with my
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote:
On Monday, 23 March 2020 at 15:07:31 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote:
do you mean I should loop through each pos till
strlen(cellTab[CellIndex].name) to find "\0"?
strlen is ok, that g
On Monday, 23 March 2020 at 15:07:31 UTC, Adam D. Ruppe wrote:
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote:
do you mean I should loop through each pos till
strlen(cellTab[CellIndex].name) to find "\0"?
strlen is ok, that gives the answer itself. Just slice to that.
cellTab[CellIn
On Monday, 23 March 2020 at 14:58:03 UTC, bauss wrote:
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote:
On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote:
My first thought is to!string(cellTab[CellIndex].name) is
wrong, if it is a char[20] you should be scanning it to find
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote:
do you mean I should loop through each pos till
strlen(cellTab[CellIndex].name) to find "\0"?
strlen is ok, that gives the answer itself. Just slice to that.
cellTab[CellIndex].name[0 .. strlen(cellTab[CellIndex].name.ptr)]
could do it
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote:
On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote:
My first thought is to!string(cellTab[CellIndex].name) is
wrong, if it is a char[20] you should be scanning it to find
the length and slicing. Maybe [0 .. name.indexOf("\0")]
On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote:
My first thought is to!string(cellTab[CellIndex].name) is
wrong, if it is a char[20] you should be scanning it to find
the length and slicing. Maybe [0 .. name.indexOf("\0")] or
whatever.
You also shouldn't be building a query by
My first thought is to!string(cellTab[CellIndex].name) is wrong,
if it is a char[20] you should be scanning it to find the length
and slicing. Maybe [0 .. name.indexOf("\0")] or whatever.
You also shouldn't be building a query by concatenation.
Hi guys,
I'm trying to read a name from a struct iorequest where the name
is char name[20]
The struct is received through a FIFO pipe and message is going
into a mysql database to update specific post there.
Now my problem is that all works fine to read and stop with '\0'
termination till I
On Wednesday, 20 November 2019 at 00:07:53 UTC, Joel wrote:
On Tuesday, 19 November 2019 at 14:20:39 UTC, Kagamin wrote:
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
```
http://www.w3.org/2001/XMLSchema-instance";>
```
You're missing a closing tag.
I can store the ASV Bibl
On Tuesday, 19 November 2019 at 14:20:39 UTC, Kagamin wrote:
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
```
http://www.w3.org/2001/XMLSchema-instance";>
```
You're missing a closing tag.
I can store the ASV Bible in an array (I check for if the last
book, chapter, and ve
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
```
http://www.w3.org/2001/XMLSchema-instance";>
```
You're missing a closing tag.
On Tuesday, 19 November 2019 at 04:43:31 UTC, Joel wrote:
On Tuesday, 19 November 2019 at 02:45:29 UTC, Jonathan M Davis
wrote:
[...]
Thanks for taking the time to reply.
I have had another xml Bible version text in the past [1]. It
had a different format. And Adam Ruppe helped me by writing
On Tuesday, 19 November 2019 at 02:45:29 UTC, Jonathan M Davis
wrote:
On Sunday, November 17, 2019 11:44:43 PM MST Joel via
Digitalmars-d-learn wrote:
[...]
You need to be checking the type of the entity before you call
either name or text on it, because not all entities have a
name, and not
On Sunday, November 17, 2019 11:44:43 PM MST Joel via Digitalmars-d-learn
wrote:
> I can only parse one row successfully. I tried increasing the
> popFronts, till it said I'd gone off the end.
>
> Running ./app
> core.exception.AssertError@../../../../.dub/packages/dxml-0.4.1/dxml/sourc
> e/dxml/p
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
with(ver)
vers ~= Verse(id,b,c,v,t);
Or, vers ~= ver;
I can only parse one row successfully. I tried increasing the
popFronts, till it said I'd gone off the end.
Running ./app
core.exception.AssertError@../../../../.dub/packages/dxml-0.4.1/dxml/source/dxml/parser.d(1457):
text cannot be called with elementEnd
??:? _d_assert_msg [0
On Thursday, 31 October 2019 at 08:40:42 UTC, lili wrote:
Hi:
I want implementation Lua on D, I find that a PEG parser
https://github.com/PhilippeSigaud/Pegged
why do not use BNF parser. Is PEG better than BNF?
IIRC the PEG for D is not complete. You have an EBNF here
https://libdparse
/lang/peg
Which says in the abstract:
The power of generative grammars to express ambiguity is
crucial to their original purpose of modelling natural
languages, but this very power makes it unnecessarily difficult
both to express and to parse machine-oriented languages using
CFGs. Parsing
Hi:
I want implementation Lua on D, I find that a PEG parser
https://github.com/PhilippeSigaud/Pegged
why do not use BNF parser. Is PEG better than BNF?
Has anybody put together a File-compatible web-download API?
Mu goal is to do have it do
1. stream-based download (via http or https),
2. compress (with gzip or bzip2) and
3. textual parse
of resources available either on the web or locally cached.
An extra bonus would be if the API provided a
my Meson
projects and I was wondering how would I know if AppVayer is
parsing my yaml file? I know I got a failed build because it
was set to MSBuild by default. But after I set the value to
script, how would I know it's doing its work and not just
spinning its wheels.
https://githu
AppVayer is parsing my
yaml file? I know I got a failed build because it was set to
MSBuild by default. But after I set the value to script, how
would I know it's doing its work and not just spinning its
wheels.
https://github.com/squidfarts/d-example.git
This is a question about AppVeyor,
If you never seen Meson before then pick up a camera and take a
picture:
🤔 👉 https://mesonbuild.com/
Quick question.
I started integrating ci/cd best practices to my Meson projects
and I was wondering how would I know if AppVayer is parsing my
yaml file? I know I got a failed build because
On Tuesday, 16 July 2019 at 22:24:32 UTC, Mike Brockus wrote:
If you never seen Meson before then set down and take a look:
🤔 👉 https://mesonbuild.com/
Quick question.
I started integrating ci/cd best practices to my Meson projects
and I was wondering how would I know if AppVayer is parsing
If you never seen Meson before then set down and take a look:
🤔 👉 https://mesonbuild.com/
Quick question.
I started integrating ci/cd best practices to my Meson projects
and I was wondering how would I know if AppVayer is parsing my
yaml file? I know I got a failed build because it was set
On Monday, 20 May 2019 at 14:57:57 UTC, Adam D. Ruppe wrote:
idk about phobos, but I have one of these in my web server
library
git hub link https://github.com/adamdruppe/arsd
or dub link http://code.dlang.org/packages/arsd-official
On Monday, 20 May 2019 at 14:44:50 UTC, Boqsc wrote:
I'm questioning, if D lang will ever include simple URL parsing
into their std Phobos library?
idk about phobos, but I have one of these in my web server library
http://dpldocs.info/experimental-docs/arsd.cgi.Uri.html
(also copy/past
void main()
{
string url =
"https://github.com/BoQsc/notes/archive/master.zip";;
// Output: url path:
writeln("url path: ", url.rootName);
}
I'm questioning, if D lang will ever include simple URL parsing
into their std Phobos library?
Curl added an api to access the
c/notes/archive/master.zip";;
// Output: url path:
writeln("url path: ", url.rootName);
}
I'm questioning, if D lang will ever include simple URL parsing
into their std Phobos library?
I have the following grammar https://run.dlang.io/is/gRTGm3
If user types `ubyte1` instead of `ubyte` the whole string parsing fails
and error message says string is wrong from the start. How can I get
more informative message like "unknown type ubyte1" or at least error
position
On Thursday, 31 May 2018 at 18:33:37 UTC, Ali Çehreli wrote:
On 05/31/2018 09:49 AM, Adam D. Ruppe wrote:
> Should be fairly simple to follow, just realize that the
image is a 2d
> block for each char and that's why there's all those
multiplies and
> divides.
I remember doing similar things wit
On 05/31/2018 09:49 AM, Adam D. Ruppe wrote:
> Should be fairly simple to follow, just realize that the image is a 2d
> block for each char and that's why there's all those multiplies and
> divides.
I remember doing similar things with fonts to add Turkish characters to
Digital Research and Wor
he moment for dealing with invalid XML (especially with the issues
caused by the fact that only one range actually does the validation, making
selective skipping of invalid stuff while parsing a very iffy proposition).
dxml was designed with the idea that it would be operating on valid XML, and
designing a
On Monday, 7 May 2018 at 22:24:25 UTC, Jonathan M Davis wrote:
I've been considering adding more configuration options where
you say something like you don't care if any invalid characters
are encountered, in which case, you could cleanly parse past
something like an unescaped &, but you'd the
> } catch (Exception e) {
> >
> > range.popFront;
> >
> > }
>
> Ok so this worked when inside a quoted attribute value but not a
> normal tag body. Clearly I'm not parsing valid XML so I'm going
> outside the bounds of valid paramet
states:
"If invalid XML is encountered at any point during the parsing process, an
XMLParsingException will be thrown. If an exception has been thrown, then
the parser is in an invalid state, and it is an error to call any functions
on it."
What happens if you continue parsing after an ex
hout issue. Is this something
expected and will be maintained?
try {
range.popFront();
} catch (Exception e) {
range.popFront;
}
Ok so this worked when inside a quoted attribute value but not a
normal tag body. Clearly I'm not parsing valid XML so I'm goin
So I have an XML like document which fails to adhere completely
to XML. One of these such events is that & is used without
escaping.
My observation is that after the exception it is possible to move
to the next element without issue. Is this something expected and
will be maintained?
t
On Wednesday, 12 April 2017 at 10:58:07 UTC, Nicholas Wilson
wrote:
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder
wrote:
Are Argon https://github.com/markuslaker/Argon or darg
https://github. com/jasonwhite/darg getting traction as the
default command line handling system for D or
On Friday, 22 December 2017 at 21:36:20 UTC, Ryan David Sheasby
wrote:
Hi. Struggling to figure this out. At the bottom of this page:
https://dlang.org/library/std/conv/octal.html is a vague
reference to using parse. However, when I use what I would
assume to be correct based on this:
https://
Hi. Struggling to figure this out. At the bottom of this page:
https://dlang.org/library/std/conv/octal.html is a vague
reference to using parse. However, when I use what I would assume
to be correct based on this:
https://dlang.org/phobos/std_conv.html#.parse.3 and the fact that
in the octal
On Wednesday, 6 December 2017 at 18:47:03 UTC, Mark wrote:
formattedRead(readln(), "%s %s", first_name, last_name);
You could write a little wrapper function to do that
uint myformattedRead (R, Char, S...)(R r, const(Char)[] fmt, auto
ref S args) {
formattedRead(r, fmt, args);
}
It jus
On Wednesday, 6 December 2017 at 18:57:55 UTC, Ali Çehreli wrote:
On 12/06/2017 10:47 AM, Mark wrote:
> string info = readln();
> formattedRead(info, "%s %s", first_name, last_name);
>
> This piece of code works
> formattedRead(readln(), "%s %s", first_name, last_name);
>
> But this raises a co
On 12/06/2017 10:47 AM, Mark wrote:
> string info = readln();
> formattedRead(info, "%s %s", first_name, last_name);
>
> This piece of code works
> formattedRead(readln(), "%s %s", first_name, last_name);
>
> But this raises a compilation error, claiming that formattedRead "cannot
> deduce funct
std.format has the function formattedRead which can be used to
parse a string, e.g.
string first_name;
string last_name;
string info = readln();
formattedRead(info, "%s %s", first_name, last_name);
This piece of code works as intended. However, since I don't need
the input after it's parsed, I
Hello,
Parsing mbox file (/var/spool/mail/... on a Ubuntu machine)
and splitting to a range or array of mail objects.
Has anyone done this with D? please give me hint. (DUB, git, this
forum?)
Or should I start with formail (-s) as a subprocess?
(At first step, I want to run a vibe.d server
btw it is important to use right compiler with right flags I am using ldc
with this flags
ldmd2 -O -release -boundscheck=off
On Fri, Jun 9, 2017 at 6:28 PM, uncorroded via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> On Friday, 9 June 2017 at 14:19:48 UTC, Daniel Kozak wrote:
On Fri, Jun 09, 2017 at 04:28:08PM +, uncorroded via Digitalmars-d-learn
wrote:
[...]
> Is there a good resource to read about the good stuff in std.algorithm
> and range? I tried going through the library docs but they are too
> exhaustive!
[...]
Try these:
http://ddili.org/ders/d.e
On Friday, 9 June 2017 at 14:19:48 UTC, Daniel Kozak wrote:
import std.stdio;
import std.array: appender, array;
import std.algorithm : findSplit, splitter, joiner, canFind,
map;
import std.typecons : tuple, Tuple;
import std.conv : to;
import std.range : dropOne, dropExactly, takeExactly, chai
import std.stdio;
import std.array: appender, array;
import std.algorithm : findSplit, splitter, joiner, canFind, map;
import std.typecons : tuple, Tuple;
import std.conv : to;
import std.range : dropOne, dropExactly, takeExactly, chain;
alias push_type = Tuple!(int, char[], int, bool, bool);
alia
On Friday, 9 June 2017 at 08:58:38 UTC, Daniel Kozak wrote:
There is no difference in speed because you do not process
your data
lazily, so you make many allocations, so this is main reason
why it is so slow. I could improve that, but I will need to see
some example data, which you are trying
On Fri, Jun 9, 2017 at 9:34 AM, uncorroded via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> Hi guys,
>
> I am a beginner in D. As a project, I converted a log-parsing script in
> Python which we use at work, to D. This link was helpful - (
> https://dlan
Dne 9.6.2017 v 09:50 rikki cattermole via Digitalmars-d-learn napsal(a):
On 09/06/2017 8:34 AM, uncorroded wrote:
Hi guys,
...
The code isn't entirely 1:1. Any usage of IO (includes stdout via
writeln) is expensive. Your python code doesn't write anything to
stdout (or perform any calls).
; Hi guys,
>>
>> I am a beginner in D. As a project, I converted a log-parsing script in
>> Python which we use at work, to D. This link was helpful - (
>> https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ ) I
>> compiled it with dmd and ldc. The log fi
On 09/06/2017 8:34 AM, uncorroded wrote:
Hi guys,
I am a beginner in D. As a project, I converted a log-parsing script in
Python which we use at work, to D. This link was helpful - (
https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ ) I
compiled it with dmd and ldc. The log
Hi guys,
I am a beginner in D. As a project, I converted a log-parsing
script in Python which we use at work, to D. This link was
helpful - (
https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/
) I compiled it with dmd and ldc. The log file is 52 MB. With dmd
(not release
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
Are Argon https://github.com/markuslaker/Argon or darg
https://github. com/jasonwhite/darg getting traction as the
default command line handling system for D or are they just
peripheral and everyone just uses std.getopt
https:/
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
Are Argon https://github.com/markuslaker/Argon or darg
https://github. com/jasonwhite/darg getting traction as the
default command line handling system for D or are they just
peripheral and everyone just uses std.getopt
https:/
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
Are Argon https://github.com/markuslaker/Argon or darg
https://github. com/jasonwhite/darg getting traction as the
default command line handling system for D or are they just
peripheral and everyone just uses std.getopt
https:/
On 12/04/2017 10:51 AM, Russel Winder via Digitalmars-d-learn wrote:
Are Argon https://github.com/markuslaker/Argon or darg https://github.
com/jasonwhite/darg getting traction as the default command line
handling system for D or are they just peripheral and everyone just
uses std.getopt https:/
Are Argon https://github.com/markuslaker/Argon or darg https://github.
com/jasonwhite/darg getting traction as the default command line
handling system for D or are they just peripheral and everyone just
uses std.getopt https://dlang.org/phobos/std_getopt.html ?
--
Russel.
=
On Monday, 27 March 2017 at 09:05:00 UTC, Seb wrote:
On Saturday, 25 March 2017 at 06:53:58 UTC, xtreak wrote:
Hi,
Sorry for the double post. I have asked a question at
Stackoverflow regarding this :
https://stackoverflow.com/questions/42992507/get-float-value-out-of-jsonvalue-in-dlang . I ha
On Saturday, 25 March 2017 at 06:53:58 UTC, xtreak wrote:
Hi,
Sorry for the double post. I have asked a question at
Stackoverflow regarding this :
https://stackoverflow.com/questions/42992507/get-float-value-out-of-jsonvalue-in-dlang . I have a `rating` field that might have 3 which parses to
taking the same time.
So I profiled again and now the time for JSON parsing has
suddenly increased as per the profile. I thought it was due to
using .type and I returned a hardcoded number for the function
get_number and the time to write to terminal increased. I don't
know why reducing the
On Saturday, 28 January 2017 at 15:40:24 UTC, Nestor wrote:
On Friday, 27 January 2017 at 04:26:31 UTC, Era Scarecrow wrote:
Skipping the BOM is just a matter of skipping the first two
bytes identifying it...
AFAIK in some cases the BOM takes up to 4 bytes (FOR UTF-32),
so when input encodin
On Friday, 27 January 2017 at 04:26:31 UTC, Era Scarecrow wrote:
Skipping the BOM is just a matter of skipping the first two
bytes identifying it...
AFAIK in some cases the BOM takes up to 4 bytes (FOR UTF-32), so
when input encoding is unknown one must perform some kind of
detection in orde
On Friday, 27 January 2017 at 07:02:52 UTC, Jack Applegame wrote:
On Monday, 16 January 2017 at 14:47:23 UTC, Era Scarecrow wrote:
static char[1024*4] buffer; //4k reusable buffer, NOT
thread safe
Maybe I'm wrong, but I think it's thread safe. Because static
mutable non-shared variables
On Monday, 16 January 2017 at 14:47:23 UTC, Era Scarecrow wrote:
static char[1024*4] buffer; //4k reusable buffer, NOT
thread safe
Maybe I'm wrong, but I think it's thread safe. Because static
mutable non-shared variables are stored in TLS.
On Tuesday, 17 January 2017 at 11:40:15 UTC, Nestor wrote:
Thanks, but unfortunately this function does not produce proper
UTF8 strings, as a matter of fact the output even starts with
the BOM. Also it doesn't handle CRLF, and even for LF
terminated lines it doesn't seem to work for lines other
On Monday, 16 January 2017 at 14:47:23 UTC, Era Scarecrow wrote:
On Sunday, 15 January 2017 at 19:48:04 UTC, Nestor wrote:
I see. So correcting my original doubt:
How could I parse an UTF16LE file line by line (producing a
proper string in each iteration) without loading the entire
file into
On Sunday, 15 January 2017 at 19:48:04 UTC, Nestor wrote:
I see. So correcting my original doubt:
How could I parse an UTF16LE file line by line (producing a
proper string in each iteration) without loading the entire
file into memory?
Could... roll your own? Although if you wanted it to be
On Sunday, 15 January 2017 at 16:29:23 UTC, Daniel Kozák wrote:
This is because byLine does return range, so until you do
something with that it does not cause any harm :)
I see. So correcting my original doubt:
How could I parse an UTF16LE file line by line (producing a
proper string in each
V Sun, 15 Jan 2017 14:48:12 +
Nestor via Digitalmars-d-learn napsáno:
> On Friday, 6 January 2017 at 11:42:17 UTC, Mike Wey wrote:
> > On 01/06/2017 11:33 AM, pineapple wrote:
> >> On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
>
> I'm not sure if this works quite as in
On Sunday, 15 January 2017 at 14:48:12 UTC, Nestor wrote:
After some testing I realized that byLine was not the one
failing, but any string manipulation done to the obtained line.
Compile the following example with and without -debug and run
to see what I mean:
import std.stdio, std.string;
On Friday, 6 January 2017 at 11:42:17 UTC, Mike Wey wrote:
On 01/06/2017 11:33 AM, pineapple wrote:
On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
I'm not sure if this works quite as intended, but I was at
least able
to produce a UTF-16 decode error rather than a UTF-8 decode
error
On 01/06/2017 11:33 AM, pineapple wrote:
On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
I'm not sure if this works quite as intended, but I was at least able
to produce a UTF-16 decode error rather than a UTF-8 decode error by
setting the file orientation before reading it.
import
On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
I'm not sure if this works quite as intended, but I was at
least able to produce a UTF-16 decode error rather than a
UTF-8 decode error by setting the file orientation before
reading it.
import std.stdio;
import core.stdc.wchar
I'm not sure if this works quite as intended, but I was at
least able to produce a UTF-16 decode error rather than a UTF-8
decode error by setting the file orientation before reading it.
import std.stdio;
import core.stdc.wchar_ : fwide;
void main(){
auto file = File("UTF-
On 1/4/17 6:03 AM, Nestor wrote:
Hi,
I was just trying to parse a UTF-16LE file using byLine, but apparently
this function doesn't work with anything other than UTF-8, because I get
this error:
"Invalid UTF-8 sequence (at index 1)"
How can I achieve what I want, without loading the entire file
Nestor via Digitalmars-d-learn
napsal St, led 4, 2017 v 8∶20 :
On Wednesday, 4 January 2017 at 18:48:59 UTC, Daniel Kozák wrote:
Ok, I've done some testing and you are right byLine is broken, so
please fill a bug
A bug? I was under the impression that this function was *intended*
to work onl
1 - 100 of 285 matches
Mail list logo