A Founder Salary Calculator - <AUTHOR> http://christophjanz.blogspot.com/2017/11/unsure-how-much-you-should-pay-yourself.html <comment><USER2> A founder's salary should strike a balance between maximising their ability to work on their startup and minimising the startup's burn rate. Distractions like spending time finding somewhere cheaper to live, trying to decide whether you can afford something, or having arguments about money with a spouse reduce the likelihood of the startup succeeding so the founder needs enough for those problems to just go away. That means paying yourself enough for them not to be an issue any more. Equally though, paying yourself so much that the startup's capital will only last 6 months is stupid if you're a year from getting to market. You have to be sensible.

What you could earn elsewhere, what you earn compared to your co-founders, etc are just unnecessary distractions. The startup and the future value you're building are the only things that matter at this early stage.

<comment><USER3> Exactly this.

I get chills reading that some founders were eating ramen for a year. Imagine how much extra work could have a fed brain complete.

Some may say I am not understanding the startup life, however without founder's health and sanity startups rarely succeed, because just like you said they're distracted with things they should not be worrying about like living frugally.

On the other hand I would never jeopardize my health, family and property for a startup. Maybe that will cost me 10 million in startup funds from a "get rich die trying" mentality loving VC, but at the end of the day, too many startups have failed because they scaled too soon and because someone made a decision when they lacked glucose. I'd much rather have my physical and mental health and future success, than a short term money to spend and an uncertain life ahead. Now, I am not saying that I would not work extra, but there has to be a balance otherwise you'll burn out.

<comment><USER4> I attribute some of my own startup's success to the attitude of my cofounders and I to live a sensible schedule which gave time for loved ones and friends.

This was helped by two of my cofounders having a spouse, and one cofounder having children. Priorities and behavior are different for a single person than someone in a relationship.

Being in a relationship or having kids is not the only route to having that sensibility in life. I was single even when my cofounders were not, yet I had a pretty sensible life, in spite of dating and trying to find a partner for life while also starting to build a company. I think the influence of my other cofounders, who had dreams and aspirations outside of just the company, was a strong tempering force to me or anyone else in the company getting an unhealthy tunnel vision.

<comment><USER5> This certainly exposes a moral hazard for their investors who have an incentive to maximise output for as long as an exit takes. After that, I doubt they care that much aside from having a "successful serial entrepreneur" with a reputation to further exploit.

<comment><USER6> They have an incentive to maximise the expected value of an exit. The parents are suggesting that maximising output reduces probability of an any exit, I believe.

</comment></comment></comment></comment></comment><comment><USER7> I have to say, I usually love Janz's writing, but I think this model is too simplistic and does not provide enough evidence.

As a technical founder with a successful track record, I could be working with any number of businesspeople or all sorts of opportunities, and _I 'm good at math_. Why should I forgo a market rate salary to take a 1 in 100 chance at a lottery ticket, where my likelihood of success is largely determined by the people who also choose my salary? Major conflict of interest. The math does not add up.

I would think my team should be motivated to pay enough to keep each other from leaving for attractive opportunities in this lucrative market. It's one thing to voluntarily give up salary to help the company. It's another to force it by means of a questionably sustainable business model.

Evidence: try to hire yourself a technical co-founder from their job at FaceGoogAmaSoft (or pay equivalent) and find out that money talks.

<comment><USER8> > try to hire yourself a technical co-founder from their job at > FaceGoogAmaSoft (or pay equivalent) and find out that money talks

What an incredibly simplistic view of the world. Even as someone living on the west coast I still find it insane that people think the best engineers only work at FaceGoogAmaSoft or somewhere else paying exorbitant salaries.

There are thousands of engineers that work for far less. They're more interested in making a difference and solving difficult problems than collecting $300k per year as a cog in the machine.

Not having to work for FaceGoogAmaSoft is likely worth hundreds of thousands of dollars to some people (I know it is for me).

<comment><USER9> Nope, your parent is absolutely correct ( most likely because he is successful technical co-founder with a track record, which would put him into his mid thirties or more). People get wiser with age and realize that while money may not buy one happiness, it certainly removes barriers to achieving happiness.

> They're more interested in making a difference and solving difficult > problems than collecting $300k per year as a cog in the machine.

That means their take home is roughly $150k/year after taxes, which is $12.5K/mo, which is _not an great take home_. Most likely the take home for his partner would be about $4-$5k/mo. Lets make it $5k. So the total take home is $17k/mo. For someone in his thirties the apartment would be about $5k/mo. Wife's personal trainer + ClassPass ( you are accounting for things like that, right? You realize that 'I like the way you look' costs real money?) is $1k/mo. Food + incidentals is another $1k mo. Utilities + misc recurring is another $1k mo.

So we are down to $9k/mo not going to anything before:

1\. Going out

2\. Clothes

3\. Trips

4\. Parties to host or go to

5\. Emergency funds

By the time this is all accounted for $300k/year income is perfectly fine but not extravagant in any of the areas where one gets $300k/year for his co- founder worthy skills.

<comment><USER10> You think 1000 a month on food for two people is normal?

<comment><USER9> Yes, a month is 30 days. 1000/30 is slightly more than $33 per day for two people. Your lunch coffee at starbucks habit is $5 per person per day. So with that or with "i grabbed an apple" or "I got a granola bar" habit that you or your wife has you are at $26 per person per day for breakfast/lunch/dinner for two people, which is $13 per person per day for breakfast, lunch and dinner.

I seem to remember people arguing with me that $10 per person per _dinner_ is the lowest that they pay per person ( see Blue Apron/Home Chef/Plated/etc business models) So based on their math it is $20 for two people per dinner. Now I _personally_ think it is too much because I automatically only shop sales but I'm weird.

</comment></comment></comment></comment></comment><comment><USER11> Strong disagree on letting the founders personal situation count for the salary to be taken off the table. Having kids or not is a personal decision, if your co-founder has kids and you don't or vv then your salaries should be - all other things being equal too - equal.

Paying one founder more than another is a good way to start a founder conflict and those you need like you need a toothache.

<comment><USER12> _Strong disagree on letting the founders personal situation count for the salary to be taken off the table. Having kids or not is a personal decision_

Having kids is a factual part of many people's lives, _not_ an arbitrary personal decision that can be erased at startup time. A person with kids simply has higher living expenses. Of course, if you feel that strongly about it, you can choose to only found companies with single people but that needlessly reduces your pool of potential founders who are talented, experienced, disciplined, of great character and compatible personalities.

Otherwise, the issue of varied expenses can be balanced via 2 approaches:

a) All cofounders take salary equal to the amount required by the one with highest expenses and agree on the resulting consequences (smaller operating budget, higher urgency towards independence via profitability/ funding, etc).

b) Equal salary nominally assigned but the founders with less expenses agree to loan the startup the "excess" portion of their salaries. This can be structured and recorded as deferred compensation/loan agreement payable upon achieving X financial milestone, e.g. when revenue hits a certain level or target amount of funding is received.

<comment><USER13> I didn't choose "to not have kids" so I could pay more for the kids of other people, if I wanted to pay for kids, I would have got some myself. :D

<comment><USER14> If you're committed to ignoring the needs and wants of a business partner, why do you want to be their business partner?

It seems like a dickhead attitude that bodes poorly for the future of a business enterprise.

<comment><USER15> The need for an equitable salary is just as legitimate as the need to care for children. I have a family to care for even if they are not listed as dependencies. I also have a future family to prepare for that I might want to get a leg up on. Or maybe I want to forego children because I'd rather save up to start something more meaningful to me later.

Just because you have an immediate need that is evidenced by children doesn't mean others don't have equally legitimate needs.

<comment><USER14> I didn't say that children trump all. It's a negotiation point. Getting what you need/want may cost you.

My point is that if your "partner" is going to take an extreme, aggressive stance on such a thing, that's a red flag.

</comment></comment></comment></comment></comment></comment><comment><USER16> Considering the cost of living in these cities, what this tells me when 66%+ of founders in SV pay themselves less than 50k/year is that the majority of them are already well-off, and have savings to spare for things like.. paying rent and eating food. It is completely unrealistic to expect the average college dropout to live comfortably on the same salary. Do these numbers match reality?

