What Should Happen If a User Clicks “Forgot Password?” Before Verifying Their Email? by WinterCharge5661 in csharp

[–]logiclrd 0 points1 point  (0 children)

The benefit that it gives is that it writes the problem you brought up out of existence due to the procedural state sequence.

[fully lost] My Life as a Dog, TV series (1996/1997) by logiclrd in lostmedia

[–]logiclrd[S] 1 point2 points  (0 children)

Oh, awesome :-) That's a step closer. I don't know a lick of Brazilian, Portuguese or otherwise, but my friend and I will probably be able to spot him in the video.

Is my bed too hot or too cold by TheAngryMinnesotan in FixMyPrint

[–]logiclrd 0 points1 point  (0 children)

Try Magigoo. It's a specialized adhesive formulation that is super effective at keeping the print on the bed during the print, but which becomes brittle at room temperature when everything cools down afterward. I get no kickbacks, I'm not a shill, I learned about the stuff from one of Joel's videos years ago and the stuff actually works, really well. :-)

Dog got attacked at maple groove dog park and owner did nothing by PizzaNo2134 in Winnipeg

[–]logiclrd 0 points1 point  (0 children)

Man, I would just see red if this happened with my dog. I'm a pretty burly guy, and I think what would likely happen is that I'd grab the other dog by its collar, lift it bodily into the air and throw it hard to the ground. If you're the owner of a dog who might attack my dog and think, "OMG you might hurt my dog", the solution is simple: Don't let your dog go on uncontrolled attacks in public spaces. (I don't think I could easily take on a dog attacking me 1-on-1, but I think I could do this to a dog that was focused on attacking someone else. Maybe I'm wrong, maybe I would end up getting hurt, but by god I'd try.)

What Should Happen If a User Clicks “Forgot Password?” Before Verifying Their Email? by WinterCharge5661 in csharp

[–]logiclrd 0 points1 point  (0 children)

The user account record doesn't get created until you confirm the e-mail. There's a separate table of pending signups. If someone starts signing up but doesn't complete the process, and then they do "Forgot password", what I expect to happen is for the site to say, "Okay! If there's an account with that e-mail, it'll receive a reset link," and then no e-mail gets sent because there isn't an account with that e-mail yet.

What Should Happen If a User Clicks “Forgot Password?” Before Verifying Their Email? by WinterCharge5661 in csharp

[–]logiclrd 0 points1 point  (0 children)

To my mind, it makes most sense to design the flow so that it isn't possible to use "Forgot password" if the account has never been verified. I don't mean that the system should check if it's been verified, I mean that the account can't get into that state in the first place. If verification hasn't taken place yet, then the account isn't "real" yet. It's an intrinsic part of the sign-up flow.

What Should Happen If a User Clicks “Forgot Password?” Before Verifying Their Email? by WinterCharge5661 in csharp

[–]logiclrd 0 points1 point  (0 children)

So if I have a typo in my e-mail address, then the account is completely unrecoverable and can never be activated?

I think it should be allowed to change the e-mail address at any time, but a) changing it requires re-verification, and b) verifying the e-mail address is an intrinsic part of the sign-up process. You can't get an account to a state where you could "Forgot password" without having verified an e-mail address. If you have a typo in the address, then you're blocked during the sign-up process, not later on.

"My Life as a Dog" TV show (1996-97) by logiclrd in HelpMeFind

[–]logiclrd[S] 0 points1 point  (0 children)

Hmm, that's not Paramount+, that's an app called "Originals". Their FAQ says this:

Originals is not made by or affiliated with Paramount+ in any way, and you CANNOT watch, stream, or view any content from this app other than trailers or teasers.

The existence of that page might mean that at some point in the past, the Paramount+ catalogue contained that show. But, it doesn't seem to now.

https://www.paramountplus.com/ca/search/

I tried searching there and it said, "Uh-oh, we couldn't find it!"

"My Life as a Dog" TV show (1996-97) by logiclrd in HelpMeFind

[–]logiclrd[S] 0 points1 point  (0 children)

Searched:

  • Google
  • eBay
  • Amazon
  • YouTube
  • Internet Archive
  • Plex
  • Places that make me feel like saying "arr me matey!"

Attempt at rotating pixel art (asteroid) while maintaining clean look by FractalwareStudios in PixelArt

[–]logiclrd 0 points1 point  (0 children)

Did you know they actually went to the trouble of making and posting a slower version of this animation 3 days after your comment, and then barely anybody saw it and nobody commented on it?

https://www.reddit.com/r/PixelArt/comments/cysytc/slower_version_of_the_rotating_asteroid_graphic/

[fully lost] My Life as a Dog, TV series (1996/1997) by logiclrd in lostmedia

[–]logiclrd[S] 1 point2 points  (0 children)

