HNHacker News
TopNewBestAskShowJobs

jewel

1,988 karma · joined May 22, 2011

Just another programmer
submissionscomments
jewel··on In Defense of RAM
Memory compression (via zswap) has made a big difference for me, on Linux, when on a constrained device. It makes a lot of sense for desktop workloads where most time is spent waiting for user input. For me it was a lot faster than swapping to disk, although with NVME drives that may no longer be the case.

I thought I had read when the M1 came out that they had memory compression turned on by default but I'm not an Apple user.

jewel··on Memories from old LAN parties
The disk cache is what lets the second one catch up. It would only happen if the copies were started at nearly the same time; soon enough that what's been copied so far is still in the cache.

I've observed this same behavior on modern operating systems with big rsync jobs and spinning drives. If you have lots of small files then reading the metadata and directory structure takes a while but fits in the cache, so a second rsync will catch up very quickly to the first.

jewel··on Reaching the Unix philosophy's logical extreme with WebAssembly
Sure! Here's an implementation of nand and a 2-bit adder that uses it: https://github.com/jewel/nand
jewel··on Why does all() return True if the iterable is empty?
> SQL NULL can't be far behind.

SQL's NULL is far more useful though, since NULL != NULL. That lets you do things like join two tables with a column and not have the NULLs match.

Consider, for example:

    select * from users where id = null;
That will give 0 results, even if somehow you have a user with a null id.

It's also really nice for non-ID, non-reference fields to represent N/A. For example, user.birthdate can be NULL if the birthdate is not known.

SQL also lets you choose when you want NULL to be allowed for a column, so it's less likely to be a gotcha.

jewel··on Ask HN: Please stop sharing paywalled links or alike?
This has been an issue discussed for a long time. See https://news.ycombinator.com/item?id=10178989, as linked to from https://news.ycombinator.com/newsfaq.html, for some context as to why things are the way they are.

I personally agree with the decision. The discussion generated is still valuable even when I can't read the whole article. A lot of the paywalled sites are generating content that's more valuable than the average blog, which is why they're able to survive behind a paywall to begin with.

jewel··on The FCC wants to regulate broadband data caps again
I hate caps because they don't reflect the underlying reality of the way the backbone works. I run backups in the middle of the night when the lines are otherwise idle. This is also true of data plans for cell phones which have X GB of 5G data then unlimited 3G data.

Caps discourage people from using too much and making the network slow for everyone and/or very expensive to run. It'd be great if, instead, bandwidth was prioritized based on usage each month. So the really heavy users that cause problems for everyone else will run slowly during the day but still can be fast at night.

Ideally there would be a way to mark streams as low-priority in a way that didn't count against your quota, that could be used automatically by backup software and other cases.

Another possible system which seems fair to me would be to give each user a guaranteed 1/N of the bandwidth. If there's any unused, then split it equally among those that are using it. In practice an ISP needs to have enough capacity to support streaming during the peak hours, so that'd keep the 1/N value reasonable. For example, if a local ISP offers 1 gbps connections to 200 customers and has them sharing a 10 gbps upstream connection to the wider internet, each would have a guaranteed 50 mbps, with ability to burst to all 1 gbps most of the time. That's plenty fast for streaming from several devices per household. If someone needs faster guaranteed speed, they can pay extra for more bandwidth shares.

jewel··on Bard is getting better at logic and reasoning
This is a great capability. I wish that it ran the code in a sandboxed iframe in the browser so that I could ask for things that'd waste too much of the providers server CPU to compute. It'd also be great for those iframes to be able to output graphics for tiny visual simulations and widgets, e.g. ciechanow.ski.
jewel··on Meta AI announces Massive Multilingual Speech code, models for 1000+ languages
Trying to attach a license to model weights seems counter-productive to me. If you argue they are copyrightable then surely they are derivative works of the training data, which is unlikely to all be public domain. Machine learning enthusiasts are better off lobbying for model weights being non-copyrightable as it doesn't have any creative input and is the result of a purely mechanical process.