<comment><USER17> I live in Palo Alto making about $55k and live fairly comfortably; my actual living expenses are probably closer to $25k. It would be hard to have a family, but I get by just fine having roommates.

<comment><USER16> Zillow tells me average house price in Palo Alto is $2.6m, average rent $5k. Do you own/share a house? I'm in Europe, so basing myself on public stats.

<comment><USER17> I rent in a house and split 4 ways. My share of the rent is a little over 1k.

<comment><USER16> Thanks for answering! So the data is not far off. I should add "or is single and has no children" to my comment. Nothing bad about that, on the contrary, it does mean older founders with family or other obligations will need to bring/sacrifice their own nest egg.

<comment><USER17> I think a total household income of ~150-200k is right around the cutoff for 4 people to live in Palo Alto together. You can split that up however you want though. In my case, that's 4 people earning ~50k rooming together. In the case of a family, one person earning 120k and the other doing a startup earning 50k (plus 2 non working kids) works too.

You're right that someone trying to support a family on a single income at 50k would have a tough time, but I think the range of people who can make it work is a lot broader than you're making it seem.

<comment><USER18> To be fair two non working kids have a lot more costs than a frugal 20 something. Childcare alone in the bay area is probably in the 10s of thousands a year range.

</comment></comment></comment></comment></comment></comment></comment><comment><USER19> This martyr narrative is tired.

The truth is that most companies once they get to series A fold for much more binary reasons that are almost never saving a few $1000 a month on the founders salaries. Additionally there are easy ways to turn your salary into a draw that ebbs and flows in times of cash flow crunches if thats a concern.

Ultimately a founder should just pay themselves what they want. The companies rise happens on the backs of the their judgement so I dont know why we are using some irrelevant framework for this particular decision. Like everything from raising money to hiring, create a narrative and then use it to optimize your target outcome.

It's also important to note the founder isnt entitled to struggle as a species. In fact you can build an incredible company and ask to maintain a quality of life.

If you can afford it pay yourself market or more and you think it will make you happier or more effective, do it!

In the end tolerance for pain isn't the skill that defines a great founder its the progress. Pay yourself whatever the hell you want as long as you keep doing good work.

</comment><comment><USER20> Does/should a founder's skills and market-rate salary affect their salary in the startup?

For example, if a highly sought-after AI expert founds a startup with a talented but somewhat junior businessperson, their market-rate salaries could be 2-5 times different and a case could be made that the one with higher market-rate salary makes a larger sacrifice/take on more risks and thus should be compensated more?

<comment><USER12> No, it shouldn't. If both senior and junior are starting the company at zero and working fulltime/equally pouring sweat equity in and assuming similar living expense profiles, then they should be compensated similarly. If you can't see your cofounder as equal, then partner with someone else. Or if the salary differential is that important to you, then remain on the corporate path.

<comment><USER20> What if the junior partner is the best person available with history of good working relationships with the senior cofounder? Not considering him/her because of salary differential might be suboptimal for the startup.

At the same time, the senior cofounder could have a much larger need for salary because of mortgage and family to take care of, so receiving too little salary would cause hardship and adversely affect the startup, while the junior person has less financial obligations.

</comment></comment></comment><comment><USER21> Why is it when I read this it feels like the VC essentially "hazing" the founder saying that "you will get your payout later so suck it up." Thats not true for every company because not every company has the goal of doubling every year and then getting sold to Google. They don't all have to follow the Silicon Valley model. The irony of this is that the VC has the operating funds to wait till later to get their payout, its like they are making the founder suffer with them. Simultaneously they are taking as much equity as possible essentially minimizing the founder's payout. The difference is that this is probably not the VC's first venture so they have plenty of cash to rest upon whereas a first time founder is literally scraping by, possibly with a family, mortgage, etc.

<comment><USER21> Really the more I think about it, this more sounds like one VC's attempt to weed out people thinking about starting a company by scaring them. There is nothing set in stone that says founders should get paid a certain amount. Every company has different cash flows and situations.

<comment><AUTHOR> I'm not sure if you've read my post. If you read it, you'll see that I wrote:

<< The numbers in the model reflect what I think is market and fair based on the data points that we have and some industry benchmarks that we were able to get. However, our data set is quite limited and the numbers produced by the calculator should by no means be taken as the ultimate truth. If you disagree with my assumptions or have seen different numbers in the market I'd love to hear from you! >>

No need to assume bad intentions.

</comment></comment></comment><comment><USER22> > I saw a study according to which founder salaries are much lower. According > to this data source, 75% of Silicon Valley based founders pay themselves > less than $75,000, with 66% paying themselves less than $50,000. Based on > these numbers, even for companies that have raised more than $10M the > average salary is only $81,700. This looked odd to me, and maybe the > difference is due to the fact that the study is three years old. I ignored > this data source for now, but again, suggestions and input are very much > appreciated.

I totally appreciate a VC saying it's okay to take a decent salary, but this point seems strange to me. Why on earth ignore the data?? I doubt three years makes any difference at all. I would speculate this is more likely a philosophical difference between the US and Germany.

A founder's entire existence is spent trying to figure out how to get a company to survive its first few years. Companies that raised $10M are dying all the time. $10M really isn't that much, it buys a startup with 30-50 people maybe a year of runway. In a company that size, one or two more engineers can make a real difference, and if four founders forego $50k/year they can then hire one or two more people using the difference. They basically spend every second trying to figure out how to stretch every dollar they have, it's not surprising to me that many live their early startup years exploring just how little money they can actually live on.

<comment><AUTHOR> The reason why I ignored the data is that it was in stark contrast to several other data sources that I've seen. But it's a good point, I need to look into this again. I will also contact the research team of that study and ask how they collected the data.

<comment><USER22> Ah, that is interesting. I'd love to see something on the multiple data you've seen! I tried to look but didn't see whether this data is for only VC funded startups, or for a wider set that includes others, do you know. If there are other data sources on SV startup salaries that disagree, then I have to take back my US vs Germany comment. Perhaps the discrepancy is that this data was all opt-in, which could bias the sample? Anyway, thanks for following up!

</comment></comment></comment><comment><USER23> A bit off topic but lets say you and your co-founder follow the canonical YC advice. You form a Deleware C-Corp, register your California foreign entity and grant yourselves ISOs with a 4 year vesting period and a 1-year cliff.

But then your company starts to do very well and in 6-months you both agree you won't need to raise VC and want to start paying yourselves more than the ~$100k mentioned in this article. What would be the best way to draw money from the company ? Increasing you payroll check seems unwise from a tax standpoint. Dividends might be a good way but you don't yet own a single share so you can't be paid through a dividend. You could pay yourselves bonus checks, but isn't that taxed at same rate as payroll ?

Side request, can anyone recommend a CPA in the East Bay (SF). Thanks.

<comment><USER24> You need to be careful with the dividend route. The IRS seems to frown on someone in a career that normally makes 6 figures drawing a 50k salary and 200k in dividends a year. I would ask an accountant. But this is exactly the downside of early C corp.

</comment></comment><comment><USER25> _in response to feedback being requested_

The post: It's great, adds a lot of value.

The calculator: Terrible idea. Might even add negative value or be counterproductive.

The post is appreciated for multiple reasons. Insights from investors are not overflowing the Internet. It's a relatively small group, so it's often very helpful when someone chooses to share their thinking. It also has value because it's not just pulling back the curtain, or sharing facts, rather, it offers critical analysis of how to approach the question. Even if some of the analysis is wrong, it's still valuable, in that it inspires further analysis and facilitates understanding of the mechanics.

However the calculator is a reductionist solution to a problem, that can be highly inconsistent from one situation to another. Paraphrasing: Please input the number of kids you have? Sounds like something a government office would come up with. How about a calculator to pick startups to fund? Well, some people do try to automate betting on companies for various needs, however they often have limited success, and it usually involves very complex modeling systems, rather than a google spreadsheet.