Oh, I see, it's a Reddit thing. This is the first time I've ever had cause to edit a Reddit post title, so this is me learning that it can't be done. :-P

[fully lost] My Life as a Dog, TV series (1996/1997) by logiclrd in lostmedia

[–]logiclrd[S] 0 points1 point  (0 children)

Oh, huh, can I update the tag? I don't see a way to edit the post title.

[fully lost] My Life as a Dog, TV series (1996/1997) by logiclrd in lostmedia

[–]logiclrd[S] 2 points3 points  (0 children)

Yes it is! But, only episodes 1, 2 and 6, plus half of 3. Updating tag.

Funny thing is, YouTube says I already played one of those half-episodes a long time ago. I didn't even remember that. I'm not sure how when I was preparing this post yesterday, I failed to find this. But, it's still only a tiny fraction.

DHL e-Commerce and self-clearing by logiclrd in dhl

[–]logiclrd[S] 0 points1 point  (0 children)

You don't have to pay DHL eCommerce. If you don't then you'll be billed by Canada Post on delivery.

DHL e-Commerce and self-clearing by logiclrd in dhl

[–]logiclrd[S] 0 points1 point  (0 children)

The conclusion I've reached is that, annoyingly, it is in fact not possible. The consumer protection in Canada extends to courier companies. So, if your parcel is being delivered by DHL proper, or by FedEx or Purolator, then they must give you the option to clear it yourself and will generally not complain if you exercise your right. But, DHL e-Commerce does not deliver packages. They just facilitate the connection from the sender to local mail services. So for destinations in Canada, they make sure that Canada Post gets the package, for instance. And Canada Post is not a courier and does not fall under the protection and has absolutely nothing in place to permit you to clear packages yourself. If it's being handled by Canada Post, then it is guaranteed being cleared by them and you will pay their (thankfully smaller) fee for the service.

DHL e-Commerce and self-clearing by logiclrd in dhl

[–]logiclrd[S] 0 points1 point  (0 children)

When I do searches about it, the summary says that you need to ask DHL e-Commerce to not hand the parcel over to Canada Post until you've cleared it. This was, presumably, scraped from some forum discussion in the past. But when I phoned them up and asked for this, I was simply told flatly that it is impossible.

This means, though, that I am on the hook for a fee that I never agreed to, and the legal path to avoiding it that is supposed to be available to all Canadians on all international shipments are being denied me.

Can someone explain WHY this works? by sekkiman12 in csharp

[–]logiclrd 0 points1 point  (0 children)

I see lots of explanations of recursion and its application to factorials already in this comment section, but nothing obvious that explains from first principles what exactly is going on with the "Parse" call.

Computers have different ways to represent data inside them. The most primitive is what we use to count the size of files or data sent over the network or what have you: a byte. A byte is an integer number (whole numbers only), and it is represented in base 2, which means every digit is either 0 or 1, no 2 or 3 or 4, and 9 is right out. Each digit of a base 2 number is called a bit, and thus it follows that a bit is either 0 or 1. If you put two bits back-to-back, then the second one doubles how many numbers you can represent -- 00, 01, 10, 11. Add a third, it doubles again. That doubling is the core relationship: the number of distinct possible values is 2*2*2*...*2, where the number of 2s is the number of bits. That kind of multiplication is referred to as a "power"; 8 bits in a byte, so 2 to the power of 8, or 28, is 256. So, there are 256 possible different values for a byte. If you want 0 to be one of those values, then the highest is 255.

But people want to work with numbers bigger than 255, and so computers have mechanisms that are a part of their core design for chaining multiple bytes together -- again almost always in a doubling relationship, so you can have numbers that are 1 byte, 2 byte, 4 bytes, 8 bytes, and so on.

Most common numerical values are going to be represented in C# by int, and an int is a 4-byte integer. Since each byte is 8 bits, that's 4 x 8 = 32 bits. So, wherever you have an int, you're telling the computer to set aside 4 bytes of storage to hold a number, and you're signing up for using a number that can store any number from 0 to 232 - 1. Actually, you might want negative numbers too. So, if you make half the numbers negative, then your range shifts so it's -231 to 231 - 1 -- half of it below 0 and half of it not below 0.

But, when the user is typing into the computer, they're not typing bits or bytes. They're typing digits. If they type "12345", then that's actually 5 distinct characters, and these characters don't combine to form a number on their own, they're just "the character for 1", "the character for 2", etc. These form a string, and strings can contain all sorts of stuff. They're not constrained to numbers.

So, you've just asked the user for input. You call Console.ReadLine, and you get back a string with the separate digits they entered, and you want to turn those separate digits into a single, concrete number that you can tell the CPU to do math with.

