skysight-inc/HackerNews huggingface dataset:
> 400 lines of code to wait for keyboard input.. sweet Jesus.

That function isn't particularly bad. It's a little messy, but it's reasonable for legacy portable code.

>> This function is over 400 lines and contains over 40 #ifdefs.

This is a low-level function that is supposed to handle different platforms, so this is the function where platform-specific #ifdefs should be collected. It's mostly a giant case/switch style #ifdef wrapper around a list of platforms and features.

>> Vim tries to be compatible with every OS, including dead ones such as BeOS, VMS, and Amiga.

That isn't a bad thing. Unless there is an actual[1] problem with the legacy platform support, then it should be left in for the people that do use the "dead" OS.

> Features that drastically change behavior are enabled/disabled with preprocessor flags.

Yes, that's the point of those flags. This is to enable/disable major features like XCLIPBOARD support which isn't going to compile on non-X11 platforms, or for debug and other unusual features that shouldn't be included in standard builds.

> Cross-platform libraries like libuv didn’t exist when Vim was created.

Sure. Which is why this function exists. Also, libuv is nice, but it isn't a replacement for all of the features (like XCLIPBOARD) this function provides. Even if most of the function was replaced with a libuv port, some of the #ifdefs would still be necessary.

[1] "It's old" doesn't count.
I have a MacBook (which I love in general) and I've come to prefer its keyboard to the older Mac keyboards with more travel and smaller caps, which just feel mushy to me now. I doubt i'll be getting one of the new Pro models in the near future, but I suspect that the keyboards on those might be a sweet spot for me as far as laptop keyboards go.

The keyboard I use when I'm sitting at a desk is an HHKB with PBT caps and deep, luxurious Topre switches, which has no real mobile equivalent as far as I know.
This sounds like it would be fun to detect. What would I have to know, to detect ultrasound signals and recognize them as a signal?

It also sounds like something that ublock origin will want to get interested in.

What an arms race, right in my pocket.
> Python has a) an extensive runtime library (e.g. batteries included)

Which is also decently documented. The importance of good documentation for libraries (and other tools) cannot be over-emphasized.

Also, just as important as the standard library are third party libraries.v The advantage of using Python (or other popular languages) is that there is probably already a library for what you want.
Manhattan is also exorbitantly expensive. Even more so than SF, with more people. This also relates to the skyscrapers argument mentioned by a sibling thread.
> the UX/UI of OS X is just miles ahead of anything on Linux.

I thought the same, but I spent the last few days surveying the field and it's not actually the case anymore. ElementaryOS and LinuxMint have top-notch desktop managers (Pantheon and Cinnamon respectively) and provide a really polished experience. After a few hours on Elementary in a VM, I am really tempted to format my rMBP and see if it can be my main OS going forward.
Amazon has completely lost control of their own marketplace for electronics and accessories, as I suspect nearly every HN reader has noticed.

Perhaps being held accountable for it will cause a change in policy. It's about time.
Or surf from a VM on your machine.