The net of it is, using a spreadsheet might be helpful to track and manipulate data inputs, but not to generate an actionable result to drive a nuanced decision. I'm wary even of using it as a starting point, given the risk of building additional reasoning on a flawed foundation. It would be a great tool to have. The problem is there are just too many subtleties to capture (known and unknown), and even then they would apply differently across the startup world's highly variable situations and contexts.

In some ways the question is typical of many other questions startups encounter: It's at least partially and possibly highly subjective, the number of potentially relevant factors makes it impractical to spend lots of time of each factor, and the available data points are imperfect and/or incomplete.

As AI slowly but steadily chips away at the list of things humans can do better, questions with these attributes might be the some of the very last to fall. And when they do, it will not be office productivity software that slays them.

</comment><comment><USER26> Isn't the founder salary something that only the founder and those who bought a board seat should care about? If I'm an investor and the founder wants a 40% premium over what the algorithm recommends, I may or may not agree, but surely the founder's judgment on that one issue is not an outlier from other good or bad judgement he or she may have.

I'd actually be more worried about minor graft like the founder hiring a family member to provide catering or the founder taking bonuses when most employees are not paid bonuses.

<comment><USER27> At a flat rate of $10,000/year per pop, the Duggars and their Quiverfull movement would love this Founder Salary Calculator.

Should you get more or less financial reward if you pay child support to outsource your kids (KAAS) instead of raising them yourself, so you have more time to dedicate to the start-up?

</comment></comment><comment><USER28> It would be interesting to hear YC's official position on founder salary. Anyone have a link to an official post or comment from YC?

</comment><comment><USER29> I've been through a few startups and I always paid myself as little as possible. That is to say, I paid myself the minimum I needed to cover my own personal fixed costs. For me it was important to leave as much money as possible for others and growing the company. When the startup is successful, then I'll take a higher salary.

<comment><AUTHOR> Same here. I think this is the right attitude. By the way, this even goes for micro VCs, we didn't (couldn't) pay ourselves a salary in the first year or so.

</comment></comment><comment><USER30> Ultimately everything comes down to BATNA [0], but a good place to start is what you would be doing if you weren't running a startup and how much you would earn (after tax) if you worked as hard for someone else as an employee. This is your BATNA.

An investor (in theory) could pay you a high salary as an employee to work on the business and keep all the equity. An investment is in someways equivalent to a very high interest non-recourse loan. Given this you want to take the absolutely minimum in investment you can and an extra paid in salary to founders will cause you to take more investment than you need.

Personal circumstance should never play a role in what someone is paid, only their BATNA. When it comes to startups there are three forms of compensation; salary, conditions, equity. The split between these can vary, but the total should be fixed by the individual's BATNA, not how much many kids they have or student debt.

Slightly off topic your compensation in any job should never be based on how much value you bring to the company, but what your BATNA is. It is up to your boss to decide if your BATNA means they want to pay you as much.

0\. [https://en.wikipedia.org/wiki/Best_alternative_to_a_negotiat...](https://en.wikipedia.org/wiki/Best_alternative_to_a_negotiated_agreement)

</comment><comment><USER31> Hoping the "100-hour-work-week" bit was a joke.

<comment><USER32> Probably not...getting any business off the ground usually requires a god awful amount of work at the outset. That's the trade off.

</comment></comment><comment><USER33> _> If you raise a small angel or friends & family round, you'll probably want to spend it on other things than founder salaries._

This part in particular doesn't make sense, or at least assumes founders have savings and assets. But what if you don't because you're young or you've already bootstrapped your way through all of it and gone into debt too?

It makes sense to pay subsistence salaries at the angel stage.

</comment><comment><USER34> Ya in the last company I founded I would go without paychecks to let my co- founder pay himself when we were running out of money/struggling to collect payment. It's a lot more about the needs of the people to be able to get through the initial phases than it is about 'equality and fairness'

</comment><comment><USER35> I'd think the starting point would be a market rate salary - to the extent that a founder is willing to take a lower than market rate salary their equity should be increased taking that into consideration at each stage (or just issuing equity to that person that's the difference between actual and market each year).

<comment><USER36> Supposedly that's what equity plus vesting achieves, which is pretty much the default.

</comment></comment><comment><USER37> It's amazing how little VC's value early stage founders. It's an accepted fact that hiring a competent CEO is going to cost you well into 6 figures and up. Because their experiences and track records are rare. If we all know having a good CEO is well worth that kind of money, then why don't we apply the same logic when allocating capital for paying the founder(s)? It's a hard job, fraught with literal peril. Founders often face personal financial ruin if the venture fails. Founders are literally pulling on a yarn to iterate on and articulate very broad visions. They are faced with critical decisions that will affect many people's lives every day under incredibly stressful conditions. If there's $1,000,000+ in the bank, it's a disgrace to pay a founder what amounts to Jr. level rates anywhere else.

<comment><USER24> Startup A pays founders 50k and has budget for 4 developers.

Startup B pays founders 200k and has budget for 2 developers.

All else equal, B should win right? It is running leaner that gives you more effort to throw at the problem. Until the point your pay is so low you have to stress about money.

Founder pay that is lowest to avoid stress seems optimal.

<comment><USER38> "What one programmer can do in one month, two programmers can do in two months"

<comment><USER24> Yes this is why Google, Apple, and Facebook all have 1 programmer.

</comment></comment></comment></comment><comment><USER39> Seems like it should factor in the expected size of the company. If it can work with 2 solid engineers and 2 other people then $2 million goes a lot farther than if it is 10 people. So why not pay closer to market in that case.

</comment><comment><USER40> Do the employees get an extra $15k / child?

</comment><comment><USER41> I agree with most points but if you are dead set on dedicating yourself to the compahy you work at why did you take a large exit?

</comment><comment><USER42> I frequently see advocating paying founders with kids more, but (partially because a company can't legally ask about having kids during an interview) almost never factor in those type of expenses for other employees. Unsure what I think about this.

</comment><comment><USER43> I'd qualify these with - a non technical founder in a product company.

A technical founder of a consulting company would be making above market rate from day one, or you are doing it wrong.

</comment><comment><USER27> How much does prior experience and shipping successful products count? Is it really better for your salary to pump out a few kids instead of shipping a few successful products? Do the kids have to be successful or will any kids do? ;)

[https://lh3.googleusercontent.com/-gpJ2FfhmWMc/TYb7Un7m-gI/A...](https://lh3.googleusercontent.com/-gpJ2FfhmWMc/TYb7Un7m-gI/AAAAAAAAACU/bD0C0FNpL-g/s1600/forgot.jpg)

</comment><comment><USER44> Overall, a sensible calculator.

One surprise for me is how low the kids addition is. $18k (pre-tax) is hardly enough to cover the cost of a kid in SF. Even ignoring costs of additional housing, daycare costs are going to be over $25k/year.

Looking at the numbers:

* $90k single founder in SF - pretty easy to do (live with roommates); probably slightly excessive ($80k should be just fine for most folks)

* $108k founder with kids in SF - difficult. I'd put $120k as being a reasonable minimum with one (pre-k) kid.

<comment><AUTHOR> I agree, I don't expect the kid additions to fully cover the costs. Trying to cover these costs fully is probably unrealistic, as it would lead to a very large salary spread between, say, a founder with 3 kids and one with 0.

The good news is that once you have kids you won't have time for parties or expensive hobbies anyway ... and the joy of having kids makes up for the financial disadvantage several times over. :-))

</comment></comment><comment><USER45> So this kind of defines value = able to raise lots of money. That just doesn't make sense to me.

Also the idea that you should be paid more because you have kids is same logic that communists used "to everyone according to their needs". In capitalism people should be paid based on what value they provide.

So, to me this calculator looks stupid. What if my startup hasn't raised any money, is still very profitable and employs 20 people?

<comment><USER46> Could argue that raising children potentially provides society future value, making the increase a kind of long term investment

<comment><USER47> For society, maybe. For the startup, no.

<comment><USER46> Agreed. The line of thought probably ends up being an argument to have tax cuts for parents</comment></comment></comment></comment>


The countries with the fastest internet, charted - <AUTHOR> http://qz.com/866998/the-countries-with-the-fastest-internet-charted/ <comment><USER2> AU is at 50 but the internet is so poor here that I thought we'd be further down the list. ADSL over very old wires. No cable option in my building and no fiber. Wireless is too expensive. It's really shit.</comment>


Librarian of Congress Renews and Expands Protections for Fair Uses - <AUTHOR> https://www.eff.org/deeplinks/2015/10/victory-users-librarian-congress-renews-and-expands-protections-fair-uses <comment><USER2> Whatever happened to unlocking phones? There was a huge stink about that. Petitions were signed. Legislation then bogged down as it always does. After two years(!) congress finally passed something, but

"the unlocking exemption will only last until the Librarian of Congress's next rulemaking, scheduled to happen in 2015."

[http://www.pcmag.com/article2/0,2817,2461481,00.asp](http://www.pcmag.com/article2/0,2817,2461481,00.asp)

This would have been the time to reverse that decision, no? WTH is there no mention of the reversal of that decision? Does this mean we're right back to square one?

</comment><comment><USER3> _The exemptions we requested—ripping DVDs and Blurays for making fair use remixes and analysis;_

Does this mean fan-edits are fair use now?

<comment><USER4> In the end it depends... but you won't be convicted for circumventing the DVD and copying it to your own hardware... it'll just be the act of sharing it with a few thousand of your closest, most personal friends on the internet.

</comment></comment><comment><USER5> What would it take to make the protections permanent instead of something that is renewed?

</comment><comment><AUTHOR> Could these fair use exemptions be reconciled with the TPP?

</comment><comment><USER6> take a lot, give a little...</comment>


Is there any good Internet resource for studying Statistics? - <AUTHOR>

I'm going back to university this September and I picked up a course which has some prerequisites
Mathematics & Statistics (Sci): Sample space, events, conditional probability, independence of events, Bayes' Theorem. Basic combinatorial probability, random variables, discrete and continuous univariate and multivariate distributions. Independence of random variables. Inequalities, weak law of large numbers, central limit theorem.
I've studied statistics many years ago but as I don't use it in my work I completely forgot all of it. Since there're still a month before September, I think I should make some preparation for my study if I don't want to drop the course. So is there any good Internet studying resources that I can use to refresh my statistic knowledge? (I thought about buying textbooks, but they are really expensive) <comment><USER2> Go purchase a Schaum's book - they're under $15, have tons of questions, and cover the basics. You can use Wikipedia (seriously, it's very solid) to review concepts, then work through a few question in the reader.

Example: [http://www.amazon.com/Schaums-Outline-Statistics-Murray- Spie...](http://www.amazon.com/Schaums-Outline-Statistics-Murray- Spiegel/dp/0070602816) \-- $8.65

<comment><USER3> I think this one is closer to the topics he's asking for.

[http://www.amazon.com/Schaums-Outline-Probability- Variables-...](http://www.amazon.com/Schaums-Outline-Probability-Variables- Processes/dp/0071632891/)

Also, courses on this tend to have a bloody lot of calculus and algebra, to the point of dominating the actual prob & stat knowledge required by about an order of magnitude. Solve lots of problems and review manual computation of integrals & etc. if necessary. I routinely use Mathematica for anything that would take a meaningful time to compute by hand, so it was a huge pain to deal with this aspect.

</comment></comment><comment><USER4> khanacademy.org may be a pretty good way to refresh some basics</comment>


Reminder: weekend of code starts tonight - <AUTHOR>

Admittedly, I didn't pour much work into this, safe for starting a ning community (weekendofcode.ning.com). I was hoping for self-organisation, and it just seemed like a good idea at the time: work on a project with somebody over the weekend, to test the waters for co-founding a start-up. Just start a group on Ning for your project, or join an existing group, and start developing.
<comment><USER2> isn't every weekend a "weekend of code?" ;)

<comment><AUTHOR> Sure, but not a weekend of cooperative coding.</comment></comment>


Free ride from SFO if you test our app - <AUTHOR>

We are looking for people who are visiting SF Bay Area in the next 2 months. If you could use a free ride from SFO to anywhere in the SF Bay Area, we would be happy to meet you at the airport and give you a ride. The catch is that while you are riding with us, you will be testing our app (iPhone or Android, your device or ours - whichever you choose). The only requirement is that you must not be a San Francisco resident, because we need to test this app with visitors, rather than with locals. Feel free to refer your friends to us as well. You can contact us at firstname.lastname@example.com. <comment><USER2> Why don't you just go to Union Square and ask people if they'll test your app in exchange for a free coffee. There are TONS of tourists around there, and a lot of them are just sitting around after a long day on their feet.

<comment><AUTHOR> Thanks for the advice. I think, we'll do that too. Personally, I don't like when people come up to me in the street and demand attention, but maybe that's just me.

<comment><USER2> ahh, you gotta get over that. Don't project your personal views on others, there's plenty of people that would enjoy this - I know I would.

If you're going to be successful as a startup, you gotta hustle. I did door- to-door sales one summer and do you know which people turned out to be the nicest? The ones with "No solicitation" signs on their door. I kid you not. Just go and do it.

<comment><USER3> I think there's plenty of people who would not like this as well and the current method they're experimenting with is unique in that only people who want to test the app will agree to get a ride. If someone does approach me in public and ask for my time, I'm not going to think too favorably of the experience.

<comment><USER2> yeah, but giving rides from SFO is time consuming and costly. Gas could easily cost you $10, not to mention an hour of time. There's easier ways to do it, and as a startup, you need to be as resourceful as possible.

<comment><USER4> We'll give union square a try as well, but this free ride & test idea seems to work well so far. A good test of the app takes 45-60 minutes, which works well for an average ride of 30-45 mins. The time wasted on finding candidates is minimal - few postings and replying to email.

</comment></comment></comment></comment></comment></comment><comment><USER5> Cool idea, wish I could take advantage of this. You don't happen to need testing on a flight to San Francisco too? ;)

<comment><USER6> maybe international? ;)

<comment><AUTHOR> International or local, anyone who is arriving to SFO and is not a Bay Area resident qualifies.

<comment><USER6> I was asking if they were going to offer a free international ride (flight) in order to test their service :)

<comment><AUTHOR> Maybe when we hit first 10 million downloads :)

</comment></comment></comment></comment></comment><comment><USER7> What's the app?

<comment><USER6> I suppose this one: <http://www.citybot.com/> it looks like an app that allows you to create a customized travel itinerary

<comment><AUTHOR> Yes, the app is Citybot. It isn't in the app store yet, but we can deliver it via Testflight and as an APK file. The app lets you create custom itineraries in seconds.</comment></comment></comment>


Ask HN: Reality for the Average Developer Outside Silicon Valley/Big US Markets? - <AUTHOR> Hi HN,
Big US markets, especially Silicon Valley, get a lot of attention. I would imagine it distorts the view of what it's really like outside these big markets. So what's the situation like for the average developer outside the big US markets in terms of ease of getting a job (or switching jobs), perks, salary, quality of work?
I ask as an average grad entering the industry in a non-top-tier, non-US city. <comment><USER2> > non-top-tier, non-US city

Up your relevant demonstrable skills enough to work remotely for a company in a big US city.

Alternatively, immigrate either to US or to a country from where it's easier to work for US (hello Canada).

Maybe move to a bigger city in your country and work for its Google or Microsoft office if there is one and if it pays well.

An average nondescript town is not a good place to be a software developer. Low wages, uninteresting, unchallenging work (hello agency work, drupal websites, 15 year old enterprise java codebases), working in an IT dept that is a cost center rather than revenue driver, etc. We can't possibly know what exactly it's like where you are (better ask on a local forum) but that's what it's like more often than not. It might certainly be better than other careers locally, but it's worse than you can have if you're willing to make the effort.

<comment><AUTHOR> I am in Canada, but is there still not an issue with taxes and other things that makes a lot of companies not consider Canadian remote workers? Dont you have to work out a consultant/contract type deal with US remote companies? What companies do you know that do hire remote workers from Canada, let alone remote junior developers :P

<comment><USER2> Junior remote is hard, which is why I'm saying get the skills first. This is not just a one year journey, you should be planning your path for the next 5-10 years. Optimize for skills and learning first, then go for maximizing income (as much as you can afford this delay). Always keep interestingness and quality of life up high in priorities.

Get a local internship / job first either in your town or in a bigger town like Vancouver / Montreal / Toronto. Learn the trade, best practices, best technologies, get an open source presence, etc. All of this will require a genuine interest in the field and hard work on your own time. You will of course also progress your skills on the job, but relying solely on that you will grow much slower, and will be strictly capped by the quality of your workplace dev culture. You can start your growth before even getting a job btw.

In Canada, lots of companies hire juniors, both big and small. Look at your peers and know how to stand out. Did you build a simple app, put it on github and host in somewhere? Congrats, you have demonstrated more skills than 90% of your peers, and you haven't even interviewed yet. Google your way into finding these companies – see angel.co, many lists of companies hiring remotely, local job fairs, etc.

As for cross border contracting – yes, working for US you will most likely be a contractor unless the company is big enough to have a Canadian office. Better that they don't, then they will be less likely to offer you a Canadian salary. Being a long term contractor is not really a problem as long as you have the skills you advertised. Taxes are easy for contractors. There are legal things you need to know, and you will know after you do proper research on this, but there are no showstoppers there. If you want to take the most from this career, you don't let some paperwork or the illusion of job security get in the way. You work hard to become the best developer you can be, and allow the highest bidder that you're interested in working for pay you for your work.

\---

This might sound very... effortless and maybe pompous and out of reach but it's entirely doable. Knowing who you want to be, being interested in your work, and spending a lot of effort on becoming a better developer year after year is really all it takes. It's a long path but thousands of people have walked it.

<comment><AUTHOR> Thanks for the detailed write up, raquo. I truly appreciate it.

</comment></comment></comment></comment><comment> a-saleh I Work in Czech republic.

So far switching jobs was not a problem. Nor getting a job.

Around 7 years as a developer on some form or other. Currently 2500$/Month with a 4 day work-week. Interesting work. Up to additional 500-1000$ a month for my on-call duties. No additional variable compensation. Some possibility to get pre-IPO share of the startup. No sick-days. 20 day vacation. Vacation is auto-approved :)

Previously similar compensation for a 5 day work-week as a QA/Internal tooling dev at US corp with local presence. Accumulated ~20K$ stock over, but only half of it vested as I was leaving :P 5 days of no-questions-asked sick-days. 25 days of vacation. 15% of additional variable compensation.

Around 30% tax/social-security (there are additional employee taxes on top of my salary, but custom is to pretend that this is the employers problem :) Some opt for self-employment scheme (you can half your tax if you have good accountant), that can be sometimes in a grey legal area, if you are billed by a single large corporation.

Started at 800$ with 4 hours a day 7 years ago.

Currently around 500$/month recurring life expenses (I own my flat, so mostly utilities, insurance, phone bills, e.t.c., if I rented, it might be additional 300$ for 2 bedroom flat?), around 10$ price of dinner at a pub. And feeding a family of three is more expensive than I'd like :)

<comment><AUTHOR> Thanks for sharing your experience. Are 4 days work weeks common in Europe? I worked on a team that had a UK office where some of the people were on a 4-day agreement (although the agreement was in place before the UK office was bought by my employer). Seems like it's very uncommon to find someone working 4-day weeks in North America or even part time as a developer (but, of course my experience is very very limited)

<comment> a-saleh Not common at all. Unless you are a college student (most people I knew went intern->part-time->full-time)

But most employers are open to them. I used it as a negotiating tactic, where they offered 15% more than I had, and I countered with 20% less time :)

