3,518 karma · joined Feb 20, 2007 (19y ago) · 724 submissions
comment 2d ago · link · parent
What makes you believe that time is irrelevant? If AI allows for breakthroughs in mathematics, science, engineering, computing, and health care—and it does seem to be delivering on this promise so far—what in your estimation is the net cost to humankind of delaying those breakthroughs by even a year? It's not zero, is it?
comment 1w ago · link · parent
Monitor changes also included a return of the mini-assembler, absent since the days of Integer BASIC. It was activated by entering a “!” command in the Monitor, instead of a jump to a memory location as in the older Apple II. Features also added included the ability to enter ASCII characters directly into memory, and an “S” command to make it possible to search memory for a byte sequence. Interrupt handling was also improved. However, the “L” command to disassemble 6502 code still did not handle the new 65c02 opcodes as did the IIc disassembler.
Source: https://www.apple2history.org/history/ah07/#07:~:text=Monito...
comment 1w ago · link · parent
Ancient assembly hacker tip: A JSR/RTS sequence can be simplified to a JMP. To continue your example, the bytes you provided decompile as follows (assuming Apple 2 monitor ROM at $F800):
PRINTBANG:
A9 21 LDA #$21
20 F0 FD JSR COUT1
60 RTS
So, you load the A register with #$21, which is the ASCII code for `!` in hexadecimal, and then call COUT1 which will output the character in the A register, printing the exclamation point. When COUT1 is finished, it will return to you using an RTS instruction, and then you'll return to your caller using another RTS instruction.Since the call to COUT1 is a tail call, you can borrow its RTS instruction to return to your caller and save one instruction. So the following code is equivalent to yours but a little bit smaller and faster:
PRINTBANG:
A9 21 LDA #$21
4C F0 FD JMP COUT1
Notice that the JSR instruction has become a JMP.Another related trick: When you have a routine that callers often want to call twice—say to print `!!` for extreme exclamations—you may be tempted to create a do-it-twice call:
PRINTBANG2:
20 00 03 JSR PRINTBANG
20 00 03 JSR PRINTBANG
60 RTS
But now we know better and code it this way: PRINTBANG2:
20 00 03 JSR PRINTBANG
4C 00 03 JMP PRINTBANG
But we can do even better! We can eliminate the jump and save three more bytes by placing our do-it-twice routine immediately before the routine it is calling: PRINTBANG2:
20 03 03 JSR PRINTBANG
PRINTBANG:
A9 21 LDA #$21
4C F0 FD JMP COUT1
When PRINTBANG2 is called, it calls PRINTBANG to print an exclamation point, but when PRINTBANG returns, it returns to PRINTBANG2, which promplty falls through to PRINTBANG, calling it again and printing a second exclamation point. This time, however, when PRINTBANG returns, it will return to the original caller.Back when every byte mattered, these tricks were useful to know.
comment 1w ago · link · parent
Yeah, Poisson distributions show up everywhere if you are paying attention. You can even use the theory as the basis for a fast, elegant algorithm to take parallel, weighted random samples. You can even do it in SQL!:
SELECT *
FROM Population
WHERE weight > 0
ORDER BY -LN(1.0 - RANDOM()) / weight
LIMIT 100 -- Sample size.
For more on the Poission connection, see: https://blog.moertel.com/posts/2024-08-23-sampling-with-sql....comment 3w ago · link · parent
Groff currently uses a greedy algorithm to format paragraphs one line at a time, but the Knuth-Plass algorithm, implemented in TeX, Heirloom troff and elsewhere, optimizes linebreaks throughout whole paragraphs and achieves a more uniform typographic grey. One of the most exciting challenges facing groff will be implementing an improved formatting algorithm, the most likely candidate being Knuth-Plass. It’s a big job, but with groff’s clean codebase and helpful community of experts, it is hoped additional developers will step forward and contribute their programming skills.
Equally important will be instituting native support for TrueType, Open Type, and other non-Type1 PostScript fonts, and improving Unicode support.
Source: https://www.gnu.org/software/groff/groff-mission-statement.h...
7.
GDPx: Measuring Frontier Model Capabilities Across the Most Valuable Domains(newsletter.semianalysis.com ↗)
3 points · by tmoertel · 3w ago · discuss
comment 3w ago · link · parent
For epubs, right now I'm using Pandoc: https://pandoc.org/epub.html. But, again, that's just now for the writing and proofing stages. For final output, I'll consider my options. (I may still go with Pandoc, but right now I'm using it because I was already using it for typesetting and so it was a low-friction choice.)
comment 3w ago · link · parent
> The text of this book is set in Times Roman; headings are Helvetica; examples are Courier. Text was prepared using the troff text formatter and the devps PostScript filter. Figures are produced with a Macintosh. Printing is done on an Apple LaserWriter.
comment 3w ago · link · parent
comment 3w ago · link · parent
comment 3w ago · link · parent
When I started writing fiction, here’s what I came up with. I write in Google Docs because it’s lightweight, works everywhere, and can easily export to Markdown format. From there, I manage the Markdown source in Git and Emacs. For typesetting—I cannot abide crappy word-processor output—I used to use Pandoc to generate LaTeX markup and run LuaLaTeX to produce PDFs. But that took several seconds. Now, I use Typst to go straight from Markdown to PDF files. It’s pretty much instant.
If you want to see what the output looks like, here’s the first chapter of my current project:
https://drive.google.com/file/d/1Wl4k_rdYGFZp-r5nq864r5CNzD1...
(Notice: This is a typesetting sample, not a writing sample. It’s my W40k-adjacent fanfic, so you have been warned.)
It’s set in 12pt Erewhon, which is an enhanced version of Andrey V. Panov’s Heuristica font family, which extends Robert Slimbach’s Utopia font family. Slimbach is a sublime type designer—he created Minion—and Utopia is one of his early works that is especially spirited.
comment 3w ago · link · parent
comment 2mo ago · link · parent
> Not being able to specify how ties are handled (and choosing, as far as I can tell, a fairly useless definition) fits the bill.
Actually, you can completely specify how ties are handled—and should, in any study designed to be repeatable. The docs for dplyr::ntile tell us that:
> To rank by multiple columns at once, supply a data frame.
So, repeatable, completely specified tiebreaking is as easy as adding a tiebreaker column to the dataset, using whatever strategy makes sense for your study. For example, if we wanted random tiebreaking using R's built-in `runif`, all it takes is one extra line of code:
data_table |>
dplyr::mutate(
tie_breaker = runif(dplyr::n()),
ntile_bin = dplyr::ntile(tibble::tibble(partitioning_key, tie_breaker), n = 4))
Almost 100% of the original author's problems could have been avoided by just reading the docs.comment 2mo ago · link · parent
> Unlike other ranking functions, ntile() ignores ties: it will create evenly sized buckets even if the same value of x ends up in different buckets.
comment 2mo ago · link · parent
But you do need homogenous coordinates if you want to include translations (fixed distance shifts, such as moving the camera) in the set of operations you can represent as linear transformations and thereby gain all the benefits of linear algebra, including the benefit of being able to include them in a series of operations that you can represent with a single transformation matrix.
comment 2mo ago · link · parent
Consider a transformation f where we wish to move x-y coordinates s units to the right. In 2d, we could express it as:
f(x, y) = (x + s, y)
But that transformation is affine not linear. There is no way to generate the value s as a linear combination of the inputs x and y. So, our workaround is to embed the x-y plane into 3d space at z=1. Then we can move (x,y,1) points in that plane s units to the right using this transformation:
f(x, y, z) = (x + s*z, y, z)
This new transformation is linear: it maps (0,0,0) to itself. But it maps our embedded 2d plane's origin (0,0,1) to (s,0,1), shifting it right by s units, as we want.
The matrix form of that transformation is:
[[1 0 s]
[0 1 0]
[0 0 1]]
The same scheme would work if we had embedded the plane at any fixed z=r for nonzero r. We would only have to rescale the s in the matrix to s/r. Again, however, if r=0, this scheme will not work, as 1/r has gone to infinity.comment 2mo ago · link · parent
comment 2mo ago · link · parent
comment 3mo ago · link · parent
So, until the ultimate query language is developed, I'll take SQL with pipes. It's an easy sell and good enough to eliminate 90% of my gripes about SQL.
comment 3mo ago · link · parent
I will give you approximately twenty delightful novels where the prose and the stories are both excellent: Patrick O’Brian’s Aubrey–Maturin series.
I avoided these books for the longest time because I didn't believe I was the kind of person who would read “books about tall ships.” But so many people recommend these particular books because of the masterly writing that I tried the first, Master and Commander. Immediately, I was taken by O’Brian’s writing: vivid, lively, and engaging, while also utterly precise.
Give that first novel a try. It’s not easy, but it is oh so rewarding.
Edited to add some examples from the first novel:
“I have never yet known a man admit that he was either rich or asleep: perhaps the poor man and the wakeful man have some great moral advantage.”
“Where there was no equality there was no companionship: when a man was obliged to say ‘Yes, sir,’ his agreement was of no worth even if it happened to be true.”
“He held up two fingers, in case a landman might not fully comprehend so great a number.”
“But you know as well as I, patriotism is a word; and one that generally comes to mean either my country, right or wrong, which is infamous, or my country is always right, which is imbecile.”
comment 3mo ago · link · parent
Yes. When people make mistakes, they sometimes fall into holes that are hard to climb out of. It is in society’s interest to place ladders in these holes so that these unfortunate people can climb out and become productive members of society.
Instead, we have self-interested parties who have figured out how to extract rents from keeping people trapped in holes. Some of these parties are preventing ladders from being built. Others are destroying existing ladders. Others still are even inventing deeper, stickier holes—crypto scams, ubiquitous gambling, addictive gas-station drugs, dopamine-hit apps—to trap even greater numbers of their fellow human beings.
When a society allows the suffering of others to become a profitable business model, good things rarely follow.
comment 3mo ago · link · parent
Pittsburgh has most of the benefits of a larger city without most of the problems. Its infrastructure is in many ways over-provisioned, being built for past industry and a larger population (but the maintenance burden is catching up). Its unusually hilly and berivered geography has allowed its neighborhoods to escape homogenization and retain their individual ethnic characters. And the setting, with rivers, bridges, trails, forests, is beautiful. Plus the airport recently got overhauled to meet the region’s actual needs, making it way more convenient.
Oh, if you're in to sports, Pittsburgh has some great teams and a great fan base.
Yeah, I like the ’Burgh.
comment 3mo ago · link · parent
The tragedy is that we could have a society that gives people more opportunities to escape the downward pull of chance gone wrong early in life. Maybe someday we'll get there.
comment 3mo ago · link · parent
And, yep, it's worth a read.