|
First Winkle Brown, now Chuck... strange how they lead a career in death seem to suround them and they get to their late 90's!
|
|
|
|
|
On a lark I decided to port LexContext: A Streamlined Cursor Over a Text Input[^] and part of my Json: A Fairly Powerful JSON Engine in a Small Package[^] projects to C++ to run on ESP32 devices (or any Arduino compliant device that can handle 64 bit ints I think)
Basically I didn't like the ArduinoJson package because it didn't look like it streamed very well, and that's what my library excelled at.
I love the way I wrote it. It ported seamlessly. In a few hours I have it running - not fully featured yet - but it's parsing through a 120kb JSON document 2kb at a time (max).
Sometimes I could go back in time and hug myself. And people said I reinvented the wheel! (see Newtonsoft JSON)
Edit: And it seems pretty fast!
typedef JsonReader<1024*2> JsonReader2k;
File file = SD.open("/data.json", FILE_READ);
if (!file) {
Serial.println(F("/data.json not found or could not be opened"));
while (true); }
JsonReader2k jsonReader;
jsonReader.begin(file);
while(jsonReader.read()) {
switch(jsonReader.nodeType()) {
case JsonReader2k::Value:
Serial.print("Value ");
Serial.println(jsonReader.rawValue());
break;
case JsonReader2k::Key:
Serial.print("Key ");
Serial.println(jsonReader.rawValue());
break;
case JsonReader2k::Object:
Serial.println("Object");
break;
case JsonReader2k::EndObject:
Serial.println("End Object");
break;
case JsonReader2k::Array:
Serial.println("Array");
break;
case JsonReader2k::EndArray:
Serial.println("End Array");
break;
case JsonReader2k::Error:
Serial.println("Error!");
break;
}
}
file.close();
Real programmers use butterflies
modified 7-Dec-20 20:28pm.
|
|
|
|
|
honey the codewitch wrote: And people said I reinvented the wheel!
The wheel is so 2nd millenium! Pah!
|
|
|
|
|
Alright, first of all, you definitely need a factory for this, and then an abstract factory for your factory.
Second, this just screams for a visitor! Too many switches cases.
Of course the handling of the various nodes is just asking for a strategy pattern, possibly combined with a template method.
As a default, it should implement a null pattern so you don't get NullReferenceExceptions.
Are you even using an interpreter for this code?
I hope you've at least broken it up in multiple packages, at least one for your interfaces and another one for your JSON implementation.
This code is heavily under-engineered and I doubt it could even be extended to handle XML or YAML.
So yeah, just my two cents
|
|
|
|
|
Well, there are a lot of switch cases in the code.
Real programmers use butterflies
|
|
|
|
|
Understandable, have a great day
|
|
|
|
|
You too. Every line in your comment had me counting increasing source files and code bloat.
Real programmers use butterflies
|
|
|
|
|
|
"Gosh" ? ? ? Really, "Gosh" ? ? ?
What do you think this is, 1950?
It's time you come to grips with and embrace the current present and far more permissive society.
I'm really darn sure of it.
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'm bringing it back. It's retro, Daddy-o.
Real programmers use butterflies
|
|
|
|
|
Twentythree-Skidoo.[^]
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 |
|
|
|
|
|
No not a political post.
Just wondering if anyone out there is working on system changes for BREXIT? Or are we still waiting to find out what the rules are?
|
|
|
|
|
The plan is out since 1975. The Brits want to blow the moon out of orbit and fly away with it.
Look here[^]
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
5teveH wrote: Just wondering if anyone out there is working on system changes for BREXIT? The company I work for will get affected for sure, but I don't think anything will change for my daily work.
From what I can observe...
some people would like to prepare but don't know how.
Others are just bluffing that there will still be a deal.
Others are just so clueless that will get overrolled...
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.
|
|
|
|
|
There seem to be very few Brexit-related projects, from what I've seen. I suspect the truth is that the changes affect far fewer businesses, and in a much less far-reaching way, than the MSM would have us believe. It's also true that getting hard facts is, as yet, not possible but I would have expected projects to be fully resourced and making preparations (1) for multiple outcomes, and (2) by preparing development / test environments and making sure that documentation and knowledge of potentially impacted systems are fully in place.
One rather important point that every commentator seems to have overlooked, is that 31st December is NOT a deadline for a deal. True, if there's no deal done by then we revert to WTO rules, but there's absolutely no reason a trade deal cannot be struck on the 2nd Jan, or in June, or 2021, making the situation from 1st Jan a temporary one, and one that (especially given the world's economic state right now) may make just "forgetting about" the European market for a few months actually quite attractive (for exporters, anyway).
|
|
|
|
|
I heard that we are going to revert to £.s.d for all financial transactions.
|
|
|
|
|
Guineas, with groats for servile classes.
"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!
|
|
|
|
|
Or sovereigns, or even Britannias! Carney was a demented carnival barker, and we managed to pass him on to you lot!
|
|
|
|
|
Richard MacCutchan wrote: I heard that we are going to revert to £.s.d for all financial transactions. That gets my vote. Maybe the 'youngsters of today' would then get a grip on mental arithmetic. If only we could devise some way of improving their grasp of grammar, spelling and punctuation, too!
|
|
|
|
|
Oh yes, a return to the good old days of non-political education!
|
|
|
|
|
It was always political, though more subtle. Historically, some of the principal advocates for mandatory, monopolized state education were open about its purpose being to turn out good little citizens and workers.
|
|
|
|
|
True, but that is somewhat different from the political ideologies that are taught these days.
|
|
|
|
|
ImgBurn[^] was mentioned in a recent thread, and I questioned that the last version was released in 2013. Especially given the churn of modern mainstream operating systems, a lapse of a few years between releases often indicates an unsupported application.
I've been burned a few times on commercial and shareware software, where the vendor stopped supporting the software after a period of time. In a few cases this caused me a fair amount of work to switch to different software, so I'm cautious on the subject.
Yeah, I'm highly skeptical of software that hasn't been updated in 7 years. In this case, it's not a huge deal -- if the software doesn't work, get another one for burning DVDs, but still?
It was pointed out that the forum for the software is active -- the original author replies regularly. So I read through the support and bug fix threads ... and quickly identified that replies are made, questions are answered, but nothing new happens -- not bug fixes nor enhancement requests. There is a lot of deflection.
Page 4 of the thread for the last release proved very entertaining. The author's reply made my morning!
ImgBurn v2.5.8.0 Released! - Announcements - ImgBurn Support Forum[^]
LIGHTNING UK!
Author of ImgBurn
Posted July 26
What bugs are you referring to?
I’m pretty sure I’d have fixed anything that was actually a bug at the time it was reported. Of course, me fixing them is very different to me fixing them AND releasing a version that includes those fixes.
The author claims to be implementing updates, but just hasn't managed to release a fix in 7 years.
Is this software supported or unsupported?
|
|
|
|
|
I think I'd class that as "fake supported"!
|
|
|
|
|
Be careful with ImgBurn.
It could install Adware ...
ImgBurn - Wikipedia[^]
modified 8-Dec-20 8:56am.
|
|
|
|