HNHacker News
TopNewBestAskShowJobs

mci

1,307 karma · joined July 2, 2015

submissionscomments
mci··on Emotion concepts and their function in a large language model
The first and second principal components (joy-sadness and anger) explain only 41% of the variance. I wish the authors showed further principal components. Even principal components 1-4 would explain no more than 70% of the variance, which seems to contradict the popular theory that all human emotions are composed of 5 basic emotions: joy, sadness, anger, fear, and disgust, i.e. 4 dimensions.
mci··on Show HN: Latex-wc – Word count and word frequency for LaTeX projects

  detex "$@" | wc
  detex "$@" | tr -cs '[:alnum:]' '\n' | grep . | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -rn
mci··on Board Games in Ancient Fiction: Egypt, Iran, Greece
Interesting. Apion's description of the pessoi game mentioned in the Odyssey: flicking pebbles toward the Penelope-pebble convinces me more than translating pessoi as draughts. The problem with Apion's description is:

- There were 108 suitors (we know this from the Odyssey 16.245-254 [1]).

- All that Homer told us is: They were gladdening their hearts at pessoi in front of the doors, sitting on the hides of oxen which they themselves had slain (the Odyssey 1.106-108 [2]).

- You can't have 108 sitting men play the same game of marbles.

IMHO, pessoi was a 1:1 game and it was not a board game.

[1] https://www.perseus.tufts.edu/hopper/text?doc=Hom.+Od.+16.24...

[2] https://www.perseus.tufts.edu/hopper/text?doc=Hom.+Od.+1.106...

mci··on The Tonnetz
A recent blog post on thatsmaths.com was about Tonenetz, a diagram of harmonic relationships of notes. Tonenetz means 'tone network' in German :-)
mci··on Rupert's Property
He is also known from prince Rupert's drops.

https://en.wikipedia.org/wiki/Prince_Rupert%27s_drop

mci··on An interactive guide to sensor fusion with quaternions
> a quaternion is a 4D representation of a rotation in 3D space

A unit quaternion represents a rotation in R³.

A quaternion represents the quotient of two vectors in R³. That's what Hamilton had in mind.

mci··on Cracovians: The Twisted Twins of Matrices
I took the liberty to replace my awkward wording with your "the result in column i and row j is the sum of product of elements in column i of the left cracovian and column j of the right cracovian". Hope you don't mind. Thanks!
mci··on Cracovians: The Twisted Twins of Matrices
Author here. There are no practical advantages, as far as I know. Not even faster multiplication on today's computers.
mci··on Cracovians: The Twisted Twins of Matrices
Thanks for the feedback, everyone. I pasted my Polish text into Gemini to translate it into English. Gemini hallucinated the translation of this example. Now it should be OK.
mci··on Virality in cartography: What makes a map go viral?
My map of the most frequent occupational surnames in Europe [1] also went viral in 2015. When I posted it on Reddit, newspapers from Ireland (they asked me for permission to reprint it) to Greece (nobody else asked) and countless people on Facebook republished it. Well, everybody has a surname, an occupation, and a country.

Late advice: when making a viral image, put your URL on it :-)

[1] https://marcinciura.wordpress.com/2015/09/17/smiths-millers-...

mci··on Tao Te Ching translated by Ursula Le Guin (1997)
> If you all pardon an off topic digression...

IMHO, Euclid's definition of a straight line in today's terms would be "a line that has the same direction on its entire length". His definition of a plane angle would be "a plane angle is the difference between the directions of two straight lines that have a common end in one point".

What are Playfair's and Hilbert's definitions?

mci··on A flat map with the least error possible: The Gott-Goldberg-Vanderbei projection
If your metric is the length of the land that the map boundary cuts, then the best centre lies somewhere in the Indian Ocean. Proven here: [1]

[1] https://marcinciura.wordpress.com/2015/11/17/slicing-earth-c...

mci··on SI Units for Request Rate
How about a third unit, baud [1]? It looks no worse than hertz to me:

In telecommunication and electronics, baud (/bɔːd/; symbol: Bd) is a common unit of measurement of symbol rate, which is one of the components that determine the speed of communication over a data channel. It is the unit for symbol rate or modulation rate in symbols per second or pulses per second.

[1] https://en.wikipedia.org/wiki/Baud

mci··on A Brief History of Tricky Mathematical Tiling
I invented a game that uses tiles in the shape of a regular hexagon plus a rhombus. IMHO, you can tile the plane aperiodically with them. See the first picture in [1].

[1] https://marcinciura.wordpress.com/2023/10/14/orinoko/

mci··on Are any words the same in all languages?
My two candidates are pepsi and amen. Coke is known as coca-cola where I live.
mci··on XHTTP: An HTTP server library in a single C file
Also overlaps with mongoose.{c,h} (GPL; not the MongoDB Mongoose) and its fork CivetWeb (MIT license).

https://github.com/cesanta/mongoose

https://github.com/civetweb/civetweb

mci··on Wanderwort
> what word was used for the color orange

I once answered this question for Polish [0]:

1. Find the Latin word for the color orange: "luteus".

2. Find Polish words corresponding to the Latin word in a scanned Latin-Polish dictionary from 1644.

3. Find Latin words corresponding to the Polish words in the Polish-Latin volume of the dictionary.

4. If new words found, GOTO 2

