skysight-inc/HackerNews huggingface dataset:
Just to be clear, the issue is not in Python: the deadlock will happen if you won't consume the pipe whatever language you use to spawn a subprocess -- the buffer is not in your application -- it is the OS pipe buffer.

I imagine your broken code did something like:

#XXX WRONG, DON'T DO IT
p = Popen(cmd, stdout=PIPE)
p.wait() #XXX deadlock is possible if cmd generates enough output
output = p.stdout.read()

To avoid the deadlock, it is enough to swap the last two statements:

p = Popen(cmd, stdout=PIPE)
output = p.stdout.read()
p.wait()

that you would normally write as:

output = check_output(cmd) # 2.7+

If you need to consume more than one pipe separately then you should consume them concurrently and therefore you need threads or async.io.

`Popen.communicate()` can read from both pipes concurrently (as you've mentioned) and it is always available. It was available even in Python 2.4 that introduced the subprocess module.
This true of any group of people you find yourself around for very long periods of times. Humans are social animals and have built-in mimetics. That's why its important to be around people with aspirations and goals; who believe in possibilities. I didn't believe this until much later in life, but I agree now that it's important to select for high-performance colleges for this reason alone.
> I invite you to google "Contributor Licence Agreement".

I know what they are, and that doesn't change anything. Apple can't force people to sign a Contributor Agreement. Look at, for example, what happened with MariaDB and MySQL. Oracle can't force the MariaDB devs to sign the agreement, nor would Apple be able to in similar situations.
That was surprisingly on topic and good.
Should have carried #overlyhonestmethods label
How come 10% is high enough for corporations but I pay a lot more than that in income taxes. Shouldn't it be the other way around?
C9.io / nitrous.io are online IDEs with collaborative functionality.

Codr is much more lightweight - a collaborative paste-bin if you will. In this regard Codr is similar to Code Pen or Gist.

Codr is great for quick, informal collaboration - when you're on the phone or on IRC with someone you can say "let me show you" instead of "let me tell you".

Unlike C9.io or nitrous.io, you don't need to create a project, share an invite link, mess with permissions, etc.
As someone exposed to the Sydney real estate market it is definitely insane right now. When this bubble bursts it is going to very nasty for everyone.
> (or perhaps formally at Apple)

You were probably looking for formerly.
I am a UK taxpayer too but my building has no recycling. I live at home for one or two days a week and no personal transport.

Why should I suffer all the costs of recycling?
For one thing, they've got a better team this year, and it's possible they'll be forced to skip the playoffs this year. Then they don't get to sell those tickets, they don't get that chance at a World Series, etc.
Check out the KickStarter video at codr.io for more on this.
My ideal monitoring system must have:

Monitoring:

- resource usage (hdd, cpu, ram, network, LA)

- server status (online/offline, uptime, response time?)

- package manager status (new packages)

- services status (running/not running, etc)

Notifications:

- allow to add triggers (with some default triggers: high cpu/ram/network/LA usage (90-100% 5 minutes), high hdd usage, etc.) with notifications through email/hipchat/slack

Server control:

- restart server?

- package manager: update packages

- services: start, stop, restart

It must be web based with zero install effort. I'm doesn't use containers enough, but maybe it will be useful feature.
This audio clip doesn’t prove anything about her personal competence, and the congressman grilling her is grandstanding.

What’s she supposed to say? If the OPM shut down their systems until everything was rewritten from scratch up to some security auditors’ standards, the same congressman would be flipping tables because all the agencies relying on OPM’s systems’ operation would also grind to a halt, costing the precious taxpayers X gajilion dollars per day.

Anyone else put in as director of the OPM would have done the same thing she did, and high-level decisions are being made as an institution based on internal discussion, not imposed from top down. There’s really nothing satisfactory that someone in her position is going to be able to say after an incident like this other than “we’re doing a thorough investigation of the break in and we’re doing everything we can to fix this as soon as possible.”

Does the OPM undervalue security? Clearly. That’s an institutional problem though, not the director’s personal problem. More generally, most institutions don’t sufficiently value security, including government agencies everywhere in the world at every level, corporations, etc. Doing security right is expensive, and fixing up systems from the 70s and 80s without service interruption is really really expensive.

As another commenter mentioned, it would be pretty great if we could divert some substantial portion of the ridiculous budget the NSA has been getting to build a massive database of everyones nude photos and web search history toward securing domestic computer systems instead.
That depends on how rich you are.
But the quality of that refined content is not very good. There's still huge amounts of work that need to be done. But trying to do that is sometimes like walking through molasses.

So yes, it does matter.
I lived in SF. Stayed at several buildings. Never once saw the compost bin (green) used correctly even though SF people seem to pride themselves on their "greenness".

Similarly I worked at a company with 10000+ employees in SV. Even though they had green (compost), blue (recycle), black (trash) everywhere I never saw them have the correct stuff in them even though said company prides itself on hiring smart people.

That leads me to believe recycling by requiring each and every person to separate their own trash is not really a solution at all.

My understanding is some cities separate it at the dump. If true that seems like a much larger win. It will likely be correct far more often and only a few entities to check up on that they're doing it right.
There are several things you've said here that would worry me if said by an undergrad. You must have a new prime because the number you construct has a prime decomposition, and that prime decomposition cannot use any of the prunes you started with. And your collection so far need not contain all primes so far, so the new prime need not be bigger than the ones you already have, so you can not, as you claim, observe that the number you've constructed must have a prime factor greater than p_n.

It may be that you were just being informal, but statements like this coming from an undergrad would make me start to investigate how secure their knowledge really is.
What I mean is that if your code (or a library you call) mixes logic with IO, meta-programming lets you capture the IO calls in a mock (like turning it into an IO monad), which you can then query and verify, without changing the code and the API's it's using.

E.g. on the JVM you do that with Mockito (similar mocking libraries exist for other languages/runtimes). Say you have a (silly) method that does computation and IO:

void printDouble(int x, PrintStream out) {
out.println("Result: " + (x * 2));
}

You can then do:

@Test
public void testPrintDouble() {
PrintStream out = mock(PrintStream.class);

printDouble(3, out);

verify(out).println("Result: 6");
}

No output is actually done. The call to println (which may be deep in some library printDouble calls rather than directly in the tested code). We've essentially replaced any object that does direct IO with something akin to an IO monad.

We can query the mock in more sophisticated ways, too. Here's a very contrived example:

void printDoubleWithLog(int x, PrintStream out, PrintStream log) {
log.println("Computing...");
out.println("Result: " + (x * 2));
log.println("Done.");
}

@Test
public void testPrintDoubleWithLog() {
PrintStream out = mock(PrintStream.class);
PrintStream log = mock(PrintStream.class);

printDouble(3, out, log);

InOrder ordered = inOrder(out, log);
ordered.verify(log).println("Computing...");
ordered.verify(out).println("Result: 6");
ordered.verify(log).println("Done.");
}

This contrived example also verifies the relative ordering of IO done on two separate streams. Again, no API change is necessary, and the actual IO calls may be deep in some library.
They seem to be hostile to reality.
> So creating software is hard and should be compensated, while creating music is easy and it should be given away for free.

Except first features downloading and owning it and the other streaming rights through certain period of time.
What makes sense for the major labels doesn't necessarily make sense for the artist. Major labels have billions in net worth and have invested heavily in the stock/equity of companies such as Apple, Spotify etc etc. They could care less about the royalty pennies that drip out the bottom to feed the artists. They're getting rich on equity.

The independents on the other hand don't have this luxury.
Yes, unknown artists can't, but the point is that they are going 3 months without income. There have been many local one-hit-wonders in my country, make a decent album with one or two 'hit' singles, and never get enough money to stay afloat. Hence the one-hit-wonder bit.

If it took me 6 months of no income to produce an album, then as I release it I go 3 months with no income (assuming that Apple is the only streaming service, and that people choose to stream instead of buy). By the time the 3 months are over, people have moved on to something else. This hurts me as I don't recover my expenses.

Taylor mentioned that she can support herself, team, etc. The unknown mostly can't, so the trial hurts them.
> voluntold

That's excellent.
> The problem with recycling is still a focus on the end of the cycle, when much better results could be had with smarter policies at the beginning -- i.e. Manufacturing. If thin plastic containers are a problem, ban them and let Coke/Pepsi/Starbucks figure out how to deal with it

The confusing/complicated/ironic thing here is that thin(ner) plastic containers were seen as a _positive_ for resource use. If the point of recycling, after all, is to reduce what goes into landfills, or to reduce our petroleum or other resource use, then using less plastic in the bottles in the first place is a positive -- and one that indeed takes place from a focus on smarter practices at the beginning -- right?

But apparently it also destabilizes the recycling market.

Either way, I agree that the only solution is to somehow make the original manufacturers bear the environmental costs of what they produce -- which neccesarily means those costs will be reflected in the prices of consumer products too.
> You have to fly around quite a bit... and you'd almost certainly need human controllers, increasing the expense.

So where's the problem? Have two officers on duty, you don't have gunshots that often to justify one officer per drone 24/7.

> I mean... we have cameras right now ??? Why would we not just set up a monitoring system... if we wanted a monitoring system ???

You could do this in the UK, but not anywhere else. NCIS LA ain't real.
You can get away with treating your employees like that if they only need to do menial work. But still, I wonder how sustainable was the increase in productivity? Because one explanation for that increase could be the fact that the employees felt they were being punished and were afraid to lose their only source of income, thus having to show work. Otherwise they would have left immediately under those conditions.

Another question is, could your father had had the same increase in productivity, or even more, if he had used other strategies, like productivity bonuses for the team?

Being nice and respectful is not something that you try to do despite the relentless market competition. It's something that you must do precisely because of that competition. The reason being, unless you can have a good working culture, you'll end up with a group of desperate people that have no where else to go. Good luck trying to come up with any creative work or idea with a company full of desperate people.
The sad thing is Australian are actually quite willing to take on massive risks - we just need to be willing to do this in business. We don't have to change our entire culture, just open our eyes.
Well-played!

I myself have researched leopard spots since I painted our toilet floor in them. It's a lead sheet, and the paint had worn off, which probably wasn't the healthiest thing. My housemates had filled the toilet with memorabilia from an African trip, so leopard-print paintjob it was.

Which entailed looking up leopardprint online. Very little of which actually looks like leopard rosettes, and now I have a problem with almost anything trying to pass itself off as leopardprint. Anyway, I can't say that my paintjob is a particularly good reproduction, but at least it's 'spiritually correct'... :)
This is what you get for extremely unskilled labor. These people are about as unskilled as you can get.
Can Fintech Kill Wall Street?
it's not--it's just propaganda...I never trust any stats promulgated or hyped by the gov't, the media, corporations or nonprofit foundations. They all have an agenda, and agenda that portends no good for the average american.
> I didn't want to get candidates purely motivated by the high cash comp in the area.

