Readit News logoReadit News
awegio commented on Spacedrive – an open source cross-platform file explorer   github.com/spacedriveapp/... · Posted by u/microflash
koolba · 2 years ago
> why do I want to login a file explorer man this timeline is weird

From the first line of the link:

>> Spacedrive is an open source cross-platform file manager, powered by a virtual distributed filesystem (VDFS) written in Rust.

You log in because it’s a remote file system. Think Dropbox, not file explorer.

awegio · 2 years ago
In their FAQ

> How does it work?

> Using a "Virtual Distributed Filesystem" (VDFS), in other words; a decentralized database that emulates a filesystem. It indexes hardware filesystems to create a master database that is synchronized in realtime between your devices running Spacedrive.

> What makes this different to Dropbox or Google Drive?

> It is not a storage provider, Spacedrive is simply a database that exists on top of existing storage layers, from cloud services like Dropbox, Google Drive and iCloud to physical devices and external drives you already own. It doesn't provide you more storage, rather a supercharged view of your existing storage.

So more like Syncthing? Or rather Windows File Sharing/Samba? I don't really get it

awegio commented on Passkeys are now enabled by default for Google users   blog.google/technology/sa... · Posted by u/vdelitz
jasonjayr · 2 years ago
How can a user, right now, take control + ownership of backing up their own pass keys, without iCloud or Google?

This is a privilege I currently enjoy right now, and one I am not really eager to give up.

awegio · 2 years ago
It depends on your web browser. Just see what happens here https://webauthn.io/

Firefox on Desktop tells me to "touch my security key". Not sure how that works. Firefox Android gives me a few hardware options to store my passkey to. Chrome Desktop asks me to enable Bluetooth. Chrome Android asks which Google Account to use.

