Hello. How can I calculate the number of DAYS between two dates? ie. Difference between 03-15-2023 and 01-01-2023. = 73 days. Thanks!
@RRKS_TF Жыл бұрын
Extract the number for each value of a date, then compute the difference between the same units before finally converting each unit into days and summing them up. Accounting for leap years can be accounted for by using a non-exact factor for how many days in a year, then flooring the result
@downey2294 Жыл бұрын
thank you for the video. so if i understand it correctly there is only one running coroutine at a given time? also are there any other ways for multi threading?
@Stevesteacher Жыл бұрын
Yes, if one co-routine has to wait for a task, another will run instead, switching between them for more efficient code execution I don't think Lua natively supports other ways for multi threading, however, if you learn C or C++, you should be able to implement it and then just run Lua files in threads... I've also heard LuaJIT includes FFI, which allows you to interface with C, which in return could allow you to do multi threaded tasks
@_GreenShadow_2 жыл бұрын
What programming client are you using?
@downey2294 Жыл бұрын
says in the top, its vs code. what you are referring to as an "programming client" is called an IDE its short for integrated development environment.
@leavesfed54622 жыл бұрын
Hey I wanted to ask you something: Local function loop() Print(“what number do you want to start on”) Input = io.read() Print(“your number: “ .. input) For i = input, 10 do Print(i) End End Now this works perfectly fine but when I store the function as a variable Local test = loop() Print(test) It prints out all the numbers from input to ten but at the end it gives me nil for some reason.
@Stevesteacher2 жыл бұрын
That is because the function returns nil, at the end of the function, after the loop and before the final end, put "return 0", then you'll get 0 instead of nil
@leavesfed54622 жыл бұрын
@@Stevesteacher oh I understand now thank you, so it’s better off not using a function for a simple loop like this
@leavesfed54622 жыл бұрын
@@Stevesteacher but wait, that didn’t happen on the first try, only after I put it in a variable
@orangegamer Жыл бұрын
@@leavesfed5462that’s what, when ur simply it running it, it’s just printing those values, however when you are storing the function in a variable the value of return is being Handed over to it, hence when you u print it’ll print null
@AdrianTRYaValioCheetos3 жыл бұрын
Very nice!!! :D
@damnedattendant25364 ай бұрын
I just saw fairytail and I knew .. this is my bro ..
@tooeooeenee48553 жыл бұрын
Cool! 👌👌👌👌👌👌👌👌👌
@Im_Ninooo2 жыл бұрын
I'm a Go dev and goroutines + channels make so much more sense for me hahah