All I see is an employer who isn't willing to pay, and then I move on from that listing.

Even with how little time and work goes to sending a resume now, you're listing hasn't made it worth the time it does take.
TRICK PHOTOGRAPHY AND SPECIAL EFFECTS EBOOK- AN HONEST REVIEW
It's much more likely that they cannot figure out from all the complex clauses and sub-clauses councils have.

Mine went along the lines of it's recycled if it's paper but not if it's certain types of paper unless it has a recycle logo on it but then not if it's has any food residues. The list went on like that for multiple pages. Handily it was in around 12 languages too, but I was in London (and technically an immigrant, so I suppose the multiple languages were for me).

Then there's the fine for having an empty bin on collection day but also a fine for having the lid ajar from ever so slightly more than the bin holds - you were allowed up to 1/4 of an inch (yup, documented in the explanation leaflet) (and they have private contractors going around at 4am to check that and issue fines before anyone gets up in the morning).

Plus, of course, once it's all collected, the council send it all to landfill and don't bother recycling it at all. [1] And still do it after being caught. [2] Or they just dump it in Africa or China instead of landfill/recycling. [3]

There are endless examples of the bone-headed UK public sector approach to recycling which makes it a waste of time. Sir Humphrey Appleby would be proud.

I don't think you're being fair trying to blame it on some sort of illiterate proles.

