How to sleep at night having a cloud service: common architecture do's - <AUTHOR> https://danielsada.tech/blog/cloud-services-dos/ <comment><USER2> One thing missing here is to avoid synchronous communication. Sync comms tie client state to server state; if the server fails, the client will be responsible for handling it.

If you use queue-based services your clients can 'fire and forget', and then your error handling logic can be encapsulated by the queue/ consumers.

This means that if you deploy broken code rather than a cascading failure across all of your systems you just have a queue backup. Queue backups are also really easy to monitor, and make a great smoke-signal alert.

The other way to go, for sync comms, would be circuit breakers.

My current project uses queue-based communications exclusively and it's great. I have retry-queues, which use over-provisioned compute, and a dead-letter for manually investigating messages that caused persistent failures.

Isolation of state is probably the #1 suggestion I have for building scalable, resilient, self-healing services.

100% agree with and would echo the content in the article, otherwise.

edit: Also, idempotency. It's worth taking the time to write idempotent services.

<comment><USER3> Queues introduce entire other dimensions of complexity. Now you've got to monitor your queue size (and ideally autoscale when the queue backlog grows), and have a dead letter queue for messages that failed processing and monitor that. Tracing requests is harder b/c now your logs are scattered around the worker fleet, so debugging becomes harder. You need more APIs for the client to poll the async state, and you need some data store to track the async state (and now you've got to worry about maintaining and monitoring that data store). It's a can of worms that should be avoided when possible.

The only way to know whether or not to accept this kind of complexity is to think about your use cases. Quite often it's fine (and desirable) to fail fast and make the client retry.

<comment><USER4> > Queues introduce entire other dimensions of complexity. Now you've got to > monitor your queue size (and ideally autoscale when the queue backlog > grows), and have a dead letter queue for messages that failed processing and > monitor that.

Wouldn't you need similar mechanisms without a queue? It seems to me queues give more visibility and more hooks for autoscaling without adding additional instrumentation to the app itself.

<comment><USER3> The queue sits behind a service. If you don't do the work in the service, and do it in a queue instead, you've got more infrastructure to manage, monitor, and autoscale.

</comment></comment></comment></comment><comment><USER5> I like guides like this that can help beginners bridge the gap between hobby and professional quality development.

I'll add one more tip, the one I think has saved me more sleep and prevented more headache than any other as I've developed a SaaS app over the last 5 years.

It's simple: Handle failure cases in your code, and write software that has some ability to heal itself.

Here are a few things I've developed that have saved my butt over the years:

1) An application that is deployed alongside the primary application, tails error logs and replays failed requests. (Idempotent requests make this possible)

2) many built-in health checks like checking back pressure on queues and auto- throttling event emitters when queues get backed up

3) Local event buffering to deal with latency spikes in things like SQS.

I hope to eventually write more about these systems on our blog but I never seem to find the time

<comment><USER6> 4) Sometimes it's better to fail fast and try again than spend time writing extensive error handling and retry logic.

<comment><USER7> But unless you inform the audience of those times, they will continue being ignorant of when to use your advice, as if you'd never given this advice at all.

<comment><USER8> As a beginner, until I heard that advice a little while ago it hadn't occurred to me. I disagree advice that doesn't clarify everything has no value. It transforms an unknown unknown into a known unknown that you can fiddle around with or Google further to learn about.

</comment></comment></comment></comment><comment><USER9> You know the one thing that has helped me out the most, an error reporting service AND then addressing _every_ error.

That is to say, my service should emit zero 500 errors.

Then my reporting is easy to interpret and consistently meaningful. I don't have to worry about bullshit noise "oh that's just X it does that sometimes."

Sleeping at night is a lot easier when you have less keeping you awake.

<comment><USER10> This. I have a really hard time measuring it, but ever since we really worked on error reporting our week-end sleep factor has greatly improved.

For a complex system though, don't under estimate how hard this is to do though ... \- Every cloud service needs to be routed to a common service \- All of your software, every language, even that cool Go experiment \- All of the third party software \- logs all have to agree on a format, JSON is not always an option.

Finally ... justification of time spent fixing things with no observable side effect(s). Most cloud stuff is reliable against first orders of failure and so are tolerant to a lot of stuff, it's designed that way. But once the wheels come off, and they _will_ come off, ... buckle up if you haven't been fixing those errors. If you aren't clean on second order failures, you're in for a rough ride.

<comment><USER11> We use AWS, and one benefit of their hosted ElasticSearch is that they can build you a lambda that syncs Cloudwatch logs to ES, handling a variety of different formats. So we have our beanstalk web requests + some lambda infra + our main web backend etc. all synced to ES with very little effort.

You do have the downside that they don't have eg nicely synced structure, but that also has the upside that the structure is closer to what the dev is used to so nobody ever needs to go back to CloudWatch or any other logs to get more details or a less processed message. The other downside is you have to write a different monitor for each index, though this has the upside that you can also have different triggers per index. In our small team we just message different slack channels which makes for a nice lightweight opt in/out for each error type.

It'd definitely be tricky to get everything aligned in eg the same JSON format, but this sort of middle ground isn't too hard and still has benefits - you just need to be already syncing in any format to CloudWatch - which if you're in AWS you probably are.

</comment></comment></comment><comment><USER12> Just about everything mentioned here is well-handled by Google App Engine. I still think it's the way to go for most projects, but I don't think they've marketed themselves well lately. I'm sure there are other good providers too; I don't see the downside to using PAAS.

<comment><USER13> GAE is incredible and poorly marketed. Its the only serverless product I know of that allows me to use whatever server framework I want (flask, rails, spring) but be blissfully ignorant of the underlying VMs. I spent a week looking all the other major alternatives out there, and I don't think GAE has any real competitors. Its just a different kind of serverless...in a really good way.

Having said that, it has some serious shortcomings: baked in monitoring (at least for Python) is much worse than, say, Datadog + Sentry. Additionally, Google doesn't have any great relational serverless databases (which is what I personally want for a regular webapp) -- they do have some solid non- relational databases. Also, no secret store...its very tricky to securely store secrets inside GAE.

To me, the perfect platform for a webapp is GAE + Aurora + some undiscovered secrets store.

<comment><USER14> Are there any particular downsides you have with storing secrets as environment variables? It's working in my app, albeit configuration is done via the web UI [of elastic beanstalk] to keep secrets out of SCM.

<comment><USER15> Storing secrets in env vars is very common in practice, although it presents a slightly bigger attack surface than using something like Hashicorp's Vault to just pull the secrets into memory.

You can sometimes find debug pages etc for apps and runtimes set up that will show all set environment variables, or have crash monitoring software that will capture env vars and send them elsewhere by default. Those risks can be managed, but having sensitive information not set in the process environment is more 'secure by default'. It also means in the event that someone finds a way to remotely execute code in your process (eval() on an unsantized input, anyone?) it's much harder to dump out secrets.

</comment></comment></comment></comment><comment><USER16> > A 4 9's means you can only have 6 minutes down a year.

4 9's is 52 minutes of downtime a year. Keep in mind that single region EC2 SLA is only 99.99%. And if you rely on a host of services with an SLA of 99.99, yours is actually worse than 99.99. So if you want to actually get to 99.99, your components have to be better than this, meaning you will have to go multi-region. So achieving this is actually way harder than this simple step.

<comment><USER17> This is a very salient point. If your service relies on N other services, each with a SLA of 99.99%, the chance of a single request having at least one failure is:

        1 - .9999^N

Which means if you make 10 requests, you go from 99.99% to 99.9% or from 52 minutes to 8.77 hours of downtime a year.

In most cases you're likely to be making a lot more than 10 service calls.

<comment><USER18> Depends on if those 9s are in series or in parallel. In series it multiplies to produce lower availability but in parallel they give you higher availability.

<comment><USER19> > AWS will use commercially reasonable efforts to make the Included Services > each available for each AWS region with a Monthly Uptime Percentage of at > least 99.99%, in each case during any monthly billing cycle....

So to achieve 99.99% within a region, every component should have at least 3 nodes and to better it deployment should go multi-region which will escalate the costs quickly.

Most application in reality don't even need four 9s so this works b beautifully for everyone. I work in outsourcing industry and in bad old days we had huge penalties and many rounds of explanations even for applications with no redundancy requirements ;).

But it's just Amazon credit nowadays and no one blinks and eye so it's win win the all.

<comment><USER18> 3 nodes of a component in parallel would give you 99.9999% for that component.

<comment><USER19> Yes but not in AWS land. Committed SLA for availability of entire region is still 4 nines irrespective.

<comment><USER18> Hmmm. That's good to know.

So in that case you have to replicate across three regions to get 6 nines. So one component needs 9 copies running around the world to have 6 nines for the component.

<comment><USER19> Preety much. As I said above it works because most internal apps within the Enterprise don't even need 2 nines.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER20> I'd recommend using an APM product off the shelf to get a lot of the mentioned functionality in the article (Monitoring, Tracing, Anomaly Detection). I would definitely _not_ recommend trying to roll all that yourself, unless you have a ton of time and resources.

There's a few good ones out there, we use Instana and it's working really well.

</comment><comment><USER21> This is all good advice for the app tier, but in my experience the most painful outages relate to the data store. Understand your read/write volume, have a plan for scaling up/out, implement caching wherever practical, and have backups.

<comment><AUTHOR> I wanted to lay down some of the common things in the app tier, I think data stores get complex really fast really quickly, it's not easy replicating and sharding quickly unless you've got some experience with it under your belt or you use a tool.

</comment></comment><comment><USER22> Good article. I would add one thing to this - pick a database that scales horizontally and is distributed. CockroachDB, Elasticsearch, Mongo, Cassandra/Scylla are all good choices. If you lose one node, you don't have to be afraid of your cluster going down, meaning you can do maintenance and reconfiguration without downtime. If your load is low or bursty you can even get away with running these on some small servers such as t3 (probably minimally t3.larges). Running a cloud managed database is also a good option.

<comment><USER23> Yes, and together with that, I recommend putting all state in the distributed database (or distributed file storage for large blobs). This allows you to gracefully handle crashes, stop and restart servers, etc. because you don't lose any state in the process.

</comment></comment><comment><USER24> Having only one mirror is scary. If one goes down, its like murphy's law kicks in. So you want at least 3 things to go wrong in order to take down your system, 2 is not enough. Also have redundancy _everywhere_ if your checker agent stops working for example. You want 2 of everything and at least 3 of those that should never fail.

</comment><comment><USER25> As a solo founder, I have almost everything mentioned in this article set up, except CI/CD. I can certainly see its value, but being able to easily take down parts of my production system and replace them with instrumented variants is very useful to me when things go wrong. I find that CI usually gets in the way of this. Maybe it's just a bad habit that I need to ditch :)

<comment><USER26> > being able to easily take down parts of my production system and replace > them with instrumented variants is very useful to me when things go wrong

Sorry what did you mean by this?

<comment><USER25> When some service is misbehaving, I have a script to take it down and replace it instantly by an instrumented version with more logs and whatnot.

<comment><USER27> Service reconfiguration is a thing and, in systems that handle dependency management well, tends to not be _too_ painful. (I'm in the process of writing a TypeScript library for doing exactly this, designed for NestJS but usable outside of it.)

</comment></comment></comment></comment><comment><USER28> Haven't seen anything related to third-parties service that your cloud service relies on. I'm talking mostly about APIs that you can use that might crash at some time. Any recommendations on that part?

</comment><comment><USER29> This is a great list. I feel a little happy with myself that I knew about most of these.

Except for identifying each request, I had never heard about that. It's so simple yet so brilliant, gotta start doing it.

</comment><comment><USER30> Good article. Fire drills are worthy of mention. Simulate parts going down, practice recovery.

</comment><comment><USER31> Nice article, may I ask what tools you used to produce the illustrations?

<comment><AUTHOR> OneNote! :) I'm a SDE in OneNote

</comment></comment><comment><USER32> Pretty funny that HN traffic seems to have killed the site.

</comment><comment><USER33> Great article Sada :). Hope OneNote is treating you well!

<comment><AUTHOR> Hey thanks Vishaal! Having fun everyday :) We miss you over here.

</comment></comment><comment><USER34> I applaud the author for sharing their notes. But also, this is why HN (and general upvote-anything-that-looks-interesting forums) sucks. If you are actually defining architecture, you should not be reading these kind of blog posts. I get that they are interesting to the layman, but so is The Anarchist's Cookbook. _Don 't make whatever you read in The Anarchist's Cookbook_.

And I'm crabbing about this because _I am easily susceptible to Anarchists Cookbooks_. I have had to implement X tech before, and googled for "How do I X", and some blog post came up saying "For X, Use Y". I'm too lazy to read 5 books on the general concept, so I just dive in and immediately download Y and run through the quick-start guide. After spending a while getting it going and getting past the "quick start", I wonder, "Ok, where's the long-start? What's next?" And that doesn't exist. And later, after a lot of digging, it turns out Y actually really sucks. But the blog post didn't go into that. I wasted my time (my own fault) because I read a short blog post.

A lot of people live by _Infrastructure as Code_ , and so they will reach for literally anything which has that phrase in its description. But you don't need it to throw together an MVP, and a lot of the IaC "solutions" out there are annoying pieces of crap. I guarantee you that if you pick any of them up, you are in for months of occasionally painful edge cases where the answer to your problem is _" You just weren't using it the right way."_

In reality, if you want to be DevOps (yes, I'm using DevOps as an adjective, ugh) you should probably develop your entire development and deployment workflows by hand, and only when you've accomplished all of the basic requirements of a production service by hand (bootstrapping, configuration, provisioning, testing, deployment, security, metrics, logging, alerts, backup/restore, networking, scalability, load testing, continuous integration, immutable infrastructure & deployments, version-controlled configuration, documentation, etc), _then_ you can start automating it all. If you've done all of these things before, automating it all from the start may be a breeze. If you haven't, you may spend a ton of time on automation, only later to learn that the above need to be changed, requiring rework of the automation.

<comment><AUTHOR> Yeah, in reality I was weary about adding the links, these solutions are often created after a problem arose in the system. But I wanted to provide a few places to see what's the initial paths for a beginner to find out more. I can't count the times when I wasn't as knowledgeable approached a conversation about Chef and Puppet that didn't make sense to me, even after I read what Chef and Puppet did.

It could be, in the other side, that you really don't grasp the need for these technologies until you've had to manually implement one. Things like the UUIDs are basic to hook up to anything.

I can often relate this feeling with nutritional advice. "If you want to be more healthy, eat more advocados", if you only eat advocados, but don't understand what's behind it, or the premise behind it, you'll probably get fat. But if someone tells you "Advocados are a good way to supplement your fats without blah blah blah" and you understand that there isn't a unique solution, then you'll probably be healthier.</comment></comment>


GPUs Found Vulnerable to Side-Channel Attacks - <AUTHOR> https://www.infoq.com/news/2018/11/gpus-side-channel-vulnerable <comment><USER2> kinda of obvious after it was prooved on cpus.</comment>


Ask HN: Why does everybody like notion.so? - <AUTHOR> What is your favorite feature? What is missing in other tools? <comment><USER2> It's a poor version of OneNote.

The reason why it's popular now is because productivity tools go through a flavor of the month period.

Few years back it was all about Evernote, then Omni, etc.

It doesn't help that notion blasted the productivity and self help YouTube community with paid sponsorships last year(many of whom didn't even disclose it).</comment>


Ask HN: One World One Simcard - <AUTHOR>

Hi everyone. I would like to get feedback on an idea I had to gauge its viability:
The Problem: As a frequent traveler (on a budget) to different countries I always find myself having to buy new sim cards in each country I visit to get network and data access while I'm in that country.
This involves keeping tracking of all my different sim cards for each country and taking them with me everywhere I go. Using the roaming features is just not viable due to the insane charges that are incurred. There are currently providers that offer a "one-sim" service but these services still dictate the prices that you have to use and have somewhat limited offerings / selections when it comes to packages.
The Solution: Why not create a service (website / app)that allows you to use one generic sim card all the time, but manage the networks you belong to via a website / app? For example, when currently visiting a new country, you would have to go into a shop / contact call center and get a new sim card to use any of a network provider's services.
Instead, now you would just log into your "One-Sim" account, select the network and package you want to join from a list of networks available in that country. The service would then register you on that network and then add that network to your global list of available networks. You then just switch to that network via the website / app and voila you are on the new network using one of their packages / contracts. When you return to another country, you simply go back to the app, select the network for that country and then the app connects you to that network.
Advantages / Disadvantages to follow... <comment><AUTHOR> Advantages: \- Let's you choose your own network provider(s) in a country \- Let's you take advantage of a network's specials (for example a cheap 20GB data bundle) \- Let's you switch network providers by visiting a website/app instead of changing sim cards. \- The networks still get their full rates

Disadvantages / Problems: I'm sure there are some so feel free to add. The main obstacle that I can think of is that you might have to contact and create relationships with all the network providers around the globe, which may be a very political process. I don't have much knowledge in this area but maybe someone in the mobile industry could fill in the possible setbacks and problems related to the mobile industry.

<comment><USER2> It's no doubt a VERY political process. They will likely not be interested in working with you unless you have a ton of users or will pay for the time they need to integrate with whatever system you build and even then I'm sure it'd be hard to convince them.

I'm pretty convinced that the only way to have a phone that will work in EVERY country, for now, is to get a satellite phone which has a moderate up front cost and a comparatively significant marginal cost (per minute).

Good luck though!

</comment></comment><comment><USER3> What about the places, which don't use sim cards?</comment>


Qt binding for Go with support for all major operating systems - <AUTHOR> https://github.com/therecipe/qt <comment><USER3> I love that the author provides docker images for cross compilation. Cross compilation environments are such a pain to setup and maintain - having docker images with all that stuff in is a major step forward.

Next time I want to build a desktop app I'll have a go with this for definite.

<comment><USER4> Docker will only let you cross-compile to OSes with the same kernel, which is relatively limited. A full set of say vagrant files would be slower, but a lot more polyvalent (but even then it would not let you, say, compile a windows binary from linux).

<comment><USER5> You can _cross_ -compile to completely different environments. It just can be tricky to set up, so prepared docker images with e.g. the toolchain to build a Windows executable on Linux are great to have, and what is provided here.

<comment><USER6> I think it's a nice idea in theory to provide cross-compilation support by means of emulating all possible target architectures on the compiling machine.

Then I remember that I'd be managing a custom heterogenous compute cluster just to compile some code.

<comment><USER7> It's not emulation, it's cross-compilation which has existed basically forever. You don't have to target the same instruction set as the one you're compiling on.

<comment><USER6> I am well aware of that, I was referencing the concept of "cross-compilation" the GP seemed to have.

<comment><USER7> I see what you mean now, using like qemu or something. So "emulated native compilation". It is an interesting concept. Sorry for misunderstanding you.

<comment><USER6> Indeed, "virtualbox-the-crosscompiler" (probably from hell). QEMU would be a few orders of magnitude slower but I think it supports many more archs.

No hard feelings :)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> I wish the author success. Many UI libraries for Go have been made and abandoned. It would be a joy to see one succeed.

<comment><USER9> Not only a joy, it would be the best way we currently have to make desktop applications. Currently the easiest alternative is JS+Electron, but that's just horrible because of all the waste of resources. Python is hard to package, so something statically compiled would be great.

I would prefer Rust for this (or, well, I would prefer Python with a better packaging story), but Go is much better than the alternatives too.

<comment><USER10> python can be packaged up. I haven't done it, but there are some popular 100% python apps with a UI that dint require any global python crap.

<comment><USER11> Like Sublime.

<comment><USER12> Sublime Text is mostly written in C++, Python is only used for plugin API.

</comment></comment></comment></comment></comment><comment><USER13> Serious question:

Once I have been building Qt Widgets application in Python with PySide bindings. I needed to do some simple processing in several SLOTs and decided to use lambdas as an easy replacement. Kids, do not even think about attempting to do this at home, seriously.

I have run into some extremely evasive random crashes and stuff. I did not dig to the bottom of the issue, although my guess is that Python lambdas are executed in main (constructing) thread context and that causes race conditions.

My question: how do Golang's goroutines interact with native threads spawned by Qt?

<comment><USER14> I have some experience building PyQt apps and can confirm random crashes (segfaults, sigaborts and such). I suspect this has nothing to do with lambdas. It may likely be something happening between Python and QT - <USER2> that all things happening in QT/C++ world are invisible to Python. For example if your Python routine returns None (as many Python methods, functions do) instead of some other object that is expected by C++ (say QNetworkRequest) it may crash and die without any traceback. I spend hours on things like this - QT method must return something but in some cases was not returning expected object and whole thing was crashing. Python being Python doesn't care about return types, there is no Python traceback, you're left in the dark groping, browsing codebase trying to find what might get wrong, no debugger will help you.

Working with QT bindings is very difficult. Debuging things is not easy. I'm not sure if using bindings is worth it. I suspect doing things in plain C++ QT might be easier to debug and maintain.

<comment><USER15> In C++ one gets a compilation error if the wrong type is returned from a function.

Qt is generally type safe, but it uses quite a lot of pointer types and also a rather unusual for C++ parent-child resource cleanup rule for QObjects (e.g. all widgets).

When something does crash, C++ doesn't offer any tracebacks, but if one has a core dump or can reproduce the crash under a debugger, a traceback can be easily obtained in the majority of cases.

<comment><USER14> > but if one has a core dump or can reproduce the crash under a debugger, a > traceback can be easily obtained in the majority of cases.

how do you create core dump? starting program under some debugger? I tried debugging with valgrind but the output contained so much noise it took my ages to find something. I also had to recompile QT used by PyQT because QT because QT requires some flags to be able to debug. What's the best way to debug things like this?

<comment><USER15> A core dump is a file that's generated by the OS and includes a snapshot of the process state. It's useful when e.g. one is not able to run the program under a debugger. Enabling it depends on the OS, I would just search for enable core dumps on "my OS".

If one _can_ run the target program under a debugger, a core dump is not so helpful because it's a static snapshot, whereas a debugger can modify program state.

I am guessing that one has to run the python process itself under the debugger and pass the parameters such as the script path.

There will probably be a signal or exception condition at one point and one can take a look at the call stack. The call stack will probably be messy, as it will include python internals.

An alternative way to debug this is to understand the lifetimes and preconditions of C++ widgets and signals and slots and review one's python code.

Unless there's a bug in Qt itself, PyQt and Qt might have a misunderstanding about lifetimes and something gets cleaned up too soon or there's a dangling refrence to a cleaned up object

<comment><USER16> There is a gdb plugin for Python. I'm not sure how other distros handle it, but on Arch Linux you _have_ to build Python yourself for it to work.

</comment></comment></comment></comment></comment></comment><comment><USER17> So this is more comprehensive than the qml binding library?[0]

[0][https://github.com/go-qml/qml](https://github.com/go-qml/qml)

<comment><AUTHOR> The Author said about go-qml and this binding in reddit[0]

[0][https://m.reddit.com/r/golang/comments/585rvs/comment/d8xtre...](https://m.reddit.com/r/golang/comments/585rvs/comment/d8xtrez)

</comment></comment><comment><USER18> The code has a mind boggling LOC. e.g. [https://github.com/therecipe/qt/blob/master/widgets/widgets....](https://github.com/therecipe/qt/blob/master/widgets/widgets.go)

</comment><comment><USER19> Now if only someone did the same thing for .NET Core. Ideally someone who would want to build a business on that :)

<comment><USER20> You mean Go bindings for .NET Core?

<comment><USER19> .NET Core bindings for Qt. .NET Core doesn't have any UI toolkit right now. There are several efforts but they're mostly hobbyist ones and seem to lack funding or major development power, unfortunately.

<comment><USER20> What about WPF?

<comment><USER21> It's not designed to do cross platform UIs and QT already is. It's be easier to bind QT to .NET than make WPF cross platform.

</comment></comment></comment></comment></comment><comment><USER22> Does this library support making "derived classes" from QObject/QWidget? And how does that work, in Go- are they interfaces?

<comment><USER23> author here; Yes, you can create derived classes from any class that is derived from QObject. Simple anonymously subclass in Go and add your own slots/signals, as shown in the "quick/bridge" and several other examples. Then run "qtmoc" to generate the need c++ and go code. All functions usually accept interfaces and all classes have their corresponding interface, which itself inherits all the derived interfaces.

<comment><USER22> That's great!

</comment></comment></comment><comment><USER24> Could someone please enlighten me why an installation would need 8gb of free ram?

<comment><USER19> If it's building everything (including Qt), Qt includes Webkit. I imagine that's a lot of C++ code to build.

<comment><USER25> QtWebkit _and_ QWebEngine, which uses Blink(/CEF).

8GB RAM is rather optimistic.

</comment></comment></comment><comment><USER26> I am wondering if there is something similar for Rust. Does anyone have some information on this?

<comment><USER27> Not Qt, but I'm using [https://github.com/gtk-rs/](https://github.com/gtk-rs/) with Rust, which is pretty cool, I've developed the GUI using Glade, which I load via Rust. I'm also using CSS, to style the interface.

<comment><USER28> Unfortunately GTK itself is pretty bad, and it constantly has breaking changes. Hopefully things are improving.

</comment></comment></comment><comment><USER29> Question. Does QT still have a licensing problem for closed-source apps on mobile platforms?

Last I saw, QT's GPL/LGPL license required you to open-source the code that was statically linked to it. That wasn't much of a problem for desktop platforms, as you could just package up all of QT into its own QT.DLL (or the equivalent) and link to it dynamically. But this isn't allowed on stuff like iOS, so you were required to buy a license for those.

<comment><USER30> nitpick: its Qt, not QT.

QT is Apple QuickTime which some consider as the worst Windows software ever created.

<comment><USER31> Adding to that, "Qt" is pronounced like "cute", while "QT" is pronounced like "cutie" (though with different stress).

I was guilty of mispronouncing it too, until Qt 4 came out and they released that goofy "Qt 4 dance" video.

</comment></comment></comment><comment><USER32> Why do the iOS screenshots look nothing like iOS? [https://github.com/therecipe/qt/blob/master/internal/screens...](https://github.com/therecipe/qt/blob/master/internal/screenshots/ios_portrait.png)

<comment><USER33> It's the Qt framework, not iOS's UI framework.

<comment><USER34> It definitely looks like Qt but I am surprised that Qt is not using any native controls on iOS. It tries to use native controls or at least a native _look and feel_ if possible (it does so on Windows and macOS at least). On the other hand, I don't know anything about mobile app development and apis that iOS gives you so I cannot tell whether such a thing is possible in iOS at all.

<comment><USER35> Two points:

a) Qt doesn't use native controls on any platforms (though for half of desktop Linuxes Qt _is_ the native toolkit). Qt has its own controls that are styled to look like native.

b) The screenshot shows Qt widgets. This is not the intended way to do Qt on mobile platforms, and thus no native styling is provided. QML is the official way to do mobile apps with Qt.

<comment><USER36> Point A is interesting because you can see particularly on OSX that it is not native, despite widespread recommendations to use Qt for cross platform development. I have used wxWidgets on multiple platforms and despite its idiosyncrasies, I have found it performed very well and is obviously truly native on all platforms (unless you choose wxUniversal as a rendered; nobody does) or unless you do "owner drawn" stuff and paint yourself. In any case I would not hesitate recommending wxWidgets for native controls over Qt.

Other minor Qt annoyances include their own scrollbars which ignore the system setting of "jump to where I click the thumb" setting etc.

</comment></comment></comment></comment></comment><comment><USER37> I've been using this library for a couple of weeks, and so far I have been very impressed. It's relatively easy to use, and seems to be pretty comprehensive in the amount of the Qt API that it supports.

I raised two small issues, and both were addressed quickly by the author. In one case incredibly quickly.

</comment><comment><USER38> Sadly, FreeBSD is not included in the supported OS list.

<comment><USER23> author here; Didn't know it was supported by Qt, I will put it on my TODO list ;)

edit: can't comment any further currently, I will try to answer everything once I'm unblocked.

</comment></comment><comment><USER39> This is awesome. I was really bummed about the state of QT support in golang. I played with the go-qml project, but it wasn;t everything I needed. This looks amazing.

</comment><comment><USER40> Does this support QML/Qt Quick Controls 2?

<comment><USER23> author here; Yes, as well as material design and all the stuff that comes with QML/Qt Quick.

</comment></comment><comment><USER41> Please, please where is a proper C# binding?

</comment><comment><USER42> big fan of the repo [http://github.com/dontpanic92/wxGo/](http://github.com/dontpanic92/wxGo/) it's got everything Qt has but free

<comment><USER43> Is Qt not free?

<comment><USER42> Commercial licensing $79/month [https://www.qt.io/licensing- comparison/](https://www.qt.io/licensing-comparison/) [https://www.qt.io/faq/#_Toc_2](https://www.qt.io/faq/#_Toc_2)

</comment></comment></comment><comment><USER44> Is there an example of using data from Go in the application?

<comment><USER23> author here; Take a look inside the `internal/examples` subfolder. There are several examples.

edit: can't comment any further currently, I will try to answer everything once I'm unblocked.

</comment></comment><comment><USER45> Does anybody know why the demo application is 52mb?!?

I mean, yes, its statically linked but 52 million bytes for a window, a button and a pop-up?

Shouldn't this fit into 5-10 mb? Is the whole qt lib linked into that binary?

<comment><USER23> author here; The size depends on your platform and the way you build it. If you used `qtdeploy` instead of `go run/build`, you should get a 2mb binary which includes Go's runtime + only the needed Qt C++ code. (A normal go binary has the size of 1.5mb or so) The rest are Qt dynamic libs, which are not all needed, depending on what you build. You can safely remove plugins and maybe whole modules. edit: and you can also compile Qt on your own to strip out ICU and other unnecessary stuff + with Qt 5.8 things will get even more lightweight.

<comment><USER46> First of all, thank you. The effort of maintaining Qt in any way or form is ... nontrivial.

I've wanted to try this one out, but it looks like I'm maybe trying something too far off from mainstream. I like how the bindings can be built against incomplete Qt releases (iow. just the development packages available in debian sid); the build complains when some modules can't be found but continues nonetheless. Sure, it takes QT_DIR and PKG_CONFIG settings to build like this but I have no problem there.

So far I haven't found a way to build even the sample project against this type of custom build though. I'll try to find more time to dive in as to why this happens but I'm sure this is an error on my end. Once I figure that out, I should be able to provide a documentation update.

As to why? I have an old project which I need to revive, and being stuck in ancient GTK land with dubious bindings and even more dubious upstream practices sounds less appealing than porting things over.

<comment><USER23> Did you tried to use QT_MISC_DIR (which should contains the "mkspecs" subfolder) and QT_DOC_DIR, which should contain for example (QtCore/qtcore.index)? Or if you like, open an issue on github and we can try to sort this out :) edit: also if you use PKG_CONFIG=true, the QT_DIR will be ignored

<comment><USER46> Hum, I hadn't, but in retrospect I should have. I've done my share of Qt builds in the past and mkspecs path was often an amusing detail. Didn't solve the problem though.

But I think I found out at least one thing that goes wrong. I'll provide a github issue report later this weekend but here's the short version:

* The generated #cgo directives for CXXFLAGS are different for desktop and minimal files. Minimal is generated with -I$(QT_INCLUDE_DIR)/QtFoo include paths; desktop is generated with -I$(QT_DIR)/<major.minor>/gcc_64/include/QtFoo paths instead. So headers in desktop build are looked up from _library_ directory paths (and with obviously bad path elements too).

* When building, qtsetup goes for desktop target.

More data coming in via github once I get the exact details sorted out.

<comment><USER23> Mh, usually the minimal_cgo_* files and the cgo_* files should use the same imports.

But the qtsetup won't always re-generate these cgo_* files if the QT_DIR is up to date (there is probably a bug if you use QT_PKG_CONFIG).

So I would use `qtminimal` or `qtdeploy` for debugging this, because the minimal_cgo_* files are always re-generate.

And you may also want to change `InfoLevel` in `internal/utils/logger.go` to `DebugLevel` and then re-build the cmd/tools to get additional infos.

Hope this helps :)

</comment></comment></comment></comment></comment></comment><comment><USER47> Please, I beg of you, do not create an iOS app using this library. Look at that screenshot: [https://github.com/therecipe/qt/blob/master/internal/screens...](https://github.com/therecipe/qt/blob/master/internal/screenshots/ios_portrait.png)

It looks like a tiny Windows 95 on your phone. Tap targets way too small.

<comment><USER48> That's because it is done with Qt Widgets. "Proper" way for mobile is to use Qt Quick Controls, but you have to deal with QML/js crap unfortunately.

<comment><USER49> QML isn't crap. Its much nicer, IMHO, than HTML and CSS and much more intuitive. The animation and states system makes it trivial to make polished looking UI's.

Granted, I wish I didn't have to use JS with it, but QML itself is fantastic.

<comment><USER48> Of course, when I say it's crap, I mean compared to C++/Qt Widgets. I wish Quick Controls were available in pure C++.

<comment><USER49> You can use them from C++, but its definitely not the expected usage and not particularly easy.

I personally much prefer QtQuick to QtWidgets, and really like the QML declarative language as a better HTML/CSS for non-web. But I completely agree with you that I would prefer if I could code all my logic in C++ and not JS.

I've been meaning to play around with two ideas:

1\. Construct the QtQick widget scenegraph wholly from C++ (and not using QML/JS at all). Doable, but definitely not intended usecase.

2\. Construct the scenegraph using QML, but using it only for setting values (and never any logic) and then manually connecting the signals from the QML- created widgets to C++ slots.

<comment><USER50> It is not wise to even implement a lot of logic in the JS part of QML, as the JS interpreter there is quite a bit more primitive than something like V8. Your performance will suffer if you attempt to write anything too complicated in JS inside QML.

<comment><USER49> Oh I know, I've had some complex QML/JS in the past.

Even more so if you're running on iOS where the JS isn't jitted.

It's really easy to write QObjects that are accessible to QML and you can connect your signals/slots with the QML widget ones, so having the logic in C++ isn't hard. It's just not quite as convenient as putting it inline in QML, I guess.

</comment></comment></comment></comment></comment></comment></comment><comment><USER41> Where is the proper useful C# binding....

</comment><comment><USER51> Does Qt have something like React?

<comment><USER52> QML does provide an FRP-like methodology, which is not exactly like React but in the same universe of UI techniques.

</comment></comment><comment><USER53> So, dang, why is my account rate limited then? I've had 2 cases before where a project I participated in was presented here, and I showed up to comment, and couldn't do so due to the rate limiting.

This is not really helpful, and destroys any chance at meaningful discussion.

(Also, last time you told me that rate limiting couldn't be undone, and I should just write an email – what's that about now?)

<comment><USER54> There are other reasons for rate-limiting besides an account being new—if an account has posted a lot of unsubstantive or uncivil comments, for example. I doubt that I told you it couldn't be undone, because it can be undone. What I probably said was that you should email us because it isn't a good idea to go on about it here.

We detached this comment from [https://news.ycombinator.com/item?id=12932238](https://news.ycombinator.com/item?id=12932238) and marked it off-topic.

</comment></comment><comment><USER55> Please change the title - the long string breaks the HN layout on my phone.

<comment><USER56> Please add (2016) to the title.</comment></comment>


Vitamin D looks powerful, underutilized for Covid-19 - <AUTHOR> http://agingbiotech.info/vitamindcovid19/ <comment><USER2> For what it's worth, I've been curating research on over-the-counter interventions for Covid-19 here: [https://www.reddit.com/r/covid19stack](https://www.reddit.com/r/covid19stack)

The research on vitamin D has been discussed extensively there over the last couple months.

This article (and the linked citations) misses a bunch of the most important theorized mechanisms of action, most notably that vitamin D plays a role in regulating blood clotting and having adequate levels may prevent the kind of sudden deaths from stoke we've been seeing in people who seemed to have gotten over the disease with otherwise mild symptoms.

<comment><USER3> Author of the review here. Happy to have addition suggestions for papers to include in the review. I looked at the Reddit group you linked and saw only citations of Alipio et al and Grant et al (from several posts), both of which I already cite. The review says of the Grant et al paper that it "broadly reviews evidence for D to help with infectious diseases, pneumonia, and inflammatory cytokines that damage the lungs and discusses some of the aspects of COVID-19 infection that are known to relate to things known to be also relevant to vitamin D." So not quite sure what it is that you are suggesting be covered that is not.

The review is not meant to be a thorough description of the biology at the intersection of vitamin D & COVID-19. The point of bring up the refs I have in section 8 is to point out that there are good causal mechanistic biological arguments for D's usefulness against C19, to help justify a call for additional data gathering.

Your reddit group looks fine and all, but it isn't the same as a single document that concisely collects all the best evidence for the potential of vitamin D in a well organized way.

</comment></comment><comment><USER4> Dr. John Campbell, an educator in Northern England who's been doing daily Youtube updates on Covid news since January I believe, has put out a few videos from time to time related to vitamin D:

[https://www.youtube.com/watch?v=W5yVGmfivAk](https://www.youtube.com/watch?v=W5yVGmfivAk) \- A month ago [https://www.youtube.com/watch?v=GCSXNGc7pfs](https://www.youtube.com/watch?v=GCSXNGc7pfs) \- 3 weeks ago [https://www.youtube.com/watch?v=K-mHCn74E5o](https://www.youtube.com/watch?v=K-mHCn74E5o) \- 3 days ago

He suggests vitamin D deficiency may play a partial role in explaining higher mortality rates among people with darker skin (other important social disparities notwithstanding).

<comment><USER5> Very important to remember that Dr John Campbell isn't a medical doctor. He's a nurse with a PhD in learning.

I'm still waiting for the statistics where skin colour is correlated to income levels. Then I suspect we'll see the real issue. Poorer people living more densely.

<comment><USER6> Ben Goldacre (and others) have done a rapid assessment of covid-19 risk. [https://opensafely.org/outputs/2020/05/covid-risk- factors/](https://opensafely.org/outputs/2020/05/covid-risk-factors/)

> Results: There were 5683 deaths attributed to COVID-19. In summary after > full adjustment, death from COVID-19 was strongly associated with: being > male (hazard ratio 1.99, 95%CI 1.88-2.10); older age and deprivation (both > with a strong gradient); uncontrolled diabetes (HR 2.36 95% CI 2.18-2.56); > severe asthma (HR 1.25 CI 1.08-1.44); and various other prior medical > conditions. Compared to people with ethnicity recorded as white, black > people were at higher risk of death, with only partial attenuation in hazard > ratios from the fully adjusted model (age-sex adjusted HR 2.17 95% CI > 1.84-2.57; fully adjusted HR 1.71 95% CI 1.44-2.02); with similar findings > for Asian people (age-sex adjusted HR 1.95 95% CI 1.73-2.18; fully adjusted > HR 1.62 95% CI 1.43-1.82).

He talks about it here: [https://twitter.com/bengoldacre/status/1258372975004389379?s...](https://twitter.com/bengoldacre/status/1258372975004389379?s=20)

</comment></comment></comment><comment><USER7> Not by me. I'm D-deficient, had gastric sleeve surgery, surprisingly it's the only deficiency I have regularly. I often forget my D... but been taking it religiously and asked my doctor if it's okay to add an extra 5000 iu per week, and he said it was fine and a good idea because of how low I normally run.

I've got a new formulation coming soon though that has vitamin k mixed in w/ 5000 ius, and a separate calcium/magnesium pill to make sure my bones stay strong. Will get re-tested next month and see if I beat the deficiency. I'm sure there's plenty of things but seemed like taking D probably is biggest (other than distancing) due to my already extremely low normal levels.

<comment><USER8> I read somewhere that prolonged high doses of vitamin D might have adverse effects on bone strength making them more brittle, but I'm unsure about the source. I personally have celiac disease and hypothyroidism am also having issues keeping the D up (heh heh). I take about 200ug daily with vitamin K and I'm thinking about increasing it temporarily to double of that. Generally it shouldn't be an issue with short term higher doses, but nearing a 1000ug daily dose for prolonged periods (months) can be dangerous.

<comment><USER9> (Med student here with only limited knowledge).

This is correct. The active form of Vitamin D (Calcitriol) can be both helpful and harmful to bone health.

I think the mechanism is not fully understood but in short doses it stimulates bone growth and is a treatment for osteoporosis. In chronic doses it actives cells caused osteoclasts that reabsorb bone.

<comment><USER10> Cholecalciferol is used in over the counter supplements, not calcitriol (which is the active vitamin D form).

There also is a negative feedback for the conversion, that explain why there are so few acute vitamin D poisoning.

</comment></comment></comment></comment><comment><USER11> Previous Vitamin-D/COVID discussion with many informative comments: [https://news.ycombinator.com/item?id=23023703](https://news.ycombinator.com/item?id=23023703)

</comment><comment><USER12> Not a very good review. We know that sunlight exposure is associated with lower all-cause mortality [1]. However, vitamin D supplementation has no effect on mortality [2].

Current thinking is that it is the nitric oxide rather than vitamin D that causes the benefit from sunlight [3].

So, if you want to have the best of both worlds, you should go out in the sun rather than using vitamin D supplements.

[1] [https://www.ncbi.nlm.nih.gov/pubmed/24697969](https://www.ncbi.nlm.nih.gov/pubmed/24697969)

[2] [https://www.ncbi.nlm.nih.gov/pubmed/31405892](https://www.ncbi.nlm.nih.gov/pubmed/31405892)

[3] [https://www.karger.com/article/FullText/441266](https://www.karger.com/article/FullText/441266)

<comment><USER13> Not enough existing research controls for when in the day vitamin D is taken or for other related nutrient levels (K, Mg).

Vitamin D is part of a whole complex network of signaling processes related to (at the very least) regulating circadian rhythms and how is calcium absorbed and used in the body.

I could see how taking vitamin D in the evening would actually be harmful if it disrupts melatonin synthesis. Do existing studies control for this? If they are, they're hard to find.

Until I see vitamin D studies controlling for those things, I take meta- analyses like that with a grain of salt. And I'll keep taking vitamin D in the mornings + magnesium in the evenings when I'm depressed in the winter. It sure seems to help.

<comment><USER14> Said as respectfully as I can, it seems like there's a lot of post-hoc justification from the supplement crowd.

I.e. 'Well, no effect was observed because Y wasn't done simultaneously.'

Which isn't to say vitamins aren't under-studied and -prioritized.

But is to say, it feels unscientific to always quibble over experiment design after the results show no effect.

<comment><USER15> > it feels unscientific to always quibble over experiment design after the > results show no effect.

Respectfully, _this is exactly what science is_. The process of finding potential confounding variables and controlling for them in a new study is critical.

The OP isn't saying the original study is wrong, or falsified, or whatever, just that it might not account for a particular effect. Someone should study that effect!

There is a lot of _untestable_ post-hoc armchair experiment criticism from the supplement crowd, but this isn't an example of that!

<comment><USER14> There are an infinite number of confounding variables in biological systems. Ergo, there are an infinite number of reasons to dismiss any particular study.

OP's suggestions are tightly scoped and proceed from a basis, but there is a point where you're dismissing concrete evidence on the basis of supposition.

</comment></comment></comment></comment></comment><comment><USER16> A double-blind study for respiratory infections (before covid-19):

[https://www.bmj.com/content/356/bmj.i6583](https://www.bmj.com/content/356/bmj.i6583)

</comment><comment><USER17> There was some discussion about this on another thread: [https://news.ycombinator.com/item?id=23079976](https://news.ycombinator.com/item?id=23079976)

Essentially, one of the theories is that severely low Vitamin D can cause a hypercoagulable state and also increase the risk of the "cytokine storm" often observed in Covid-19 patients.

</comment><comment><USER16> And if people hoard it and it's out of stock, you can just go outside!

<comment><USER18> It doesn't take hoarding, although that doesn't help. There are precious few products that can stay on the shelves when everyone decides they need some at once.

At northern latitudes, there isn't an available amount of sunlight, such that dark-skinned people can synthesize a healthy amount of vitamin D. Indeed, this is probably why light skin is selected for at those latitudes.

As a silver lining, I hope this crisis will provoke awareness of that fact. In most parts of the US, people with dark skin should definitely be taking supplemental Vitamin D. Really everyone should, unless they're a light-skinned sun-worshipper living in the Sun Belt.

<comment><USER19> Light skinned people shouldn't get their vitamin d from the sun. The skin cancer risk far outweighs any benefit.

If it becomes scarce look up how to make vitamin d with mushrooms left in the sun.

<comment><USER20> This is nonsense. 10-30 mins of sunlight a day without sunscreen for caucasians is something on the order of 10,000 IU of Vitamin D. You can do this safely without the worry of skin cancer.

<comment><USER19> Tell it to every derm I've talked to or read.

<comment> radford-neal It might be good to exercise a bit of common sense before believing everything a doctor tells you.

How likely is it that getting even small amounts of sunlight is horribly dangerous? Do you believe in evolution? (For that matter, if you instead believe in creation by a benevolent god, you get the same answer.)

</comment></comment></comment></comment></comment></comment><comment><USER21> If this is right, it means there's a natural non-intervention-based treatment for COVID called "going outside and getting sun."

What a concept. Positively medieval!

Funny how you don't see many doctors or pharmaceutical companies trumpeting this new treatment as a part of a treatment regime.

Obviously there are second order social-benefits to staying at home, but it's just funny that so little attention has gone into something as simple and reasonable as 'get more sun' compared to the billions spent on equipment, drugs, and hospitalizations.

</comment><comment><USER22> As a layman observer of the scientific debate, the Vitamin D guys have been quite persistent about the correlation between Vitamin D levels and deaths. Is there causality? Beats me. The best I've heard by way of explanation is that inflammation depletes Vitamin D stores. That idea is usually followed-up with the additional theory that CV-19 causes inflammation and high platelet activity, clogging up small blood vessels and producing most of the major effects that are observed.

<comment><USER3> As with many comments in this thread, carefully reading the originally linked review: [http://agingbiotech.info/vitamindcovid19/](http://agingbiotech.info/vitamindcovid19/) would help. One of the 3 recent preprints specifically noted repeated testing of C19 patients and they did an ANOVA statistical test and determined that D blood levels were not declining in the patients over the course of the infection.

This doesn't prove causality, but it rules out the reverse causality you hypothesize in this post. There is a good, concise (3-paragraph) sub-section on the causality question in the discussion section called "Correlational data supported by many pieces of causal evidence". Mandatory reading for anyone who reacts with "correlation doesn't imply causation" as a criticism. Karl (author of the review)

</comment></comment><comment><USER23> Here is a fantastic list of compelling resources about Vitamin-D: [https://www.grc.com/health/Vitamin-D.htm](https://www.grc.com/health/Vitamin-D.htm)

</comment><comment><USER24> Sure, being healthy on many levels seems to be the best offense against C19 and lot's of other things.

</comment><comment><USER25> Can someone tell me why HN is so obsessed with Vitamin D? I see a Vitamin D related article on the front page every few months. Also, [https://hn.algolia.com/?q=vitamin+d](https://hn.algolia.com/?q=vitamin+d) shows a lot of articles about Vitamin D with a lot of upvotes.

Note: I supplement with Vitamin D daily, so no hate at all, just curious.

<comment><USER26> Programmers tend to not go outside as much, in the batcaves creating value many times in the dark of night.

<comment><USER27> Bring up a picture of the sun on your monitor?

</comment></comment></comment><comment><USER28> Vitamin D is under studied because it cannot be patented (my doctor told me).

<comment><USER29> Why don't governments fund the research though?

<comment><USER30> They do: [https://www.npr.org/sections/health- shots/2018/11/10/6665455...](https://www.npr.org/sections/health- shots/2018/11/10/666545527/vitamin-d-and-fish-oil-supplements-disappoint-in- long-awaited-study-results?t=1588980441791)

[https://www.lifeextension.com/featured- articles/2010/12/fede...](https://www.lifeextension.com/featured- articles/2010/12/federal-government-funded-study-fails-to-recognize-value-of- vitamin-d)

It's just that not everyone likes the results... If a doctor's cognitive bias leans towards "alternative medicine", for example, they don't want to accept certain findings, so they ignore them.

The real complaint those people have is "there's not enough (government- funded) studies about [remedy] that fit my preconceived convictions". At least that's my suspicion - I could be wrong of course.

</comment></comment></comment><comment><USER31> Sunlight as a treatment for COVID-19? Where did I hear about this before.

<comment><USER32> Perhaps irradiating yourself with UV rays might help after all!</comment></comment>


How We Use Docker (And Why We Can't Live Without It) - <AUTHOR> http://www.hakkalabs.co/articles/use-docker-cant-live-without

<comment><USER2> Pretty good summary. Did you compare Docker to anything else (ElasticBox, etc) before you made this decision?

<comment><USER3> Author here, it's the first time I hear about ElasticBox here, but it sounds interesting - I see that it supports docker too.

Before Docker we used Vagrant with virtual machines. It's a decent tool, but it doesn't really help with deployment - you don't ship virtual machines from vagrant, as you can with Docker containers and with Vagrant - developer's machines tend to diverge.

We've chosen Docker because it's lightweight, portable and we've seen lots of potential in this tool. It's ecosystem grows really fast, but docker is pretty stable now.</comment></comment>


Dogs able to quickly, economically shake themselves dry, experiments prove - <AUTHOR> http://www.philly.com/philly/columnists/faye_flam/20120903_Planet_of_the_Apes__Shake__Rover_.html

<comment><AUTHOR> For those interested in the full paper:

• Dickerson, A., Mills, Z. & Hu, D. L. (2012) Wet mammals shake at tuned frequencies to dry. Proceedings of the Royal Society: Interface. <http://www- old.me.gatech.edu/hu/Publications/Hu12-dog.pdf>

</comment><comment><USER2> This HN title reminds me of the type of headline The Onion used to be famous for.

</comment><comment><USER3> in addition to perfecting their shake to get every drop of water all over my bathroom floor/walls, my dogs (@TurdsAndTreats) also have a dive bomb maneuver where they drop and roll on any carpet or piles of clothes.</comment>


Swiss women strike for more money, time and respect - <AUTHOR> https://www.bbc.com/news/world-europe-48615911 <comment><USER2> I see just two comments right now and I see a lot of cynism.

Things are better today than in the past thanks to people fighting for their and others rights. And the job is not finished.

Democracy is not something that happens once each four years. It's important to vote, but as important is to express your dissatisfaction with the wrongdoings of the system.

> Ms Born, who joined a newsroom staffed entirely by men in 1986, is quietly > optimistic. "We've achieved some good things since 1991," she points out. > "We have maternity leave now."

Parental leave seams such a natural right to have that it's strange that there exists any opposition to it. Mothers and fathers benefit from it. Fighting for women's rights is also figthing for a more just and balance society for everyone.

<comment><USER3> > Parental leave seams such a natural right to have that it's strange that > there exists any opposition to it.

There's opposition to it for a number of reasons:

1\. Employers are people, and peoples first reactions to anything is almost universally selfish: "how does this negatively affect me? And why should I suffer financially for someone else's gain?"

2\. Most policy makers are still men, and policy makers only decide policy based on their own experiences. If they haven't suffered from lack of maternity leave, they won't prioritize it as an issue.

Protest is a means of shaking the sleeping masses and getting your message into the public consciousness. That's how you make change happen when nobody in power is motivated to change. Once you build enough momentum, they have to change.

<comment><USER4> During the maternity leave it is not the employer that is paying the salary of the mother (at least in Switzerland, and I assume it is the same in most if not all countries with a mandatory maternity leave), but the state. So the employer isn't paying someone to do nothing.

He also has enough time to plan the replacement since the leave can be announce 6 months or so in advance.

<comment><USER5> Maternity leave is covered by deductions from salary for everybody. It's a part of the Income Compensation Insurance, the rate of IC is 0.225% of the salary. It is deducted from the agreed-upon salary and additionally the employer pays an additional 0.225%, so in the total 0.45% is deducted.

[https://www.bsv.admin.ch/bsv/en/home/social-insurance/eo- msv...](https://www.bsv.admin.ch/bsv/en/home/social-insurance/eo-msv.html)

[https://www.ahv-iv.ch/en/Leaflets- forms/Leaflets/Contributio...](https://www.ahv-iv.ch/en/Leaflets- forms/Leaflets/Contributions-OASI-DI-IC)

There are other mandatory insurance deductions. Let's say the employer and the employee agree upon a wage of CHF 7500 a month, then first the employer deducts premiums of 5.125% or CHF 384 and also adds CHF 384 on his own and sends the money to the compensation office where the employer is located.

From my own experience as an employer I know that the compensation offices are very strict and know how levy the monies even from small mom-and-pop shops with employees. They are also helpful, as an employer you can call them or visit them and do what is neccessary. It's an efficient and tightly organized system.

</comment></comment></comment></comment><comment> Funes- >women [...] are under-represented in management positions

They are hugely under-represented in blue-collar jobs, as well. And over- represented in the health sciences, many fields of academia, and social work. Would all that be unfair to men?

<comment><USER6> Women are under represented in construction. Women are under represented in waste management. Women are under represented in front line duties. ...

</comment></comment><comment><USER6> What a pleasure this morning, lot of places in public transportation, fluid traffic, people arrive at work with a smile, then we can work on an exceptionally zen atmosphere.

They can repeat this operation as often as they please.

</comment><comment><USER7> Absolute equality is not realistic. People are not equal, individuals are different from eachother. And I say that as someone belonging to a minority group. However, I am convinced that equality can not be forced. Differences are what make us interesting. And yes, there are differences between the sexes, no matter how you twist and/or turn it. Trying to ignore those is unrealistic and a fair bit naive.

<comment><USER6> Exactly. Blondes are paid more than the rest of women. Tall people are paid more.... Any criteria you select can lead to differences in outcomes.

</comment></comment><comment><USER8> This article is international politics and is off topic. Doesn't even reference tech companies.

</comment><comment><USER9> Context is always important. Switzerland still has conscription in to the military and the culture that comes with it is very strong and male dominated - though it's importance has lessened somewhat.

Switzerland is a modern country and many have the same liberal values we all know but there appears to be a sizeable proportion which regard women for their, shall we say, utilitarian value and little else.

Given this backdrop, this strike shows that while there has been progress there is still a long way to go. Comparisons with the situation in other countries is a little unfair.

<comment><USER4> I live here and I really don't see a strong and male dominated culture, no more than when I was abroad in countries without conscription.

It's especially not the case in jobs requiring a degree, because degree holders are way more likely to have opted out and done either the civil service or pretended they were unfit and pay an extra tax instead.

However I guess it can slow things down from a different angle because currently the only gender currently legally oppressed is men, since the law guarantee the same rights to all but forces men into the conscription. This can breed some resentment, especially since progressives regularly fail to address it properly.

</comment></comment><comment><USER10> > Swiss women's pensions are 37% lower than men's, primarily because women > take time out from work to raise their children

<comment><USER3> And in a world where you can't both live off the man's income anymore, that's completely unfair.

Forcing people to trade their future income and security to raise kids is terrible.

<comment><USER11> How do you fix it? Any way you look at it, the person spending 12 hours a day every day sharpening their skills is going to have a much higher income on average than the person that spends their time raising kids.

<comment><USER3> Same as any quality of life improvement program: You tax people and use the money to make things better for society.

<comment><USER12> Why do i have to help pay for your choice to have kids? I dont like kids. I like fish. Will you help pay for my aquarium?

<comment><USER3> Because that's how it works to be part of a society. You sacrifice some of your work to raise the quality of life of everyone.

Roads, parks, power lines, communications cables, police, welfare, healthcare, sewage, electricity, clean water, healthy food, safe consumer products, clean environment, justice, protection for the vulnerable, duck wetlands, women's shelters, protection of creative works... These all cost money, and you pay for them with your taxes. Not everything goes equally to everyone, and not everything benefits everyone (by necessity), but the aggregate benefit is huge.

</comment></comment></comment></comment></comment></comment><comment><USER13> What does "done" look like?

I am not at all that anything is, but I am saying in many cases we are closer to the finish line than the starting line. (If we come to think of it there are things which have been completed to the extent that many people don't even know they existed)

In some cases the good fight for equality has transferred into something besides good or equal.

When do you start thinking about how to cross the finish line and what should you do?

</comment><comment><USER14> "stage", well said.

>However, women in Switzerland still earn on average 20% less than men, they are under-represented in management positions, and childcare remains not only expensive, but in short supply.

Women are less valuable? How will a strike solve this? I mean if this was true and I was a business owner I would only hire women because I could pay 20 % less. But of course that's not the way it works. Those "facts" are manipulative.

<comment><USER15> I believe the research in question does not speak on the grounds such as to suggest women earn 20% less for the same job vis-a-vis men, but rather claims due to women are being under-represented in a variety of high-level jobs, on average, they earn less.

And the reason may not be in the realm of misogynist inclinations depicted at high levels of government, it may be the case on average women choose professions that pay less.

We know that men are more likely to go into "nerdy" professions such as math or engineering, whereas women are more likely to go into the caring professions and to spend more time looking after children [0].

0: Geary (2010); Halpern (2012); Maccoby and Jacklin (1974)

<comment><USER14> Do men and women have the same level of education and have they chosen the same career paths in average? If they haven't then that 20 % is meaningless. As far as I know men and women can choose to get the degrees that they want and can choose to pursue the careers that they want. If they haven't chosen to do so what do they expect?

Ah I see you edited. Yes that was exactly my point. If they expect to get the same money for nursing that you can get for designing rockets then that's basically Communism.

<comment><USER16> More woman at my school in switzerland had the education to go into IT and yet we had 3-4 woman in 3 classes. That has zero to do with access to education and everything with personal choice.

One can argue its a society problem, but its not an education problem. Woman are overrepresented and get more education in general.

<comment><USER7> I experienced pretty much the same thing during the time I went to school. I specialized in IT during school already. We had about 2/3 women and 1/3 man. AFAIK, none of the women actually started to work in IT. Two or three man did.</comment></comment></comment></comment></comment>


How to think when programming in Lisp? - <AUTHOR> https://www.reddit.com/r/Clojure/comments/ckha6h/how_to_think_when_programming_in_lisp/ <comment><USER2> I see _(if ( < (_* _a b) c)))_ and think why didn't you use _cond_?! :)

<comment><USER3> (if a b c) translates to, for instance in Common Lisp, (cond (a b) (t c)): four more parentheses and an extra symbol.

 _cond_ came first; _if_ was invented later for less verbiage in the common case of testing a single condition, where the consequent and alternative are single expressions.

 _cond_ is better than _if_ when you find yourself stuffing _progn_ bodies into the _if_. (if a (progn b c) (progn d e)) -> (cond (a b c) (t d e)).

<comment><USER2> I'm sorry, I was attempting humor! You're absolutely right though - use _if_ for if-then-else type logic, use _cond_ for testing multiple conditions. _cond_ corresponds more to _switch_ from the c family of languages.</comment></comment></comment>


What's the best way to manage a team of remote software engineers? - <AUTHOR> http://arstechnica.com/information-technology/2012/07/whats-the-best-way-to-manage-a-team-of-remote-software-engineers/ <comment><USER2> Arstechnica does blog-spam. This is largely cloned from StackExchange

[http://programmers.stackexchange.com/questions/97660/what- re...](http://programmers.stackexchange.com/questions/97660/what- recommendations-can-you-give-in-managing-a-team-of-remote-software-engineer)

<comment><USER3> Aren't Stack Exchange staff intentionally posting this to Ars to drive traffic back to their site?</comment></comment>


Huang's Law Is the New Moore's Law, and Explains Why Nvidia Wants Arm - <AUTHOR> https://www.wsj.com/articles/huangs-law-is-the-new-moores-law-and-explains-why-nvidia-wants-arm-11600488001 <comment><USER2> Spoiler: the "Huang's law" this author is trying to coin is that AI processors (surely this means ML) are still following something like Moore's Law in terms of rate of improvement of processing speed per year.

Which is cool I suppose but comparing it to Moore's Law seems a bit unfair.

<comment><USER3> I feel that I took the days where headlines just said what an article was about for granted.

Also it is extra silly because Moore's law is about transistor density and transistor cost.

<comment><USER4> I have heard Moore's law generalized to " _computing power_ doubles every two years" which could then apply to "AI"

<comment><USER3> That's not a generalization, it's a misunderstanding. Not every program can benefit from doubling transistors because not every program is written to minimize serial computations and the impact of memory latency.

The reason Moore's law was insightful was because he didn't make the simplistic generalization of computing power (which is more difficult to quantify anyway) and looked at what was really happening on a fundamental level from an engineering perspective.

</comment></comment></comment></comment><comment><USER5> They're both really Wright's law. Theodore Wright published a paper in 1936 describing how aircraft production costs decline at a constant percentage with each doubling of production. The formal term is manufacturing learning curve.

[https://ark-invest.com/wrights-law/](https://ark-invest.com/wrights-law/)

<comment><USER6> Well, to be specific that seems more about manufacturing efficiencies (optimizing waste, batches, waiting time, etc as a line learns how to be more efficient) while this law and Moore's law are more about the intrinsic design of the chips (hardware and software).

<comment><USER7> Plus Moore's law has a time based element. I don't think anyone could have got to a 5nm process in 1970 say simply by deciding to up the volume of transistors being produced.

<comment><USER8> Generallys Moore's law is time based, Wright's law is production based. Both are great models, but Ark Invest's researcher found Wright's law to be more precise.

</comment></comment></comment></comment><comment><AUTHOR> [https://archive.vn/gCPp3](https://archive.vn/gCPp3)

</comment><comment><USER7> The rationale put forward in this piece for Nvidia wanting to acquire Arm is essentially that AI compute will move to the 'edge' and that as Arm dominates compute in the edge Nvidia needs to defend its position and to follow that compute. So in one sense it's defensive of Nvidia's existing position.

Once again though did Nvidia need to buy Arm to do this? It could license its own IP and /or compete with SoC's of its own for this market. As in the server market the advantage of ownership (and what is worth $40bn) is the advantage it gives Nvidia in information and control of what is done with Arm IP.

</comment><comment><USER9> It's interesting that they picked Amazon Go as an example of the power of AI (or ML) when in actuality most of the grunt work in those stores is done by "dumb" sensors AFAIK. The store "knows" that an item has been picked up from a certain shelf and thus it assumes that the item is what is usually on that shelf, it has little to do with either CV or AI in general, just careful placement of the items and weight sensing. I think that if you let a few kids roam free in there picking stuff up and setting it down in an unexpected place the magic of AI would dissolve into thin air.

<comment><USER10> Have you actually visited one?

I've been a couple times to one of the SF locations with coworkers. We definitely tried to trick system by passing items between us, and putting items down in random locations and then picking them back up later. When we left the store everyone got charged for the items they had on them.

I think you are too dismissive in saying its "just careful placement of the items and weight sensing".

<comment><USER11> How do you know there aren't humans on the other side of the cameras doing the item-customer matching?

Go has relatively few stores. Seems like the sort of thing you can still do manually, especially if the model expresses doubt.

<comment><USER12> I went to one of these stores in Seattle on a weekday afternoon with a couple friends. It was literally packed with people. We tried breaking the system by leaving items in random places and exchanging them between us. It still charged me accurately for a couple bottled waters, a sandwich, and some other snacks.

<comment><USER11> Again, how do you know there aren't humans on the other side of the cameras/sensors facilitating this?

At the scale they're operating at and the accuracy you point out, to me it's more plausible they're having humans assist.

<comment><USER13> I think they're saying that humans behind cameras likely wouldn't be _able_ to do this accurately.

<comment><USER11> Except that cameras in stores have been used for anti-shoplifting for decades. They've been used for more subtle things like monitoring tables at casinos.

I mean, I'm just asking the question how people know for sure Go isn't (at least partly) a Turk. It seems like an obvious thing to ask? But I first came to wonder if there's manual component involved after shopping a few times at Go. When it was busy, it took sometimes well over an hour to get a receipt. When it was empty, it was immediate. How come?

Also, the accuracy is completely anecdotal both ways... at least one person I visited the store with never got billed.

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> Relevant chart I did mapping how much $1 gets you in GPU compute on AWS over the last 10 years: [https://twitter.com/lmeyerov/status/1232937998464901120](https://twitter.com/lmeyerov/status/1232937998464901120) (note the log scale)

</comment><comment><USER15> [https://www.marketscreener.com/quote/stock/INTEL- CORPORATION...](https://www.marketscreener.com/quote/stock/INTEL- CORPORATION-4829/news/Huang-s-Law-Is-the-New-Moore-s-Law-and-Explains-Why- Nvidia-Wants-Arm-31323896/)

\- the exact same article for those who don't have a wsj-account

</comment><comment><USER16> I read the whole article a few times. But nothing in there explains why Nvidia wants ARM.

Is this one of those PR articles [1] that try to convince public about the ARM-Nvidia deal being great for the industry? ( While I prefer ARM to stay independent, I am not exactly _against_ Nvidia acquiring it )

[1] [http://www.paulgraham.com/submarine.html](http://www.paulgraham.com/submarine.html)

</comment><comment><USER8> The key to doubling AI operations is changing the architecture significantly, which sadly makes it harder to use the platform itself as well.

After CUDA we had to use Tensor cores, later float16, now sparce matrix multiplications that work because deep learning uses lots of RELUs.

<comment><USER17> CD players are a more legacy example of hardware doing magic, in this case, a whole lot of XORs. [1]

[1] [https://youtu.be/fBRMaEAFLE0?t=651](https://youtu.be/fBRMaEAFLE0?t=651) "Free with every CD, a Cray supercomputer"

</comment></comment><comment><USER18> The author fundamentally misunderstands how the industry functions.

Money wise, the ARM acquisition for this amount of money makes no sense if they want to save on core, or architectural licenses.

With the amount of money, and engineers Nvidia has, they can easily bootstrap a CPU ISA on their own.

It was by far not their top priority.

And in their function relevant to the "AI" trend as giant linear algebra crunchers, GPUs don't need much help from anything else.

And in longterm, basically anything you do pales to logarithmic scaling of PPW/relative performance. A s..ttier, and cheaper chip few years down the line invariably beats current best.

In practical terms, the winner in the GPU/CPU/WhateverPU is decided by who gets the better fab contract.

</comment><comment><USER19> On NVIDIA and ARM:

1\. Huang was seen sitting at the wheel of a Mercedes Benz S class, which has a stupendous amount of NVIDIA silicon. That's great, but the bulk of the market is for the electronics that go into a Chevy.

NVIDIA owns the highly profitable top end, but competitors (for gfx, robot brains, ...) are so disorganized that NVIDIA should move downmarket quickly to capture that terrain even if the profit margin is less.

2\. A cynical take is that of "Patronage Networks". That is if Softbank can't manage "Return of Capital" to its investors, Masayoshi Son might come to his room and find a katana to cut himself with. The $40B from ARM goes a good way to "saving his ass" and might mean Huang owes him one in the same sense that politician owes something to voters.

</comment><comment><USER20> Where's the data that says Moore's law no longer holds? I see comments and articles asserting this but everytime with evidence. The data that I do find certainly still suggests Moore's law is doing fine.

<comment><USER21> Moore's law is still on pace but Dennard scaling has broken down for ~15 years now. That means we're not getting the same speedups as we were used to and that gets explained by "Moore's law has broken down" as a title.

[https://en.wikipedia.org/wiki/Dennard_scaling](https://en.wikipedia.org/wiki/Dennard_scaling)

<comment><USER22> I did not know about Dennard law, thanks for that link. Any idea why it has slowed down?

<comment><USER23> Dennards law held until the approximately linear relations that made it work ended. Delay stopped being entirely gage, and more importantly, voltage couldn't drop forever, due to material limits and intrinsic silicon limits.

</comment></comment></comment></comment><comment><USER24> I'm wondering if there are any firewall/router/load balancer type of devices that use GPUs for their parallel processing capabilities (or whether that's even possible). Anyone familiar with this ecosystem to comment?

<comment><USER25> Disclosure: I work at NVIDIA.

This is a developing area with a number of research and development efforts ongoing looking at basic packet filtering flows, for example: [https://ieeexplore.ieee.org/document/7019193](https://ieeexplore.ieee.org/document/7019193) [https://arxiv.org/pdf/1312.4188.pdf](https://arxiv.org/pdf/1312.4188.pdf)

and AI-driven approaches like CyBERT showing promise: [https://medium.com/rapids-ai/cybert-28b35a4c81c4](https://medium.com/rapids- ai/cybert-28b35a4c81c4)

One of the main system challenges has been efficient high-bandwidth and low- latency delivery of packet flows between NICs and GPUs. NVIDIA has their cuVNF library (part of the Aerial SDK) that works with GPU Direct NICs and extends the DPDK toolkit to accomplish this: [https://developer.nvidia.com/aerial- sdk](https://developer.nvidia.com/aerial-sdk)

However, as for integrated devices, I'm familiar with at least one that claims to be on the market: [http://www.h3c.com/en/About_Us/News___Events/News/201907/121...](http://www.h3c.com/en/About_Us/News___Events/News/201907/1218274_294554_0.htm)

</comment></comment><comment><USER26> Didn't Carmack say Moore's Law still holds? At least long enough to get VR where he wants it to be.

<comment><USER27> Didn't Carmack recently have a talk where he said he was done with VR and moving to AGI

<comment><USER28> Money talks

</comment></comment></comment><comment><USER29> I still cannot comprehend the significance of Moore's law. Although the hardware keeps getting more sophisticated, I cannot perceive that today's computer is 100x faster or more than 20-30 years ago. Perhaps the software has been getting bloated to counteract or the speed increase is not real.

For AI chip, will we fall into the same situation? will AI algorithm still focus on efficiency?

<comment><USER30> While processors have become more powerful, we're now coding our apps in Javascript, which negates any progress described by Moore's Law. Of course I'm being hyperbolic but you get my point.

<comment><USER29> Thanks, finally someone agree with my observation. :-) I got deduction point for saying that statement. For me, it is not right to use 100x speed increase for eye candy feature or using bloated Javascript libraries.

</comment></comment></comment><comment><USER31> Nvidia buys ARM, Apple builds its own GPU, and the dance goes on.

</comment><comment><USER32> This is silly. Just because you can build bigger chips doesn't mean you have anything similar to Moore's law, which was more about the economics of semiconductor manufacturing.

<comment><USER33> Moore's Law is literally about the number of transistors per IC. Building bigger chips is... extremely similar.

<comment><USER23> Yes, except the important parts. In Moore's law scaling, you reduce the cost per transistor, and because of that there is money for capex and the consumer benefits.

In Huangs law, si is commoditized, so the benefit accrues to the designer and software makers, and really only in narrow domains.

</comment></comment></comment><comment><USER34> Why were either allowed to become laws. Moore's law was a little confusing in high school

<comment><USER35> _> Why were either allowed to become laws. Moore's law was a little confusing in high school_

Nobody _allowed_ Moore's Law to become a law.

The so-called Moore's Law is really just Gordon Moore's _Extrapolation_ of an observation. In 1965, he _observed_ that transistor count was doubling every ~12-18 months. He _extrapolated_ that this trend could continue for ~10 more years to 1975.

But journalists and readers like snappy poetic words. "Extrapolation" is a long-winded 5-syllable noun so it's no surprise that the 1-syllable "law" was used instead. Wikipedia says: shortly after 1975, Caltech professor Carver Mead popularized the term "Moore's law".[1]

Although calling it _" Moore's Extrapolation"_ would be more accurate, it just doesn't roll off the tongue as nicely. Sometimes humans value the sing-song poetry of a meme more than its dictionary accuracy.

[1] [https://en.wikipedia.org/wiki/Moore%27s_law#History_of_the_c...](https://en.wikipedia.org/wiki/Moore%27s_law#History_of_the_concept)

<comment><USER36> Or Moore's Assumption. Which is less of a mouthful, through also less precise.

<comment><USER37> Moore's observation.

<comment><USER38> Absolutely right. An observation that became something of a self-fulfilling prophecy.

<comment><USER39> I'm not sure about "self-fulfilling" part. If Moore didn't do his observation, would doubling of number of transistor every 18 months still work?

<comment><USER40> The expectation drove capital investment.

The business application of it meant profits from each generation could fund the higher costs of each succeeding generation.

Now we are in the tens of $billions for a new generation, with much smaller increases in performance, and it is faltering. Will we spend hundreds of $billions on factories for smaller transistors? Or will we find a more cost- effective way to get more performance?

<comment><USER38> It appears as if chipmakers will continue to drive things as small as they can, e.g. with EUV (finally).

But the expectation is that a lot of continued performance gains will have to come through other means. These are some of the things that were talked about at the Hot Chips conference: [https://enterprisersproject.com/article/2020/9/moores-law- wh...](https://enterprisersproject.com/article/2020/9/moores-law-what-means- today)</comment></comment></comment></comment></comment></comment></comment></comment>


Show HN: BBC Recipe search engine. Open source, super fast - <AUTHOR> https://www.auntiesrecipes.co.uk/ <comment><USER2> In other recipe news, some devs @nytimes recently released some __VERY__ interesting code that handles unstructured data from the NYTIMES recipe archives:

CRF Ingredient Phrase Tagger [https://github.com/NYTimes/ingredient-phrase- tagger](https://github.com/NYTimes/ingredient-phrase-tagger)

I used to work with a lot of recipe data in multiple languages, so this topic remains close to my heart.

This could be an interesting project to add to the trained data.

<comment><AUTHOR> Very cool. I was thinking of expanding mine to work with other recipe sites, so this may come in handy, thanks!

</comment></comment><comment><AUTHOR> On Tuesday the Guardian reported that the BBC (fondly aka Auntie) would be archiving their recipes, so I quickly scraped the site and wrote a search engine for it.

Not sure how the site will evolve, if at all, but it was a fun side project!

Code is here if you want to play: [https://github.com/user24/auntiesrecipes](https://github.com/user24/auntiesrecipes)

<comment><USER3> I thought archiving meant it would be no longer on their website, it would be awesome if they just released it all under something like the GPL. Could do some fun machine learning stuff with it...

<comment><AUTHOR> I'd love them to release it as open data so that I'm not in murky waters.

If they move the recipes I can update the links. If they take the recipes down (which they've said they won't, now) I have got all the data so could rehost them.

edit: but, if you want to do some fun ML work, my scraper should help get you started!</comment></comment></comment>