HNHacker News
TopNewBestAskShowJobs

qazxcvbnm

280 karma · joined October 3, 2022

submissionscomments
qazxcvbnm··on Some remarks on the mathematical structure of the multiverse (2016)
If consciousness is a property of mathematical systems, and such an infinitude exists, what is the paradox? It sounds quite consistent to me. Could you elaborate?
qazxcvbnm··on Show HN: Meet.hn – Meet the Hacker News community in your city
Hey! I think I saw your profile on the meet.hn for a while, but as of now, it seems that even your profile has disappeared. I tried submitting again with your advice, and the submit seemed to not give any errors yet I don't see myself on the map either.
qazxcvbnm··on Show HN: Meet.hn – Meet the Hacker News community in your city
Trying to add myself fails, showing "Oops! Something uncool is breaking this app.". The POST request seems to be receiving 500 with the following request.

    -----------------------------74974701830891853922449739590
    Content-Disposition: form-data; name="1_username"
    
    qazxcvbnm
    -----------------------------74974701830891853922449739590
    Content-Disposition: form-data; name="1_location"
    
    Hong Kong Island, China
    -----------------------------74974701830891853922449739590
    Content-Disposition: form-data; name="0"
    
    ["$undefined","$K1"]
    -----------------------------74974701830891853922449739590--
qazxcvbnm··on Interactive NixOS Tests
Speaking of useful “break” constructs in Nix for debugging;

Break within a Nix derivation to debug it: https://discourse.nixos.org/t/debug-a-failed-derivation-with...

Break on a Nix expression evaluation to debug it: https://nix.dev/manual/nix/2.18/language/builtins#builtins-b...

qazxcvbnm··on SwiftUI for Mac 2024
Touché. Indeed, CSS forces one to recognise layouts that may not conform to a layout 'flow' in boxes.

In its defence, I suppose recognising this is important, as to make potential box overlaps explicit (which is typically unwanted).

CSS also handles a whole lot of things other than layout, which I'm not well informed of layout constraint systems being able to handle. Being a hodgepodge is an advantage, comparable to how its a great advantage that one can invoke any hodgepodge systems task from bash, as one single tool.

qazxcvbnm··on SwiftUI for Mac 2024
Either put left, right as absolute (like the following) and leave middle in the flex, or do the opposite. One may decide which option to use based on whether the centre or the left/right is more semantically important in the layout.

We did have to use some CSS "tricks" (transform for absolute centring), but once you've learnt those then CSS is indeed quite sane.

  outer {
          flex-direction: row;
          justify-content: center;
          align-items: center; }
  left, right {
          position: absolute;
          top: 50%;
          transform: translateY(-50%); }
  left {
          left: 0; }
  right {
          right: 0; }
