Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tmoertel
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
271.
▲
by
tmoertel
2y ago
I think the Resource Manager was designed with the "objects" in mind being understood to be an application's assets, such as code, graphics, menus, text, and so on. My abuse was to extend this to arbitrary, dynamically alloca
272.
▲
by
tmoertel
2y ago
This would have been in the early 1990s, I'd guess. EDIT: I just checked the sources: it was mid 1993. Back then, a Macintosh Classic II would have been a common machine and shipped with 2 MB of RAM. Older machines often had only 1 MB
273.
▲
by
tmoertel
2y ago
Confession: Back in the day, before Macs had a real virtual memory system, I abused the Resource Manager and a file's resource fork to serve as a crude VM for an object management library I created so that I could write apps that used
274.
▲
by
tmoertel
2y ago
As a programmer writing OS-level utility software for Macs back in the day, I stumbled across one of the MS-preservation hacks in Mac OS. I wrote about it here on Hacker News twelve years ago: https://news.ycombinator.com/it
275.
▲
by
tmoertel
2y ago
You can always make your own sports drink, starting with the recipe from the World Health Organization: https://www.who.int/publications/i/item/WHO-FCH-CAH-06.1 Just 4 ingredients: Glucose, anhydrous (dextros
276.
▲
by
tmoertel
2y ago
I once wrote an OS hack to drive a friend crazy. This was back in the early 1990s when we worked at a company making Macintosh utility software. My friend, another coder, liked to arrange his Finder windows so that they reflected the underl
277.
▲
by
tmoertel
2y ago
Can `greetWithAge` be implemented using `greet`?
278.
▲
by
tmoertel
2y ago
As I wrote in an earlier comment [1], you can take a sample in two parts, and the first part is the only one that needs to do a scan and, even then, if you index your weights (or are using a column store like Parquet), this scan can be very
279.
▲
by
tmoertel
2y ago
As I mentioned in the "Tricks for faster samples" [1] section of the article, you can take a sample in two parts: (1) identify the rows in the sample and (2) read the data you want for the rows in the sample. Only Part 1 requires
280.
▲
by
tmoertel
2y ago
> But only when operating on fields that are indexed. No, even without indexes, you only need O(N) memory to find the top N records under any ordering, including on random sort keys. You do have to examine every row, but if you are usi
281.
▲
by
tmoertel
2y ago
All of your `created_at` epoch times are going to be of similar magnitude, since they’re all about the same relative distance from the start of the epoch (usually 1970-01-01T00:00:00). So if you use them as weights directly, you’re in effec
282.
▲
by
tmoertel
2y ago
Yes, to sample a population, you must consider every row in the population. There's no way around it. But it doesn't have to be as slow and expensive as reading the entire population table. To determine which rows are in the sampl
283.
▲
by
tmoertel
2y ago
The weights just indicate how important each row is to whatever you’re trying to estimate. Sometimes, your datasets will have numeric columns that naturally suggest themselves as weights. Other times, you may have to create weights. For exa
284.
▲
by
tmoertel
2y ago
Yes, rhymer has hit on the primary tradeoff behind Algorithm A. While Algorithm A is fast, easy, and makes it possible to sample any dataset you can access with SQL, including massive distributed datasets, its draws from the population are
285.
▲
by
tmoertel
2y ago
Actually, on most modern SQL systems, especially those that deal with large datasets, the `ORDER/LIMIT` combination is implemented as a `TOP N` operation that consumes only O(N) memory.
286.
▲
by
tmoertel
2y ago
Yes, except that it avoids the possibility of a floating-point error. In most SQL implementations, `RANDOM()` can return zero, but the log of 0 is undefined. From the article: > One last numerical subtlety. Why do we generate random numb
287.
▲
by
tmoertel
2y ago
Generally, table scans dominate the cost of sampling, so evaluating a "slow" function once per row doesn't matter. What does matter is whether you can push filtering expressions down into the scans to eliminate I/O and d
288.
▲
by
tmoertel
2y ago
Indeed. On systems with unfortunate evaluation semantics for `RAND`, you can generate fresh random values for each row by creating a function for that purpose and calling it on the primary key of each row. I provide one example in the artic
289.
▲
by
tmoertel
2y ago
Hey! I'm tickled to see this on HN. I'm the author. If you have any questions, just ask. I'll do my best to answer them here.
290.
▲
by
tmoertel
2y ago
In some cases, unit tests can both test and specify the semantics of the system being tested. My favorite example is the ReadP parsing library for Haskell. The source code ends with a short and automatically testable specification of the
291.
▲
The Print Shop
(theprintshop.club)
1 points
by
tmoertel
2y ago
|
0 comments
292.
▲
by
tmoertel
2y ago
Chris discusses the rationale in his blog post at https://chrisdone.com/posts/hell/
293.
▲
by
tmoertel
2y ago
Just a note that "stratification" as described in this article is not what is traditionally meant by taking a stratified sample. The article states: > Stratification lowers variance by making sure that each sub-population is sa
294.
▲
by
tmoertel
2y ago
For those tricky situations, there's "sledgehammer and review" and the second-order git-diff trick: https://blog.moertel.com/posts/2013-02-18-git-second-order-d...
295.
▲
by
tmoertel
2y ago
From the referenced doc: > CTR is basically how many people see our thumbnail in their feeds divided by how many that click it. That's actually 1/CTR. Another example of math fluency not being required for success at the top.
296.
▲
by
tmoertel
2y ago
Are you sure? Consider that one of the common ways that trademarks become "revoked" is that a third party files to have it canceled because they are trying to register the trademark for themselves: > Petitions to cancel based o
297.
▲
by
tmoertel
2y ago
I use a Cafelat Robot in the USA, and I agree it's great. The workflow is simple and streamlined, yet it affords a high degree of control.
298.
▲
by
tmoertel
2y ago
> There is no such obligation. Yes, if you don't enforce a trademark you can lose it... Your second sentence kinda refutes the first, doesn't it? I mean, if your company gets a cease-and-desist demand from the owners of the Chi
299.
▲
by
tmoertel
2y ago
My understanding is that another company owned the Chili Crunch trademark and took enforcement action against David Chang's company when it started selling products under that name. As part of the settlement, Chang's company ended
300.
▲
by
tmoertel
2y ago
> 60-100 events per minute Do you mean per hour?
More ›