The main answer was "fawn", the color of deer. Besides "yellow-red" and "red-yellow", other words were based on red pine mushroom [1], fox, honey, fire, saffron, and gold.

[0] https://oslowach.wordpress.com/2018/11/17/jak-sie-przedtem-n...

[1] https://en.wikipedia.org/wiki/Lactarius_deliciosus

mci··on Uthash – C macros for hash tables and more
See also David Hanson's book C Interfaces and Implementations [http://drh.github.io/cii/toc.html].
mci··on Literate programming is much more than just commenting code
IMHO, attempts to show literate programming on screen are doomed to meet with mediocre success. DEK invented literate programming with printed books in mind. I dare say that the only successful literate programs are books printed on paper.

First, in a printed book, it is easier to find a previous page and compare a fragment on it with the current fragment. Second, a printed book has no links tempting you with the words "CLICK ME" to disrupt the flow so you can read it from cover to cover with fewer distractions. Third, anecdotally, I can see flaws much easier on a printout than on screen, both in programs and in texts.

mci··on Show HN: Improve your Python regex skills with 75 interactive exercises
I like it! Here is a gotcha my students stumble on. I have not noticed it while skimming your book: ^ and $ do not have special priorities. To match alternatives, write ^(abc|def)$, not ^abc|def$
mci··on ContractPatch
Here is a belated reply to your comment about the python-cf library.[0] My top-level comment[1] does not present its use cases well. While you can compute the billionth digit of π with continued fractions, other methods suit this task better. The library caters to those who need much fewer significant digits. Such users can rely on the result undisturbed by numerical errors, as illustrated by the iterated logistic map in my slides[2].

Happy New Year! :)

[0] https://news.ycombinator.com/item?id=25266072 [1] https://news.ycombinator.com/item?id=25263435 [2] https://marcinciura.files.wordpress.com/2019/10/cf-slides.pd...

mci··on Write your own arbitrary-precision JavaScript math library
This discussion would really go better if you followed the links. See lines 92–96 of cf.py:

      By the
    # Gauss-Kuzmin theorem [5, 6], a partial quotient in the
    # continued fraction expansion of almost every number exceeds
    # 1e+31 with probability log2(1+1e-31) =~= 1e-31/ln(2) =~=
    # 1.5e-31.
mci··on Write your own arbitrary-precision JavaScript math library
Thanks, "dynamic" is a good term. "Very large" would not describe it well: for non-contrived irrational numbers, the chance of an improper rounding to a rational is much smaller than the chance of a meteorite strike in your room within the next five minutes (slide 60).
mci··on Write your own arbitrary-precision JavaScript math library
See slides 43–60 and 72. A node emits ∞ as the partial quotient after 100 resultless iterations. The threshold is configurable. In particular, see lines 184–187 of cf.py:

    # Idealistically inclined folks, who would prefer their
    # computations to hang rather than to yield a heuristic result,
    # can achieve this effect by setting accuracy to a negative
    # value.
mci··on Write your own arbitrary-precision JavaScript math library
If you do not care about speed, you can get not arbitrary-precision (static number of significant digits, set upfront) but exact (dynamic number of significant digits, as large as you wish) results. Under the hood, your expressions will be directed acyclic graphs of lazy generators, each generator coresponding to a mathematical operation or function.

Here is a Python library that employs continued fractions to this end: [0]. You can pull successive partial quotients of the result from the root node of the dag. Whenever any node needs more precise input to deliver more precise output, it pulls a partial quotient from its argument(s).

Full disclosure: I wrote the original version of the library 13.5 years ago. Here are the slides from my talk about it: [1].

[0] https://github.com/AdamPrzybyla/python-cf

[1] https://marcinciura.files.wordpress.com/2019/10/cf-slides.pd...

mci··on Chess tactics explained
> After learning simple piece development and basic checkmating techniques, it's tactics, tactics, tactics.

Fair enough, tactics is fun, pretty, and rewarding. I like it, too, and do not advocate avoiding it. But if any of their games lasts till the endgame, it is usually the principles not the tactics that contributes to the victory.

> Modern chess engines have evolved towards simpler, faster evaluations

Alas, modern humans do not undergo Moore's law so your analogy to computer chess can as well be turned upside down: we ought to improve our evaluation function if we want to play better with the limited resources of our brain.

mci··on Chess tactics explained
> and if they were we would no longer be in disagreement.

I tried to explain my (perhaps unorthodox) understanding of strategy and tactics in the last paragraph of my grandparent comment.

EDIT: Now I can see that I was framed into the tactics:strategy dichotomy by the answers to my top-level comment. To get a better verbalisation of my ideas, replace "strategy" with "principles" in all I wrote.

mci··on Chess tactics explained
> if you leave your pieces vulnerable to tactics that your opponent can find and you can't, then it's all for nought.

In my book, {avoiding hanging pieces, placing your pieces so that the opponent cannot pin them} ⊂ strategy, being wary of forks ∈ tactics.

mci··on Chess tactics explained
Thanks for the reply. Since you are the second person who understands the opening theory as a subset of strategy (an alien notion to me), I added a clarification to my post.
mci··on Chess tactics explained
Thank you for the reply. I do not advocate "remembering all the 15 length opening sequence" either.

> A Primer of Chess and Nimzowitsch's My System are targeted for IM/GM.

This is an interesting assertion. How about you take a peek into either book?

Page 1 of 4Next →