[1] http://www.courier.co.uk/Wealden-council-sending-residents-r...

[2] http://www.yourlocalguardian.co.uk/news/10467239.Council_aga...

[3] http://www.express.co.uk/news/world/538317/Britain-sends-ton...
"it only takes seconds to make high-quality molecules"

I have a hard time accepting that this is true for any but the simplest of molecules. Takes caffeine or Diazepam as more realistic examples. These have double bonds, which are drawn offset from the center-to-center line, and use elements besides carbon, which need either labels or CPK color assignments.

Even in the case shown here, benzene should be drawn with double bonds for correct Kekule interpretation, or with one of several ways to denote aromatic bonds. However, there are fields like macromolecular structure visualization where bond type information is often omitted, so this is not critical. But drawing cyclohexane would be difficult because of the non-planar hydrogens.

There are any number of tools for making eye-catching images. These include programs that will render the atoms and bonds using more complex materials, and including shading effects, fog effects, and multiple light sources. I think it would be better to leave this PP example in the "neat though very limited applicability" category.
And not all those costs can be credited against US taxes on repatriation, so double taxation scenarios exist.
I get the free trial.. but not paying the artists? really?

This feels very high and mighty of Apple. Hate to break it to you Apple but you are not changing the music industry like you did with iTunes. Streaming music services have been around for years. This isn't some revolutionary new product that artists just have to be on board with. There are other options.
Yes: https://en.wikipedia.org/wiki/Materials_recovery_facility#Di...
I think it could be either way, but many object to the fact that it is both. In other words, corporate tax is seen as double taxation, since the earnings (after taxes) are then passed on to shareholders, who pay tax on it again.

