Just went through this on a new car buy from a Toyota dealer. The dealer had a charge on the invoice for a "security" system. Found out it was being installed when delivered at port due to vehicle thefts and their insurance requires it. They most certainly are NOT tracking you. We just told them to NOT install it as the one they use is a horrible system (i.e. cheap).
mdblack98
Posts
-
This morning on the east coast of the US, and it's a Microsoft rant... -
For want of a nailCompress the disk. Depending on the file types stored might create a lot of empty space.
-
What's y'all's favorite way of dealing with floating point precision?Maybe you want a currency library? You can control the rounding too with this. currency.js[^]
-
Sometimes It Pays To Cover All BasesI'm reminded of the work we did for SEPTA (South Eastern Pennsylvania Transit Authority). We did the computer aided dispatch system which had to communicate to the trains via packet radio. When they showed us the protocol they wanted to use I just about died. No error check, no ACK/NAK. Asked them how we were supposed to test the protocol they said they were going to use a VT100 terminal to type in the messages. I proposed a better protocol and told them we would design an emulator so we could emulate the entire train system. Then there was one big bugaboo....they had to be able to connect dispatch to all the train's audio systems for emergency announcements and such. I told them they needed a broadcast message and they said "no". I also explained to them that with the ACK/NAK protocol and single train connections it would take up to 30 minutes to get all the trains connected and another 30 minutes to disconnect them (all during which the live dispatch radio system is connected to train speakers). I put this in writing to them. They said "we aren't going to fix it". Around 3 years after we delivered the system they called us and blamed us for the 30 minute delay. I had to haul out the letters between us to show them we warned them.
-
A gentle puzzle I was just asked.Since this is a coding site here are the possibilities for a 32-bit int.
#include #include int main()
{
int pos = 1;
int neg = INT_MIN;
printf("pos=%d neg=%d\n", pos,neg);
printf("pos+neg=%d\n", pos+neg);
printf("pos-neg=%d\n", pos-neg);
printf("neg+pos=%d\n", neg+pos); // yes I know it's commutative but here for completeness
printf("neg-pos=%d\n", neg-pos);
return 0;
}pos=1 neg=-2147483648
pos+neg=-2147483647
pos-neg=-2147483647 // Hmmm...this seems wrong -- subtracting negative SHOULD add it.
neg+pos=-2147483647
neg-pos=2147483647 -
win11 dismay: can't have vertical taskbar?!See if this helps... How to move Taskbar to top or side on Windows 11 - Pureinfotech[^]
-
( C/C++ historical question) was there a point in time where adding a return at the end of a void function was required ?In the C89 standard draft (the actual standard you have to buy). Shows that return has never been required....minimalist approach... https://port70.net/~nsz/c/c89/c89-draft.html#3.2.2.2
3.6.6.4 The return statement
...
Reaching the } that terminates a function is equivalent to executing a return statement without an expression. -
Four foursI didn't program the entire solution...left that for others to do. One could make the necessary change to solve the X/Y problem of trying to get 5 5's or 3 5's or such an arbitrary combination. I was just demonstrating the "let's use 4's" to solve the values. That's why I said there needed to be more work to do the special cases of "only 4" or "only X" values. You eight need to increase or decrease the # of terms so is a bit more challenging.
-
Four foursIt works for four fours. But this is "Code Project" and writing a routine to do just that one example is no fun.
-
Four foursSince this is "codeproject" my train trip was short. Took about 15 minutes to get the 1st order solution in C. Yes...I know it's simplistic....but a good exercise nonetheless. Obviously could be improved for all the special cases....could obviously compute squares, square roots, factorials, etc and start from the largest of those to reduce the value. I'll leave that exercise for others. In this code just change the modulus value to whatever you want and you'll get all the 1st order solutions. #include int modulus = 5; void do4(int n) { int mod = n % modulus; int i, j; printf("%d=", n); for (i = modulus; i <= n; i += modulus) { if (i > modulus) { printf("+"); } printf("%d", modulus); } for (j = 0; j < mod; ++j) { if (i != modulus) { printf("+"); } printf("(%d/%d)", modulus, modulus); } printf("\n"); } void main(void) { int i; for (i = 1; i <= 100; ++i) { do4(i); } }
-
word wrappingLook at the CSS options which cover a lot https://tippingpoint.dev/pure-css-truncate-text Seem like simple wrap would be good for an ereader just splitting the word at the last char on the line...no ellipses or such needed.
-
25 years of programming reduced to a question.I was asked that question once....I told them "I've never done that particular function before so I would search for a solution before reinventing the wheel". I got the job.
-
To the guy asking if we'd using COVID-19 tracking apps...Yeah...I see holes.... Let's start with #1. The "only on your device" is something you won't know. They also said you can recreate your GUID so that means the police can recreate your GUID. Then...when you get diagnosed as a COVD carrier and you smoosh the button...who's to say your phone won't scream at every other phone in the office...or the 120 kids are in your class...? Let's shut down businesses!! When this "6 foot" rule is being incorrectly applied as a cure all. The 6 foot rule came from an study on airplanes of "how close is too close" and they found that less than 6 feet for more than 10 minutes was too close. They didn't come up with any graphs that showed that 7 feet for 12 minutes is safe. They are finally starting to figure out now that all you have to do is walk through an area where an infected person has breathed and you can get it. No sneezing or coughing needed. It sounds like COVD has a very high replication rate so even a small viral load can overwhelm your antibody production.
-
true-false or false-trueI would prefer something that rings true and has an explanation when it fails. Assert.IsTrue(TokenIsValid(token), "Invalid Token: "+ TokenCheck(token)); TokenCheck would say "Empty", "Wrong Length...must be 4 bytes" (or whatever), "Exceeds limits of 0-100"...etc.... Mike
-
Dumb Old Program QuestionFound this that may be fairly easy to figure out what it's trying to create. There are other solutions too for tracing file access. It's may be failing the file creation as it's using a on-existent path and hopefully this software sees the failure. https://www.visualclick.com/content/cptrax-for-windows-active-directory.htm Or process monitor should do it too http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx You can run it directly from the site if you want http://live.sysinternals.com/Procmon.exe Mike
-
Redundancy PeakingUmmm...if you dissassemble something isn't there a program to disassemble? Ergo a test program? I was simply providing an example that proves that this is not redundant code at all. The disassembly does confirm it though so thanks for that observation.
-
Redundancy PeakingAnd I ran this test once with "if mybool" and once with "if mybool = True". No difference in speed. 1st one showed 33 seconds, 2nd one showed 32 seconds.
Module Module1
Sub Main() Dim mytime As Date Dim mybool As Boolean Dim mydiff As TimeSpan Dim j As Double mytime = TimeOfDay() While mytime = TimeOfDay() End While mybool = True j = 0 For i = 1 To 100000 For j = 1 To 100000 If mybool = True Then j = j + 1 End If Next Next mydiff = TimeOfDay() - mytime Console.WriteLine(mydiff) Console.ReadKey() End Sub
End Module
-
Redundancy PeakingIt's not redundant at all...it's explicit. And there's also a difference between "= True" and not leaving it empty. Any non-zero value is "True" but "True" is not any non-zero value. There's no extra code generated as this is what is actually done when you leave off the "= True" part. Given there's no difference in the generated code I fail to see your problem. Personally, I prefer explicit coding as you're much less likely to make a mistake. How's this for redundant? if (a==1) { cout << "a=1" << endl; } Braces are completely redundant...but you'll never bite yourself by forgetting to put them in when you have to expand the clause in the future.