The Fourier Transform and its Applications - <AUTHOR> https://see.stanford.edu/Course/EE261 <comment><USER2> There is this hard question that is often glossed over in a first course on Fourier analysis: We learn that the Fourier transform of f(t) is an integral of exp(iwt)f(t) over all t. But when we look at a table of Fourier transform pairs, we find things like the Fourier transform of a constant function (is the Dirac delta). Integral does not converge? WTF?

I really think Prof. Osgood hits a sweet spot of not sweeping this under the carpet, and not becoming a course on functional/integration theory. I'm a postdoc in theoretical physics, and use these transforms regularly, and I have yet to find a more honest but still useful introduction (although I understand that real mathematicians cringe at my abuse of mathematics.. :)

edit: typo

<comment><USER3> the other somewhat confusing thing is that algorithms like discrete fourier transform/fft are actually fourier series.

<comment><USER4> There are three of them.

1\. Fourier transform: unbounded real domain <-> unbounded real domain

2\. Fourier series: bounded real domain <-> unbounded integer domain

3\. Discrete Fourier transform (DFT): bounded integer domain <-> bounded integer domain

FFT is an algorithm for quick calculation of DFT, which is _not_ Fourier series.

<comment><USER5> you are missing the discrete time fourier transform, which is the dual of your point (2).

Together, these eight domains can be arranged on a commutative cube, all of whose edges have beautiful meanings: sampling, interpolation, etc. The fact that the cube is commutative gives a lot of theorems relating each transform and these operations.

</comment></comment></comment></comment><comment><USER6> In case this is useful to anyone else:

There's probably an easier way to do it, but if you want to get faster playback (2x is about as fast as I can comprehend this lecturer at), this line seems to do the trick:

        document.getElementById("myElement").querySelector("video").playbackRate = 2

<comment><USER7>
        document.getElementsByTagName('video')[0].playbackRate = 2;

Not tested.

<comment><USER8> Here's my general-purpose speed-adjustment bookmarklet:

        javascript:void%20function(){document.querySelector(%22video%22).playbackRate=parseFloat(prompt(%22Set%20the%20playback%20rate%22))}();

And I find that about +70% is the speed I most-frequently want, so here's my one-click "x1.7":

        javascript:void%20function(){document.querySelector(%22video%22).playbackRate=1.7}();

Both of these adjust the speed of all _non-iframe-embedded_ HTML5 video elements on the current page.

Of course, because of XSS-prevention rules, they won't help with iframe- embedded players. For that I guess you're gonna need a plugin.

<comment><USER7> `queySelector` only returns the first matching element (according to Mozilla docs).

</comment></comment></comment></comment><comment><USER9> This is an exceptional course. In my CS undergrad days, some 7 years ago, when I wanted to make sense of Fourier Series and Transform, this course was my savior. The mathematics text book had a dry and unintuitive treatment of the topics and electrical engineering, physics and computer science books mostly relegated the topics to a few pages in an appendix.

I found this course and printed out the PDF of the lecture notes as I didn't have enough bandwidth for watching the videos. The lecture notes had a wealth of information about the idea of a Fourier Series expansion, it's connection to the Transform and the applications in diverse fields.

Prof. Osgood had great examples. In one such example he showed that the temperature of a ring must be a periodic function of time as the structure of the ring is periodic in space, and then went on to derive an equation for the temperature of the ring that was a Fourier Series.

It was from these notes that I learned a great deal about convolution too. The new website looks much better organized. I'd recommend every CS/EE student to at least watch the first few lectures once.

<comment><USER10> > electrical engineering, physics and computer science books mostly relegated > the topics to a few pages in an appendix.

Out of curiosity, is this really true? Perhaps I misunderstand you, but I have always been under the impression that Fourier Transform was a fundamental building block covered extensively in all EE curriculum?

I took Computer Engineering with some classes shared between Comp. Eng. and EE students. I probably had 2 full-semester classes dedicated to signal processing and fourier transforms. Additionally I took a math course that covered Fourier and Laplace transforms.

<comment><USER11> I don't know about physics, but it's definitely not true about electrical engineering. The Fourier transform is one of those things that is absolutely fundamental to any branch of electrical engineering, you run into it when doing anything, from microelectronics to power distribution. And there's typically no way you get an EE diploma without a soul-wrenching course on signals & systems.

As a personal anecdote: I ended up taking _three_ courses: one on signals, one on systems, one on circuits (...and systems!). During those troubled uni years, trying to see if I can still remember the Fourier transform was my "am I too drunk?" benchmark. When I could no longer do it, I went home.

<comment><USER12> _And there 's typically no way you get an EE diploma without a soul-wrenching course on signals & systems._

Similar to the person you're replying to, my education is in computer engineering rather than electrical engineering. I took the "signals and systems" course which was a treatment of Fourier series, Fourier transforms and convolutions. Since the final exam was open book, I did well by primarily being able to quickly look up the information relevant to each question on the exam. Convolutions did seem a little bit convoluted but the course didn't seem particularly soul-wrenching (compared to, say, the intro circuits course or the intro electronics course). Perhaps I was spared the soul-wrenching bits (e.g. I took a stats course instead of the course on random signals) or perhaps my university's electrical engineering department is subpar.

<comment><USER11> The soul-wrenching part depends a lot on the professor, I suppose. My Signals teacher was absolutely stellar and put a lot of effort into giving us a solid understanding of the theoretical underpinnings of her course, so it was pretty math-intensive. The exam, as I remember it, was pretty modest in terms of difficulty, but the course was pretty hard. I aced every homework, lab and exam, but that's largely because I loved that course. Everyone I knew struggled with it. It ate a good 4-6 hours off every week, in addition to the time spent on assignments & co. (sometimes more, but by my own making, i.e. because I'd hack on something alluded to, but not taught in that course. Like I said, I really liked that class).

My Circuits and Systems professor, on the other hand, wasn't too interested in this. He obviously cared about us knowing the math, but insisted that he was teaching a Circuits class, not a Mathematics course. His course seemed a lot easier as a consequence. I was never that good at math. I learned it because you can't do engineering without it, but it has always been my weak spot.