I could see a coherent tax code that taxes corporations, but not individuals, or one that taxed individuals, but not corporations (Of course with either of these there would no doubt be all sorts of new loopholes to deal with). But taxing both seems odd to me.
Record Jeopardy champion reveals how he used a web tool he built to help him win
> so many ... that we have enough data to see patterns

I believe that there's enough data to _see_ patterns, but is there enough data for these patterns to be statistically significant?
"Per the RIAA, the entire recorded music industry in the US recorded under $7 Billion in revenue in 2014."

Amazing. We think of the RIAA, or "big music" as some kind of juggernaut force in society and politics - especially Internet politics.

But their entire industry top line is smaller than what fedex makes in a month.[1]

[1] http://www.nasdaq.com/symbol/fdx/revenue-eps
Encryption is a waste of complexity and battery life here.

Firefox encrypts your history and open tabs because those are sensitive.

A page number in a book is not.
Non-constructive existence proofs are critical in random graph theory, and that in turn is producing all sorts of useful results about what's possible, what's not possible, and what might be possible but it's likely to be hard.

A specific example, I'm working with some people on producing instances of G3C that may lead to a new form of PKC that is expected to be securely based on a known NPC problem. Non- constructive asymptotic existence proofs are critical to proving these instances are difficult.
This is a very well known and researched phenomena.

You can make any change in a workplace and see productivity go up.

This is related to the Hawthorne Effect. It even jas a wikipedia page.

https://en.wikipedia.org/wiki/Hawthorne_effect
They gove away their OS and a ton of solid near business class apps in some cases. They do this to get people to buy hardware.

She said she supports herself on tours, five more music away, you should get more people at her tours. Same for the new band, you don't get discovered on the radio, 5K and they will play your song, it's that easy. Never works.

Play shows for 5 - 10 years, you may make it, or be coached and molded like Taylor, that Canadian Kid, and the ret of them.
What did you do? Because it seems like you're pretty dramatically underestimating the cost of a stadium tour and confusing costs for a tour with payments for private bookings(separating travel expenses for example which would come from the artist on a tour).
So you were writing protein-like programs to categorize proteins? :P
In my experience, determination and perseverance trumps raw talent. If you really push yourself to the limit and are passionate enough about what you're doing to try to improve yourself, you're going to be a better asset in the long term for a team compared to someone who understand things easily but doesn't really try to improve himself unless he has to.

Even in term of team morale, someone who tries hard and pushes himself to the limit is motivating.

So I wouldn't worry too much about it (plus you might just have imposter syndrome and discount what you really know ;-))
Free social media management app for android users
Oh please :rollseyes:

I have been running a small business here since 2006 or so. Do not get me started, yes getting a business setup is easy but the fun begins when you realize you are in for a lot of "fun" with taxes and Revenue and other bureaucracy and red tape.

The tax system actively penalizes you for starting a business by for example reducing your tax credits, removing welfare support for when things fail, and whats worse is how you get treated by state beuracrats with cushy public service jobs they view all private businesses with disdain and treat you like shit. For example Revenue ALWAYS treat every case as if you are guilty of whatever you are accused and then you have to spend time and money to prove your innocence, instead of you know running a business.

I am not negative after all this time running a business here, I am simply bitter and disillusioned. Anyone wanting to start a business here does not realize how much of their time and money will be wasted for no good reason.
Hacking the PS Vita
Here is why apple sold Taylor for free:

Taylor is Swift;
Swift is free;
So Taylor is free too.
I love ctrl-Z, but I think of it more as "suspend" than "background". After all, a ctrl-Z'd process isn't really doing anything. If you want to run such in the backround, just use bg, which is precisely analogous to fg.
Out of curiosity, and on a similar note, is Spotify not paying artists during their "3 months for $0.99 promotional period"?

I guess that would explain why her 1989 album isn't there either... At least she's consistent.

I'd lean on the side of Apple eating the cost during the period, not the artists.
And since human nature limits the size of group that can work together, the only way I can imagine for larger groups to avoid tree structure would be to have no structure: to have each group actually be independent, and to work together the way components of a market economy do.

That might be worth exploring. I suspect there are already some highly partitionable businesses that lean this way. But
I don't know any technology companies that have done it.

Isn't Valve such a company?

http://www.valvesoftware.com/company/Valve_Handbook_LowRes.p...
Why, for testing. The calls to IO are replaced with calls to mocks which are then used to verify IO behavior. It's like replacing the IO monad with a type that doesn't actually do IO, only it doesn't require the code to change, so it works even for third-party code.

You can then use the security manager during the test to verify that all IO calls are indeed mocked.
Having the satisfaction of doing a good job ? Not everyone is working simply in order to become richer, there are some which also wants to have a meaningful impact on society.

I like when my clients says the tools I've developped are extremely useful to them, and sometimes it means sticking my neck out and not doing the bare minimum.