skysight-inc/HackerNews huggingface dataset:
> typedef uint16_t uint16;

does adding that little "_t" hurt you that much ? think that now every programmer reading your code will wonder "hmm... what is that uint16 type ? is it equivalent to uint16_t ? is it some weird macro designed to accomodate 1990 compilers ?" etc etc.

> const char *fileName

for the love of all things holy, use std::string_view for non-performance-critical stuff like this.

More generally, the only remotely C++-like thing in your code is the use of std::vector. The rest is honestly more C than C++. This shows for instance in SampleChannelFractional with that ugly #if 0. Proper C++ design would have SampleChannelFractional be instead a function object that you could pass as template argument: this way, the user can choose which implementation he wants without requiring a recompilation, and without indirection cost.

In addition, if you change some parts of your code, the C++ compiler will be able to check both code paths directly.

That is :

struct LinearSampleChannelFractional
{
float operator()(const std::vector<float>& input
, float sampleFloat
, uint16 channel
, uint16 numChannels)
{
// your linear implementation here
}
};

struct CubicSampleChannelFractional
{

float operator()(const std::vector<float>& input
, float sampleFloat
, uint16 channel
, uint16 numChannels)
{
// your cubic implementation here
}

private:
float CubicHermite (float A, float B, float C, float D, float t)
{
// encapsulate it here:
// the rest of your code does not care about this function.
}
};

// First modification: pass Fractional as template argument
template<typename Fractional>
void TimeAdjust (...)
{
// replace SampleChannelFractional:
output[...] = Fractional{}(input, srcSampleFloat, channel, numChannels);
}

template<typename Fractional>
void SplatGrainToOutput (...)
{
// same
output[...] = Fractional{}(...);
}

// Second modification: refactor this in a Granulator class of some sorts...
// and use the standard C++ naming convention
template<typename Fractional>
class granulator
{
public:
void time_adjust (...)
{
// uses the class template argument
output[...] = Fractional{}(input, srcSampleFloat, channel, numChannels);
}

void splat_grain_to_output (...)
{
// same
output[...] = Fractional{}(...);
}

void granular_time_pitch_adjust (...)
{
// ... splat_grain_to_output(...)
}

int main()
{
// now both kinds can be used at the same time in your code, and both will be
// just as efficient as with the #if 1 ; for instance the choice
// of the granulator to use can then be part of a configuration option
// in a GUI software
constexpr granulator<cubic_sample_channel_fractional> gran1;
gran1.time_adjust(source, out, numChannels, 0.7f);

constexpr granulator<linear_sample_channel_fractional> gran2;
gran2.time_adjust(source, out, numChannels, 0.7f);
}
> this seems to only happen when the cells are actually removed

Not, this is false. All alive tissues are subject to osmotic regulation. Is a basic mechanism to protect the cell integrity.

> drinking distilled water causes blood cells to burst in our veins?

Not in your veins, in your gut. Is well known that drinking big amounts of distilled water causes diarrhea. A glass of water will not have much effect on you. All depends on the dose. (Injecting distilled water directly in your veins could cause blood cells to burst, on the other hand).
Depends on whether they're just being used for day-to-day work or, like a ship's log, they're actively getting archived. I think atm, printing and storing is still the way to go with that.
Where did you find the 7 character suggestion? 7 used to be the default suggestion, but the problem of collisions has been acknowledged and dealt with by the git project. Linus himself authored the change that made the abbreviated revision length vary based on the size of the repository: https://github.com/git/git/commit/e6c587c733b4634030b353f402.... Also, the command for creating references to other commits which comes from the git project and is linked to in the article also uses automatic abbreviation length.
Or better yet. You get a bag of clothes in, "Hey, I know this guy, he's an a$$hole, I'm going to plant something in his clothes and report him, ha!"
Antidotally, I was a fan of Fitbit's focused model and owned several of their middle range devices. I ended up buying an Apple Watch for two reasons (one in FitBit's control and the other not).

1. Connectivity with my iPhone was spotty. I mostly blame the iOS ecosystem for this; long-running apps will sometimes lose connectivity to BLE devices. This would happen even when they are in the background, probably how apps are suspended and resumed.

