Hacker Newsnew | past | comments | ask | show | jobs | submit | venning's commentslogin

It may be worth pointing out: these are equivalent comparisons when testing for even numbers but cannot be extrapolated to testing for odd numbers. The reason being that a negative odd number modulus 2 is -1, not 1.

So `n % 2 == 1` should probably [1] be replaced with `n % 2 != 0`.

While this may be obvious with experience, if the code says `n % 2 == 0`, then a future developer who is trying to reverse the operation for some reason must know that they need to change the equality operator not the right operand. Whereas, with `n % 1 == 0`, they can change either safely and get the same result.

This feels problematic because the business logic that necessitated the change may be "do this when odd" and it may feel incorrect to implement "don't do this when even".

I really disfavor writing code that could be easily misinterpreted and modified in future by less-experienced developers; or maybe just someone (me) who's tired or rushing. For that reason, and the performance one, I try to stick to the bitwise operator.

[1] Of course, if for some reason you wanted to test for only positive odd numbers, you could use `n % 2 == 1`, but please write a comment noting that you're being clever.


I really disfavor writing code that could be easily misinterpreted and modified in future by less-experienced developers

That's their problem. Otherwise you're just contributing to the decline.


In what languages is n % 2 -1 for negative odd numbers?

Edit: apparently JS, java, and C all do this. That’s horrifying


Horrifying? It’s mathematically correct.


it's a semantics problem, not a maths problem - modulus and remainder are not the same operation. This easily trips up people since `%` is often called "modulo", yet is implemented as remainder operation in many languages

https://stackoverflow.com/questions/13683563/whats-the-diffe...


It's actually really awkward. Math usually considers (-7 mod 5) === (2 mod 5). But in C, (-7 % 5 != 2 % 5).


No. Math considers -7 = 3 modulo 5. it's a ring that repeats every 5 units. -7 + 5 + 5 = 3.

Think of a clock which is a ring of size 12. In a clock, going backwards 15 hours (-15) is the same as going backwards 3 hours (-3) which is the same as going forwards 9 hours.

-15 = -3 = 9 modulo 12


You are correct. I thinko'd and missed the edit window. I meant to say:

Math usually considers (-7 mod 5) === (3 mod 5). But in C, (-7 % 5 != 3 % 5).

The issue is that -7 and 3 are congruent, but the % operator keeps the sign. So -7 % 5 yields -2, not +3. Those are congruent, but not equal. I've never had a use for this behaviour, but I've definitely had to work around it. The lazy way is ((x % n) + n) % n which is safe (assuming n > 0).


+1. I wholeheartedly agree. That "lazy way" looks all too familiar haha.


wrong. it's not any more correct than 1. that's the key part of an "equivalence" class is that the elements are "equivalent"


You can just not( iseven() )


From the linked study: [1]

Total operational water "footprint" of data centers in 2018: 5.13 * 10^8 m^3. Of that, indirect consumption through electricity generation: 3.83 * 10^8 m^3, or 74.7%. And indirect consumption related to water and wastewater utilities (non-electicity production): 4.50 * 10^5 m^3, or 0.09%.

The study then does a reasonable job of discussing the concerns of building data centers in water-stressed places.

This article seems to be another "didn't read the study, saw big number" thing.

[1] https://iopscience.iop.org/article/10.1088/1748-9326/abfba1 (PDF page 7, section 3.1)


Okay that makes more sense. I was skeptical of the article's claim that the water was just being heat-vaporized into oblivion.

That said, more water-sustainable power generation is clearly still a need.


"Typhoid Mary" was an asymptomatic carrier of typhoid fever for at least 38 years.

https://en.wikipedia.org/wiki/Mary_Mallon


FWIW I think that article shows her infecting people for only 15 years (1900-1915), then being quarantined for a further 23.


The Wikipedia article doesn't cover everything. Reference for the sibling comment: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3959940/


That article has 1906 (her engagement as cook in the Warren household) to 1932 (her paralysis) as the period of her infection of others, assuming after her paralysis she didn't infect anyone else.

That's still not 38 years; it's not especially important a point - she infected others over at least 2 extended periods amounting to mor than a couple of decades in total.

It's interesting to me, I thought nih.gov was a scientific publication but at least one part of that document appears to be opinion asserted as fact (~"she never intended to abide by the conditions of her release").


> ... 1906 ... to 1932 ... as the period of her infection of others ... That's still not 38 years ...

I never stated that she infected others for 38 years. Being an asymptomatic carrier does not require continually infecting others, only that the carrier maintains the infection without showing symptoms. [1] Additionally, the NIH article isn't complete in listing likely infections, as evidenced by comparing it to the Wikipedia article. Nor does is state that she continued to infect others until her paralysis in 1932.

