skysight-inc/HackerNews huggingface dataset:
The C++ STL vector, as is, has some limitations:

- As far as I know, it requires two calls to the allocator (one for the instance, and another for the resizable buffer).

- Even if allocated in the stack, unless you use a different allocator, the buffer is allocated in the heap.

If you do lots of operations per second, it makes the memory allocation functions, e.g. malloc(), suffer (depending on allocator algorithmic complexity, it could be a bottleneck).

P.S. an implementation of vector type for C, using dynamic size arrays, with only one allocation per container, using also geometric growing, and supporting both stack and heap allocation: https://github.com/faragon/libsrt/blob/master/src/svector.h
I watched that video, too, right after the first cab drove off when he found out where I was going to.

I could report him, but I'm a busy adult with kids of my own to mind, and I don't have time to try to parent someone else's problem.
Why doesn't the reserve() function also perform a shrink_to_fit() implicitly? Or does it?
Thanks for the info. I may have to look into some open-source projects and maybe make a few of my own and release it out to public.
I completely agree. Here's my 2 cents.

A few buddies of mine back in 2009 were joking around that Dropbox would undoubtedly launch an email service. Then they bought MailBox. Personally, I think it's only a matter of time that a entry-level bundle will become available under the guise of a free email service.

Users get free email address, and access to MailBox + 2 GB storage. The email is just bait. I think at the point the `*@dropbox.com` emails become available, they would be wise to implement at the very least a basic SLA.
Excellent work, thanks for sharing!
Do all your HN on the train. Read so much that you get sick of this place for 8 hours and aren't distracted. :)

But seriously, if you find some popular threads and read them on the way in, then you can still jump in the comment threads while "your code is compiling". And you won't have wasted your working time reading a long article from HN.
How Not to Design a World Without Borders (2014)
The plan was always to add RDS integration, specifically Aurora support.

That plan hasn't changed! Just need to find more time for open-source projects :P
Five good reads (okay, one that I've read and four that I now definitely will), and the beautiful prose I have come to love over twenty years of reading this particular author.
Project Tango Development Kit by Google
I agree entirely.

As soon as your code touches the database (or a mock of it), it looses most of its re-usability. It suddenly becomes much harder to use it elsewhere. In most cases, the code is then tied to that particular framework (like Django, or Flask), and you cannot move it out into a separate independent module. This becomes a problem in large projects, and for example micro-service architectures.

It also mixes up the levels of abstraction. Getting and instantiating objects is mixed right (hard coupled) in with the code that uses them.
Ask HN: Best book/resource for SEO?
I'm a novice when it comes to SEO, so I'd like to ask the community for the best resource out there in order to rank higher on Google. Thanks!
Hyperbole: exaggerated statements or claims not meant to be taken literally.
My Own Social Media
Show HN: News site using NLP to analyze social data and write its own headlines
What do you do to deal with programs (like vim) that don't respect XDG?
That doesn't seem to be the case with Ag-Gag laws.

"Ag-Gag laws are notoriously unsupported by the public. Nationwide thirty-two similar Ag-Gag measures have failed. Currently, seven states have Ag-Gag laws on the books. This Idaho decision is just the first step in defeating similar Ag-Gag laws across the country."
http://www.centerforfoodsafety.org/press-releases/4001/idaho...
That's not at all what I meant. Gmail redirects emails to "youremail+whateveryouwanthere@gmail.com" to "youremail@gmail.com". Some people filter emails this way, henceforth my suggestion to check for this edge case.

http://gmailblog.blogspot.de/2008/03/2-hidden-ways-to-get-mo...

PS: The downvoters are downright silly on this website lately.
>It is, however, abundantly clear to me that Chinese parents, culture and values are the real reasons that Shanghai Province tops the oft-cited Pisa tables rather than superior teaching practice.

Yes, there's a reason that the High Expectations Asian Father is a meme[1]. Even at home outside of school, the strict attitude of always being mindful of schooling was also made famous by the Tiger Mom author.[2]

When kids have 2 parents apply pressure like that, an inept high school football coach with a degree in General Studies could teach physics to Asian students and it wouldn't matter.

[1]http://highexpectationsasianfather.tumblr.com/

[2]http://www.amazon.com/Battle-Hymn-Tiger-Mother-Chua/dp/01431...
How many poor people can you stick next to the rich people before the rich people leave for a place where they aren't part of your social experiment?
No because the reason China scores so high is

1 They cherry pick students.
2 The teachers in these specialised schools only teach one subject for only 3 hours day.
Also, you can invoke Lambda functions from within a Lambda function. Even Lambda functions on other AWS accounts.

It's going to get crazy up in here...
1. it's not nearly as hidden

2. am I not allowed to dislike both things?
3 separate voices, actually. One by the headmaster, one by a student, and one by a teacher. Each had very very different viewpoints.
That would be a good start. From what I understand they're not doing that though.
I understand what you're saying about the good fortune of people who live in public housing in desirable areas. And I see what you mean about the benefits of spreading some of that good fortune around by selling parking. Both of these may be good reasons to support Bloomberg's plan.

But I don't see what any of this has to do with your assertions about the rationality/wisdom of residents who oppose the plan:

> The plan was bitterly opposed by residents who apparently value massively subsidized parking over non-falling-down buildings and/or believe that the money is going to magically appear in some other way.

> DeBlasio has put out a modified version of the same plan . . . [which] will mean less money for NYCHA, which means fewer repairs, but I guess he doesn't care.
I don't fully understand how this would work - the key being "forwarded agent". My (poor) understanding is that in order for compromised github to get to a host I'm connected to they would somehow need to invoke ssh on my host, somehow. The only way that would not be the case is if ssh maintains an in-memory persistent thing that a) maintains connections to foreign hosts, and b) can somehow be signaled from active connections. If that's true, then a) I didn't realize it could do that, and b) it would be quite handy sometimes, although the security implications are rather serious.
Don't hate the programmer, hate the tools. ;)
Instagram Has Banned the ‘EDM’ Hashtag
seems they aren't limited to just future output:

"Using that private key, they can observe CSPRNG output on the wire, “decrypt it”, and use that to rewind and fast-forward other people’s CSPRNGs, discovering their keys."
> cities at this point require a large base of low-wage service labor to function

It's not really "low-wage" if their rents are being subsidized, randomly.
Have him email me. We sometimes (depends on the team, hiring manager, etc) get things stuck in the process, even with good candidates. (Someone leaves a note saying "great interview, next he should talk to someone in one-of- the- teams, then it doesn't actually get assigned to someone, and just sits there.)

If we actually set it to "decline" we send out decline email, or something more personal.

I thankfully am not actually involved in hiring in any way. I don't really even interview many people.
I use this daily (ok, hourly)
very interesting - thanks for pointing that out.
Ergo my statement that Docker and Nix/Guix will converge at some point. There is already an overlap: I believe Docker has mindshare, but it is unusable on desktops.. whereas Nix/Guix was designed for desktops, but is losing out because most people use Macs!!

It would really be something to build a ESXi for Docker/Nix/Guix and be able to provision fully functional VMs on top of it.
Sorry for the weird layout in this thread, everybody. It's a bug at our end. I'm traveling at the moment but will try to fix it later today.
Further showing the advantage of the pythonic way, is that the above construction remains about as clear when you refactor it for better pruning:

(
(to_number(s, e, n, d),
to_number(m, o, r, e),
to_number(m, o, n, e, y))

for d, digits in choose1(digits)
for e, digits in choose1(digits)
for y, digits in choose1(digits)
if (d + e) % 10 == y

for n, digits in choose1(digits)
for r, digits in choose1(digits)
if (n + r + (d + e) // 10) % 10 == e

for o, digits in choose1(digits)
if (e + o + (n + r + (d + e) // 10) // 10) % 10 == n

for s, digits in choose1(digits, 0)
for m, digits in choose1(digits, 0)
if (s + m + (e + o + (n + r + (d + e) // 10) // 10) // 10) % 10 == o
if (s + m + (e + o + (n + r + (d + e) // 10) // 10) // 10) // 10 == m)

Ends up being several order of magnitudes faster since it partially sums each place and prunes aggressively. You can eliminate the sub-expressions, but it has noise impact on the run time (likely due to trading off temporary tuples for cheap arithmetic):

(
(to_number(s, e, n, d),
to_number(m, o, r, e),
to_number(m, o, n, e, y))

for d, digits in choose1(digits)
for e, digits in choose1(digits)
for y, digits in choose1(digits)
if (d + e) % 10 == y

for n, digits in choose1(digits)
for r, digits in choose1(digits)
if (n + r + (d + e) // 10) % 10 == e

for o, digits in choose1(digits)
if (e + o + (n + r + (d + e) // 10) // 10) % 10 == n

for s, digits in choose1(digits, 0)
for m, digits in choose1(digits, 0)
if (s + m + (e + o + (n + r + (d + e) // 10) // 10) // 10) % 10 == o
if (s + m + (e + o + (n + r + (d + e) // 10) // 10) // 10) // 10 == m)
Starting Now at Netflix: Unlimited Maternity and Paternity Leave
You do realize I all I was implying was that visual studio is very large and that people use it?
Since there's (at the time of this writing) 827 jobs here, I wrote a script you can copy and paste into the web console to search the posts (available here: https://gist.github.com/kristopolous/19260ae54967c2219da8)

There is both OR and AND support here. If you specify your function parameter as an ARRAY then it operates as an AND, otherwise each argument is an OR.

For instance, to see posts that are remote and python OR remote and ruby, you can do

query(['remote','python'],['remote','ruby']);

The return of the function shows how many jobs were shown versus in total. For instance, as of this writing, I get the following result when running the above function:

{ shown: 56, total: 827 }
Not that it matters too much, equity is equity, but how much sweat equity are we talking here? How much of your time did you invest for that 3%? I would consider that when thinking about how much the equity is worth to me. Again, this is only a small factor, but a factor none the less. If you put 10 hours in $2160 might be more appealing than if you had 100+ hours of your time invested.
I'm mixed on this. For background, I'm from Idaho and the son of a dairyman in this state. I know the intimate details of how this law came about, I know the dairyman whose operation was filmed, and I've seen the film. From the viewpoint of the guys in ag, their concern is more about the lies that got spilled out over the initial film, and the death threats that came afterwards.

Couple of side facts:
* some of the employees were rightfully jailed for animal cruelty.
* the dairyman in question has been receiving death threats ever since, even tho he is not personally responsible for the actions films, and he fired the offending employees soon after. (note, this is not a small dairyman, he has +300 employees, you can't personally monitor everyone all of the time).
* the film has been redubbed constantly to attack other operations -- even tho they weren't filmed.
* Most of the dairymen in this state are sole operators, or family owned. If you say "corporate owned farm", you aren't talking about my region, or we have a difference of opinion as to what constitutes a corporation.

The Good:
* it was a bad law, it needed to be revoked, even the dairymen in this state were uneasy about it. What got it passed quickly were all the death threats against the owner. Lawmakers were very concerned about that spreading.

The Bad:
* The dairymen in the state aren't worried about filming, they are worried about lies coming from it. Some groups are actively hell-bent against them. I've seen them, I've talked with them. The worst have no problem saying anything, because there won't be repercussions.
* As most of the dairies are really sole operators, they are very concerned about their reputation and having that get away from them. Often the dairymen see it as "someone else's lies against them in a world where no one is going to believe them".

I understand someone will see what I wrote and say I'm full of shit, oh well I guess. But understand, these people are my friends and family. I see and hear their struggles, and I watch them take care of their animals. Most actually do care for them, but at the same time, have to struggle with running a business that depends on those animals. You don't work with animals because you hate animals.
It is strange to think of blue eyes to be the most common eye color for Union Soldiers. Now that seems less common for Americans. Perhaps that is due to where the Union Soldiers were coming from demographicaly.
> Though, in some circumstances people have been jailed for violating court order to not disclose information, but they are jailed for contempt of court, NOT the disclosure it self.

So, if I understand this properly, you're saying that the government can't make you sign away your first amendment rights, but they can order you not to speak ('disclose information') and then jail you?
> If the server doesn't know that key, then SSH tries the next one. You can enumerate all of someone's keys this way (like this SSH server does)

If you have five keys, and the second is the one that's needed, doesn't that mean that only the first two keys are sent?

Anyway, this is very good to know, and I'm going to take action to make this more secure.
The Martian author says Comcast let hacker take over his e-mail
Thanks for the heads up!

I'm not affiliated with Amazon, nor do I know anyone over there. I'm a freelancer in Oakland, CA., and my goal is merely to offer some open source code to help people take advantage of emerging tech so that they can build ridiculously cheap and scalable web apps.
root because that's the user I use to log into OpenWrt. But it's the same if I change it.
Yet the medical community and food industries still have iterative processes. It's a miracle you still live.
Sounds like they either imported or imitated a lot of other Japanese stuff based on the content of that first news clipping.

Sure, they're not going to find it locally available, but I don't see why it would be impossible for someone wealthy to get what they wanted.
Very sad, considering that reasonable people with less talent for making themselves unhappy can simply start using another name and email, accept that their old commits are associated with their old name, and recognize that as far as DVCS features go integrity trumps flexibility and changing names is such a bad idea that being reminded of bad times is a necessary sacrifice.
> they already have very well established legal counsel

If that's the case, why are they asking you for help? Either their existing counsel is bad or they don't want to pay.

Maybe if they are looking for advice around some of the things that aren't strictly legal (e.g. negotiation), that makes sense. I agree with another comment that after about 2-3 times, it's probably worth sitting down and offering your services as a true advisor and the rewards/responsibilities that come with that.
The close proximity of recruits reminds me of the Pals battalions in ww1
and what is wrong with that?
I agree to what you just said. But sometimes nothing could be learned when you already know that and I couldn't agree more to the second para. I am going to think wise and make a decision on that very soon. :)
One allocation per resizable container means that the identity of the container may have to change when it grows.

We see that in the API: functions return a new vector, which the caller must capture (and at the same time forget about the vector pointer that was passed in and all copies thereof, to avoid a use-after-free error).

That captured vector must be stored somewhere, such as in a stack variable or a member variable of an object.

That storage location itself must be allocated.

Hence, effectively, two allocations.

The memory management is manual: if you leave a scope without freeing all the "sv" vectors (by any means, including longjmp: your poor man's exception handling in C) you have a leak.

{
std::vector<int> stdvi; // stack for "stdvi" + heap for buffer
}
// heap object deallocated

{
sv_t *sv = // stack for "sv"
sv_alloc(sizeof int, 42); // heap for buffer
}
// heap object leaked

If a C++ programmer were to use this "sv", he or she would likely wrap it in an inline template class which manages the ownership of the buffer to prevent leaks and perhaps facilitate sharing. And that would just re-create std::vector basically. This template class would add next to zero overhead.
Making Git user names immutable only seems to show short-sightedness in the design of Git. Whether this design decision was driven by patriarchal biases is debatable - it was most likely just a quick and dirty solution in a program that Torvalds never imagined would become as popular as it has. (With a little extra work, Git could have mapped internal immutable numerical user IDs to external names, as in Unix's /etc/passwd file.)

And I don't think you can logically extrapolate from one program designed by one person to the beliefs of millions of people in the software industry. There's plenty of software out there (including Linux) that allows people to change their names easily, all of which was written by the same software industry.
Wouldn't the guy in the leather jacket want to continue having cheap leather? Cheap leather comes from factory farming. The same farms that support Ag-Gag laws.
Interesting. When I tried it at work earlier (Windows 7, latest PuTTY) it closed out the window without showing anything. I just tried it at home (Windows 10, latest PuTTY) and it worked as you said.
You can just use this and not have to overwrite your name/email:

git commit -m "message" --author=<author>

You can even pass a different commit date with --date=<date>.

It's actually a really useful feature when you're migrating a project from a different SCM system to git.
this was the best resource for Philosophy 101!
I wonder if "EDM" was used for meanings other than "Electronic Dance Music".

Urban Dictionary lists these other meanings for "EDM":

* Electronic Dance Music
* EveryDay Minerals
* Event Driven Marketing
* EDMonton, [A]lberta
* Euro Domestic Market
* Etablissement de Detention de Montreal (Bordeaux jail)
> It's new but is it really bad?

My opinion - yes. I never imagined typing out type names was a hassle when using an IDE like Visual Studio. I know a number of people use it religiously - but when I read code I find it easier to read C++ with types than the auto keyword everywhere. But I'm sure a number of people still use vi (or emacs), and even smaller number of those people use gdb or some other debugger.

Apparently Linus doesn't use a debugger [1]. I have some comments on that - but I'll keep them to myself.

[1] http://www.linuxtoday.com/infrastructure/2000090700221OSCYKN
'Son of Concorde' Could Fly London to New York in an Hour
I had a relatively sane comment (IMO) about whether github should instead consider allowing users to opt-in to "show unsigned commits which claim to be from this address as unknown."

Oddly enough my comment itself was altered to be a mindless obnoxious comment! (does github use git commits to track the comments themselves?)
Yeah, this is one of those "feature not a bug" things that's been known for some time. As others have pointed out, sign your commits if this bothers you. It's even possible to get your fellow open source contributors to sign commits to your project, as we do with the Metasploit Framework: https://github.com/rapid7/metasploit-framework/wiki/Landing-...
It's a funny trend in recent years that people are so offended by the opinions and ideas of others that they cannot bare to expose themselves to anything that person has to say.

Discourse and logical thinking are the basis of modern society and all of it's afforded comforts. If the inventors of the past had coddled themselves in a hugbox for their entire lives we would still be saying things along the lines of "A train can never go more than 10 miles an hour", "there wont be a market for more than 10 computers in the world", and "you wont ever need more than 64k of ram" because there would have been no one who would have heard--or even said for that matter--"No!"

If someone disagrees with you, just explain your points rationally and calmly. If it something you are passionate about, like the OP has pointed out in https://xkcd.com/386/, then isn't it worth the 15 minutes it will take to explain your viewpoint as I am doing here?
"The remedy for misleading speech, or speech we do not like, is more speech, not enforced silence," Winmill declared.

Very well said.
I usually open up my Audible app and listen to books that are totally outside my field of work. Great way to make your brain think outside your domain.
My first reaction when I've read your comment was that it has to be because of sub-strings but as std::vector allocates memory again anyway that can't be too important. Can you elaborate a bit? I am not a C++ programmer but I am sometimes curious so maybe I am missing something obvious.
Great experiment here. Lambda has been intriguing me for a while. More and more, as I scope out work for clients, I'm finding bits that could probably be run as Lambda processes instead of requiring an entire EC2 instance. This is kind of like taking a REST interface to a natural extreme.
Io.js v3.0.0
Luckily, putty/kitty does not send anything to unknown hosts. Good try though. Please accept a record of my IP address connecting to your honeypot as a token of gratitude.