2. Band quality, at the one year mark they the band would start to fall apart. Fitbit support, for their part, was always easy to get a replacement (usually free). But after the 3rd time, I kinda of felt that I shouldn't have to deal with that every year.

So when Apple announced the waterproof Series 2, it was right around the time my Fitbit was falling apart again. The Apple Watch (expensively) solved my two issue.
Not OP, but good question.

I find Rust is a much better language, but there are very few mature libraries right now if you do something outside the scope of what Mozilla is doing. Also very few companies that are working in Rust (AFAIK, if you know some let me know) looking for devs.

If you want to work in a company that is doing any kind of low level code you will either need C or C++ as a foundation. At least to understand existing code. Most companies won't just rewrite everything in Rust, no matter how good the language is.

I really hope Rust replaces C++ for new projects, but it's just too new to tell whether that will happen. I find there's a bit more momentum (and good ideas) than in D, but nobody can predict the future from 2-3 years of language history.
Amazon could become the third-biggest US bank
Agreed, that book is great. I keep pushing off getting a real sous vide setup because the cooler is 'good enough'.

Last year I went to a fancy steak house in Las Vegas, and my thought was that I prefer my own steak. I was surprised, since I assume that restaurants have access to better cuts and can age it better. I mean, it was a fine steak, but I preferred my own.
For a constrained problem like that, it's certainly possible for someone to have fully automated the PCB design. (I think it's unlikely to be commercially viable to create that automation, but there's a lot of excellent hobbyist work out there.)

There's still a time-intensive series of steps for one-off production from "finished PCB gerbers" to "finished PCB with all components installed, all mechanical holes in exactly the right place, microcontroller firmware written and programmed, and the whole thing tested".

If the scripts exist, there's probably forum discussions about people's experiences trying that path.
Or just reporpose an old phone.
It's not a very long date, you show up, show passport/id-card and they'll authorize you getting a new password send. And while you're there you can write out any SEPA transactions you need done onto paper and submit manually (almost any bank still has a special mailbox for manual submission).
The referral link doesn't seem to work for me either. Maybe you want to add the referral link in the confirmation email as well? I lost my referral link after closing the tab on signup, forcing me to signup again :o

Looking forward to it! If only I wasn't 15k in line :D
I cannot comment on the DCIM side, but I agree on the "everything as code" mantra.

For a relatively small setup I chose a combination of Ansible, Kubernetes and Dockerfiles, but probably any combination will do. All these files are stored in a git repo.

Even after months (or years) neglect, I can easily know what I configured (and why!) and update where needed with a minor effort.
Genomic analysis opens door to precision medicine for childhood cancer
I think a great deal of our confusion in life comes from the idea that we have a strongly fixed identity - that we are this or that "kind of person" - with definite characteristics which don't vary much with context.

I think we construct an enormous number of illusions, especially with regard to what our - usually untested - values are.

I think many of what appear to be our innermost feelings are learned/mimetic reactions that have become deeply ingrained.

This can be disturbing to some people because it makes them feel unstable - but it is also very freeing because it means we can really change. Even how we feel about things.

It also means we can become monsters.
I think people are conditioned to associate "leaks" with "scandals" (especially when it comes to the three letter agencies), when in actuality this "leak" is just a revelation of completely reasonable and expected activities.
So I recently picked up kicad for some hobby project and made my first boards. I did exactly as you said "watched some tutorials" and I still think that making PCBs is easier than I thought it would be. Kicad definitely has rough edges and I have zero experience with altium but I'm still getting things done so I'm not sure your advice holds.
I was generalizing, of course. Your experience may be the exception or (hopefully) the vanguard.

Self-published books with non-traditional page counts, at wildly different price points, discovered via recomendation engines is exactly the kind of thing I was hoping to see.

From what I can tell though, this is still a marginal phenomynon, less impactful to the median author than twitter or blogging or somesuch. I don't think this is a coincidence. Amazon has allowed for it, but not really pushed on it, or gambled on it.