awegio commented on How to store a chess position in 26 bytes using bit-level magic (2022)   ezzeriesa.com/index/Writi... · Posted by u/kurinikku
solardev · 2 years ago
Meanwhile the non-comp-sci dev in me is like, "why not just store every position in a simple JSON so everyone can read it and everything can parse it". Yeah, it might be half a kB, but you don't have to run through mental gymnastics just to render the pieces...
awegio · 2 years ago
You need a compact encoding for chess engines that explore billions of states as fast as possible to plan the best move.
awegio commented on The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine.   twitter.com/lauriewired/s... · Posted by u/isp
oefrha · 2 years ago
Since I'm slacking off, here's a straightforward, not at all optimized Go implementation:

  package main
  
  import (
      "bytes"
      "crypto/sha256"
      "encoding/hex"
      "fmt"
  )
  
  var (
      _chars = []byte("0123456789abcdef")
      _names = []string{"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "a", "b", "c", "d", "e", "f"}
      _size  = len(_chars)
  )
  
  func main() {
      hexsum := make([]byte, 64)
      for i1 := 0; i1 < _size; i1++ {
          for i2 := 0; i2 < _size; i2++ {
              for i3 := 0; i3 < _size; i3++ {
                  for i4 := 0; i4 < _size; i4++ {
                      for i5 := 0; i5 < _size; i5++ {
                          for i6 := 0; i6 < _size; i6++ {
                              for i7 := 0; i7 < _size; i7++ {
                                  s := fmt.Sprintf("The SHA256 for this sentence begins with: %s, %s, %s, %s, %s, %s and %s.", _names[i1], _names[i2], _names[i3], _names[i4], _names[i5], _names[i6], _names[i7])
                                  sum := sha256.Sum256([]byte(s))
                                  hex.Encode(hexsum, sum[:])
                                  prefix := []byte{_chars[i1], _chars[i2], _chars[i3], _chars[i4], _chars[i5], _chars[i6], _chars[i7]}
                                  if bytes.HasPrefix(hexsum, prefix) {
                                      fmt.Printf("%s\n", s)
                                      fmt.Printf("%s\n", hexsum)
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
  }
Takes a few minutes on common consumer hardware. There's exactly one hit.

(Easiest optimization is wrapping the loop body in a goroutine. GOEXPERIMENT=loopvar really makes this nicer btw.)

The reply is obviously more interesting, need to come up with a lot of variations.

awegio · 2 years ago
> There's exactly one hit

There are N possible sequences, and you try N times with a success probability of 1/N each (because it is a good hash function). This means the expected number of hits is 1.

awegio commented on Bad numbers in the “gzip beats BERT” paper?   kenschutte.com/gzip-knn-p... · Posted by u/ks2048
skrebbel · 2 years ago
Can anyone explain to me how a compression algorithm can beat an LLM at anything? Isn’t that like saying horses are better than graffiti?

I’m sure the answer is in there somewhere but I’m not well versed in AI and I simply can’t figure it out.

awegio · 2 years ago
A language model estimates the probability of a sequence of words P(w_1, ..., w_n) or equivalently P(word | context).

For compression, word sequences that have higher probability should be encoded with shorter codes, so there is a direct relationship. A well known method to construct such codes based on probabilities is Huffman coding.

This works whether you use a statistical language model using word frequencies or an LLM to estimate probabilities. The better your language model (lower perplexity) the shorter the compressed output will be.

Conversely, you can probably argue that a compression algorithm implicitly defines a language model by the code lengths, e.g., it assumes duplicate strings are more likely than random noise.

awegio commented on Bubblewrap – Low-level unprivileged sandboxing tool used by Flatpak   github.com/containers/bub... · Posted by u/TheFreim
CJefferson · 2 years ago
I do wonder if some future Nix-variant which based around sandboxing first could make life easier.

Nix seems to have to put lots of work into handling programs that expect to find to find /bin/bash. An alternative would be to put programs in custom sandboxes, where /bin/bash is found exactly where they expect to find it.

awegio · 2 years ago
> put programs in custom sandboxes, where /bin/bash is found exactly where they expect to find it

NixOS can do that, I think it was necessary to get Steam games running

https://nixos.org/manual/nixpkgs/stable/#sec-fhs-environment...

awegio commented on When an app asks for permissions, it should have a “feed fake data” option   mastodon.gamedev.place/@N... · Posted by u/janandonly
Havoc · 2 years ago
Unfortunately this approach makes you quite unique for fingerprinting
awegio · 2 years ago
Why? Only if you would reuse the same data multiple times, or if you use a unique random generator that is easily distinguishable from other data. So maybe don't use the 5x5 island, but when done right the approach shouldn't help fingerprinting?
awegio commented on Why Kakoune – The quest for a better code editor (2016)   kakoune.org/why-kakoune/w... · Posted by u/r3trohack3r
chongli · 3 years ago
Perhaps it’s changed since the last time I used it, but I do strongly recall it adding multiple cursors with regular n. Those cursors might not have been “live” for editing, but they were still there to distract me.
awegio · 3 years ago
That's probably because you confused Vim and Kakoune key bindings.

Kakoune

- n: next match

- alt+n: previous match

- shift+movement: extend selection by movement

Vim

- n: next

- shift+N: previous match

So if you press shift+N as you are used from vim, you start adding a lot of selections instead of going to previous match. I believe this difference is the most confusing for people who switch from Vim to Kakoune.

awegio commented on My First Impressions of Nix   mtlynch.io/notes/nix-firs... · Posted by u/signa11
otabdeveloper4 · 3 years ago
nixpkgs doesn't use requirements.txt for whatever reason.

(That reason probably being the utter brokenness and braindead state of Python packaging; Node packages work much better.)

awegio · 3 years ago
> Node packages work much better

Are you sure about that? I haven't seen a node app built from source on nixpkgs yet. That includes Electron apps like Signal Desktop, which is a bit disappointing.

There is this article about trying to package jQuery on Guix:

http://dustycloud.org/blog/javascript-packaging-dystopia/

awegio commented on GPT-4 “discovered” the same sorting algorithm as AlphaDev by removing “mov S P”   twitter.com/DimitrisPapai... · Posted by u/machdiamonds
awegio · 3 years ago
DeepMind's blog post on AlphaDev says:

> AlphaDev uncovered faster algorithms by starting from scratch rather than refining existing algorithms

Finding that specific optimization, especially when given the comments, seems almost trivial by comparison.

Edit: I tried to understand the optimization in question. This is not the full sort3 algorithm, but only under the assumption that B < C. In that case the GPT-4 answer is actually wrong because it wasn't given that assumption.

u/awegio

KarmaCake day145April 26, 2023View Original