</comment></comment></comment><comment><USER3> Here's my experience working as a SWE in Australia for about 4.5yrs, mostly in Brisbane and recently in Melbourne. I don't know what is "normal" for SV/SFBA so I'll just list everything I can think of. The first three points are mandated by law in Australia.

* Maximum of 38hrs per week + breaks (~40hrs). I have never worked or been pressured to work overtime, paid or otherwise. I happily do my 9-5 and everything outside those hours is my personal life, especially the weekend.

* 20 days paid-time-off (annual leave) per year. Never tried negotiating for more.

* 9.5% on top of base salary contributed by employer to your superannuation (similar to 401k). I believe 17% if you work for government.

* Comfortable salary. Definitely not SFBA rates but comfortable for CoL. Fresh grad would be ~$40-60k/yr, going up about $10k/yr for the first few years until you reach a point where years of experience becomes less relevant than the type of experience (~5yrs). Some regional variance to account for CoL. I stupidly started low, but then pushed for more until I felt comfortable that I'm paid average market rates. My history was $40k, at ~6mo $55k, at ~1.5yr $70k, at ~2.5yr $77.5k, at ~3yr $90k, at ~4yr (job change and BNE->MEL) $110k. This is plenty to live off and save for the future, especially if your SO makes similar.

* Somewhat flexible working conditions. Some companies are butts-in-seats 9-5 from the office, most will allow some WFH and variance in hours (7-3, 11-7, etc.), some allow full WFH/remote and your own hours.

* Pretty easy to find a new job. Each time I've tried interviewing I've received multiple offers within about 1 month.

* Sane interview processes. Most places will do a 15-30min phone screen so you can decide if you want to proceed, a take-home technical test that takes 1-2hrs, and then a 1hr onsite, before making an offer.

* Offices are mostly open-plan.

* Some companies offer small perks on top of all this, e.g. retail discounts, device allowance, phone allowance, personal development allowance, etc.

<comment><AUTHOR> I don't have a whole lot of knowledge about the Australian industry, but I would think it would be similar in compensation to Canada (relative to US). So $110K seems quite high after ~4 years.

What allowed you to get to this point? Was there a general pattern that you noticed that helped you go from 40 to 110 in just 4 years? It's quite impressive actually. Was it being in the right place at the right time, professional growth from what you worked on, personal projects, negotiating hard when the offer was made?

<comment><USER3> Happy to go into a bit more detail on this. As I said in my first post, I shouldn't have accepted 40 to start with. I had received an offer for 55 at another company that fell through when they had a hiring freeze, so I was getting a bit desperate when I accepted 40. The early raise to 55 after about 6 months made me feel a lot more comfortable.

The way the raise process worked at that company, I was never present, never given an opportunity to negotiate or even suggest a number, but I was lucky enough to have a great boss who valued what I did, fought for what he thought he could get for me, and told me to let him know if I was unhappy. I tried to keep an eye on the market (just follow a few recruiters on LinkedIn and it's not too hard), and when I went from 70-77.5 at about 2.5yrs I felt I could get more elsewhere.

I was also at a point where I felt like the growth potential there was running out (it was a _very_ small engineering dept.), when I was offered another role internally reporting to the same boss (was a SWE, new role was Product Manager, again very small company though) so I took it and pushed for a raise to go with it. At the same time, I interviewed at a few other companies and ended up getting offers at 75, 80, 85 and 95. The raise came through at 90 so I decided I was comfortable where I was. This is at about the 3yr mark. Note: These were all quite small companies by global standards, but normal for a small city like Brisbane (50-500 employee range, not FAANG etc.).

Stayed in that role for about a year until I decided to move interstate. I could have kept my position and worked from our office in the new city, but decided it was time to move on. Being a new market that I hadn't been paying much attention to, I wasn't really sure what was fair, but felt I should take my current salary, add about 10% for another year's experience, and then another 10% for increased CoL. I interviewed at a few companies and asked for 110, and got two offers at 95 and 110. I had already decided on the company that offered 110 so was happy to accept it.

I'm not sure I would call this advice, as I don't know how widely applicable it is, but what worked for me was knowing what the market will pay, being confident that you're worth it, then find somebody willing to pay it. If any of this breaks down, fix it. At your current employer, the first step is to get your boss to value you, and my suggestion for this is to understand their job, their pain-points, the things that they're accountable for, and then fix those for them, even if it's not in your job description. Try to get to a point where you are seamlessly interchangeable for them in meetings/dealings with other parts of the business, and actually find opportunities to do this. If they're on your side and the business just can't afford you, as much as it sucks for your boss, it's probably faster to look elsewhere. Hope that helps.

</comment></comment></comment><comment><USER4> I'm from SEA (Philippines) and work here remotely under a US consulting company. What I hate is it's like a stigma that because we're from a low-cost country we're paid much lower vs those from the West (around 50-70% less) considering I have the same set of skills for a 10yr Software Engineer. I think it shouldn't matter where you're from as long as you're doing a great job, money shouldn't matter.

<comment><USER5> Right, that's what you think. Are you buying a house that's $1 million dollars? Are you paying $80,000 in taxes? Are you paying $2400 a month for daycare bills? Are you paying thousands for health care insurance? Are you paying $250 for car registration? Or another $1000+ for car insurance or transportation? There's a big SV envy going on from those in tech outside of SV, when one reads about the high salary they command over there, their expense is likewise accordingly.

I also think the stigma is GENERALLY true. The average 10yr software engineer from Phillipines is not going to be anywhere as good as the average software engineer in the Bay with 10yrs experience at these companies that pay good. Sure, there are exceptions, but we are talking about the average. Heck, the average 10yr software engineer in the US outside of the major tech cities can't keep up either. There's a reason most of the innovation and tools you are using are coming out from that side of the world. :-)

<comment><USER6> > Are you buying a house that's $1 million dollars? Are you paying $80,000 in > taxes? Are you paying $2400 a month for daycare bills? Are you paying > thousands for health care insurance? Are you paying $250 for car > registration? Or another $1000+ for car insurance or transportation?

That's not the right logic here. Are you saying that if they do those things in the Phillipines, then they should get a similar salary? I don't think it would be very difficult to get someone to raise the price of a house they're selling to $1 million dollars. One can then say they're buying that house and to give them a salary that allows them to do that. That would be extremely silly.

What you pay someone should only depend on what you get in return, and not on what their expenses of living are. Those are totally irrelevant. You can use an estimate on their expenses of living to know how low you can offer to pay them and still keep them happy, but it's not a justification, only an indicator of a low price they would be happy with.

On your second paragraph, that might be true, but GP's comment is made on the assumption of being equally experienced, equally as good. What justifies being paid much less, then? The real justification is that they can't be equal because, at the same price, it's always going to be more beneficial for a company in country A to hire an employee in country A over one in country B. This because it's inconvenient to have to deal with stuff like different timezones, language barriers, cultural barriers, taxes and other legal stuff, difficulty in physically meeting, etc. These things define the upper bound that a company is willing to pay before preferring to instead hire local for someone of the same skill.

As to the real price that these employment contracts should go for, it should be somewhere between this upper bound and the lower bound of the salary that a employee candidate can be reasonably sure to be able to obtain from their local job market. If the real price is too close to this lower bound, it may be because as a group they're not valuing themselves enough to push for higher salaries, or maybe they're being offered something else that they value that the local job market doesn't offer like remote work.

<comment><USER7> Willing buyer, willing seller. You could probably buy a mansion in these countries with $500k. Someone else in the same country would take it. I'm personally happy just making enough money to be in top 10% by 30 years old, so others working remotely in the same time zone have to compete with that.

However if you're unique in a vertical, you no longer compete. Let's say you're no longer just an app developer, you're an expert in live streaming videos and CA/DRM for apps. Maybe there are regional/legal difficulties in implementing this.

Now suddenly you are worth a whole lot. A company like Netflix is willing to pay premiums like $100k for a consultant for a week maybe.

If it's a large enough niche, demand exceeds supply, and people are willing to pay closer to what they're valued.

</comment></comment></comment></comment><comment><USER8> In São Paulo, Brazil (the best-paying city in Br) it goes more or less like this:

All of these are _monthly_ salaries:

A good jr developer salary: R$4500 +- R$1500 (today, ~US$1200 +- US$400)

A good middle-level developer salary: R$7500 +- R$1500 (today, ~US$1900 +- US$400)

A good senior developer salary: R$12000 +- R$2500 (today, ~US$3200 +- US$700)

A good tech leader developer salary: R$18000 +- R$3500 (today, ~US$4800 +- US$900)

The highest salary for pure software development that I heard is R$30000 (today, ~U$12000). More than that only for CTO-like roles at big companies.

In terms of ease to get a job, it is ridiculously easy. A struggling startup fired 10 developers and let the market know that they were open to offers. In one week all of them were already working at another company. _All_ of them and _already working_ (not just receiving an offer). We get LinkedIn messages from recruiters all the time. The more senior ones get around 3 to 5 messages a day from recruiters. A little bit harder for juniors, but still easy enough compared to other professions.

The quality of work varies a lot. I like a lot my current work and company, but this one is hard to generalize.

<comment><USER9> What are some of the top tech companies? I have to imagine the normal ones like Google, Facebook, and Amazon. But then more local companies would be UOL, Itau, Banco do Brasil, Bradesco, etc?

<comment><USER8> Google, Facebook and Amazon don't have as much developer positions in Brazil. Engineering is mostly done elsewhere and the offices here are more comercial people.

The banks indeed are good places and pay very well, but there are a few smaller startups that are very good employers. Nubank and Creditas (the largest fintechs), PlataformaTec (founder is the creator of elixir), Thoughtworks has an office here.

</comment></comment></comment><comment><USER10> Having moved from one non-top-tier US city to another, look for an area that has a lot of tech activity spread across multiple industries. If there are a few startups in the area then that is better as well.

If there is a large downturn in the technology space, a place like Silicon Valley is going to see more of an impact. Multiple industries like tech, insurance, banking, biology/medicine, etc. in an area will help if there is a downturn in the economy for a specific industry.

</comment><comment><USER11> What is the "US big market"? We have developers on the East Coast, West Coast, South Coast, North Coast and even in the middle of the country. To be fair, we also have digital nomads, and we do not really know where they are just that their code shows up in the repository, and they are present in the video conference, albeit sometimes with some odd background noises. We cannot imagine anything more of a perk than be able to work from anywhere in the world. Compensation is based on home office where ever the programmer chooses it to be. There are some sweat shops, some average 80/20 shops, and there are some posh, research programming jobs. Perks, salary, and QoW very much depends on company.

<comment><AUTHOR> Are the digital nomads all Americans too living outside the country? I've noticed most American companies only hire American citizens for remote work -- due to tax or similar issues.

</comment></comment><comment><USER12> Dublin, Ireland, senior developer with 15+ years

Very easy to jump jobs, though permie jobs have more hoops to jump through. Most jobs are big corporate, very few startups.

Working as a contract developer (rolling 6 months) at $11,500 per month (25 days holidays factored in). A similar permie role would pay about $8,500 a month + perks (health insurance, pernsion, etc.)

The work is generally not that challenging - a good dev with 5 years behind them could do it.

