News for hackers. Stuff that matters.

jchb

Re:Dead ends of information technology on Thursday November 25, 2021 @07:44PM (#29346511)
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...
Re:Undefined behavior in C is a reading error on Thursday May 20, 2021 @09:13PM (#27229437)
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#...

Re:Apple deletes Steve Jobs's “Thoughts on Flash” on Thursday May 06, 2021 @09:20AM (#27062792)
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/

Re:The Gates to Hell: Apple’s Notarizing on Friday April 30, 2021 @11:05AM (#26994382)
> 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...

Re:Swift Evolution: Actors on Tuesday March 16, 2021 @08:50PM (#26485216)
> 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.

Re:Have the Tables Turned on NoSQL? on Saturday January 16, 2021 @04:15AM (#25801123)
“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.
Re:Tokyo’s internet Jesus uses secret creed to command CEOs on Wednesday October 14, 2020 @08:38PM (#24783475)
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.

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?

Re:Why the Arabic world turned away from science (2011) on Friday October 09, 2020 @12:22PM (#24731457)
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)

Re:Why the Arabic world turned away from science (2011) on Friday October 09, 2020 @11:42AM (#24730988)
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"

Re:Why the Arabic world turned away from science (2011) on Friday October 09, 2020 @11:13AM (#24730640)
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

Re:Last Phase of the Desktop Wars? on Sunday September 27, 2020 @01:32AM (#24604446)
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
Re:PostgreSQL B-Tree index deduplication on Monday September 07, 2020 @04:34AM (#24397693)
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

Re:US sanctions International Criminal Court officials on Thursday September 03, 2020 @03:05AM (#24361494)
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...

Re:US sanctions International Criminal Court officials on Thursday September 03, 2020 @02:41AM (#24361383)
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.

Re:App Review process updates on Monday August 31, 2020 @10:25PM (#24337955)
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.
Re:App Review process updates on Monday August 31, 2020 @10:21PM (#24337938)
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.

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

Re:Emotionally Expressive Text to Speech on Sunday May 17, 2020 @08:03AM (#23211394)
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.
> 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.

Re:A quick primer on type traits in modern C++ on Saturday February 29, 2020 @09:12AM (#22450628)
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 :)
Re:macOS Kernel Extensions are officially deprecated on Thursday February 06, 2020 @07:42AM (#22255567)
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.
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".

> 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) ...

> 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.

Re:How Swift Achieved Dynamic Linking Where Rust Couldn't on Saturday November 09, 2019 @06:56AM (#21490993)
> 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.

Re:Swift Numerics on Friday November 08, 2019 @06:24AM (#21481349)
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.
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)

Re:Perfectly Cropped on Friday October 25, 2019 @10:49AM (#21355519)
Tip: long press the image you want to save, tap Save.

Older »