|
I am rewriting my entire SVG parsing to be able to peephole parse the entire thing using a 64 byte capture buffer. (Or more, but 64 bytes is the minimum)
This creates an interesting problem when it comes to really long attributes like the "d" attribute on the "path" element in SVG.
<path d="M-8.2 249.201C-8.2 249.201 -9 247.201 -13.4 246.801C-13.4 246.801 -35.8 243.201 -44.2 230.801C-44.2 230.801 -51 225.201 -46.6 236.801C-46.6 236.801 -36.2 257.201 -29.4 260.001C-29.4 260.001 -13 264.001 -8.2 249.201z"/>
The trick is the peephole parser returns about 64 bytes of that "d" attribute's value at a time. To read the entire "d" attribute will typically require multiple calls to read()
Well, I did it. With judicious use of state machines I can parse a float, skip whitespace, and parse path commands even they land partly across the 64 byte capture boundary.
Previously in my old code, I would gather all of the capture into one big string buffer and parse that.
This new approach wasn't easy code, but the result is very memory efficient, and robust in that it can handle content of any length with a constant (and very small) amount of memory.
Bless state machines. I have 7 states in my float parser alone.
I feel like I had my Wheaties this morning. Hooah!
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I just came across a spam message that appeared to have been created by ChatGPT. It contained instructions on how to try and get your Daily Insider subscription working.
|
|
|
|
|
I threw a boomerang a few years ago. I now live in constant fear.
|
|
|
|
|
I was hit by a boomerang, a few years ago.
Now you should fear my revenge.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
I couldn't quite remember how to throw a boomerang correctly.
But eventually, it came back to me.
|
|
|
|
|
Wordle 1,182 3/6
🟨🟩⬜⬜⬜
⬜🟩🟨🟨⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,182 3/6*
⬜⬜🟨⬜⬜
🟨⬜⬜🟨⬜
🟩🟩🟩🟩🟩
Can't believe the luck on that 3rd attempt.
|
|
|
|
|
⬜🟨🟨⬜⬜
🟨⬜🟨⬜🟨
🟩🟩⬜🟨⬜
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,182 3/6*
🟨🟨⬜🟩⬜
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
"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!
|
|
|
|
|
Wordle 1,182 4/6
⬜⬜🟨⬜⬜
🟨⬜⬜⬜⬜
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
Within you lies the power for good - Use it!
|
|
|
|
|
Wordle 1,182 4/6*
⬜⬜🟨⬜⬜
⬜🟩⬜⬜🟨
🟨🟩⬜⬜🟨
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
|
Where was the bag and how did the thief get in? Or was this just another Labour stunt?
|
|
|
|
|
Richard MacCutchan wrote: how did the thief get in?
Well, more people voted for her party than for any of the others...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Proof, if it were needed, that you can only fool some of the people ...
|
|
|
|
|
William Shakespeare wrote: A man may see how this world goes with no eyes. Look with thine ears: see how yond justice rails upon yond simple thief. Hark, in thine ear: change places; and, handy-dandy, which is the justice, which is the thief?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Crime minister sounds like she makes sure there's enough crime and that crime is carried out correctly.
Criminals have a place in society too and the criminal interests group is lobbying for more pay and recognition for criminals.
We have a minister of security and justice who prevents all that.
|
|
|
|
|
The receptionist asked me "How about 10 tomorrow?"
But I don't need that many.
I was still wearing my coat.
|
|
|
|
|
I beg to differ, I think you probably need em bro.
|
|
|
|
|
Why ?
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
OK, looks like you need them too.
|
|
|
|
|
I'm probably having a dumb moment so, can you please explain ?
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
. . . A Moment is one sixtyeth of an hour
|
|
|
|
|
Nobody mentioned moment
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|