(This kind of layout, which is common in eg top nav bars, is slightly deceptive. robin_reala's solution does not conform to requirements that left and right can be different widths, which would cause middle to be not centred under simple justify-content: space-between.)
qazxcvbnm··on Ask HN: Could true randomness come from sparkles from light reflecting the sea?
Many comments point to regularities being present in waves. This makes me wonder; for eg sampling problems, it is possible to construct a sampling of a fair coin given a biased coin (eg discard HH, TT, take HT and TH to be the flip; I believe many other sampling methods exist). Given a source of low entropy randomness, what is the best way to convert it into a source indistinguishable from true randomness? Would suitably hashing the low entropy source be sufficient, since good hash functions are supposed to possess avalanche effect and be indistinguishable from randomness (perhaps with schemes of eg recursive hash salting to guard against “replays” from the source) (Is this the kind of stuff that goes on in the kernel /dev/random)?
qazxcvbnm··on Ask HN: How to build site with payment, subscriptions, user login, registration
And hashes with salts of course. Without, get a rainbow table and the password becomes plain as day.
qazxcvbnm··on Below: A time travelling resource monitoring tool (2021)
Yes, I read that. That’s an advantage of this tool against atop, not a disadvantage.

(“Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.”)

(If you’ve downvoted my comment, I’d love to hear why. I think my question is an entirely reasonable one; every tool has strengths and weaknesses. From the article, I know when I might want to use below; it sounds very useful. I think it would be very useful as well to know should I avoid it in any cases.)

qazxcvbnm··on Below: A time travelling resource monitoring tool (2021)
Is there any disadvantage of this tool against atop?
qazxcvbnm··on First Contact with SQLite
Yes, but you have to write C; I am more confident in SQL, and SQL fits better with the rest of my data stack.
qazxcvbnm··on First Contact with SQLite
How do you typically deal with "missing features" from SQLite (e.g. stored procedures)? Do you use extensions like https://github.com/nalgeon/sqlean in production?
qazxcvbnm··on Show HN: Tab vs. Space, vote for your empty space
Linus must be quite the monster!

> Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

https://www.kernel.org/doc/html/v4.10/process/coding-style.h...

qazxcvbnm··on Tao Te Ching translated by Ursula Le Guin (1997)
I believe the best answer may be to read the original text. Given the style of the text and the mentioned incredibly contextual structure of Classical Chinese, its very difficult to believe a single definitive reading was intended, or even possible.
qazxcvbnm··on As Lovely as a Tree
On trees - how could we neglect the Succinct trees?

Succinctness - expressing trees with as little bits as entropically possible. The representation is as simple as it could be - simply write down nested parentheses whose abstract syntax tree is your given tree. Practically all tree operations in logarithmic or constant time. How it works - recursively with range-min trees and range-max trees - simple and elegant number theory.

A primer - https://arxiv.org/pdf/0905.0768

qazxcvbnm··on Is there ever a good reason to disable swap?
I’ve seen a sentiment expressed widely that disabling swap enables their machines to fail fast when the workload runs out of memory. I would be partial to such behaviour as well, but in my experience, without swap, I’ve more often seen systems run into livelock with the OOM killer unbearably slow in reaping its victims meanwhile I cannot ssh in nor view logs, and that such situations basically disappear on systems where I do have swap enabled.

Of course, with or without swap, I can manually obtain the fail-fast behaviour by using systemd-oomd, oomd, early-oom, but I wonder why the reputation of swap differs so from my experience (for context, I’ve mostly run systems for small medium businesses and machines mostly under twenty gigabytes of RAM).

qazxcvbnm··on The Rate of Return on Everything, 1870–2015 (2019)
Revealed preferences are only as revealing as the market is competitive. In monopolies, is it not revealed that the populace prefers to be price-gouged? In a market as regulated as housing and with deep ties to policy (and industrial structures that I have heard about which I do not understand), it's difficult to not be sceptical of revealed preferences as a sole convincing explanation.
qazxcvbnm··on Ask HN: What macOS apps/programs do you use daily and recommend?
Adding two more indispensible ones for me:

Brightness Control https://www.splasm.com/brightnesscontrol/ The only macOS app that is actually able to properly dim my monitor beneath the lowest brightness setting without hacks like painting an overlay above your desktop such that it blinds my eyes when ever I switch workspaces.

Cursorcerer https://doomlaser.com/cursorcerer-hide-your-cursor-at-will/ Lets me bind a shortcut key to hide my cursor.

qazxcvbnm··on If English was written like Chinese (1999)
Classical Chinese has nounification... very heavily; vernacular, another thing, of course.
qazxcvbnm··on If English was written like Chinese (1999)
The phonology differs. Vocabulary differs. Grammar differs. Speaking Cantonese and Mandarin natively, I have no idea what Hokkien or Sichuan people say, whether or not you write it down.

This is especially apparent when speaking to less educated people with less exposure to the standardised, official Chinese language, which is what people do actually write down when intending for a broader audience, of course. Diglossia is real.

qazxcvbnm··on Grokked Transformers Are Implicit Reasoners
With a quick skim, the paper delivers on its promise. It's not a particularly long or difficult paper to follow.

> Causal tracing. The transformer could be viewed as a causal graph that propagates information from the input to the output through a grid of intermediate states, which allows for a variety of causal analyses on its internal computation

> [...] There are in total three steps:

> 1. The normal run records the model’s hidden state activations on a regular input [...]

> 2. In the perturbed run, a slightly perturbed input is fed to the model which changes the prediction, where again the hidden state activations are recorded. [...] Specifically, for the hidden state of interest, we replace the input token at the same position as the state to be a random alternative of the same type (e.g., r1 → r′1) that leads to a different target prediction (e.g., t → t′).

> 3. Intervention. During the normal run, we intervene the state of interest by replacing its activation with its activation in the perturbed run. We then run the remaining computations and measure if the target state (top-1 token through logit lens) is altered. The ratio of such alterations (between 0 and 1) quantitatively characterizes the causal strength between the state of interest and the target.

> The generalizing circuit. [...] The discovered generalizing circuit (i.e., the causal computational pathways after grokking) is illustrated in Figure 4(a). Specifically, we locate a highly interpretable causal graph consisting of states in layer 0, 5, and 8, [...]. Layer 5 splits the circuit into lower and upper layers, where 1) the lower layers retrieve the first-hop fact (h, r1, b) from the input h, r1, store the bridge entity b in S[5, r1], and “delay” the processing of r2 to S[5, r2]; 2) the upper layers retrieve the second-hop fact (b, r2, t) from S[5, r1] and S[5, r2], and store the tail t to the output state S[8, r2].

