For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more raviolo's commentsregister

Could someone explain why in question 5

i = 0; return i++ + ++i;

Could produce different results?


There's explanations at the bottom after you click the button.


I read it but I still don’t understand. Isn’t it 0 + 2 vs 1 + 1? How would it produce something other than 2?


Imagine a dumb piece of hardware storing your variables. Two pieces of a statement try to do conflicting things to the same variable at the same time. This can cause the data to get corrupted, or the entire chip to have a fault. The C standard allows an implementation like this.


So for the left-to-right operand evaluation order I thought it’s this: look at the left operand, take zero. Then post-increment, now it’s one. Move on to the right operand. Pre-increment what is 1, so now it’s 2. Take 2. So it 0 + 2?


How do you get 0 + 2?

I could imagine the post-increment happening after the sum: giving 0 + 1…


That’s what I imagined, and what I get with Cygwin gcc, the result is 1. I thought that the post-increment was supposed to always only happen after the “statement”, but I was wrong. Other compilers, like gcc on Ubuntu return 2.

This looks like a good explanation of why both are correct and why it’s confusing: https://stackoverflow.com/a/4445841


It’s sad how the costs of dealing with used plastics - whether recycling, landfill, or something else - are usually presented as a problem. Like, “look, it’s getting too expensive to have country X take it” or “it’s not economically feasible to recycle”. I wish the costs of dealing with plastic trash went up 10 times and there was absolutely no way for anyone to avoid them. That’s the only meaningful way to get people’s attention and stop consuming 400 million tons of plastic per year.

The amount of plastic bags is ridiculous. The packaging for many products is ridiculous. I feel good about being able to put groceries into my backpack rather than plastic bags. Unfortunately I don’t have an option to take other products of their crazy layered plastic packages and put those into my backpack as well, all that packaging going straight to garbage as soon as I get home. This makes me sad.


Not true. One of the commenters on this thread was nice enough to post the modern-day history book for the 9th grade. Unless you believe he went through the effort of redacting it, you will see that it contains details of USSR’s invasion of Poland in 1939, German-Soviet pact and its secret addendum, nature of the agreement to divide Poland and other countries between Germany and USSR, and so on. Factually it seems to agree pretty well with Western sources.


Orlov's history textbook don't even give it a glancing mention in latest editions. That one is more common in more lower tier educational institutes.

A more liberal Brandt's textbook, the one posted above, been heavily edited year after year to its current state where the pact, invasion of Poland, and whole of thirties was reduced to just few pages.


This used to be true 30 years ago but is no longer true.


Thank you for posting. I was very interested to know what the modern-day school history books say.

For non-Russian speakers I can confirm that on page 203 of the above-referenced history book for the 9th grade it says that World War II started on Sep. 1, 1939 with the German invasion of Poland. It also contains plenty of info on Soviet invasion of Poland, albeit in such context as “it was necessary to create a buffer zone” etc - but it’s there. The Soviet-German pact is also referenced and so is the secret addendum, and it specifically states that Germany and USSR have divided Poland and other countries of Eastern Europe into “spheres of influence”. Which is pretty much what the actual newly declassified document says.


I myself studied by a much earlier version of this textbook, and can attest an almost 5 fold reduction in material covering thirties in comparison to edition I was taught on.

The biggest omission being the use of word invasion or statements amounting to Soviet-German conspiracy to start the war against these countries.

> specifically states that Germany and USSR have divided Poland and other countries of Eastern Europe into “spheres of influence”

You have to admit, dividing "spheres of influence" sounds way more benign in comparison to "joint invasion plan"


I assume this comment was not intended to be taken seriously. Most of the population of what are now independent countries of Belarus and Ukraine, but used to be part of USSR, are pretty well aware of where the Polish border was in 1939. If you visit, it becomes apparent that this fact would be impossible to hide, and no serious efforts to hide it have been made in recent years or earlier. Most towns West of Minsk still bear polish-sounding names and are predominantly catholic while those East of Minsk are orthodox with Russian-sounding names. Many people in western parts of Ukraine and Belarus hold the equivalent of polish green cards issued to them as poles, and everyone is pretty well aware of the reasons, and so on. I don’t know what the modern school books say on the subject (it is true that 30 years ago they began the WWII history with the 1941 events) but there is abundance of information on the subject, including Russian resources, and none of it certainly “gets you killed”.


1. stating a historical fact gets you a prison term for sure https://translate.googleusercontent.com/translate_c?depth=1&...

2. Going to jail in Russia is a 1 in 10 to 1 in 5 chance to die from terrible conditions or prison violence. And that is of course will be more aggravated if you are a political prisoner.

3. A list of people who went missing going into thousands now


What if the robot was written by another robot and a “salesperson” was also a robot?


Wasn't there a Philip K Dick story about a human computer programmer in the future where robots were taking over all the good programming jobs, who had to pretend to be a robot, in order to get the high paying robot-only programming gigs? Every morning when he signed in to work, he had to fail a Turing Test in order to prove that he was really a robot.


We obviously didn't have enough bullshit jobs for human beings, so we're gonna create some useless robots as well. It makes me think of Futurama with all the worthless robots (Preacher Bot, Robot Devil, Homeless Bot), which were finally explained after the show came back as the robots self-reproducing.


Calculations of this model are misleading. One hugely important parameter missing: inflation rate. This would tell us what part of that 2.1 million in 30 years is real return and what part is simply inflation, i.e. depreciated money. Put it differently, it’s important to know what the investment will yield in terms of today’s dollars - not depreciated dollars.

For such a long horizon of 30 years modeling without accounting for inflation makes little sense. For instance that 7% stock market return used by the model as a default, which perhaps may be used as proxy for inflation, would return 661% over 30 years.

Default values for other parameters and their distributions also look very optimistic to me. Like 4% annual appreciation which maybe drops to 2% annual appreciation. How about 40% annual depreciation, your mortgage being 30% underwater, and foreclosure? How about the bank that issued your mortgage going bust, then the bank which bought that bank going bust, and then you 30-story building being shut off from public utilities? What am I smoking? Neh, I just bought investment properties in Miami and other places in Florida in 2007. Anyone too young to know what I’m talking about: I urge you read up on the 2008 crisis before you start buying up investment real estate, after 10 years of unprecedented growth of both real estate and stock market.


Try using the model with a very high down payment. At 50% of property value, your gains are equivalent to the 7% baseline. Beyond that, the property makes significantly less than the stock market. If you pay 100% up front, you end up making half what the stock market does.

In other words, the gains shown by this model are coming from leverage, not from the underlying asset. Leveraged investments always return more, but with higher risk. That's true in the housing market as well as the stock market.


Leveraged assets are not necessarily always more risk than unleveraged ones. You also have to look at the underlying risk/volatility.

That said, I agree with your point in this case that the leverage is the main component of the return, and greatly increases "risk", for some definition of that word. In a non-recourse state where you can default on the mortgage without losing other assets, the risk calculation must also take that into account.


In addition to your point about leverage and underlying asset volatility, certain assets are not regularly marked to market (real estate being a prime example) and so you don't experience the true volatility of the asset unless you attempt to sell it.

As a concrete example, a number of commercial real estate investors were technically insolvent in 2008-2009, with assets worth less than the balances of the loans used to buy them. They just pursued the 'hear no evil/see no evil/speak no evil' approach and marked to book (what they paid for the asset) until the market recovered. This approach is aided by the multi-year nature of commercial leases, which protects the cash flows needed for debt service (as long as your tenants stay in business).

In aggregate these factors allow professional real estate investors to consistently earn return by taking on a ton of leverage and with it huge but disguised risk. Back to the original point of the article (buying to rent), most retail investors don't necessarily have the float/access to debt to weather that volatility, and their cash flows are more sensitive which compounds that risk.


Excellent points.

Other parameters missing: - Vacancy rate! - Leasing costs (or value of your own time)

Annual cost should include: "normal" maintenance, repairs, insurances, renovation sinking fund, taxes, rates, strata fees if applicable.


I mostly agree with the article but for the reason that I did not see clearly reflected in it. I think knowledge of multiple languages (and technologies in general) is important not from a perspective of trying to be an expert in many things (which I think in general is counterproductive) but because it helps one to be better (and, arguably, much better) within their domain.

Few examples to illustrate my point:

- Having some experience with strongly typed language makes Python developer a better and safer programmer. Compare with Python developer who is not even aware of the weak vs. strong typing issues and all the related gotchas. Well worth the investment.

- Having seen the ease-of-use and power of some data structures (e.g. Python dicts) not natively available in C may suggest to C developer to look for libraries that implement something similar. 10 minutes playing with Python may end up saving countless man-days on a large C project.

- Having even minimal experience with NOSQL DB may suggest to a DB admin that handling unstructured data on their Oracle cluster may not the best way to go.

- Having seen FPGA latencies may suggest to a Java developer not to bother with the software that will be competing on latency.

The list is endless. I guess my main point is: even approximately knowing what's out there helps you make much better decisions, where decisions may be anything from picking the right approach in your area of expertise, or picking up a different tool if you need to, or telling your boss to hire the right person, or even not starting on the task due to lack of right expertise.


Indeed, TIM is a poor heat conductor compared to metals. If surfaces were ideally polished, TIM would be absolutely not necessary. We’ve done this and saw significant improvement in thermals. Next best thing is liquid metals that have an order of magnitude higher thermal conductivity than anything like arctic silver. Big problem though: they are also electrically conductive so if a drop gets under CPU pins that’s the end of it.

Without going these exocitic routes, the goal of using TIM is to fill up gaps (due to surfaces not being ideal) to replace no thermal conductivity in those places with some thermal conductivity. What you do not want to do, however, is put TIM where there was already good metal-on-metal contact. That’s why too much TIM is definitely bad.


> If surfaces were ideally polished, TIM would be absolutely not necessary

I'm skeptical of this, I'd be surprised if it's physically feasible to get literally perfect contact between the surfaces, micro-gaps are too real.


I wonder what's the thermal conductivity between two Guage blocks?


Actually you can check out Gauge block's and Wringing


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You