written by dr. love
written by dr. love
a wise programmer knows to always ask the question “can i solve this problem in python using metaprogramming?” in this instance, the answer is yes:
def is_even(n: int):
s = "def is_even_helper(number: int):\n"
b = True
for i in range(0, abs(n)+2):
s += f"\tif (abs(number) == {i}): return {b}\n"
b = not b
exec(s)
return locals().get("is_even_helper")(n)
ah true. i missed the context of the original comment since it got deleted, but you’re completely right that the “1 is a scalar while i is a vector” statement is not entirely accurate.
no it does not. it’s basically just a poll to see what other countries think. at least, that’s my understanding based on what i’ve read.
sources:
edit: formmatting. also i should clarify that reddit isn’t a particularly reliable source, but i included it because the top comments on that post agree with the other sources linked, and give provide simple answers to the question
after you spend enough time with complex numbers, the real numbers start to feel wrong
whether or not i is a scalar depends entirely on the context.
every vector space has an associated field of coefficients. in practice, this field is typically the real numbers. but you can have lots of other kinds of vector spaces as well, and they can be useful for certain things.
anyways, if you have a vector space over the complex numbers, then i is a scalar, because it is a complex number. if you have a vector space over the real numbers, then i is not a scalar, because it’s not a real number.
its worth mentioning that you can view the complex numbers as a vector space over itself. this is just a fancy way of saying that you can add complex numbers together, and you can multiply a complex number by a complex number. (one of those numbers is playing the role of scalar, and the other is playing the role of vector.) but you can also view the complex numbers as a vector space over the real numbers. and this is just a fancy way of saying that you can add complex numbers, and you can multiply a complex number by a real number.
from a topological perspective, pizzas are also pyramids and cubes. from an enlightened topological perspective, pizzas are lines and points.
it’s very telling that being pro palestine is immediately interpreted as being “anti israel”
the only problem with that is i’d need to change their mind again next year
unfortunately i don’t believe in uranium or numbers higher than 200, so this argument doesn’t work on me
There is only two ways to protect a game against piracy, right? Either you don’t, or use our protection
this is the most denuvo quote i could possibly think of. it’s beyond parody, and yet, they went and said it anyway
disposable vapes come with built in lithium batteries, while (most) disposable lighters don’t. so there is a very real difference between the two. but disposal lighters are also stupidly wasteful, so it would be nice to ban those as well.
nothing beats having to click the download button twice. it’s my favorite
what’s the deal with the white arm bands?
i won’t be able to sit still for 5 minutes either if i know there’s a whole. that said, i still wouldn’t be fixing that hole
it’s homeomorphic to a square, so why not
what about haskell