|
Test Data
For nuts
1
7
4
2
3
5
4
9
8
For bolts
6
4
9
7
8
1
2
3
4
Does it meet the specifications. No, but then real data almost never is as the user said it would be.
There are 2 matching 4s and one has an unmatched 5 the other an unmatched 6.
Good data in > good data out
Garbage in > report errors and depending on the situation quit or process what you can.
|
|
|
|
|
Yeah, I should review mine to see what happens with unmatched items, but I don't think it will cause trouble.
I know mine won't handle duplicates, but I could easily change it so that it does.
Still, not required by the spec.
|
|
|
|
|
Was Noel Coward terrified of Christmas?
"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!
|
|
|
|
|
More likely, Father Time was afraid of the near term.*
These seasonal offerings are a bit limiting.
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 |
|
|
|
|
|
Yes, he was Clausetrophobic.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Does he need to be admitted to a santarium for treatment?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
Nah, he just needs to elf isolate for 10 days.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
I've been trying to speed up my JSON processing and the bottleneck was my I/O class.
So I added a function to my I/O classes called skipToAny() which takes a string of characters and advances the input until it finds one of them.
Depending on the kind of source you use (like memory mapped file sources) it's *fast*
apparently strpbrk() is optimized for SSE and AVX instructions w/ some stdlib implementations.
So using the builtin C function to scan over my memory mapped buffer increases my performance by a factor of almost 4. I'm in spitting distance of 600MB/s now.
And I didn't even need to bit twiddle.
Higher level optimizations > bit twiddling
Real programmers use butterflies
|
|
|
|
|
This is a very specific topic but oddly I received an email from a colleague today about a library called simdjson which gives a significant performance improvement over other c++ json libraries.
simdjson claim 'Standalone UTF8 Validation' at 13/GB/s
|
|
|
|
|
simdjson is cool, but it doesn't run everywhere. My JSON thing will even run on arduinos
Real programmers use butterflies
|
|
|
|
|
What are you doing on an Arduino that needs to process large Json files so quickly?
Or is this just a case of seeing how many people can fit in a phone booth?
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
It's not fast on an 8 bit Arduino, it's just that it scales to workstations and servers.
The advantage of it over ArduinoJSON is the same library also blazes on traditional computers, and it actually uses far less RAM than ArduinoJSON, which cannot process large online dumps from say, a mongoDB backed repository, like the one tbdb.com runs.
ETA: Originally I wrote it to try out a novel way of parsing and running queries, but it turns out simdjson just recently invented something similar. =)
Real programmers use butterflies
|
|
|
|
|
I want to build something, basically an analog clock where, when power is interrupted, the clock stops. But then, when power is restored, the clock zips around to the correct time.
Back in my SATCOM days, the az/el motors would follow the back-in-the-controlroom position controls, but wouldn't move if no power was applied to them. Then slew around to the correct position when the power was turned on.
So, basically, like that, in principle.
I have no idea what I'd need to get this to work these days. A digitally-controlled analog clock is probably the simplest...if I can figure out how to do it.
Suggestions?
|
|
|
|
|
|
Thanks. I was thinking that. Way simpler than a synchro.
|
|
|
|
|
So if you have a digital battery backed 'clock' keeping time, you could feed out to a couple of octal counters for the hour, six decades counters for the minutes. The time is read from from the counters and translated to a signal for the clock motor, if the power is lost the clock face just stops. Once the power is back up the signal will be a series of steps on from when power was lost the counters 'jump' to the correct time, the hands are not so will spin as fast as they can to show the right time. I think the issue will be getting the correct ammount and style of counters. This is sort of silly thing I enjoy give me chance I'll have a think.
|
|
|
|
|
That sounds simplest, so far.
|
|
|
|
|
It is my task in life to find the simple way to do things! Engineers are essance lazy, they find generally find a simple cheap way of doing things, managment complicate
|
|
|
|
|
If you plan the clock for the Central European market, you are within the coverage of DCF77[^] - it reaches half way up Norway.
The DFC77 signals, at 77.5 kHz (really longwave!) are so primitive, both at the physical modulation level and the data format, that I often refer to them as 'Morse code Mark II'. The frequency is so low that you could probably sample the signal from the antenna directly (after a simple tuning circuit) using any standard microprocessor that can take an analog input.
(My PC sound card is capable of producing 192 kHz sample rate sound, sufficient for generating the right on-the-air waveforms. I have jokingly suggested that once I get myself a new stereo amp capable of handling analog 192 kHz, I will plug an antenna into the speaker connectors and have my PC generate DCF77 signals to adjust all the DCF77 clocks in my neighborhood by an hour or two .)
The DCF77 data gives you exact time and date directly in binary format. The simpler way to do it is to feed these digital values directly to a numeric LED display. If you very much want an analog clock, you would use a stepper motor (moving arms 6 degrees/pulse) that at reset moves the arms to 00:00:00, and then moves each arm as many steps as the digital time value indicates. After a power down, you would have to do a reset (which may cause each arm to move all the way around - in theory almost twice: One to go from 1 to 00, and then from 00 to 59, if the arms were at 01:01:01 and the correct time is 11:59:59), but you need not worry about anything else to keep it in sync.
If you have battery backup for the stepper motors and the (very simple) electronics - it is as if the smallest Arduino is overkill - the clock doesn't have to stop, unless you want it to. One of my DCF77 clocks says in the documentation that to save battery power, it turns on the receiver once an hour checking for drifts of the internal oscillator, possibly holding back one pulse or giving one extra to the seconds arm, but even the cheapest oscillators nowadays are so stable that hourly check is probably overkill. You can just turn off the receiver completely if external power goes out.
I haven't been using a soldering iron for years, so I never build a DCF77 clock like this (but I have come as far as to buy the stepper motors for it ) - I guess you know how to handle the electronics much better than I can. Now that you post at CP, I take it that you also handle the software part well .
ps. If you do this, write a CP article about it!
|
|
|
|
|
Never even considered that. Even though I'm old and am used to things like LORAN-C (we used it just for the pulses, not positioning).
|
|
|
|
|
You might be able to use an Arduino or better yet, an ESP32 to control the steppers on the thing
An IoT Smart Clock Using an ESP32 Development Board[^]
IoT Smart Clock using the Mega 2560+WiFi R3[^]
These clocks use WiFi and NTP rather than a radio based sync mechanism so they don't support time zones but could be made to be configurable or modified to use the radio system.
Anyway, some of the principles therein might be useful. Get an ESP32 as they are cheaper and more capable than arduinos + smaller. I included both for the sake of completeness although the arduino one uses an ESP8266 as it's primary worker CPU, not the ATmega2560
Real programmers use butterflies
|
|
|
|
|
Thank you. More things to read about.
|
|
|
|
|
[^]555 is also 'yer friend ...
|
|
|
|
|
Going from simple to complex:
Asynchronous motors with a good reduction and an external encoder can work.
Steppers will do it if you don't need much torque and you don't need them to rotate fast (they can loose position feedback if they turn too fast) (you would need an external encoder to prevent that).
Servomotors will give you a bigger range of speeds and torque while not suffering from the loss of precision at fast speeds.
|
|
|
|
|