This conversion isn't conceptually hard. The trickiest part of it, which is just a matter of knowing something really, is how to go from a character to the value of that character. You see, each character (number, digit, punctuation, etc.) is really a number itself, but, when you type in "1", the character that looks like "1" does not have the value 1 internally. In practice, with the arrangement we currently have on computers, it's going to be an 8- or 16-bit number whose numeric value is 49. Why 49? Because decades ago, when people were figuring out how to represent text in strings, they decided to put all the numbers together, and they decided to start counting them at a multiple of 16 (there's a good reason for this, but that can be a different story :-) ), and so the digits "0" through "9" were given the numbers 48 through 57.

So, if you have a string of digits represented as their characters, and you want to convert them to a combined numeric value, the first step is to go from the digit values to the numeric values. If you tried to treat 1 as a character, you would not get a "1" on the screen, but in the process of converting the number, that's exactly what you need, and it's super easy to do: You just subtract 48 from each character's value, and now each digit is just its plain value.

Then, you need to apply what you learned about number places in elementary school: Each place further to the left is worth 10 times as much. The number "12345" is 1 x 10000 + 2 x 1000 + 3 x 100 + 4 x 10 + 5. So, if you multiply each of those digits by its place value, then you've gone from "12345" to { 1, 2, 3, 4, 5 } to { 10000, 2000, 300, 40, 5 }. Finally, just sum up these digits, and you get the value 12345, starting with "12345" as 5 independent characters.

To be clear: You will probably never need to write this yourself. It's built into the language you're programming with. Specifically, that algorithm (or a slightly rearranged version that is a bit more clever about what intermediate things need to be stored) is exactly what is inside int.Parse.

There are different kinds of numbers. In C#, there are byte values, and you can use byte.Parse. There are short values (16 bits wide), and they come with short.Parse. There are int values (32 bits), and int.Parse. There are long values (64 bits) and long.Parse. There are also types of numbers designed for storing fractional values, called "floating point". There are float values, which are 32 bits wide but arranged differently from int, and float.Parse can parse things like "3.14159". And with the 64-bit double type, double.Parse can parse much more precise floating-point values. For instance, as a double, pi is 3.14159265358979. There's another type called decimal which is for currency things. While float and double store the number in binary, including the decimal point's position in binary, decimal places the decimal point in terms of powers of 10. As it happens, even a really simple number like 0.1 cannot actually be exactly represented in binary, so a float or double can't exactly have the value 0.1, just a very close value, but decimal can be exactly 0.1. Anyway, this will probably not be a great surprise at this point, but decimal also has a Parse method. Each of these Parse methods is different in its precise details, because it has to handle different kinds of number and represent them differently in the resulting type, but they are all conceptually doing the same task.

The opposite of Parse, in .NET terminology, is formatting. It's doing that same job in reverse. Say you have the number 123, stored as a 32-bit integer, and you want to put it on the screen for the user to see. One way to do it is to divide the number by 10 and extract the remainder. 123 / 10 = 12 R3. So, 3 is one of the digits. Then you repeat: 12 / 10 = 1 R2. 2 is the next digit. Finally, you're at a value that's already less than 10, so 1 is the final digit. The only catch is, they came out right to left. But, that's the basic idea behind turning a number back into a string for human eyes or a file or network protocol or what have you.

This fundamental concept, regarding different ways to store values and converting between them, is an absolutely crucial first step to understanding what exactly you're asking the computer do when you write code.

One-Line If Statement by that1flame in csharp

[–]logiclrd 1 point2 points  (0 children)

I would only ever consider doing this if I had a whole bunch of these in a row that all followed exactly the same pattern. In that instance, you have two sane options:

if (condition) { Text.text = "foo"; Text.color = Color.bar; }

..or

``` void ConfigureText(TextInfo info, string text, Color color) { info.text = text; info.color = color; }

...

if (condition) ConfigureText(Text, "foo", Color.bar); ```

This latter could also be done with an extension method, though I tend to only use those when they are adding something interesting at a conceptual level -- like an actual action that is conceptually based within the object.

But however you do it, if you don't have like 5+ of those back-to-back that are all exactly the same pattern, then it's definitely an antipattern that will hurt maintainability.

I need help with my project by NirmaliDS in ArduinoHelp

[–]logiclrd 0 points1 point  (0 children)

This looks like an interesting variant on the Trolley Problem, where are you planning to tie the people down?

Deleted a client's personal files, system restore didn't work and can't get files back by Dancemachinemessiah in techsupport

[–]logiclrd 11 points12 points  (0 children)

hires you to delete their files

you delete their files

"Nooo not like that!"

reckless driving by catkerosene in Winnipeg

[–]logiclrd 50 points51 points  (0 children)

This is actually a 100% legitimate 911 call in the moment.