The copyright on the code, on the other hand, would definitely be copyrighted and would need a clean-room implementation, as you said. The community could pool its resources and do it once, and license it under the AGPL to keep it and further improvements available to everyone.

jewel··on Quid Pro Crow
For those that like this sort of thing, Wikipedia calls them malapropisms [1]. Reddit has a bunch of them at r/BoneAppleTea [2].

[1]: https://en.wikipedia.org/wiki/Malapropism [2]: https://old.reddit.com/r/BoneAppleTea.

jewel··on The seven programming ur-languages (2021)
Ruby's if statements are actually expressions, they behave the same as the ternary operator : ?

  foo = if bar
    1
  else
    2
  end
jewel··on It's not only you, there's an explosion of ChatGPT on HN
Good question. GP is claiming that because ycombinator (YC) investors have put money into AI, we're going to see a lot of AI posts here for the foreseeable future. That's because YC companies use HN to promote their products.
jewel··on Tell HN: Do Not Use Docusign
Document everything you've tried so far and then do a charge back through your credit card company.
jewel··on A tale of Phobos – How we almost cracked a ransomware using CUDA
Sorry that happened to you. Using a de-duplicating backup solution (such as rdiff-backup or restic), will let you keep daily increments indefinitely with very little overhead.
jewel··on TurboTLS: TLS connection establishment with 1 less round trip
This reminds me of the noise protocol which lets you communicate securely with a single round trip.

http://www.noiseprotocol.org/noise.html#zero-rtt-and-noise-p...

jewel··on A custom-designed IDE SSD for old PCs
On Linux there is zram which creates a first-priority swap partition that just compresses the pages and keeps them in memory.

It looks like Windows also has memory compression.

I believe that OS X has memory compression turned on by default.

jewel··on Read this post ‘unless’ you’re not a Ruby developer
It's Ruby though, where Array has "size", "length", and "count", all of which are equivalent. The programmer chooses which one they prefer based on the context or their style or the phase of the moon.

Ruby inherits the Perl philosophy of "There's more than one way to do it". Compare with Python, and its "There should be one — and preferably only one — obvious way to do it."

It's true that it makes the compiler less elegant, but Ruby optimizes for the programmer at the expense of the compiler.

jewel··on Show HN: Pomodoro with friends
chatodoro.com is available.
jewel··on Photopea: A free Photoshop alternative making millions
It's not the default on my Ubuntu, and I don't even see it in apt or snap. I wonder if perhaps you've confused it with another program, or are running an Ubuntu derivative.
jewel··on BliKVM PCIe puts a computer in your computer
The concept has been around for a while:

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

jewel··on The Follower: Using open cameras and AI to find how an Instagram photo is taken
It depends on the bitrate. Let's assume 10 mbps for five cameras. That'd be 16.4 TB for a month's footage.

Depending on the application, you could lower the bitrate significantly during times of low motion or low detail (such as at night). You could also drop the framerate.

I've found that when the scene is static, without panning, and no wind blowing leaves on trees, you can compress really well. I have a Wyze outdoor cam looking at the front yard that does 1080p at a little less than 1 mbps.

jewel··on Hydrogen battery startup says it has $700M order backlog
It would probably make more sense to store the heat of summer into the ground directly, using something like a ground source heat pump. An additional benefit is that the same system cools the house in the summer cheaply.

My friend has an off-grid cabin and his solar panels were easy to size for all other energy needs during winter by having them installed angled towards the winter sun position.

He does have a small generator just in case there is a particularly bad winter storm, but even in that circumstance it just has to run long enough to charge his batteries, so fuel consumption is minimal.

jewel··on 30TB Portable SSD Hits Walmart for $39 but Stay Away from It
I use the hard drive category on pcpartpicker.com, sorted by price per GB. You can then filter by seller and total size if you have other constraints.

https://pcpartpicker.com/products/internal-hard-drive/#sort=...

Also be sure to check external drives. Sometimes it's cheaper to buy one of those and then discard the enclosure.