As for the 38 years, the Wikipedia article notes 1900 as the first known, likely infection of a family she worked for. Then, from the NIH article:

> A post mortem revealed that she shed Salmonella typhi bacteria from her gallstones ...

Her death (and, presumably, post mortem) was in 1938. "Bacterial shedding" [2] implies infection and, thus, being a carrier in 1938, though asymptomatic. I arrived at 38 years by considering her likely a carrier from 1900 to 1938.

[1] https://en.wikipedia.org/wiki/Asymptomatic_carrier

[2] https://www.google.com/search?q=bacterial+shedding


A post-mortem confirmed that her gallbladder was loaded with the bacteria that cause typhoid.


Wikipedia mentions that autopsy might not have been performed.


> I think even the VAT is added on checkout to the price

No. VAT in Germany is not charged to American servicemen and women and dependants. This is covered under the Status of Forces Agreement (SOFA) [1]. One may also receive reimbursement of VAT paid on the economy, though that is subject to some restrictions at around €2500, I believe. There are specific rules on cars. The actual forms for receiving reimbursement are onerous enough that VAT forms aren't often used outside of major purchases.

I went to high school on an American military base in Germany in the 1990s. At least then, the major items of note were jeans and gasoline/diesel (though, I had a teenager's bias). Both were subject to significant taxation on the economy that Americans didn't need to pay on base. In practice, this meant there were some restrictions on how many jeans people could purchase at once, to prevent Americans from reselling them to the Germans. There were also special booklets that Americans could buy on base that had little tear-out pages; each page could be exchanged for a certain number of liters of fuel at, specifically, Esso gas stations on the economy. While fuel prices on base (the same rate as the booklets) were considerably more expensive than in the US, it was still far cheaper than off base.

Most of the goods available in stores on base were imported from the US [2]. All prices and payments were in dollars. We did not use pennies on the base, since they were too expensive to import. All bills/receipts were rounded to the nearest five cents [3].

I was told by a teacher at the time that the Rhine valley had "the single largest concentration of Americans outside of America." That specific area of US installations has grown in the intervening 20 years both due to the wind down of smaller Cold War-era bases scattered throughout Germany and due to the current conflicts the US is involved in, of which, most require US forces to deploy via Germany.

[1] https://en.wikipedia.org/wiki/Status_of_forces_agreement

[2] As a major exception, I believe the bases purchased civilian fuel from German suppliers directly as part of the taxation agreement.

[3] The base bank would always do business to the penny which, over the course of years, would create a small pile of useless copper in every home.


It just worked for me. Opened the "web" link in an Incognito tab on Android Chrome.


Not sure why I'm getting downvoted. Here are two gifs as proof. Regular logged in Chrome + Incognito Chrome. Maybe I need to be in Mobile?

http://g.recordit.co/f2Ygm2R5zl.gif http://g.recordit.co/1maj5kq8Qd.gif


>Not sure why I'm getting downvoted.

Perhaps because you stated your personal experience as though it was universal. It works for me.

>Maybe I need to be in Mobile?

Nope, Desktop here. Maybe geolocation, who knows.


>Perhaps because you stated your personal experience as though it was universal. It works for me.

TBH, I thought it was. Maybe they've blacklisted my IP or geolocation like you suggest or something else.

For the record, I tried it in Android Chrome and it works ok there! Just not in my desktop Chrome.

OSX 10.12.6 (16G29)

Chrome Version 67.0.3396.99 (Official Build) (64-bit)


> ...Americans use 500 million plastic straws a day ... hundreds of thousands of straws are found littering coastlines around the world each year...

If "hundreds of thousands" means 500 thousand, then this is saying that 0.00027% of those plastic straws are found on coastlines.

I understand that there are problems with both of those statistics, but it still seems a bit odd to publish them like this (there are 13 words between those numbers).

Again, the "500 million" number is likely wrong (as OP references, [1]) and the "hundreds of thousands" number was probably the author taking a spitball at something that there aren't real statistics for, but they still chose to print it.

[1] https://www.nytimes.com/2018/07/19/business/plastic-straws-b...

EDIT: In reference to [1], being within an order-of-magnitude is pretty impressive for a 9-year-old.


As a counterpoint, I found it to be very helpful in understanding the information presented.

The animals breakdown (Chart B) contains 10 values, ranging from 1 Gt to 0.002 Gt. That's a difference of 500x. That's a bit hard to perceive in a one-dimensional chart.

The two-dimensionality of a Voronoi makes it easier to perceive, particularly in a small image (as is presented on a phone's screen), at least to me. I imagine this is mostly due to a 2D chart consuming far more physical pixels to convey the same information.

A stacked bar chart of the same information: [1]. Admittedly, I didn't take time sprucing up that chart, but I find it extremely hard to intuit from and can't even see the value for "wild birds".

[1] https://www.meta-chart.com/share/untitled-23893


I can't find the source for this but, as I recall, HN has a system where certain new or recent submissions are artificially promoted to a low position on the front page for a few minutes to see if they gain traction naturally. Also, I believe that some people (perhaps just dang and sctb, I don't know) can manually add to the pool of submissions that the algorithm will randomly draw from to temporarily promote. They don't have the power to push them directly to the front page, only to give them a chance to be selected for a few moments of spotlight.

Forgive me if I got some of that wrong, or if the system as a whole does not work like than anymore. Not exactly what was asked, but maybe helpful to someone.

EDIT: Closest source I can find: https://news.ycombinator.com/item?id=9866140

It references a long comment from dang three years ago regarding this as an "experiment": https://news.ycombinator.com/item?id=8790134


It seems like HN ranks a lot by recency. I have seen articles with 40 or so points high on the front page and of course highly rated articles need to leave it at some point.


Last I read, Tesla is holding $985MM in customer deposits. [1] Now they are asking for, I'm assuming, full payment for cars starting at $48,000. However, the soonest one can be delivered is in "two to four months" and that's only for the trim that starts at $64,000. Plus there are now quite a few options costing in the thousands.

For every 10,000 customers that place an order of the, likely, several hundred thousand current deposit holders, that's somewhere around $600 MM in additional customer money that Tesla would be holding. For every 10,000 customers. But that money won't deliver a physical product for months.

Is this a play to make billions more in deposit money? Is this how they plan to take no more investment/debt this year?

Is there anyone on the list looking to buy one that can confirm if this requires full payment?

EDIT: Apparently, the ask is for an additional $2,500. [2] That would make $25MM per 10,000 customers that place an order.

Putting forth the additional $2,500 also removes the ability for you receive a refund of the original $1,000 deposit if you do not cancel within three days.

[1] https://www.bloomberg.com/graphics/2018-tesla-burns-cash/

[2] https://www.cnbc.com/2018/06/28/tesla-model-3-orders-cost-25...


> Now they are asking for, I'm assuming, full payment for cars starting at $48,000

A quick searched reveled that the final payment is due at delivery, or shortly before deilivery [1].

When you finalize configuration, Tesla asks you for a $2500 non refundable deposit (although I have heard that they refund it in some circumstances as a matter of goodwill). This deposit is the same for all models even the Model 3, as stated here [2]:

> And finally when you’re ready to place your order, a deposit of $2,500 is required which isn’t any different than placing an online order for a Model S or Model X.

The only thing I cannot tell you is if the initial deposit counts toward the 2500 deposit or the final price. So Tesla doesn’t get billions in deposits and doing that would probably cause a lot of logistical problems and the media would scream that they are scamming customers and only do that because they are about to go bankrupt.

[1]: https://forums.tesla.com/forum/forums/payment [2]: https://www.teslarati.com/tesla-model-3-design-studio-config...


According to CNBC:

> Those reservation holders must pay an additional $2,500 to turn their reservations into an order, at which point the original $1,000 deposit goes toward the overall payment for the car. Buyers can cancel their orders within three days for a full refund, the company confirmed, but after that their money is Tesla’s for good.

https://www.cnbc.com/2018/06/28/tesla-model-3-orders-cost-25...


They say that cars will be delivered in 2 to 4 months. Also ordering costs $2500.

I thought it is common to pay full amount upfront upon ordering cars, then wait a month or two for actual delivery.


It depends on the place/country, regarding the payment.

Regarding the delivery, there's two aspects: the first one is that delivery can take even more, even for regular cars. The second one is that I wouldn't be too confident as a Tesla customer, that I'll get the car in 2 to 4 months. 6+ months seems more realistic, based on their track record.

All-in-all, if you really like the car, it doesn't seem a blocker.


It is, with the proviso that it's rare for Americans to order a car before it's made -- we mostly buy them "off the lot". Tesla is unusual in that regard.


As a former car salesperson, I can tell you that, in the state of Virginia, car sales contracts are not valid until the customer has physically taken possession of the vehicle. As a result, we were always very reticent to sell a car "off the truck". Customers would swear up and down that they'll definitely follow through but, most of the time, they'd just never come to pick up the vehicle and we'd be stuck trying to unwind a contract. I'm sure this is common in a lot of states.


Nissan Leaf and a Scion xB, both ordered, both paid at the time of delivery, not before. No way I'd pay upfront for something I haven't even driven.


I’ve ordered a car that wasn’t a Tesla in the US. I paid upon delivery.


Are any of these deposits protected? I assume when Tesla folds, they will all be lost?


You can get a refund of the deposit at any time for any reason -- but no, it's not in escrow or anything. Dunno about the order payment.


Why would Tesla fold ?


Because they’re cash flow negative and would eventually run out of runway without either a change in financials or raising a new round.


Someone else would certainly buy them. The brand is too good to let it vanish. So it's just a matter of price -- the more indebted is Tesla the more likely someone would buy it.


Tesla as a brand will certainly continue to exist.

Alas: that's not what is being discussed. If Tesla were to enter bankruptcy, then it legally is no longer necessary to uphold its end of any bonds, payments, or other such financial issues.

Tesla might go bankrupt in the next few years, if this Model 3 thing doesn't work out. At which point, it won't return any of the money from these reservations.


They’re almost out of money.


Because their current liabilities exceed their liquid assets by several billion dollars.


I think it is extremely unlikely Tesla would go bankrupt in the next few years. If it has a cash flow problem, then it just needs a loan or investment. There are lots of venture capitalists out there who bet all the time on companies that might not succeed but could make a ton of money if they did, and Tesla certainly fits that description.

Now it is true that Musk would hate to do this, because it would mean giving up some independence, but if necessary he no doubt will.

I think the real reason we are seeing all these claims that Tesla is about to go under is that there is about $10 billion bet on stock shorts that is going to explode in the near future, and so the financiers are desperately trying to put a scare into people and drive down the stock price.


The deposit for a Model 3 is $1,000.


But the article isn't about offering deposits. It's about ordering.


The order requires a $2,500 payment, not the full price.


Ah, thank you. I see now there are better articles. I'll update the original comment.


Yes, I read the article. It was extremely unclear what you were asking, and it's definitely not the case that a full payment is required.


EDIT: Apparently, the ask is for an additional $2,500. [2] That would make $25MM per 10,000 customers that place an order.

Right, and so the premise of your original comment no longer applies. Or am I missing something?


> the hundreds of $1000 spent just defending his short position through hiring former Herbalife people, funding legal campaigns, funding support groups

You are describing entirely legal actions. Sabotage and (this form of) industrial espionage are very much illegal. There's quite a difference there.

> a few $100k is pocket change for these guys

But a few billion dollars of market cap and a few years of jail time are the price of being found guilty of what Musk is insinuating.

That's not a small leap.


But a few billion dollars of market cap and a few years of jail time are the price of being found guilty of what Musk is insinuating.

If I stood to lose $100M, I wouldn't do the dirty work myself, I'd hire someone else to do it for whom taking that risk for $100K (or whatever) is worth the risk - that could be several years (tax-free) pay for some people.

I'd use several levels of anonymization or maybe redirection to try to keep my identity hidden (and I doubt I'd be successful, but it takes a certain level of arrogance to hire someone to sabotage a company because you bet against it and might be losing)