When kindles came out, I read a Seth Godin (blogger/writer) comment that eachone should have shipped with 1,000 books, including his. He'd have agreed, in order to get to readers (with his back-catalogue).

Maybe (hopefully) you're right on the timing. Maybe we're just discovering the medium. But, (a) I think things move faster these days, and 10 years should have been sufficient. (b) amazon controls most of the levers, and I think it won't happen unless they decide that it happens.
Well, there's already the peak/off-peak signalling. You could theoretically send another signal, perhaps with time encoded, at midnight or some such. Note that this is a unidirectional broadcast, as opposed to the complexity of an actual bidirectional network.
Ask HN: My Docker image just hit 1M+ pulls. What now?
Here's some context. Sometime in May 2017 I was following the Chrome headless dev closely and wanted to use the most up to date build. As I wasn't able to find a regularly updated Docker image on the Hub, I decided to build my own [0]. I sent a short announcement to the headless-dev mailing list [1] and 10 months later the image hit 1M+ pulls. Just for fun, I've been collecting the pull count on a regular basis [2].

I'd like to make some changes to the image (remove the custom certificates feature, update the base image etc.) plus any other features that might be useful. The source repository is hosted on Github [3] and there have been 2 pull requests to date, so not much data to go with.

I'm looking for ideas how I could best get in touch with everyone who is using the image, how to collect feedback going forward and any other suggestions the HN community might have for the future direction of this project.

Thanks!

-alpeware

---

[0] https://hub.docker.com/r/alpeware/chrome-headless-trunk/

[1] https://groups.google.com/a/chromium.org/d/msg/headless-dev/ntHnXHBvHaI/lP0Jw-laAwAJ

[2] https://docs.google.com/spreadsheets/d/e/2PACX-1vQMZcFPvH92Vptpj5gz3WX-z-fe3F0ycVP3cb9IGS91NO4wOAbt4kx5tYu9KeuDPkVa5cybS8CLXSe5/pubhtml?gid=905813765&single=true

[3] https://github.com/alpeware/chrome-headless-trunk
I know!

I’m inviting you to navigate to its website, to see what happens there :-)
Scout24 | Senior Scala | Munich | Full-time
https://boards.greenhouse.io/scout24/jobs/931970?gh_src=02cn...
The issue with D is not mandatory garbage collection, rather its quality and anti-GC religion.

Joe Duffy mentioned on his Rustconf talk that Windows devs even with Midori running in front of them, it was still a very hard sell for them to psychology accept it as doable.

The problem with Ada was basically expensive SDK, Pascal-like syntax and not being part of OS SDKs.

Only systems programming languages that are bundled with OS SDKs survive on the market, others either get a niche (Ada - high integrity systems) or fade into oblivion/maintenance (Modula-2, Delphi, ...).

The main reason being, companies already payed for OS SDK or gotten it for free with the OS.

Any other language must add a very worthwhile set of benefits for them to look beyond the SDK and possible toolchain integration issues.
Very good results and embarrassingly easy to implement!

The very stretched waveform did contain some audible artifacts, but I think other methods like FFT would introduce some as well.

This kind of trick works because our hearing is frequency-based. So the crucial thing is to preserve the frequencies and it is going to sound exactly the same.

Spatial mapping of frequencies in the human ear here:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2394499/
(see fig 5.)

Trying this with an image for example wouldn't work, because our vision is sample-based. Imagine splitting an image in tiny fragments and repeating/interpolating them on top of one another.
You see it happening already, people are finding e.g. old tape drives from MOS Technology (http://ascii.textfiles.com/archives/5256) which could contain valuable information about the design of some older processors and such, but they're unreadable and/or rotted. Same for older films, which are finally getting painstakingly restored and digitized.

TL;DR if you're making something, and it turns into something great, make sure your older stuff, the stuff you did to work towards it, is archived somehow.
Two major reasons that made me quit FB:

1) No control of what posts you see. Ideally it should be everything sorted by date, with some optional filters. Instead FB decides on its own what I should see.

2) It's designed to create echo chambers, to divide people, and propagate identity politics. I had otherwise reasonable people to get offended because I said we should listen to the other side and address their arguments, not call people "nazis". Guess what, I got immediately labeled as a nazi.

Less important reason is tracking, though that can be defeated by browser extensions.

In the end, HN and Reddit are far superior to FB.
> What choices people make with their one shot on earth is up to them.

Yet you also want me to subsidize the fixing of any consequences related to poor choices, no? In other words "Do whatever the heck you want. If you do something incredibly stupid, everyone will help you recover whether they want to or not."

> It's their choice, their body, their whatever.

But it's my tax money that will bail them out of the hole they get themselves in. This is exactly what I'm talking about. The liberal mindset does not reward personal responsibly - it punishes it. The responsible people have to foot the bill of the irresponsible.
ADA is really good, but too much word vomit and the compilers (used to?) cost a lot of money.
I don't think you understand what a fiduciary responsibility is.
> Short term question is whether Walmart will survive

Why do you think they wouldn't survive? $15B in free cash flow versus $46B in debt makes bankruptcy a virtual impossibility.
That game was awesome! The procedural terrain rendering. Got re-released as Rescue on Fractalus!

Another game that blew me away as Bill Budge's Pinball Construction Set.
Related: Any good websites to practice C++ with challenges? I've heard some things about CodeWars, but are there any other?
I'd say the linked item actually has the better article as it discusses some of the issues with this.
When did you know you were straight?
Tiangong 1 Reentry Updates – Where it's going to crash
I agree that comprehensive catalogues matter more for music, but I think we're missing another area where Netflix and Spotify are similar (and where Spotify may arguably be better than Netflix): acting as a recommendation engine.

Netflix has been able to track exactly what types of movies consumers are into so that it can deliver more in the same vein. Originally, it would send consumers to other movies it licensed. Now, as a producer, it can direct consumers towards its own flow of productions.

Spotify's recommendation engine has long been a draw for many users. I believe Spotify is setting itself up to be able to increasingly direct users into its own Spotify-flow of artists and musicians. The recent change to playlist mechanics (so that playlists autoplay "recommended similar songs" once completed) will make this even easier.

Having a huge catalog is important, but controlling the flow of what's popular may trump the back catalog in the long run.

edit: Spotify is not as far along in the process as Netflix, obviously, and the entrenched nature of the music business doesn't help, especially with the market practice of locking artists into 7-year exclusive contracts. I believe it will go in the same direction - it's just going to take a little longer.
Are ‘you’ just inside your skin or is your smartphone part of you?
In Sweden the standard is something called BankID, which is basically a digitally bank issued id that ties into 2FA and works kind of like the Blizzard authenticator or the Googla Auth app, but I'm not sure about the solutions for people without smartphones. It's becoming kind of big here and is regarded as the most secure solution. The startup I'm at now use it for logging into both the admin dashboard and the customer pages.

The user fills in his SSN to our form, we push a request to bankid, they send a request to the users phone, user types a min 6 digit code which is posted to bankid, bankid tells us to go ahead with the login. For iPhone X there's even support for skipping the code and using FaceId.
This works if you retire at 20 and live to 100.

Withdraw 4% every year and you can live on your investments forever.
Or salt.
Archon, oh Archon. Friendships were almost lost from Archon.
Begin – fast and lightweight tasking in Slack
I basically got the first device. Very cheap and easy to use (unless you got your monitor out of arms reach, in this case I have to move the blinkenlicht to a monitor I can reach)
> actual sales is likely negligible

At the moment it might be negligible but in the long run they are hurting them self. 5 years ago I and a lot of my friends ordered everything on Amazon because it was fast and we knew that we will get the correct stuff.

Nowadays I (and most of my friends) almost stopped using Amazon because it is such a hassle to find stuff which is actually sold and shipped by Amazon and not some sketchy third party seller with only 5 reviews. And even if you manage to order something directly through Amazon you might still have problems with counterfeit items and other stuff.

And the same is true for my parents and their friends. Until 1-2 years ago Amazon was _the_ place to shop online but nowadays they switched back to more traditional methods.

