Are short-term home sellers screwed? - <AUTHOR> http://www.tenence.com/home-flipping-explained <comment><USER2> > Data tells the story: on average, if you sell your home within 90 days, > you'll do it at 15% higher than what you bought it for.

There's some selection bias here. Those who got lucky (e.g. they bought the house cheaply) found it easy to sell for a good price quickly. Those who got unlucky and couldn't find a buyer quickly are excluded from the "90 days" window so don't contribute to the statistic.

It might be true that homes sold within 90 days of purchase sold for an average of 15% higher than the purchase price, but it doesn't mean you can expect to sell a home within 90 days of purchasing it for 15% more than you paid.

<comment><USER3> If you haven't sold in 90 days, your price is to high. There is always a buyer at the right price.

As a real estate investor, I specially target homes going unsold after long durations on the market due to unrealistic expectations.

<comment><USER2> > If you haven't sold in 90 days, your price is to high

Right. So it's selection bias. The people who can get a price 15% more than they paid manage to sell within 90 days, the people who can't dont.

<comment><USER3> That's not selection bias, that's a functioning marketplace. Something is worth what someone will pay for it. If demand is increasing, prices increase.

<comment><USER4> The point that the op is making is that this is only looking at the "successful" trades. It is not looking at the set of "attempted" trades. So it is only looking a selection of the possible trades, and so there is a selection bias involved in the data set. This is very much a form of survivor bias.

It is likely that it also "only" includes those that managed to buy a house at under market rates, and sold at, or above, market rates within 90 days. Anyone who is buying to live in is likely paying as much or more as the "sale" price.

This is further stated in the market, since the annualised rate of return is 650%, but house prices are _not_ going up that quickly.

Which, in turn, means that distressed buyers are not necessarily going to see a 15% increase in the price of their house in 90 days, nor are they going to see a ~30% in 180 days, since their property may not be "undervalued".

<comment><USER3> Attempted transactions do not make a market. Completed transactions do.

<comment><USER5> No one is saying the market is wrong or the data is wrong. Just that the implications the author makes based on the data are unjustified.

</comment></comment></comment></comment></comment></comment></comment><comment><USER6> There is massive selection bias here. You are not showing how many homes were listed but didn't close. This is measuring only successes, not all the failures to sell.

Also you need to factor in realtor fees on both the original purchase and then subsequent sale (I do not know what they are in the UK, but in Canada they can 3%-7% of the transaction, and this exclude lawyer fees and mortgage discharge fees) which means that you need to get a certain percentage of "gain" in the selling price compared to the purchase price to make any real profit at all. If this was Canada, a good percentage of these so called "profitable sales" would actually be breakeven or slight losses.

Assume realtor fees of 5% on both the original purchase and the sale, this completely wipes out the profit of $168M on the $1.5B of sales. Hmm...

Strange article. It is like the author is not at all knowledgeable at all about how realestate works, or maybe UK is very different than Canada.

<comment><AUTHOR> Limited by data here unfortunately. The data source I'm using is Land Registry, which only shows successful deals. Regarding transaction costs, in the UK its around 1.5% for broker fees, plus moving and legal costs. There's also capital gains tax on profits generated on the sale, which is a complex mathematic, and applies if its 'not your first home'. And stamp duty (varies by price) which you pay on purchase.

I understand all of your points, and from what you're saying, with the fee levels you've described, it does sound like the UK is different from Canada.

<comment><USER6> 1.55B * 0.03 = 46M in realtor fees. This reduces the expected profit by 1/4.

</comment></comment></comment><comment><USER7> I'm not sure whether I understand (or trust) this analysis.

\- If I buy an house and resell it within a year, barring extreme circumstances, I'm probably a real estate investor/professional; maybe it's the fact that I was able to buy a property which I felt was underpriced, then maybe I did some minimal "rejuvenating" modifications, and sell it at a premium.

\- We don't see the negative data; how many properties were on sale and were not sold? We're very likely to introduce a bias, otherwise, because I suppose very few people would sell at loss, hence we see few sales at less than purchase price.

<comment><AUTHOR> Negative data would be very helpful, unfortunately its harder to get. The data I used was from Land Registry UK which only captures successful transactions.

<comment><USER8> Did you combine data from the 3 UK registries (England & Wales, Scotland and Northern Ireland)?

<comment><AUTHOR> The analysis is just for London

</comment></comment></comment></comment><comment><USER9> I really love articles like "are people who <do something totally ridiculous> screwd?" This gives the impression for these people that they are doing something totally normal, and that it is the world screwing them.

You never ever want to sell a home you live in short-term. You only do that if you really don't have another choice. It's probably your biggest investment. You probably bought a bigger home than you can afford. Sell it for what it's worth and invest the time. The costs of selling too quickly might be retiring at 55 years of age or at 65 years of age.

And if you decide to go the easy route anyway then it was you who screwed you. As said before being in a f*d up situation otherwise might be an exception. But it might also be a sign that you do in general not the sensible thing.

</comment><comment><USER10> Homes that resell within 90 days are fix & flips. Yes, they sell for a higher price, but there is also more investment put into them than just the purchase price.

<comment><USER11> > Homes that resell within 90 days are fix & flips.

That seems like an unwarranted assumption. How do you know any fixing was involved?

<comment><USER12> How do you know it _wasn't_? We basically have a _whole bunch_ of possible hypotheses here that the data/analysis here does not allow us to distinguish.

<comment><USER11> I don't know, and made no claim implying knowledge. The "what about" attempt (more formally _tu quoque_ ) fails.

</comment></comment></comment></comment><comment><USER13> Wait, we are supposed to ignore transaction costs? I kept waiting for them to be factored in, but it never happened. I have a simple reason for the 15% number — you need to make ~ that much to be breaking even!

Humans have strong loss aversion and it's common to come across properties where the offer price is clearly set at a point where the sellers will only be making their money back. You can make fair offers in this situation but we had them declined every time. This was most evident during the 2008-2010 housing bust when we had to look for 18 months for a house that was fairly priced — and after we bought, we got two calls from people we'd made offers to — offers which they declined — asking if we were still interested in buying at our offered price! In the case of one house I tracked, they ended up selling at over 10% below what we'd offered them!

Combine that with the lack of any kind of data on houses that didn't sell, and I would take this analysis with a hefty nugget of salt.

<comment><AUTHOR> You're right, I should do the math on trxn costs in my next update - the main ones are stamp duty on purchase and broker fees on sale. The minor ones are moving costs and legal fees on buying and selling. Capex I'll have to ignore because I have no data on this.

Still, if you assume the broker got paid say 1.5%-2.0%, the stamp duty was 3.5-4.0%, there's still a sizeable margin in between.

<comment><USER13> I don't know UK laws, but you also get dinged in the US on property taxes (pay half a year), home insurance (can't close without it), HOA fees ($500 selling our house this year despite our HOA being otherwise meaningless), warranty (not consistently required) and various local costs that are associated with the municipality or state — not to mention mortgages are deliberately designed to make their money even if you pay them early.

Again, I've never bought/sold in the UK, but in the US you could easily see $100K in costs on a transaction of ~$2M, and the percentages will go up as you move down market.

</comment></comment></comment><comment><USER14> A warning to those taking these numbers seriously. I had a go of Tenence service after reading and it's property valuation service gave Very dodgy results for my previous properties.

For my last property it gave the wrong square footage and it's valuation method is ridiculous. For example, sold 2010 £200k sold 2017 £400,000 -> valuation £300,000?

Valuing a property based on the average of previous sold prices regardless of time-scale is nonsense and needs to be fixed. If not, I am looking forward to buying that Mayfair townhouse last sold in 1930 for £1,000 ;-)

<comment><AUTHOR> Sorry about that, will look into this particular case and fix. For square footage we rely on EPC certificates which sadly are not always accurate.

<comment><USER14> Thats alright, thanks for taking a look at it. I can see why it is very hard to get a good reading of square footage. I was a bit too harsh in my last comment. The valuation algo however is concerning. Perhaps take a look at the Savills local house price indices, I know a number of valuation algos use that heavily alongside Land Reg data. Good luck!

</comment></comment></comment><comment><USER12> >on average, if you sell your home within 90 days, you'll do it at 15% higher than what you bought it for.

Uh, well, what I think this probably means is that people who _aren't_ going to make money _don't_ sell a property within 90 days. Even if they were buying it as an investment/flip, if they aren't going to be able to sell it for a ~15% profit... they hold on to it longer. Until they can.

Realizing this confusion of correlation with causation makes the rest of the "advice" in the article somewhat suspect too.

It's interesting findings, that there are significant numbers of owners managing to flip a house quickly for profit. But I'm not sure it can be extrapolated into a "what you should do".

</comment><comment><USER15> You should label your axes properly. You haven't defined 'price change' and 'gap' anywhere in the text, so we have to try to deduce the meaning from context. I'm still not sure if the units are percentage change or thousands of GBP.

</comment><comment><USER16> > If you can wait till year-end, then you're even better off

So .. why stop here? Isn't this just saying that since London houses are an extremely rising market, the longer you hold the more profitable it its?

</comment><comment><USER17> The relevant factor in short term asset holds is transaction costs. Whether you're buying stocks or houses. If you can account for them and make a profit anyway, you're making money. Generally you need a market edge to lean on.

But at the end of the day it's hustling in a zero-sum market. Holding on to your edge requires work. And doing the deals requires work. Not something you want to make a career out of if you value your sanity or free time.

</comment><comment><USER5> This story gives the impression that you can somehow magically make a profit by buying a house, waiting a few months, and selling it. This is completely ignoring the concept that most of the data is going to be from house flippers who don't just buy and sell houses, but renovate houses. If you are a professional who buys fixer-uppers that no one else wants the hassle of dealing with, then put a lot of money and work and skill into them, yes you have a good chance of selling it for more than you spent on it.

If you just buy and sell, and don't do anything to the house, you're very likely to lose money (when factoring in transaction costs) unless you really know what is happening in the market. People see what you bought the house for a few months ago, why would they pay more than you did? Also, as many others have mentioned, there is a lot of selection bias. People are less likely to sell if they have to sell for a loss, if they have to hold onto a property they _wanted_ to sell because they would lose money if they sold, they don't show up in this data.

</comment><comment><USER18> There's an obvious strategy here to make an infinite amount of money!

</comment><comment><USER19> What about property tax, which (AIUI) is paid in a big lump sum on purchase, and not annually like in the USA?

</comment><comment><USER20> [https://en.wikipedia.org/wiki/Selection_bias](https://en.wikipedia.org/wiki/Selection_bias)</comment>


Google ordered to remove anti-Islamic film from YouTube - <AUTHOR> http://news.yahoo.com/google-ordered-remove-anti-islamic-film-youtube-165609763--sector.html;_ylt=AwrBJR7wKg5TB2cAqR3QtDMD

<comment><USER2> It's worth noting that it was removed because it _grossly_ misrepresents what the people in the film would want to be associated with, and nothing to do with religion. This is akin to filming someone doing something wholly innocent and then dubbing it with hate speech without asking them if that's ok.

There's a strong argument that this is art, and consequently worth protecting to enshrine freedom of expression, but at the same time I can't imagine many people would be happy if they were the one in the film. I'd argue that it's not far from defamation as far as the actor is concerned.

<comment><USER3> This kind of legal deception is the basis of all Sasha Baron-Cohen movies and TV shows.

</comment></comment><comment><USER4> More like US court ordered Google to remove anti-Islamic film from YouTube...

"By a 2-1 vote, a panel of the 9th U.S. Circuit Court of Appeals rejected Google's assertion that the removal of the film "Innocence of Muslims" amounted to a prior restraint of speech that violated the U.S. Constitution."

</comment><comment><USER5> whoa, why can't they make a video with a person calmly speaking and not interrupt him with music?</comment>


U.S. Explodes Atomic Bombs Near Beers to See If They Are Safe to Drink - <AUTHOR> http://www.npr.org/sections/krulwich/2012/09/18/161338723/u-s-explodes-atomic-bombs-near-beers-to-see-if-they-are-safe-to-drink <comment><USER2> (2012), summarizing a 1957 report on a 1955 experiment.</comment>


Custom mechanical keyboards - <AUTHOR> https://scrapbox.io/MECHKEYS/ <comment><USER2> Looks like this is just a scrape of /r/mechanicalkeyboards.

In fact, my custom board is there.

[https://scrapbox.io/MECHKEYS/Mitosis_Anaphase:_full- custom_h...](https://scrapbox.io/MECHKEYS/Mitosis_Anaphase:_full-custom_hand- wired_build_with_Box_Navy_:_MechanicalKeyboards)

<comment><USER3> _eye twitching from OCD_

Aargh, that bottom key! Just switch the high keycap with the low one on the other side!

<comment><USER2> There's a reason it's like that: the right side has arrow keys, so I made them all G20. The left side has page up/page down so I made them both SA R3.

</comment></comment></comment><comment><USER4> I recently went through the trouble of getting a custom split layout mechanical keyboard machined. I have a write-up/buildlog here:

[http://www.csun.io/2018/07/16/custom-mechanical- keyboard.htm...](http://www.csun.io/2018/07/16/custom-mechanical- keyboard.html)

<comment><USER5> Really cool. Why did you choose home on the right and end on the left?

<comment><USER4> Thanks! I think of it as moving my finger in the same direction as the cursor, which ended up feeling the most natural during typing.

</comment></comment></comment><comment><USER6> I recently purchased a low-profile mechanical keyboard with low key travel (Havit tenkeyless) and it's been amazing (I've always disliked how high profile and long key travel cherry switch keyboards have). The switches feel great but build quality on everything else seems lacking. I'm tempted to buy a half dozen of them in case they are discontinued. Does anyone know of other keyboards similar to this one? Thought it would be useful to ask here. Thanks.

<comment><USER7> You talking about the 87 key one? Its so awesome because it fits in my bag and I can travel with it.

As far as being discontinued, the low-profile switch is made by Kaihl and is still fairly new I think so I hope maybe more companies will start building keyboards with them.

<comment><USER6> Yes that's it!

</comment></comment></comment><comment><USER8> I love mechanical keyboards, and as a tinkerer the concept of making a custom one really appeals to me.

That said, the fact that the main page loads up dozens of multi-megabyte "thumbnail" icons is absolutely baffling.

<comment><USER9> This is really not out of the realm of a dedicated hobbyist.

The switches and keycaps can be ordered from quite a few vendors.

Also, custom circuitboards are no longer difficult to design or produce in small quantities (especially separate left/right boards).

Use a Teensy to wire it together as a USB HUD device.

3d print the case.

<comment><USER10> Shameless plug for my own custom keyboard firmware project: [https://github.com/dhowland/EasyAVR](https://github.com/dhowland/EasyAVR)

Works with the Teensy

<comment><USER11> Thanks for linking this, I'm actually in the design phase of this project right now so the timing couldn't be better. I'm going to try it some time this week.

</comment></comment></comment></comment><comment><USER12> I was just talking to a coworker about mechanical keyboards, and how it feels like a right of passage at this point to transcend into full techie. Like picking a side in Vim/Emacs. I'm thinking about getting one, /r/mechanicalkeyboards has a buying guide, I'm thinking about buying this budget one to see what its all about: [https://www.amazon.com/Mechanical- Keyboard-68-Keys-Magicforc...](https://www.amazon.com/Mechanical- Keyboard-68-Keys-Magicforce-Qisan/dp/B01E8KO2B0)

<comment><USER13> If you work in an open office or share a workspace your co-workers will hate you. No one wants to listen to machine gun fire while your neighbor types animated gifs into slack.

<comment><USER14> I own a mechanical keyboard, and I have the displeasure of working in an open office space. Two things:

1\. The keyboard really isn't that loud. I've used this keyboard for well over a year, and have yet to have had any complaints about the noise; compared to other noise sources (any conversation, the jackhammers outside my office, occasional city noises), the keyboard is quieter. It's also the sort of "noise" in my opinion that is easy to tune out, as opposed to stuff with signal, like nearby conversations/meetings.

2\. Hate towards such owners is misdirected. The problem is the open office layout, not the keyboard.

Now, I also have quieter switches (Cherry MX Browns, I think).

<comment><USER13> I'm not sure if that's true. Yes open offices are horrible. Even offices with cubicles (semi-open), or offices where the doors are open. I have several neighbors who built their own keyboards or bought mechanical ones and it drives me crazy. They are loud and distracting. But Ive never mentioned it to them. Why? It's a pointless disagreement in the workplace. One of those pick your battles scenarios, so even though you've had no complaints doesn't mean it's not an issue.

</comment></comment></comment></comment><comment><USER15> As an ergonomic nut I have to recommend the kinesis edge gaming keyboard. Most mech keyboards are just fancy design plus mech keys.

The kinesis lets you find the best horizontal distance apart and change their tilt from center.

It's not that attractive, but it's great from an ergonomic perspective.

<comment><USER3> Personally I don't find anything with a staggered layout ergonomic. It's better than standard though. I've gone totally ortholinear now. Ergodox at home and Truly Ergonomic at work.

</comment></comment><comment><USER16> This got my hopes up about something I was just talking about a few days ago [0]. However, this does not seem to be custom bespoke keyboards, but rather DIY keyboards. It also seems to be limited to mechanical key switches with the bulky key caps. I'm not too interested in building my own keyboard, but I do see the appeal. Some of these are truly works of art.

[0] [https://news.ycombinator.com/item?id=17563058](https://news.ycombinator.com/item?id=17563058)

</comment><comment><USER17> I own both a kinesis freestyle 3 keyboard (split and wireless) and the Microsoft ergo sculpt keyboard.

The ability to combine the ergonomics of both would be great.

</comment><comment><USER18> I wonder if fancy split keyboards are actually getting popular, or if all split keyboard owners are posting pics on the internet.

<comment><USER19> Manufactured or pre-made split keyboards aren't cheap. However if you're making your own the costs aren't all that different. So it's easier to ignore the cost and effort if you're making a split keyboard. Also by definition, you're talking about someone willing to go down the less beaten paths.

I would love for split keyboard to become more mainstream. They're far superior to the traditional key layout. But if the sample set is customs, it's probably selection bias.

</comment></comment><comment><USER20> Now if there was only a place that sold custom keycaps. Actual keycaps, not stickers.

I'd love to have my Open-Apple and Closed-Apple back.

Or a comma to replace my F19, which is currently mapped to comma.

Or maybe a pair of proper "Meta"-labeled keys again.

Or replace Function-Control-Option with Meta-Super-Hyper like those old Symbolics keyboards.

<comment><USER21> If you can deal with not having instant gratification, Massdrop [0] has group buys of custom keycap sets, which are designed by members of the community.

[0] [https://www.massdrop.com/buy/massdrop-x-admgc-sa-green- scree...](https://www.massdrop.com/buy/massdrop-x-admgc-sa-green-screen- custom-keycap-set)

<comment><USER20> Sign up for an account to even browse the web site? No thanks.

</comment></comment></comment><comment><USER22> Nice! My mechanical keyboard wishlist item is for an ortholinear keyboard that has a full set of rows including number keys and function keys, so that I can play Starcraft 2 on it. :)

</comment><comment><USER23> Are there any custom keyboards which allow creating Unix layout? Especially with Escape in second from top row, and Backspace in third from top?

<comment><USER10> Pretty much all of them are fully programmable. So you can swap Caps Lock with Ctrl, move Esc to the grave key, and put backspace on the backslash key. If you want to customize the actual size and position of the keys, then that is harder to find.

<comment><USER24> Most maybe, but nowhere near all. The two I have offer only limited customization through a set of DIP switches.

<comment><USER2> This page shows mostly full-custom keyboards, which you have to compile the firmware for yourself. Naturally, that affords ample customization.

</comment></comment></comment></comment><comment><USER25> I've been thinking about doing this for a while. And I LOVE the fact that the whole first page is mostly egonomic/split.

</comment><comment><USER26> what would be really cool is a bloomberg mech keyboard with the green and blue keys. but i think the pcb is proprietary.

</comment><comment><USER27> How does one go about building a custom mechanical keyboard? Are there any good resources to get started? I've long fantasized about building a standard- layout keyboard with a couple of extra unobtrusive shift/modifier keys.

<comment><USER28> Get yourself a switch tester [0], find a layout you like (or handwire your own [1]), and compile your own firmware [2]. The r/mk wiki has a great page [3] for starting to build your own.

[0] [https://www.amazon.com/KBDfans-Mechanical-keyboard-Tester- sw...](https://www.amazon.com/KBDfans-Mechanical-keyboard-Tester- switches/dp/B07BTMWJ92/)

[1] [https://geekhack.org/index.php?topic=87689.0](https://geekhack.org/index.php?topic=87689.0)

[2] [https://qmk.fm/](https://qmk.fm/)

[3] [https://www.reddit.com/r/MechanicalKeyboards/wiki/customkeyb...](https://www.reddit.com/r/MechanicalKeyboards/wiki/customkeyboards)</comment></comment>


What is your favorite popular link aggregator? - <AUTHOR>

<comment><AUTHOR> With the nearly endless supply of interesting links from del.icio.us, digg, reddit, news.yc, etc, do you use one of the popular link aggregators to stay on top of what's hot? So far I've come across three that look interesting: popurls <http://popurls.com/> theweblist <http://theweblist.net/> and trendalicious <http://glozer.net/trendy/> I really like the mix of textual and visual links on popurls, but my favorite is trendalicious because it combines links from del.icio.us, digg, and reddit into one "top 100" list. Just wish it included news.yc too!

</comment><comment><USER2> Over 90% of everything I read on the web comes from <http://originalsignal.com>

A truly great site.</comment>


Ask HN: Simplified C? - <AUTHOR>

Can you please recommend a 'simplified' C, if it exists? By 'simplified' I mean a 'cleaned up' subset of C which would (ideally) compile on a standard C compiler but avoids some of its syntactic/semantic darker corners. <comment><USER2> If you are looking for a simplified C but still want it to compile on standard C compilers, just don't use the features you don't like. Out of curiosity, to which syntactic/semantic corners are you referring?</comment>


Wealth, Health, and Child Development: Evidence from Swedish Lottery Players - <AUTHOR> http://qje.oxfordjournals.org/content/131/2/687.full <comment><USER2> _our findings suggest that in affluent countries with extensive social safety nets, causal effects of wealth are not a major source of the wealth-mortality gradients, nor of the observed relationships between child developmental outcomes and household income_

Pretty much the same as in the 19th century US:

 _Sons of winners have no better adult outcomes (wealth, income, literacy) than the sons of non-winners, and winners ' grandchildren do not have higher literacy or school attendance than non-winners' grandchildren. This suggests only a limited role for family financial resources in the transmission of human capital across generations and a potentially more important role for other factors that persist through family lines._

[https://www.nber.org/papers/w19348](https://www.nber.org/papers/w19348)

<comment><USER3> You know, since lotteries are run by states, could they not somehow require as a stipulation of taking the prize winners must also simultaneously and compulsorily have to take financial planning education courses at an additional 25% penalty for not attending, for winnings over double median household income? Including lessons on rebuffing close and distant relatives.

<comment><USER4> This really assumes that financial planning is the issue. It's a symptom of the problem. The winners of the lottery are ill equipped to pass on the life skills for success, because generally they don't have them. While tons of people gripe about the accumulated wealth of the upper class, there is some socialization in upper class families that sets the children up to succeed -- it's not just an increased access to connections.

I say this as someone who lived in a four person family that lived on a single welfare check for years. There is a huge cultural difference between those who are systemically poor, situationally poor, and the upper class.

Learning upper class behaviors -- and unlearning my 'poor person' behaviors -- has had an immensely positive effect on my life and the way that I handle situations.

<comment><USER5> > There is a huge cultural difference between those who are systemically poor, > situationally poor, and the upper class.

I'd be interested to read more of your thoughts on this based on your observations.

<comment><USER4> Sure thing! I won't go too in depth, but I was just talking about this with my wife a few days ago.

My dad came from a family of systemic poverty. Money was something to be spent. Ironically, he was in charge of saving money for our family, which understandably went poorly. He tanked nearly all of our money in the dot com boom.

One of the biggest things that stands out to me in retrospect was how little respect he had for his body, especially as a manual laborer. Rather than trying to preserve the resource that he used to make money, he broke his back (doing absolutely dumb things) twice. At this point he was functionally unable to work, and became a stay at home parent because it was the only option left to him. There was no backup plan. He'd dropped out of high school to go to Vietnam, and hadn't saved money in a safe way in case of a catastrophe -- even after one had already struck. Rather than a safe, well diversified plan, all of our money that was not immediately spent was put into tech stocks. And then the dot com bubble hit.

People who are systemically poor are more likely to be content with a good gig, even if it is not sustainable. They are less likely to hedge against risk in this situation as well.

This showed in other areas as well. For example, he'd lost all of his teeth by 40.

My mother on the other hand was situationally poor -- her father's family had a good bit of money, but he passed away very young leaving her and her two siblings with a single mother, who worked in public schools. My mom pursued a degree in journalism, while her brother went into tech. While in school, she dropped out to become an administrative assistant for a large uranium company that was paying more than she was looking at as a journalism grad.

People who are situationally poor are willing to take low risk opportunities with a good reward (take a job that pays more, leave school -- if it works then that's great, if not then you head back to school with more money as a buffer). They are less likely to make a career out of things that use your body as a resource, as such careers are usually unsustainable.

Upper class people I've met are far more likely to take high risk opportunities, even without a buffer. A decision my wife and I made that I think is a more 'upper class' decision was moving to Seattle without much of a financial buffer and no jobs, because we thought it had a very good chance of being the best payoff for our degrees. It's a decision that has accelerated both of our careers and earnings immensely.

Upper class people network. A lot. While they are born into connections, I'm shocked at how few people (myself included) have not picked up the networking skill.

Upper class people are also more likely to understand that their brain/body is a resource that needs to be taken care of to have personal and economic success. For instance, attitudes towards consumption of media, food, and learning materials is something that is shockingly different.

There's a reason why when you read about the success that upper class people have had, there's usually very little mention of television, and an extreme amount of "i used to read a lot."

I considered myself to be someone who read a lot, and compared to my peers I did, but when I'm hanging out with people who grew up in this culture, I'm simply unable to keep up with the amount of references that they make.

There's more, but this has gone on for longer than I was expecting it to, and of course it's all just my opinions and observations.

<comment><USER6> A follow-up to this that I thought was profound. I have told this story here before but it really relates. I was once on a train in Europe and lucked into an upgrade to first class. The food car was in the back and I wanted a sandwich, so I walked through business and economy class to get food. In business class, everyone without exception was reading non-fiction, news or working on a laptop. When I walked through economy class, everyone was either watching TV/Netflix, reading magazines or fiction. With one or two exceptions. I thought it was a pretty profound difference that probably alone could explain the inevitable income differences between who was sitting where. I recognize that it makes sense those in business class would work, but... it was Saturday.

<comment><USER7> You got me curious as to what was being read/watched on first class.

<comment><USER6> Only a few of the fancy private cars but it seemed like people were just hanging out talking to each other.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> This seems to be arguing that since sudden windfalls don't make people better off, money is not the deciding factor in various markers of high quality outcomes in life.

Yet there is a huge difference between someone who was born to "wealth" and someone who won, our whose parents won, a lottery. And many of those differences specifically relate to safeguards that protect and grow a wealthy- person's wealth.

Various differences between the "wealthy"and those who just happened to come upon a large windfall of money:

* The wealthy usually have an (often inherited) network of financial advisors, people investing their money, and lawyers, all of whom stand between them and bad decisions

* The wealthy are typically surrounded by a culture that has always been rich, so has always been able to afford universities and good health, and so can afford to value these highly

* The wealthy are usually surrounded by other wealthy people, who are not usually expecting (justly or not) financial favors (e.g. a brother who needs medical debt paid off)

* The psychological difference between growing up rich or working for a high salary, versus a sudden unexpected windfall our of the blue, must be immense.

Clearly there are differences between lottery winners and those who are wealth by other means, so you can't take the former, see that their life outcomes don't improve, and conclude that money over all doesn't have an effect on these measures. Just that lottery money doesn't.

<comment><USER9> I think you've badly misunderstood the paper and its results and are taking some sort of Occupy Wall Street mindset... The 'gradients' the paper is talking about are not exotic gradients which apply only to the general population vs the 1% of the 1% who get into an accident in their Lamborghini and call their dad in the Bahamas who deploys a crack team of white-shoe lawyers to ensure he never appears in court; it's talking about the health gradients you see when you compare the first decile of income nationally to the second decile, the second decile to the third, the fourth decile to the fifth, and so on. (AFAIK, the Swedish administrative data doesn't even give access to the 1% as they topcode or withhold access to their data.)

You see health differences no matter who you define as 'richer' or 'poorer', throughout the general population, in ordinary people. Yes, in the normal people you pass on the street, who have no 'financial advisors' other than their uncle who has some hot stock tips (although I suppose he would count as 'inherited'), who have no 'people investing their money' unless they are unusually prudent and have some Vanguard savings, who are not 'able to afford universities and good health', and so on. The person making $5k a year is less healthy than the person making $20k a year is less healthy than the person making $50k a year, and so on. Where are the monocles and secret cultural rituals there? None of these people 'grew up rich', so you should still see benefits when the $20k person wins a few thousand bucks in the lottery, if the causal effect here is through the money. But you don't.

</comment></comment><comment><USER10> Scott Alexander wrote up a fantastic analysis of this and two more articles: [http://slatestarcodex.com/2016/06/14/three-more-articles- on-...](http://slatestarcodex.com/2016/06/14/three-more-articles-on-poverty- and-why-they-disagree-with-each-other/)

</comment><comment><USER11> Related podcast: _Would a Big Bucket of Cash Really Change Your Life?_

[http://freakonomics.com/podcast/would-a-big-bucket-of- cash-r...](http://freakonomics.com/podcast/would-a-big-bucket-of-cash-really- change-your-life-a-new-freakonomics-radio-podcast/)

</comment><comment><USER12> I would expect this exact same outcome being Sweden. Being a country with a very good social safety net and low income inequality it stands to reason that a big increase in wealth wouldn't affect the health care and education of children since that role is already well taken care of by society.

It would be more interesting to see this study in a county with low social net and great income inequality like the USA or in a poor county.

</comment><comment><USER13> TLDR?

<comment><USER14> It's in the abstract of the paper, but essentially this is a study of Swedish lottery winners which finds that winning the lottery doesn't make them or their children any healthier, better educated, or more pro-social.</comment></comment>


DuckDuckGo Searches Are Not Anonymous - mike-cardwell https://secure.grepular.com/DuckDuckGo_Searches_Are_Not_Anonymous <comment><AUTHOR> In the settings, <http://duckduckgo.com/settings.html>, you can turn on POST requests as well as disable favicons and 0-click. Switching to POST alone should fix this issue for you. In particular the Referer heading then becomes:

Referer: <https://duckduckgo.com/>

<comment><USER2> how about you set up a separate domain (e.g., supersecretduck.com) where all the options you mention above default to their paranoid settings?

<comment><USER3> If that separate domain can be used in the Chrome URL bar, count me in. Thought it would be even better if it could be done using the main URL in the Chrome URL bar somehow...

<comment><USER4> If the domain exists it can be used in the Chrome URL bar. Any search engine that puts its queries in the URL can be added manually to Chrome.

<comment><USER5> The whole point of using POST is to remove the queries from the URL, though.

<comment><USER6> In Opera, when setting up search engines [which can be used directly in the address bar], you have the option of using POST instead of GET.

</comment></comment></comment></comment></comment></comment><comment><USER7> Good catch, really. Trivial to fix fortunately. Not that I care too much about super secure secret searches, but if they're advertised as such they should be. And even then, you probably should assume they're not. (secret).

<comment><USER8> I can't figure out what the trivial fix is. Would proxying all S3 requests through his server fix the issue, or do the headers get passed through to Amazon anyway?

<comment><USER9> One fix is to not directly send the users to the result page. Instead link to a redirect script on the ddg servers i.e, duckduckgo.com/goto.php?link=<http://search-result.com/> and then have goto.php remove the REFERER from the request headers.

<comment><USER7> Not sure if that will work in all browsers, iirc a 301 or a 302 can still pass those headers on. The only trick I know of that will not do that is by using a 'meta refresh' with a time set to '0', but that has bad implications for the working of the 'back' button.

<comment><USER9> I haven't tested this out, but I don't see why something like this wouldn't work...

<?php

       header("Location: the-result.com");

       header("Referer: ");

?>

<comment><USER7> Referer is a header the browser sends, Location is a header the server sends. Also, the Location header needs either a relative url on the local machine or a fully qualified one. In this case it would have needed a fully qualified one.

So maybe you should have tested it ;) ?

</comment></comment></comment></comment></comment></comment><comment><USER10> If super secret squirrel searches are your need, you may wish to look at things like, disabling Referrer, Tor, Disabling Flash completely (as it represents it's own version of a cookie), disabling cookies, regularly DBANing your system, and even then realizing that you are still screwed according to EFF's research in their Panopticlick project (<https://panopticlick.eff.org/>)

<comment><USER11> True. torbutton does a lot of that, however, so if you enable it and completely disable javascript you can get your browser uniqueness down to about 1 in 1500

</comment></comment><comment><USER12> The heck are you talking about?

Sure, Amazon S3 could be spying on your searches just like any web host (especially a cloud host) could spy on connections to its customers' sites. I don't think this is very likely, however.

Nothing shown in this blog post indicates that DDG's S3 account is logging IPs or that there's anything at all wrong with the privacy policy.

<comment> mike-cardwell You misunderstand. The images are being served from Amazons web frontend to S3. They probably log the requests, not for "spying" reasons, but simply because that's what people tend to do when serving websites; log the website requests that are made against it. Because they do that, a government could contact Amazon and ask them for the data.

Knowing that, DDG may as well log the IP+Search themselves, as it makes no difference. The data is already logged and retrievable by contacting Amazon, therefore what is the point in DDG not logging it anyway?

</comment></comment><comment><USER13> Isn't this sent by the user's browser, and not by DDG? It's a client-side configuration issue -- turn off referrers in your browser. Your browser would send the same header if you clicked through a DDG search result.

<comment><USER7> It is a duckduckgo issues because they should not be loading third party graphics. The referrer will be on in almost all cases. People just look at the 'lock' item and will assume they're safe.

Whatever happened to that 'mixed content' security warning, I thought that was pretty effective against stuff like this?

<comment><USER14> Because complaining about "mixed content" was completely pointless in the general case -- you could mix content across multiple https sites, but the certificates were never correlated, and the second site would still get all the headers just the same.

It's extraordinarily user-hostile, and would just add to the pile of pointless wankery that keeps people from using https (see also: shitting all over self- signed certs when in reality the CAs don't do shit for their rent and identity is useless anyway).

The actual solution is to never send Referer headers for cross-site requests from an HTTPS page.

<comment><USER7> > The actual solution is to never send Referer headers for cross-site requests > from an HTTPS page.

That should be on someone's todo list at the major browser vendors. You're right, there really is no point in sending that header along, and sending it can cause all kinds of trouble.

</comment></comment></comment></comment><comment><USER15> "First they ignore you, then laugh at you. Then they fight you. Then you win." (Gandhi via Robbie Williams)

Rightly identified and well addressed by epi0Bauqu. And also worth noting that this sort of constructive criticism is a great sign of positive market traction. I'm bumping into DDG more often on the web, which is excellent.

</comment><comment><USER16> POSTs and HTTPs are good, but here's a few other ideas:

1) Embed the images in iframes, which are then embedded in the page. The iframes will swallow the referrer, so provided they are hosted somewhere where logs are discarded then it should be fine (I'd want to cross-browser test this before relying on it though).

2) If the browser supports data: URIs, then embed the image in the page. Obviously this might have some costs, but you could do it for HTTPS only perhaps?

3) Request the images in Base64 encoded form (or binary strings) via XMLHttpRequest after the page has loaded. You can overwrite the Referrer header in XMLHttpRequest

4) Preload the images BEFORE the search is done (ie, on the search page). With appropriate headers Amazon won't see a request (this won't work from the browser bar, though. I could imagine some ways around that, but I'm not sure they are worth it)

<comment><USER17> > 1) Embed the images in iframes, which are then embedded in the page. The > iframes will swallow the referrer, so provided they are hosted somewhere > where logs are discarded then it should be fine (I'd want to cross-browser > test this before relying on it though).

https will swallow referer automatically.

<comment><USER16> Which is why I said "..HTTPS is a good idea".

There are valid reasons why serving everything under HTTPS isn't always a good idea. The obvious one is CPU cost, but cache performance can also be affected. See, for example: [http://blogs.msdn.com/ieinternals/archive/2010/04/21/Interne...](http://blogs.msdn.com/ieinternals/archive/2010/04/21/Internet- Explorer-May-Bypass-Cache-for-Cross-Domain-HTTPS-Content.aspx)

<http://blog.pluron.com/2008/07/why-you-should.html>

(I'm not saying that https isn't the best option. I'm just pointing out other options that can work with plain http.)

</comment></comment></comment><comment><USER18> Almost all web servers keep a log of HTTP requests if only to weed out troublesome pests.

The worry is not that the information is sent. The headers, IP address, and search query is always sent to any search engine regardless of their privacy policy or whether it's sent as POST or GET, so the worry is not that information is being sent, but rather that the query string in GET requests is most likely kept in a log file at least for a few days.

If Duck Duck Go was upfront about how long this HTTP request log was kept, would that make the default search with GET requests acceptable? I think having search queries sent by default as POST would be irksome for a default setting.

</comment><comment><USER19> This isn't DuckDuckGo's fault.

People serious about privacy will be using a proxy with flash/javascript disabled and headers scrubbed.

</comment><comment><USER20> The complaint is that the search terms could potentially be logged.

"They certainly could log that information if they wanted to."

This is a problem with ANY site and ANY system that I know of.

<comment> mike-cardwell They basically say:

"We don't log your IP address with the search term"

As it stands, they should append this to the end:

"but the architecture of our site lets Amazon log it."

<comment><USER21> >As it stands, they should append this to the end:

>"but the architecture of our site lets Amazon log it."

This is the best suggestion yet. Of course there are numerous hacks possible to make it more secure, but each one at the cost of user experience. DDG has so many things going for it, I don't think for the majority of users security is at the top of their list.

<comment> mike-cardwell Do a http redirect to a url which has an encrypted version of the search term in the url parameters before displaying the search results. That fixes the problem without hitting the user experience.

</comment></comment></comment></comment><comment><USER22> Well doesn't duckduckgo use other search engine's results and combines them with its own? Or does that not involve sending the search terms to the other search engines?

<comment><USER7> Yes, but then it is duckduckgo.com doing the query. Here they're passing on the query in the referrer string and the users original browser makes the non- secure request to amazon.

That sort of gives it all away.

So if duckduckgo would just send back the answers to the query and not use a page that requests resources from third parties they'd be fine.

<comment><USER13> Except if the same user clicked through to a result, the server of the result page would receive the same referrer header w/ the DuckDuckGo query in it.

<comment><USER7> Not if he makes the 'POST' option the default for secure searches.

</comment></comment></comment></comment><comment><USER23> Once again, bad defaults == class A bug.

Well exposed.</comment>


Watch and stream live mobile video games with 1s latency - <AUTHOR> https://stre.am <comment><USER2> Is it just me or is 1s latency terrible?

<comment><USER3> Its actually incredible. Twitch the leading giant in video game streaming as around 10s latency.</comment></comment>


The Next Steps for Single Ownership and RAII - <AUTHOR> https://vale.dev/blog/next-steps-raii <comment><USER2> Hm. That's an interesting approach. The constraint reference encapsulating a ref counter is useful.

The "destructors with parameters" are interesting, but it's not clear what prevents using the object (or trying to) after destroying it.

None of this seems to address locking. The trouble with locking in C-type languages is that the language has no idea what data the lock covers, and thus it's hard to do an analysis for race conditions.

 _" We made two tiny classes, Request and RequestHandle. Each had only a pointer to the other. When one was destroyed, it would reach into the other to null out the pointer, thus severing the connection."_

I've wanted something like that for Rust. Rust has problems with back references in trees and lists. There's no safe way to do those. What you need for a back reference is something like what Vale has there. The back reference has to be a non-owning optional reference. The only allowed values which can be assigned to it are the owner and None. Changing the ownership implicitly sets it.

(This is one of the two big safety holes in Rust. The other is partially initializing an array. There's no way to say to the language that "0..N of this array are initalized". So "Vec" has to be unsafe. If both of those holes were plugged, there would be far fewer excuses for "unsafe")

<comment><AUTHOR> Thanks!

There are three things preventing someone from using the object after destroying it:

       * If it was an owning reference, the compiler will ensure nobody else uses it.
       * The program will halt if there are any live constraint references to an object we destroy, preventing anyone using one of those.
       * If it was a weak reference, the language will (conceptually) null that out when we destroy the object.

Locking goes deep into Vale's concurrency story, but I can try to sum it up:

       * By default, an object can't be visible to two threads, every thread has its own isolated region (similar to Pony and Rust).
       * We can use a mutex to contain a region, and Vale's "region borrow checking" can make sure references don't escape the lock's duration.

I'm curious about that second safety hole Rust has. I don't think Vale has that same hole, as we initialize every array with a size and a lambda, and there's no opportunity to stop it halfway through (well, our form of "exceptions", involving pure functions or rollbacks, could stop it and keep everything safe), you can see an example in our little roguelike sample [1] on line 415.

[1]: roguelike.vale, [https://github.com/ValeLang/Vale/blob/9541d414ce6b1c2745de19...](https://github.com/ValeLang/Vale/blob/9541d414ce6b1c2745de19f1335e4f213cae32cf/Midas/test/tests/roguelike.vale#L415)

<comment><USER2> _I 'm curious about that second safety hole Rust has._

All variables are supposed to be initialized before use. But a Rust Vec, like a C++ std::vector<T>, has both an in-use "size" and a usually-larger pre- allocated "capacity". This allows adding elements without getting a new memory block.

Implementing Vec safely in Rust runs into the problem of initializing the capacity not yet used. Not initializing it is unsafe, so Vec has to have "unsafe" code.

I'd argue for this:

First, data types should be divided into "fully mapped" and "not fully mapped". A fully mapped type is one where all bit combinations are valid. Fully mapped types don't have to be initialized to be memory-safe. This includes integers, floating point on most systems, but not booleans. (C++ calls this "plain old data", or POD, but allows Booleans and enums. Whether Booleans with values other than 0 or 1, or out of range enums, should be considered "plain old data" is a good question for a language designer.)

If it's not fully mapped (worst case, it has a pointer or reference in it), what do you do about uninitialized data in the unused "capacity" area? If it's not initialized, you have a pointer with a junk value, as far as the language is concerned. If it has to be initialized, you have a problem if initialization requires an input value.

So I'd argue for the concept of a partially initialized array as a language feature. For simplicity, only being initialized from the beginning to a limit (0..N) should be supported. (Yes, there is such a thing as a giant sparsely initialized hash table where allocation info is stored outside the table. See Google's sparse hash table. That's very rare.) The idea is that you designate some field of the structure as the "size", and accessing beyond "size-1" is a subscript error. But you can initialize at "size", and this increases "size" by 1. You can decrease "size" if you own the whole object.

If you have both of those features in a Rust-like language, you should not need "unsafe". Except to call other languages, maybe.

<comment><USER3> I don't think you can have a "fully mapped type" the way you describe it. Uninitalized memory in today's compilers do not have an observable value.

[https://www.ralfj.de/blog/2019/07/14/uninit.html](https://www.ralfj.de/blog/2019/07/14/uninit.html)

<comment><USER4> The compiler's representation of an uninitialized lvalue might not be observable as the article describes, but an uninitialized heap allocation from the OS (i.e. malloc()) is observable by design.

Of course a language and its clever implementation can make reading unintialized values from malloc()'d objects UB with all that implies, but that's a spec choice.

So I believe you could define what's returned by malloc() as safely castable to one or more "fully mapped types", which would solve the problem for vectors at least of those types.

<comment><USER2> Yes, you need to be able to at least do that, for big I/O buffers and such. Those are usually raw arrays of bytes, so no problem there.

The problem I was discussing is with growable arrays, where the memory underneath is partially initialized.

</comment></comment></comment></comment></comment></comment><comment><USER5> Interesting work! When I read it, I came away with the impression that vale provides guarantees like Rust, except that you get runtime errors rather than compile time errors, and that the guarantees for thread safety are weaker.

It's likely these are well motivated design decisions since you designed this with knowledge of Rust. As a programmer relieved by the transition from C++ to Rust, going back "halfway" in the direction of C++ will be a hard sell, even if it makes some things easier.

<comment><USER6> Not the author, and still new to Rust, but I think this approach is interesting in Rust as well.

Consider visiting a tree:

        enum Tree {
           Branch(Box<Tree>, Box<Tree>), // left, right
           Leaf(i32)
        }

        fn postorder_visit(t: &mut Tree, f: fn(&mut Tree)) {
             // ???
        }

A recursive implementation of `postorder_visit` is trivial but risks stack overflow. A heap-allocated stack (say, `Vec<&mut Tree>`) runs into problems with the borrow checker, which knows about the C stack, but not _your_ stack.

So an overflow-safe implementation must use unsafe, but still wants to have confidence in ordered destruction. You could make it a `Vec<*mut Tree>`, but now there are zero checks!

The idea here is, in debug mode only, replace `Box` with `Rc` that checks its refcount upon drop, and `&mut Tree` with Rc as well. Now your debug mode does not require unsafe, and your release mode is fast. You have dynamically enforced ownership in a regime inaccessible to the borrow checker.

<comment><USER7> Since I'm still starting out with Rust, there's probably just something I'm missing here, but couldn't you easily solve that with `Cell<T>` or `RefCell<T>`?

<comment><USER6> I hope to see an expert answer to this question. In my lame attempt, Cell was too awkward and RefCell was also awkward with a side of runtime cost.

</comment></comment></comment></comment><comment><USER8> > When one was destroyed, it would reach into the other to null out the > pointer, thus severing the connection.

How does this deal with concurrency? Must you now always use mutexes when handling this kind of pointers?

Also the discussion about destructors having a return value or taking arguments forgets to mention a simple trick: an rvalue-reference qualified member function. To call it you must use std::move() on the object. Linters can then warn about use-after-move. That method can do the real work of destruction while the destructor can be quite trivial.

<comment><AUTHOR> Great question! In C++, yes. When I did a clasp in C++, I had a mutex on each side, where the "primary" one locked its mutex then locked the other, and the "secondary" one would instead lock its mutex and _try_ -lock the other. Then, it would sever the pointers in both.

Vale, like Rust, isolates its threads' memory regions from each other, and also allows borrowing from mutexes. (Vale will use region-based borrow checking rather than Rust's object-based kind)

You're quite right about the rvalue-reference qualified member functions! There's one hiccup though; it can't be used with unique_ptr. I think theres an obscure note in the article that mentions that C++ could use Rust's "Arbitrary Self Types" to really close this hole. At that point, C++ might be able to have this kind of improved RAII!

<comment><USER9> Rust does not provide any specific isolation between threads' memory. You can Send an &mut T to another thread, and it will be able to mutate your memory.

<comment><USER10> > You can Send an &mut T to another thread, and it will be able to mutate your > memory.

Mutable references are exclusive. If you Send an &mut T to another thread then it isn't really _your_ memory any more—you can't read from it or write to it unless the other thread somehow Sends the reference back.

<comment><USER9> If it gets sent back or if it ends execution, which releases the &mut T, and the borrow. It isn't your memory _temporarily_. If it was forever, you'd be passing ownership, not a reference.

<comment><USER11> In other words, Rust provides the isolation that was originally mentioned.

That there are mechanisms by which the isolation boundary can shift does not change that.

<comment><USER9> I guess we're arguing about definitions :) nothing about this is specific to threads, and to me, thread isolation means that threads are forbidden from writing to each other's memory entirely. Maybe my understanding of the definition is idiosyncratic!

<comment><USER10> I think the point that verdagon was making regarding "isolation" was that the Rust ownership and borrowing rules prevent any _concurrency_ issues from arising. At the OS level threads, by definition, share all their memory—that's the primary factor that distinguishes them from processes—so it doesn't really make sense to talk about memory belonging to a particular thread at that level. Most other languages do not have that level of isolation and would not actively prevent multiple threads from accessing the same mutable memory location.

In one sense it's true that in Rust terms the actual _ownership_ of the memory remains with the original thread, and the receiving thread is only borrowing it, but the reality is a bit stricter than that would imply since the borrowing thread has exclusive access for the duration of the borrow and can't be forced to give it up. To me, "which stack was the object allocated from" is less important than "which thread actually has control right now".

<comment><USER9> Yeah, and it's possible I'm over-indexing on something like an Erlang-style green thread model, where shared state is (almost) forbidden, and thinking that's what was being referred to.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> The Rust section is missing the various Cell types, they'd help here, depending.

<comment><AUTHOR> Yes indeed! Cell types can be used for a lot of different situations depending on the specific requirements, but there's no good way (that I've found) to really represent the Plane/Airport example in a way that doesn't discard safety, incur a runtime cost, or freeze the containing Vec... I may very well have missed something though.

<comment><USER12> > but there's no good way (that I've found) to really represent the > Plane/Airport example in a way that doesn't discard safety, incur a runtime > cost, or freeze the containing Vec…

That's true. But according to your blog post, neither does Vale: it makes you choose between unsafe mode and reference-counting-overhead mode. From what I can tell, the advantages you're claiming are:

1\. Optimized reference counting: Valid, though I'm wondering how much difference it makes.

2\. Constraint references: Valid, but as far as I can tell this could be easily implemented as a wrapper around Rc like the C++ version is around shared_ptr.

3\. Mutable aliasing: I think this is the most important one. In Rust you can do this by wrapping all your struct fields in Cell or RefCell (so that the 'immutable' references you get from Rc are actually mutable ones), but the ergonomics are poor. Other reference-counting languages (e.g. Swift) do this ergonomically, but have no way to opt out and use a borrow checker for increased performance. There's definitely room for a language to combine features of both.

4\. Ability to compile the same code as either fast or safe: Doesn't appeal to me, because safety matters most in production where you might actually get exploited; but YMMV. I know game developers tend to have a different outlook.

<comment><AUTHOR> Absolutely right! Both Rust and Vale have their respective overheads.

Fast mode is as fast as even C++, and strictly safer than e.g. the C++ + ASan approach, but Resilient Mode is where the speed+safety story gets interesting.

I didn't have much opportunity to go into it in the article (it was already going on 15 pages, hah!) but there are some other aspects to Vale which should drastically cut down on reference-counting overhead:

       * Immutable region borrowing: we guarantee an entire is immutable, so all references into it are temporary and zero-cost, verified by the region borrow checker)
       * Bump-calling: a pure function can make its own new region which uses a bump-allocator for all allocations, and at the end we copy out the return value.
       * As mentioned, optimized ref-counting; we hope to reuse Lobster's algorithm, which removes 95% of ref counts.
       * Non-atomic ref-counting, because of the region isolation (like Rust's Rc, as opposed to its Arc), which is faster and more optimizable.

I would of course agree that fast mode isn't for every use case; I would use it for a game or WASM, but not for a production server, where priorities are different. We think that the above four optimizations will give Resilient Mode speed on par with Rust and C++. Benchmarking will show us how close we can get!

</comment></comment></comment></comment><comment><USER13> The trick of switching the implementation of owning_ptr and constraint_ptr based on a compile flag is very neat.

Is there any risk of the compile flag influencing which object owns the reference, and therefore causing a kind of "heisenbug" where it doesn't crash during the safe mode but still has dangling pointers in the fast mode?

<comment><AUTHOR> Thanks! We stand on the shoulders of giants, this method has been in use in the wild for a while, and Gel introduced it back in 2007.

Behavior will be the same in all three modes. There is however a chance that testing and development didn't cover a certain code path, and we would trigger unsafety in production, similar to unsafe blocks in Rust. When one encounters unsafety in Vale, they'll be able to just re-run in normal mode to instantly identify what caused it.

Normal Mode is very conservative (halts early when a constraint ref becomes dangling, rather than when it's dereferenced), so combined with test coverage, it can give high confidence in safety, and is strictly better than even C++ and ASan.

If that's not enough, Resilient Mode has zero unsafety, and with the optimizations we'll be using (nonatomic RC, Lobster's algorithm, immutable region borrowing, bump calling, etc) should be incredibly fast in practice, possibly on par with Rust and C++, and exceeding them in certain cases, with bump calling.

</comment></comment><comment><USER14> > Safe Handling of Aliases

Er, why wouldn't you just use automatic storage duration? That would look even simpler than the Vale implementation and have the same benefits:

      class BigClass {
        A a;
        B b{&a};
        C c{&a};
        D d{&a, &c};
      };

You could of course explicitly write the constructor if you choose.

> Destructor Parameters

This can be done in C++: both unique and shared ptrs can take a deleter instance. So for the rollback example:

      std::unique_ptr<Transaction, Transaction::RollbackWithMode> tx(
        new Transaction(), Transaction::RollbackWithMode(mode));

But my question is -- why? At this point you are losing one of the main benefits of RAII IMO: scheduling cleanup work right next to initialization work, allowing you to assume it is taken care of as you read the rest of the function:

Transaction tx(conn, Transaction::ROLLBACK_MODE_TUMBLE);

...

if (ok) { tx.commit(); } return;

Similarly with the Future example -- IMO this is far clearer:

      void Producer(Future<T> future) {
        auto auto_reject = AutoRun([&] {
          if (!future.ready()) future.reject();
        });
        ...code, including potentially many branches....
      }

where AutoRun is something simple like

      template <typename Functor>
      auto AutoRun(Functor f) {
        class AutoRunner {
         public:
          AutoRunner(Functor f) : f_(f) {}
          ~AutoRunner() { f_(); }
         private:
          Functor f_;
        };
        return AutoRunner(f);
      }

<comment><AUTHOR> Great question! We could also use a deleter, set up when we create the object, but thats often too early to know what parameters to pass into the destructor.

In some cases, you do know the destruction parameters up-front, and there I would agree that a deleter is great.

Sometimes you can't know the parameters up front, so can't easily get them into the deleter when you initialize. The call-once std::function and the future are good examples: These both take parameters which you might not know until later on. If you already know the values of a future when you're creating it, it probably wouldn't be a future.

future.~resolve(resultOfSomeAsynchronousCalculation);

</comment></comment><comment><USER15> The thing this is doing with "named deconstructors" seems to essentially be a form of linear typing, which is already well-modeled; and while the article claims this is "incompatible" with exceptions, I don't think that is true: it only means certain kinds of objects can't be on the stack if an exception were to occur without a "default" deconstructor (similar to a default constructor), but being able to get that scenario as a compile error is actually "cool" (as you can always model exception handling as just an automated expansion of an error propagation monad, at which point the code either would have worked before or it wouldn't have) and so I wouldn't throw the baby out with the bath water so soon.

<comment><AUTHOR> I'm not familiar with that particular flavor of monads, is that kind of like how Javascript's Promise has a .then() and a .catch()?

Also, someone mentioned yesterday that this is a form of linear typing, since everything must be destructed exactly once. But we would still run into a problem if we _did_ make any objects with no zero-arg destructor...

...except now that I'm typing this out, it occurs to me that we could just use the "Bailing Past Destructors" [1] rule says: hold the error, call the appropriate destructor, and continue returning the error upwards. (Vale would use a Result type, not exceptions)

Wow, the solution was there all along, and I never thought to retrofit it to C++. Perhaps I'll revise the article tonight to take out the mention of exceptions =)

[1] "Vale: The Interesting Parts", [https://docs.google.com/document/d/1t0zzW0K9jilbCkuAulZfDlZc...](https://docs.google.com/document/d/1t0zzW0K9jilbCkuAulZfDlZcYioRO10Ny5K7LEciyMI) (fair warning, written for language enthusiasts!)</comment></comment>


Increase Productivity or a Boost in Innovation – Which Would You Choose? - <AUTHOR> http://blog.15five.com/increase-productivity-or-a-boost-in-innovation-which-would-you-choose/

<comment><USER2> Essential for today's globally competitive workplace --finding the balance and equilibrium between brilliant collaborative innovation and individual productivity.</comment>


Waiting for Fedora 22? - <AUTHOR> https://stg.getfedora.org/

<comment><USER2> You don't have permission to access /pub/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Workstation- netinst-x86_64-22.iso on this server

[edit] fixed now

</comment><comment><USER3> Jaja! They did it! :D</comment>


Show HN: Editable Software Engineer Resume Templates - <AUTHOR> https://www.beamjobs.com/resumes/software-engineer-resume-examples <comment><USER2> Good started templates and really nice suggestions. I work with students who are struggling to come up with an engineering resume (non-traditional coding background) and this will be useful for them. Thanks for writing it!

<comment><AUTHOR> That's great, I'm so happy this will be useful for them. If you have any recommendations you think I missed or notice anything you think I should change about the templates please let me know!</comment></comment>


Fertility paradox in male beauty quest - <AUTHOR> https://www.bbc.com/news/health-48396071 <comment><USER2> This was noted in primates, some forgo large testicles or actual reproductive capability in order to have bulky fur that makes them look tougher.

[https://royalsocietypublishing.org/doi/10.1098/rspb.2018.254...](https://royalsocietypublishing.org/doi/10.1098/rspb.2018.2542#d3e1426)</comment>


UK consumer spending growth in 2019 to be slowest in six years - <AUTHOR> https://www.reuters.com/article/us-britain-consumers/uk-consumer-spending-growth-in-2019-to-be-slowest-in-six-years-ey-item-club-idUSKCN1TO0ZI <comment><USER2> Is this actually a bad thing? Do we need consumers spending more and more money on things they don't need (and often don't even want, they just think they want it)?

<comment><USER3> Why are you the judge of what people want or don't want ?

<comment><USER4> He isn't the judge of anything. He's just asking a question.

</comment></comment></comment><comment><USER5> As somebody who lives in the UK, in most cases (that is - peoples I know) it is small lifestyle changes that have impacted their spending habits more than the ability to spend spend spend. Be that having a phone that works for them for a few years that the need to upgrade every opportunity has become less important. Not wasting money on plastic bags, or filling up the fridge because they can. Giving up smoking for health reasons. Small things, but they all add up.

But in many countries some areas have seen changes. Not all driven by fiscal necessities.

</comment><comment><USER6> Hard to imagine this is a surprise. Doubt/fear historically has negative impact on consumer spending.

That said, lack of population growth also keeps economic growth in check. If you consider immigration a form of population growth (hint: you should) then, again, given Brexit, lack of spending is no surprise.

</comment><comment><USER7> The rate of growth is slowing? What derivative is that?

>> In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.

</comment><comment><USER8> Making assumptions on the size of the economy based the low-end retailers revenue can be misleading. The people I know spend more and more on healthcare, education, buying services abroad.

A better way could be to check the volume of payment card spending.</comment>


The Story McKinsey Didn't Want Written - <AUTHOR> https://www.institutionalinvestor.com/article/b1g5zjdcr97k2y/The-Story-McKinsey-Didn-t-Want-Written <comment><USER2> This is not original reporting, more of a summary of the other in depth and brutal coverage from the FT, NYT, BB, and WSJ over the last two and half years. Not a particularly clear summary either. I would recommend those if you are interested, and have linked some below.

[https://www.ft.com/content/7c6700bc-2976-11e6-8b18-91555f2f4...](https://www.ft.com/content/7c6700bc-2976-11e6-8b18-91555f2f4fde)

[https://www.nytimes.com/2019/02/19/business/mckinsey- hedge-f...](https://www.nytimes.com/2019/02/19/business/mckinsey-hedge- fund.html)

[https://www.bloomberg.com/news/articles/2018-07-08/mckinsey-...](https://www.bloomberg.com/news/articles/2018-07-08/mckinsey- s-sneader-says-south-africa-s-eskom-was-overcharged)

[https://www.nytimes.com/2019/02/19/reader-center/mckinsey- he...](https://www.nytimes.com/2019/02/19/reader-center/mckinsey-hedge-fund- reporting-investigation.html)

[https://www.nytimes.com/2018/06/26/world/africa/mckinsey- sou...](https://www.nytimes.com/2018/06/26/world/africa/mckinsey-south-africa- eskom.html)

[https://www.bloomberg.com/news/articles/2018-10-21/mckinsey-...](https://www.bloomberg.com/news/articles/2018-10-21/mckinsey- horrified-saudi-arabia-report-may-have-been-misused)

[https://www.nytimes.com/2019/01/09/business/mckinsey- bankrup...](https://www.nytimes.com/2019/01/09/business/mckinsey-bankruptcy- investments.html)

edit: A couple of people pinged me on the FT article, which was groundbreaking, and a one-week copy can now be found here:

[https://pastebin.com/jqkAytZp](https://pastebin.com/jqkAytZp)

<comment><USER3> This article specifically seems to cover the conflict of interest that arises from McKinsey also running a hedge fund (MIO).

The NYT article (your second link) covers the same topic more clearly indeed.

(Can't read the paywalled FT article).

</comment></comment><comment><USER4> I believe, to some extent, outsiders want to see prestigious organizations fail, as it will make us feel better about our lot somehow. Journalism certainly plays on this as we see the most prestigious firms across consulting, tech, and finance get flame pieces written about relatively small scale issues internally quite often.

While I enjoy the scrutiny organizations draw when due, I can't help but think that most of the news and journalism that gets written about companies like McKinsey is really insignificant in the scheme of their company. 100's of millions of dollars is pretty small in McKinseys organization, and there really is no evidence of a systemic problem here, just a small anomaly/mistake that a few partners called the shot on.

I believe these type of pieces can really bring serious harm to brands that don't necessarily deserve it, but I'm open to hear others opinions. It just seems that traditional news media is becoming the worlds best click baiters, while the importance of what the report on diminishes beneath them.

<comment><USER5> This isn't a flame piece. This is what journalism looks like. This sort of elbow-throwing happens at every level of reporting, from local ordinances on garbage collection to international politics.

> 100's of millions of dollars is pretty small in McKinseys organization, and > there really is no evidence of a systemic problem here, just a small > anomaly/mistake that a few partners called the shot on.

Take a moment and think about what you wrote here.

If you were a partner at McKinsey, is this what you'd tell yourself?

If you were a non-partner employee at McKinsey, how would you feel about your own retirement funds being invested in MIO, given its performance?

<comment><USER6> Non-partner employee here. Same poster as elsewhere on a different throwaway.

The benefits are very strong. I had not heard of this issue previously, and don't especially care. I'm not clear on if you mean the performance is too high or too low because the article kind of implied both. I don't think the amount was particularly material nor do I think it's especially bad if the firm gives preferential treatment to partners because... it's a privately owned firm... by the partners... and in general it treats its employees very well.

I'm not sure I'm communicating this well because the underlying facts feel vague. But I would give my employer an A+ based on my experience so far. The possibility that a percentage point of returns was lost on my 401k is bottom of the barrel priority. I can't tell from the article what happened, but it would be really hard to outweigh the visible, conscious investment in its people that the firm does.

I recognize this sounds like I'm drinking the Kool Aid here, but frankly, very few companies invest much into their employees. The best case scenario is often lame office perks for tech workers. But tech workers get shitty non competes. McKinsey, for example, gives you weeks of fully compensated time off to find your next job elsewhere. I think it's a remarkably healthy culture.

</comment></comment></comment><comment><USER7> Low level McK emp. Don't care to get too involved here, and will only share personal opinions.

This article seems to be mostly anger fluff. A lot of it seems to reference someone's lawsuit over a 401k deal with overly dramatic wording. Maybe someone can clarify but I don't actually see anything illegal or even particularly unethical. As the article states, it's not entirely unreasonable for a private company to offer better options to senior officials. Low level employee benefits are significantly above average and I don't believe anyone seriously feels sleighted.

As for whether there is insider trading involved with the MIO, I think it is unlikely. The opportunity for fraud exists, but not moreso than the personal risk for committing fraud. I have no comment on the specifics of individuals behaviors. Might bad actors exist? Certainly. Although it would seem strange for them to try and commit fraud through a massive diluted operation like this. The culture of internal controls and communications is frankly very strong in my opinion.

People will be able to find examples of bad actors. I don't feel it disproves any particular points. I do see active decisions about firm and personal ethics. And people are actively encouraged to not work on things they oppose.

There was a NYT article about a study looking at improving marketing for Opioids. No doubt, that was not good. The Chinese thing was distasteful. Does it represent the firm culture? Personally I don't think so.

The media, the NYT in particular, has been painting the firm as an evil shadow organization. They released an article that basically said they're going to continue to write attack articles against it because it's secretive. Well it's secretive because it protects client confidentiality.

<comment><USER8> _It has made money in 24 out of the past 25 years — a period that includes the dotcom bust and the global financial crisis of 2008-09 — earning hundreds of millions of dollars for McKinsey partners and alumni, according to an investor in Compass. Over the same period, the average fund of hedge funds has lost money in five years, according to data provider Hedge Fund Research._

"Think about it...McKinsey is the foremost management consultancy with better links/knowledge and influence over the World's leading companies. Its partners are very smart. Yet they can operate and compete in the highly competitive world of investment - not a management consultancy's core area of expertise - better than large, established professional money managers - without the competitive advantages coming from their insight as management consultants! Really! If that were true, they would spin off MIO and run it 'for profit' becoming one of the leading global money managers. Or does an opaque structure work better for them?"

\- [https://www.ft.com/content/7c6700bc-2976-11e6-8b18-91555f2f4...](https://www.ft.com/content/7c6700bc-2976-11e6-8b18-91555f2f4fde)

<comment><USER6> (Same account, lost original login)

This quote is misleading. It implies that McKinsey consulting partners are the ones making the investment strategies which is false. The large investment unit is run by... surprise surprise... finance professionals. Furthermore 90% of the MIO's investments are in externally managed funds, the investment decisions of which the MIO does not control.

Spinning off the MIO as a for profit firm would frankly be misaligned with the firm values. It's also not especially opaque, as it's fully registered and files documents on its structure and what not. Journalists have simultaneously been using those filings and claiming the structure is opaque.

Again. It's possible that McKinsey partners engage in insider trading (although it is very difficult as all trades in the firm are required to be approved by compliance). But I really don't think there's a logical thread by which partners take enormous risks to circumvent internal controls and provide tips to the MIO just to boost the fund performance. That's a very high risk, low payoff idea, because even if your secret info is super profitable, it's diluted across thousands of other partners before benefiting you personally. Claiming that it happens on a massive scale to offset that is just silly and is frankly a huge accusation with no basis. It's fully possible that the fund was just well managed.

</comment></comment></comment><comment><USER9> My pet theory is that McK is re-orging the NYT to be more commercial and the writing staff is rebelling, while Jay Alix is more than willing to help out.

</comment><comment> green-eclipse Would anyone mind posting a tl;dr?

<comment><USER10> _[McKinsey's internal investment company] first came under scrutiny because of the investments it holds in the clients of the firm's bankruptcy consultancy work. For years, McKinsey did not disclose those investments to the court when applying to be a bankruptcy adviser — and still has disclosed very few. Under bankruptcy law, advisers are required to be "disinterested persons," and cannot own the debtor company's debt or equity, directly or indirectly._

My impression is that McKinsey is kind of like Arthur Anderson and Enron balled into one international criminal organization. AA had the undisclosed conflicts of interest part and E had the screwing over your employees' retirement funds part. Top that with helping Saudi Arabia track down dissidents under the guise of "public opinion research."</comment></comment>


Ask HN: How do you make coding a more casual activity? - <AUTHOR>

Is there any way to make coding something more casual and informal instead of being so structured and feeling unchangeable?
I want to tinker with this bit without causing this bit and that bit to blow up.  I want to stretch this line without the code in line number 45 explode.  I want a way to make coding feel more like I'm playing with putty and less like I'm working with cement.
What options are there (if any) for doing this? <comment><USER2> forth? lisp? try coding naked?

I think if you can find a combination of:

\- dynamic \- REPL \- good editor support \- lots of libraries \- easy bindings for text/graphic display

...that will be conducive to "playful" programming.

Some of it might be how you approach it. Try coding silly things for yourself. Write a program to greet you when you first turn on your computer...or render a graphic depicting how your favorite sports team is doing against their rivals..or whatever you can imagine.</comment>