I expect that's how most industrial espionage happens; some company employs the services of some third party research firm to investigate a competitor's product and doesn't explicitly ask for anything illegal. Maybe that third party hires other contractors, and so on. The actionable information bubbles up through the chain, and the original company that funded the "research" has no idea where it came from. They might not even have had any intention of causing a crime to be committed, but ignorance is bliss.

It would be a lot harder to plausibly deny paying some third party for explicit sabotage; as far as I know, companies don't normally pay third parties to cause harm to a competitor for legitimate business reasons.


Jail time? The SEC will just do the “this individual/corporation is important to the economy” thing and fine them some pocket change. The downside is far more limited than you might hope.


Can you provide examples of explicit corporate sabotage (e.g. criminally stopping production in a factory) being lightly punished by the SEC?


No, because corporate sabotage is outside of their remit. They would only look at it within the realms of market manipulation and insider trading, for which the punishment is a) usually light and b) usually deflected onto a fall guy.

In terms of the actual espionage end of things, it’s covered by EEA 1996 - and the prosecutions there have always gone for the hand, not the head, and the fines have been in the thousands, not millions, of dollars range.

https://en.m.wikipedia.org/wiki/Economic_Espionage_Act_of_19...


You started by questioning jail time, then brought in the SEC. Now you're stating the SEC doesn't deal with industrial sabotage and talking about fines, which no one else mentioned.

As for actual jail time, here [1] is a single engineer in California (same jurisdiction as Tesla, presumably) that was sentenced to 15 years. Also, $28 million in fines, which is what he earned for his espionage. Another engineer got 2.5 years for the same incident [2]. And this was the very first instance of people being convicted under the Economic Espionage Act you mentioned. Further reading: [3].

I don't think the facts support your position.

[1] http://www.latimes.com/business/la-fi-espionage-sentence-dup...

[2] https://www.law360.com/articles/571212/ex-dupont-engineer-ge...

[3] https://www.justice.gov/opa/pr/two-individuals-and-company-f...


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

Search: