Browserver: A web server inside your web browser - <AUTHOR> http://browserver.org/ <comment><USER2> Reminds me of Opera Unite[0], where you could build services available externally in HTML and JavaScript. It even has NAT traversal. It never gained much traction, and I believe Opera no longer develops Unite.

[0]: <http://unite.opera.com/overview/>

<comment><USER3> Didn't know about this one. Thanks!

</comment></comment><comment><USER4> If you re-read the early cyberpunk scifi from Gibson and Stephenson, one of the characteristics of their vision we're still missing is execution at the edges. There was a strong concept of "my virtual space" in which space owners control not just a visual presentation layer, but the full execution stack.

Our architectures are still dominated by central server farms, in which we give up our data and cede control to the server operators. There are few experiences where we have a true, decentralized experience with execution controlled by the clients. BitTorrent and it's predecessors are the closest we've come so far, but AFAIK it's all limited to peer to peer file transfer.

Every time I start to explore these thoughts, the browser is the obvious platform for the first iterations. I'm glad to see initial designs appearing, and look forward to seeing a truly decentralized and peer to peer service that don't have critical dependencies on central servers.

<comment><USER5> There are things like Freenet and I2P.

And thanks to WebRTC we may see these sorts of things running in the browser soon.

</comment></comment><comment><USER6> As discussed previously on HN: <http://news.ycombinator.com/item?id=4366555>

</comment><comment><USER7> I've actually created something similar myself, that does support streaming and blob serving.

I haven't officially 'announced' it yet, as I was planning to make a nice drag and drop Chrome FileSytem API way of setting up a website and hadn't got around to it. So it's still fairly immature (although I think it supports most of what the linked system does).

If you're interested, it's here: <https://github.com/kybernetikos/yobets>

I've designed it to run on heroku, and it sets up virtual hosts for each client. I have a lot of ideas for how this could be used, here's two: 1. using in browser encryption stream your location acquired by the geo location api from your mobile phone but only to your friends who have the right key or 2. any time you want to serve a large file to a bunch of friends, just fire up one of these servers on heroku (first process is free) and serve it...

</comment><comment><USER8> Looking at the larger picture in this context we are moving to a world where Browser == computer.

<comment><USER9> Yes, and we're slowly loosing all the advantages of having dedicated browsers in the process.

</comment></comment><comment><USER10> I tried using this lib to make a self aware browser which can also serve requests to other browsers. but dropped it cause it didn't go well wit the sandbox model.

</comment><comment><USER11> Wow... this is awesome. But I can't think of any ways how this could be really useful. Or maybe I need more imagination.

<comment><USER12> This site allows us to return an arbitrary HTTP response to be displayed in other users' browsers?

We could all set cookies under the browserver.org domain for one thing.

Perhaps we could return some Javascript to be cached in browsers and self- replicate among users of this page. Not so sure about that one though.

</comment></comment><comment><USER13> IIRC it's just using websockets to sort of proxy http requests. They still go through a central server.

<http://news.ycombinator.com/item?id=4366555>

Also, when PeerConnection gets its Data api implemented this will be more literally possible. You could connect to someone with minimal routing from a server and then serve basically whatever peer to peer.

You know, your friends could share metadata among themselves and a webapp in your browser could provide you real time access to the files associated with that metadata when they [or their server] is online, etc.

<comment><USER14> Data API will use SCTP and not TCP so there are some considerations for implementing HTTP over SCTP based channel. Also it depends on what Congestion control the SCTP implements/enables.

There are also NAT traversal considerations which would make connection setup longer when compared to HTTP based infrastructure. Of course, as the underlying transport matures over time (or people build extensive libraries in JS to over come the deficiencies), we will see if data API will become larger than its current vision (of serving data in-band with multimedia)

[RELIABLE vs UNRELIABLE DATA CHANNEL][http://tools.ietf.org/html/draft-ietf- rtcweb-data-channel-01...](http://tools.ietf.org/html/draft-ietf-rtcweb-data- channel-01#section-3)

[CONGESTION CONTROL] [http://tools.ietf.org/html/draft-ietf-rtcweb-data- channel-01...](http://tools.ietf.org/html/draft-ietf-rtcweb-data- channel-01#section-5)

<comment><USER13> PeerConnection API supports traditional NAT traversal mechanisms though there are a very, very, very small number of cases that can be handled by a privileged user that can't be emulated in the browser.

<comment><USER14> What do you mean? Do you mean for a non-p2p applications or in general?</comment></comment></comment></comment>


Coders,do you still have problem naming things? - <AUTHOR> "There are only two hard things in Computer Science: cache invalidation and naming things." Yeah,after 5 years coding,I still do,how about you? I wish there is a tool out there helps me naming variables and functions. <comment><USER2> I believe the saying is, "There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors."

But seriously I do still have problems naming things. And when working with other developers we can never seem to agree on a good name. The name he or she chooses is usually way different that what I would choose.

</comment><comment><USER3> Sometimes it's just going to be hard. But sometimes it may be an indication that you don't know quite what the thing is, because the thing is too many things.

<comment><AUTHOR> For many new devs the hard times are too many,CODELF is a better way I guess

</comment></comment><comment><USER4> What made it easier for me was jettisoning the notion that names must be short.

1\. Names must be descriptive.

2\. Names must be unambiguous.

3\. Names should be no longer than they need to be to achieve #1 and #2

I just ask myself: what is this thing, or what is it doing?

Then take the answer to that question, and boil it down to a name.

Then look at each word in that name and try to think of different interpretations of that word. If I find some ambiguity, then change something until the ambiguity is replaced with clarity. "Change something" could be changing that one word, or a word next to it, or it could be changing the whole thing. Yes sometimes this is hard, but often it's easy.

Also for #1, the context can help a little, so in a tight scope where there's plenty of context indicating what a variable might be for, the name can be less descriptive. By contrast, for publicly exposed names, they could be used far away from their original context, so fulfilling #1 relies entirely on the name itself, with no reliance on the context.

</comment><comment><USER5> Since nowadays we all have autocompletion and good refactoring tools (to rename a variable), I usually give a pretty explicit name, even if it's sometimes more than 40 characters long. At least there's no ambiguity on the variable meaning, even if it makes the code a bit hard to read sometimes.

<comment><USER4> I would argue that descriptive and unambiguous long names make the code easier to read.

</comment></comment><comment><AUTHOR> Just found this tool,pretty new.I've tried it about 1 hours,Some how it helps,helps me to calm down to have a good mood to think. I have to say this is sweet cool. Just like it says:Search over projects from Github, Bitbucket, Google Code, Codeplex, Sourceforge, Fedora Project to find real-world usage variable names — [http://unbug.github.io/codelf/](http://unbug.github.io/codelf/)

</comment><comment><USER6> By five years you should already have a system. I went from calling things "xStuff" to "xUtils".

A level up is where you can write names in such a way it detects bugs: [http://www.joelonsoftware.com/articles/Wrong.html](http://www.joelonsoftware.com/articles/Wrong.html)

</comment><comment><USER7> Much like what Natch says, I go about it by asking myself what this function is doing and then proceeding to name it something that mirrors that. If I find myself unable to answer then perhaps the function is doing more than it should be and that also gives me a chance to break it up into simpler functions each doing something that can easily be described by its signature.

</comment><comment><USER8> I'm surprised there isn't already some sort of name generator that does this for you (like all the other startup and funny name generators). It should just ask you what it does and then convert it to some sort of camelcase or titlecase etc format with a standard convention.

Reaching here.. maybe even use AI to slowly standardize on certain things as more poeple use it?

<comment><AUTHOR> I found it [http://unbug.github.io/codelf/](http://unbug.github.io/codelf/) CODELF is base on real source codes,it really helps

</comment></comment><comment><USER9> Names can describe their nature or their function. Blending the two can be difficult.

</comment><comment><USER10> The problem is picking a name that is both abstract and descriptive.

<comment><USER4> Huh, sounds interesting. What's an example of having an abstract name, and why is that important?</comment></comment>


Privacy: Is That iPhone? - <AUTHOR> https://foundation.mozilla.org/en/blog/what-half-of-iphone-users-dont-know-about-their-privacy-new-poll/ <comment><USER2> Mozilla suggests resetting the IDFA once per month...but that seems pretty trivial to workaround? If an app you used previously starts up and sees that your IDFA changed, it's easy for that app to know that the old IDFA and the new IDFA refer to the same user!

This tracking is all possible because iOS gives every app on the device the same IDFA (advertising identifier [1]). They can then correlate all your activity and target you for ads.

I'd love if Apple just killed this feature, but barring that, why not change iOS so that it scopes these identifiers at the per-app level. Different apps on the same device see different IDFAs, but an app can still use an IDFA to target you for ads. Apple already has similar per-vendor scoping with _identifierForVendor_. [2]

[1]: [https://developer.apple.com/documentation/adsupport/asidenti...](https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier?language=objc)

[2]: [https://developer.apple.com/documentation/uikit/uidevice/162...](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)

<comment><USER3> You don't need an IDFA to track someone in the same app. You can generate your own UUID to use.

The value of the IDFA comes from coordinating user behavior across apps.

Targeting ads is one use case, but it is also used in conversion tracking, which is very valuable to advertisers. They can know if ads in one app resulted in people buying things in another app.

Edit: fixed typo

<comment><USER4> The point is that the app can just record the old IDFA, and when the IDFA changes whoever is doing the comparison between two apps knows that the old and new IDFA are one and the same.

<comment><USER5> A likely-good-enough fix would be for Apple to first make extremely clear that this is not allowed, then catch one ad framework/library provider violating the rule and ban every single app/publisher using it to ensure the rule is actually taken seriously.

<comment><USER6> How do you "catch" them? The ID is sent from the app and not in plaintext.

<comment><USER7> I imagine with the usual review process

<comment><USER6> The review process can't tell the contents of the data being sent back.

</comment></comment></comment></comment></comment></comment></comment><comment><USER2> To disable: _Settings_ > _Privacy_ > _Advertising_ > _Limit Ad Tracking_

You can also disable Location-Based Ads: _Settings_ > _Privacy_ > _Location Services_ > _System Services_ (at the bottom) > _Location-Based Apple Ads_

Apple's ad tracking help doc: [https://support.apple.com/en- us/HT205223](https://support.apple.com/en-us/HT205223) (Apparently they derive your gender based on your first name or the salutation on your iTunes account)

<comment><USER8> I just looked at the location tracking preferences and the default setting for Google maps is "always", as in "whenever your phone is on". O_o

<comment> yoz-y The phone will periodically ask you if you want to keep this setting.

<comment><USER9> As of iOS 13, specifically.

</comment></comment></comment></comment><comment><USER10> Anyone disillusioned by the thought that Apple values privacy would be well served by reading iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment - [https://gist.github.com/iosecure/357e724811fe04167332ef54e73...](https://gist.github.com/iosecure/357e724811fe04167332ef54e736670d)

There is so much more to privacy than is made apparent to the user as a few OS knobs to "limit" ad tracking.

<comment><USER11> Saved this writeup for future reference, thanks. Agreed that privacy needs more analysis than trusting a few rather opaque OS knobs.

I am a little skeptical about some of the claims in that gist, though. One example is when they claim that APNS pushes require app access to a globally unique iOS activation identifier. That seems false. According to Apple's dev docs at least, those tokens are device-and-app specific and have to be re- requested at app start time since they can be regenerated for a variety of reasons: [https://developer.apple.com/library/archive/documentation/Ne...](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html)

Seems to have nothing to do with an activation UUID from a quick glance.

I appreciate a lot of the reference material in there, but this seeming mistake of conflating 2 different UUIDs makes me a little skeptical of some of the conclusions.

Edit for correction: I think I misread this part of the gist. They never directly say that the activation UUID is given directly to the app developer, just that Apple can track your social networking app pseudonym over APNS, "and possibly the social networking service" will be able to, as well.

This to me implied that the social networking service had the activation UUID, but the author never directly said that. If the notification has your pseudonym in it and Apple's storing that when a notification goes to APNS, it does seem like Apple would be able to tie that to your device if they're peeking inside the notification payload. The solution to this would be for the app developer to not include sensitive info in notifications or for the user to disable push notifications, but an E2E encrypted trustless notification solution provided by Apple would be much nicer.

<comment><USER12> > On iOS, there is no full-disk or full-volume encryption, only varying levels > of file-based encryption, partially dependent on third-party developer > choices, such that what is, and isn't, encrypted (with encryption tied to > the user passphrase) is not always clear to the end-user.

I'm not sure about this, either; all recent iOS devices have a DMA AES engine that performs encryption on anything that travels between storage and memory.

<comment><USER13> Yeah, that's completely and obviously fucking wrong and makes me question this person's skills to be honest.

</comment></comment></comment></comment><comment><USER14> > Phone users can currently disable the IDFA, but have to do so manually; > Android users aren't even given this option

This actually false. You can change your Ad ID on Android. I just looked (and checked)If you go to Settings > Privacy > Ads you can see this IDFA. At the top (it looks like a header and not an option, so I will not fully fault Mozilla because this is a dark pattern) it says "Reset advertising ID". If you press it you can see the grey "Your advertising ID" (at the bottom) change.

Additionally, there's the option "Opt out of Ads Personalization". It has the text "Instruct apps not to use your advertising ID to build profiles or show you personalized ads." I would love if someone here could clarify this for me. Is this a suggestion to apps or is this a strict and enforceable thing? As in "Hey app, you should ignore this ID that I'm handing to you" vs "Hey app, you don't get to have this ID. Sorry." Does anyone know which it is? The language suggests to me that it is the former.

Edit: This was done on a phone running Android 10

<comment><USER15> I interpreted Mozilla's claim that Android users cannot _disable_ the advertising identifier, but can reset it. The sentence talks about periodic resetting. I might be wrong in the intention of the author(s), but that is my interpretation.

<comment><USER14> I definitely read it differently. But I can see your interpretation. Though it gets to my question about what the opt out means. Does this mean that apps don't see it? Or does it just ask that apps don't use it. Because those are two very different things. I was hoping someone on HN would know.

</comment></comment></comment><comment><USER16> Finding the settings mentioned in the article is the sole dark pattern I can think of in iOS — when you find them it's like finding a secret level in Super Mario Land.

They are under _Settings...Privacy...Advertising_

[https://imgur.com/a/EOvUzCS](https://imgur.com/a/EOvUzCS)

The _Advertising_ and _Analytics_ options are only visible below the fold, if one scrolls down the privacy page. The fold itself is disguised as the bottom of the page to put you off scrolling.

Unlike everything else, they do not have icons and only come after a paragraph of text almost perfectly large enough to fill out the vertical height where the tracking options would be.

<comment><USER12> Did you… _print_ out a screenshot of your phone?!

<comment><USER16> I applied filters and took a screenshot of the screenshot to reduce image fidelity in case it contained any [covertly embedded]* identifying information [in the form of watermarks or hidden pixels] _.

_ *added for clarity.

<comment><USER17> In case people aren't aware, such a thing _is_ possible. Companies have used steganography techniques in the past to secretly embed identifiers into movies and other visual content. It's been used to track down the movie leakers, for example.

Another example; most printers covertly embed an identifier in their prints.

I have a vague memory of a pre-release video game doing it? Or maybe it was just debugging information that they were embedding. _shrug_

Personally I don't believe Apple is doing what you describe (though maybe they might do it to a prototype iPhone). But it's certainly your right to hold that belief and take measurements to protect yourself. Shame you're getting downvoted for explaining yourself.

EDIT: Fixed a typo; thank you.

<comment><USER18> Sorry to nit-pick, but isn't the concept of hiding messages in images steganography, rather than stenography? _studying for Security+_

<comment><USER12> Yes.

</comment></comment></comment></comment></comment></comment><comment><USER19> There a bunch more things Apple could do to improve privacy they haven't done (yet?)

They could require for example that unless you're specifically making a browser (Firefox, Chrome, Brave) that your in app webview have a whitelist of domains it's allowed to contact. That would force apps to launch Safari (or better the user's choice of browser) for external links. As it is nearly every app that supports external links launches an internal webview in which they can track 100% of the activity (urls, net requests, login credentials, etc...)

They could require apps that are not specifically a camera app or audio creation app not get access to the camera or mic and have to ask the OS take pictures/video and select pictures via the OS photos app. That way less apps would be able to record things in secret or upload any/all your photos without permission.

They could disallow scanning wifi SSIDs except for network tools. Scanning SSIDs is used to figuring out a user's location with with GPS off. In iOS 13 they did add bluetooth permissions so apps can be denied scanning bluetooth to do the same but AFAIK they have not done the same for SSIDs. Not sure what that would require but would love it if they'd work on it

They could disallow using the network at a low-level except for network tools. As it is, AFAIK, any app can use the network however it likes including scanning home networks for devices with vulnerabilities. I'm sure there are implications for things like Chromecast and other IoT like devices but I'm sure there could be more privacy oriented solutions.

<comment><USER20> > As it is nearly every app that supports external links launches an internal > webview in which they can track 100% of the activity (urls, net requests, > login credentials, etc.

My understanding is that UIWebView (or WKWebView) allows the host app to do basically anything with the web view but since iOS 9 there's also SFSafariViewController that doesn't quite allow apps as much access. Many apps whose main purpose is not web browsing (like Twitter) use the latter.

> They could require apps that are not specifically a camera app or audio > creation app not get access to the camera or mic and have to ask the OS take > pictures/video and select pictures via the OS photos app.

This API (UIImagePickerController) also already exists since the very beginning but it is the app makers that think using a custom UI for photo taking or photo picking is more suitable. I personally refuse to grant apps access to my photo library except a small number of apps. (For apps like Messenger that could totally make do using the system-provided photo picker but does not, I initiate the sharing from Photos instead.)

</comment></comment><comment><USER21> OK, so, probably an ignorant question, but here I go anyway:

What, exactly, does "turning off IDFA" do? Does it send just a dummy IDFA? Or does it give you nothing at all? Why is rotating it periodically better? (I'm assuming rotation is better because that is what Mozilla is apparently recommending.)

<comment><USER12> It sends a zeroed out identifier: [https://developer.apple.com/documentation/adsupport/asidenti...](https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier)

</comment></comment><comment><USER22> Oh yes the fun thing about iOS is that the browser is super private so Google & Co have a problem but the apps themselves are also rife with trackers and there is almost no limit to what they do and barely any way to block it. I mean they only banned screenshots being taken of actual users' screens, which basically means anything that's less worse than that still goes.

As a consumer I would love a good scandal that would force them to tighten up on in-app trackers as well. But it might hurt my employers.

</comment><comment><USER23> The problem is that Apple has always claimed ios provides more privacy (& security) than android, but that's irrelevant if you don't make sure your users are capable of finding the settings. Apple has always marketed to people who are (at least perceived to be) largely tech illiterate (while claiming you have to be extremely tech savvy to use android which is a lie), so if they view their users that way they should make sure those settings are easy to find.

<comment><USER24> Android phones pump tons of location info and usage info direct to one of the biggest advertising companies in the world. On top of that, a fair number of Android phones ship with third party spyware and outright malware which cannot be uninstalled.

The iPhone is a lot better for privacy by default. It's just not as good as it _should_ be, and I do agree it's not as good as their claims suggest.

<comment><USER25> Question is, does it matter if my barn comes with a door that only closes half way, and your barn comes with a door that closes most of the way?

<comment><USER26> It depends how on how wide your horses are.

In other words, it depends on whether the difference in information leakage is information you actually care about.

</comment></comment></comment></comment><comment><USER27> A Linux phone is what we need. FirefoxOS was a great initiative from Mozilla, but now it is in the hands of a company I do not trust.

<comment><USER28> Yes, Librem 5 is our hope. Also, Pinephone.

<comment><USER29> Yeah, but why can't _anyone_ make sane size mobiles nowadays? There's literally nothing less than 5 inches on the market.

I would love something like the SEX here: [https://i.imgur.com/OKZiWrN.png](https://i.imgur.com/OKZiWrN.png)

Source: [https://news.ycombinator.com/item?id=20936147](https://news.ycombinator.com/item?id=20936147)

<comment><USER28> At least in case of Librem 5 there was no choice: the hardware working with free software is rare, which restricts the choice of SoC and the modules.

</comment></comment></comment></comment><comment><USER30> Somewhat related: when i re-install Youtube or Google Home i am automatically logged in to both apps.

Even if i delete the apps and wait weeks/months and then reinstall, i'm logged in again when i first open them.

I have enabled "Settings > Privacy > Advertising > Limit Ad Tracking" and also cleared all Safari history.

How is this possible?

<comment><USER31> I believe they store some data in your iCloud account. Uber used to do this too. The only way to get rid of it is to sign out and then again explicitly ask to delete account data on this device, then uninstall and reinstall to use the service without signing in.

<comment><USER32> What Google does is store account data that is shared with all Google apps under "Google LLC".

Go to "Settings > General > iPhone Storage" and you will find "Google LLC" where it explains the data stored is shared with all Google apps.

Microsoft does the same thing to enable you to quickly sign-in to their different apps under the name "Microsoft Corporation".

</comment></comment></comment><comment><USER33> For Google's pitch (to advertisers) for IDFA / AAID (the Android equivalent), see:

[https://support.google.com/authorizedbuyers/answer/3221407?h...](https://support.google.com/authorizedbuyers/answer/3221407?hl=en)

</comment><comment><USER34> Why does Apple have this as the default?

Now they've mostly ditched their own advertising platforms, what do they have to gain from having these default settings?

<comment><USER35> Maybe to prevent really nasty dark patterns from emerging? It would break a /lot/ of companies, I'd think

</comment></comment><comment><USER36> I saw a video on Youtube yesterday that dug into this ad campaign a bit: [https://www.youtube.com/watch?v=82N5SiOvStI&t=791s](https://www.youtube.com/watch?v=82N5SiOvStI&t=791s). I like the guy - he's a bit long-winded at times but I don't think he was incorrect about any of his points.

</comment><comment><USER37> How much of this, if any, applies when using the Facebook or IG mobile websites or PWAs? IG's PWA seems to be the same as the mobile website, except that it launches in fullscreen, with no browser address bar. When using those on Chrome, I have not received one of those dialog popups saying "m.facebook.com wants to know your location".

</comment><comment><USER38> It would be really nice if we could modify our OSes (remove the stupid IDFA completely, or send garbage) This is coming to laptops and other computers soon though, sadly.

<comment><USER39> iOS already has an option to just give out zeroes as the IDFA. Mozilla wants to change the default behavior for all the users who don't realize they can already do this.

</comment></comment><comment><USER40> Interesting. My iPhone's Limit Ad Tracking policy is already enabled with no option to disabled. Can this setting be controlled by Apps/MDM?

</comment><comment><USER41> > Phone users can currently disable the IDFA, but have to do so manually; > Android users aren't even given this option

Huh. I have never heard of this.

<comment><USER42> Too many incentives are wrong for Google. They are fundamentally an advertising company that has built their fortune monitoring users. They aren't going to build an operating system that actively works against their best interests.

</comment></comment><comment><USER43> One thing I always check when using a new install.

<comment><USER44> I'm in the same boat. I went to check after reading this and I had already disabled both settings.

</comment></comment><comment><USER12> Can we have a title that mentions "IDFA" in the title, please? (Also, I'd prefer something that wasn't as clickbaity…)

<comment><USER33> Email title change requests to email@example.com.

The mods are quite responsive to these.

</comment></comment><comment><USER45> Does this apply to webpages? As someone who installs barely any apps to what extent is this impactful?

</comment><comment><USER46> Is it possible to control from an admin perspective this if you have a managed device?

<comment><USER2> Yes! A configuration profile can set _forceLimitAdTracking_

[https://developer.apple.com/business/documentation/Configura...](https://developer.apple.com/business/documentation/Configuration- Profile-Reference.pdf#page=72)

On that topic...if you're really security conscious you can set _allowHostPairing_ to _False_. This requires a supervised device, but then your phone will only pair a computer that has the supervising certificate, and if none exists, then all pairing is disabled. This might help defend against GrayKey like attacks.

</comment></comment><comment><USER47> If only someone had created a viable alternative to both Google and Apple's phones. Maybe they could base it on the browser? Web technologies are getting pretty good these days. One of the popular browsers that are an alternative to safari and google chrome... Like some sort of browser-OS.

<comment><USER6> Every platform that has tried that for the last decade has failed - Palm, Firefox, RIM, and Microsoft have all had development platforms "based on web technologies".

<comment><USER47> This was a bit tongue-in-cheek -- I was referencing FirefoxOS, and insinuating that mozilla should have stuck to their guns (and maybe changed their batshit market strategy of racing other android vendors to the bottom-most market segment) and kept FirefoxOS in their portfolio.

If a phone OS isn't a strategic bet, I don't know what is. All the people spending money on the librem would have happily bought FFOS phones, if they made proper high spec ones (I still have one of the highest spec FFOS phones ever made and it wasn't that impressive).

</comment></comment></comment><comment><USER48> Is IDFA carried in the http request header? Can government track this too?

<comment><USER49> No the IDFA is for native apps only and does not exist on the web. It is not exposed to websites.

<comment><USER50> Native apps use http, too. Surprise. From a middleman's perspective a native app and a website aren't too different.

</comment></comment></comment><comment><USER51> Even if you opt out, then often opt you in again after iOS updates, so you need to check the setting regularly.

<comment><USER51> Why the downvote? I had enabled limit ad tracking and at least when I updated to iOS 13, limit ad tracking was suddenly turned off.

</comment></comment><comment><USER52> And on the topic of privacy and iPhone: what you can do to protect yourself from attacks: [https://blog.duple.io/how-i-can-hack-your- phone/](https://blog.duple.io/how-i-can-hack-your-phone/)

<comment><USER53> That article has some inaccuracies, particularly around brute forcing iPhones in DFU mode which is nowhere near as practical as they make it sound on newer models with Secure Enclaves.

</comment></comment><comment><USER25> Apple is all about heavy handed locking down the experience for the user's benefit as judged by Apple. Why do they even allow apps that exfiltrate data and serve ads? Just require all ads go through Apple's system, and ban apps that do anything remotely shady.

<comment><USER33> While that's one possible solution, the problem of creating one-stop shopping for any potential adversary (state actor, non-state actor, stalker, insider threat, etc.) might give pause to reconsider.</comment></comment>


Americans' Distaste for Both Trump and Clinton Is Record-Breaking (2016) - <AUTHOR> https://fivethirtyeight.com/features/americans-distaste-for-both-trump-and-clinton-is-record-breaking/?ex_cid=538twitter <comment><USER2> Scott Adams's blog, [http://blog.dilbert.com/](http://blog.dilbert.com/) is an immensely interesting and entertaining source of information on the whole Trump phenomenon.

If what he says is remotely true then politics is never going to be the same again.

<comment><USER3> As much as I love his comic strip, I'd be wary of his political analyses.

He thinks he's a trained hypnotist(hypnosis is total baloney) and he thinks he has awesome persuasion skills. Oh by the way he thinks that Trump has awesome persuasion skills as well.

I don't think there's much analysis that needs to be done for the Trump phenomenon. He is a narcissistic douche, exuding "success" according to the contemporary American standards. The mass has been completely brainwashed for the past decades, with regards to what happiness and success looks like. Case closed.

There are no magical persuasion skills at play here.

<comment><USER4> So what you're saying is that any successful "narcissistic douche", by today's standards, would have won the GOP nominations. Is that right? What about the democratic nominations? If a democratic candidate, are you saying that Trump would have won those as well?

IMHO, there are some flaws in your analysis.

<comment><USER5> It's more like democracies have been electing Celebreties more than leaders for a while now. Thanks to social media and the 247 hype cycle, the best celebs whether its Obama or Trump or Kim Kardashian, are capable of capturing the scatterbrained attention of the herd. And thats what we are wasting our time selecting for in elections...whether in US, Canada, India, Indonesia its playing out everywhere. We are going to keep electing celebrities. And thats why so many ppl are sick of it cause we know are not getting leaders.

<comment><USER6> Ronald Reagan, sure. Obama? What kind of celebrity did he have before his presidential election?

</comment></comment></comment></comment></comment><comment><USER7> Question as a non-American: why did _these_ candidates (virtually) win the primaries? Were the other candidates of the end-run liked even less? Are the voters that vote in the primaries not representative for the general population?

<comment><USER8> I've been following Bernie's run _very_ closely (and am the foolish pollyanna type that still has his fingers crossed for a miracle in California)

But, if you look at Clinton/Bernie he underperformed in States with "closed primaries" meaning people had to declare party affiliation months in advance. (New York was almost a year ago) independents and swing-voters weren't allowed to say "hey, I actually _like_ this Bernie guy."

Bernie did _overwhelmingly well_ in places with open primaries. On two occasions he "beat the polls" (IIRC -Indiana and one other had Clinton's chances of winning at ~99% and he came out with victory) open primaries are being credited with contributing to that phenomenon. People who have never voted are coming into the mix for Bernie

If you look closely you will also see a couple States where there has been either "gross incompetence" or voter suppression / electoral fraud.

People's part affiliation swapped without their knowledge, budget cuts forcing extremely long lines, running out of ballots.

In some areas around electronic voting machines, the disparity between voter counts and exit polls are higher than the ones seen at the Ukrainian election which was declared fraudulent.

In Chicago for example there was an "audit" where the observers saw the clerks alter their tallies to match the expected number.

I know that it's all very "tinfoil hat" sounding, but there are a number of places where the disparity is highly suspect.

 __Edit __: (Apologies, I started pasting in references for my outlandish claims and it got wiped because of a mobile-page-reload and have now got to decide whether or not to throw my phone out the bleeping window :))

Here's one reference covering a few points about the electoral fraud thing: [http://m.huffpost.com/us/entry/its-not-just-arizona- elec_b_9...](http://m.huffpost.com/us/entry/its-not-just-arizona- elec_b_9550670.html)

The examples have gotten more egregious since it was written though.

<comment><USER9> > I know that it's all very "tinfoil hat" sounding, but there are a number of > places where the disparity is highly suspect.

It is tinfoil hat sounding because it _is_ tinfoil hat territory.

I'm sorry, but the internet has made Sanders supporters lose touch with reality; Hillary Clinton, even at the very end, still beat Sanders by double digits (source: [http://elections.huffingtonpost.com/pollster/2016-national-d...](http://elections.huffingtonpost.com/pollster/2016-national- democratic-primary)). The Obama vs Clinton matchup was much, _much_ closer. We're only talking a few point difference.

I saw this same thing happen back in 2008 with Ron Paul. Paul supporters had a hard time believing that Paul didn't stand a chance.

The reason Clinton trounced Sanders is multifaceted; First off, Sanders is old and he's Jewish. Unfortunately, that puts some people off right away (bigotry and prejudice is still alive and well in America). Secondly, he embraced the term Socialist. While people under 40 may be aware of what that term entails (we think of European/democratic socialism, not Russian/Chinese socialism) the older generation & boomers still thinks of the commies and pinkos. America is still 10-30 years away from using that word without the stigma & negative connotations. And that kind of sums up Sanders; he's espousing an ideology that America isn't quite ready for.

We need to move further to the left a bit. Kind of like how the GOP has kept moving this country to the right over the last 35 years, we need to move it back to the center, and ultimately to the left. I'm a democratic socialist myself but even I knew Sanders didn't stand a chance. That's because I'm aware that it's going to take some time. Perhaps a couple decades. It starts with small steps, electing moderates who lean left, then finally left candidates like Sanders.

<comment><USER5> I dont think it needs to take that mucb time. Elizabeth Warren would have had a better shot than Sanders and would have still stood for a lot of the same stuff.

<comment><USER9> Well history has shown it takes _at least_ that much time. It took that much time for the republicans to push our country to the right as much as they have; it would take at least that long to push it back to the left.

</comment></comment></comment></comment></comment><comment><USER10> Nate Silver on twitter:

        No, I didn't predict the the Republican Party would lose it's fucking mind.

<comment><USER11> How could he, of all people, have not seen this coming?

Trump basically "primaried" his way to the nomination by going hard right to appeal to the Republican talk-radio base. He'll lose of, course, in the general, but that's the basic strategy of winning any Republican nomination. Many, many Republicans have won their local primaries only to lose in the general.

<comment><USER12> I don't think you can go by the previous "many Republicans" and say that Trump is going to fall prey to the same things they did. I'm not saying he's unstoppable and I'm not saying you have to throw out all conventional wisdom but he's at least so far defied most expectations (which of course are mostly based on historical data)

<comment><USER9> He's only defied expectations within his own party. The U.S consists of more than the republican party; You have independents, third parties and the democrats. So sure, he'll have those hard right neocons voting for him, but what about everyone else? What about the moderate (disenfranchised) republicans? Or the independents and democrats? I'm sorry, but I haven't met a single independent or democrat who said they'd vote for Trump. He's about as polarizing as they come. He'll get creamed in the general election. I'll go so far as to say that it will be the biggest landslide in history. I'm talking double digits.

<comment><USER13> Now that he's won the primary he can drop all the hard-right crap he's been saying and try to win over some independents and democrats.

He's never going to lose the hard right republicans to hillary so he doesn't have much to lose by completely flipping on a lot of issues

<comment><USER12> This is how I see it. I would also guess that a much larger portion of Sanders voters will not vote in the general vs everyone else who voted against Trump in the primary.

</comment></comment></comment></comment></comment></comment><comment><USER14> It's not only in USA, it's worldwide trend, you can observe same strong dislike in EU countries toward their candidates for high office. Society is divided and it seems like there is lack of good leadership this days.

<comment><USER15> Not sure what evidence there is that the quality of leaders has changed, but there is evidence that both (a) we perceive strangers differently (compared to say the 1960s), see Robert Putnam's book _Our Kids_ and (b) there are cognitive biases that push us to think things are getting worse (declinism, rosy retrospection, positivity effect).

</comment></comment><comment><USER16> Eight years. Both parties have had eight years to find candidates. This is what they give us. Talk about scraping the sludge off the bottom of the barrel.

</comment><comment><USER17> I noticed more and more politics submissions on the HN front page in the last 5-6 months. I think this is the demise of HN.

<comment><USER13> Probably because this is the most publicised primary race in history

<comment><USER17> Still it could distract from the main focus of HN and damage the community.

</comment></comment></comment><comment><USER18> Interestingly, excluding 2000 (where Gore arguably won anyway), and 1992, being the most disliked means you win...

From that, I would take that firing up your base (and thus making the other side dislike you more) is more effective than being moderate and trying to appeal to both sides.

</comment><comment><USER19> Americans sick of oligarchy, either billionaire business class or nepotism, you choose. Actually this is really great. It really says something profound about American politics.

<comment><USER11> Americans aren't sick of oligarchy, especially all the millennials that love Elon Musk, Mark Zuckerberg, etc..

</comment></comment><comment><USER20> "Americans' Distaste for Both Trump and Clinton Is Record-Breaking"

No more so than the rest of the world's distaste for the US system. Everyone else can elect a government in a couple months or even weeks. We're sick of hearing about your pretty little mini-elections. Just get on with it!

<comment><USER5> Americans invented this. Their celeb culture requires months of 247 entertainment. Now its exported everywhere. Modi in India. Trudeau in Canada. They are all just following the Obama built hype model of leadership through entertainment.

<comment><USER20> That;s not the issue. That's been around for a far longer time than Obama. What is so painful about the US system is that rather than have proper elections, say a party-wide vote for the nomination, they have this series of tiny mini-elections where every week is another battle royal. The net result is a paralysed political system where the real problems are totally ignored.

And I cannot be the only one here who's ears bleed every time I hear some pundit talk of the "black vote" or how evangelicals have this or that opinion. I see some of the CNN pundits, many of which are actually Canadian, flinch every time they are fed such lines. The American political obsession with racial and religious categories is just creepy.

<comment><USER5> Its all entertainment. I.e. meaningless bullshit. Its equivalent to the guys who review the latest episode of game of thrones for 3 hrs and have 10 hrs or random analysis lined up for the rest of the week till the next episode appears. When I see the time and effort Americans put into their pop culture its like watching aliens from another planet. And they all have so much to say, with such eloquence and speed about essentially nothing just blows my mind.</comment></comment></comment></comment>


Ask HN: Viable to open LLC to run open wifi (or TOR exit node)? - <AUTHOR>

There were some recent HN articles on persons still wrongfully getting accused of all kinds of things for having an open wifi. Even worse, "... you need balls of steel to operate a Tor exit node" http://archives.seul.org/or/talk/Sep-2009/msg00058.html<p>How well would it work (in terms of personal protection) to let an LLC own the router/server/ISP-bills? Is the concept of Limited Liability strictly financial?<p>- LLCs are relatively cheap and easy to setup<p>- LLC does not need to be "for profit"<p>- LLC is a "company", not a "corporation" (might be an important legal-entity distinction) <comment><USER2> Corporate protection does not extend to criminal acts conducted by directors, officers, or employees.

<comment><AUTHOR> Good point; though this seems to suggest that wifi/TOR is explicitly criminal.

<comment><USER2> I definitely didn't mean that. Thanks for the clarification.</comment></comment></comment>


Console-as-a-service eliminates need to build tools for customer-facing teams - <AUTHOR> http://internal.io <comment><AUTHOR> I'm a co-founder at INTERNAL. My cofounder and I spent years at multiple tech companies building internal tools (i.e. admin consoles) for non-technical teams to interact with app data they need to service customers. We found that most companies never spend enough time and resources to build these tools well, and most engineering teams would rather spend time building their customer-facing product vs building/maintaining internal tools. We launched INTERNAL to eliminate the need for eng teams to build these tools all together. Would love feedback.</comment>


Escher Illusions in LaTeX - <AUTHOR> https://www.writelatex.com/docs?snip_uri=http://www.texample.net/media/tikz/examples/TEX/escher-brick-penrose-triangle.tex&splash=none <comment><USER2> Unrelated: writelatex.com is the only site I've noticed that sees when you don't load some of the JS it requires from third-party domains, and warns you about it! Great little feature.

<comment><USER3> Thanks for noticing :) That check has greatly reduced the number of confusing support requests we receive.

</comment></comment><comment><USER4> For those who want to see more, this is build using PGF/TIKZ, a library with one of the most extensive and awesomely looking documentations around:

[http://mirror.jmu.edu/pub/CTAN/graphics/pgf/base/doc/generic...](http://mirror.jmu.edu/pub/CTAN/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf)

<comment><USER5> I've used TeX/LaTeX for 24 years and I look at PGF/TikZ and it seems more verbose than I can stand. Do you edit it by hand, which seems to be the case for simpler diagrams, or is there a map/transform application that can take output from drawing applications?

</comment></comment><comment><USER6> This is really cool! I always wanted to do an impossible shape in PostScript, this makes me want to take the time to actually do it. Thanks for sharing!

<comment><AUTHOR> No problem :-) I loved this example when I first saw it, and someone shared it with me again today so I decided to post it here.

</comment></comment><comment><USER7> I imagine this would be a great way to make logos for your startup.

</comment><comment><USER8> Has anyone tried using something like emscripten to set up a version of TeX that can run in the browser?

<comment><USER9> Yes: <http://manuels.github.com/texlive.js/website/> \-- "This is a port of TeX live 2012 to Javascript."

Also related: <http://www.mathjax.org/>

<comment><AUTHOR> The port to Javascript is really neat, I remember when that was on HN a month or so ago</comment></comment></comment>


Simple Mobile Wedding Map - <AUTHOR> I just released a new version of the wedding map product I created a few years ago. I've been meaning to create one that is more mobile friendly so if you're planning a wedding (or similar event) and have a lot of people coming to town you can given them a link to a map that has all of the venues, hotels, local attractions, etc. on it.
Then they can easily get directions between locations as well as add their own locations to their personal view of the map (locations they add will only display on their device).
I tried to make it as simple as possible. Would love any feedback people might have.
Here's an example wedding map:
http://tools.weddingmapper.com/stephandtony2007
and here's the mobile version (best viewed on a mobile device):
http://www.weddingmapper.com/mobile/stephandtony2007 <comment><AUTHOR> Also, in case it isn't obvious, you can create your own map from the website:

[http://www.weddingmapper.com](http://www.weddingmapper.com)

and here are the links from the description in clickable format:

[http://tools.weddingmapper.com/stephandtony2007](http://tools.weddingmapper.com/stephandtony2007)

[http://www.weddingmapper.com/mobile/stephandtony2007](http://www.weddingmapper.com/mobile/stephandtony2007)</comment>


Netflix Plans to Raise $2B More, Bringing Debt Load to over $12B - <AUTHOR> https://variety.com/2019/digital/news/netflix-2-billion-debt-load-1203195285/ <comment><USER2> i hope it's no to hit us with the next wave of low budget tv that we mostly received with the last round; hopefully they learned from mistakes and this time will be better!</comment>


Optimizing Rust Struct Size - <AUTHOR> http://camlorn.net/posts/April%202017/rust-struct-field-reordering.html <comment><USER2> This is pretty cool!

A few thoughts from a C/C++ perspective (I have only tinkered briefly with Rust):

\- This effectively makes the optimization algorithm part of the Rust ABI; you cannot change (or even fix a bug in) the layout algorithm without breaking binary compatibility. The simpler the algorithm, the less of a concern this would be.

\- In a systems programming context, you don't always want to optimize a struct for size. You may reorder a large struct to optimize for other properties like cache coherency, or because you have to match a memory layout specified by other software or even hardware. Obviously one can still use 'repr(C)' for these cases.

\- Related to the prior point, it's a little disconcerting that adding a field to the end of a struct declaration can completely change the layout. Sometimes in C/C++ land programmers 'cheat' by adding fields to the end of a struct that's used in multiple modules, and initially only recompile the modules that need to know about the new field. (For purposes of compilation expediency/iteration speed.)

\- This seems like it may violate the principle of least-surprise pretty badly. As long as we continue to use debuggers and have crash dumps, systems programmers will sometimes need to look at raw memory data and figure out what the structure is. If the field layout isn't easily predicted, that may be very difficult. In my experience there can be huge benefits to minimizing the number of opaque/hard-to-predict transformations between authored data and its final representation. (In this case, the struct declaration and its final memory layout.)

For these reasons it seems like this auto-reorder behavior might be better as an opt-in rather than opt-out behavior (which it sounds like it is.) Regardless, it's still a feature I wish I could have in C++ from time to time!

<comment><USER3> _> Sometimes in C/C++ land programmers 'cheat' by adding fields to the end of a struct that's used in multiple modules, and initially only recompile the modules that need to know about the new field. (For purposes of compilation expediency/iteration speed.)_

How would that work, with some modules assuming an incorrect size for a given type?

I agree with your concerns regarding debuggers and crash dumps, though in my experience you need debuggers far less often when writing Rust code, and when you do need them (e.g. for unsafe code) you've often already used `repr(C)` on the types of interest.

<comment><USER4> The correct type layout is already encoded in debuginfo, so I'm not sure how that's a problem unless you're avoiding a debugger intentionally or simply can't use one?

<comment><USER3> Do we generate debuginfo by default at -O? If so, then TIL. :)

<comment><USER4> Not by default, no, but what I mean that if you're debugging you can just enable debuginfo and _that_ will contain the descriptions of the types including all fields, with the right offsets and everything.

</comment></comment></comment></comment></comment><comment><USER5> For those that didn't read the whole thing. The author is blind !

Very impressive effort to work on something as technical as optimising a Rust compiler.

And to write about it so eloquently just makes it even more impressive.

<comment><USER6> I wonder if the rise of standardised formatting for source code helps here?

<comment><USER7> Depends on the standard. there are parts of pep8 that are nearly impossible for me to follow, namely the bits about indenting complex expressions that span multiple lines. I mostly don't care about it, save for indenting by fixed amounts at every {. My screen reader can announce changes in indentation level, so it's a way to not have to remember if we're 3 or 10 braces in.

I make the effort to match formatting but I hate it because I get basically no benefit, and the early reviews here had lots of places where eddyb made me change it until I finally learned all the rules for this project. A standard formatting tool and official list of rules for Rust is in the works. That'll be nice to have.

<comment><USER6> Thank you for your reply, I never would have thought of indentation being useful. It would be interesting to see what a programming language designed to be optimal for conveying information through screen readers would turn into. I wouldn't be surprised it it would lead to something with very nice formatting for people who don't need such tools as well.

<comment><USER7> This is admittedly a bit ranty, but it hits some important points that a lot of sighted people miss, so I'm posting it anyway.

People have started going down the blind programming language road; look up Quorum. What's not obvious about it is that mostly it's used at schools for the blind.

But I think it's incredibly stupid. I'm a very good C++ programmer. I'm at least reasonable at Python. I know enough Haskell that I'm no longer actively frightened of the monad (i.e. a newbie, but past the biggest hurdle). Obviously I both know and actively like Rust.

You can make a programming language for the blind. You can't make people use it. if we go down that path, we end up in a world where blind programmers work for the blind programming shop because the rehab agencies push you there. And then you make less money.

I know at least 10 other blind programmers. 3 of them either work or have worked at Microsoft. 2 of them maintain my screen reader, which is something around 40000 lines of C++ and Python doing incredibly complicated things to fully hook into the OS. One of them is either currently at or has worked at Google; I'm not in touch with him anymore, so I don't know if he moved on or not.

We don't need programming languages for the blind. We need people to stop tying technologies closely to IDEs and then not making said IDEs accessible.

My other project, Libaudioverse, is cross platform. The irony is that this is because VS was inaccessible. I used CMake instead and learned cdb when I needed a debugger. VS is at the point of dreadfully inconvenient but workable now, but I still don't use the Microsoft stack. It puts me in the position of being at their mercy--if they roll out a new UI tomorrow and it's inaccessible (as they did with 2010), all my personal projects stop instantly, and I maybe lose my job when my employer upgrades it, depending how bad it is. Microsoft is one of the better places for accessibility; there are issues with VS for screen reader users that have been around and reported for years.

</comment></comment></comment></comment></comment><comment><USER8> That's a great work and great write-up. I'm happy it finally landed.

BTW: Rust team now runs unit tests of packages on crates.io, so each compiler release is verified against almost all public Rust code.

<comment><USER3> To elaborate: for a long time (since before 1.0) Rust has had a tool called Crater, which attempts to compile every library on crates.io using two different versions of the compiler, to see if the newer version of the compiler has caused any regressions. What's happened recently is that Crater has been superceded by a new tool, called Cargobomb, which not only compiles public Rust code, but also attempts to run test suites (among other things, see [https://github.com/brson/cargobomb/blob/master/README.md](https://github.com/brson/cargobomb/blob/master/README.md)). What's great about this new approach is that it can find regressions that wouldn't manifest as compilation errors, such as the field reordering changes described in the OP.

<comment><USER9> > which not only compiles public Rust code, but also attempts to run test > suites

Ah, giving CPAN Testers[1] some competition. :)

If you haven't already got plans for it (or already done it!), I highly suggest starting an initiative to get lots of donated resources so you can really fill out a testing matrix and make it public[2]. Perl's CPAN a good place to look for what works and what they would do differently (or what they have planned), as they have an _amazingly_ robust module testing ecosystem.

1: [http://www.cpantesters.org/](http://www.cpantesters.org/)

2: [http://matrix.cpantesters.org/?dist=Path- Tiny+0.104](http://matrix.cpantesters.org/?dist=Path-Tiny+0.104)

</comment></comment></comment><comment><USER3> Using fuel to enable a binary search to uncover misapplied optimizations is very clever! I always just figured that fuel was used to avoid pathological behavior in the optimizer by putting an upper bound on the time spent optimizing.

<comment><USER7> The first time I think I saw the idea was [0], but I don't know if this is the post that got linked in the discussion threads. Rust didn't have fuel at all until after my changes, and I don't think it's necessary to use it as a limit unless you're letting the optimizer run on the optimizer's output until it stops changing. The number of optimizations Rustc can run is already finite because it doesn't do so.

nonetheless, the idea isn't original to us.

0: [http://blog.ezyang.com/2011/06/debugging-compilers-with- opti...](http://blog.ezyang.com/2011/06/debugging-compilers-with-optimization- fuel/)

</comment></comment><comment><USER10> While this might be pretty rare, I can see how one would want some fields in large structs to stay close to one another to stay in the same cache lines. If the compiler moves things at will, you lose the ability to do such things... I guess you could still use repr(C) and optmize manually, then...

<comment><USER11> One thing to consider in this respect is the optimisation won't/can't separate out the subfields of a field, meaning `struct Foo { ... x: SomeStruct ... }` will reorder x as a whole, keeping the fields of SomeStruct together. Fields that are accessed together often could theoretically be pulled out into a separate type, which, depending on the codebase, may be a nice idea anyway. (Similarly, one could group the fields in a tuple, `x: T, y: U` => `xy: (T, U)`, although this is... rather ugly.)

This property also ensures a (hypothetical) type like `CachePadded<T>`, which keeps a value of type T in its own cache line, works as expected.

</comment></comment><comment><USER12> That's always been a question in language design - follow the user's layout, or pack for the machine? For C compatibility, anything passed to C now needs 'repr(C)'. One would think that would be 'repr("C")', since here, "C" is neither a reserved word nor a variable, but, whatever.

Pascal had "packed" as an option for structures and arrays. Using "packed array of boolean" got you a bit array. Rust has "repr(packed)", but it was broken as of Rust 1.0. Something that has no machine address, such as an individual bit, is apparently troublesome. C supports bit fields in structs, but that feature is seldom used.

<comment><USER4> > now needs 'repr(C)'

It always has, we lint for this, and the Rust struct layout has been officially left unspecified (making assumptions based on it UB) from before 1.0, anyway.

> One would think that would be 'repr("C")', since here, "C" is neither a > reserved word nor a variable, but, whatever.

Neither is 'repr' \- they're both just identifiers in an attribute. #[attr("string literal")] is newer and still unstable (as part of the new macro system).

The bit array packing is something we've wanted to do for a long while, but it requires an opt-in along the lines of "disallow taking references to any (sub- byte) fields".

#[repr(packed)] is the same as the C equivalent, be it attribute or pragma, in that it only removes alignment padding and does nothing to booleans.

</comment></comment><comment><USER13> What if there was an option to rewrite the source .rs file into the matching layout? I'd imagine that could be useful in scenarios where one has to manually do something with a dump or disassembly, etc. Plus then it could be linted against if a project wanted to ("code does not match in memory layout, use --rearrange-structs to correct").

<comment><USER14> In generic code, the generated layouts can't even be written in a universal way, because they can vary depending on those input types.

</comment></comment><comment><USER15> Somebody should hire this guy to work on the compiler full-time.

<comment><USER3> Mozilla gives the Rust devs an annual budget for hiring contractors, and indeed these often end up going to well-known community members who are tackling major initiatives. I don't know if camlorn is one of these people (he's well-known, certainly), but quoting aturon from [https://www.reddit.com/r/rust/comments/64t251/mozilla_awards...](https://www.reddit.com/r/rust/comments/64t251/mozilla_awards_50000_to_the_tokio_asynchronous_io/dg62o0a/) :

 _" the Mozilla Rust team awards contracts, grants and internships more directly. We haven't tended to make a lot of fanfare around these in the past, but the general strategy has been to support people who have been doing amazing volunteer work so that they can do that work full time for a stretch. That's covered work from eddyb on the compiler, Integer 32 on crates.io and Rust training, dtolnay on Serde and other library work, jseyfried on the new macro system, carllerche on mio and Tokio, and withoutboats on a variety of topics -- and that's all this year! Beyond that, we have academic grants for research into Rust for HPC (really large-scale servers/clusters), and foundational work around the unsafe guidelines/formal semantics for Rust."_

 _" In general we have a preference toward supporting people who are already doing great work in the ecosystem, rather than continually expanding the internal Mozilla team. We want Rust to grow and find support far beyond Mozilla, and this is one way of nudging things in that direction, while bolstering the ecosystem at the same time."_

 _" While we've awarded almost all of our contracting money for this year, please feel free to reach out to me at email@example.com if you have interest in small (~3 months) contract work to help push a piece of the Rust ecosystem (or tooling, or docs, or ...) over the finish line."_

<comment><USER7> Didn't know about this. I'll have to see if I can stay involved with some sort of project--the problem is that, currently, the one I was doing is...well...done.

I don't want to leave the Rust ecosystem, and I'd kill to keep working in it. But I didn't realize that there was any source of general funding from Mozilla specifically targeted at Rust. This whole thing was done simply because I'm bored and had a lot of free time and also we thought it would only take a few weeks. Money was far from the motivation initially, but certainly it occurred to me later on that it's amazing for the resume.

</comment></comment></comment><comment><USER16> anyone know how this plays with generics? With it generate different, optimal layouts for each instantiation, i.e. will HashMap<u64,64> have a different layout than Hashmap<u16,u32>? Because that would be a huge win

<comment><USER7> Yes, it will do exactly that.

<comment><USER17> I think in this case it doesn't, because the `HashMap` implementation just stores everything behind an untyped pointer.

[https://github.com/rust- lang/rust/blob/master/src/libstd/col...](https://github.com/rust- lang/rust/blob/master/src/libstd/collections/hash/table.rs#L115-L123)

It would be cool to see if the "we'll manage our own pointers, thanks" approach makes less sense with this optimization in place. It would be nice; the source is pretty inscrutable, mostly in the interest of performance, I think.

Edit: Or, maybe more importantly: in the untyped memory they store hashes and (K,V) pairs separately, so I think the only opportunity is to swap (K,V) for (V,K).

<comment><USER7> I haven't looked at libstd, so I can't comment to that specifically. But we don't reorder two-field structs.

Rustc special cases them in a lot of places to do things that I will not even pretend to understand, and not reordering 2-element structs keeps them working. Since this already took 6 months of my free time (I have a lot of free time, though not 40 hours a week admittedly), this was for the best.

You can make an argument that we should have, but it doesn't matter from the user's perspective. (a, b) is the same size as (b, a) no matter what a and b are.

</comment></comment></comment></comment><comment> Ono-Sendai Interesting. Did it result in any speedups?

</comment><comment><USER18> I wonder whether this would be better as an external tool? It seems almost inappropriate for a systems language.

It seems like a great way to boost performance, but performance isn't everything. Compiler simplicity should also be a goal (though perhaps difficult with rust, I think it's worth some effort). Debuggability should be a goal.

And I think some kind of ABI guarantees would be nice eventually after the rest of the language stabilizes.

<comment><USER7> In fairness, the compiler is actually simpler now. Perhaps not as simple as if fields were always in order, but we only determine what type layouts should be in one place instead of two now, and 99% of what you have to do in the rest of it is just foo.memory_index[i] instead of i in all the places you want a field index.

There's also a helper function that lets you invert it. The part of the compiler that builds LLVM types just uses this.

The cost here isn't complexity, it's that "Fields are in increasing order by offset" has been baked into the compiler for years and you have to make sure to change them all.

</comment></comment><comment><USER19> Great write-up!

</comment><comment><USER20> This is impossible. His brain should be connected directly to tensor flow to continue his work.</comment>


Ask HN: Algorithm to help humans learn? - <AUTHOR> So, I'm building a simple flashcards/memorization game and would like to boost it further by helping people learn.
Is there some study/algorithm that correlates the times you have seen something, the time to learn, the frequency and distance of when you last saw it(something you've seen yesterday is easier to remember than something you've seen 2 years ago).
Could be something simple, just to start off. I tried to google it, but it's hard. Algorithms and learning always end up with something about "teaching computers to learn/AI", when I actually want to help humans... <comment><USER2> Yes, this is a well-studied problem.

Here is some information from SuperMemo: [https://www.supermemo.com/english/ol/sm2.htm](https://www.supermemo.com/english/ol/sm2.htm)

This algorithm is used in other programs like Anki ([https://apps.ankiweb.net/docs/manual.html#studying](https://apps.ankiweb.net/docs/manual.html#studying)) and Mnemosyne ([https://mnemosyne-proj.org/help/memory- research](https://mnemosyne-proj.org/help/memory-research)).

Good luck with your program!

<comment><AUTHOR> thanks a lot! <3</comment></comment>


Charity claims it owns "Happy Birthday" song's copyright - <AUTHOR> http://arstechnica.com/tech-policy/2015/11/a-new-happy-birthday-boss-charity-claims-it-owns-famous-songs-copyright/ <comment> raving-richard Please note: "Happy Birthday" is well out of copyright in a number of countries that aren't the USA. Including Australia, and any other country that applied the rule that copyright expired 50 years after the death of the author. According to Wikipedia, the copyright expires in the EU at the end of next year (70 years after the death of the last author).

The fact that copyright extends for so long is a travesty and is something that we all should be fighting against (along with all the myriad of other injustices around...).

</comment><comment><USER2> This case is sufficiently absurd that its very existence hurts the credibility of the courts. They're allowing peoples' right to sing "Happy Birthday" to depend on the details of a sale that took place in _1893_.

</comment><comment><USER3> Ancient copyrights are the ultimate rent seeking of our time.

<comment><USER4> Not land ownership?

<comment><USER5> The difference between land and music is that _land is actually scarce_.

<comment><USER6> Also, nobody ever really _builds_ expensive things on top of music that they'll lose if it's suddenly played by other people.

<comment><USER7> Actually they sort of do: people make derivative works or compilations that become encumbered when something out of copyright is found to be in copyright again. Something which _has_ happened thanks to nonsense like "common law" state copyrights and retroactive extensions.

Of course, that's an argument against the practice rather than for it.

</comment></comment></comment></comment></comment><comment><USER8> How on earth is a 100+ year old song still in copyright anyway, even if the author was known?

<comment><USER9> It looks like this will be the norm in a couple of years. I expect that there will be a time when no music or books are entering the public domain anymore.

<comment><USER10> We're basically there already. Disney pushes back the copyright date every decade or two so that Mickey Mouse (steamboat willy, 1920s) never gets into the public domain.

<comment><USER11> The ip Disney is trying to protect is Winnie the poo.

</comment></comment></comment></comment><comment><USER12> It's a good thing TPP will strengthen copyright laws and lengthen terms, err wait, what did I say?

</comment><comment><USER13> a few weeks ago the supreme court said it wasn't able to have the copyright law applied to it

</comment><comment><USER14> A "birthday charity" sounds like a great idea to me.

Have a party, sing the song, everyone present donates $1 to charity for the "licensing rights".

I haven't done the math, but I'm sure it's not an insignificant amount of money.

Charity: water has a program similar to this.

<comment><USER15> Except collecting donations for charity:water actually goes to bring water to developing countries instead of the pockets of billionaires. Minor difference.

<comment><USER14> My comment did not advocate benefiting billionaires.</comment></comment></comment>


Ask HN: Do you use shared spreadsheets at your office? - <AUTHOR>

Are you organizing your work by sharing spreadsheets with your colleagues? If so, what's the purpose of these shared spreadsheets? e.g. do you use shared spreadsheets to organize your office space? <comment><USER2> We keep a spreadsheet of acceptance tests for each app we make. Like this:

[http://imgur.com/EDqTnrw](http://imgur.com/EDqTnrw)

It's Google docs, so lots of us can work through the tests at the same time.

We also have shared spreadsheets for project story estimating, cashflow forecasts and profit and loss forecasts.

</comment><comment><USER3> Let's see: \- passwords (terrible, I know) \- funnel analytics \- list of SDKs in apps</comment>


Show HN: Better Budgeting App – Find Success in Your Savings - <AUTHOR> http://betterbudgetingapp.com <comment><USER2> I've traversed many budgeting apps and I currently use YNAB. I signed up for the beta program because I'm obsessed with budgeting and love trying new programs, but I would love to see a break down of how you differentiate yourself in this relatively crowded market.</comment>


Petition for pardoning Edward Snowden - <AUTHOR> https://petitions.whitehouse.gov//petition/give-presidential-pardon-edward-snowden-any-crimes-comitted

<comment><USER2> While I applaud the goal, politicians pay far more attention to dead-tree snail mail.

</comment><comment><USER3> Have any successful petitions on whitehouse.gov resulted in actual _productive_ action, or are they simply additional topic generators for the administration's speech writers?

<comment><USER4> Found one where people asked the white house to release their beer recipe... [https://petitions.whitehouse.gov/response/ale-chief-white- ho...](https://petitions.whitehouse.gov/response/ale-chief-white-house-beer- recipe)

Source: [http://www.npr.org/2013/01/03/168564135/white-houses-we- the-...](http://www.npr.org/2013/01/03/168564135/white-houses-we-the-people- petitions-find-mixed-success)</comment></comment>


Ask HN: Where do you store your photos? - <AUTHOR> I'm thinking about moving away from the cloud and building my own. I was wondering where you store the photos you take on vacation <comment><USER2> I have moved away from Google Photos and it took me a looong time to find another service that was as reliable and easy to use. I didn't want to spend too much money on it and I wanted it to be reliable and that it would give me enough control.

I tried a few photos-only clouds like shoebox or Canon Irista (recently defunct) but I find them all very lacklustres.

Dropbox was the best alternative I found but it was bit expensive for my taste and I wasn't fully happy with it. For example you can put data on the SD Card.

Here is what I ended up with and I am the happiest I have ever been: Note: I don't actually have that many photos, but I use this solution for all my cloud storage.

I have VPS on Scaleway (~3 €/month) where I run a Resilio Sync instance. This means I have all the data on all 3 of the devices (I use an SD Card on my phone, resilio is one of the services that will allow you to put data on it)

I run a second instance on my phone and a third on my laptop. This way, if one of them dies/lost I have 2 backups.

And to top it all, I backup everything to Backblaze B2 storage bucket with CloudBerry. Which costs me something like 1€/year.

All in all, I am very happy, it's a solid setup, all the files are safe and always with me.

Here is the blog post I followed to set it up.

[https://www.danielandrade.net/2017/07/22/roll-your-own- secur...](https://www.danielandrade.net/2017/07/22/roll-your-own-secure- dropbox-alternative/)

<comment><AUTHOR> Sounds interesting! I don't like dropbox due to the price as well. Also, I'm looking for a better solution in terms of privacy, that's why I'm considering running my own little server

</comment></comment><comment><USER3> I got fed up with abandoned photo apps, failed photo startups, software that wouldn't scale to hold my library, and companies using my metadata for ad targeting, so I quit my office job and started building what my family needed. You host it on your own hardware. [https://photostructure.com/about/introducing- photostructure/](https://photostructure.com/about/introducing-photostructure/)

</comment><comment><USER4> Personal internet-accessible server.

I thought Dropbox would be the way to go initially but I had too many problems with it while travelling in foreign countries. I ended up 'rolling my own'.

</comment><comment><USER5> I've got a Synology DiskStation at home and use the "Moments"-App for my photos. Works like a charm.</comment>


Adeo Ressi: In Australia you're getting it wrong - <AUTHOR> http://www.brw.com.au/p/business/ressi_australia_you_start_getting_i3CEPkrtJd5B28dzIl5lrJ

<comment><USER2> A VC nut job from the environment that brought the world Yo! and that $40 "take your trash out for you" service says Australia is doing it "wrong".

There are plenty of things Australia could improve. Adopting the US' approach to VC funding is not one of them.

</comment><comment><USER3> Is this the same guy that does psycho-analysis on founders before giving them funding?</comment>


Ask HN: Would Video Games Requiring Real-World Education Work? - <AUTHOR>

I'm brainstorming an idea where someone has created an RPG. The only way to succeed in this RPG is to master real-world knowledge. For example, Medicine or Healing may be an aspect of the game. For someone to achieve expert level in the game, they would have needed to prove to the game (through some mechanism) they have doctor-level knowledge.
Often we hear about applying game-tactics like achievements and leveling-up to real-world activities to keep people working toward their goals. What about putting real world study into an RPG to keep progress toward goals in the game?
Imagine World of Warcraft level obsession with mastering a dozen fields of science. <comment><USER2> I think it would work - essentially, this is the entire premise of the simulation market; the only difference is a lesser emphasis placed on motor skills due to it being an RPG. Mastering Gran Turismo / Forza requires players to learn quite a bit about real-world vehicle dynamics, for example. The caveat is that, in your example, the cumulative knowledge required to develop the game would be equal to mastery of every in-game class. You would need several teams of expert consultants to create and model scenarios, much like TV shows that deal with medicine, military, forensics, etc. Realistically, it would make a lot more sense to narrow the focus to one or a few domains.

</comment><comment><USER3> [http://www.somethingawful.com/d/feature-articles/project- hip...](http://www.somethingawful.com/d/feature-articles/project-hippasus- interview.php) basically this idea but with math

I don't think it ever came out though.

edit: <http://en.wikipedia.org/wiki/A_Tale_in_the_Desert> also comes to mind. Not specifically real world knowledge based, but advancement is generally tied to the user's real world skills (at least partially) rather than the normal fair.

</comment><comment><USER3> <http://en.wikipedia.org/wiki/Trauma_Team> is the closest I can think of in the medical field. I do not know particularly how accurate it is, but if you cut down the hand-holding and copious reference material it would fit the bill.

</comment><comment> Rob-Goodier "Imagine World of Warcraft level obsession with mastering a dozen fields of science." That would be amazing. It might take off if it were framed as a regular RPG and the education was slipped in without highlighting it.

Or, on the other hand, if you scaled down your expectations to make it accessible to middle and high school students, rather than medical school students, it might become popular in schools - something like the Oregon Trail.</comment>


Ask HN: Should Web designers know HTML and CSS? - <AUTHOR>

Simply put: Am I crazy for expecting a Web designer to know how to work with HTML and CSS?
I've been a Web developer for many years (since 1993), and I've been an independent contractor/consultant since 1995, working with many different designers, developers, and other companies.  I was born and raised in the US, but have been living and working in Israel for many years.  My clients are in a mix of Israel, the US, and Europe.
In general, Web designers in Israel aren't expected to know HTML and CSS.  They are expected to come up with one or more pages of Photoshop.  The "cutting" of the Photoshop into HTML and CSS is considered to be the domain of the programmer.  Increasingly, I've found that my Israeli clients are surprised (and even a bit hostile) when I say that I expect any decent Web designer to be able to work with HTML and CSS files, and even some JavaScript -- although I admit that the responsibility for JavaScript is a bit of a gray area between the developer and the designer.
Am I wrong to have such expectations?  I find it totally weird and wrong-headed to think that a Web designer, who presumably makes their living working on the Web, doesn't have a clue about CSS and how it works, and assumes that this will be taken care of by a programmer.  The analogy that I've used is that of a photographer: When I hire a photographer, I don't expect them to sketch what they want on paper, and then hand it to a technician who will aim, focus, and click the shutter.
I've been told that these expectations are unreasonable, but my expectations are (I believe) more than reasonable, and are the norm outside of Israel.  But I'm curious to hear what other HN community members think...
Thanks in advance,
Reuven <comment><USER2> I'm a web developer also and I work with clients mostly in Europe, Australia and the U.S. My clients are generally other developers contracting the back- end stuff to me. Generally the design is done by one source, someone else will do the HTML / CSS and then I weave everything into a working site. So, your experience has been the same as mine.

I have never done design work, but this system makes a lot of sense to me for all sides. If you hire a high end designer you may not want to pay the same high end rates for that designer to do the HTML / CSS as well. That same high end designer may not want to bother with that sort of work, especially if that person has a lot of design work queued up.

Because there are a lot of choices for people who can do HTML / CSS, I wouldn't expect the designer to do this, especially if that designer is great to work with (great to work with is highly valuable in the freelance world.)

HTML / CSS is easy enough to pick up that designers should know it, but I don't think it should be a requirement. The only time I have seen problems with this is with designers who have a heavy print background and hand over a design which would looks like it belongs in a magazine or brochure.

Another thing to consider is that the fastest front-end developers are those who do a lot of it. If I'm in a crunch for time, I would rather hire someone who is a specialist on the front end who could pump out the work much faster than someone who spends far more time in design than development.

EDIT: Actually, I think I veered away from the question.

Should web designers KNOW HTML / CSS? Yes. I think it would be difficult to get to the point of supporting yourself as a freelance web designer without learning HTML / CSS somewhere along the way.

Should web designers be expected to do HTML / CSS work? Not necessarily.

</comment><comment><USER3> It sounds to me as though you might be expecting the web designer to be both a designer and a frontend developer. It's critical that any web designer knows enough about HTML/CSS to know the limitations of the medium and what they can design but not necessarily enough to code it.

I think ideally, both the designer and frontend developer should be capable of slicing up a PSD. I'm a frontend developer, and I prefer to do that myself so I can save things in the optimal sizes and filetypes for my workflow. If the designer does it, they will be creating slices based on their opinion of how the website should be coded.

I don't think the responsibility for JavaScript is a gray area at all, it falls on the developer. It becomes a gray area when you remove one of the pieces of the puzzle, the frontend developer.

I also don't think your photographer analogy is fair. A photographers job can be defined as a person who takes photos. A designers job is most often defined as someone who creates designs.

It sounds like you're more of a backend developer, wanting to use a designer as a designer and frontend developer. You'll probably save money and get a better result if you have the designer stick to design and higher a third- party to quickly slice and code your PSD.

<comment><AUTHOR> I'm not at all expecting the graphic designer to be a frontend developer. I've said all along that I'm happy to take care of whatever JavaScript is necessary.

But there's a difference between knowing the technical side of HTML + CSS + JavaScript (which I certainly do) and being able to make a nice-looking interface that takes into account all sorts of browser issues and limitations.

The fact that most designers I've met in Israel wash their hands 100% from anything Web oriented, saying that they're responsible for making PSDs and that the rest is for the programmers to handle, seems very weird to me.

That said, an experienced front-end developer is always welcome on a project, and can certainly help to bridge this gap. But I really wouldn't want a front- end developer to be wasting their time making the initial HTML and CSS from PSDs. Rather, I would want them to tweak, change, and improve what the designer did, and then make a good in-browser experience that communicates with the server.

</comment></comment><comment><USER4> Are you crazy?

No

Should anyone doing design for the web (in all it's flavors) be familiar with HTML and CSS?

Yes

Yes

Yes

Even if they're not wizards with it, they should have a core understanding of the medium, it's limitations, and how to work within them on a basic level.

Javascript, maybe not so much - understand what it is, why it's needed, and where it should be applied, but it shouldn't be "required" so long as they have a developer on the team who can work with them to implement javascript / "ajax" functionality into their design properly.

</comment><comment><USER5> I would expect a designer to know just enough to design for the web but shouldn't go full blown into what is absolute and relative,how to get to get a container to stretch with floating divs inside, what a variable is, or an if else statement.

People really should stick to what they are good at and stop being jack of all trades. There are way too many people claiming to be deselopers out there and I have only seen a handful that are decent.

</comment><comment><USER6> I've seen some situations where "web designers" without any knowledge of html/css were producing designs that look more like they are for print, not for web.

If you want to make the workflow smooth and productive, the designs need to be realistic and properly layered so the web dev can do the work better and faster. I don't really see that happening in a situation when the designer has completely no clue about html/css.

</comment><comment><USER7> my answer: yes yes yes, a million times yes. I found this article to be spot on and completely agree with everything the author says: <http://andyrutledge.com/web-design-is-product-design.php>

</comment><comment><USER8> I'm a developer and while I do know CSS and html, I'm not a designer. I've cut up Photoshop templates in the past, but I usually leave it up to a designer.

Designers need to know at least some CSS or html. If not, then they are just graphic designers, not web designers.

</comment><comment><USER9> A web designer who can't make a web page is just a designer.</comment>


50 Useful CSS Snippets Every Designer Should Have - <AUTHOR> http://www.hongkiat.com/blog/css-snippets-for-designers/

<comment><USER2> With Compass Mixins + SASS/SCSS, I don't look at these anymore. Compass mixins are so convenient. I think people should start using LESS or SASS. It makes life so much easier. <http://compass-style.org/index/mixins/>

<comment><AUTHOR> Thanks I really do not know much about Mixins, but I have seen the discussion countless times here on HN. I will have to look into it soon.</comment></comment>