HNHacker News
TopNewBestAskShowJobs

Cyberdog

3,013 karma · joined December 10, 2015

Cyberdog is the internet alias of a guy with interests in:

- Swift programming language

- Cryptocurrency

- Vidya gaems

- Unix and macOS (though I don't hate Microsoft/Windows - you do you)

- Instinctively distrusting Google

- East Asia culture, language, politics, and especially food

submissionscomments
Cyberdog··on Atkinson Hyperlegible Font
I looked at the code to see why it would be doing that. It seems to handle the font customization stuff by basically downloading all of the variants and then combining them into a zip file in client-side code - even when you do no customization at all. Apparently that code which makes the zip (which I'm guessing is an external library) creates a corrupted one when run in Safari according to a comment buried in the JS.

Maybe it really is a bug on Safari's part but creating custom zip archives is something which would be far saner to do on the server side in the first place.

Cyberdog··on Hezbollah pager explosions kill several people in Lebanon
I won't disagree with you about some people liking to keep secrets just as much as others like to spill them, but could you give an example of how trauma would cause someone to want to do the former?
Cyberdog··on Hezbollah pager explosions kill several people in Lebanon
The capacity to keep secrets, even at the state level, takes a level of mental maturity that few are capable of. So many are thrilled by the idea of knowing something few other people know to a degree that they paradoxically want to make it something everybody knows. Journalists take advantage of this and collect and share leaky sources amongst each other. The reason for the leaking is most likely just human nature.

That said, the existence of the state of Israel is such a contentious topic that the leakers may have been motivated by politics as well as the above, sure. But I doubt state-level agencies are condoning the leaking here.

Cyberdog··on Launch HN: Marblism (YC W24) – Generate full-stack web apps from a prompt
That you think full-stack developers such as myself are routinely earning "just under $200k" (but please feel free to reach out to me if you need an experienced dev and think that's a fair price to pay) yet "cost money and do not generate profit" seems to speak of a skewed perspective and/or experience, I think. I mean, if that were true, then what would be the point in hiring a web developer in the first place? Some sort of weird nepotistic makework scheme? Again, if that's your perspective…

In my world, clients come to me with a web site and a problem (or no web site and the problem of "I don't have a web site"), we agree on contract terms, and I solve their problem. If I do a good job at it (and I want to do a good job at it, because solving problems and making clients happy feels good while failing at that feels really bad), the client finds value in my work and they will come back to me the next time they have another problem that needs solving. It's that simple. Nobody's hiring me because of "candidate compatibility" and then throwing a bunch of money at me to do nothing.

At least in the short term, I'm not too worried about AI taking my job, because, as stated elsewhere, it's not yet good enough to do more than the least complex of tasks, and as one tries to get it to do more complex things, the odds that it will hit a brick wall due to a bug it can't code its way around or a creative understanding it can't unravel increase - so these sorts of tools might actually end up creating more work for more experienced professionals like myself (although I don't necessarily look forward to the days where I'm regularly being hired to unravel a plate of ChatGPT spaghetti). But even more than that, I feel like a good deal of the value I provide is in being able to talk to a client about what they want the site to do, how it will earn them money, and foresee potential problems or offer better solutions based on my experience - to answer questions that they didn't think to ask, and ask questions of my own to make sure we're on the same page on things. A client just giving me a description of what they want built followed by me just building it? That never happens. There's always discussion and back-and-forth to nail down details and make sure the site is as good as it possibly can be. So long as clients see the value in that, and until AI can do that sort of thing, I'm not sweating it.

Cyberdog··on macOS Sequoia is available today
As a web developer, specifically one who started my professional career when Internet Explorer 6 had something like 85% marketshare, I'm horrified at the idea of a single browser engine dominating the space again. It will lead to stagnation just as it did back then.

Keep WebKit alive. Open source Presto. Support Ladybird. Hell, I believe that Microsoft should never have abandoned Trident…

Cyberdog··on macOS Sequoia is available today
I looked up an article to elaborate on the "threw a fit" part. It appears that Apple believes it would have to compromise security aspects of iPhone Mirroring in order to do it in a way that complies with EU law, so it's choosing to just not offer it at all.

https://appleinsider.com/articles/24/06/28/eu-hits-back-at-a...

Cyberdog··on Why I avoid using empty() in PHP? A Closer Look
Thankfully it's been a couple years since I had to touch a WordPress code base, but I remember being confused because I needed to define a route and couldn't figure out how to do so either in the code base or in documentation scattered about online. Eventually I realized that this was because WORDPRESS DOESN'T HAVE A ROUTER and you're supposed to just create .php files which are called and executed directly from the web server. True caveman smash-together-rocks shit.
Cyberdog··on Why I avoid using empty() in PHP? A Closer Look
What is the computer meaning of "empty?"

I'll answer - there really isn't one. You could say "undefined" but we already have another word for that ("undefined") - an "empty" construct doesn't exist in any other programming language that I'm aware of. Back in PHP's way-too-helpful days, they came up with this concept, so they got to define what it meant. (And to be fair, as with other things from the bad old days, it has caused confusion ever since.)

Cyberdog··on Why I avoid using empty() in PHP? A Closer Look
How can WordPress be so prominent and have so much money behind it and still have such garbage code? Are there giant companies still running PHP 4 server farms that need it to continue to be coded to 2003 standards? Is it some government op to ensure a good deal of the sites on the web are easily-hackable? Someone explain this to me.
Cyberdog··on Why I avoid using empty() in PHP? A Closer Look
In PHP, as in other languages, numeric types that aren't ints should be avoided as much as possible. If you don't know why, smarter people can explain it, but the basics are that the binary nature of computers (every value is 0, 1, or a combination thereof) doesn't really work for reflecting decimal values without some level of fakery.

When working with things like money amounts, lengths, etc, store values as ints of the smallest denominator you support. For example, store $1.23 as 123 cents, or 4.567 meters as 4567 tenths of a centimeter. If you want to still allow the user to be able to, for example, enter a price as 1.23, multiply by 100 on input (like `$priceInCents = round($_POST['price'] * 100);`) and divide by 100 when displaying the value(`number_format($priceInCents / 100, 2)`), but keep it as an int all the way in between.

In terms of PHP, this also makes empty() a lot more predictable, because once a value is cast as int, the only time empty() will return true is if it is zero - or you could explicitly code `$priceInCents === 0` and have the exact same result.

Cyberdog··on Why I avoid using empty() in PHP? A Closer Look
What value would an empty int have, then?
Cyberdog··on CP/M forty years on – what it was, and why it still matters (2021)
Note this article is from 2021 (it goes hard on COVID dooming near the end).

Good explanation on what an OS is and how is useful to programmers, though.

Cyberdog··on Wallops: A modern IRC client for classic Mac OS
Leave that page open in a tab without moving your mouse over the window for a couple minutes for a cute little treat.
Cyberdog··on The quest for a Wiki-less game
Don't forget the Yellow Paint Epidemic.

Some game devs don't even want to risk the chance that players might have to stop and explore a little bit before they find the right path to continue the game.

Cyberdog··on Consent-O-Matic – automatically fills ubiquitous pop-ups with your preferences
I've been using the annoyingly-named superagent for a while for the same task, but it often seems to fail to detect some of these annoying boxes. I'll definitely give this alternative a try and see if it works any better.

Thank you so very, very much to the EU and whatever other government agencies are responsible for making the web more annoying to use.

https://super-agent.com/

Cyberdog··on Who uses Accept-Language header?
Yes, but if the web site supports both of them, then it will pick whichever one is first in the header. For example, "en;q=1.0,de;q=1.0" technically states you want equal weight to be put on English and German, but the site has to pick one to show you, so it will most likely fall back to the behavior that's used when the quality score isn't provided (such as "en,de"), which is to pick the first one it can service from left to right.
Cyberdog··on Who uses Accept-Language header?
The Accept-Language header, when used properly, provide exactly the semantics you ask for.
Cyberdog··on Who uses Accept-Language header?
> I might prefer some sites in Danish, but others I'd like to have en English. Unless browsers allow you to set language on a per site basis, we still aren't really capturing the nuances of language preference.

This problem is solved already by competent sites. On your first visit to a site, it uses Accept-Language to guess what language you want to see. If you use a language switcher menu to pick a different language, a cookie is used to save your choice. On your next visit to the site, the cookie is sent and that takes precedence over Accept-Language to send you the page in your preferred language. Easy.

If/when you decide to create a user account on the site (if the site even supports that) then your language preference can be stored with your user data so you would see it automatically after you log in even if you're on a different browser/device.

As with many other things, there are already best practices on how to do all this stuff. It's just a matter of getting web devs and their managers to be aware of them and/or care enough about providing a good experience for their users (unfortunately this has turned out to be a huge ask) to find and implement them.

Cyberdog··on Who uses Accept-Language header?
But then where's the flag for Liberia and Belize and Singapore? What if I'm in Indonesia and you don't offer an Indonesian option but I know enough English to get by - what country's flag should I click?

Just don't use flags, man. It's ridiculous that this is even still a discussion.

Cyberdog··on Who uses Accept-Language header?
> Not that hard to implement, except perhaps parsing the Accept-Language preferences with their quality value can be cumbersome.

Many web frameworks provide a tool for parsing these for you. If yours doesn't (or you're not using one) you may be able to find a package that does. Some will also do the matching for you, so you can pass it a list of languages you can support alongside the Accept-Language string and it will pick the best option that's found in both.

For example, here's the documentation for such a method in the excellent Nette PHP framework that I've been using where I can lately: https://doc.nette.org/en/http/request#toc-detectlanguage

But I've also used this stand-alone package: https://packagist.org/packages/willdurand/negotiation

Cyberdog··on Show HN: Vomitorium – all of your project in 1 text file
That's what I was thinking too. It looks like someone just reinvented tar, and given how it's a JavaScript thing I'm wondering if it's a zoomer who didn't know tar existed and the HN crowd would set them straight. But then I come into the comments here and people are posting about how absolutely brilliant it is, so surely I'm missing something… right?
Cyberdog··on Why GitHub won
> your remote GitHub repo can be located on any machine with an ssh connection

Technically true, but GitHub provides so many more tools that it's almost silly to do so. Aside from the "hub" in GitHub such that it is often the first and only way that some people will look for projects they're interested in, you also get the nice web interface for quick code browsing, issue queues, the ability to add and remove people with a simple GUI rather than SSH key management, wikis, email notifications, and so on and so on.

Some of this can be mitigated by using a self-hosted web-based Git tool like GitLab, Gitea, Phorge, etc. But you still lose the "everyone uses it because everyone uses it" factor of GitHub on top of whatever GitHub features the clones may lack.

Cyberdog··on Show HN: 1-FPS encrypted screen sharing for introverts
For most professional software, I agree. For hobby projects like this, I can certainly understand the appeal of asking users to compile it themselves rather than trying to provide binaries for all of the possible OS and hardware combinations in use today, most of which you might not even have access to for testing.

That said, certainly there does seem to be a weird glib assumption by some hobby/OSS projects that of course I already have the same developer ecosystem/toolchain installed on my system as they do - of course I have a Rust toolchain or can install dependencies with Homebrew or am using Linux with systemd/Wayland. This project at least kindly asks me to install Go first if I haven't already.

Cyberdog··on Why CSV is still king
Did TOML take off? As much as I love it, it seems really rare to see in the wild. I still see YAML everywhere and despair.
Cyberdog··on Why CSV is still king
While that's true, the way text editors handle these characters is not standardized, and many may not let you input them. One of the important features of CSV/TSV is that they're relatively easy to edit by hand, and for that you need separator characters that are easy for both text editors and humans to work with.

Personally, since I've discovered the field/group/record/file separator characters in ASCII, I've been using them to concat fields and rows on one-to-many SQL joins. They work great for that purpose since (at least on all the projects I've done this with so far) I can be certain that none of the values in the joined data will have those characters, so no further escaping is necessary. For example, in MySQL:

  SELECT
    i.item_id,
    GROUP_CONCAT(CONCAT_WS(0x1F, f.field_id, f.field_value) SEPARATOR 0x1E) AS field_values
  FROM items i 
  LEFT JOIN fields f ON f.item_id = i.item_id
  WHERE ...
Then split field_values with 0x1E to get each field ID and field value pair, and split each of those on 0x1F. Easy as pie.
Cyberdog··on [dead]
It just validates what these groups say about such people. "If these degenerates can act with such brazen illegality against our computer systems, just imagine what they're doing with your children!"

But on the other hand I doubt gay furries actually did this hack. More likely it was edgy teenagers who constantly use homophobic slurs in their Discord servers and are just saying it was done by gay furries to be funny.

Cyberdog··on RISC-V AI Chips Will Be Everywhere (2022)
Are you counting "real-world usage" as a measure? I can go to Costco or Best Buy right now and come home with a system with an ARM or x86-64 chip. I'd have to go out of my way to find a system with RISC-V at its core. Even if you allow for devices like routers or embedded systems in disk drives and the like, there's a good chance the selection that any given store has won't have a RISC-V.

Maybe you can come back to this comment in five or ten years and laugh at me, but right now it feels like RISC-V is a solution in search of a problem.

Cyberdog··on RISC-V AI Chips Will Be Everywhere (2022)
I don't know. It feels to me at this point like the RISC-V revolution and the year of Linux on the desktop will happen at around the same time.
Cyberdog··on Daily Usenet Feed Size Hits 300TB
AFAIK, files uploaded to Usenet still need to be ASCII encoded using something like uuencode or base64, which increases file sizes to something like a third larger than their original sizes. So you can decrease the amount of data you need to store quite significantly by only storing the unencoded versions.

After that, deduplication can probably bring you down at least another 50% - how many of these files are just the same things being posted over and over? Probably quite many of them. Store a file once with a database tracking its SHA1 hash, and whenever you see a file with the same hash come in, throw it away and instead store a reference to the first file.

Cyberdog··on Cancel Adobe if you are a creative under NDA with your clients
Everyone always forgets about Acorn. :(

https://flyingmeat.com/acorn/

← PreviousPage 3 of 34Next →