Waring problem variant Updated 2025-07-16
b-money Updated 2025-07-16
Penalty kick left right Nash equilibrium Updated 2025-07-16
And before he kicks, the goalkeeper must also decide left or right, because there is no time to see where the ball is going.
Because the kicker is right footed however, he kicker kicks better to one side than the other. So we have four probabilities:
- goal kick left keeper jumps left
- goal kick right keeper jumps right
- goal kick left keeper jumps right. Note that it is possible that this won't be a goal, even though the keeper is nowhere near the ball, as the ball might just miss the goal by a bit.
- kick right and keeper jumps left. Analogous to above
Personal finance Updated 2025-07-16
- the American stock market gives 10% / year, which is about 2x over 10 years. It has been the sure-fire best investment on a 10 year horizon for many decades, and should serve as your benchmark.
- risky diversified investments (e.g. ETFs that track a market index) are basically the best investment if you can keep your money in them in the long term (10 years)
- risky investments can gown down for a while, and you cannot take your money out then. This effectively means risk is a form of illiquidity
- investment funds have taxes, which eat into your profit. The best investments are dumb index tracking investments (like an ETF that tracks the stock market) that are simply brainless to manage, and therefore have lowest taxes. No fund has managed to beat the market long term essentially.
- when you are young, ideally you should invest everything into riskier higher yielding assets like stock. And as you get older, you should move part of it to less risky (and therefore more liquid, but lower yielding) assets like bondsThe desire to buy a house however complicates this for many people.
ROW_NUMBER
Updated 2025-07-16sqlite3 ':memory:' 'WITH t (i) AS (VALUES (-1), (-1), (-2)) SELECT *, row_number() over () FROM t'
-1|1
-1|2
-2|3
With a possible output:
partition by
:sqlite3 ':memory:' 'WITH t (i) AS (VALUES (-1), (-1), (-2)) SELECT *, row_number() over ( partition by i ) FROM t'
-2|1
-1|1
-1|2
Organizationally unique identifier Updated 2025-07-16
activatedgeek/LeNet-5 run on GPU Updated 2025-07-16
By default, the setup runs on CPU only, not GPU, as could be seen by running htop. But by the magic of PyTorch, modifying the program to run on the GPU is trivial:and leads to a faster runtime, with less
cat << EOF | patch
diff --git a/run.py b/run.py
index 104d363..20072d1 100644
--- a/run.py
+++ b/run.py
@@ -24,7 +24,8 @@ data_test = MNIST('./data/mnist',
data_train_loader = DataLoader(data_train, batch_size=256, shuffle=True, num_workers=8)
data_test_loader = DataLoader(data_test, batch_size=1024, num_workers=8)
-net = LeNet5()
+device = 'cuda'
+net = LeNet5().to(device)
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(net.parameters(), lr=2e-3)
@@ -43,6 +44,8 @@ def train(epoch):
net.train()
loss_list, batch_list = [], []
for i, (images, labels) in enumerate(data_train_loader):
+ labels = labels.to(device)
+ images = images.to(device)
optimizer.zero_grad()
output = net(images)
@@ -71,6 +74,8 @@ def test():
total_correct = 0
avg_loss = 0.0
for i, (images, labels) in enumerate(data_test_loader):
+ labels = labels.to(device)
+ images = images.to(device)
output = net(images)
avg_loss += criterion(output, labels).sum()
pred = output.detach().max(1)[1]
@@ -84,7 +89,7 @@ def train_and_test(epoch):
train(epoch)
test()
- dummy_input = torch.randn(1, 1, 32, 32, requires_grad=True)
+ dummy_input = torch.randn(1, 1, 32, 32, requires_grad=True).to(device)
torch.onnx.export(net, dummy_input, "lenet.onnx")
onnx_model = onnx.load("lenet.onnx")
EOF
user
as now we are spending more time on the GPU than CPU:real 1m27.829s
user 4m37.266s
sys 0m27.562s
Actuator Updated 2025-07-16
Animal subclade Updated 2025-07-16
Application programming interface Updated 2025-07-16
Convolutional neural network Updated 2025-07-16
YouTube channels that just go over Stack Exchange questions Updated 2025-07-16
Some people have been creating YouTube channels that just post and go over a large number of Stack Exchange questions, some of them with a quick random intro video. Perfectly legal due to CC BY-SA but really weird stuff!
- Roel Van de Paar www.youtube.com/@RoelVandePaar. This one seems to be the OG. As of June 2024 it had 2M videos (!), 161K subscribers and only 47M views. youtube.fandom.com/wiki/Roel_Van_de_Paar mentions "he has the highest number of uploads of any YouTube channel". Interestingly at www.linkedin.com/in/roelvandepaar/?originalSubdomain=au he says he is a test engineer at MariaDB.
- Peter Schneider www.youtube.com/@peterschneiderQandA e.g. www.youtube.com/watch?v=GBQhrKRpUdI "How to put a newline special character into a file using the echo command and redirection operator?" from unix.stackexchange.com/questions/191694/how-to-put-a-newline-special-character-into-a-file-using-the-echo-command-and-re)Stackexchange
- Sophia Wagner www.youtube.com/@SophiaWagnerQandA. As of June 2024 it had 14k videos and only 88k views, so she made 88 bucks on it.
- E.g. www.youtube.com/watch?v=elIlkJneVBI "Vertically stack multiple images using ImageMagick" goes over superuser.com/questions/290656/vertically-stack-multiple-images-using-imagemagick
- www.youtube.com/@LukeChaffeyTechInfo Luke Chaffey, an Indian-American dude, e.g. www.youtube.com/watch?v=wmx6mN_G83s "Do Boost Geometry nearest queries always sort results ordered by smallest distance first?"
- www.youtube.com/@pythonoracle The Python Oracle. Speech synthesis, with different accents. Cute!
Adenine nucleotide translocator Updated 2025-07-16
Adenosine triphosphate Updated 2025-07-16
CC BY Updated 2025-07-16
Polarity symbols Updated 2025-07-16
Political correctness Updated 2025-07-16
Ciro Santilli believes it generally hurts more than it helps.
Especially when you can't even mention censored things to criticize them. You have to pretend they never existed. So people will forget about them, and do them again in the future.
Coprime Updated 2025-07-16
Point particle Updated 2025-07-16
This idealization does not seems to be possible at all in the context of Maxwell's equations with pointlike particles.
Taylor expansion definition of the exponential function Updated 2025-07-16
The Taylor series expansion is the most direct definition of the expontial as it obviously satisfies the exponential function differential equation:
There are unlisted articles, also show them or only show them.