I used to do this on linux, as I had copies of my windows VM and I would just browse from the windows box on another screen and then work from the linux one on the main screen
Given some of the comments in another recent thread (https://news.ycombinator.com/item?id=12828398) your coworkers just might kill you for using a loud keyboard (but given the construction of an IBM Model M, you will probably be able to defend yourself with it).
1. 1Password apparently works fine with WINE, but I haven't used it myself.

2. Spotify will still receive updates for Linux, they just don't have a dedicated Linux developer on it anymore. On my machine it still works fine.

3. I prefer GoodBudget, which IMHO is much better than YNAB, especially when it comes to their iOS/Android apps. The desktop client just runs in the browser. Also, I've heard YNAB will be discontinuing their desktop apps?

4. There's https://github.com/odeke-em/drive, a fork of the official drive client, and it's still being actively developed.

5. Haven't used Alfred, but you can get some of it's features using other tools, e.g. indexed search using Tracker, clipboard history using Diodon, and perhaps some other things. However you are right that you can't get the kind of polished automation Alfred seems to provide. Rather, you'll have to write shell scripts and use the commandline tools to get what you want. Absolutely everything is possible, but it'll feel a bit like using lots of duct tape at first.

Note: I'm not saying you should switch right away (1). But I used Linux (Ubuntu) full-time for work and at home for the last 5 years and I was able to do everything with very few exceptions (2). Most peripherals that I bought just worked out of the box. Going Linux full-time is 100% doable.

Also, with so many apps running in the browser (or on Electron) the choice of OS matters less every year.

(1) in fact, I'll probably get a Mac myself this year for developing iOS apps.

(2) Only exception: Windows VM for Microsoft Word/Excel/Powerpoint & iTunes for iPhone syncing. All other software ran in WINE or had a reasonable Linux alternatives.
I love Kierkegaard and I agree that it can be really hard to figure out what he is trying to say. I wouldn't have gotten nearly as much from his writing if it wasn't for supplementary material.
> I really don't understand why developers use macs at all.

Because there are developers on this world that don't develop for UNIX, rather native applications for macOS, iOS, tvOS and watchOS.

Being a developer doesn't mean one is only allowed to work on UNIX.
I've been pretty happy with the "sakura" terminal[s] - I don't really know iTerm2, though, so I'm not sure what "iTerm2-like quality" means, or if Sakura matches (or surpasses, for that matter) it.

I'm not sure why you need a shortcut for copy, select copies by default on linux[x11] - middle-button pastes (or shift-insert).

[s] http://www.pleyades.net/david/projects/sakura

[x11] https://www.debian.org/doc/manuals/debian-reference/ch01.en....
No problem. Please wait a bit for my parts to sell before listing yours ;)
You can buy a dell xps 15 today that comes with: 3840 x 2160 display / 1tb pcie solid state disk / nvidia gtx 960m (crucial for developing cuda programs and prototyping deep learning on your laptop) / 32g ram. For $2340 (ten percent off coupon at the top of the page). I'm not sure if this link will work: http://www.dell.com/en-us/shop/productdetails/xps-15-9550-la...

And this thing comes with regular usb ports and an hdmi port instead of usb-c nonsense so I don't have to immediately drop $250 in dongles just to keep the capabilities I already have.

My problem with a macbook is because you simply can't upgrade anything, you have to prepay for all the disk you want to use for the next 3-4 years. Add them screwing us on magsafe, and I would need $400 plus in extra chargers and dongles (hdmi/dvi/vga so I can connect to whatever random projector / tv I run into), etc. As some snark on twitter said, we should call our new giant kit of cables to make macbooks usable a courage of cables.

I just can't believe these people have the giant balls to roll out a $3k+ laptop that you can't connect an iphone 7 or iphone 7 headphones to without purchasing $50 in adapters.

I'm sitting here hoping linux gets usable fast enough that I'll have something to transition to. I need a unix-ish box that was working power management/audio/the ability to plug into whatever random projector or tv I encounter and assume it will work.

edit: just to be clear, my complaint really isn't about pricing of macbooks. I mean, cheaper is better, but I'm comfortable spending $3k on a laptop. I just need a laptop that has 32g or more of ram, and that connects to my peripherals without hundreds of dollars of dongles that I have to carry around. That laptop better last 3-4 years though. If Dell can profitably sell the above for $2400, apple should be able to very profitably sell the same specs for $3200.
A Proposal for an Email Avatar Header
I think johnw tried at some point but Yamamoto isn't very excited at the prospect, and who would really blame him?
Keeping his work out of the main branch gives him the freedom he needs to focus on technical matters and introduce support for new features as they're being exposed by OSX APIs.

