|
Q: How would the world look if Pi was 3?
A: Dunn⬡ but this sentence w⬡uld l⬡⬡k like this.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
|
Screw Pi,
Celebrate Tau! Join me on June 28th, in eating 2 pi instead of 1!
Read the Tau Manifesto!
|
|
|
|
|
The STL does this too but it's annoying. You wind up declaring C++ templates that package a bunch of template parameters together as a unit, and then pass that as an argument to another template, and so on.
rgb_pwm<
rgb_pwm_group< pwm_traits<32,0>, pwm_traits<25,1>, pwm_traits<26,2> >
> p;
If that isn't the ugliest elephanting thing outside of preprocessor macros, I'm not sure what is.
Sure you can use typedef/using, but then you just end up adding even more lines of code.
I don't know what I want though. I guess JSON wouldn't be much more brief. I do kinda wish C++ allowed you to explicitly pass your arguments by name like you can do in C#. That way this would be at least a little more legible, if verbose.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I bet I am missing the point but how about something like
std::map<unsigned int, unsigned int> pwmPins { {32, 0}, {25, 1}, {26, 2}, };
And of you have a bunch of these also create a type alias
using PinMap = std::map<unsigned int, unsigned int>
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Ummm, no. I'm not using a map and relegating all of my microsecond fast pin operation code to a hash table.
Compile time and runtime are not the same thing. Not even a little bit.
Edit: Sorry if I came across as hostile. I didn't mean to be. It's early and my conversation skills are a bit dodgy right now.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Makes perfect engineering sense, and I did not read it as unfriendly.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
How about this then? After the template is built the table definitions become neat.
constexpr-map/[^]
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
That *would* be nice, but I don't think it's available under the Arduino framework necessarily - on many platforms The STL is only partially implemented. I'd probably have to reimplement much of that instead of using the std:: namespace. Not out of the realm of possibility. I'll poke at it. Thanks!
To err is human. Fortune favors the monsters.
|
|
|
|
|
When I get fed up with all this magic stuff I ask myself: Alrite, how would I do it in plain old C ?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
You'd most likely have to use a ton of preprocessor macros.
To err is human. Fortune favors the monsters.
|
|
|
|
|
If you have to go more than three 'if' levels deep - that! Even two levels looks like something I never want to eat! I feel for the MS guys who keep up their #ifdefs in the Windows headers!
|
|
|
|
|
The problem in this case is you can have up to 5 RGB LEDs you can control, each requiring 3 pins. The above was just for one LED.
Variadic template arguments are how I accomplish that. It would be really messy to do that with the preprocessor. It's doable I think, but it requires a lot of nonsense.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I just have to shake my head at this one.
Outlook lets you define rules, but they only run against items that make it to your inbox. It doesn't run those rules against folders such as "Junk email".
In the web client - under Mail / Junk email / Filters, I have checked the checkbox labeled "Only trust email from addresses in my Safe senders and domains list and Safe mailing lists". That means unless something is already in my explicitly defined list, it'll end up in the junk mail folder. If I'm going to build such a list of safe senders, that means I have to check the junk mail folder on a regular basis and look for anything to add to it. Not very practical, although I do have a few items I've added so they're guaranteed to never end up in the junk folder.
It's not unusual for me to get dozens of spam items a day - for the most part, they seem to consistently originate from the same people, with the same sender names, but the email addresses are totally random. So even though Outlook lets you define rules based on addresses, I can't realistically do that. So it would make sense to define rules against sender names...but Outlook doesn't let you do that, for some reason.
If I uncheck the option to only allow items from my safe list to be sent to my inbox, that means everything ends up there. And while that means rules could be run against those...Windows pops up notifications for anything that makes it to the inbox (as opposed to keeping quiet for things that end up in the junk mail folder). So suddenly, unless I have a crap-ton of rules, I have a lot more notifications popping up all day long...
Bottom line - and my whole point - is that if only MS let you run rules against the junk mail folder, and not just the inbox, going through the junk mail folder wouldn't be such a tedious job, and the popups could still be kept to a minimum.
As an aside, I tried to use PowerShell to connect to my mailbox using MS's Graph API to automate things based on my own filters...and while it works great for a corporate account, none of it works for a personal Hotmail account (aka a "Microsoft account"). But that's a rant for another day.
[Edit]
I can work around the sender email vs sender name issue by specifying the sender name values if they appear under message headers. That works, but again, because everything is now going to my inbox...I still have a lot more notifications than ever, until that list gets built up.
|
|
|
|
|
try Thunderbird. Today I received 40 emails. Thunderbird correctly routed 36 to junk based my previous tagging as junk and what it has learned as junk.
|
|
|
|
|
That's kinda beyond the point.
I want to define rules once, at the source, not my individual clients. So it makes sense to do that when logging on the web site (outlook.com).
Once those are sorted, it no longer matters what client (if any) I use on any of my machines - they should sync my folders with whatever state the server is in.
I have tons of machines, both physical and virtual, and I may want to decide to access my mail from any one of them. I'm not going to install Thunderbird (or worse, the full Outlook client, which requires a license) everywhere I might decide I wanna access my email from.
|
|
|
|
|
|
|
You don't trust Mr. Google?
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
|
Me I trust Mr. Ed[^]
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Even the back end of Mr. Ed is more trustworthy than many things these days!
|
|
|
|
|
Mr. Ed's back end and Facebook look about the same to me.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
I disagree. Mr Ed's back end produces useful manure.
Keep Calm and Carry On
|
|
|
|
|
Agree and Facebook useless manure
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|