HNHacker News
TopNewBestAskShowJobs

jchb

320 karma · joined September 4, 2017

submissionscomments
jchb··on Dead ends of information technology
Not on Apple platforms. The article links a "gtk and qt trend at Stackoverflow". Adding swiftui and uikit to that trend: http://sotagtrends.com/?tags=gtk+qt+swiftui+uikit&relative=t...
jchb··on Undefined behavior in C is a reading error
By learning only the most important rules, and then enable the compilers undefined behaviour sanitizer(1) during development, making mistakes, and fixing them.

(1)https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#...

jchb··on Apple deletes Steve Jobs's “Thoughts on Flash”
You can remote debug webviews (from Safari on a Mac), but only web views in apps signed with a development provisioning profile (1). So to debug web content in iOS Chrome you would have to build and install Chromium for iOS yourself, rather than use the Chrome App Store version.

(1) https://webkit.org/web-inspector/enabling-web-inspector/

jchb··on The Gates to Hell: Apple’s Notarizing
> And these days all the documentation that Apple produces is in form of brief mentions in WWDC videos. Aaaarrggh!

There's actually a very detailed guide that explains both how to do it from the Xcode UI, and from the command line: https://developer.apple.com/documentation/security/notarizin...

jchb··on Swift Evolution: Actors
> You're just sending messages, so you can send a message over the wire and it would be as simple to the developer as sending it locally

If you are expecting a reply, or some side-effect in another system, as a result of the message you sent (and usually you would expect that, otherwise you wouldn't send the message in the first place) then it's not that simple. If the actor is in the same OS process on the same machine, then message delivery is reliable, and you know you'll either get a reply OR a signal that the other actor died. If, on the other hand, the actor is on another machine across the network then the semantics are different. You cannot always differentiate between the remote actor dying and an intermittent network connection error. So you need to take that into account in your protocol design - for example by making operations idempotent.

I've many times seen Erlang code where the developers didn't make this distinction - because the message passing operation looks the same, remote or not - and as a result the system is not resilient to network failures.

jchb··on Have the Tables Turned on NoSQL?
“might cause”, yes. But at least with Postgres that only happens if you add a default value to the new column. You can add the default value in your application instead, just like you would with your average NoSQL DB. Then, when you have low load on your system, you can migrate the rows in batches to have a default value, and eventually remove the application default.
jchb··on Tokyo’s internet Jesus uses secret creed to command CEOs
Second that, what's wrong with NTT? 250mbit fiber for a fraction of what it would cost in the US. IPv6 ready. Basically no down time in 5 years. Very polite service staff.

Sure, if you look at how they design their websites, signup process and router UX, it's... a bit special (from a "western" perspective) ... But it works.

jchb··on I found black-hat content marketers: sockpuppet bloggers, fake Reddit/HN accts
What about building a service, perhaps a web browser plugin, that overlays a trust-worthiness score + contextual information, over text (bonus for images) on the web?

If a user posts "I recommend product X", the overlay would say "Caution: This user also recommended the product Y,Z in the last 48 hours. 34/34 of the users post in the last month are product recommendations. Sentiment score for users posts: 100% positive. The following internet accounts are likely controlled by the same individual or organization: ..."

Is it feasible? Does it already exist?

jchb··on Why the Arabic world turned away from science (2011)
Even if that would be true (that US supported that coup), would the democratically elected Mohamed Morsi have promoted science education in Egypt? The Muslim Brotherhood's history of science education doesn't seem so rosy.

I am curious what you think of https://www.hudson.org/research/9881-the-muslim-brotherhood-... (yes, I know this is written by an Israeli)

jchb··on Why the Arabic world turned away from science (2011)
It seems so, a key part of that quote is "working in".

https://books.google.co.jp/books?id=d2tF-L00-X8C&pg=PA216&lp...

"My late friend, the distinguished Pakistani physicist Abdus Salam, tried to convince the rulers of the oil-rich states of the Persian Gulf to invest in scientific education and research, but he found that though they were enthusiastic about technology, they felt that pure science presented too great a challenge to faith. In 1981, the Muslim Brotherhood of Egypt called for an end to scientific education. In the areas of science I know best, though there are talented scientists of Muslim origin working productively in the West, for forty years I have not seen a single paper by a physicist or astronomer working in a Muslim country that was worth reading"

jchb··on Why the Arabic world turned away from science (2011)
Abdus Salam belonged to a school/sect of Islam that encourages open debate and promotes a scientific interpretation of the Quran.

"Salam was an Ahmadi Muslim, who saw his religion as a fundamental part of his scientific work. ... In 1974, the Pakistan parliament made the Second Amendment to the Constitution of Pakistan that declared Ahmadi to be non-Muslim. In protest, Salam left Pakistan for London." [0]

[0]https://en.wikipedia.org/wiki/Abdus_Salam#Religion

jchb··on Last Phase of the Desktop Wars?
Well, macOS 10.15 has a user-space network stack. 11.0 can run on ARM as well on x86. So there are a bunch of things going on under the hood
jchb··on PostgreSQL B-Tree index deduplication
Previously on HN:

Why Uber Engineering Switched from Postgres to MySQL (2016): https://news.ycombinator.com/item?id=17280239

A PostgreSQL response to Uber [pdf]: https://news.ycombinator.com/item?id=14222721

One important point is that Uber wrote this running on Postgres 9.2. The latest Postgres release is now 12.4

jchb··on US sanctions International Criminal Court officials
I think this is less about wanting to protect criminals, and more about US sovereignty at all costs. And clearly upholding this sovereignty was one of Trumps election promises.

Under this philosophy (or doctrine, if you will) of sovereignty, US will never accept that the ICC - an entity that the US citizens have not explicitly delegated their sovereign power to - are trying to prosecute US nationals.

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

jchb··on US sanctions International Criminal Court officials
To me, a non-US citizen, it seems that the International Criminal Court (ICC) is being quite reasonable here. ICC wants to investigate US military personnel that, allegedly, committed war crimes on Afghanistan soil after 2003. They can do that because Afghanistan ratified the ICC that year. Clearly, if the US wants to commit war crimes, they should only do that inside their own borders, where they are actually perfectly safe from the ICC.

That being said, I don't like when this kind of issues are politicized ("Obama destroyed America", "Trump sucks on all issues", ...). So I looked up the numbers.

The US congress and senate passed a law, in 2002, that gave the president authority to "with all means necessary, prohibit the International Criminal Court from seeking to exercise jurisdiction over United States persons, and allied persons"

https://clerk.house.gov/Votes/2002328

Votes by party

Republican YEAS: 201 NAYS: 18

Democratic YEAS: 195 NAYS: 13

Doesn't seem to be a "current administration" issue only. Clearly the US was caught up in the post-9/11 panic at the time of passing this law. But it seems a good idea to repeal it - if there is no longer a majority in support of it.

jchb··on App Review process updates
UDP on AT&T and other carriers is just fine, but you need to do NAT hole punching or proxy the UDP packets. See my comment to the grandparent.
jchb··on App Review process updates
UDP is fine. We have apps on the App Store that use UDP. This is likely a NAT related issue. That is not going to be an issue just for App Store review, but also for tons of other networks out there. As of lately, carrier-grade NAT deployments are very common.

It's usually impossible to establish a two-way UDP "connection" between two peers that are both behind NAT. This varies depending on the type of NAT. If just one peer is behind NAT you can typically establish the "connection" using NAT hole punching. If both peers are behind NAT you may need to proxy the UDP packets using an intermediary server.

There are protocols for hole punching, such as ICE (https://tools.ietf.org/html/rfc8445), but you can also roll your own - if you control all endpoints.

"Connection" in quotation marks because UDP is a connection-less protocol, but the NAT port mappings that are established are sometimes referred to as a connection.

jchb··on TikTok Agreed to Buy More Than $800M in Cloud Services from Google
Yes, but they only store data in China for Chinese customers (as per the registered region of the Apple ID). [1]

[1] https://support.apple.com/en-us/HT208351

jchb··on Emotionally Expressive Text to Speech
There is Speech Synthesis Markup Language (SSML). Amazon Polly and Google text-to-speech supports it, although the best neural-model based voices only support a small subset.
jchb··on Airbnb’s loss nearly doubles in fourth quarter, before virus
> why is it up to me to do weird math to figure out if I actually have enough $$$ to pay for what I'd like to have.

Well, one reason is: to make you aware of the tax burden (and judge if that % is kept at a reasonable level), rather than hiding it in the total price.

jchb··on A quick primer on type traits in modern C++
Scott Meyers has retired from C++ (his own blog post: http://scottmeyers.blogspot.com/2015/12/good-to-go.html?m=1) so the next C++ bible has to come from somewhere else. Maybe he saw it coming :)
jchb··on macOS Kernel Extensions are officially deprecated
Second this, you get two free Technical Support Incident requests per year as a registered developer, and you can purchase additional ones. We regularly file such requests and have always got timely and helpful responses.
jchb··on 250M Microsoft customer service and support records exposed on the web
Under the GDPR, that Microsoft Data Protection Officer will have 30 days to respond to you. If they don't respond, you can complain to the supervisory authority (in the case of UK that is https://ico.org.uk/make-a-complaint/).

Now, Microsoft does not necessarily have to tell you exactly what of your data was leaked. They probably do not know! In this case, they may just respond to your request with all of the personal data they hold.

The law just says that they have to notify you of the "nature of the personal data breach as well as recommendations for the natural person concerned to mitigate potential adverse effects".

jchb··on Apple's auto layout and visual format language for JavaScript (2016)
> Does anyone honestly think this: [ 'H:|[view1(==view2)]-10-[view2]|' 'V:|[view1,view2]|' ] is readable?

This is not Auto layout, it is just an alternative string-based API to express constraints in Auto layout. In practice no-one (that I know) uses Visual Format Language, as it is called, but instead sets up constraints in code or in Xcode Interface builder. In Swift code it would look something like this: view1.leadingAnchor.constraint(equalTo: view2.leadingAnchor, constant: 10) view2.topAnchor.constraint(equalTo: view1.bottomAnchor) ...

jchb··on Apple's auto layout and visual format language for JavaScript (2016)
> so it can't gracefully scale layouts down from desktop to mobile sizes (when you have a 3-column layout you have lots of control over column widths, but no way of turning them into 3 rows instead).

On Apple platforms (UIKit on iOS) handling such layout changes is done with another mechanism on top of auto layout. Something they call "Size Classes". You get a callback saying eg. "view has changed to Regular width, Compact height" and you switch to a another set of auto-layout constraints + animate as desired. This size class system is used for stuff like handling rotation on the iPhone and transitioning to split-screen mode on iPad.

jchb··on How Swift Achieved Dynamic Linking Where Rust Couldn't
> ABI-resilience by default at dylib boundaries

Actually ABI-resilience is not the default, it is enabled by a compiler flag.

In addition to that, there are some current compiler limitations when it comes to cross-module usage of generics and inlining that affect performance. But those are not by design and can be improved in future compiler versions.

jchb··on Swift Numerics
Technically it is a form of garbage collection. However, garbage collection is a very broad term that arguably encompasses even C++ smart pointers. Typically one refers to a garbage collector in the meaning of a separate process that runs independent of the application. Either in the background or “stopping the world” to collect. ARC is part of the application code. It is also visible to the compilers optimizer, which can optimize away redundant redundant reference count operations.
jchb··on California power lines spark wildfires and prompt blackouts. Why not bury them?
The bigger question to me, is why doesn't the US do combined gas/electricy/... trenches accessible by manholes, like you can see in most northern European cities? Is it just economic shortsightedness or does it have to do with density (or rather US cities being the opposite of dense)?

(yes there are regulations on minimum distance between electricity and gas pipes, so these trenches have to be pretty big)

jchb··on Perfectly Cropped
Tip: long press the image you want to save, tap Save.
jchb··on Apple’s Use of Swift in iOS 13
> - Message passing in ObjC is so optimized that it probably can't get much faster, and anyone acting like it's slow has a potentially skewed understanding of this

The problem with Objc message passing is not the absolute execution time involved in passing a message. The problem is that the dynamism involved completely disables the compiler from performing any code-inlining. Typically inlining small functions is what enables the compiler to unlock further optimisations. From simple things such as merging duplicate loads from same address, to auto-vectorization.

Page 1 of 5Next →