</comment><comment><USER13> As someone who works in web development in the UK (and who's writing an article about this very topic):

1\. You're far less well paid than in Silicon Valley. Wages vary by region, but in many European countries, developer wages are closer to standard office worker ones than the rockstar ones at Google and Facebook.

2\. Tools are often a bit more basic/old fashioned, and design is usually the same. In fact, I'd say the vast majority of the tech world is usually about 2-3 years behind the valley in terms of tech knowledge and tooling and best practices, and that time gap jumps up further and further the smaller the town/less tech savvy the company.

3\. Perks are a mixed bag. Some companies have all the ping pong tables and arcade games and free food/drink associated with startups, some just offer you an office environment and say get to it.

4\. Quality of work is usually less interesting. Lots of CRUD apps, small business websites, CMS themes, etc. Very few projects that have the goal of 'changing the world'.

5\. The workforce is usually more diverse than in Silicon Valley. For all the comments about women in tech and diversity, my experience is that it's more of a problem with Silicon Valley unicorns than other businesses and agencies. Probably because they're not mostly hiring graduates from a select few universities.

6\. The ease of getting a job varies. Usually you don't have much in the way of Google esque logic tests, but you'll probably have a few coding challenges to prove you know what you're doing. These challenges will be extremely easy for someone with FANG experience.

7\. There is far less interest in personal projects, side hustles, and other such things among developers outside of Silicon Valley and other major markets. Most devs in these places are basically salarymen, they code because it pays the bills and spend their free time doing other stuff.

8\. This lack of interest also seems to extend to the companies themselves when it comes to marketing their tech and culture. In fact, I suspect most European companies are absolutely terrfied of inbound marketing, and have no idea how to update a blog on a regular basis.

9\. Working practices are often a bit dated as well. A lot of development is still done with the old 'have the designer create a PSD and get the developer to turn it into a website' mentality, and waterfall style project management methodologies haven't been replaced by agile in many of these organisations either.

So yeah, basically the reality for the average dev outside of Silicon Valley is working on a CRUD project with tech and design that's about 3 years behind the cutting edge with a team that build sites as a profession rather than a 'passion'.

</comment><comment><USER14> I'm a Brazilian working remotely. The reality is really good, specially compared to my fellow countrymen and women.

<comment><AUTHOR> May I ask whether you're working for an international company (US?) or a Brazilian company? And how senior are you? Is remote work common there?</comment></comment>


The Median-of-Medians Algorithm - <AUTHOR> http://www.austinrochford.com/posts/2013-10-28-median-of-medians.html <comment><USER3> Note that you shouldn't use the algorithm in practice (unless you need certain guarantees) since the average performance isn't that great. This is just like Mergesort vs Quicksort where Mergesort guarantees O(NlogN) yet Quicksort is usually much faster. The constant for the number of comparisons is quite high. Compare this to the _average_ complexity for Quickselect with these pivot strategies:

\- Random pivot (ie Median of 1) has 3.39N comparisons

\- Median of 3 has 2.75N

If you want the fastest possible algorithm you should follow

[http://dx.doi.org/10.1109/TSP.2012.2197394](http://dx.doi.org/10.1109/TSP.2012.2197394)

which proposes to choose the median of N^{2/3} _1 /(4_pi)^{1/3} elements as the pivot and then also uses a different strategy to choose the second pivot (close to the median yet "safe").

Another fast algorithm is Floyd & Rivest's SELECT (yes the same crypto Rivest) which is also asymptotically optimal and implementations exist. (Paper title: "Expected time bounds for selection")

<comment><USER4> > "Note that you shouldn't use the algorithm in practice"

You certainly can:

1\. Run the randomized algorithm

2\. If if the usual way takes too long (more than O(n) for whatever constant factor makes sense to you), just stop doing more work and switch to the deterministic algorithm

Now you get the best of both speeds, within a small constant factor (like 2).

<comment><USER5> Or, since we have enough cores, run both in two parallel threads, keeping the original list read-only.

<comment><USER6> Or distribute out the median_5() work to many cores at once since each call is independent of the others.

</comment></comment></comment></comment><comment><USER7> This is one of my favorite algorithms. I use it frequently in my code (example: filtering noise in a real time system) and get giddy when I talk to others about it. One of the contributors to this algorithm was Manuel Blum [0], whose contributions (and his students') touch pretty much every corner of Computer Science.

His lecture notes from his course at Carnegie Mellon describe this algorithm quite clearly [1].

[0] [http://en.wikipedia.org/wiki/Manuel_Blum](http://en.wikipedia.org/wiki/Manuel_Blum)

[1] [http://www.cs.cmu.edu/afs/cs/academic/class/15451-s07/www/le...](http://www.cs.cmu.edu/afs/cs/academic/class/15451-s07/www/lecture_notes/lect0125.pdf)

<comment><USER8> Minsky -> Blum -> Adleman, Minsky -> Blum -> Goldwasser are 2 hat-tricks of Turing awards involving Blum.

</comment></comment><comment><USER9> According to the man himself, this algorithm was found by Manuel Blum when trying to prove that it was impossible to do k selection in linear time deterministically

<comment><USER10> Do you know if that's been proven, or is it still an open question?

<comment><USER9> The algorithm described in the article is deterministic and linear time -- exactly what Blum was trying to disprove as possible

</comment></comment></comment><comment><USER11> This is so trivial!

Actually, if you use lazy data structures, then sorting the list lazily and taking i-th element will give you the best possible complexity: [http://en.wikipedia.org/wiki/Selection_algorithm#Language_su...](http://en.wikipedia.org/wiki/Selection_algorithm#Language_support)

In Haskell, it is nothing more than "ithSmallest xs i = sort xs !! i".

<comment><USER12> Pretty sure this is wrong. For example, what about the case where k=n? Then the lazy evaluation will have to fully sort the list before it can determine the kth element, resulting in an O(n log n) algorithm.

In the standard idiom,

       smallest = head . sort

we're only looking for the case of k=1, so we can do it in O(n) time.

Note that if you used a lazy BST, then you could probably still get the last element in O(n) run time, but your example code doesn't do that. AFAIK, no standard library routine exists for this.

<comment><USER13> If your sort is lazy enough, the `(sort xs) !! k` approach will work fine. Haskell's default sort isn't lazy enough, but you could certainly make it so.

You don't have to fully sort the list before determining the kth element (again assuming a sufficiently lazy implementation). Once you know the element is in the second half of the list, the sort simply will never sort the first half.

<comment><USER14> It should be noted that the additional overhead from performing lazy quicksort (all those additional thunks) make it an unlikely choice for the standard sort function; you'd suffer a large constant factor overhead in the typical case of processing the entire list in sorted order.

<comment><USER13> Yep, definitely should have noted that. It's an interesting mental exercise though.

</comment></comment></comment></comment></comment><comment><USER4> If you like this, go look into the suffix array construction algorithm, called DC3 ("difference cover, modulo 3"). It's even more mindblowing.

<comment><USER6> Pang Ko's is cooler IMHO but then we are old lab mates.

</comment></comment><comment><USER15> The C++ standard library method std::nth_element states complexity; linear time on average. ( [http://en.cppreference.com/w/cpp/algorithm/nth_element](http://en.cppreference.com/w/cpp/algorithm/nth_element) )

I wonder if there are other possible implementations?

</comment><comment><USER6> I'm coding it in Ruby. Check back tomorrow and I should have it finished. [https://gist.github.com/chadbrewbaker/7202412#file-median- rb](https://gist.github.com/chadbrewbaker/7202412#file-median-rb)

<comment><USER16> Here is a python implementation. [https://github.com/NSkelsey/algorithms/blob/master/select.py](https://github.com/NSkelsey/algorithms/blob/master/select.py)

<comment><USER17> Sorting the sub-lists to find the 5 medians by itself is at best a O(nlogn) as per this example. That would make the algorithm non O(n). Or am I missing something?

<comment><USER18> Yes you are. It's O(nlogn) where n is 5 - i.e. it's constant time (you can easily find the median by 4 comparisons to find the smallest of the 5, followed by 3 comparisons for the 2nd smallest, followed by 2 comparisons for the median - a total of 9 comparisons)

<comment><USER19> Put otherwise: to sort them all it's O(n/5*(5 log 5)) = O(n).

</comment></comment></comment></comment></comment><comment><USER20> Nice writeup. There's a good source already though: [http://www.cs.cmu.edu/~avrim/451f11/lectures/lect0908.pdf](http://www.cs.cmu.edu/~avrim/451f11/lectures/lect0908.pdf)

</comment><comment><USER21> You can use the same idea in quicksort while choosing the pivot (and make it O(n log n)) but you don't because it is expensive.

There is a very nice and simple probabilistic algorithm instead.

</comment><comment><USER22> So embarrassing when a candidate busted this out on me in an interview - <USER2> couldn't quite explain it - so I was convinced he was wrong / out of his mind. Later I looked it up in the CLR and sure enough...

</comment><comment><USER23> Well written. This was the first algo we were taught in our algorithms design course from CLRS. Blew my mind at that time.

</comment><comment><USER24> very cool algo!! a C impl: [https://github.com/felipecruz/paa/blob/master/t1/knth_n_mom....](https://github.com/felipecruz/paa/blob/master/t1/knth_n_mom.c)</comment>


Robots With Automatic Rifles Could Be on the Battlefield in 5 Years - <AUTHOR> http://www.wired.com/dangerroom/2013/10/weaponized-military-robots/

<comment><USER2> Other than keeping our casualties down, this actually might stop some civilian casualties. Since the operator of the gun is not in mortal danger, s/he can pause that briefest of moments to decide if the person s/he is shooting at should be shot.

<comment><USER3> Or, since he is not there he could be even more trigger happy.

<comment><USER4> Psychological removal is a serious concern. It could be a lot easier to kill someone when you're removed by a few layers of abstraction.

<comment><USER5> On the plus side, doesn't it also lower the psychological harm that happens to many a soldier in sustained war?

<comment><USER6> Actually the experience so far with drone pilots shows that they get PTSD at the same rate as combat pilots who were physically there.

[http://www.nytimes.com/2013/02/23/us/drone-pilots-found- to-g...](http://www.nytimes.com/2013/02/23/us/drone-pilots-found-to-get- stress-disorders-much-as-those-in-combat-do.html?_r=0)

<comment><USER5> We're still in the beginning. Removing the "witnessing the carnage" part could still be accomplished one day. As I mentioned, using our brains just to simulate humans on-site controlling stuff at the battlefield may not be the best use we could come up with. Compared to what I had in mind, current drones are just glorified RC models. Thanks for the interesting link, though. This risk is always there, I guess.

</comment></comment></comment></comment></comment></comment><comment><USER7> The prospect of an entirely robotic war is interesting to me. No more bloodshed, the winner is determined by the amount of technological progress they manage to achieve and put into use. Wars could actually become somewhat useful for humanity as means to improve technologies (they already do, but the death toll that comes with them is kind of a shitty side-effect).

<comment><USER8> It won't any time soon be robots vs. robots, because that (with our current tech level) would imply superpowers fighting, and they'd just skip the battlefield and go straight to ICBMs. Or not fight.

What it will be, is robots vs. guys with AK 47s, robots vs. third-world armies. It would look a whole lot like "Terminator", and the bloodshed would be apocalyptic.

<comment><USER9> I'm not even that optimistic, it will almost certainly be robots vs. civilians simultaneous with guys with AK-47s and car bombs vs the other side's civilians.

Nobody's going to intentionally get in a stand-up shooting match with robot, unless the robots are so expensive and impractical that you can win a war of attrition against them by bankrupting the country building them.

</comment></comment></comment><comment><USER10> I'm surprised they didn't mention ATLAS. [http://www.theroboticschallenge.org/aboutrobots.aspx](http://www.theroboticschallenge.org/aboutrobots.aspx)

It looks so much like the terminator I wonder if it's a coincidence.

<comment><USER11> I'm not surprised.

Robots like QinetiQ's Talon and competing iRobot products have been deployed in the field for a decade doing things like recon and ordinance disposal. I'm not sure they're awesome pieces of engineering, but they're mature products that see real military use. There were even mounted weapon experiments with them around 2002. So seeing them armed on the battlefield is not a huge step.

Atlas, on the other hand, looks like a pie-in-the-sky research project. It even has a cord attached to it. It's definitely not going to be on the battlefield shooting things in the next five years.

Disclosure: I worked on the Talon robot (the one in the article's main picture) in college.

</comment></comment><comment><USER12> Fantasy talk for a second. . . ok, so if robots have far greater accuracy and of course options for self-exposure within a battlefield, why can't their primary directive be to shoot (literally) the guns of the enemy. It would be great if the technology was directed in a way for the robots not be "killer" but rather to shoot at the actual weapon someone is holding and not their person.

<comment><USER13> Imagine an enemy soldier facing you. The weapon they are holding has a small profile compared to the person holding it, and they are directly behind the gun. I can see a few challenges on this:

1) Hitting the gun and not the person. (duh)

2) Avoiding the bullet from glancing on the weapon and hitting the person.

3) Differentiating between the weapon and some equipment strapped to the armor, or even a pattern on their clothes.

4) Determining if the person is about to move and get hit by the bullet you'll fired at the weapon.

Depending on the damage dealt to the weapon, the enemy can just get behind cover and pickup the weapon again. You are also losing the surprise element, revealing your position, etc.

</comment></comment><comment><USER14> I'd settle for a really good vacuum cleaner. I've been holding out for years now. Shouldn't that problem be easier to solve? Killer robots always garner headlines but there are a still a few practical robots away from the real revolution. The real revolution happens once consumers enter the picture.

<comment><USER15> How much are you willing to pay for a robot vacuum cleaner? Because the armies are going to pay a lot...

</comment></comment><comment><USER16> I think the major concerns with "infantry drones" are signal hijacking/jamming and physical tampering - the latter could be remedied with a well designed body, as well as a fast self-defense system (a gun or at least a high power laser to quickly disable any approaching enemies)...

<comment><USER17> signal hacking could be mitigated by having them be truly autonomous. So they will still attempt to complete their mission without communication to the base.

Broadcasting a message also may compromise their location.

Maybe we'll start to see more weaponized EMPs.

<comment><USER16> Now there's a scary thought - truly autonomous... Soon the NSA facility in Utah will be fully automated _and_ impenetrable :-)

</comment></comment></comment><comment><USER18> Shouln't military throw a tanker of money at computer vision researchers right about now?

<comment><AUTHOR> Yes. [http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5...](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5596241)

</comment></comment><comment><USER19> I hope this will finally make farad (or even kilofarad) capacitors cheap and available. There is no better engine for innovation than arms race.

</comment><comment><USER20> \- General, Im proud to announce that after decades of research of our brightest scientists our country can make robots!

\- Great, now its just put a gun in their hands and teach them how to kill!

Total failure of the human kind: Technologically advanced morally corrupt

</comment><comment><USER21> DISASSEMBLE? NO DISASSEMBLE!!!

YOUR MOTHER WAS A SNOW-BLOWER!

</comment><comment><USER4> Because a robot with an automatic rifle is way scarier than a robot with a semi-automatic rifle.

<comment><USER22> doesn't matter if the robot is pulling the trigger - just like modern automatic gears are actually manual ones where a "robot" is the shifting.

streams of bullets are no longer necessary as accuracy goes up. why waste ammo on suppressive fire if you can simply headshot with high precision? spotting targets through visible and invisible spectrum plus audio? using large caliber rounds that penetrate brick walls, car doors, etc (7.62, 50cal, etc.). basically mount 2 barretts on a turret and wreak havoc.

<comment><AUTHOR> Only good reason I can think of is where multiple shots are required to weaken / overcome some kind of hardened defense. Of course, these things will be firing some kind of armor piercing / explosive / incendiary round, so that may not be a requirement. Or unless the psychological effect of a spray of highly- accurate bullets warrants the barrage.

<comment><USER5> "Only good reason I can think of is where multiple shots are required to weaken / overcome some kind of hardened defense."

If there's a simple window, you can kill everyone along the wall by a simple application of a high-precision-timed grenade. "Explode 50 cm behind the window" is simple to achieve these days: [http://en.wikipedia.org/wiki/XM25_CDTE](http://en.wikipedia.org/wiki/XM25_CDTE) , [http://www.youtube.com/watch?v=Fgh4uy5A-lI](http://www.youtube.com/watch?v=Fgh4uy5A-lI)</comment></comment></comment></comment>


Fit-PC2: smallest 6W Intel Atom PC - <AUTHOR> http://fit-pc2.com/wiki/index.php?title=Main_Page

<comment><USER2> Thanks! I'd forgotten about the fit-PC. I now have need for something small and miserly on power for home automation (and maybe another for an mp3 player in my car).</comment>


The Madness of Queen Shanley - <AUTHOR> http://www.breitbart.com/Breitbart-London/2014/12/10/The-Madness-Of-Queen-Shanley

<comment><USER2> Well, I'd not run across that particular harpy before. I can't say I feel deprived...

What a waste of brain cells and oxygen.

The article made many good points about how pointless and destructive her approach is.</comment>


Interviewing is Broken - <AUTHOR> http://www.stilldrinking.org/interviewing-is-broken <comment><AUTHOR> > _5) Bring them in for a few days, see if they can set up the dev > environment, assign them some bugs nobody else wants to fix, have them meet > everyone._

Not crazy about this suggestion. It's not always that easy to just take a few days off from your current job just to interview for another. Even if you're getting paid.</comment>