HNHacker News
TopNewBestAskShowJobs

papercrane

1,797 karma · joined February 19, 2009

submissionscomments
papercrane··on Vector indexing all of Wikipedia on a laptop
If you don't mind using a preview feature you should be able to use the foreign function API to call mlockall without any unsafe code.

Otherwise, JNA is probably the easiest way, and how Cassandra does it.

https://docs.oracle.com/en/java/javase/21/core/calling-c-lib...

https://github.com/java-native-access/jna

papercrane··on Depression (2014)
They also helped preserve Stephen Hawking's voice. Their emulator included an extremely accurate emulator for one of the DSP chips used in his voice machine. Th code was used when Hawking's original voice machine was failing.

https://news.ycombinator.com/item?id=21026000

papercrane··on Sam Altman on opeanai non disparagement exit clause
Not a lawyer, but "general release of claims" seems like a term of art which I would expect to be a something that would waive your right to sue, and not an agreement that includes a non-disparagement clause.
papercrane··on The USDA's gardening zones shifted, this map shows you what's changed
The term "climate change" usage had a PR person behind it. Republican strategist Frank Luntz pushed for politicians to use the term instead of "Global warming" has it sounds less severe.

The term is often misattributed to Luntz, but it existed before him.

papercrane··on NYU professors who defended vaping didn't disclose ties to Juul
I'd be interested to see actual data on that. For example, a Canadian study done after a year of legalization found that more youths tried marijuana, but that they were trying it later than average and the overall usage of cannabis among youth remained the same. Interestingly, there was also an increase to the perception of harm from using cannabis among the youth surveyed.

https://doi.org/10.1016/j.jadohealth.2022.09.003

papercrane··on Lithium-free sodium batteries exit the lab and enter US production
I don't think it's feasible to store your summer excess long term like that. It would be cheaper to add more panels to produce enough power in the winter and having enough battery capacity to last you a few days in case of bad weather.
papercrane··on Google workers fired for protesting Israeli contract file NLRB complaint
At will employment doesn't matter here. Even with at-will employment it is illegal to fire employees for some reasons. For example, it's generally against the law to fire employees for discussing their work conditions.

I think the employees will have a difficult case here, but it is conceivable that some of them might. For example I could see the NLRB ruling in favor of an employee who was fired after for expressing concern about a project with Israel, but I think the employees who staged a sit-in probably don't have a case.

papercrane··on Google surpasses $2T market cap
All the money investors have gotten from Google has been in capital gains (i.e. buying low, selling high). There's nothing illegal or nefarious about that. In fact, it's extremely common, most stock investors gains will be from the underlying equity increasing in value. Dividends are just distributions that the company pays from it's available cash.
papercrane··on Solving the minimum cut problem for undirected graphs
Since the AoC specifies the min-cut for you I found it was simpler to take advantage of that.

I picked two random vertices and found the shortest path between them 3 times, cutting each vertex after each iteration. If after doing that I couldn't find a path between the two vertices then I had successfully partitioned the graph in two. Otherwise that meant I picked two vertices in the same partition and I reset the graph and randomly picked a different vertex.

Ended up being very quick to run, and easy to implement.

papercrane··on The $10k BYD Seagull EV is scaring the U.S. auto industry
They're already looking to enter the Mexican market. Publicly they say this is to supply the Mexican market, and not export to the USA. It will be interesting to see if/when that changes.

https://www.reuters.com/business/autos-transportation/chines...

papercrane··on Airbnb bookings for the solar eclipse reach astronomical levels
Life expectancy decreasing seems to have an obvious answer. We just had a pandemic.
papercrane··on Phytomining – Extracting Minerals via Plants
Iron is widely distributed across the globe. Nearly all soil will have some iron in it. I'm actually in PEI right now to watch the eclipse, and the soil here is famous for it's red colour caused by the high iron-oxide content.
papercrane··on Terraform makes carbon neutral natural gas
My guess is that the answer is taking advantage of existing NG infrastructure.
papercrane··on Supreme Court unanimously rules against government in No Fly List case
The issue in Sweden is that he didn't have enough evidence to convince Sweden that he was arrested and tortured at the behest of the American government. Since he was on the no-fly list no air carrier would take him as a passenger, so Sweden's only options were to keep him or fly him in a private jet.

https://www.wweek.com/portland/blog-31874-swedish-government...

papercrane··on Vegetable stock: my secret lover (2011)
A more viscous sauce will adhere to the food it's on better and feels different in your mouth. Most people would describe it as "richer".
papercrane··on The Pile is a 825 GiB diverse, open-source language modelling data set (2020)
You've got it backwards. The judge in Silverman et al dismissed the claims asserting that OpenAIs output is copyright infringement. The claims for copyright infringement in the training data are still going forward, that will directly test whether it is "fair use" or not.