> What happens during grokking? To understand the underlying mechanism behind grokking, we track the strengths of causal connections and results from logit lens across different model checkpoints during grokking (the “start” of grokking is the point when training performance saturates). We observe two notable amplifications (within the identified graph) that happen during grokking. The first is the causal connection between S[5, r1] and the final prediction t, which is very weak before grokking and grows significantly during grokking. The second is the r2 component of S[5, r2] via logit lens, for which we plot its mean reciprocal rank (MRR). Additionally, we find that the state S[5, r1] has a large component of the bridge entity b throughout grokking. These observations strongly suggest that the model is gradually forming the second hop in the upper layers (5-8) during grokking. This also indicates that, before grokking, the model is very likely mostly memorizing the examples in train_inferred by directly associating (h, r1, r2) with t, without going through the first hop

> Why does grokking happen? These observations suggest a natural explanation of why grokking happens through the lens of circuit efficiency. Specifically, as illustrated above, there exist both a memorizing circuit Cmem and a generalizing circuit Cgen that can fit the training data [...]

qazxcvbnm··on How to Use JSON Path
As to cross format path querying, I see limited value in such an endeavour; the reason that one deals with such formats is generally because it is used as an interface to configure some tool, but moving across different tools, besides the path queries, even the configuration schemas differ, and having a cross format converter would do you no good. The fact that many such configuration formats support subtly (or drastically) divergent types of objects does this idea no good either.

Speaking of this topic, I would be very interested in a CLI tool that translated between different dialects of regex. As opposed to general data or configuration, I find the case for cross format conversion very compelling for regexes; the objects that different regex languages deal with are functionally completely identical. I would be very happy to be able to craft a regex to search for something in vim, then convert the regex to grep or use another tool on the shell, then perhaps adapt it to some other scripting languages e.g. Javascript/Ruby/Perl.

Indeed I am sad that I am not finding any CLI tools (non web-based) for this beyond https://github.com/Anadian/regex-translator . Am hopeful for more suggestions.

qazxcvbnm··on The File Filesystem (2021)
What happens if your JSON key has a slash?
qazxcvbnm··on How Perfectly Can Reality Be Simulated?
The world is chaotic.

> In chaotic systems, the uncertainty in a forecast increases exponentially with elapsed time.

https://en.wikipedia.org/wiki/Chaos_theory

(The above applies equally to the past)

