|
Bobby Deluxe posted:Bolded to see if I understand the important part right, but it just feels to me like if you have a program that guesses between 1 and 1000, and you set the maximum to 1000, that should include it guessing 1000. Yeah fair enough "between" might not be the best word here, though if you'd look at the documentation it would be more like "from 0 to n-1 inclusive".
|
# ? Sep 20, 2021 15:06 |
|
|
# ? May 23, 2024 04:51 |
|
arrays starting with 0 in VBA bothers me and i always redim them to start with 1 that's how lists work!! the first item is labelled 1, that's the number of items there are up to and including that point in the list! I will die on this hill.
|
# ? Sep 20, 2021 15:08 |
|
Bobby Deluxe posted:Bolded to see if I understand the important part right, but it just feels to me like if you have a program that guesses between 1 and 1000, and you set the maximum to 1000, that should include it guessing 1000. Its due to how Random.Next(min,max) works in C#. The min value is inclusive, the max value is exclusive.
|
# ? Sep 20, 2021 15:08 |
|
But do negative numbers exist?
|
# ? Sep 20, 2021 15:09 |
|
Mega Comrade posted:Its due to how Random.Next(min,max) works in C#. The min value is inclusive, the max value is exclusive. Yeah it's this https://docs.unity3d.com/ScriptReference/Random.Range.html "Description Return a random int within [minInclusive..maxExclusive) (Read Only)."
|
# ? Sep 20, 2021 15:10 |
|
Guavanaut posted:But do negative numbers exist? Sometimes Depends on your data type.
|
# ? Sep 20, 2021 15:11 |
|
Bobby Deluxe posted:Yes this is an edge case lunatic, but people like the LGB alliance cutting specific letters out of LGBTQ seems to have awoken a chunk of nutcases who think they have the right to do the same with other letters. Almost as if that was the plan all along.
|
# ? Sep 20, 2021 15:12 |
|
rand(6) gives you one of six numbers, where the first is 0. Thinking about it another way, if you want to cover every integer percentage including 100, there's actually 101 possibilities, 1-100 and 0. A 1 in 100 chance would cover either 1-100 or 0-99. Here's how I'd do it (pseudocode as I don't know C#) code:
|
# ? Sep 20, 2021 15:14 |
|
JeremoudCorbynejad posted:arrays starting with 0 in VBA bothers me and i always redim them to start with 1 0-indexing is way better than 1-indexing, sorry
|
# ? Sep 20, 2021 15:14 |
|
JeremoudCorbynejad posted:arrays starting with 0 in VBA bothers me and i always redim them to start with 1 Ahem. Array indexes are sized offsets from the start of the array memory, hence the first item is zero item-size-distances from the start. Beep boop.
|
# ? Sep 20, 2021 15:16 |
|
If you want to talk about bad decisions, JavaScript trumps C# a hundred times over. JavaScript dates have 1-indexed day of month and year, but 0-indexed months, so if you created a date with 1/1/2021 it would give you the first of February 2021. Comically annoying until you get used to it
|
# ? Sep 20, 2021 15:17 |
|
Zero-indexing vs one-indexing arguments are boring cos very very few people will ever take the side of arrays starting at 1 these days if they know much about programming. Tabs vs spaces, now that's where it's at. Noxville posted:If you want to talk about bad decisions, JavaScript trumps C# a hundred times over. JavaScript dates have 1-indexed day of month and year, but 0-indexed months, so if you created a date with 1/1/2021 it would give you the first of February 2021. Comically annoying until you get used to it Bringing up bad design decisions in languages and using JS is just cheating.
|
# ? Sep 20, 2021 15:19 |
|
Thanks all for the answers re: physio stuff, based on the responses I'll look into a sports physio short term as they aren't too pricy, and book something with the NHS as well to see if I can get imaging at some point if needed
|
# ? Sep 20, 2021 15:20 |
|
Looks like Biden admin will lift the UK/EU travel ban from November, so look forward to reading reports of how Big Boy Boris manfully wrestled Joe into a headlock until he caved in. Nice for me though, means I'll probably get to spend Thanksgiving - the best eating holiday - with herself in NY
|
# ? Sep 20, 2021 15:20 |
|
It's really interesting reading the clarifications, thanks all. I quite often find things like this where I feel like I've been dumb and wrong, and then when I talk to people who are good at it, I find out I'm just thinking about it in a really complicated way that most people don't need to but would make sense at a graduate level. Like most people don't really need to think about what a number actually is at a conceptual level.
|
# ? Sep 20, 2021 15:23 |
|
josh04 posted:Ahem. Array indexes are sized offsets from the start of the array memory, hence the first item is zero item-size-distances from the start. Which would be relevant if we were writing a compiler
|
# ? Sep 20, 2021 15:23 |
|
Bobby Deluxe posted:It's really interesting reading the clarifications, thanks all. I quite often find things like this where I feel like I've been dumb and wrong, and then when I talk to people who are good at it, I find out I'm just thinking about it in a really complicated way that most people don't need to but would make sense at a graduate level. Thinking of how the CPU is actually addressing memory and how the code is actually generating and iterating through those 1000 numbers is probably more complicated than "1-1000 should be 1-1000".
|
# ? Sep 20, 2021 15:29 |
|
Private Speech posted:This will be because the function to generate a random number returns a number between 0 and the number you gave it - so random(6) will give you 0...5. If you want to make it 1...6 you have to add one to whatever you generate. The reason it's this way is that it's often more useful to start with 0 than 1 for various maths reasons, hence it being that way actually saves work most of the time. In that case, you should just add 1 to the rng result, tho.
|
# ? Sep 20, 2021 15:31 |
|
Bobby Deluxe posted:It's really interesting reading the clarifications, thanks all. I quite often find things like this where I feel like I've been dumb and wrong, and then when I talk to people who are good at it, I find out I'm just thinking about it in a really complicated way that most people don't need to but would make sense at a graduate level. Indexes starting at 0 is a hurdle every programmer hits when they first start learning programming. Once you learn the nitty gritty of why though it makes sense and thinking in those terms when you're programming becomes second nature after a while.
|
# ? Sep 20, 2021 15:31 |
|
https://twitter.com/thecourieruk/status/1439918521861935110
|
# ? Sep 20, 2021 15:32 |
|
Kerbtree posted:In that case, you should just add 1 to the rng result, tho. Believe having to do this was the original complaint. Would definitely agree though that if you want to make a [1, 1000] random generator then expressing exactly what you want in code is better + less likely to introduce subtle bugs, than making a [0, 1000) generator and shifting every value up by one.
|
# ? Sep 20, 2021 15:33 |
|
Mega Comrade posted:Once you learn the nitty gritty of why though it makes sense and thinking in those terms when you're programming becomes second nature after a while. If this were true, there would be vastly fewer off-by-one errors.
|
# ? Sep 20, 2021 15:39 |
|
peanut- posted:A huge part of the problem right now is that there isn't any wind Get the guardian to churn out more articles then.
|
# ? Sep 20, 2021 15:41 |
|
|
# ? Sep 20, 2021 15:42 |
|
9/10 on the colour match, 8/10 on the hakenkreuz not looking like a squashed spider, 6/10 layout, 2/10 spelling punctuation and grammar
|
# ? Sep 20, 2021 15:46 |
|
Genuine laugh out loud from me. loving nora. What an absolutely perfect LibDem policy.
|
# ? Sep 20, 2021 15:48 |
|
Oh dear me posted:If this were true, there would be vastly fewer off-by-one errors. The issue usually comes up when you have to switch back to the inferior one-based system for the benefit of the uncultured plebs using your system.
|
# ? Sep 20, 2021 15:50 |
|
loving nazis man. Just the absolutely dumbest loving people on the planet. When has adding a swastika to anything ever granted it more credibility after 1945, and this is if (and that's a big loving if) you can look past the antivax idiocy. This is not an open call to explain to me how the swastika was coopted by the nazis tia
|
# ? Sep 20, 2021 15:51 |
|
Miftan posted:loving nazis man. Just the absolutely dumbest loving people on the planet. When has adding a swastika to anything ever granted it more credibility after 1945, and this is if (and that's a big loving if) you can look past the antivax idiocy. I'm pretty sure they are trying to claim the NHS are the Nazis, for making us get the evil fake COVID vaccine
|
# ? Sep 20, 2021 15:55 |
|
Miftan posted:loving nazis man. Just the absolutely dumbest loving people on the planet. When has adding a swastika to anything ever granted it more credibility after 1945, and this is if (and that's a big loving if) you can look past the antivax idiocy. I suspect that this is the antivaxxer implying that the NHS are Nazis.
|
# ? Sep 20, 2021 15:55 |
|
Strom Cuzewon posted:I'd call it powerfully centrist rather than right-wing. Yeah, the baddies are socialist revolutionaries and anarchists, but also a theocratic monarchy and fascists (with mechs). Politically I'd say its no better or worse than a dozen other YA properties, but it definitely sticks out because it spends so much effort trying to be deep and serious about it. The second season guy is framed as an environmentalist (he wants to bring "balance with the spirit world") and the final season woman is a communist in a Maoist or Stalinist style (as opposed to the revolutionary socialists - "equalists" lol - of the first season).
|
# ? Sep 20, 2021 15:56 |
|
Miftan posted:This is not an open call to explain to me how the swastika was coopted by the nazis tia The sworstica was coopted by neo nazis
|
# ? Sep 20, 2021 16:00 |
|
forkboy84 posted:I'm pretty sure they are trying to claim the NHS are the Nazis, for making us get the evil fake COVID vaccine As a rule of thumb, because they can draw a swastika, they are probably not a fan of the nazis E: ^^ great minds
|
# ? Sep 20, 2021 16:00 |
|
josh04 posted:Believe having to do this was the original complaint. Would definitely agree though that if you want to make a [1, 1000] random generator then expressing exactly what you want in code is better + less likely to introduce subtle bugs, than making a [0, 1000) generator and shifting every value up by one. I get that thinking of arrays as starting with 0 by default is more useful in more cases, it'd just be nice if you could set it to start at 1 in certain cases. I'm probably going to find out you can, but it's either too long / complicated to go into on a udemy video or they didn't know how. Or that the unexpected interactions would cause nightmarish levels of bugs and errors. It just seems like such a huge issue to bring up in literally the first lesson, but I doubt most other people really thought about it too much. * apologies if this word has a specific meaning within coding, I mean like a suffix or symbol that you add to a number-based command or function ** We must secure the existence of our syntax and a future for logical parsing.
|
# ? Sep 20, 2021 16:03 |
|
i actually wanted to be number 100 but here we are.
|
# ? Sep 20, 2021 16:03 |
|
gently caress lol. The only sensible response to this is to go to your local polling station and immolate yourself in protest like Thích Quảng Đức
|
# ? Sep 20, 2021 16:04 |
|
Miftan posted:loving nazis man. Just the absolutely dumbest loving people on the planet. When has adding a swastika to anything ever granted it more credibility after 1945, and this is if (and that's a big loving if) you can look past the antivax idiocy. They're claiming that the NHS are the Nazis - just search Twitter for "nuremburg" (sic) for loads of examples of it.
|
# ? Sep 20, 2021 16:06 |
|
Failed Imagineer posted:gently caress lol. The only sensible response to this is to go to your local polling station and immolate yourself in protest like
|
# ? Sep 20, 2021 16:07 |
|
starting all my arrays from now on at -1 just to annoy all of you
|
# ? Sep 20, 2021 16:13 |
|
|
# ? May 23, 2024 04:51 |
|
buffeh posted:Hi all, As someone that had sports related physio on the NHS just before the pandemic hapenned, I might be able to help. First of all go to your GP ASAP, no ifs ands or buts. Unless it's been a while since the injury (as in, several weeks/months) and isnt displaying signs of being something really serious, you'll likely be told to rest up a bit after an examination. In my case it was serious last time, enough to be prescribed the Good Drugs for back spasms. A short course of that then after that had helped, a referral to a specialist unit, likely but not always in a hostital. It did take a few weeks to get the physio started, but they were excellent. The most important thing is to go to the GP as soon as, and take it from there.
|
# ? Sep 20, 2021 16:34 |