From the ruling:

> Assuming the truth of Plaintiffs’ allegations - that Defendants used Plaintiffs’ copyrighted works to train their language models for commercial profit - the Court concludes that Defendants’ conduct may constitute an unfair practice.6 Therefore, this portion of the UCL claim may proceed.

https://caselaw.findlaw.com/court/us-dis-crt-n-d-cal/1158180...

papercrane··on Java is becoming more like Rust, and I am here for it
Record types in Java were added with Java 14, released March 2020, it was later that year, in November, that C# added them with C# 9.0.

I don't believe C# has anything like the exhaustive switch over a sealed interface that the article is talking about.

papercrane··on The lithium-ion battery may not be the best bet for EVs
What the study actually says:

> current Li-ion cell, primary data were used in this study resulting in 50,8 kg CO2eq/kWh in the WCS and 30,9 kg CO2eq/kWh in the BCS.

From the context in the study it's clear they're talking about capacity.

papercrane··on BYD launches $15,000 EV
There are reports that they're looking to build a factory in Mexico. Likely for that very reason, as then they should be covered by the US-Canada-Mexico free trade agreement.
papercrane··on Russian troops use Starlink licensed and imported from Dubai
Spoofing is possible, and Russia is known to use it. But it's unlikely they'd use it here. Spoofing is pretty indiscriminate, so nearby devices would also be affected, and as another commenter pointed out the device knowing it's location is important for it to connect to the network.

https://www.nbcnews.com/news/vladimir-putin/russia-spoofing-...

papercrane··on Across the country, houses of worship are going solar
Most flat roofs aren't really flat. They're built with a slight slope, I think it's a 2% slope, or 1/4" for every 12", towards a drain.
papercrane··on One Billion Row Challenge Shows Java Can Process 1B Rows File in 2 Seconds
> although for some reason Gunnar's baseline is slower. Maybe I'm doing something wrong.

I suspect it's because the baseline code is adding each line to a TreeMap before processing, effectively sorting 1B rows and then processing them. Your code reduces to the 413 unique stations and then sorts those.

I feel like Gunnar purposefully wrote the baseline with lots of room for improvement to encourage participation.

papercrane··on One Billion Row Challenge Shows Java Can Process 1B Rows File in 2 Seconds
All the sub-2 second ones are. There is an impressive 3.2s solution that uses neither AOT or Unsafe. It's using the in-preview foreign memory and vector operations APIs. Browsing the solutions it looks like that the Unsafe solutions are winning because Unsafe lets them bypass bounds checks.

The current fastest safe version: https://github.com/gunnarmorling/1brc/blob/main/src/main/jav...

papercrane··on Dumping Firmware for fun and learning [pdf]
It's an IC test clip. I believe this is the one pictured: https://www.sparkfun.com/products/13153
papercrane··on Canadian man stuck in triangle of e-commerce fraud
In Canada we have the right to be tried in a reasonable amount of time. The Supreme Court of Canada put strict time limits in place in R. V. Jordan.

For cases without a preliminary inquiry (which this would be) the Crown has 18 months from the arrest to bring the case to trial. For cases with a preliminary inquiry it's 30 months.

Since he was arrested April 2022 that means he must be tried before the end of 2024, or the charges withdrawn.

papercrane··on Canadian man stuck in triangle of e-commerce fraud
> how did the scammer know that the guy ordered the stuff in the first place?!

The idea is the scammer is the seller on Amazon. So the guy orders from Amazon Marketplace, the Marketplace seller uses a hacked Wal-Mart account to fulfill the order and pockets the cash from Amazon.

papercrane··on Canadian man stuck in triangle of e-commerce fraud
If charges are withdrawn or dismissed, as long as you don't have any convictions on record and there isn't a public safety concern you can request the destruction of non-conviction information from your record.

It's silly that you need to request it, but there is a process to expunge your record.

papercrane··on Canadian man stuck in triangle of e-commerce fraud
> If the charges go nowhere, the record of the arrest and charge remains on the public record forever.

This isn't necessarily true. It's dumb that it's not automatic, but you can request in the destruction of non-conviction information.

papercrane··on We switched to Java 21 virtual threads and got a deadlock in TPC-C for Postgres
Curious if you considered switching to a different connection pooling library. These days I usually use HikariCP which is fast an actively maintained. c3p0 hasn't had any activity for years, I'm not sure if it's still maintained.
papercrane··on We switched to Java 21 virtual threads and got a deadlock in TPC-C for Postgres
The issue here is currently virtual threads don't work well with the 'sychronized' keyword. Right now synchronized will pin the carrier thread. The fix was to switch to a higher-level abstraction that works with virtual threads.

My understanding is there is work to make synchronized not pin the carrier thread, but that's some pretty complex and important code to change.

← PreviousPage 4 of 16Next →