https://pcpartpicker.com/products/external-hard-drive/#sort=...

jewel··on Slackmoji has been sunset due to cease and desist (2018)
Every company should behave this way. At least in the US, trademark requires active enforcement to not become generic and useless.

https://en.wikipedia.org/wiki/Generic_trademark#Avoiding_gen...

Copyright doesn't work the same way. You can selectively enforce it, at your discretion, without risking loss of the copyright.

jewel··on Mindustry – Open-Source Game
A few years ago we played this for a few weeks at the office over Christmas break when things were otherwise slow. We had maybe a dozen players, and played in Survival mode which I believe is infinite with difficulty ramping up.

We split into four teams, with one providing power, one providing ammo, one building defenses, and the rest just running around trying to help out where we needed it the most.

There was a ton of potential. I had to keep adjusting the difficulty as the match went on to keep us alive and then to finish us off when we were running out of time.

I'd love a multiplayer coop game like this but with the potential to have fifty or a hundred players. Right now the office plays CS:GO once a week, with the settings changed to allow max players, but it still caps at thirty. CS:GO is hard for new employees to get in to so I'd love something where everyone has fun. We also did TF2 for a while, which was better because the newbies could be medics and still feel like they were contributing, but the hard-core player base loved the challenge of CS:GO.

jewel··on Electronics are built with death dates. Let’s not keep them a secret
I've been using this magnetic USB-C adapter on my laptop to reduce the wear and tear on the port: https://a.co/d/4JCadfi.

I've been using it since March with no complaints. It'd be great if manufacturers could standardize on something like this so that the port could be flush.

jewel··on For centuries, English bakers’ biggest customers were horses
The article makes me wonder what the maximum range for a horse would be if carrying its own meals, never grazing, but drinking water along the way as needed.

Seems like it'd sort of be like the rocket equation, but more forgiving.

jewel··on Code doesn’t have to be a mess
Sometimes called YAGNI, or You Ain't Gonna Need It.

I've found that the right level of abstraction is the one that saves time and effort and duplication now, for the features you're currently shipping. If you're thinking about hypothetical new features that aren't even on the roadmap then you've gone too far.

As an example, say your embedded program needs to load images, and your standard library only supports raw BMP files. BMP images are going to work great for the time being, since the art team can supply them that way. By all means, add abstraction method around the library method called "load_image" so that you don't have to refactor a million places to replace that library. It'll give you a great place to add error handling, logging, etc.

Beyond a single method to add a point of attack, don't go beyond that and spend the time to add a JPEG and PNG library, don't add support for high bit-depth images, or for grayscale images, or CMYK images. Don't add an abstraction that'll someday be able to load the Nth frame from a video file. Perhaps throw an exception for unusual input, but beyond that don't waste your time.

In my experience having simple, direct code makes it easier to refactor in the future when the need arises. Having too much abstraction or future proofing gets in the way because the future inevitably will bring different changes than what you were expecting.

jewel··on Log4j: The pain just keeps going
That's fantastic. Since Go has gone all-in on static compiling, it'd be awesome if they made it possible to update a dependency without recompiling (or even having the source code for) the rest of the program.

In addition to making it easier to do security updates in situations like log4j, it'd also make it easy to comply with LGPL license terms.

jewel··on A 100x Investment (2019)
If the software improves beyond a certain point, insurers would be willing to take on the risk of this aftermarket approach, making it viable to run a business installing this on cars. Regular consumers wouldn't have to be hacker types to want this or know anything about how it's installed.

For that matter, at a certain point your car insurance might give you a big discount to have one installed and subsidize the installation and hardware costs. There's a profit motive for the first company that does so, being able to offer much cheaper rates while still paying out far less for at-fault collisions.

jewel··on Inflation Has Outpaced Wage Growth. Now It’s Cutting into Spending
An idea for the fries: an air fryer would let you make a small batch of fries without having to use a lot of oil for deep frying.
← PreviousPage 2 of 15Next →