As long as Stallman holds sway over Emacs and can demand that one cripple his own work for _political reasons_ , I don't see this situation changing. I'm just glad that Yamamoto did not fall for the "lowest common denominator" approach and has enough pride in his own work to do things as he sees fit.
It's more like a "proxy" for your SIM card where it can act as its own SIM, or as a passthrough, depending on software settings.
Europe had competition between states but it also had stability. The key seems to be balance between competition, that forces states to innovate and gives freedom to inventors, and stability, that brings wealth and allows academic/engineering traditions to take hold. Persia had many scientific discoveries and technological innovations during the so called Islamic golden age but whole cities have been destroyed including there libraries during the Mongol invasions that spared Europe. Meanwhile, Paris, London, and many Germanic cities had centuries without suffering from catastrophic destruction.
Also, I think that the focus should be on a technical level more than on a cultural level. "Then one day, Europeans build a vacuum pump. [...] In 1573, a Danish astronomer called Tycho Brahe observes a supernova." I would rather know more about how they came up with pumps and telescopes than read a long dissertation on how Chinese elites were too conservative or on how Aristotle has been trashed. Why did Europeans came up with pumps and telescopes and not China? I feel that the answer has more to do with demands (from demographic growth), concentration of wealth and skilled craftsmen than with political systems. Did China also had available materials, skilled workers and demand for efficient production?
IMO Steam needs to launch an Android store. If anyone can convince consumers that mobile games have the potential to be high quality and valuable, it's Valve. People who balk at the idea of paying 99 cents for a mobile app happily drop $20 on a game on Steam.
10 years ago I led Dell’s recall of 4.1m Sony batteries
It doesn't even need to go underground. Just purchase off Ebay with direct shipping from China.
Tiered monthly pricing based on number of sessions tracked is how I would expect to pay for a service like this.

Would love to see it integrated with an A/B test optimisation tool.
What we see once, but can't see again – visual perception
Seriously???
In that case the real problem is pushing directly from a dev machine to prod.
It is simply crazy not to use a staging server.
I bet that even if the Dev machine has the same OS as prod a lot of shit happens when not using a proper staging server (been there seen that).
So the production problems that you experienced are completely unrelated to the OS on the dev machine.
They are simply caused by the wrong deployment process.
I read that there is an independent ARM processor controlling TouchBar. Is there solid proof the TouchBar reverts to Func keys when no OS has initialized/rendered keys to the TouchBar?
My nomination for what we get wrong over and over again: working under the assumption that there is One True Syntax. There isn't. Different syntaxes are suitable for different needs.

A single language can support multiple syntaxes if the AST is exposed as a first-class construct. This makes it easy to write new syntactic front-ends. Unfortunately, the only language to date that supports this idea is Lisp, which means that this incredibly powerful idea is conflated in most people's minds with lots of irritating silly parentheses. (One of the reasons for this conflation is that once you start adopting this mindset the parens become a lot less silly and irritating, but that's another story.)

I'm currently working on cryptography code, where algebraic syntax is very convenient. Here's an excerpt from some code I'm currently working on:

(define-method (point-double (ec elliptic-curve a b c q r) x y)
(bb
lambda modp(q, (3*x*x + 2*a*x + b)/(2*y))
x3 modp(q, lambda*lambda - a - 2*x)
y3 modp(q, lambda*(x-x3)-y)
(values x3 y3)))

(define-method (point-add (ec elliptic-curve a b c q r) x1 y1 x2 y2)
(if (and (= x1 x2) (= y1 y2))
(point-double ec x1 y1)
(bb
lambda modp(q, (y1-y2)/(x1-x2))
x3 modp(q, lambda*lambda-a-x1-x2)
y3 modp(q, lambda*(x1-x3)-y1)
(values x3 y3))))