(Edit: I don't mean it in the "how much is 12% out of 45 USD? zomg I suck at math" way, that's 5.4 USD, I'm not an idiot. I mean it in the "vector calculus made sense, I think, but I could never have made a career out of it as I did with writing software and designing electronic devices" kind of way.)

My Systems professor was smart but had long stopped caring about that course and his students, so I learned most of the material by myself. At the time, I thought he was an idiot, but I've come to understand him in time. His course wasn't too torturous, largely because I skipped most of the classes.

Most of my colleagues (particularly those in CompEng) didn't take separate courses on Signals and Systems though. They had a single, bigger Signals & Systems course, that was taught by a couple of hardcore professors, both well into their sixties and both of them very draconian. One of them also taught an introductory Electronic Devices and Circuits course that I took, so I knew him firsthand: he was a very good professor, but he was about as flexible as a chopstick. An year when less than 1/3rd of his students failed the final exam was a really good year.

</comment></comment></comment></comment></comment><comment><USER13> I 'took' the stanford NLP course online it was great.

Doing this one now.

Funny - I did Fourier in Comp. Eng. - but it was jammed together with so many other things, I felt overwhelmed by all of it, I did enough to do decently on the exam, but I feel a lot of it was lost on me, and I forgot much of it.

Using fourier in most computer applications is very rare!

I'm excited to have a project I need to use it for - and weirdly stocked to be watching this video.

I love it when I have a reason to learn something awesome ...

<comment><USER13> The prof noted that it's almost all EE folks, with a few others, but didn't mention Comp Sci. Can anyone comment on why there were seemingly no Comp Sci people in this class? Wouldn't this be 'core' to Comp Sci?

<comment><USER14> >The prof noted that it's almost all EE folks, with a few others, but didn't mention Comp Sci. Can anyone comment on why there were seemingly no Comp Sci people in this class? Wouldn't this be 'core' to Comp Sci?

Why would it? Core CS deals primarily with discrete mathematics. Outside of a DSP or image processing course, there's little reason for a CS student to encounter the Fourier or other transforms.

<comment><USER15> I took a class on Scientific Computing (required) which went over a lot of core algorithms in various fields, including FFT. I wouldn't be surprised if a good portion of programs had something similar.

</comment></comment></comment></comment><comment><USER16> I went through this entire lecture series and I can't recommend it enough. Osgood is one of the most engaging professors I've ever listened to. I would happily learn anything from this guy. My only disappointment was that he doesn't teach anything else!

</comment><comment><USER17> Web page didn't work for me on my Safari. YouTube works fine: [https://www.youtube.com/watch?v=gZNm7L96pfY](https://www.youtube.com/watch?v=gZNm7L96pfY)

</comment><comment><USER18> I think I remember that the fourier transform is used to send a signal across a analog line, for DSL modems, after it's converted from binary.

Since analog lines may not have the same frequency response when it comes to interference, the modem usually tests the analog lines at various frequencies, and only keeps the intervals who are good enough to transmit.

I wonder if the FFT is used for wifi, since wifi passes through an analog signal.

Although I'm not even sure of what I'm talking about is true or relates to fourier.

<comment><USER19> Yes, Wi-Fi uses the FFT. In wireless systems, the method is known as OFDM (orthogonal frequency division multiplexing).

</comment></comment><comment><USER20> 30 lectures on Fourier transforms and not one mention of the Fourier transform over compact groups? (Which is arguably the most generalized/abstract formulation of the concept of a Fourier transform.) A lot of recent research has been done on FFTs over groups like the rotation group and the symmetric group, and this work has lead to significant progress on problems that were previously considered intractable.

<comment><USER21> > the Fourier transform over compact groups … is arguably the most > generalized/abstract formulation of the concept of a Fourier transform.

A good-spirited correction: anyone who knows enough to know this much generality knows that calling anything mathematical the "most generalised" version of a concept is begging to be corrected. Source: I do harmonic analysis on non-compact groups, and suspect that the folks over at the n-category café probably regard my kind of work as dangerously pedestrian (see, for example, [https://golem.ph.utexas.edu/category/2010/11/integral_transf...](https://golem.ph.utexas.edu/category/2010/11/integral_transforms_and_pullpu.html)).

<comment><USER20> Haha, fair point (although in my defense, I did qualify my statement with "arguably").

That's interesting that you do harmonic analysis on non-compact groups; I've been meaning to learn more about that actually. I've been working on group synchronization problems related to the ideas in this paper ([http://arxiv.org/pdf/1505.03840.pdf](http://arxiv.org/pdf/1505.03840.pdf)), which briefly mentions how one might extend the concept to non-compact groups, but doesn't elaborate further.

<comment><USER21> Sorry for the delayed response; I'm "submitting too fast".

> I did qualify my statement with "arguably"

I always tell my students—and, though it's a joke, I think that it's more true than casual consideration might suggest—that the correct answer (though not one that they're allowed to use on tests!) to any question in mathematics is "it depends." The more elementary the question, the more profound it sounds that you can see angles from which different answers can be correct. (Of course, backing this up with actual profound re-interpretations is the hard part. :-) )

> That's interesting that you do harmonic analysis on non-compact groups; I've > been meaning to learn more about that actually. I've been working on group > synchronization problems related to the ideas in this paper > ([http://arxiv.org/pdf/1505.03840.pdf](http://arxiv.org/pdf/1505.03840.pdf)), > which briefly mentions how one might extend the concept to non-compact > groups, but doesn't elaborate further.

As a decidedly pure mathematician, that's outside my wheelhouse, although I did have the pleasure of having some of the applications explained to me by one of the authors of one of the papers on cryo-electron microscopy cited in the linked article. I'm afraid that the idea of embedding a non-compact group in a larger, compact group is foreign to my way of thinking about things, so (in case you were implicitly asking) unfortunately I can't shed any light there.

</comment></comment></comment></comment><comment><USER22> very very highly recomended. Once you can understand the basis of this concept you open your mind to a whole new area of math and things like the finite element method for PDE's and wavelet transforms follow much more naturally.

</comment><comment><USER23> One of the fun ones, and this may or may not be covered by the link, is generating the "cumulants" for probability density functions. The basic idea in (basic, continuous) probability theory is that you have these things called "random variables" X,Y,Z which now need to be thought of taking on values with various probabilities; and the way we do that is to use calculus (where the d- in "dx" is a special notation coming from the word "difference"; "dx" means "a tiny little change in x"). The basic idea is that there is some _joint density_ j(x, y, z) such that the probability that simultaneously x < X < x + dx, AND y < Y < y + dy, AND z < Z < z + dz, is simply given by j(x, y, z) dx dy dz.

With a bit of calculation you conclude that if we want to analyze Z = X + Y, then the probability-density for Z alone must be h(z) = ∫ dx j(x, z - x); there are a couple ways to do this but my favorite is to use Z = X + Y as a schematic to write a Dirac δ-function j(x, y, z) = j(x, y) δ(z - x - y), then the standard "what is the probability-density for Z alone? integrate over both x and y!" rule comes into play. But you can also reason it out by hand, if you want.

Anyway, then you come up with this cool definition of independence; X and Y are independent if j(x, y) factors nicely into f(x) g(y); independent probabilities tend to multiply. So that's cool.

Now here's where the Fourier transform comes in; consider using a convention where we denote the Fourier transform and with the same function-name but using square brackets rather than parentheses for its application,

f[q] = ℱ{p → q} f(p) = ∫ dp exp(-i p q) f(p).

When we Fourier-transform h(z) for Z = X + Y we get:

h[a] = ∫ dz exp(-i a z) h(z) = ∫ dx dy exp(-i a (x + y)) j(x, y)

and if the two are independent random variables we find that h[a] = f[a] g[a]; the sum of independent random variables has a product of Fourier transforms precisely because the above sum takes the form of a convolution.

Taking a logarithm, we have that the χ(a) = log h[a] = log f[a] + log g[a] and any properties of the logarithm of the Fourier transform of the density function must be additive amongst independent random variables. And this gives the _cumulants_ of the random variables: pseudo-linear expressions (linear in independent random variables f(X + Y) = f(X) + f(Y), with f(k X) = q(k) * f(X) for some fixed q) which characterize the different "moments" of the random variables in question. In fact if we look carefully at the definition h[a] = ∫ dz exp(-i a z) h(z) we see that the variable P = k Z, having distribution b(p) = h(p/k) / k, generates b[a] = h[k a].

Calculating the zeroth, χ(0) = log h(0) = log 1 = 0. No biggie. Continuing the Maclaurin expansion gives χ'(a) = h'(a)/h(a) and at a=0 that's -i E(Z). We knew that the expectation value was linear, so no surprise there. The next term is (-i)^2 [h''(a) h(a) - h'(a) h'(a)]/[h(a) h(a)] which works out to just E(Z^2) - E(Z)^2, the familiar expression for the variance; so variance is pseudolinear (in this case q(k) = k^2). The point is, then you can just go on. There are in fact infinitely many pseudolinear cumulants which scale like q(k) = k^n, coming from this Maclaurin series, with a pattern based in fact entirely on the pattern of derivatives that comes out of log(f(x)).

As a freebie you have a proof of the central limit theorem. Take N independent identically-distributed random variables with characteristic functions χ(a), call them each X_i, form their sum S = sum_i X_i / N, and from the properties we've already seen in this comment its characteristic function must be ψ(a) = N χ(a / N). Do the Maclaurin series to 2nd order and ignore the latter terms for large N; you get convergence to a parabola, which means that the Fourier transform of the probability density is... a Gaussian! And the inverse Fourier transform of that Gaussian is just another Gaussian, so for large N the result must be a normal random variable with mean μ and variance σ²/N, which of course is what they must be, because means are linear and variances are pseudolinear.

<comment><USER24> Thanks for this cool writeup. My undergrad probability professor had us prove the CLT using cumulants, but I never kept the notes and had trouble finding the same proof later in life. Do you know of any reference that goes in depth about cumulants/FT/CLT?

<comment><USER23> Actually probably one of the best simple ones is Scholarpedia's article: in particular it covers one of the things that are kind of at the periphery of a non-applied statistician's mind when using cumulants: how the log-normal distribution serves as a handy counterexample to just about everything you'd like to prove about them (e.g. with some tweaking you can prove that the log- normal distribution's cumulant expansion is not unique, therefore you have an injection from PDFs to cumulants, not a surjection).

Something I've never seen rigorously explored: Cumulants appeared in my Master's work in condensed matter, where they at times seemed to have a mysterious tie to Feynman diagrams; that is, there seems to be some sort of analogy between how the Nth cumulant "subtracts out" all of the components of the Nth moment which are just products of the previous N-1 moments to obtain something "additive", and a Feynman diagram containing a vertex joining N particles. In particular Feynman diagrams for pairwise interactions seemed to be eerily similar to cumulant expansions which did not have any 3rd or higher moments. I confess I totally forgot this until I Googled today and saw a question on Math Overflow about it, but it was too sketchy to show me a real satisfying resolution of my mental curiosity. Similarly I remember seeing Young tableaux in some lecture notes on cumulants and then the day after I was working with Marcin Dukalski on some crazy approach he was taking in his thesis, and he spontaneously started talking about "hm, what do the Young tableaux look like for that?" and I was only able to help at all because of some limited understanding from the previous day's reading! So... there's definitely some mathematical resonances when you get to quantum theory.</comment></comment></comment>


Warren Buffett says economy fell off a cliff - <AUTHOR> http://www.businessweek.com/ap/financialnews/D96QHBG80.htm?chan=top+news_top+news+index+-+temp_news+%2B+analysis

<comment><USER2> Does anyone actually know what's _really_ wrong with the economy?

Because I've been reading about this shit for nearly two years and I don't have a real good handle on it, particularly how CDS are involved.

<comment><AUTHOR> Thomas Freidman said it all in the Sunday NYT:

We have created a system for growth that depended on our building more and more stores to sell more and more stuff made in more and more factories in China, powered by more and more coal that would cause more and more climate change but earn China more and more dollars to buy more and more U.S. T-bills so America would have more and more money to build more and more stores and sell more and more stuff that would employ more and more Chinese...

All the links begin to break...

<comment><USER3> Our dealings with China is really not what has created the mess we're in right now. I hope Thomas Friedman didn't actually blame the crisis on our trade imbalance with China.

This video [ [http://vimeo.com/3261363?pg=embed&sec=](http://vimeo.com/3261363?pg=embed&sec=) ] does a pretty decent job explaining the basics of the current crisis (~10 min).

</comment></comment></comment><comment><USER4> That's exactly what the latter part of my portfolio graph looks like.</comment>


Bots and newspapers - <AUTHOR> http://www.niemanlab.org/2017/04/these-are-the-bots-powering-jeff-bezos-washington-post-efforts-to-build-a-modern-digital-newspaper/ <comment><USER2> I really enjoyed this, but I'm not sure this headline does it any favors.</comment>


Fairpoint Pledges To Violate Net Neutrality - <AUTHOR> http://tech.slashdot.org/tech/08/12/27/1833202.shtml <comment><USER2> From the article and comments on slashdot it just looks like Fairpoint is cutting access to email from the verizon website in Febuary, which makes sense because Fairport is taking over Verizon's service in that area. So this really isn't a big deal.

<comment><USER3> Verizon apparently has some kind of portal for accessing other webmail services (why?) and after a certain date customers will have to use Fairport's portal instead. This is a complete non story.</comment></comment>


Electric Buses Are Hurting the Oil Industry - <AUTHOR> https://www.bloomberg.com/news/articles/2018-04-23/electric-buses-are-hurting-the-oil-industry <comment><USER3> It's a strange shift in affairs that China appears to have the greatest incentives (urban pollution, petroleum imports) today to advance clean transportation and energy while the US has stalled or moved backward, at least the Federal level.

Western European countries, for whom fossil fuels don't seem to be an identity politics issue like in the US, are also making more progress in electrifying their transportation and developing renewable generation - like those massive offshore turbines in the North Sea, or the more comprehensive EV charging networks.

Again, they seem to have stronger incentives: high gas/petrol prices, higher population density, tense relations with Russia - their big petroleum and natural gas supplier, and the desire to gain an advantage in clean energy technology while the US is seemingly regressing.

Perhaps states that have taken the problem seriously - wind in Texas, Iowa, EVs in CA, WA, NY, will carry the torch for the US without the Federal government's support.

<comment><USER4> I don't know if it really proves anything and it might be OT from your point, but, the confounding variable is that in the US - especially outside of the major urban areas - _everything_ is just very far away in terms of miles. Lacking a car, you can expect life to be very difficult. there are still plenty of places in the US where the range of a tesla might be a borderline problem week-to-week. (though probably not as often as people think and if you plan well)

My casual observation is that smaller countries just have a lot more good options when it comes to transit because the total distances are much smaller.

<comment><USER5> The OP was talking about China. China is bigger than the continental US. I think the persistent myth about the US's size being some unique problem doesn't explain much.

What's more, if you think of the EU as a comparison for the US, with the individual counties as analogues for US states, it seems to explain even less. Belgium and Massachusetts are the same size but over has much better transit options than the other.

<comment><USER4> In 2015, Belgium had a Population density of 363people/Km^2. Massachusetts in 2015 had 336 people/KM^2. So, pretty close. The difference is that Belgium has a much more uniform population distribution vs Massachusetts.

Secondarily, Belgium can define it's own national policy, while MA must compromise with the rest of the country, including CA, WY, MT, and NY, all of which have very different economic and practical concerns.

The US's size is not a unique problem, but, it is _a_ problem, and the governmental structure we have chosen does pose some unique problems.

<comment><USER5> Obviously the US has some structural issues, otherwise it wouldn't have these persistent failures. All I'm doing is pushing back against the simplistic "but the US is so big compared to all those tiny countries".

If you want to talk about density or uniform distribution... Why is Australian public transit so much better than American public transit?

America's governmental structure isn't unique either. There are other countries with the same kind of federalism.

And similar rebuttals can be made for virtually all other explanations.

I guess what I'm really getting at is that in the real world there are no easy solutions or explanations to problems despite the penchant in places like HN and Reddit to try to reduce explanations to a single paragraph. America's problems are likely due to a complex interaction between federalism, its geographic size, its traditional wariness of cities, its first mover advantage turning into obsolete infrastructure, and many other factors besides. But it is hard to know that the relative importance of any of those things actually is.

If you say Belgium can make its own policy, you are almost certainly making an off the cuff comment. There are dozens, possibly hundreds, of Europe-wide rules and regulations on transit that limit what Belgium can do. Belgium has to work across borders just like Massachusetts does. From Directive 95/19 on safety certification to Directive 2005/47 on the working conditions of workers on services that happen to cross a border. Since 2007 every European railway undertaking is able to off er rail freight services on every line in every EU country.

It is a mistake to paint a picture where Belgium has unlimited unilateral decision making powers.

<comment><USER6> > Why is Australian public transit so much better than American public > transit?

I would guess it's because Australia is, like, 99% uninhabited and uninhabitable or borderline uninhabitable[1], which probably means they can focus resources almost exclusively on the few densely populated areas. Additionally Australia's urban population seems to be significantly higher than America's (~89% vs ~80% according to 5 seconds of Googling I just did) so there's probably greater political will for investing in urban areas, and that political will probably also isn't resisted/sabotaged by an electoral system that grants hugely disproportionate representation to non-urban areas that have little to gain from realistic/economically sensible investments in public transportation.

[1] [https://www.reddit.com/r/MapPorn/comments/8ehplw/australian_...](https://www.reddit.com/r/MapPorn/comments/8ehplw/australian_population_density_2017_6776x4732/)

<comment><USER7> so USA has poorer public transport than Europe because the latter has much more uniform population distribution; USA also has poorer public transport than Australia because the latter has much more skewed population distribution.

american exceptionalism at its finest. :)

<comment><USER5> It's the Goldilocks syndrome. Population density has to be juuuust right to result in American transit. It couldn't possibly be due to any other factors.........

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> One interesting feature of articles like this that I don't really get is that they often leave out a huge huge quality of life benefit that electric vehicles bring: reduced urban machine noise.

<comment><USER9> The visceral excitement from the noise and vibration is a key part of auto marketing, and automakers are struggling to sell cars without it. Some people enjoy the attention they get from their loud, smelly cars - old Porsches, Harley Davidson motorcycles, and large trucks come to mind. Which is why some EVs play engine noises from internal speakers.

<comment><USER10> This sounds so bizarrely immature to me - like the trolls that sabotage their vehicle's noise suppression. I wonder if they realise they catch people's attention because the onlookers are simply waiting for them to leave so they can resume hearing themselves think.

Also, I thought EVs make noise to alert pedestrians and bicyclists, because the general public isn't used to quiet cars yet and honking the horn is likely to have the wrong effect.

</comment></comment></comment><comment><USER11> The scale of this is astounding and wonderful:

"China had about 99 percent of the 385,000 electric buses on the roads worldwide in 2017, accounting for 17 percent of the country's entire fleet. Every five weeks, Chinese cities add 9,500 of the zero-emissions transporters—the equivalent of London's entire working fleet, according Bloomberg New Energy Finance."

<comment><USER12> While electric buses are almost certainly an emissions win compared to the no doubt primitive and dirty Chinese diesel buses, I doubt it is it fair to call them zero-emission? China burns a lot of coal for electrical power.

<comment><USER13> That is picking nits :-) Not only is China rapidly building nuclear power plants, containing the emissions of one plant burning coal is easier than containing the emissions of the 10,000 buses that plant provides power to operate.

There is also a benefit to China converting from oil (something imported[1]) to coal (something available locally[2]).

[1] [https://oilprice.com/Energy/Crude-Oil/Chinas-Becomes- Worlds-...](https://oilprice.com/Energy/Crude-Oil/Chinas-Becomes-Worlds-Next- Top-Oil-Importer.html)

[2] [https://en.wikipedia.org/wiki/Coal_in_China](https://en.wikipedia.org/wiki/Coal_in_China)

<comment><USER14> > That is picking nits

No, actually it's not. The source of electricity matters, and just because something doesn't directly emit pollutants does __not __mean its power is derived without emitting pollutants.

<comment><USER13> I don't disagree the source of electricity does matter. But who is to say where the electron coming out of the plug came from? Perhaps it came from one of their existing nuclear plants[1] ?

For me, when you get to the point where you can construct two valid statements that both are supported by available information, yet one disproves a statement and the other proves it, you have reached the point of 'nits'.

In this case :

"They are not zero emission because electricity can come from a coal fired plant."

"The are zero emission because electricity can come from a nuclear power plant."

Pedants could go a different way, they could say "the _bus_ is zero emission but the infrastructure isn't."

We saw a lot of that with solar panels where people would argue that the energy to smelt the aluminum to make the frames and furnaces to grow the silicon ingots far exceeded any amount of energy that the solar cells themselves would provide.

But one has to wonder, what is the point of arguing at that level when, as the article states, the pollution where the buses are deployed is significantly less?

[1] [https://en.wikipedia.org/wiki/Nuclear_power_in_China](https://en.wikipedia.org/wiki/Nuclear_power_in_China)

<comment><USER15> > But one has to wonder, what is the point of arguing at that level when, as > the article states, the pollution where the buses are deployed is > significantly less?

Pollution where deployed isn't the issue, overall pollution is (the main impact of CO2 is climate change on a _global_ scale). Significant reductions in pollution are to be celebrated, but it's wrong - and takes away from your point - to emphasise something as " _zero_ emission" when it isn't.

<comment> Al-Khwarizmi _Pollution where deployed isn 't the issue, overall pollution is_

I think inhabitants of large Chinese cities that have to wear masks when they go for a walk would disagree.

Actually, both things are quite relevant. Pollution in cities poisons and kills people in the short run, climate change would kill us all in the long run.

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> Cyclist here in Tokyo with hybrid buses. The hybrid buses start from stop on purely electric power. The diesel engine seems to kick in at speeds above 10kph. Compared to the large amount of exhaust belched out of diesel only, as cyclist sometime stuck behind a bus, the electric start is a big relief.

Can't wait until Japan adopts the same all electric design.

<comment><USER17> Here in Germany with have quite a few hydrogen powered buses.

Examples:

(German) [https://www.ksta.de/region/rhein-erft/huerth/ab-2019-neue- wa...](https://www.ksta.de/region/rhein-erft/huerth/ab-2019-neue- wasserstoffbusse-fuer-huerth-geplant-29511032)

But also elsewhere in Europe (here: South Tyrol, Italy): [http://www.greenmobility.bz.it/en/projekte/die-bozner- wasser...](http://www.greenmobility.bz.it/en/projekte/die-bozner- wasserstoffbusse/die-bozner-wasserstoffbusse/)

Nothing but water vapor coming out of them.

<comment><USER18> > Water vapor is the most potent greenhouse gas owing to the presence of the > hydroxyl bond which strongly absorbs in the infra-red region of the light > spectrum. [1]

Though I can't tell whether water vapor created at the surface has the same effect as water vapor at altitude.

[1] [https://en.wikipedia.org/wiki/Water_vapor](https://en.wikipedia.org/wiki/Water_vapor)

</comment></comment></comment><comment><USER19> Please stop linking to Bloomberg.

The auto-play video at least is muted, but when you go and press the pause button it... unmutes the video. Then you have to press it again to actually pause.

Fuck these guys and their dark patterns.

<comment><USER20> Better than the NYT/WSJ/etc links that slam you right into paywalls.

<comment><USER21> Use this bookmarklet:

        javascript:window.location.href='https://m.facebook.com/l.php?u='+encodeURIComponent(window.location.href);

</comment></comment></comment><comment><USER22> I think few people know that a bunch of public transit was actually electric in the early/mid 20th century. Car companies, most notably GM, conspired to convert public transport to gas to make public transit less comfortable compared to private car ownership[1].

[1] [https://en.wikipedia.org/wiki/General_Motors_streetcar_consp...](https://en.wikipedia.org/wiki/General_Motors_streetcar_conspiracy)

<comment><USER23> I remember riding on Dunedin's (New Zealand) Trolley Bus service when I was very small, which were standard bus bodies that were hooked to overhead power lines. I remember the driver hooking the bus back to the power lines. Must have been about '78 or '79.

<comment><USER24> I remember them in Auckland at about the same time. Every trip it would lose the contact with the overhead lines and the driver would get out with his stick and move it back. I also remember for the being very quiet, except for a quiet hum and whine inside. And they accelerated very fast.

</comment></comment></comment><comment><USER25> While the reducing pollution piece is captured here, interestingly the reducing oil imports dependency is not captured in the article which I would imagine is equally important here.

<comment><USER26> I guess with the advent of shale, things aren't as black-and-white for the U.S. as they once were.

<comment><USER27> With regard to the US, I would argue the dependence on fossil fuels is bad regardless if the oil is imported or not. Being a fossil fuel "producer" is a misnomer because you aren't creating new fossil fuels. You are simply burning through your own home reserves faster.

</comment></comment></comment><comment><USER28> It is clear that China, in particular, has embraced a future-oriented way of thinking in managing its society. While I quite fundamentally disagree with some of what the leadership does in terms of human rights & democracy, it is certain that they are taking bold and progressive steps in technological areas.

I should learn Chinese - I expect it to be the key language in 30 years.

<comment><USER29> as machine translation is a field of machine learning research with the largest budgets and even though it's not perfect it's already pretty good, in 30 years it will likely be solved and it may not really matter which language you know

<comment><USER30> Machine translation is AI-hard. If this happens in 30 years we might as well have reached the singularity as computers will understand natural language and all of its meaning completely.

<comment><USER18> If Google Translate hasn't surpassed OP's ability to speak Chinese in 30 years then I'll eat my hat.

</comment></comment></comment></comment><comment><USER31> What's sad is that the majority of electric buses being purchased both in America and around the globe aren't manufactured in the US.

We have a Silicon Valley company, Tesla, that kicked off the world-wide move to battery powered autos. Why is there not a US company recognized as the leader in buses?

There are a few California companies on this list but they're tiny. Here in Michigan the leading player is French and they're self-driving as well. I wonder how American manufacturers failed to grab this market. Detroit should have owned this industry.

[https://en.wikipedia.org/wiki/List_of_electric_bus_makers_an...](https://en.wikipedia.org/wiki/List_of_electric_bus_makers_and_models)

<comment><USER32> > What's sad is that the majority of electric buses being purchased both in > America and around the globe aren't manufactured in the US.

Detroit should have gotten started on this, sure. But who in Detroit? There just aren't that many American coach builders left in the transit space. GM's bus division got sold off in the 80s, and eventually got sold to Volvo. Flxible eventually went out of business in the 90s (not helped by safety issues). Mack got out of coach building ages ago (and is owned by Volvo these days). Neoplan just built German designs, and went out of business about ten years ago. NABI just built Ikarus (Hungarian) designs and got bought out and shut down by Volvo. Ford and Kenworth haven't built buses in ages. Crown imported some Ikarus buses, but they went out of business a while ago. Blue Bird doesn't do transit buses to the best of my knowledge. Gillig is still around but has mostly been a bit player in the Bay Area at least.

That said, Reagan's Buy American mandate has ensured the opposite, at least within the public transit sphere. Major components that are not American made need waivers if DOT funds are used.

Trolley coaches (what many may think of when they think of electric buses) are pretty rare in the United States. Out here our trolley coaches are mostly Orion (Canadian, bought by Mercedes-Benz, now defunct) and New Flyer (Canadian). Both assembled their vehicles in the United States. Hell, even our decrepit Skoda buses were assembled in San Francisco.

Battery electric buses are almost unheard of in the United States (unsure if this the chicken or egg part of the problem), and the only ones I've seen in person were in Madrid and those were tiny.

Diesel-electric hybrids are becoming quite a bit more common, and for the diesel part of the hybrid equation you'll generally find American motors (e.g. Cummins, Detroit Diesel).

So, sure, it'd be nice to see American companies leading the way with electric buses (at least domestically). I'd argue there's just not enough critical mass for that to happen. It's the same reason Sukhoi's SSJ hasn't sold well. They have such minimal presence outside of Russia that it's hard to get parts and support for them. Even Mexico's Interjet which has reportedly been quite happy with their SSJs has had to ground them.

<comment><USER33> Here in Los Angeles, LADOT has a handful of battery electric buses in their fleet, for the short DASH routes near downtown [1]. LADOT is the smaller, municipal counterpart to the county's Metro system. The buses themselves are a bit shorter than an average city bus, though that is typical for DASH. I wouldn't call them tiny.

I guess that because they're so quiet, when the bus makes a turn, a loudspeaker on the front of the bus calls out, "Bus is turning right." Pretty funny to hear the first time.

[1]: [https://la.streetsblog.org/2017/01/12/electric-dash-buses- to...](https://la.streetsblog.org/2017/01/12/electric-dash-buses-to-begin- service-in-dtla-next-week/)

<comment><USER32> Well tiny is relative, they were probably 25-30ft long which is fairly standard in the US. Meanwhile San Francisco has 40 ft and 60 ft hybrid and trolley coaches.

</comment></comment></comment></comment><comment><USER34> You know, they could have titled this article: "Electric Buses are affecting the Oil Industry."

Yet they didn't. Are we supposed to feel sorry for the oil industry? The electric car can't come fast enough.

</comment><comment><USER35> Working at Proterra, we're doing our part.

<comment><USER36> Can you outline a bit how cities are customising the buses?

I've a bit of the report posted here a week or so. There are over 20 companies (of course ones in US and EU paying 2-3x over Chinese ones) and I can't fathom what they are competing over. Seems like a huge waste of resources.

<comment><USER35> It's one of the difficulties in manufacturing for US entities is the huge amount of customization. Pretty much everything outside of the shell, battery pack and motor, can/is customized.

We of course think our tech is better.

</comment></comment></comment><comment><USER37> "they consume 30 times more fuel than average sized cars". Is that true? That seems gigantic, I thought taking so bus was so much better for the planet than taking your car.

<comment><USER38> Bus weighs ~30,000 pounds. Car, ~4,000. So I would question this stat.

At full capacity, a bus would be able to pack more people, in a much smaller space than a full capacity car, so there's your savings in fuel.

Plus I would assume that one, larger engine in a bus is more efficient than ~10 smaller engines. There's also the hidden cost of manufacturing a bus - does one bus take less resources to manufacture than the cars it may be able to replace?

According to,

[https://en.wikipedia.org/wiki/Energy_efficiency_in_transport...](https://en.wikipedia.org/wiki/Energy_efficiency_in_transport#Buses)

"A commuter service in Santa Barbara, California, USA, found average diesel bus efficiency of 6.0 mpg‑US (39 L/100 km; 7.2 mpg‑imp) (using MCI 102DL3 buses). With all 55 seats filled this equates to 330 passenger mpg; with 70% filled, 231 passenger mpg.[51]"

[51] [http://www.nrel.gov/docs/fy00osti/26758.pdf](http://www.nrel.gov/docs/fy00osti/26758.pdf)

<comment><USER39> Plus more busses means less congestion and smoother traffic causes less emissions.

</comment></comment></comment><comment><USER40> Worried as I am about China's authoritarian practices and their growing influence, they sure are effective at solving environmental problems.

<comment><USER41> You may have missed this point in TFA;

"China is ahead on electrifying its fleet because it has the world's worst pollution problem. With a growing urban population and galloping energy demand, the nation's legendary smogs were responsible for 1.6 million extra deaths in 2015, according to non-profit Berkeley Earth."

It's great to celebrate progress, but don't fall for the spin.

A study published in Nature [1] found 3.3 million deaths per year worldwide attributed to air pollution. China owning nearly half that is mind blowing.

The figure for the U.S., by comparison, is 60-80,000. In terms of per capita mortality rate, China's polution problem is 5x more deadly. [2]

Economics is the study of allocation of scarce resources. China investing more heavily in electrifying their buses is not surprising in the context of a deadly pollution epidemic. The same level of investment into electric buses in the US would be a tradgedy in the sense of actual lives lost due to gross misallocation of public funds.

[1] - [https://www.nature.com/articles/nature15371](https://www.nature.com/articles/nature15371)

[2] - (1.6e6 / 1.3e9) / (8e4 / 3.2e8)

<comment><USER3> > The same level of investment into electric buses in the US would be a > tradgedy in the sense of actual lives lost due to gross misallocation of > public funds.

I get it that you don't like public investment in electric buses, but there is no evidence to suggest that such investment would cause any "actual lives lost", vs the other much bigger public budget items in the US.

If anything, more people in buses would likely reduce a significant cause of deaths in the US: car accidents.

<comment><USER41> I have no issue at all with the appropriate level of investment in electric buses.

Investment in public transit in general is besides the point. It's economic fact that paying more for an _electric_ bus and building the infrastructure to support them is more justifiable and will provide better ROI in China where the pollution is 5x more deadly.

If your metric is spending dollars efficiently to save lives, there's better ROI in the US by spending the money elsewhere.

<comment><USER3> > If your metric is spending dollars efficiently to save lives, there's better > ROI in the US by spending the money elsewhere.

It's massively oversimplifying the trade-off to reduce it to a single metric, and it proposes a false choice.

Why not also consider reducing congestion, reducing local-air-pollution related respiratory conditions, etc?

And compared to the known types of huge government expenditures that might be doing actual harm to some subset of citizens (i.e. lives lost in wars of questionable value) why point the finger at electric buses?

</comment></comment></comment></comment></comment><comment><USER42> Okay, cool. But the energy still has to be produced somehow. Are we shifting the diesel to coal power plants? So for every km driven, what is the comparative amount of CO2 produced? Is there a net benefit in this regard? Coal power plants might be more efficient, but then we are shifting the smoke stacks.

Then what about the batteries? The batteries need to be produced, and they have a useful lifespan, then need to be disposed of or recycled. How do we deal with all of that contamination?

Are we further ahead with electric cars and buses?

I went to the Volvo museum last year and learned that pneumatic tires consume something like 30% of the energy expended by road vehicles, should we not be focusing on better rail transport? Or solid tire technology?

<comment><USER43> Even producing electricity from non renewable in large power plants is better than using these same fuels directly: large power plants are much more efficient (close to 40% energy efficiency vs 30% for vehicle motors), and allow much more easily to filter out pollution, including CO2 capture. Sure going from diesel to coal would be bad, but going from diesel engines to diesel power plant would be a significant gain.

<comment><USER44> It is also a lot easier to shift centralized power generation (from coal to natural gas, to wind, import from neighbour countries) than across the fleet of millions privately owned vehicles.

</comment></comment></comment><comment> white-flame Diesel vs electric is a false dichotomy. Many cities in north america have natural-gas powered buses, and a lot of taxi fleets are CNG as well. Then there's also old-style cable cars and overhead electric lines scattered around, too.

<comment><USER45> CNG misses the win from regenerative braking on a massive vehicle in traffic. That's going to reduce the fuel burned even if the systems are comparable in emissions and also reduces the particulate emissions from brake pads which are linked to various health problems.

<comment><USER46> > CNG misses the win from regenerative braking on a massive vehicle in traffic

CNG hybrid busses are gaining traction where I'm from in Europe [https://www.vanhool.be/en/public-transport/exquicity- brt/cng...](https://www.vanhool.be/en/public-transport/exquicity-brt/cng- hybrid)

<comment><USER45> Good clarification: I should have specified that as direct drive since hybrid approaches can clearly make sense and I'd bet can be easier to engineer since the engine doesn't need to handle variable speed and power demands.

</comment></comment></comment></comment><comment><USER47> This doesn't include trolleybuses, which are more common in Europe (not by orders of magnitude, but still).

Also some modern trolleybuses have batteries in them so they can service routes where power lines are only on parts of the route.

</comment><comment><USER48> Isn't that the point? What a strange title for an article.

<comment><USER49> I thought the same. The title portraits the change as a negative thing and in the text there is no mention of the benefits that this brings :/

</comment></comment><comment><USER50> I'm a bit surprised nobody has mentioned the fraud[1]. The reason electric bus becomes so popular in China recently is mainly because of government subsidies. Well that's the intended consequence and most people are OK with it.

What's problematic is that the subsidy is a fix amount for certain kind of vehicle. And it turns out bus is more efficient in terms of subsidy/cost ratio. And since the subsidy is a fixed amount, bus maker can cut a lot of corners and make a bare minimum of a bus which may cost even less than the subsidy. Now they can dump these buses to a local government basically free and bribe the operators to drive the buses once a while to receive the subsidy[2].

I mean I'm all for green buses. But if electric buses out-sale electric cars a lot, you have to wonder why. And one obvious reason is buses are mostly bought in large quantities by entities not very concerned about cost/profitability, ie local governments. So it is much easier for bus related fraud than cars facing mostly individual consumers.

[1] [https://www.wsj.com/articles/china-fines-five-auto-makers- fo...](https://www.wsj.com/articles/china-fines-five-auto-makers-for-electric- vehicle-subsidy-fraud-1473337367) [2] [http://www.sixthtone.com/news/1001382/company-accused-of- run...](http://www.sixthtone.com/news/1001382/company-accused-of-running- empty-buses-for-green-subsidies)

</comment><comment><USER51> I have been of the opinion that the US government should have not pushed EV adoption by subsidizing moving all school buses to EV. The reasons are many but most important is having children used to the idea of EV as a good means for local travel, not having all those diesel buses spewing fumes on to people while loading and unloading at schools, and finally keeping school systems from financial issues incurred by rising fuel costs.

This page gives the numbers of one of Georgia's largest school bus fleets. [http://www.cobbk12.org/centraloffice/Transportation/](http://www.cobbk12.org/centraloffice/Transportation/)

(numbers)

        875 Bus Drivers
        139 Bus Monitors
        886 Conventional Buses
        288 Special Needs Buses
        870 Routes per day
        37,530 Bus Stops per day
        68,673 Miles Traveled per day
        72,544 Students Transported each day

<comment><USER52> Extraneous "not"?

"...should have _not_ pushed EV adoption..."

</comment></comment><comment><USER53> China is definitely going on the right direction, I live in Bogotá Colombia and according to the mayor of Bogotá, the benefit of electric buses are comparable to buses fueled by natural gas, which I think is not that accurate. Despite the new trending worldwide of adopting electric buses, we are not getting them in the near future part of it are political reasons because the cost of an electrical bus is about the same than a diesel bus as far as I know.

Hopefully, this changes in the near future and the government get serious about going green on the public transportation.

</comment><comment><USER54> Completely off topic but it just occurred to me that I haven't seen the "X is killing the Y" rhetoric recently and I'm grateful for that.

</comment><comment><USER55> Can people please stop talking about "zero emission" when talking about electric vehicles. This is intellectual dishonesty. The electricity isn't generated without emissions. The car isn't "environmental". The only environmental vehicle is the one that is _NOT_ manufactured.

</comment><comment><USER56> I think Lithium Ion is hurting OPEC [https://en.wikipedia.org/wiki/Energy_density#Energy_densitie...](https://en.wikipedia.org/wiki/Energy_density#Energy_densities_of_common_energy_storage_materials)

</comment><comment><USER57> If they have good batteries and enough nuclear power, charging vehicles will take care of extra electricity produced during nights.

Win-win

</comment><comment><USER58> But, how are they making electricity? Coal?

<comment><USER59> About 66% is coal: [https://en.wikipedia.org/wiki/Electricity_sector_in_China](https://en.wikipedia.org/wiki/Electricity_sector_in_China)

But it's on a downtrend. I believe it's a lot easier to clean up centralized sources of pollution (power plants) than diffused ones (vehicles).

I'm mostly worried about batteries and the politics and rare earth metals.

<comment><USER60> China has traditionally had the opposite problem: cars had decent enough emission equipment while coal plants would frequently disable their own (coal contributed to more of Beijing's problem than vehicle emissions, mainly because of poorly operated heating plants). With the crack down on pollution, that is changing, though the real clean up happens when they move off coal (to NG, renewables, and nuclear).

</comment></comment></comment><comment><USER61> Oh, shucks...

</comment><comment><USER62> Hurt it harder. The oil industry deserves to be ruined with absolute malice.

</comment><comment><USER63> Good.

</comment><comment><USER64> I wonder what happens when China becomes more environmentally friendly than the US. What sort of excuses will the Trump crow come up with then?

Usually whatever is done in Europe is ignored in the US, with the reason that China is so much worse. China has been a useful bogeyman for conservatives for decades as a reason to not make any sort of improvement whether related to the environment, workers salaries, work conditions, universal health care etc.

</comment><comment><USER65> Oh, the humanity

</comment><comment><USER66> Sounds like good news

</comment><comment><USER67> Is this a submarine PR ad for the Chinese government? Not to take away from the objective positivity of the actual facts, but it feels eerily cheerleady. Almost childish, if nothing else… I count at least five pointless "ha ha look who's laughing now" and "China is leading the world" in this, and a surprising lack of counterbalance. Perhaps I'm just seeing things?

But yes: great.

<comment><USER68> I think you are seeing things. China is mentioned because they had the worst pollution problems, seriously invested in electric, and are now realizing the payoff. The numbers support the narrative.

<comment><USER69> Shenzhen resident here. Every time a large petroleum vehicle goes past I hear it. On the other side of the block there is a bus depot - totally silent - <USER2> Shenzhen buses and 50% of taxis are now electric. It's great.

<comment><USER23> Has there been an improvement in air quality or have the changes been too small to have an impact as yet?

<comment><USER69> Haven't been here long enough (~12 months) to anecdata that, but it's generally recognized that government policies are increasing air quality rapidly in many major cities. Example policies: routinely spraying water on the roads in dusty areas and near construction sites, banning motorbikes from city centers, banning the import of second hand vehicles, encouraging electric vehicles, moving polluting industries away from population centers, increasing industrial regulation, reducing opportunities and increasing penalties for corruption. I have a German friend who builds air quality monitoring systems for export here and he said that restaurant kitchen air vents are actually one of the worst urban air polluters now. Another is construction. He said India's cities, especially Delhi, are literally off the charts (sensors incapable of registering pollution levels that high) and that, compared to India, China has things well under control.

<comment><USER70> > banning motorbikes from city centers

Dirty thing people miss about motorbikes. Better mileage, but not as much as you would think, in return for a lot more emissions. That said I'm lead to understand that electric motorcycles and bicycles have become very common in China.

<comment><USER9> Larger motorcycles, like Harley Davidson, use the same size engines as compact cars, like the Honda Fit. And they make a lot more noise dong so, which is part of the marketing for them.

Will automakers start putting "engine speakers" on electric Harley Davidson motorcycles and playing engine noises through them?</comment></comment></comment></comment></comment></comment></comment>


Brief Introduction To General Purpose Hash Functions - <AUTHOR> http://www.partow.net/programming/hashfunctions/index.html <comment><USER2> I think you have confused "ideal hash function" and "perfect hash function". A perfect hash function is one that maps a finite set of keys into the same number of buckets with no collisions. They have to be tailor constructed for the keys they are intended for and are not for general purpose use.

An ideal hash function on the other hand produces output that is indistinguishable from choosing the hash value for every key independently and randomly. In particular an ideal hash function should be a PRF, and it should handle any input size, and any keyset.

They aren't the same thing _at all_ , and you should not confuse them. You cannot substitute an ideal hash function for a perfect hash function, or vice versa.

<comment><AUTHOR> @demerphq (Yves Orton):

> "They aren't the same thing at all, and you should not confuse them. "

You're absolutely right. The term "idea hash function" was what I was after all along - I just couldn't find a formal definition of it. In any case I've updated the article accordingly. Thank-you for your review and comment.

<comment><USER2> You are welcome. I wanted add another point. rurban does have a bit of a point. The hash functions you referenced in your article are generally old and low quality, and slow. FNV is neither a good hash, nor is it fast. FNV_yt is very fast, but not the best quality hash function, it fails many tests in SMHasher, including some I personally consider dealbreaker: failing avalanche tests is unacceptable.

Both rurban and I have (independently) spent considerable time testing about 100 hash functions using the hash test suite smhasher. In addition I have greatly enhanced smhasher, and included test results and graphs in my version. Included in my fork is the --stream option so you can test different hash functions in counter mode with tools like the dieharder RNG test suite.

[https://github.com/demerphq/smhasher](https://github.com/demerphq/smhasher) [https://github.com/rurban/smhasher](https://github.com/rurban/smhasher)

These are the FNV test results from my version of SMHasher:

FNV1a 32 32 32 FAILED 99 of 183 tests. Avalanche: 17-41, Crc-MultiCollision: 81, 83, 85-86, 88-91, 94, 96-98, 100, Cyclic: 42-52, Hi-Lo: 157-158, HiBit- Null: 150-152, Highbits2: 147-149, Highbits: 144-146, LowBit-Null: 153-155, Lowbits: 142-143, Murmur2-MultiCollision: 101-110, Murmur3A-MultiCollision: 111, 113, 117, 119-120, Murmur3F-MultiCollision: 122-127, 129-130, OverAll: 183, Text: 160-165, TwoBytes: 54-56, 63, Zeroes: 167-168

FNV1a_YT 32 32 32 FAILED 67 of 181 tests. Avalanche: 15-39, Differential: 9-14, Hi-Lo: 154-156, HiBit-Null: 148-150, Highbits2: 145-147, Highbits: 142-144, Lowbits: 139-141, OverAll: 181, Sparse: 74-78, Text: 157-158, 160-163, TwoBytes: 51, 53-61

FNV64 64 64 64 FAILED 66 of 183 tests. Avalanche: 17-41, Cyclic: 43-45, 47, 49, 51-52, Hi-Lo: 157-158, HiBit-Null: 151-152, Highbits2: 148-149, Highbits: 145-146, LowBit-Null: 154-155, Lowbits: 142-143, OverAll: 183, Sparse: 65-67, 69, 71, 73, 75, 77, 79-80, Text: 160-162, 164-165, TwoBytes: 54-56, 58, 60, 62-63, Words: 182, Zeroes: 167-168

You can see text view of the full list at:

[https://github.com/demerphq/smhasher/blob/master/doc/summary...](https://github.com/demerphq/smhasher/blob/master/doc/summary.txt)

Also after reading this thread I added some graphs comparing performance of other hashes, including some that I have developed using genetic algorithm for use in Perl. Some of those hashes have hash-time performance at the top of the envelope (StadtX is very fast).

[https://github.com/demerphq/smhasher/blob/master/doc/graph/F...](https://github.com/demerphq/smhasher/blob/master/doc/graph/FNV_Comparison.long.svg) [https://github.com/demerphq/smhasher/blob/master/doc/graph/F...](https://github.com/demerphq/smhasher/blob/master/doc/graph/FNV_Comparison.medium.svg) [https://github.com/demerphq/smhasher/blob/master/doc/graph/F...](https://github.com/demerphq/smhasher/blob/master/doc/graph/FNV_Comparison.short.svg) [https://github.com/demerphq/smhasher/blob/master/doc/graph/F...](https://github.com/demerphq/smhasher/blob/master/doc/graph/FNV_Comparison.tiny.svg)

You may also be interested in looking at

[https://github.com/demerphq/smhasher/blob/master/HashAnatomy...](https://github.com/demerphq/smhasher/blob/master/HashAnatomy.md)

Good luck!

<comment><USER3> Thanks for saying this! It is incredible how widespread still is the belief that FNV is a good hash function, when much better ones exist that are faster even on short keys.

<comment><USER2> I am only repeating what my tests say. I was surprised frankly, given FNV's reputation, to see it fail so many tests.

Also I put a lot of effort into improving the quality of testing that smhasher does, so there are many hashes that would pass the old version which will fail the new one.

</comment></comment></comment></comment></comment><comment><USER4> Just read the first two intro paragraphs, and already stumbled on 2 major mistakes:

"Hash functions are by definition and implementation pseudo random number generators (PRNG)."

No.

> "In practice it is generally recognized that a perfect hash function is the > hash function that produces the least amount of collisions for a particular > set of data."

No. A perfect hash function produces no collisions. "Least collisions" => better but not perfect.

I briefly looked over the rest, and this looks much better.

Just the last section is a bit misleading. First he talks about hashing in general and then he introduces his implementations of hash functions as "Available Hash Functions". This is not a generalization as above, it's merely his collection.

DJB: "It is one of the most efficient hash functions ever published." Nonsense. FNV is considered the generally most efficient simple hash function. DJB ranks in the middle of generic unaligned string hash functions.

<comment><AUTHOR> @Rurban (Reini Urban): wrt to your first point, general purpose hash functions being modeled as PRNGs, I believe that statement to be correct. It is definitely the case when analysing hash function behaviour in contexts such as bloom filters, hash tables etc.

With regards to the definition of perfect hash functions - if you had read the sentence before the one you have quoted, you would have notice that the formal definition for a perfect hash function has been given in the article as:

> "In general there is a theoretical hash function known as the perfect hash > function for any group of data. The perfect hash function by definition > states that no collisions will occur meaning no repeating hash values will > arise from different elements of the group."

It then goes on to talk about the practicalities of perfect hash functions (deriving them etc), then makes a statement that generally a perfect hash function is one that has the least collisions - I agree that it is an intentional weakening of the formal definition, but it is generally the most practical one - as there is no guarantee that one can always find a "perfect hash function" for any arbitrary set of values in sub-polynomial time.

\----

wrt the collection of hash function, take note that the article is broken into the following sections:

1\. What is a general purpose hash function

2\. Designing and implementing general purpose hash functions

3\. Uses of hash functions

4\. Example general purpose hash functions (popular ones or written by leaders in the field, and dummies such as myself)

5\. Downloads

So could you clarify what it is you meant by:

> " last section is a bit misleading. First he talks about hashing in general > and then he introduces his implementations of hash functions"

what specifically was misleading in the article? I'm confused, could you please clarify.

\----

wrt: > "DJB: "It is one of the most efficient hash functions ever published."

The statement is _not_ incorrect, it is indeed one of the most efficient hash functions out there, it may not be the MOST efficient or in other words "the number one hash function", but it's there at the top - I think you may have jumped the gun on that one too.

To further that, your comment: " Nonsense. FNV is considered the generally most efficient"

Lets have a look and see if that's true, the following are pseudo code representations of the mixes for each of the hash functions:

DJB: hash = ((hash << 5) + hash) + msg_byte

FNV1: hash = hash ^ msg_byte * FNV_prime

Unless you have a really bad shift operation (eg: having no barrel shifter present), then I can't see how FNV1 can be significantly more efficient than DJB - but then again, the compiler may optimize the shift right by 5 as a multiply by 32 for targets where the mul is faster than the shift...

But lets step back a bit and consider the following:

Is hash function efficiency that important when neither of the hash functions DJB or FNV1 posses good distributive qualities?

[https://research.neustar.biz/tag/hash- function/](https://research.neustar.biz/tag/hash-function/)

<comment><USER4> ad 1: [https://stackoverflow.com/questions/31954237/pseudo- random-g...](https://stackoverflow.com/questions/31954237/pseudo-random- generator-hash-function) has some answers.

ad 2: in most measurable stats fnv1 is better than djb. practical throughput, time if inlined, cachegrind cost model (4x!). fnv also produces less collisions with average keys. only in pure cycle/hash djb is a bit better.

[https://github.com/rurban/smhasher#smhasher](https://github.com/rurban/smhasher#smhasher) [https://github.com/rurban/perl-hash-stats#perl-hash- stats](https://github.com/rurban/perl-hash-stats#perl-hash-stats)

> ad 3: Is hash function efficiency that important when neither of the hash > functions DJB or FNV1 posses good distributive qualities?

It depends entirely on the use case. Usage in hash tables is totally different to usage as file or block checksum or crypto. Besides looking how many bis of the keys are really used or how easy it is to create collisions, it also depends if the keys are random length strings, aligned buffers or plain integers. Both DJB and FNV1 are considered bad regarding their stats. But they are small and fast.

</comment></comment></comment><comment><USER5> It might be worth mentioning popular functions like FNV ([http://isthe.com/chongo/tech/comp/fnv/](http://isthe.com/chongo/tech/comp/fnv/)) MurmurHash ([https://github.com/aappleby/smhasher](https://github.com/aappleby/smhasher)) and SipHash ([https://131002.net/siphash/](https://131002.net/siphash/)).

</comment><comment><USER6> The post uses the term "internal state" pretty early on(initialize internal state, etc) and continues to reference it frequently for the algorithmic steps but nowhere is "internal state" defined. Can someone explain to me what this "internal state"?

<comment><USER7> Internal state is typically a small-ish bag of bits that mixes, and gets mixed deterministically, as the hash mechanism is used. See the internals of the Mersenne Twister[0] for an example/analogy.

[0] [https://en.wikipedia.org/wiki/Mersenne_Twister#Initializatio...](https://en.wikipedia.org/wiki/Mersenne_Twister#Initialization)

<comment><USER2> It is only small in older hashes. Modern hashes tend to have a state larger than both the seed and the input block.

See:

[https://github.com/demerphq/smhasher/blob/master/HashAnatomy...](https://github.com/demerphq/smhasher/blob/master/HashAnatomy.md)

It actually turns out there are performance benefit by having a larger seed, but not too large. (If you think about it this makes sense consider how many bits you can change with an average combining operation, and with a worse case combining operation.)

</comment></comment></comment><comment><USER8> A great resource for hash function performance: [https://www.strchr.com/hash_functions](https://www.strchr.com/hash_functions)

It includes a bunch of more modern hash functions the author missed.

</comment><comment><USER9> +1 "Brief" Introduction lol

<comment><AUTHOR> Once upon a time it was 'brief'... that is to say circa 2001 :D</comment></comment>


Ask HN: Which are the best solutions to build an ecommerce website? - <AUTHOR>

Apart from Tictail and Shopify, there are another interesting solutions to build an ecommerce website? <comment><USER2> I imagine, it might depend largely on what you're specifically looking for: configurability, design, turn-key readiness, drop-ship integration, sales tax automation, responsive support etc. If you have a preferred payment gateway or would like to use your own custom SSL cert, that will impact your choices as well. In the meantime, take a look at Volution, Bigcommerce, Corecommerce, Squarespace, Big Cartel, and Storenvy. If you're looking to build something in-house: check out SpreeCommerce and Magento.</comment>


Hong Kong Leader Backs Down on China Law But More Protests Planned - <AUTHOR> https://www.wsj.com/articles/hong-kong-to-suspend-controversial-extradition-bill-11560579580?mod=rsswn <comment><USER2> Her discourse is really manipulative, in it you can find your typical attempt to divide people by focusing on the downside of demonstrations (injuries, crime, etc.), on the lie that it is a divisible bill, and on fake low numbers (10,000? more like millions).

This is very concerning. It feels like Hong Kong is doomed to lose more and more of its independence, and freedom of speech, and freedom of press, as the years go on.

I have a lot of friends and family there, and as much as I love China and can understand their politics due to the size of their country, I do not wish Hong Kong citizens to lose any of their rights.

<comment><USER3> Oh, well, as a "mainlander", I tell you: Hong Kong citizens WILL lose all their rights, and it will come sooner than you think.

If you watched this protest and all their other protests, it is very easy to see one thing: Their action is isolated, they don't have the power to unite people other than themselves. Nobody besides themselves will stand for them. Nobody in mainland support them, nobody in mainland understand them. Many mainlanders even developed Schadenfreude when looking at those protests.

(OK, "Nobody" is a bit of over exaggeration, but fairly right if you want to feel the situation)

Why? Because they are protest only for their own rights, on their own little land that nobody cares anymore. It's not about greater good, not "making the entire China democratic". Just "We're Hongkongers, we are special, so we must have those rights", while don't give a damn when the rest of China is been stripped clean.

How many HongKonger protested when Xi changed the Constitution? Not this much.

Nobody cares about your right if you don't defend the right of the others. 50 years, if they don't change China for the better, China will change them, as simple as that.

<comment><USER4> Disclosure: Hong Konger

> Why? Because they are protest only for their own rights, on their own little > land that nobody cares anymore. It's not about greater good, not "making the > entire China democratic". Just "We're Hongkongers, we are special, so we > must have those rights", while don't give a damn when the rest of China is > been stripped clean.

Every year on 4 June, Hong Kong people hold a vigil in Victoria Park for the Tiananmen square crackdown [1][2], and one main theme of the vigil is to continue the spirit of the 1989 Tiananmen Square protests: to make the entire China democratic (one of the slogans is 建設民主中國, literally to make China democratic). In these years, this vigil in Hong Kong is the largest gathering to demand making the entire China democratic _in the whole world_.

Given that Hong Kong people are doing that every year on 4 June, I think it is reasonable that in this case--anti extraditions law protests on 9 June and 16 June this year--Hong Kong people are doing something else. But this _does not_ mean that Hong Kong people do not fight for democracy in China or for greater good--to say the least, this anti extraditions law protest also benefits foreigners who stay in Hong Kong, or merely in transit.

Also, there are 6000 PLA troops stationed in Hong Kong, and there were cases of Hong Kong people getting abducted into China for publishing books that some members of CCP do not like [3]. There are not much more that Hong Kong people can do for themselves and for mainlanders... if you have better suggestions, please let us know.

I think they are doing their best.

> Nobody cares about your right if you don't defend the right of the others.

Then what have mainlanders done for Hong Kong?

[1]: [https://www.youtube.com/results?search_query=64+hong+kong+vi...](https://www.youtube.com/results?search_query=64+hong+kong+vigil)

[2]: [https://en.wikipedia.org/wiki/Memorials_for_the_1989_Tiananm...](https://en.wikipedia.org/wiki/Memorials_for_the_1989_Tiananmen_Square_protests)

[3]: [https://en.wikipedia.org/wiki/Causeway_Bay_Books_disappearan...](https://en.wikipedia.org/wiki/Causeway_Bay_Books_disappearances)

<comment><USER3> > Then what have mainlanders done for Hong Kong?

Nothing good, and it will continue to be this way.

And it's NOT out of despision, no, it's simply because it's impossible to do it safely in China. The political climate here is so toxic and dangerous, it is unethical to even think to put people on street.

But, one thing HongKongers must understand is, your future is linked with mainlanders, for better or worse. We may not see each other eye to eye on other many topics, but this, this is the problem we both facing.

Also, many mainlanders is actually quite supportive about some protests. Simply search Twitter with the right keyword you can find many [https://twitter.com/search?f=tweets&vertical=default&q=%E6%9...](https://twitter.com/search?f=tweets&vertical=default&q=%E6%94%AF%E6%8C%81%E9%A6%99%E6%B8%AF&src=typd)

<comment><USER4> > And it's NOT out of despision, no, it's simply because it's impossible to do > it safely in China. The political climate here is so toxic and dangerous, it > is unethical to even think to put people on street.

We, Hong Kong people as a whole, understand that mainlanders face much more difficulty in speaking up, and we are sympathetic. We definitely _do not_ despise mainlanders for not speaking up in a way that we can see. The current protest does not mention democratic movement in China because we want to have a focus: on the extraditions law itself.

> But, one thing HongKongers must understand is, your future is linked with > mainlanders, for better or worse. We may not see each other eye to eye on > other many topics, but this, this is the problem we both facing.

Hong Kong people understand and agree that we are facing the same opposition-- the oppressive regime in China--and our time is dated: Hong Kong people are counting the number of years until 2047, which is 50 years after the handover of Hong Kong to China in 1997, after which the "two systems" may disappear. And we are also questioning if the "two systems", the promised anatomy of Hong Kong from China, may disappear _before_ 2047\. One reason you see so many Hong Kong people in the current protest, is the fear that if they don't speak up now, they cannot speak up later.

> Also, many mainlanders is actually quite supportive about some protests. > Simply search Twitter with the right keyword you can find many > [https://twitter.com/search?f=tweets&vertical=default&q=%E6%9...](https://twitter.com/search?f=tweets&vertical=default&q=%E6%9..).

We thank the support from mainlanders given their difficulty, and also for the support from the whole world. Such attention on Hong Kong is very much needed and appreciated.

I read from your comment in another thread that many mainlanders are trying to earn money to trade for freedom: better social status in China, or to move to another country. In fact, I think there are lots of mainlanders who went overseas, and they are enjoying the freedom and protection in another country. If we, Hong Kong people and overseas mainlanders, unite together, there is a lot more that we can do.

Your speaking up here in Hacker News is a good start, and we together can try to do more.

</comment></comment></comment></comment></comment><comment><USER5> "During her news conference, Ms. Lam pinned blame for the chaos on the government failing to effectively explain to people why the bill was needed, rather than conceding protesters' arguments that the law was flawed."

Politically savvy approach, but completely ridiculous. HKers understand exactly what this bill would do to them.

Nothing makes me more angry than bureaucrats with bad intentions treating the people that pay their salaries like children.

<comment><USER6> Well she may be from HK and she gets paid by HK government but we all know she's a mainland shill and was chosen for that reason. She is 100pc in the pocket of the mainland government

<comment><USER7> how did she get elected?

<comment><USER8> The head of Hong Kong is not elected by popular suffrage: [https://en.wikipedia.org/wiki/2014_Hong_Kong_protests#Backgr...](https://en.wikipedia.org/wiki/2014_Hong_Kong_protests#Background)

> The leader of Hong Kong, the Chief executive, is currently elected by a > 1200-member Election Committee, though Article 45 of the Basic Law states > that "the ultimate aim is the selection of the Chief executive by universal > suffrage upon nomination by a broadly representative nominating committee in > accordance with democratic procedures."

The election committee is more pro-CCP than the general Hong Kong populace, and the current leader, Carrie Lam, is widely held to be a puppet of Beijing.

<comment><USER9> It's worth taking a moment to reflect that the PM in the UK is also not elected by popular suffrage. The next PM will (literally) be elected by 100,000 members of the Conservative party, not by general election. It'll be the second time in recent memory this has happened, after Gordon Brown.

<comment><USER10> But people elect the parliament and the parliament electthe PM, so it's OK, there's a chain of accountability to the populace. In HK, the parliament has only 70 seats of the 1200-member committee, and only 35 of those are geographical constituents representing the people, the rest are "functional" constituencies mostly representing businesses). Laws have to be passed by a majority of the LegCo however, and the Chief Executive can be impeached by a 2/3 majority in the LegCo, so the LegCo is still very important. The main tragedy is that only 50% of the LegCo is elected democratically.

<comment><USER11> One interesting - and HN-relevant! - point is that the current member of HK's parliament representing 'Information Technology' is one of the leaders of the pro-democracy camp, and there was a semi-viral video this week of him confronting police inside the parliament building. He is one of the few pro- democracy members among the functional constituencies, and as a Hong Kong permanent resident and IT professional, I want to make sure I get the papers sorted to vote for him in the next elections...

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> That is good news for the time being. Let's hope more comes of this sort of action.

<comment><USER13> I don't think it is. It seems to me to be playing right into the hands of the chinese gov't. "we gave you what you want then you protest some more? Clearly you are liars and deceivers".

Then more violence by the police, completely justified this time because protesters must be just troublemakers.

It seems a very risky strategy. I would advise against it, or at least think very carefully, but what do I know.

<comment><USER14> The protesters get what they want: this is the Chinese government's evil plan. The protesters couldn't get what they want: this is the Chinese government's evil plan.

Next time please just say that the Chinese government is evil, save all the typing.

<comment><USER13> > The protesters get what they want: this is the Chinese government's evil > plan

The protesters didn't get what they want hence are considering further protests. Whether they are wise or not was my point.

There's no absolute but...

Imprisoning over a million Uighurs for their religion, and disappearing people for their political beliefs is evil, so yes, the chinese gov't is evil in that sense.

Let's look at your prior history:

"Also, the UK is extremely famous for intentionally or unintentionally leaving a mess when it leaves..."

"Little did I know about all the ignorant and arrogant comments I was about to see. The West needs a new enemy"

"The average westerners only want to accuse China so they can feel good about themselves for a while"

Anything to declare?

<comment><USER14> > Imprisoning over a million Uighurs

Have you tried to image what kind of resource does it need to do this? How many prisons and guards are needed? How many hospitals, power stations and other related facilities are required to support this? Where are the satellite images?

If we are arresting them for their Islamic religion, how come I still have a large amount of Hui friends hanging out with me just as usual? [https://en.wikipedia.org/wiki/Hui_people](https://en.wikipedia.org/wiki/Hui_people)

Trusting the Western media unconditionally without thinking about how ridiculous the news are, truly ignorant and arrogant. Surely your media will never lie or leaving important facts out, like the terrorist attacks happened in China. But I am sure your media has already painted them as some kind of freedom fighters.

[https://en.wikipedia.org/wiki/2014_Kunming_attack](https://en.wikipedia.org/wiki/2014_Kunming_attack)

<comment><USER13> I'll read the links, thanks.

> Have you tried to image what kind of resource does it need to do this?

Imprisoning 0.1% of your population is quite doable

> How many prisons and guards are needed?

Quite a few: "As easy as it may be to silently whisk away thousands of people to new re-education centres, skyrocketing prisoner would also require a huge recruitment drive. According to Zenz, from May 2017, counties with large ethnic minority populations "initiated a wave of recruitments" for so-called education and training centres". From <[https://www.businessinsider.com.au/how-many-people-are- impri...](https://www.businessinsider.com.au/how-many-people-are-imprisoned- in-xinjiang-china-government-documents-2018-5?nojs=1>)

> Where are the satellite images?

<[https://www.nytimes.com/2018/12/16/world/asia/xinjiang- china...](https://www.nytimes.com/2018/12/16/world/asia/xinjiang-china-forced- labor-camps-uighurs.html>)

> how come I still have a large amount of Hui friends hanging out with me just > as usual

I dunno, you tell me.

> Trusting the Western media unconditionally without thinking about how > ridiculous the news are, truly ignorant and arrogant

True, and I do try to. You don't seem to be similarly encumbered.

> Surely your media will never lie or leaving important facts out, like the > terrorist attacks happened in China

So that's why they're imprisoning a million people! for an attack by six people (which killed 31 people others).

You agree that it's happening now because you've explained why it's happening

> But I am sure your media has already painted them as some kind of freedom > fighters

They have not.

By the way, who do you work for?

<comment><USER14> So now I am a wumao right? If someone disagrees with the Western media, just say he/she is a wumao and you automatically win, how convenient.

The image in your link makes me laugh. I can do the same, just get an image of an Amazon fulfillment center and say it is holding thousands of supporters of Edward Snowden against their will.

> I dunno, you tell me.

Because we don't arrest people for their religions.

It's not just 31 people btw. [https://en.wikipedia.org/wiki/July_2009_%C3%9Cr%C3%BCmqi_rio...](https://en.wikipedia.org/wiki/July_2009_%C3%9Cr%C3%BCmqi_riots)

If you don't think your media could lie, there is nothing I can do.

<comment><USER13> > So now I am a wumao right?

Odd. Most westerners wouldn't have that word to hand. I myself was trying and failing to remember it.

But to answer the question, I asked, I did not accuse. And you did not answer. Why?

> The image in your link makes me laugh

You asked for evidence. It's evidence, not proof because pix can be faked, I agree. But anything I put in front of you you can dismiss as fake so what can I do - specifically, what do you want?

> Because we don't arrest people for their religions.

Seems you do, and put them in giant camps. And you explained why with all the links you post.

> it's not just 31 people btw

Re this link, of course it's more than 6, but the link you gave was to that specific attack in which 6 people were killed. Which I acknowledged. Don't fudge things.

And you have not denied that the crackdown on Uighurs occurred, and you yourself gave the reason why - so you don't deny any of this.

I don't think you are thinking for yourself, as you suggest me of not doing, and you have not said who you work for. Which is interesting.

<comment><USER15> I don't mean to pick on you personally at all, but I have to reply to you a third time in this thread.

This comment not only broke the site guidelines terribly, it became aggressive enough to count as harrassment. You simply can't bully another user like that on HN. We ban people for that.

Let's look at the larger picture for a minute. Geopolitics between China and the West have taken a polarizing turn. Hacker News' audience is highly international but majority Western, so most users here identify with one side of the story. That's natural, but it means that people representing the other side are in a minority position. No matter how wrong you think their position is, you and other HN users need to treat the people you're arguing with respectfully. Otherwise we get a mob dynamic, which is vastly more destructive to HN than comments being wrong about China—and unfortunately there has been a lot of it lately. HN users who have a Chinese background, or have lived in China and so on, have a right to present their side of the story without being accused of being spies or foreign agents and run out of town. The site guidelines ask you to " _assume good faith_ " for good reason: when people don't, it turns a functioning community into a tire fire.

Our experience with the issue of astroturfing is that internet users are all too eager to imagine it about commenters they just happen to disagree with. Having imagined it they then feel entitled to sling the accusation to twist the knife a bit further in an argument. That's not ok. If you're genuinely concerned about abuse, email email@example.com so we can look into it. But it's not ok to casually insinuate it in the threads: most of the time there's no evidence for it, and the accusation is a powerful poison in its own right.

If you'd please review [https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html) and stick to the spirit of this site when posting here, we'd be grateful.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER16> I'm impressed, this is much more responsive than how Macron has handled the gilets jaunes.

<comment><USER17> One can't really compare a democratically elected president bound by rule of law and various balances to a totalitarian puppet.

<comment><USER16> Exactly my point, we usually expect democratically elected leaders to be more responsive to protests than autocrats.

</comment></comment></comment><comment><USER18> A notice of no objection for Sunday's march has been issued.¹

1\. [https://www.police.gov.hk/info/doc/nono/POERN19007953E.pdf](https://www.police.gov.hk/info/doc/nono/POERN19007953E.pdf)

</comment><comment><USER19> back down until they find a sneaky way to reintroduce it. IMO, case closed. Just a matter of time

</comment><comment><USER20> Political submissions on HN make me want to reinstall the tagger extension so known trolls or obvious shills can be tracked.

</comment><comment><USER21> As far as i understand the bill doesn't apply to those with political or religious offense. what are these people protest against?

<comment><USER22> These types of protests are largely encouraged by the West to deepen division within it's enemies, same as with sunni/shiites in the middle east, or gop/democrats by the Russians. You can tell because the West didn't give a single shit when hk wasn't democratically ruled by the Brits, but now democracy there is headline propaganda.

<comment><USER10> The PRC didn't exactly cooperate when the UK wanted to introduce democratic measures in HK well before the handover. [https://en.wikipedia.org/wiki/Democratic_development_in_Hong...](https://en.wikipedia.org/wiki/Democratic_development_in_Hong_Kong#Under_British_rule)

<comment><USER23> The UK only tried to introduce it after they knew they couldn't hold on to Hong Kong anymore. So they did it out of spite.

But the UK did try to convince Portugal not to offer the people of Macau citizenship, because they didn't want to do the same for the people of Hong Kong.</comment></comment></comment></comment>


Modern Train Kits - <AUTHOR> I'm looking at building a model train. Most of the stuff out there is very old fashioned, with big heavy transformers and low tech - plus its expensive.
Ideally I'd like a standard electrified track, but a motorized carriage that can be controlled with a raspberry pi or similar. I figured it would be common but haven't found anything.
Anyone have any tips? <comment><AUTHOR> After some research I'm going with Lego. Will start with basic kit then I can try to automate later.

<comment><AUTHOR> fyi

[https://shop.lego.com/en-US/LEGO-Power-Functions-Motor- Set-8...](https://shop.lego.com/en-US/LEGO-Power-Functions-Motor-Set-8293) [https://shop.lego.com/en-US/LEGO-Power-Functions-Train- Motor...](https://shop.lego.com/en-US/LEGO-Power-Functions-Train-Motor-88002) [https://shop.lego.com/en-US/Flexible-and-Straight- Tracks-749...](https://shop.lego.com/en-US/Flexible-and-Straight-Tracks-7499)</comment></comment>


Disney's New Production Renderer 'Hyperion' - <AUTHOR> http://www.fxguide.com/featured/disneys-new-production-renderer-hyperion-yes-disney/ <comment><USER2> Whenever I read about new renderers I think I'm completely intellectually inept even with what I think is a reasonably well-rounded computer science education. It is like reading about string theory in a way. Sure, I can grasp the concepts, but the details and minutia are fascinating and admittedly a little beyond my immediate comprehension. I remember when POV-RAY was amazing when it ran all night to produce just one image with some reflection on a 486.

How time and Moore's law flies...

<comment><USER3> I suggest taking a look at Physically Based Rendering [1]. It goes through an advanced rendering system in a literate coding style. That is, the physical explanations are interspersed with the code of an open source renderer [2]. I'm not sure how it compares with this Disney renderer, but it should go a long way towards demystifying how these things work.

1\. [http://www.amazon.com/Physically-Based-Rendering-Second- Edit...](http://www.amazon.com/Physically-Based-Rendering-Second- Edition/dp/0123750792)

2\. [http://www.pbrt.org/](http://www.pbrt.org/)

<comment><USER4> PBRT's an excellent book if you want to play with / build / understand raytracing renderers.

Some of the knowledge is not-quite state of the art any more, but everything's still relevant. And there's a third edition coming soon.

</comment></comment></comment><comment><USER5> Brent and the team at Disney Feature Animation have always pushed complexity like crazy. Most people keep telling them to just think procedurally or reuse elements, but Brent prefers to let the artists do whatever they want and the system should handle it. Since cores are cheaper than humans this is a good long-term tradeoff, but YMMV since very few studios would bother doing so much explicit detail (as opposed to procedurally tweaked variations).

<comment><USER6> >> Since cores are cheaper than humans

I don't want to be a sourpuss, but there is a limit beyond which MPI stops scaling, when you look at the program runtime 60% of time is spent in MPI_Wait. Past 80k nodes you can't go much faster no matter how much money you got, I believe this is precisely the problem they address by intelligently grouping similar rays.

<comment> z-e-r-o You forget that rendering a movie is almost infinitely scalable. Imagine, even when using only single-threaded code, you could scale for 130,000 nodes as there are about this many frames in a 90 minute movie at 24 fps. This is not totally true of course, for example you might want to do light or particle system calculation which persist across frames, but the general rendering bit is extremely scalable.

<comment><USER4> Bandwidth allowing of course - that's often the bottleneck when you're rendering production scenes with +300GB of textures :)

</comment></comment></comment></comment><comment><USER7> The paper is here: [https://disney- animation.s3.amazonaws.com/uploads/production...](https://disney- animation.s3.amazonaws.com/uploads/production/publication_asset/70/asset/Sorted_Deferred_Shading_For_Production_Path_Tracing.pdf)

</comment><comment><USER8> Clicked thinking it was a Disney adaptation of the novel with the same name. In retrospect, it would be an unlikely adaptation for Disney to undertake ;)

<comment><USER9> Walt Disney Studios was once located at 2719 Hyperion Avenue in Los Angeles. It's surely named after that. The Walt Disney Company also used the name for other things, like the publishing company Hyperion Books, and the Hyperion Theater at California Adventure.

[http://blog.wdwinfo.com/2013/07/28/the-walt-disney- hyperion-...](http://blog.wdwinfo.com/2013/07/28/the-walt-disney-hyperion- studios-1929-1939-the-foundation-of-an-empire/)

</comment></comment><comment><USER10> Quote: Disney pioneered the use of special camera rigs that would render the foreground with one 'stereo camera' or solution, while rendering the background with another.

I saw that, and my brain hated it. I even tweeted about what I thought it was at the time. This is an absolutely terrible effed, and I don't understand why they do it.

<comment><USER11> The article explains why they do it.

 _" Since a hero character close to camera felt attractive with a stereo convergence, that would mean the background in the same shot would be too extreme and unpleasing on the eye. Instead of dialing down the stereo effect overall, Disney pioneered the use of special camera rigs that would render the foreground with one 'stereo camera' or solution, while rendering the background with another. Thus the foreground character would appear round and with more fullness, but their background would appear more relaxed, less stereo pronounced."_

<comment><USER12> Yep. It's also worth remembering that different people respond physiologically to 3D movies very differently [1]. Disney thought the effect was useful enough to patent and use for more films, so it's unlikely everyone responds that negatively.

1\. [http://www.plosone.org/article/info%253Adoi%252F10.1371%252F...](http://www.plosone.org/article/info%253Adoi%252F10.1371%252Fjournal.pone.0056160)</comment></comment></comment>


A set of standardized legal documents for startups - <AUTHOR> http://seriesseed.fi/

<comment><USER2> Are these all specific to Finland?

Using Opera 11 and the Open in Google Docs button placement is off for me; it's half-hidden by the text.</comment>