Am I a bad person for doing this?
-
Just because Microsoft say you shouldn't do something doesn't necessarily mean they are right.
Forgive your enemies - it messes with their heads
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
dawmail333 wrote:
I couldn't be bothered working out how to store a float in the registry
Not too difficult if you use an appropriate type[^]. Hmm, I just answered a programming question in the lounge! :omg:
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
I'm writing myself a small C++ utility. Now, I've justified this by telling myself it's a small utility, but the thing is, I probably will make this available to the internet, particularly to a small niche... Anyway, I've been bumping my head into walls with C++, particularly pointers, and type malleability, but I finally got my program running the way I wanted. Then I updated it, so the end user could configure a float the program uses extensively. I was going to throw it into an ini, but I noticed MSDN said that the registry should be used. So off I went and used that. Except I couldn't be bothered working out how to store a float in the registry, so I just stored a numerator and denominator, and divide them once they're loaded into the app. Aside from the fact I just remembered that I'd better 0-proof it, does this make me a bad person at all? Is that TOO hacky? :-O
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
Programming questions in the appropriate forum, if you please. :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
-
Just because Microsoft say you shouldn't do something doesn't necessarily mean they are right.
Forgive your enemies - it messes with their heads
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
goto
FTW!!! -
dawmail333 wrote:
I couldn't be bothered working out how to store a float in the registry
Not too difficult if you use an appropriate type[^]. Hmm, I just answered a programming question in the lounge! :omg:
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
-
Whenever I write a 'small C++ utility', I don't use the registry: I either use a .config file, or a custom "document" (an XML file with a custom extension, saved in the user's 'Documents' folder). This is because your user may not have permissions to write to the registry, a By the way, whenever you are saving a double to an INI file, a CONFIG file, or any other XML file you are serializing it as a string, so saving a string to the registry is not necessarily a bad idea. Hope this helps,
Pablo. "Accident: An inevitable occurrence due to the action of immutable natural laws." (Ambrose Bierce, circa 1899).
Good point! It's just that I personally use this utility by dumping it in my 'startup' folder, so putting a config file in the same folder would try and launch it on every startup. Also, each user might want their own volume step settings, so that's the other consideration I prepared for.
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
-
Just because Microsoft say you shouldn't do something doesn't necessarily mean they are right.
Forgive your enemies - it messes with their heads
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
This IS the company that defined ERROR_SUCCESS I suppose. Nah, I find the registry is an appropriate fit in this situation, it wasn't just blind acceptance.
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
-
Programming questions in the appropriate forum, if you please. :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Aha! I wasn't actually asking a programming question in that I wanted help or advice on it. I just wanted to know if people though my solution to something was TOO hacky. The fact I managed to trick someone into answering an unasked programming question is just a cool bonus. :laugh: If you REALLY still think this should be shifted, then ok.
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
-
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
dawmail333 wrote:
Don't forget to rate my post if it helped!
OK, I gave it a 1 as it's really a programming question!
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Just because Microsoft say you shouldn't do something doesn't necessarily mean they are right.
Forgive your enemies - it messes with their heads
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
20!
-
I'm writing myself a small C++ utility. Now, I've justified this by telling myself it's a small utility, but the thing is, I probably will make this available to the internet, particularly to a small niche... Anyway, I've been bumping my head into walls with C++, particularly pointers, and type malleability, but I finally got my program running the way I wanted. Then I updated it, so the end user could configure a float the program uses extensively. I was going to throw it into an ini, but I noticed MSDN said that the registry should be used. So off I went and used that. Except I couldn't be bothered working out how to store a float in the registry, so I just stored a numerator and denominator, and divide them once they're loaded into the app. Aside from the fact I just remembered that I'd better 0-proof it, does this make me a bad person at all? Is that TOO hacky? :-O
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
dawmail333 wrote:
MSDN said that the registry should be used
Never use the registry. And don't do what Microsoft says.
dawmail333 wrote:
Is that TOO hacky?
Yes.
-
dawmail333 wrote:
MSDN said that the registry should be used
Never use the registry. And don't do what Microsoft says.
dawmail333 wrote:
Is that TOO hacky?
Yes.
I didn't blindly follow MS, it actually seemed to be a good fit for the project. :-\
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."
-
dawmail333 wrote:
Don't forget to rate my post if it helped!
OK, I gave it a 1 as it's really a programming question!
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
Thank you for your most helpful, thoughtful and useful reply. :)
Don't forget to rate my post if it helped! ;) "He has no enemies, but is intensely disliked by his friends." "His mother should have thrown him away, and kept the stork." "There's nothing wrong with you that reincarnation won't cure." "He loves nature, in spite of what it did to him."