Notice that it looks like Lisp (and it is Lisp) but there's infix code seamlessly embedded. Moreover, the MODP construct automatically converts everything to modular arithmetic operations, so, for example, x/y doesn't actually divide but instead expands into (* x (modular-inverse y p)). But when I code, all I have to do is copy the mathematical formulas more or less verbatim and my compiler takes care of expanding everything out into calculations that use Montgomery reduction or whatever optimizations I want to provide. This approach also has the advantage that I can test the correctness of my protocols completely independently of the correctness of my optimizations.
I watched a vid some time ago about "who exactly invented the hoverboard" - it was really interesting... I can't find it right now, but if I find it - ill post it.
For protection, I put all my files I care about on Dropbox. Is that enough? It's enough for backup for most things, but I worry attackers would be smart enough to kill it and also the old revisions that Dropbox stores.
Average rent for a 1 bedroom in Manhattan is $3,400.00 / month. That seems to be about on par with the 'city' parts of SF. In Manhattan you also get a much better public transit system, more restaurants, and more museums.
What's funny is that if you are not a registered reseller of certain products, they product's manufacturer will flag your account as a 'copyright violation' claiming you don't have permission to sell their intellectual property (because you are selling it at less than the MSRP and hurting their bottom line by advertising one item at below their decided price,) and as a seller you have no choice but to comply or have your seller account suspended. The whole system seems automatic and though you reply to every message indicating there is no intellectual property violation as your products are genuine they are ignored. I have definitely bought a knock-off iPod from China on Amazon, too.
I dunno... I'd feel much more comfortable if all humanities smartest technical people were trying to make the next whatsapp clone /s
>> Good programmers understand how malloc works.

> "Good programmers know how their GC works. What, are you kidding, or am I misunderstanding?"

I think you are not understanding what I am saying.

You link your allocators into your code so you know what they are. You see the source code. You know exactly what they do. If you don't like exactly what they do, you change them to something different.

A garbage-collector, in almost all language systems, is a property of the runtime system. Its behavior depends on what particular platform you are running on. Even 'minor' point updates can substantially change the performance-related behavior of your program. Thus you are not really in control.

As for your other examples, apparently you're a web programmer (?) and in my experience it's just not very easy for me to communicate with web people about issues of software quality, responsiveness, etc, because they have completely different standards of what is "acceptable" or "good" (standards that I think are absurdly low, but it is what it is).
Sue the pants off of them... maybe it will get Amazon to crack down on what they're willing to sell (or host the sale of) before it's a completely lost cause.

I used to really appreciate Amazon, but in the last couple of years it's become a bad joke.
We absolutely noticed. An Ethernet cable is being sold as 45000+ different products because it is uploaded as "Ethernet cable for HP X" "Ethernet cable for IBM Y" and so forth. It's incredible. I won't link the company but their name is like the "run command as root" command with the first vowel changed to be the same as the last. There are other cases, this is the most egregious I am aware of.
Apple processors and improvements in industrial engineering happened before Cook took the helm. You could argue those were under Jobs's watch...

And yes the increase of revenue in services is safe, stable bet. But offering music and email and image storage doesn't seem to be be groundbreaking services to me.
The post mentions in passing David Beazley's curio[1] project. Is anyone using curio for async programming instead of asyncio?

The curio docs are fun to read through and didn't leave me feeling lost. They're also full of understandable examples of using the new async/await syntax.

I've made some simple scripts with curio but have found I keep hesitating take on the asyncio docs to learn it "the real way". Any thoughts on whether curio might be a plausible alternative to asyncio?

[1] http://curio.readthedocs.io/en/latest/tutorial.html
This kind of stuff always gets me thinking a lot. It is very mysterious how some companies can spend such enormous amounts on research and still seem to get very few innovative products in return.

Gets you really thinking about, what exactly is the nature of innovation and research?

Our society as a whole is inherently focused on quantity over quality when it comes to something like research which so obviously is about quality. Science is getting measures as number of patents issues, amount of GDP spent on research etc. And these things becomes goals and targets by themselves.

Nobody seems to stop and ask whether quality research and discovery is actually happening or whether we are getting patents for the right kind of things.

This quantification and reducing everything into a number is a disease which I think is destroying much of what is good about our society.
Having an interest in design, I often feel a vibe of aggression towards the whole endeavor coming from some elements of OSS scene that I can see being equally infuriating or hurtful as "neckbeards". Among them are:

- dismissal of design as a sort of thin veneer, somewhat fake, lipstick-on-good-bacon

