Hacker Newsnew | past | comments | ask | show | jobs | submit | fingerlocks's commentslogin

> By the way on macOS MAUI uses Catalyst as backend, not native macOS APIs.

What does this mean? Mac Catalyst is native. It’s just a thin bridge between iPhone’s UIKit and AppKit on MacOS, which are really the only two divergent frameworks in the entirety of the massive Apple SDK.


For those who have never heard of catalyst: https://developer.apple.com/documentation/uikit/mac-catalyst

Rust with traits and Swift with protocols

So just type classes?

How does a type class help with composition? They do help with the expression problem (adding support for an "interface" after definition), and via parametric polymorphism they might give you a bit with regards to composing two traits.. but you do also have generics in Java, even if not as good as type classes.

So anyways, I don't see as big of a change here. But there was a Brian Goetz mail/presentation somewhere where he talked about adding "basically type classes" to Java? But unfortunately I couldn't find it for you now.


>Though we're also talking about an organization that couldn't merge a PR for a year that fixed a one liner. A mistake that should never have gotten through review. Seriously, who uses a while loop counter checking for equality?!? I'm still convinced they left the "bug" because it made them money

What is this in reference to? I tried to search for it but only found this comment. “Github while loop fix that was in review for a year”?


It was the safe_sleep function. Here's an issue on it [0]. IIRC there was an early issue, but really this is code that never should have made it in. Here's the conditional in question

  SECONDS=0
  while [[ $SECONDS -lt $1 ]]; do
      :
  done
Here's the fix... (s/!=/-lt)

  while [[ $SECONDS -lt $1 ]];
It's a fallback sleep function for if you don't have the sleep command, (or read, or ping) then it'll increment SECONDS (special variable) until the time has passed because : does nothing (it will peg your CPU though).

Problem is the loop isn't computed with infinite precision. Doesn't take a genius to figure out < is infinitely better than != here and you'd be right to guess that people did in fact waste thousands of dollars getting stuck in infinite loops that were entirely unavoidable.

Here's the actual merge...[1]

At least it didn't take them months to merge this line, which should have existed from day 1 too (a very very well known pattern for writing bash scripts)[2]

[0] https://github.com/actions/runner/issues/3792

[1] https://github.com/actions/runner/pull/3157/changes

[2] https://github.com/meshtastic/firmware/pull/7922


FYI, in your reproduction, both of the conditionals are the same. But you are right, the initial implementation was `!=`

    while [[ $SECONDS != $1 ]]; do
became

    while [[ $SECONDS -lt $1 ]]; do

>.< idk why I copy pasted my line with the correction again. Sorry about that, but glad you got it despite that haha

If asking for the zip first was more common then we quickly learn those four extra digits because the auto fill benefits would be immediately obvious


Why?

I have a 4 digit postcode, I have to look it up every time I have to fill in an address form for delivery.

I've had people screw 1 digit up in that postcode and their items (a laptop in one case) went to the completely wrong city.

A code sounds foolproof, until you realise most people don't engage with them for most of their lives - you don't tell the uber driver the zip/post code you are waiting in, and travelling to, nobody does.

edit: just to add - Magic numbers are bad. Software engineers know that a number that's undocumented in code is unmaintainable, a zip code is worse.


> I have a 4 digit postcode, I have to look it up every time I have to fill in an address form for delivery.

> A code sounds foolproof, until you realise most people don't engage with them for most of their lives - you don't tell the uber driver the zip/post code you are waiting in, and travelling to, nobody does.

When the above comments said +4, they meant knowing the second half of the nine digit zip code.

Basically everyone in the US knows the first 5 digits. It's really easy to memorize them. If you can remember your city, you can remember your zip code. And in the US you use it all the time, so it stays memorized.

> edit: just to add - Magic numbers are bad. Software engineers know that a number that's undocumented in code is unmaintainable, a zip code is worse.

That complaint about magic numbers is completely off base. Magic strings are just as bad in software. "Beverly Hills" and 90210 are equal sins on the magic front.


> Basically everyone in the US knows the first 5 digits. It's really easy to memorize them. If you can remember your city, you can remember your zip code. And in the US you use it all the time, so it stays memorized.

What's the 5 digits for Yonkers New York (edited because I originally had NYC)

> That complaint about magic numbers is completely off base. Magic strings are just as bad in software. "Beverly Hills" and 90210 are equal sins on the magic front.

For the same reasons, that's why it would be: Beverly Hills, Los Angelos County, California, USA, 90210


> What's the 5 digits for Yonkers New York (edited because I originally had NYC)

Nobody sends packages where the destination is an entire city. If someone gives me an address inside Yonkers, it'll have the zip code in the address. I've never had to look up a zip code in my life.

> For the same reasons, that's why it would be: Beverly Hills, Los Angelos County, California, USA, 90210

Which reasons? That has nothing to do with magic numbers, except that a 'magic full mailing address' is still bad, you don't shove that into the middle of your code either. If you're looking at the "made a typo" reason then that's where showing the address after putting in the zip code will give you the same verification but faster.


Heh, you should take a minute to look the answer up -

ZIP Codes 10701, 10702 (post office), 10703–10705, 10707 (shared with Tuckahoe, NY), 10708 (shared with Bronxville, NY), 10710, 10583 (shared with Scarsdale, NY)


Is that information supposed to change my mind about something?

If you put in any of those numbers it can prefill the city name, with enough accuracy that you don't need to change it.

Did I imply anywhere that cities only have one zip code before you asked about Yonkers? I said if you can remember your city name you can remember your zip code. That doesn't imply you would use a list to get from one to the other.


It would have improved your response was all - nobody accused you of anything, but this response of yours... way off


Improved how?

I picked up the implication that you thought my response could be improved, so I tried to guess what your criticism was and respond to that. If it feels "way off" because I framed it as disagreement, then I dunno, that feels like the right framing? Unless it's something else I did? I could have made it clearer I was guessing but that doesn't seem way off.


Your zip plus 4 changes. It isn't worth trying to know as it isn't supposed to be constlnt. If you send a lot of mail there is a discount for using it but you have to update everyone's address often (iirt at least 4x per year)


Source? The numbers correspond to the USPS distribution centers and carrier routes. If the numbers are changing that would imply an increase in zip code subdivisions, making each zip code a better address predictor for a given individual.


https://faq.usps.com/s/article/ZIP-Code-The-Basics

I don't know how to link to the correct question but there is why did my code change.


I'm guessing the terminal role is the 64 Senior? That's nearly everyone on my team. Someone has to retire or die to get a shot at Principal.


Nowhere does it say structs provide “one source of truth”. It says the opposite actually- that classes are to be used when unique instances are required. All classes have a unique ID, which is simply it’s virtual memory address. Structs by contrast get memcpy’d left and right and have no uniqueness.

You can also look at the source code for the language if any it’s confusing. It’s very readable.


You're re-stating his exact problem while trying to refute him.


No, I’m not. OP is conflating multiple guidelines for different purposes and attempting to use them all simultaneously.


> OP is ... attempting to use [multiple guidelines] simultaneously.

No, he's literally explaining why the guidelines can't be used simultaneously.


They aren't supposed to be used simultaneously, which is literally what my comment was explaining. Different guidelines to solve different problems.


Have one source of truth is a universal guideline.

Prefer structs over classes is a universal, if weak, guideline.

It's funny how people can be all hung up on composability of things like type systems, and then completely blow off the desire for composability of guidelines.


I find that hard to believe. Every creative professional that I know shares this sentiment. That’s several graphic designers at big tech companies, one person in print media, and one visual effects artist in the film industry. And once you include many of their professional colleagues that becomes a decent sample size.


Graphic design is a completely different kettle of fish. Comparing it to academic paper writing is disingenuous.


The thread is about not knowing anyone at all who thinks AI is plagiarizing.


Yes, plagiarising text based content. No one in this thread meant graphics.


If you mean true 4x4, there are none. Sprinter went AWD a few years ago.

But I believe most vans on the market have an AWD option. Ford Transit and Volkswagen IDBuzz both offer AWD. Toyota’s Sienna is (only?) AWD with a silly lifted trim for the off-roading soccer mom market. Chrysler’s van is AWD.

That leaves the ProMaster as the only two wheeler I’m certain about. Mazda and Kia also have vans, unsure about their drivetrain options. Did I leave anyone out?


This is only applies to App Store published .app bundles. Does not apply to binaries you compile yourself or non-app binaries like cli tools


Just to be clear, you're saying that .app bundles (and CLI tools) distributed outside of the App Store (and CLI tools) will continue to operate once the expiration date of the signing certificate has passed?


No, sorry. That's not what I'm saying.

If you compile hello-world.c into a binary then it will have a placeholder (ad-hoc) signature that was signed by an "empty" key that can never expire. The Go compiler isn't doing anything special. By default all binaries are signed this way unless they were compiled with the explicit intention of App Store distribution.

And the above does not apply to .app bundles.


Yes of course apps will continue to operate after the signing cert expires, and this is documented by Apple in several places. It would be absolutely insane if apps stopped working, because all Developer ID signing certs expire after 5 years.

The valid dates for code signing certificates apply, naturally, to signing. You can't sign an app anymore with an expired certificate, but if an old app was signed with a cert that was valid at the time of signing, then the app will continue functioning forever.

This issue was just a dumb screwup by Logitech. If apps stopped functioning when the signing cert expired, you'd see Mac apps dying all the time.


This only applies to distribution certificate signed apps, not true in the general sense.


> not true in the general sense.

What does that even mean? What exactly are you saying is not true?

It's not at all helpful or informative to keep saying "does not apply," as if that meant anything by itself.


OP said something confusing about the Go compiler, so I was only added clarification for that one statement.

You walked by half listening to a conversation, stuck your head in the room and said something tangentially related but more confusing.

There are distribution and development certificates that can all be used for signing a binary. Different rules for each, and there's also auto-signed (com.apple.provenance). It's all documented on Apple's website if you want to read more about it. But I suspect you already know this and are just trying to pick a fight.


This is a gross mischaracterization of the thread. I replied to spondyl, not to you. Then you replied to me, so if anyone was "trying to pick a fight" involving me, it was you.

The crucial point is this: there are no builds that expire on macOS. Developer ID signed builds do not expire. Ad hoc signed builds do not expire. When the Developer ID code signing certificate expires, it cannot be used to sign new builds, but the old builds last forever. Build expiration is not a thing in any case.

So when spondryl asked, "Just to be clear, you're saying that .app bundles (and CLI tools) distributed outside of the App Store (and CLI tools) will continue to operate once the expiration date of the signing certificate has passed?" and you responded "No, sorry. That's not what I'm saying." that was actually confusing, not what I said.

The only reason the Logitech software died is that Logitech itself was doing some custom and badly designed validation above and beyond anything that macOS itself does. Your mention of App Store apps and CLI tools was itself a tangent and completely irrelevant to the issue.


So what happens when I codesign with the the --expires flag?


Do you? Does anyone? I see that the flag exists, but I've never seen anyone use it. That would seem a bit insane.


Yeah, it’s used for dog fooding or private distribution. It’s also used on iOS side-loading and test flight builds.


If you’re including these assets as UI elements, they would be rasterized anyway and copied to a GPU bound buffer for the frame blit. Doing so at compile time increases runtime performance.

You can of course override this behavior and redraw your vector every 8.3 ms if you want, but I promise you that this is not faster. For sparse pyramid-tiled vector images like Google/Apple maps, this is a two step process using the latter method followed by the former.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: