Open Mesure73L opened 8 months ago
@Mesure73L I have an idea for this challenge about an API for statistics but you probably don't know the math so is that fine? It is about least square regression.
We already had a plan for challenge 2
I know we did, and this follows that. It just uses math too. I will explain it step by step here, but first, you will need to have a basic understanding of what linear regression is.
If you are given a set of points (coordinates on a Cartesian plane, also known as ordered pairs), a linear regression line is the line of best fit through them. Least square regression is a method of finding a linear regression line such that the sum of the squares of the vertical distance from each point to the line is minimal. Linear regression can be used to predict linear patterns in a set of data. TL;DR: A linear regression line is a line of best fit for a set of points.
All you will be given is the API, nothing else.
Is that good?
Oh, and by the way, I know you don't think UUIDs are random enough without multiple, but I have evidence now. The chance of a specific person being hit by a meteorite in a given year is 1 in 17 billion. That is the same chance that if you generate 10 trillion UUIDs, two of them will be the same.
Oh, and by the way, I know you don't think UUIDs are random enough without multiple, but I have evidence now. The chance of a specific person being hit by a meteorite in a given year is 1 in 17 billion. That is the same chance that if you generate 10 trillion UUIDs, two of them will be the same.
I do think they are random enough without multiple.
All you will be given is the API, nothing else.
The challenge will still have to be explained.
Once you are done using the API, you will click a button.
The button will send a message to the API to close off your access to the API. This will require each user to have a unique UUID.
After you click the button, you will not be able to get Y coordinates from the API anymore.
After you click the button, you will get your input.
If you did not get enough data from the API, you must change your seed and reset the challenge to continue.
It will keep track of all your former seeds, so you can never go back to an old one.
I do not think we should limit the access to the API.
It's good other than that tho
All you will be given is the API, nothing else.
The challenge will still have to be explained.
Yeah ofc.
I have this code to get the user's starting brand:
const startingBrand =
finalBrandNames[
Math.floor(smanRandom2024mar1.startingBrand * finalBrandNames.length)
];
It is returning undefined
. How can I fix this?
@BeepBot99
Please don't mention me in issues that I am subscribed to (every issue I have commented in).
Please debug things on your own first. Don't ask me things like this that are simple.
I believe that finalBrandNames
doesn't exist in the global scope.
Also check that the index exists. Please don't ask for help with simple things like this. You're a person, you can do things.
thanks for your positive help ig /s
Can you send me the php code I need for sman and the logic for the answer checker? I am a bit stuck on what I need to do for it. Thanks!
The PHP code for sman
is in https://github.com/twelve-of-code-official/website/issues/173. For the answer checker, you just need to run the same code that the user would run and the code that the API would run and check if you get the same answer. However, you should run the API's code in the JavaScript (client side) so that it doesn't have to wait for the API to respond.
If you are stuck, make the API. That is the most important part right now.
This is my current plan (in order of what I'm planning on completing it in). Is this good, and is there anything missing?
Ok, so that is mostly good, except I wouldn't hard code test seed. I would just make it 0 or something simple like that. Currently, 0 is not allowed as a seed, so you can't just enter 0 as your real seed.
Ok, so that is mostly good, except I wouldn't hard code test seed. I would just make it 0 or something simple like that. Currently, 0 is not allowed as a seed, so you can't just enter 0 as your real seed.
We already discussed the seed and agreed on it being TEST_SEED
.
No, I mean, instead of preprogramming every single possibility for test seed, just when the API gets sent it, it acts as if it were 0.
It's not that many, i'll just hard code it.
No, please don't.
What do you mean it's not that many, it's 129.
Do you even know what TEST_SEED
is?
Because it's a lot less than 129.
Yeah it will be like 5 right? Like an example? But still don't hardcode it just take a random subset please.
No, TEST_SEED
is made for you to use in any challenge where you need to input your seed so that you can use the example in your program. The example is the same for every person. TEST_SEED
is for the very simple example that was given on the challenge for testing purposes. If TEST_SEED
is not hardcoded, it will have to always give the same response as what was given in the challenge example. Final decision.
I literally put that in the challenge HTML for that reason.
oops didnt mean to do that
No,
TEST_SEED
is made for you to use in any challenge where you need to input your seed so that you can use the example in your program. The example is the same for every person.TEST_SEED
is for the very simple example that was given on the challenge for testing purposes. IfTEST_SEED
is not hardcoded, it will have to always give the same response as what was given in the challenge example. Final decision.
Yeah, any seed always gives the same response 🤯.
I'm saying if TEST_SEED
is entered as the seed in the API, then it should just act as if it were the seed 0 but with a limited dataset.
I'm not letting you hardcode every single possibility.
If you want to do that for your challenges, go ahead. But for my challenges, I'm doing it this way because it's easier for me. You haven't listed any downsides yet. Plus I already did and it doesn't make the code worse at all.
Yeah, any seed always gives the same response 🤯.
No, I mean the same response as is already on the challenge HTML.
Ok so clearly you don't know what like the whole point of a RESTful API is.
You can use whatever code you want in your challenge as long as it works as expected. Unlike you, I don't care about how the code was written, as long as it works correctly.