- design as a kludge aimed at amateurs, to the point of preferring the worse UI (all else being equal) so as to prove something

- design = prettiness, and, by extensions, design being entirely a matter of taste and therefore impossible to criticize

- the complete rejection of any argument or evidence that cannot be derived from any of the laws of thermodynamics, Shannon, or at least an RFC

That being said, having browsed the elementary OS website, I'm not sure if isn't the victim of some of these errors itself. It sure seems to be a ripoff of macOS ca. 5 years ago applied as thin veneer to Linux. Their "brand" page may also be the first implementation of cargo-cult design.
I agree that they're currently expensive. Better hope that enough people pay the early adopter cost then.
Dropbox seems to store previous versions of files.
Event sourcing, CQRS, stream processing and Apache Kafka: What’s the connection?
Couldn't you do the same thing with less of a human cost by merely telling people about cases where the ransomware was unreliable, and refusing to spread the information that it was reliable?
> Honest question here: Do people have the right to live wherever they want? [...] But the real question is, for people that can't afford to live in SF, and are constantly protesting that fact - do you have the right to live there, or should you just move somewhere else?

Short answer: no. However I, and probably you, come from a place where we're able to obtain jobs fairly easily in other parts of the country. Mobility is something we expect and are actually privileged to. For those protesting, the idea of leaving San Francisco may be a completely outlandish thought for them.

I'm not saying one way is right, but I think there's a level of emphathy that needs to be used when we're talking about the concept of "home." Abstracting this into simple economics seems callous when we're talking about displacing people.

Also, the audience here might not be the best source to get an answer from a person/family being forced out.
Maybe I'm not the intended audience for this article, but I don't really have a problem with a lot of the warts of asyncio. It really is pretty simple to use if you don't have your mind hard set to a different way of thinking. It wasn't as simple in Python 3.4, but then the async/await keywords became part of the language in Python 3.5 and simplified things. Understanding asyncio took me a few days to understand the complexities: the event loop usage and how this works with async/await, how an async function is different than a normal function, and a few other things. Once I understood those complexities (which I don't mind because it is a new part of the language) it was easy. Granted, I feel like it's easier to just work around issues rather than complain about them but I didn't find particularly many issues about asyncio.

As an aside, not to pick on Armin but he was also complaining about Python 3 about things that may have been valid, but were more that he didn't like the way that Python 3 worked because he liked Python 2 more, and hid that fact by writing lengthy blog articles about how he doesn't like certain Python 3 things. I do find it a little strange that he does complain about these things publicly rather than trying to fix the things he doesn't like (if they are fixable), especially given his reputation in the community and his Python projects like Flask, because it makes him seem whiny and solves none of the issues that he's presenting.
I'm not sure I understand you.

Is your point that because the US hasn't toppled any governments in Western Europe we shouldn't worry about them doing it there? I see no reason to assume that Western Europe somehow is out of bounds.
Show HN: Workplace Giving Platform for Small Businesses
Everyone does have the right to live in SF. Anyone is free to earn the money required to afford a place here.

The people who earn 100k+ didn't win some sort of lottery... they choose to work in industries that pay well. They get up everyday and go to work like everyone else. Yes, some people are born into families with better support than others - but everyone has the opportunity to go to college and study STEM. Any student with decent grades and lack of capital qualifies for financial aid and scholarships.
I am finding it increasingly difficult to know how much to trust items to buy on Amazon.

It used to be fairly obvious which was a "third party seller" and which was Amazon (as in one company that sourced manufacturer products, bought them and shipped them). These days I basically click through to purchase and try to guess from the amount of P&P if they are Amazon, fulfilled by Amazon or some guy in his garage.

And why can't fulfilled by Amazon actually be on the product description !

This is another example of Internet enabling business models that law and society have not quite kept up with.
Amazon probably don't have a strategy of confuse the shit out of the customer, but they can twist their business model so many times that's what has happened.
Love it. There's a growing trend of open design. Another example is http://www.logodust.com where we open source logo designs