|
Sander Rossel wrote: but my uncle certainly isn't having any of it (although he could be dead three times over, is another way of looking at it). Coworker with lever transplantation was complaining that he wasn't allowed to lift more than 10 kilos after a year... Wife told him: Would the alternative have been better?
He never complained again.
And I was trying my father to change some habits during / after corona, he told me "I prefer to live 2 years than to survive 5", I never complained again.
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.
|
|
|
|
|
Note to self: never be Sander's uncle.
Sorry to hear that. Apparently your uncles are luckless.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Yeah, one nearly died of two collapsed lungs, one is in the hospital with his second cancer, two already died, one lost his son in an accident... And that's only counting the brothers of my parents
The one that fell down the stairs is "only" uncle by marriage (but much more fun than most of my other uncles).
CPallini wrote: Note to self: never be Sander's uncle. I think you're good, uncle Pallini
|
|
|
|
|
I have a theory that ladder's and stairs are swore enemies of human beings.
Always remember that when using them.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Yep - Fell from a 6 foot step ladder while hanging Christmas lights about 20 years ago resulting in 7 broken ribs, broken wrist, collapsed lung.
Of course I was acting immortal (being STUPID) and standing on the "Do not stand on this step" very top step and reaching up at the time....
My side still aches occasionally to remind me that I am not, in fact, immortal. I'm still pretty stupid tho...
Best wishes everyone - Craig
|
|
|
|
|
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 would be interested in learning of the solution technique.
|
|
|
|
|
Here's my float routine. It uses my ml_reader markup peephole parser
Basically I keep a running cursor over the current buffer (**current) as well as the rdr for when I need to fetch the next string. The rest is just state machine stuff.
result_t parse_float(ml_reader_base& rdr, const char** current, float* result) {
char* end = NULL;
double res = 0.0, sign = 1.0;
long long intPart = 0, fracPart = 0;
int fracCount = 0;
long expPart = 0;
char expNeg = 0;
char hasIntPart = 0, hasFracPart = 0, hasExpPart = 0;
int state = 0;
if (**current == '+') {
(*current)++;
} else if (**current == '-') {
sign = -1;
(*current)++;
}
while (state<7) {
if (**current) {
switch (state) {
case 0: if (!isdigit(**current)) {
state = 1;
break;
}
hasIntPart=1;
intPart = (intPart*10)+(**current-'0');
++(*current);
break;
case 1:
*result = (float)intPart;
if(**current!='.') {
state = 3;
break;
}
++(*current);
state = 2;
break;
case 2: if (!isdigit(**current)) {
state = 3;
break;
}
++fracCount;
hasFracPart=1;
fracPart = (fracPart*10)+(**current-'0');
++(*current);
break;
case 3:
if(hasFracPart) {
*result += (double)fracPart/pow(10.0,(double)fracCount);
}
if(**current=='E' || **current=='e') {
++(*current);
state = 4;
} else {
state = 6;
}
break;
case 4:
if(**current=='+') {
++(*current);
}
if(**current=='-') {
expNeg = 1;
++(*current);
}
state = 5;
break;
case 5:
if (!isdigit(**current)) {
state = 6;
break;
}
hasExpPart=1;
expPart = (expPart*10)+(**current-'0');
++(*current);
break;
case 6:
if(hasExpPart) {
if(expNeg) {
expPart = -expPart;
}
*result *= pow(10.0,(double)expPart);
}
*result*=sign;
state = 7;
break;
}
} else {
if (!rdr.read()) {
return IO_ERROR;
}
if (!rdr.has_value()) {
*current = nullptr;
break;
}
*current = rdr.value();
}
}
if (rdr.node_type() == ml_node_type::attribute_end) {
if (!rdr.read()) {
return IO_ERROR;
}
}
if(!hasIntPart&&!hasFracPart) {
return FMT_ERROR;
}
return SUCCESS;
}
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I agree. I’ve done some amazingly complex code on extremely resource limited microprocessors with state machines. They are compact and very fast.
"Mistakes are prevented by Experience. Experience is gained by making mistakes."
|
|
|
|
|
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.
|
|
|
|
|
|
|
This is the kind of chaos to expect when only one person can (or wants to) do your job.
There are no solutions, only trade-offs. - Thomas Sowell
A day can really slip by when you're deliberately avoiding what you're supposed to do. - Calvin (Bill Watterson, Calvin & Hobbes)
|
|
|
|
|
|
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.
|
|
|
|
|
|
What do you call a boomerang that doesn't return?
A stick.
|
|
|
|
|
Lol,
Brought to mind the time when our family was on vacation. There was a soccer field near where we were staying and early in the morning there was no one around. Figured it was a safe place to let him try it out. Went onto the field. He was about 8 or 9 years old. He wound up and let it fly. It started to rise and began a rapid curve. After turning past 90 degrees it was obvious that it was catching the air just right. It continued to rise and curve until it was on a direct line back to him. His face went from glee to horror as the boomerang began a rapid decent. Like some crazed predator it came screaming back to earth. My son turned and started to run away. The boomerang swooped in and got him right in the back before he had taken more than 3 steps.
|
|
|
|
|
did he try again or drop it?
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.
|
|
|
|
|
We continued to throw the boomerang for another hour and could not get it to come back to us. Mostly it would turn to about a 90 degree angle and drop to the ground. Kind of gave up after that point and went back to kicking a soccer ball around the field.
|
|
|
|
|
Similar story. In my 8th grade shop class we did a fiberglass unit in which you could make a boomerang. After it was complete and graded I brought it home. Me and my 2 younger brothers went to a nearby field to test it out. My first throw it flew flat and level for about 40 or 50 yards when it suddenly bent up in the air circled about 90 degrees left and did a kamikaze run down at the 3 of us. It was like a drill Sargent yelled "INCOMING!". We leapt to the side and hit the dirt like it was a live grenade. It smacked into the ground about 10-15 feet from where we were.
Try as we might we never were able to replicate that first throw. One of my brothers did keep practicing over the summer and was improving quite a bit until he hit a telephone pole and cracked it up.
|
|
|
|
|
Wordle 1,182 3/6
🟨🟩⬜⬜⬜
⬜🟩🟨🟨⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,182 3/6*
⬜⬜🟨⬜⬜
🟨⬜⬜🟨⬜
🟩🟩🟩🟩🟩
Can't believe the luck on that 3rd attempt.
|
|
|
|