Due to all this shady stuff Amazon lost me as a customer (who used to spend hundreds and thousands of euros per year).
Is there a comparison for anything other than multiplication? Or is multiplication fairly representative of other operations on AP numbers?
Coinbase debuts cryptocurrency index fund
Pessimistic. The web hasn't even been around for that long, and the first URLs are still alive - here's the first one: http://info.cern.ch/hypertext/WWW/TheProject.html
As a programmer using the compiler, how does the IAR compiler quality feel in practice compared to GCC or clang?
An extremely high fiber diet has been shown to negatively impact testosterone production. Cholesterol is also important for nerve myelination, and high cholsterol intake has been show to magnify strength gains from resistance training.
> a lot of calculus relys on trig

This seems like an exaggeration, at least from the point of view of calculus in the classroom, where the prevalence of trigonometric functions reflects only their convenience as examples. Did I misunderstand? Perhaps more apposite is differential equations, where trigonometric functions (or exponentials more generally) are ubiquitous.
>Oh and also: learning one will certainly help you learn the other in many cases. I advocate learning many languages :)

Especially the Rust borrow checker will make you mad in the first place, and then teach you something about memory management you will be able to use in C++. It really improves your mental model in places you didn't expect.
Validation of CSV file against user defined schema
The article was fine aside from not being news. But The Atlantic's quality has plummeted over the last couple months. A lot of lazy, narrative-driven pab. Someone upstairs must have decided quantity was the thing and screw quality.
8000X query speedup using GPU database
> A corner of northeast Poland is fed by Belarus.

You mean Kaliningrad? Because that is not Poland but a Russian exclave
The original article linked to this page[0], which provided a good analogy:

"On a level road it is easy to maintain speed. On reaching a gradient, however, the rider needs to make more effort to achieve the same speed. Going downhill, the rider needs to apply the brakes to keep the same speed.

In the entire European network the electrical generators are set up in such a way that they automatically and immediately respond to a change in grid frequency. Depending on the level of consumption they increase or lower their capacity. This ensures that the frequency remains stable. This automatic adjustment can be compared with the cruise control in a car."

0. https://www.swissgrid.ch/swissgrid/en/home/experts/topics/fr...
School attack in the Netherlands – no one gets hurt because it isn’t the US
Not to be that guy, but if you have that much if a reaction to butter, you are probably allergic to milk proteins rather than lactose intolerant. Butter (and most cheese) is very low in lactose. Of course, everyone is different (I'm lactose intolerant myself, so I avoid milk and cottage / ricotta cheese, but can eat butter and curd cheeses)
3bps is certainly dirt cheap - but thats purely explicit cost. You have to look at how the fund is managed. If the fund manager is an idiot and forgets to rebalance or makes some other error - that 3bps can pale in comparison to missing the benchmark.
Don’t forget SFINAE. It’s what most of the modern type traits rely on and something you’d have to understand, at least conceptually, to fully understand how to effectively use things like std::enable_if.
I synchronize with ntp every 500 million cpu cycles :p
The FAQ gives a good overview of what's going on here:

http://blogs.esa.int/rocketscience/2018/01/16/tiangong-1-fre...

TL;DR is a Chinese space lab (Their 1st) is going to crash into Earth sometime end of March, Mid April... probably Northern Europe.
iOlite Brings Blockchain to the Masses
I'd still argue that there's a lot of value in some form of teaching (via book or video or whatever). If left to their own devices, novices will often come up with messy, non-idiomatic ways to do things.
Ask HN: Implement a webservice GUI with Qt?
I have a webservice for which I want to build a GUI. I was initially considering doing it in electron but am now wondering if I could simply use Qt to build my GUI?

Qt would be making REST api calls to the backend service(which could be running locally or remote) to populate the UI.
How did I not know this was a thing. Thank you.
Or, you know, you could have law enforcement maybe not turn the rest of society in to paid snitches. Not everyone wishes to live in a reimplementation of East Germany.

I realize that for many people 'pedophile' is the root password to the Constitution (not my line), but the existence of horrible people should not be an excuse to elevate authoritarians.
Online backup. MS OneDrive if you need to access your files and view them via web interface. Amazon Glacier for long-term storage.