qazxcvbnm··on Why CockroachDB doesn't use EvalPlanQual
Which of these strategies does Postgres use under Repeatable Read?
qazxcvbnm··on SQL is syntactic sugar for relational algebra
As someone who has implemented a composable SQL generator from user-defined algebras of (arbitrary SQL) queries using relational algebra, I understand the shortcomings of SQL when viewed from an angle of a relational query language.

However, SQL is a language with many facets (DML, DDL, DCL) other than 'relational' querying. Putting on a less mathematical and more engineering mindset, SQL ingratiates me by its interface to incredibly powerful primitives difficult to find anywhere else. (I've primarily worked with Postgres SQL)

Consider the humble function; in SQL https://www.postgresql.org/docs/current/sql-createfunction.h..., one can declare the function as `stable` or `immutable` to let the runtime optimise repeated calls; as `parallel` to let the runtime consider parallelisation, as `cost ...` and `rows ...` to aid optimiser cost estimation. Imagine if one could do that in C or Javascript!

Another facet which regularly puts me in awe is the transaction isolation primitives and locking primitives offered by SQL.

I understand that as a database language, SQL necessarily has these within its specialised niche, but it seems to me these aspects of SQL as an interface to a language runtime would be equally useful in the everyday program; in all these areas of functionality, SQL is so much more advanced than nearly every other general purpose programming language.

qazxcvbnm··on Building a streaming SQL engine with Arrow and DataFusion
Thanks! I was not aware that SQLGlot has this functionality, let me give it a try.
qazxcvbnm··on Building a streaming SQL engine with Arrow and DataFusion
Not exactly on-topic, but does anyone know of SQL-to-SQL optimisers or simplifiers (perhaps DataFusion would be able to do this)? I work with generated query systems and SQL macro systems that make fairly complex queries quite easy to generate, but often times come up with unnecessary joins/subqueries etc.

I find myself needing to mechanically transform and simplify SQL every now and then, and it hardly seems something out of reach of automation, yet somehow I've never been able to find software that simplifies and transforms SQL source-to-source. When I've last looked, I've only found optimisers for SQL execution plans.

qazxcvbnm··on Pipexec – Handling pipe of commands like a single command
It seems to me that this can be achieved by the following bash-native way of creating extra file descriptor pipes:

  pipe_path="$(mktemp -u)"
  mkfifo "$pipe_path"
  exec 3<>"$pipe_path"
  rm -f "$pipe_path"
Here, exec associates the file descriptor (3 here, replace with any desired descriptor) with the pipe created by mkfifo. The filesystem path to the pipe is removed immediately after we obtain a file descriptor to it, so that the the only remaining reference to the pipe in the system would be from this script, and thus when the script dies, the kernel will automatically free the pipe.

An example use case would be like so: https://unix.stackexchange.com/a/216475/585293

qazxcvbnm··on Orthogonal Persistence
> Persistence is Orthogonal to the Data Model, ...

I have some experience with a custom data runtime where the persistence is orthogonal to the data model, with silhouettes reminiscent of the described solutions in many of the features of my system, including multiple orthogonal/model-agnostic persistence backends, automatic data synchronisation, persistable executions, automatable schema changes, automatic reactivity.

This direction can indeed bring about great savings in various parts of development; however, it seems to me that more subtlety than indicated in the post is required.

The programmer must be provided with ergonomic means to give denotations for things like when and where to persist, in order to reduce data movement, and to keep the system performant (this does not violate orthogonality; we may specify e.g. to persist at the logical location, say, in the cloud, without having to specify the physical persistence). For instance, considering the case of schema changes, unless the system bundles its language inside the database, for performance sake, to perform such changes in an "Orthogonal Persistence" system external to the database would take an completely disproportionate amount of time relative to using SQL in the database. The data runtime I work with uses the idea of lenses (where valid lenses would necessarily be reversible) to allow for coherent, undoable schema changes, but I still resort to SQL for regular (eager) migrations (the lenses system for schema changes can still be useful for migrations applied lazily).

← PreviousPage 3 of 6Next →