|
I've installed this, and it seems to be the "Preview" version. What's that all about?
|
|
|
|
|
Anything useful is either in preview or discontinued. Just kidding!
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
is gmail still in beta ?
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Don't know, but many (most?) gov.uk forms - that we HAVE to use for tax, pensions, cars etc - are marked as "BETA". There's no option to go back to the previous "version"...
|
|
|
|
|
I always found it amusing that the internet is built on documents that are named "Request For Comments" which stands for RFC.
Historically those documents were specifically that - a 'request' for others to 'comment' on.
But somehow at some point those became the form of the actual formal specification.
|
|
|
|
|
Indeed... When people refer to Internet "standards", I sometimes remind them that they're really just "suggestions" 😂
|
|
|
|
|
Like the specifications published by ITU, the International Telecommunications Union - they are just 'recommendations'.
(For those who do not know: ITU recommendations are those with a single letter, a dot and a decimal number, such as X.25, X.509, G.728, Q.700 ...)
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
I've using the little tool "Default Programs Editor", and although sometimes it's a bit strange, it works. However, whenever Window$, VideoLan, or InfraView does an update, a whole bunch of icons get redone to the stupid traffic cone or cat icons of those latter 2 apps , thus causing me to have to go through the tedious process to put in my own prefered icons for image, sound & video files.
I've had enough of this, and I can't take it anymore!
I want a tool that lets me keep some type of batch file such that when these icon extinction events happen, I can just run the tool with the existing batch file, and be done with it.
Any ideas?
|
|
|
|
|
Part of the problem might be that you are using icons from a DLL/EXE that is updated.
Create a private stash (way out of the system path!) of the DLL/EXE and reference that copy for your icons.
|
|
|
|
|
I do have a private stash where I keep the icon files - they don't get deleted, but they stop working in Explorer.
|
|
|
|
|
When you install apps, always pick the Custom option, and uncheck the checkboxes that allow it to take over. Otherwise they'll happily replace file associations with types they can handle, and there go your preferred icons.
But to be more pragmatic:
All file association details are stored in the registry (I can't be bothered to look them up right now, but they're easy enough to find). It's a huge list, so export (only) the subset of associations you care about to .reg files; you can re-combine them all into a single file once you think you've covered everything that matters. The .reg file format is easy enough to manipulate manually with Notepad.
When an app replaces your existing customizations, just double-click on the .reg file to re-import what you had before, thus undoing (only) the file associations the installer clobbered. Rather low-risk IMO, and very effective.
|
|
|
|
|
Update: Someone on reddit helped me with this, and the solution is simple and elegant. I'm low key ashamed I didn't think of it.
Update 2: It doesn't work with the GCC version I use on some of my platforms. =( Oh well, stupid code FTW
I run into that with C++ sometimes.
all i wanted to do was extend
rgb_pixel<24> foo;
foo.channel<channel_name::R>(63);
so you could set multiple channels at once.
rgb_pixel<24> foo;
foo.channel<channel_name::R,channel_name::G,channel_name::B>(63,31,47);
You'd think you could do with a parameter pack (template<typename... ChannelNames> but no, because I'm already using a parameter pack and you can't take two to a template.
Anyway, I dug and dug and dug even through some esoteric techniques to stash parameter packs in tuples[^] which I still don't understand
Finally I gave in. You know what I did?
template<typename Name>
constexpr inline void channel(typename channel_by_index<channel_index_by_name<Name>::value>::int_type value) {
constexpr const int index = channel_index_by_name<Name>::value;
channel<index>(value);
}
template<typename Name1, typename Name2>
constexpr inline void channel(typename channel_by_index<channel_index_by_name<Name1>::value>::int_type value1,
typename channel_by_index<channel_index_by_name<Name2>::value>::int_type value2) {
constexpr const int index1 = channel_index_by_name<Name1>::value;
channel<index1>(value1);
constexpr const int index2 = channel_index_by_name<Name2>::value;
channel<index2>(value2);
}
template<typename Name1, typename Name2, typename Name3>
constexpr inline void channel(typename channel_by_index<channel_index_by_name<Name1>::value>::int_type value1,
typename channel_by_index<channel_index_by_name<Name2>::value>::int_type value2,
typename channel_by_index<channel_index_by_name<Name3>::value>::int_type value3) {
constexpr const int index1 = channel_index_by_name<Name1>::value;
channel<index1>(value1);
constexpr const int index2 = channel_index_by_name<Name2>::value;
channel<index2>(value2);
constexpr const int index3 = channel_index_by_name<Name3>::value;
channel<index3>(value3);
}
5 times (last two omitted)
C++ is better than this. I'm not. This is after posting in r/cpp_questions and posting a question here and getting nowhere.
I feel bad about this code. It's terrible. And I'm stuck with it until I get better at C++
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 27-Jun-24 10:38am.
|
|
|
|
|
|
Yes, this is part & parcel of programming. Back when I was slinging code, I used to read books from Scott Meyer ("Effective C++") et al to bring my level of coding practice to that of a fine craftsman.
Did that craftsmanship keep me employable? NO
Do employers give a rat's a33 about such craftsmanship? H3LL NO
Indeed, the reason that Java has become the default application development is because all its belts & suspenders make it so that the product that poor coders put out will not (usually) cause crashes and other failures, since the compiler ensures that everything is neatly belted up. I'd like to say something similar about JavaScript, but that monster makes Java look professorial.
|
|
|
|
|
It looks like you created a template tuple. That proves you do understand tuples!
(I am mostly lost)😊
|
|
|
|
|
My first impression was "tuple? I don't think you read my code right"
And then I realized, you're just looking at my pixel<> template as if it were a tuple, and that makes sense because you can access the channels off of it as though they were tuple fields.
I never looked at it that way, but you're absolutely right.
Maybe you understand more of it than you think?
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I was referring to this clause.
template<typename Name1, typename Name2, typename Name3>
I have only ever used tuples in Python:
(anyValue1, anyValue2,…)
slap some items together so you can track them with a single reference. Great for returning multiple pieces of information from a function.
|
|
|
|
|
Ah, those are simply template arguments in C++.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Hi, you wrote that you are already using a parameter pack in the function rgbpixel::channel. Where would that be? Please post the signature(s) of rgbpixel::channel. Is your code somewhere so I could have a look?
Josef Schroettle
|
|
|
|
|
Sure
gfx/include/gfx_pixel.hpp at master · codewitch-honey-crisis/gfx · GitHub[^]
Pixel is at line 504
template<typename... ChannelTraits>
struct pixel {
...
This parameter pack is effectively passed through to each of the metadata query templates, as well as any function that access pixel data, like the implementation of channel<>()
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
DRY is soooooo overrated.
|
|
|
|
|
It is not often, but there are times in C++ when there is no alternative but to duplicate code. That is when macros come to the rescue. Due to the need for exactly the same code in several related methods, I will sometimes group those together, add a macro #define _someName with the code, expand the macro in each method, and add #undef _someName at the end of the group of methods. Sometimes there just aren't any alternatives.
In one case, I had an abstract base class that was essentially inherited in a diamond pattern to get the clean user interface that I wanted. But, even though there was no data in the abstract base class, a subclass either had to have two instances thus pointlessly increasing the size of the overall objects, or it had to be virtual, increasing both size and decreasing performance. There was no need for any of that because it was only providing an interface, with a default implementation of methods that only relied on other methods that were virtual. I wound up with two parallel lines of inheritance, with many methods duplicated between the lines. Invisible to client code (not the library code though), but there were no restrictions on size or performance. Yes, the virtual methods do require data -- but in the vtable, not in the code. And it is possible for the vtable to be optimized with global optimization (which is already being done at link time) so that multiple vtables are not required.
Recently, I created an experimental class, which required macros of templates because a template cannot contain a name used in code. A bit strange, but it worked and the user interface was reasonable. That, fortunately, never made it into my library since I had better options.
Even in C++ macros are very useful. They really, really need to be made more general with looping, variables, etc. There are places that I could use all of those features. Just like in older assembly languages. And why do macros have "elif", but neither C nor C++ do? Guess what? I use a global macro #define "elif else if". I also define "block", "loop", "when", "unless", "until", etc. I could do more with better macro features.
There seems to be a belief that if a language is good enough, that macros are simply obsolete and should be eliminated. That is false. There is no such thing as a language that is good enough. And never will be. C++ certainly isn't. I will always want more in a language (which is why I use C++, even though it is very limited) and I don't have an extra decade or two to design and build a better one. They keep adding things to C++, but the vast majority of them are never needed or should be better designed. Why are two iterators needed in loops? Mine don't require that. Do not design by committee! I have written code to support lambdas, but never actually needed them in practice. Perhaps one day. They are at least potentially useful. I have written many multithreaded programs, including the synchronization primitives themselves. But, I have never needed coroutines. I use templates, and some meta-template programming, but I have never needed templates as a Turing complete language. That is just nasty. In particular, the use of template meta programming to check std::print at compile time is an abomination. Get a single character wrong and you have several pages of useless error messages. That is a job for the compiler not template meta programming. And there is a lot of that in the standard library.
|
|
|
|
|
See, like Rust is great and all and cpp is a little dangerous, but you don't get that smart^^ working only with hand holding-y languages.
No pain no gain?
C# doesn't really have macros the same, but it's the same kinda deal. There's a bunch of information in your post that represents learning like branches on a tree (which has weird branches that grow into one another).
Starting with this stuff a long time ago when it was harder, you simply had to learn a bunch of things you just don't anymore. Many of those things have tendrils. Sum > whole of the parts...
|
|
|
|
|
Yes
|
|
|
|
|
Are you going to post the reddit solution?
|
|
|
|
|