|
1. You define the window size
2. It's quite miserly about how it uses it. Like in my last example, it only used 23 bytes of that window. That's because 90% of the data it only examines one character at a time. The remainder is the stuff you actually request.
3. On an out of memory error it halts the parse and (hopefully*) tries to recover to a known good position, like advancing past the remainder of a string value it got stuck in the middle of. Calling one of the navigation methods again should resume it. Eventually I may make a way to read values in chunks but for now I'm not worried about it. Mostly it would be to process things like base64 blobs
* this is a source of bugs, I'm sure. There's simply so many corner cases there's no way I'll catch them all without the library getting mature. If you've written parsers, you know how easy it is (sometimes) to do naive "panic mode" recovery where you just throw away symbols until a known good state, and how hard it is to actually do good error recovery. In this case, since it's a pull parser, "panic mode" isn't an option since I don't keep a stack.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Eventually I may make a way to read values in chunks I guess if it's a garage hobby project it doesn't really matter but your lib would need to handle chunked 206 in the real world. There are many HTTP/S servers that completely ignore client headers such as Accept-Encoding and send a gzip stream anyway. Some will send a 206 and give you half the data you requested out of the blue.
For example Varnish Cache[^] always sends a 206 even when it sends you the whole file! Laymen believe that internet software is orderly and structured but it's really complete anarchy out there in the real world.
|
|
|
|
|
That's transport layer stuff my lib doesn't deal with. It knows nothing of files, HTTP, or sockets. I have a class I derive and implement a read() method to make it work for various input sources. You'd want that that supported HTTP properly.
Real programmers use butterflies
|
|
|
|
|
|
Not Santana ? And they go along with his philosophy that "you've got to Change Your Evil Ways".
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I think it's a wreath of Franklin ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
They're doing it just to prove me wrong.
I keep posting, as appropriate, that "There's no cure for stupid".
Well, there is, actually, one cure - and dying (of COVID) doesn't where off.*
* unfortunately, the sharing will also hurt those who did know better.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Well, over here we had some 'pots & pans music' during prime minister Rutte's speech about the lockdown measures from his tower office in the Binnenhof, he did not let that disturb him though
|
|
|
|
|
"Medley: I'll be Home for Christmas / Katie, Bar The Door"
|
|
|
|
|
Just Discovered: Reactions.
Countered the thumbs down with a thumbs up. And then some.
The only thing I can think of as non-positive is that isn't this behavior by UK'ers (and Parisians, at one point, too) a Leslie of sorts?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
As I said to my son earlier today, these are the same idiots who behave idiotically in normal times. I had hoped that Covid would maybe act as a cull of this species, but the governments does not seem to want to let it.
|
|
|
|
|
Richard MacCutchan wrote: I had hoped that Covid would maybe act as a cull of this species, but the governments does not seem to want to let it.
The reason the government is not letting it happen (at least in some states) is that the cull would not be limited to the participants but will be further distributed into the others.
Your idea would work if we could gather all of them into a single location (like, for example, Alabama) and not let them out to spread it after giving it to one another. However - if we could isolate them in a single location like that the problem wouldn't be a problem and innumerable other problems would dissipate, as well.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
My comment was strictly tongue ibn cheek. But I do recall a science fiction film years ago where aliens gave some people some gizmos which had "the power of life and death". Ultimately some clever scientist discovered that they could selectively destroy all the evil people on earth. Would that it were true.
|
|
|
|
|
W∴ Balboos, GHB wrote: The reason the government is not letting it happen (at least in some states) is that the cull would not be limited to the participants but will be further distributed into the others.
No, the real problem is that, with the exception of parts of the United States, Western governments have disarmed most law-abiding people. In the not-so-distant past, most law-abiding farmers also had shotguns, and you can be sure that they would be warning off any suspected plague-carriers from the cities.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
W∴ Balboos, GHB wrote: Your idea would work if we could gather all of them into a single location (like, for example, Alabama) and not let them out to spread it after giving it to one another. Something similar was the master move in a book. If I recall correctly it was (translated back from spanish) "The mercenary" but I can't find it...
first I thought it was Heinlein's, but no...
Then I checked Pohl... no.
Pity... you would like it for sure.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Heinlein had a somewhat similar idea as "Coventry" in his future history, where people who cold not fit into society and who would not accept mental alteration were sent.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I don't think it was it.
In the one I mean, the scene takes place in a football stadium. All those "insurgents" are taken there by the central char (supposedly a rebel too) and, when everybody is inside, the doors get closed and everyone inside gets killed.
The descriptions are pretty graphical and the "speech" of the "betrayor" after that is... but on the same time it kind of makes sense in a macabre way. Short after the book ends.
Nevermind...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yeah, let's concentrate all the stupid people with the wrong opinions into one place.
Really can't see how that can go wrong.
Wrong is evil and must be defeated. - Jeff Ello
Never stop dreaming - Freddie Kruger
|
|
|
|
|
That's a way of looking at it - a bit dark and sinister.
On the other hand, maybe - just maybe - they'll all be in a state of delight that everyone around them agrees with them ! And when they do dangerous and stupid things that endanger both themselves and others, well, no one will complain. It's their right!
And if they kill each other off - by accident or design - is that such an ethical tragedy?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Richard MacCutchan wrote: but the governments does not seem to want to let it. If Covid kills idiots, then of course the politicians will try to stop it.
|
|
|
|
|
Yeah, charity begins at home.
|
|
|
|
|
W∴ Balboos, GHB wrote: isn't this behavior by UK'ers (and Parisians, at one point, too) a Leslie of sorts?
It certainly is. Great Plague of London - Exodus from the city
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
We have here a couple of cities / towns where the crematories are overfilled although they are making double shifts each day. Even the bureaucrats have to work and do extra hours during Christmas break because without the deceasal certificate, the crematories can't do their job.
Last year one binder was enough for 3 or 4 months... in dezember the binder was full by the 18th. And rate is increasing...
Pity is... the dumbs and the nuts usually have more luck than they deserve
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
With the cute hat, if you'd just make him blue for the holidays I sure I fix Bob up with Smurf babes[^] who take mistletoe "very seriously".
(and someone for many of the rest of us)[^]
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|