How Quantum Randomness Saves Relativity - <AUTHOR> http://www.forbes.com/sites/chadorzel/2015/08/11/how-quantum-randomness-saves-relativity/ <comment><USER2> I am still not so sure that Bell's theorem and subsequent experiments really do rule out hidden variables.

After all, if I split a coin down the middle and took the two halves to different sides of a continent, it wouldn't be surprising if one was found to be heads and one found to be tails.

It would also not be surprising that if I then repainted one of the halves, the other half would be independent of the repainting and the "entanglement" would be broken.

The difference could be simply in that quantum particles behave differently than having only TWO sides to them, like a coin. But the principle is the same ... that the FTL "spooky" communication never happens even between two particles -- rather, they are correlated because were taken from the SAME PLACE at the same time. We just don't understand how their states work, because they're not just one dimensional states.

<comment><USER3> It is important to note here that Einstein was not being translated from German properly into English. 'Spuk' has a meaning akin to spook in the sense of a remote observer; Rather than 'spooky', which is an adjective relating to ghosts.

There are also a lot of assumptions in the no-cloning theorem regarding the nature of quantum operators: that they absolutely must be linear and unitary. This is certainly not the case for research into invisibility or stealth technology, where non-linear optics are standard.

Lastly, the epistemological nature of hidden variables is the property which rules them out. They are referred to as extraneous variables in every other field of science. This has caused problems of overfitting; Biologists can hold excessive faith in Hidden Markov Models. When you dissect Bell's theorem in terms of raw mathematics, it is technically a restatement of the triangle inequality within probability spaces; So it just ensures that the transitive property holds for the variables of a functional system.

<comment><USER4> > It is important to note here that Einstein was not being translated from > German properly into English. 'Spuk' has a meaning akin to spook in the > sense of a remote observer; Rather than 'spooky', which is an adjective > relating to ghosts.

Einstein's "spukhaft" is very much an adjective relating to the activity of ghosts. If you translate it as "magical", you're not losing much of its meaning.

<comment><USER3> Spooks can also refer to watchers. There are CIA spooks, idiomatically.

Ghost is translated as geist.

</comment></comment></comment></comment><comment><USER5> This is the best layman explanation of quantum entanglement and how it doesn't allow FTL communication I've ever seen!

<comment><USER6> Really? For me it looks overly complicated and going in circles. After all it boils down to: "You have two boxes that generate exact same sequence of random bits, no mater how far away they are. How can you use it for communication? There is no way."

<comment><USER7> No the idea is pretty simple. You give entangled particles to Alice and Bob who are a non-trivial distance away from each other.

Alice performs an operation to send a bit of information to Bob via the entangled property. Bob still gets random results from his measurements. If Bob saw a signal instead of randomness this would be FTL communication.

Instead Bob and Alice compare notes after the fact and Bob finds that if he knows what Alice did, now he can find a signal in his data. This after the fact comparison is what scuttles FTL communication. Bob doesn't know anything until after the "sub-light" communication.

Alice could instead transmit her information using "sub-light" communication to Bob at the same time she performs the entangled operation, but Bob still doesn't know anything (measurements look random) until the "sub-light" information reaches him.

</comment></comment></comment><comment><USER8> So wait, if you can refresh the probabilities of a quantum property by making a second type of measurement (as described by the video in the article), why wouldn't this work? Here's how you might send information between two entangled particles via some property:

To send a 0 via property A:

      1. Clear your measurement of property in A by measuring property B
      2. Measure property A again
      3. If A is not in state 0, goto 1
      4. The other entangled particle should now read state 0 too

To send a 1 via property A:

      1. Clear your measurement of property in A by measuring property B
      2. Measure property A again
      3. If A is not in state 1, goto 1
      4. The other entangled particle should now read state 1 too

Maybe it would take a few more tries than expected occasionally, but if you give enough time to loop say, 10 times between measurements of the second particle, that's only a (1/1024)/2 = 1/2048 chance that the information is wrong! That's probably reliable enough for reasonably good error detection [1]. As long as the amount of time needed to get the first particle into a given state is less than the amount of time needed to send a photon to the second particle, it would seem that you could send information faster than c.

1\. [https://www.youtube.com/watch?v=-15nx57tbfc](https://www.youtube.com/watch?v=-15nx57tbfc)

<comment><USER9> You've forgotten what a measurement is.

A measurement is any interaction between particles. In the case of entangled photons, a measurement consists of allowing the photon to be absorbed by an atom. You only get one such measurement; any new photon emitted by that atom will have a spin which is no longer entangled with the spin of it's original twin. (Actually, they were more like anti-twins; one was up when the other was down, and visa-versa.)

Even assuming you had two larger particles (let's say atoms) which were entangled, allowing you to make multiple measurements, nothing you change about one of them is communicated back to the other. If you measure a property of your atom you may also be able to determine the value of that property for the other, but in doing so you change the atom. You flip the spins of the electrons, or of the atom as a whole, etc. This is what "clearing your measurement" means; you no longer have any good information about that property. If you then remeasure that property, it's value is no longer correlated with the twin particle.

</comment></comment><comment><USER10> This is probably inspired by the recent hype about messenger lectures by Susskind [https://www.youtube.com/watch?v=vDmMnSKEYnI&list=PLtpXn0nfqJ...](https://www.youtube.com/watch?v=vDmMnSKEYnI&list=PLtpXn0nfqJ7vVEy1WPm5TX5GTyAubX5Ad)

There is also more detailed lecture available here on this particular topic [https://www.youtube.com/watch?v=OBPpRqxY8Uw](https://www.youtube.com/watch?v=OBPpRqxY8Uw)

</comment><comment><USER11> The author, Chad Orzel, is the author of the book, "How to Teach Physics to Your Dog", which I thoroughly enjoyed. The chapter in which he explains the Bell Theorem I had to read twice, but I eventually got it.

He also wrote a sequel, which I haven't read yet, titled, "How to Teach Relativity to Your Dog". The cover art is hilarious if you know what a light cone is.

</comment><comment><USER12> Bummer, so much so sub space communication. It does sound like it would be useful for extremely safe encryption where the two parties would have an ever changing shared key.

<comment><USER13> And thus [https://en.wikipedia.org/wiki/Quantum_cryptography](https://en.wikipedia.org/wiki/Quantum_cryptography)</comment></comment>


Discuss on HN: why isn't Tesla making any utility/delivery chassis? - <AUTHOR>

Given Teslas supercharging stations allowing one to drive from LA to NYC by ~2015 - Why not make delivery vehicle chassis for "free" long haul delivery?
I'd also like to see Tesla chassis/tech available to third party builders for things such as motorhomes...
Will tesla ever go this direction? <comment><USER2> one step at a time</comment>


A survey of making music with code - <AUTHOR> https://tylersloane.com/notes/code-music/ <comment><USER2> This is great. I'm a musician interested in - but having trouble - 'learning to code', as well. Going to work through your examples and see where that gets me. Thanks for the great article, would love to see more in the future.</comment>


Meet the Linux Desktop That's More Beautiful Than Windows 10 and MacOS - <AUTHOR> https://www.forbes.com/sites/jasonevangelho/2018/12/10/meet-the-linux-desktop-that-blows-away-windows-10-and-macos/ <comment><USER2> I tried to read the article, but a video popup and other flashing ads covered the material and distracted me as well.</comment>


Nginx: a caching, thumbnailing, reverse proxying image server - <AUTHOR> http://charlesleifer.com/blog/nginx-a-caching-thumbnailing-reverse-proxying-image-server-/ <comment><USER2> His setup is vulnerable to hash length extension attacks:

      secure_link_md5 "my awesome secret $uri";

This means anyone can extend the URI (eg. adding "/../../../some/other/file" at the end of the filename) and compute a valid key, and force the server to access an arbitrary image file on the backend. If the backend is a private server not publicly accessible, then this may be a security issue.

This is why in the ngx_http_secure_link_module's documentation the secret is appended (instead of prepended), see [http://nginx.org/en/docs/http/ngx_http_secure_link_module.ht...](http://nginx.org/en/docs/http/ngx_http_secure_link_module.html):

      secure_link_md5 "$secure_link_expires$uri$remote_addr secret";

The Nginx doc is also at fault because it fails to explain why it is important to append the secret and not prepend it. I just emailed security- firstname.lastname@example.com to let them know.

<comment><USER3> Length extension attacks work for both append _and_ prepend. I don't know if you're right, or whether or not either of them are vulnerable, but the correct solution to this problem is to use the HMAC[0] construction.

[0] [https://en.wikipedia.org/wiki/Hash- based_message_authenticat...](https://en.wikipedia.org/wiki/Hash- based_message_authentication_code)

<comment><USER2> Yes some other attacks can be performed if the secret is appended (we don't call them "length extensions attacks"), however they do not apply in this guy's case because the attacker does not control the URI that is hashed.

But yes, when in doubt, and to future-proof your code, it is good practice to use an HMAC anyway. Or use SHA-3 which is not vulnerable to any attack when prepending/appending a secret.

</comment></comment></comment><comment><USER4> This is a cool little project showcasing some of NginX's lesser known modules in action.

However, I have one nitpick.

The caching server's main location is a bit of a cargo-cult unoptimization. They have specified:

        location ^/(.+)$ {

When the equivalent:

        location / {

Is shorter, clearer, and does not incur a regular expression capture on every request that is never used.

<comment><USER5> The difference is that the last one also matches requests to "/", while the regex ensures that there is at least a single character after the "/".

That allows "/" to be used for other purposes, e.g. redirecting to the main page of the site, or displaying a nice error page. (However, in this case it simply shows the default Debian Nginx installation page: [http://m.charlesleifer.com/](http://m.charlesleifer.com/) )

<comment><USER4> For that use case, I would recommend two locations like so:

        location = / {
          # Just whatever happens for "/" requests goes here
        }

        location / {
          # Every other requests ends up here
        }

</comment></comment></comment><comment><USER6> One of the great benefits of Google Appengine and Google Cloud Storage is that you get this for free. Merely changing the size param at the end of the url resizes the pic. And since this all happens on the edge cache, it never touches your app, and you don't get charged for bandwidth.

[http://lh4.ggpht.com/sTP-3BqnirkHm40qfb496w85A1bf7BpeXthFJ92...](http://lh4.ggpht.com/sTP-3BqnirkHm40qfb496w85A1bf7BpeXthFJ924I3ktYZoP5pD3diZqjsqob1ZXNfsw3kHe8lULgQaeN7AB9o04Ow=s200)

[http://lh4.ggpht.com/sTP-3BqnirkHm40qfb496w85A1bf7BpeXthFJ92...](http://lh4.ggpht.com/sTP-3BqnirkHm40qfb496w85A1bf7BpeXthFJ924I3ktYZoP5pD3diZqjsqob1ZXNfsw3kHe8lULgQaeN7AB9o04Ow=s960)

</comment><comment><USER7> I found the nginx native image library completely inadequate a few years ago, so I had to use the perl module to connect it to imagemagick libraries instead. Much higher quality results.

Not sure if they have improved the native library but I doubt it has the flexibility.

The important part is caching the results because of the expensive cpu time.

ps. googling about the current state of this came up with an interesting nginx module which talks to imagemagick (or gd) directly [https://github.com/cubicdaiya/ngx_small_light](https://github.com/cubicdaiya/ngx_small_light)

<comment><USER8> I second this, for a recent e-commerce project we started using nginx's image_filter but the quality of the resized images was unacceptable.

We ended up using Thumbor, which was able to give us much better looking images (but at the cost of being extremely difficult to deploy on the CentOS 6.x servers we had at that time).

</comment></comment><comment><USER9> We use a similar set-up at work, but we don't do the image resizing in nginx, rather we have a python backend that it proxies up to, that runs a tiny wsgi app that uses requests & pil to do the resizing and transforming. It uses proxy_cache_lock to dedupe requests to the backend.

<comment><AUTHOR> If all you need is crop or resize, might as well use nginx in my opinion.

<comment><USER9> There was one annoyance we have to fix that I don't think the nginx module supports & that's rotating images based on their exif orientation (mobile devices love to upload landscape images w/ an exif-orientation in portrait).

Python is definitely an OK solution for this as it turns out. We resize a few million of images a day on-demand on two n1-highcpu-8 GCE instances. Although, they could easily be a fourth the size, as CPU generally peaks out at 20-25% during peak hours.

We've actually tried more specialized services for this, like sharp + a threadpool using node.js and it actually performed terribly. As it turns out, blocking the gunicorn event loop by processing image resizes created a good amount of back-pressure to load balance incoming requests to each worker process.

<comment><AUTHOR> That's a good point. The nginx module can rotate, but I don't know of any built-in support for rotation with respect to exif. You could also use lua and the lua imagemagick bindings and probably see much better performance though.

</comment></comment></comment></comment><comment><USER10> I'd love to see some performance benchmarks for Nginx's caching vs Varnish (memory, reqs). Even if Nginx can do the same thing, if I need more RAM to do it, or it handles less requests - I'd rather keep Varnish.

</comment><comment><USER11> A few years ago everyone was jumping on nginx saying it's the 2nd coming of Jesus and that being a simple web server without dynamic config or modules to do processing made it better than Apache because it's "fast".

How many of those same people are now going on about how nginx has finally got _some_ support for loadable modules and built in processing like this?

<comment><USER12> > How many of those same people are now going on about how nginx has finally > got some support for loadable modules and built in processing like this?

I would doubt many of them are because early adopters tend to also be the kind of people who don't mind compiling their own webserver for whatever reason: time, patience, availability of dedicated hardware to do it on, etc.

<comment><USER11> The sort of people I saw jumping to nginx were largely _not_ the sort of people who would compile it themselves.

These are often people who would compare Apache + mod_php to nginx + PHP-fpm, and not understand why it's not a realistic comparison of the web servers.

</comment></comment></comment><comment><USER13> We do something similar : when nginx doesn't find the file for a given format (width and height are in the url), it's a 404 and we use the 404 handler to proxy to a php app that does the resize/crop (and we have a list of the formats we use more often in the app so we store the generated thumb on the disk), the resize/crop operation is centered around coordinates that we determine with opencv (it detects faces and/or focus points) when the user uploads the picture.

We use varnish in front of nginx

</comment><comment><USER14> If you use a CDN such as Cloudflare, you can do a similar trick but forget about the proxy cache (and associated storage needs) - as long as every image at every size gets a unique URL and you control http cache headers correctly, Cloudflare will store copies of every image size ever requested across their CDN network.

In terms of this blog post, you'll only need the "resizing server". This is a very simple and stateless way to get image thumbnailing to work. I'd also personally not bother with all the API key stuff - how 'malicious' can it be to generate a thumbnail of a public image?

This will even work with _3rd party_ images (the case of the app I used this for, it was product icons from Apple's App Store). If you somehow want to use images hosted elsewhere inside your app, but worry about speed or about hitting their servers too much, proxy them with Nginx and let Cloudflare handle the rest.

<comment><USER15> That's not quite true. Cloudflare (like virtually every CDN) only caches files at the edge server that handled the request. And they purge the files after a short period of time--even if your cache-control headers ask for a longer time. Most won't tell you how short (including Cloudflare), but some CDNs will delete files after as little as two hours.. 24 hours is very common. Most CDNs also give you no visibility about what is cached and where.

In Cloudflare's case, they operate 76 data centers. So every "short period of time" x up to 76, your server will need to regenerate each image.

So while a CDN is useful, a proxy cache can still be helpful.

(None of this applies to NuevoCloud though.. NuevoCloud has a global cache, with dedicated caches for each customer. So it's entirely possible to keep an image at the edge indefinitely)

<comment><USER12> I'm curious. $99/TB seems like an incredibly high price to charge for a CDN that only has 10 points of presence globally.

Maybe this is typical with 'website accelerators' as opposed to CDNs that focus on caching truly static content, but even so features like dynamic acceleration and global caching are par for the course with any traditional CDN.

Cloudflare, which I use mind you, is non-traditional and their business model seems more suited to DDoS prevention and edge SSL than anything else.

So what sets NeuvoCloud apart?

<comment><USER15> Dynamic acceleration at Cloudflare (Railgun) is $200/website. Origin shield is $200/website at MaxCDN (could be wrong, but I don't think Cloudflare has an origin shield equivalent). Both are included with NuevoCloud, and you can use them on multiple websites.

Global Cache does not exist at any CDN that I'm aware of. We spent a lot of time developing this. It's true other CDNs will cache files at each POP, when that POP sees a request for it... but that isn't what we mean here. (I understand the confusion.. I get a lot of questions about this, and we should probably rename it.)

Global Cache means we have a single cache that is used/managed globally. Let's say a visitor in France gets a cache miss for a new file on your website. Every PoP at NuevoCloud now knows of that file and has it cached. So if the next visitor to your website is in Tokyo, they'll get a cache hit and the file will be served from the Tokyo PoP, even though it's the first time the Tokyo PoP has seen a request for that file. A cache hit at a traditional CDN means that PoP has the file; a cache hit at NuevoCloud means every PoP in the world has that file.

The cache is managed for each customer individually with guaranteed space at each PoP. Which means, even if you have a small website that receives no traffic.. you can still keep your files at the edge. The only other way to get this is to pay for a dedicated CDN.

Finally traditional CDNs send requests from the edge directly to your server (client > edge node > your server) which is a long distance connection. Connections through NuevoCloud are routed through our network: client > edge node > edge node > server. So both the client and server are talking to an edge node near them. This speeds up SSL and connection negotiation between the edge and your server. We also use this setup to dynamically route requests around high latency, network partitions, etc.

I put our 10 points against other CDNs daily... and it's faster. You would be surprised at how dumb the average CDN is when handling requests. This is the reason they scatter edge nodes all over the place.

<comment><USER14> Hey, thanks for the detailed comment spam. I might become a customer in the foreseeable future!

</comment></comment></comment></comment></comment><comment><USER16> I was wondering if an additional cookie based security token is possible with secure_link module. (show image only if session cookie is present)

Apparently, it is possible, great! One of the google results: [https://gist.github.com/hilbix/5921589](https://gist.github.com/hilbix/5921589)

<comment><USER17> Secure_link module shouldn't be used for anything security related. I think it uses plain md5 and without even an hmac.

</comment></comment><comment><USER18> I wrote a similar article a few years back that employs Lua and imagemagick bindings: [http://leafo.net/posts/creating_an_image_server.html](http://leafo.net/posts/creating_an_image_server.html)

<comment><AUTHOR> Yeah, I'm pretty sure I linked to your post. I was going to use your script before I realized I could do everything with plain old nginx.

</comment></comment><comment><USER19> Could someone here explain to me how it's possible that a bug like [1] concerning the main functionality of nginx (static file routing) is open since many years, and yet nginx keeps its popularity? Is that really the best we've got?

[1] [https://trac.nginx.org/nginx/ticket/97](https://trac.nginx.org/nginx/ticket/97)

<comment><USER20> [https://trac.nginx.org/nginx/changeset/2797b4347a2af4e8fd46d...](https://trac.nginx.org/nginx/changeset/2797b4347a2af4e8fd46dc5d1def5083813f38f1/nginx)

<comment><USER19> So, do I get this right - the bug has been fixed since mid 2015 but the ticket wasn't updated?

</comment></comment></comment><comment><USER21> Does the image_filter module use the GPU?

Image filtering is an expensive operation for the CPU, with large latencies as well.

<comment><USER22> Actually GPU latencies and transfer costs dominate most _simple_ image filtering operations. A GPU might be fast _once_ the data is in GPU local RAM, but if just transferring the data back and forth takes 3x the time running the filter locally, what's the point?

You're better off performing it on a CPU, of course SIMD optimized.

Besides, web servers probably won't have GPUs anyways.

<comment><USER21> Intel is building entire Xeon lines with embedded GPUs for serving web imagery.

And these Intel Xeon's with embedded GPUs don't need to transfer data to the coprocessor, since they operate off of system memory, so transfer latencies are a non-issue.

</comment></comment></comment><comment><USER23> Similar idea but more flexible image manipulation: [https://github.com/hcarvalhoalves/django-rest- thumbnails](https://github.com/hcarvalhoalves/django-rest-thumbnails)

</comment><comment><USER24> I wish the author had gone into more detail about why they chose to stop using Varnish.

<comment><AUTHOR> I stopped using varnish because, after all, my site is just a blog and Nginx is just fine for my needs. It has a single backend server, so there's no load- balancing. Basically, I was already using Nginx to serve static files, and my caching logic was so simple it was actually easier to move it into Nginx.

<comment><USER25> Perhaps better a better question is why you were using Varnish in the first place?

I'm genuinely curious because I've never stood up Varnish before so maybe there's an anti-pattern / gotcha to learn from.

<comment><USER26> Well without some sort of caching, his site very well could fall over when being on the front page of something like HN. Putting Varnish in front a site, even with something simple like a 1 minute cache on everything, makes you pretty much immune from having "large amounts of traffic" being a real problem.

<comment><AUTHOR> Exactly, thanks frank! :P

<comment><USER25> By removing varnish aren't you now exposed to that risk once again?

I feel like I am missing something.

<comment><USER27> He would have been if it hadn't replaced the Varnish functionality with nginx.

He's basically just moving functionality from Varnish to nginx and thus simplifying his stack a bit.

</comment></comment></comment></comment></comment></comment></comment><comment><USER28> Very cool! I've been playing around with nginx-lua to handle our shortened URLs without having to invoke the upstream application.

</comment><comment><USER29> Clever and thanks for sharing. It was a good read.</comment>


NYC subway math - <AUTHOR> http://erikbern.com/2016/04/04/nyc-subway-math.html <comment><USER2> One other cause of delay (which is, anecdotally, present on the L line) is overcrowding. This is, unfortunately, not shown on the MTA's datafeed, though could maybe be estimated by adding the turnstile data?

The morning commute hours (and the hours after a 'delay' status has been cleared) are usually marked by very crowded platforms and trains. Even though the trains are 'on-time' and showing up every 3-5 minutes, there is no room to squeeze on, and you may need to let a few trains pass before getting on one successfully.

A 15 minute train 'delay' during the morning commute could cause an hour+ of backed up platforms and people unable to squeeze on. I think this kind of delay is where a lot of the displeasure with L line service is centered.

<comment><USER3> You perfectly described the issues that exist with the L train. It makes me wonder just why so many people decided to move to a region of Brooklyn with such historically poor subway service, when central Brooklyn, served by the 2,3,4,5 lines, is easily serving its rapidly-gentrifying population with relative ease.

<comment><USER4> I live right there in Williamsburg near the Bedford Avenue stop, and the subway issues are generally not a big deal. I can get to Grand Central within 20 to 25 minutes. Importantly, Williamsburg is at a very handy latitude; I can get to the East Village, Union Square, or the West Village in 10 to 15 minutes, and that is more often than not where I want to go. Then there are a ton of great restaurants and bars in the neighborhood, and everyone is pretty young and hip. It's actually under-priced in my view relative to the city (assuming the L doesn't stop running, in which case I will immediately return to Manhattan).

<comment><USER5> I'm sorry to report that you might have to return [http://gothamist.com/2016/01/13/l_train_tunnel_closure_years...](http://gothamist.com/2016/01/13/l_train_tunnel_closure_years.php)

</comment></comment></comment></comment><comment><USER6> Where's Ben Wellington when you need him? [http://iquantny.tumblr.com/](http://iquantny.tumblr.com/)

<comment><USER7> Very cool website!

<comment><USER8> Thank you!

</comment></comment></comment><comment><USER9> Unfortunately this is flawed in a very fundamental way. The NYC subways have different schedules for the morning rush, afternoon, afternoon rush, evening, and night. There should be at least three different distributions in the delay/wait data. Without teasing apart these distributions, I'm not convinced that anything meaningful can be said.

<comment><USER10> The author did limit his "sunk cost" analysis to 7am-7pm due to this exact reason. I think that part at least is quite sound, and is probably the most enlightening takeaway.

</comment></comment><comment><USER11> > My fascination for the subway takes autistic proportions [...]

What a weird way to phrase that.

<comment><USER12> Autism often involves strong obsessions, so it's not wrong. Why does this matter? Fantastic article on the whole.

<comment><USER13> Sure, but obsessions are hardly the characterizing trait of Autism, nor are they even included in literary definitions. I agree the article is wonderful, but i came to these comments specifically to see if that phrase had given anyone else pause.

<comment><USER14> No idea if the author intended it this way, but on some forums and imageboards it's normal to refer to being obsessive about something as "being autistic about it". It's similar to how most people call themselves "OCD".

</comment></comment></comment></comment><comment><USER15> Nice work Erik! You should send this to straphangers.org: [http://www.straphangers.org/](http://www.straphangers.org/)

No surprise with the L train as its the only one that is automated(despite having a conductor on board.) They refuse to let it run un-manned which begs the question why did they spend the hundreds of millions of dollars to automate the line? There are plenty of places with unmanned subway lines. There's one in Tokyo and I believe Barcelona and Copenhagen.

I guess its no surprise that their API would be mess as thats about sums up the culture at MTA from what I can tell.

The MTA is spending hundreds of millions of dollar to put arrival clocks in all stations. The problem with is that I want to know how long it is before the next train arrives before I pay for a fare. I have to pay for a fare in order to go onto the platform to find out the next train won't arrive for anther 20 minutes. At this point I have needlessly paid for a fare and generally walk back up stairs and take a taxi.

When they were questioned about this poor decision they responded it was because of terrorism that they couldn't put train arrival times outside the entrance. That makes zero sense.

<comment><USER16> Do you live in NYC but don't buy an unlimited card? I feel like that's an unusual use case.

<comment><USER15> Because everyone that lives in New York should be buying an unlimited card regardless?

How about retired people or people on a fixed income that are not work commuters?

How about someone that works in their neighborhood but still needs to use mass transit occasionally?

How about students that largely don't leave their campus tether but still need to use mass transit albeit less frequently than a commuting professional?

How about someone who bikes as their primary means of transit but still needs to use mass transit infrequently?

Its not really unusual at all is it?

So if you can't afford or don't need to purchase an unlimited subway that's your problem?

</comment></comment></comment><comment><USER17> Some thoughts on optimizing for wait time:

[https://github.com/erikbern/mta/issues/2](https://github.com/erikbern/mta/issues/2)

</comment><comment><USER18> Awesome article.

The countdown clocks are generally accurate, but in certain situations they are surprisingly off.

I would love to see someone use this data to improve arrival predictions – a regression, say, based on features such as time of day (a proxy for crowding), weather, holidays, nearby events (concerts & sports), maintenance or signal problems...

I assume the clocks use something as simple a static numbers representing the time between adjacent stations or segments. They presumably don't tolerate deviations from crowding or other unexpecteds.

</comment><comment><USER19> Isn't the last graph showing a poisson distribution, which is exactly what you expect for situations like "waiting for a train that comes on a schedule"?

<comment><USER20> Yes, one way that the poisson process is defined is as a counting process with inter arrival times that are iid exponentials.

The poisson process is the first (continuous time) point process discussed in many textbooks because the counting increments are identically distributed, since the rate parameter is a constant. You can think that in the case of modeling waiting times for subway trains, a better model is with the rate parameter that is dependent on time, since the inter arrival times are smaller during rush hour than when the subway is closed.

You can read about this in Bertsekas, and more thoroughly in Parzen or Cox's books on stochastic processes.

</comment></comment><comment><USER21> Nice! Really liked the sunk cost part. However, sometimes leaving isn't really a good idea because it's another N minutes to another station, which could take you M minutes farther from your destination than your current train, which arrives O minutes after you get there, which takes P minutes to your stop. For each station, would it be possible to instead calculate the point where (M + N + O + P) < max_wait_time?

<comment><USER10> Totally off topic, but: I grew up next to the VDNKh metro station in Moscow & therefore appreciate your user name.

<comment><USER21> Thanks! I got it from reading the Metro: 2033 book (which is really fantastic). I too have a fascination with subways

<comment><USER22> The storytelling is really atmospheric. Even more when I read it on a subway train.

</comment></comment></comment></comment><comment><USER23> Wow - thank you for sharing! It's a fun data source for those of us interested in the topic. My son learned numbers and letters from subway stations.

</comment><comment><USER24> Does this guy live in New York?? The 4 train does not stop at Van Cordlant-242 St. That would be 1 train.

I should know since I ride it every day.

[http://erikbern.com/assets/4_trips.png](http://erikbern.com/assets/4_trips.png)

</comment><comment><USER25> 1\. Either the stations are mislabled or that is data from the 1 train not the 4 train in that first visualization.

2\. The waiting time by line is flawed because the other lines are redundant to each other (corresponding colors) but the L is a single line so waiting times should be shorter.

<comment><USER26> Yes, it's the 1 train.

<comment><USER27> let me fix

</comment></comment></comment><comment><USER28> Interesting, they should install this calculator on the tablet kiosks in the stations

since you wouldn't be able to download this calculator in stations w/o data server

</comment><comment><USER29> Damn. This is useful. I used to just set a timer whenever I waited for a train and left after it expired, but this is really useful data to have too.

Good work!</comment>


Prison Debate Pits Inmate Team Against Students - <AUTHOR> http://www.nytimes.com/2010/05/08/nyregion/08bigcity.html?hp <comment><USER2> Strange format for debating. In Canada, every debate event my team went to had all teams taking Pro/Con on every argument; we also had to (and this may be a commonwealth element) switch between parliamentary and cross - Depending on how well you did, you would end up arguing both sides of a point two-three times.

There was never a "You will have to win a debate by taking just one side" type of debate - I've always thought that representation on television was just a simplification, and that, debate teams in the United States have to take both sides as well. (Though perhaps Parliamentary debate style wasn't required)

I have to believe a good portion of the HN audience has had debate classes/tournaments in High School - what was your experience? Had to argue both sides?

<comment><USER3> In my experience with high school level debating (in Australia), teams were randomly assigned only one side of the argument, and each speaker spoke only once.

I never liked it at all, because I couldn't deal with the idea that I might be forced to argue something which I didn't honestly believe to be true.

Those with fewer qualms joined the debating team and mostly wound up in law. I wound up in science.

<comment><USER4> Whenever possible, I try to debate on the side that I /don't/ believe to be true. I find that debating 'my side' of the argument is harder since I take my points as self evident and don't back them up as well.

Debating the other side means that you have to consider the argument on an intellectual level, not an emotional one. I think keeping yourself intellectually honest by forcing yourself to carefully examine the arguments that you don't personally believe is great for scientists.

It's also handy, because the other team tends to bring up points you're very familiar with as their arguments.</comment></comment></comment>


Localizing Papers, Please - <AUTHOR> http://dukope.tumblr.com/post/83177288060/localizing-papers-please-papers-please-was <comment><USER3> In case you don't see the link, Pope created a web interface, hosted on Github Pages, that allows users to easily do the localization, collaborate via Github forks, and import/export their work via CSV:

[http://paperspleaseloc.github.io/](http://paperspleaseloc.github.io/)

Pretty brilliant...reading Pope's devlog for the game makes it clear that he's an excellent game developer and designer..but it's unexpected that he'd also know how to whip up a useful, well-designed web-app for the purposes of supporting his game like this.

<comment><USER4> It is always interesting to see people use CSV in place of the established file format for translations, POT files. There are logic for certain grammatical elements (IIRC, it has been a while) and other edge cases that are exactly why one avoids homegrown CSV in the first place.

Then again, even Papers Please is making common mistakes. I can count on a single finger the number of i18n jobs I have seen. One in many years of looking at IT jobs. This stuff is little understood, and very little demand. But he makes of pointing out how this will causes problems.

I would love to see this game in Arabic, for example. Number in Arabic is crazy complicated, and as a guy who translated software for FOSS (arabeyes.org) there is a reason I bring up the number logic (1, dual, 3-99, 1000+ dictate different noun classes) and POT handles that. This and many other issues indicate why no one can be bothered to handle this until much later, and then it is such a pain in the ass with non-English charsets.

Not that this issue has come up a lot on HN recently. I am glad people are showing this stuff with interest. Regardless of my opinion, this is very cool work and I am glad to see developers caring again.

<comment><USER5> That was my reaction as well: why not gettext? ngettext and other facilities are wildly useful, and there are a huge number of tools out there designed to make it easy for translators to maintain translations.

<comment><USER6> gettext is more of a pain than you'd think unless you're in C or a C-with-a- hat-on-it like PHP. As I mentioned elsewhere in this thread I settled on Excel XML files because gettext (which I of course looked at first) wasn't a worthwhile format for either Java or .NET. And given that Papers Please is (I think) written in HaXe, I don't know what the story for gettext support is there.

That's without getting into licensing headaches, which is why the idea of P/Invoking GNU gettext is a straight-up nopenopenope.

</comment></comment></comment></comment><comment><USER7> Localization professional and developer here. I'd recommend taking a look at Transifex. This is a well thought out tool for managing localization projects and assets (prompt catalogs, resx files, etc), and for managing the translation process (it supports machine, crowd and professional translation, so you can optimize for cost and quality).

They also just released a really neat Javascript tool which makes translating web content super easy. You just embed some JS in your template, and it re- writes the pages in translation when needed. Way way easier than, for example, setting up a multilingual Drupal site, and in most cases, will get the job done nicely.

My $0.02

<comment><USER8> "My $0.02"

Why do people feel the need to write this after their posts? Were you afraid it would not be clear that it was an opinion? What purpose does it serve? Why did you go to such length to write it as "My $0.02" rather than "My two cents", or just "My 2c"?

It seems to be some kind of "thing" that people do here. Is it an in-joke?

<comment><USER9> I think you take it way too seriously. Relax.

<comment><USER8> I'm not angry about it or anything.

I just don't get it - is it supposed to be a joke?

<comment><USER10> 'My $0.02' \- For when 'IMHO' isn't enough.

</comment></comment></comment></comment></comment><comment><USER11> Very interesting article. I can't how imagine how difficult it must have been to support localization after the game was released.

</comment><comment><USER12> Very minor complaint but first of January 1984 is always depicted as '1984.01.01' in the game, regardless of I18N selected. While this is good in Germany, it many countries like US you instead prefer something like '1/1/84'.

<comment><USER13> Obligatory XKCD: [https://xkcd.com/1179/](https://xkcd.com/1179/)

<comment><USER12> Being Swedish I totally agree with XKCD since that's how dates are written here since the 70's. But this standard seems to be receding, for example recently the Swedish DMV had to change so that on new driver's licenses the date is written '01.01.1984' instead of previously '1984-01-01' :-( because of EU parliament rules.

</comment></comment></comment><comment><USER14> Very interesting writeup, thank you!

</comment><comment><USER15> In his second part of his article, he says...

> There's a system for making people sound generally non-Japanese (using lots > of katakana and dropping prepositions), but it's tiring to read and has an > air of childishness, since this is one of the first scripts kids learn to > read/write in Japan

This is utterly wrong. Katakana usage in Japanese has nothing childish attached to it. If at all, Hiragana would be the one which is considered the more "childish" way of writing, but there are numerous imported words (and more and more, I'd say) using Katakana even in business context - <USER2> certainly taken very seriously.

If you don't know a language, don't make assumptions on it. By the way the french translation of "Your son is dead" as "Votre fils est mort" is very dry and tasteless, the proper way or saying it in french is "votre fils est decede". I hate it when people do a literate translation from English to French, many words are similar but they are not used at all in the same situations.

<comment><USER16> > I hate it when people do a literate translation from English to French, many > words are similar but they are not used at all in the same situations.

Yes, this is why most people generally hate doing translations in general - people like you who nitpick.

<comment><USER17> > _Yes, this is why most people generally hate doing translations in general - > people like you who nitpick._

I don't know a bit of French, or Japanese. But I do know that there are a awful lot of English translations, done by well-meaning people, which vary from mediocre to Godawful. Almost every anime subtitling job I've ever seen is at the very least somewhat stilted and awkward to my ear. (Though they're still better than the dubs.) And a lot of it comes down to native English speakers who fear losing the intended nuances of the original and so do a rigidly literal translation, because they think that's the "most accurate."

So the problem isn't nitpicking; it's the _wrong kind_ of nitpicking. If you think you can do a translation by following a rulebook and wave off dissenters as "nitpickers," you are probably going to do a shitty job, and have no idea why.

<comment><USER15> > And a lot of it comes down to native English speakers who fear losing the > intended nuances of the original and so do a rigidly literal translation, > because they think that's the "most accurate."

Agree with you.

One of the key issues is that, to be a good translator you need to have a good command of BOTH languages. I can tell you I see piss poor French translations (from English or other languages) every day as well, and it's not nitpicking, it's just people doing an awful job at what they are being paid for. Most people who do translations are barely even literate in their own language in the first place (you can see that in their obvious lack of vocabulary).

On the other hand, I'd say the best translations I have seen go way beyond the original work, making the translated work even better, more rich, more nuanced than what it was before. It's not just "translation", it's rather close to versioning.

<comment><USER17> Oh, yes, absolutely.

Maddeningly, whenever that happens with e.g. anime you immediately get swarms of furious fans decrying the translation for "inaccuracy."

<comment><USER15> I can't say I have seen that in anime myself, but there's a couple of movies where the translation/version was actually better than the original movie in terms of language, figures of speech and so on. It was not just translation, it was beautiful writing.</comment></comment></comment></comment></comment></comment>


A Dropbox alternative for privacy minded - <AUTHOR> http://www.tonido.com/app_sync_home.html <comment><USER2> How is it different from Dropbox?</comment>


20 of the Best Free Linux Books - <AUTHOR> http://www.linuxlinks.com/article/20090405061458383/20oftheBestFreeLinuxBooks-Part1.html <comment><USER2> The Best Free Linux Book around (and which didn't make the list) is Linux® Quick Fix Notebook find it @ [http://www.phptr.com/content/images/0131861506/downloads/Har...](http://www.phptr.com/content/images/0131861506/downloads/Harrison_book.pdf)

And don't let the Quick Fix bit fool you! It's a pity that the Bruce Perens series seems discontinued

</comment><comment><USER3> BOOKmarking this for sure. Puns aside, this is a "20 best" list but doesn't necessarily say WHAT makes them best. Is it because they've all been fairly recently updated? Anyone want to suggest their favorites too? I'm ready to read ...</comment>


Dad explains how Apple Watch Noise app changed the life of his son with autism - <AUTHOR> https://9to5mac.com/2019/11/16/apple-watch-noise-app-texas-family/ <comment><USER2> This is a great story, but with respect I must disagree that this kid is the loudest person on the planet.

If it's anyone, I think it might be me.

Has this kid topped out an SPL meter at 127 decibels? I have. I don't know how far I can go beyond that point.

Ironically, I'm also sensitive to loud noises. I much prefer silence over noise. I wear 32db NRR earplugs frequently. I have 32db NRR earmuffs that I wear at home, for when my wife is doing things in the kitchen that are too loud, or when I am doing things in the yard with loud equipment.

All the headphones I use with any frequency include active noise cancellation, and sometimes I combine the ANC headphones with the earplugs.

I've probably bought just about every single SPL or sound real time analyzer app on the App Store. I use the Noise app in warning mode, but it won't let me go below the OSHA standard of extended exposure to 80db or more. I'm still looking for the right solution to give me a summary of the noise levels around me throughout the day, 24x7 and that doesn't require that I have a battery sapping app running in the foreground all the time.

I'm glad the Noise app has helped this guy and his son, but it is not enough.

</comment><comment><USER3> Some people may need the opposite, and that app should be helpful there too.</comment>


Ask HN: Are you addicted to video games? - <AUTHOR>

<comment><USER2> I grew up playing the golden era of N64. I was solidly addicted (Ocarina, Mario, Golden Eye, and Mario Kart). I played a good deal of Civilization in late high school and early College, but as I got good at programming I started to play less and less.

My philosophy has morphed into seeing video games as a waste of _my_ time. I could be building something, reading a good history book or novel, learning more about x in computer science, OR getting closer to my friends and family.

I have a friend who tells me that I need at least one trashy addiction in my life. For a while I thought his argument had some merit, but I just don't agree with him anymore. I feel most alive and happy when I'm pursuing activities that increase my understanding of the world, open my eyes to ideas I hadn't considered, or brings me closer to my friends and family. Maybe video games can be these things for other people, but not for _me_.

<comment><AUTHOR> I feel like they are a 'waste of time' as well since I could be using that time to become better at my programming skills. But my BF is addicted and it seems the only way I would be able to spend time with him is by playing video games with him and his friends, but my whole being resists it.

<comment><USER3> My oldest son appeared "addicted" to video games at one time. When he got enough out of it, his behavior changed. So that may not be hopeless.

As a divorcee who spent all my time sitting next to a man who was playing games, watching tv, etc and ignoring me, I don't really recommend you play games as a cheap assed substitute for actual attention from him. It accomplished absolutely nothing in my marriage. If he won't pay attention to you at all, sitting next to him while he ignores you isn't some kind of improvement.

Sorry you are dealing with this.

<comment><AUTHOR> All the answers here give me hope that my BF might one day tire of the games.

</comment></comment></comment></comment><comment><USER4> I was, in my teens. Specially in my "angsty phase", videogames were my escape.

Now, I don't play as much as I would like because of work and personal life. It also helps that most of my firends aren't gamers.

IMO, it's the finest and most flexible medium that currently exists, taking cues from a lot of the others. I'm an amateur video and board game designer and developer. It's hard to play games because of this, as I am always playing games with a "research" and "critical" perspective. I force myself not to replay games and try to only play games "that matter" and that "have something new", whatever that may mean at the moment.

I find it very sad to see so many HN'ers say they are "wasting their time" with games. There is a lot of crap, but some game are well worth the time. (As it is with everything -> Sturgeon's Law)

So, to answer the question, I was addicted in the past, I'm not anymore. But I would gladly be addicted again (in the good way :) ).

</comment><comment><USER5> Yea, Eve online had me for a while. It also had the strange effect of making all other games un-enjoyable for me. Eve is a true min/max game, where 2% of something often makes a huge difference. The desire to maximize the efficiency of everything I did carried over to other games and even aspects of my life.

Most games stop being fun when you make a spreadsheet for them, Eve is one of those few exceptions. Right around the time I stopped playing Eve, I started finding it difficult to play games just for fun without trying to min/max every aspect to gain an advantage. I guess I was really addicted to the meta- game rather than the game itself.

</comment><comment><USER6> In the past, when I was younger, I was addicted to numerous games including WoW, FFXII, C&C, Counter-Strike, TFC. But one day whilst playing WoW I thought "Why am I here grinding levels in a game? I should be grinding levels in life.".

I uninstalled everything and made a conscious decision to grind by learning and living. Sure, I still zone out with video games from time to time but I start to get uncomfortable after an hour and stop, very casual. For me, I realised I was wasting my life and it was making me unhappy.

[Edit: Typos]

</comment><comment><USER7> No. I did enjoy the King's Quest games back in the 1980s though. Does that count?

</comment><comment><USER8> At various times in my life I have devote entirely too much time to Chess, COD, SWG, LOL, and SWTOR.

Now I avoid them entirely, run desktop linux, and try to spend my time on things like violin, writing, reading, and coding.

</comment><comment><USER9> Probably. I have devoted several thousand hours of my life to L4D, L4D2, TF2 and Dota 2. Even more to counter-strike and other hl mods not even bothering to mention all the MMOs I've played.

</comment><comment><USER10> Much as I love computers and programming and learning.... I gotta play some Dota2 tonight... because reasons.</comment>


Marketing is still marketing when it's on the Internet - mkr-hn http://bitoflife.mkronline.com/2011/10/17/marketing-is-still-marketing-when-its-on-the-internet/

<comment> mkr-hn HN is a place I had in mind when I wrote this. Most people here are doing _something_ on the web, and it's easy to be led into blowing tons of cash on stuff that's not needed.</comment>


Pong-Like Retro Clock Using Open Source with TinyGo and Microbit - <AUTHOR> https://www.hackster.io/_conejo/pong-like-clock-using-tinygo-682736 <comment><USER2> Interesting. You could make for some trippy shop windows signs with that combination.

5w for power draw isn't much either. :)</comment>


Show HN: X11Color Java enum - <AUTHOR> https://gist.github.com/JavaTooling/2223b53c169cda539dc24e5db8a5ce39 <comment><AUTHOR> Just names and rgb values. Created from wikipedia entry on web colors with some copy-and-past and some regexps. Googled for something like this, but could not find. Needed it, now it exists and could be usefull for others as well, so posted it as a gist.

</comment><comment><USER2> Nice job. Needed something like this, we couldn't find it as well. Thanks for sharing.

<comment><AUTHOR> Good - thanks :)</comment></comment>


Arguments for Tabs (not spaces) - samholmes - <AUTHOR> http://samholmes.me/post/44018821224/arguments-for-tabs-not-spaces <comment><USER2> "That said, only a moron would use tabs to format their code." ([http://www.codinghorror.com/blog/2009/04/death-to-the- space-...](http://www.codinghorror.com/blog/2009/04/death-to-the-space- infidels.html))

"In theory, practice and theory are the same. In practice, they are not." That is why most teams (and languages and standards) end up on spaces, spaces work. Tabs become unmitigated clusterfucks unless maintained with the pristine care of a monastery monk.

More (specific) reasons:

#1. Your language, editor, team (with the exception of Go and makefiles) probably specifies not to use tabs.

#2. Once tabs and spaces get intermixed, it is a nightmare and the cleanup only works one way easily (goodbye tabs).

#3. Tabs have an undefined behavior across editors (for better or worse), indent this line, insert X spaces, move to next marked column, other even more creative ones.

#4. Most version control by default does care about whitespace (and should for stuff like Python) -- hence a mixture or auto-conversion situation is nightmarish.

#5. Your code will be displayed in places where the user does not have tab control (web interface, console printout, cat, etc) and then all the "flexibility" goes away.

#6. When your work policy has line length limits, how do you handle it? If you are allowed 79 "chars" per line, can 50 of them be \t chars? How do you handle the 79 char limit if you code with 1 space tabs, and I code with 10 space tabs?

...

#42. Tabs are evil.

EDIT: Seriously, can anyone link me to a major language style guide / standard outside of GoLang and Makefiles that specifies the use of hard tabs?

</comment><comment><USER3> Tabs to indent, spaces to align. Displays just fine for everybody.

It drives me up the wall that so many software shops have settled on "spaces for everything".

</comment><comment><USER4> At one project I instituted a formatting layout that I didn't like but it had one advantage: it was an automated compromise.

My take: I don't give a damn. Whenever I go into a new shop, one of the first things I say is "I don't care _what_ your formatting rules are so long as they're automated". Let the dev write the code as they will, so long as the formatting is automated. Automate, automate, automate. I _never_ want to worry about where my curly braces go, tabs versus spaces, 80 columns, and so on. At my current position, we have a git hook which reformats your code according to standards and the "central" repo will also reformat, in case you disable it locally. All code winds up with a consistent format that no one agrees on, but we never argue about.

No, not everyone will agree on the end result, but it's like worrying about gays in the locker room: grow the f __* up. There are _important_ things to worry about, like scalability, separation of concerns, beer.

Combine this with "alias emacs=rm" and your religious wars _go away_.

</comment><comment><USER5> Tabs for indentation and spaces for line-up is the optimum. There is no reason against tabs except if you're a Python or Haskell programmer.

<comment><USER6> What are the reasons against tabs for Python programmers?

<comment><USER5> PEP 8 recommends spaces. And consistency with other projects trumps the better thing.

</comment></comment></comment><comment><USER7> I was for a very long time a tabs supporter and hold out. In fact, this is taken verbatim from my .emacs

        (setq-default indent-tabs-mode nil) ;; The Death of a Legend!

I gave up not because anyone had any particularly good arguments, but just because it felt like I was constantly fighting an uphill battle. And now that I've stopped using tabs, I haven't really thought about it for years, which is a teensy bit of stress I don't have to deal with anymore.

Having said that, keep up the good fight.

</comment><comment><USER8> If you care how big indentation is, and you use github, and you don't like it to be indented 8 spaces, you need to use spaces. It's as simple as that.

<comment><USER3> You use spaces because of how github renders tabs in code when you are viewing it on the web?

<comment><USER8> Yes.

<comment><USER3> That seems like one of the most extreme cases of a programmer being a slave to his tools that I have ever heard.

<comment><USER8> You're right. I'm guilty of caring about the experiences people have when they read my code.

</comment></comment></comment></comment></comment><comment><USER9> OK, I'm biting; Using spaces instead of tabs is like using hard coded syntax coloring. I prefer my own color scheme thank you.

<comment><USER10> How do you handle line length limits? Or are there no line length limits in any of the codebases you work on?

<comment><USER3> Set a vertical bar that indicates the column that shall not be passed. I use 8-char wide tabs on the few codebases at work that use tabs, while everyone else seems to use 4 (because these particular projects obey "tabs for indent, spaces for align" either displays perfectly). I obey my vertical bar and always fall short.

Other peoples code will sometimes go over on my screen.... _but who cares?_ If I found that a particularly offensive situation, I would just adjust my settings accordingly.

</comment></comment></comment><comment><USER11> <http://www.jwz.org/doc/tabs-vs-spaces.html> is the canonical counter argument. Unless you can counter the arguments presented within, your perspective is flawed.

<comment><USER12> This is actually the exact argument _against_ tabs. If you need this much text in order to explain why and how to use tabs then that shows why spaces, which take no instructions, are the way to go.</comment></comment>


Chinese facial recognition firm raises mammoth $410m in funding - <AUTHOR> https://www.siliconrepublic.com/start-ups/sensetime-china-facial-recognition-ai-funding <comment><USER2> This doesn't end well.</comment>


ASCAP seeking donations to oppose Creative Commons, Public Knowledge, and EFF - <AUTHOR> http://www.zeropaid.com/news/89494/ascap-declares-war-on-free-culture/

<comment><USER2> This type of fact misrepresentation annoys me. Painting the EFF CC and PK as organization promoting pirating is down right dishonest. I just hope the artist are smart enough to not fall for this crap.

<comment><USER3> But its true. To organizations like ASCAP, the Creative Commons _is_ undermining copyright as they've come to understand and use it.

To ASCAP there really is no difference between pirating songs and releasing them straight to the public without a detour through compulsory license middle-man world. They miss out on the payday either way.

</comment></comment><comment><USER4> They can bully their users and pirates for all I care. As long as they don't touch public domain/creative common/copyleft stuff that I _produced_.

As far as I am concerned, they should give away their users and the pirates to _me_ if they hate people pirating their content so much.

</comment><comment><USER5> There is now no point whatsoever buying music. These people should not be supported.

I propose a reverse boycott: pirate the hell out of the artists you like, and donate directly to them what you think they deserve. Directly, as in skipping all the middlemen eager to take a cut of their pay and your freedom.

<comment><USER6> Practical question: How do we go about doing this? Say there's some band out there. A friend gives me a copy of one of their songs. I want to give the band $1. How do I do it?

</comment></comment><comment><USER7> _They say they are advocates of consumer rights, but the truth in these groups simply do not want to pay for the use of our music. Their mission is to spread the word that our music should be free._

This isn't an untrue statement.

<comment><USER8> I don't think the EFF have a particularly anti-copyright position. I mean, EFF cofounder Mitch Kapor was the cofounder of Lotus, which definitely did not give its software away for free. It seems his main motivation in the early days was a worry that a computer-cracking backlash would go too far and violate civil liberties (e.g. in the infamous Steve Jackson Games case), which isn't the same as thinking that computer cracking is a good thing. The organization now has similar concerns about whether the anti-piracy backlash is sufficiently respecting due process, protecting the rights of people who are in fact innocent, etc.

Somewhat more true of Creative Commons, but they still have an opt-in view of it: they'd like to promote a world where many people give away their music for free, under various definitions of "free" (may include e.g. no-commercial-use clauses), but it's strictly voluntary if you want to use a CC license or not.

</comment></comment><comment><USER9> Defamation suit anyone?

<comment><USER10> Why play their game? Just ignore them I say.

<comment><USER9> Because turnabout if fair play.

Because ignoring them doesn't stem the tide of their rhetoric. Fighting them and winning sends a clear message that they are wrong.</comment></comment></comment>


Quirky Wink Hubs bricked due to expired TLS cert. All retail stock pulled - <AUTHOR> http://www.cnet.com/news/quirky-needs-your-wink-hub-back-after-a-security-update/?

<comment><USER2> As big of a screwup as this is/was, they've done pretty well at recovery. They posted some "fix it yourself" instructions last night (that just require you to change your router's dns settings for a few minutes so the hub can reconnect to where it needs to go - that worked like a charm for me.

</comment><comment> xkcd-sucks It's not a bug, it's a Quirk™</comment>


FCC Fines Smart City $750K for Blocking Wi-Fi - <AUTHOR> https://www.fcc.gov/document/fcc-fines-smart-city-750k-blocking-wi-fi-0 <comment><USER2> Since marketing and selling jamming devices is illegal, I would like to know what the FCC is going to do about the supply chain. We know these are all using well known advertised features of enterprise wireless gear. Are they working on a consent decree with Cisco/Aruba/etc to stop including this feature? Or are they going to play whack-a-mole with end users for the next decade?

<comment><USER3> Hypothetical question: I buy some land to host conventions. I make the buildings and enclose them in a big faraday cage. Then I make deals with anyone that agrees: Whoever wants to host a convention in my center, they will accept that inside the convention center, there will not be any kind of transmission, except my own wifi. Leaving aside the ways I could accomplish this, is what I want legal?

<comment><USER4> Not sure. If someone has a cell phone and needs to call 911, would you be held liable for their inability to make that call?

<comment><USER5> I've always worked on the assumption that it is within my right to build my private facility out of copper if I choose, and the fact that your cell phone doesn't work in my facility is your problem not mine. I am not "jamming" any signals. I would be interested to hear counter-arguments from those familiar with the FCC rules on this matter.

<comment><USER6> Maybe if intent to jam wireless could be demonstrated, but there are no codes I know of that require a certain level of permittivity in a building, and indeed many buildings all but squash signals- and that is the user's problem.

</comment></comment></comment></comment></comment><comment><USER7> Here is Smart City's response.

[http://apps.fcc.gov/ecfs/document/view?id=60001011936](http://apps.fcc.gov/ecfs/document/view?id=60001011936)

Among other interesting points is that they seem to have been using the same "de-authentication" trick that Marriott had used in a similar case a while ago. Also, they make an argument about density and interference that IMO shouldn't be dismissed out of hand. I still think they were wrong and deserved the fine, but it's worth keeping in mind that mobile hotspots can fall afoul of the very same principle and law behind that fine.

<comment><USER8> > For instance, in those cases in which Smart City has used de-authentication > in the past, it targeted only access points and wireless devices that are > located within the confined and proprietary space of the exhibit hall -- > areas of a convention center that are licensed for private event and to > which access is limited -- and that pose a threat to secure, reliable, WiFi > availability within that confined space.

That's not how WiFi works. They cannot know for a fact that these WiFi hotspots are within the convention space, they could and likely are, blocking WiFi located outside of that space.

Additionally they're claiming that they literally own the radio spectrum within a "proprietary space" which is a dangerous line. What is stopping them from blocking all cellular signals or worse charging cellphone companies for the signal travelling through their space?

Their point about security is nonsense. The technology they're employing is DESIGNED to secure WiFi networks by disconnecting actually rogue APs (i.e. devices squawking the same SSID as their network), that is still legal, the problem they and the Hilten ran into is that they took tech' designed for security and mis-used it for monopolising the WiFi spectrum within their convention centers.

So, sorry, no. If your WiFi network is called SmartCityWiFi and you disconnect MyHotSpot then you're breaking the law and have zero security arguments to make.

Good on the FCC for giving these guys a fine. Too bad it wasn't more. I read their arguments and it has only made me side with the FCC more. What they're asking for would make the world a worse place in general and only helps their bottom line.

<comment><USER9> Bingo. You are totally and 100% legitimately allowed to hijack, block, and/or de-auth rogue WiFi access points broadcasting the same SSID as you so long as the blocking is targeted at your own property (some leakage is inevitable).

If attendees were naming their personal hotspots "SmartCity" then SmartCity would have a point. They weren't.

<comment><USER7> In the first paragraph you mention property, but SSIDs aren't property. They don't own "SmartCity" and you don't own "RandomPundit" and I don't own "DidMyResearch" either. The legal point seems to be whether Smart City's actions were limited to the _physical space_ they owned or leased, not what SSIDs were involved.

<comment><USER10> >They don't own "SmartCity"

They have a trademark on the phrase "Smart City Networks" within the area of wireless high-speed Internet.

[http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4801:lwa...](http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4801:lwav4n.2.1)

<comment><USER11> You know very well that's not the same thing...

</comment></comment></comment></comment></comment></comment><comment><USER12> As someone that travels with a myfi hotspot this is welcome news. The fines should have been higher.

<comment><USER13> Agree. They should be fined just for charging people $80 a day to connect to their network.

<comment><USER14> Returning the money would be interesting. Most people probably paid with credit cards.

</comment></comment></comment><comment><USER15> I wish they (FCC, FTC et al) would look into other convention center trade practices. Convention center workers are heavily unionized and exhibitors are forced to pay abnormal rates for any kind of local labor or rental services. You can't bring your own service providers and you can't DIY either in most cases.

<comment><USER16> Convention center rates are kind of ridiculous, but they're sort of like airports in that they both charge ridiculous rates for common goods in their controlled areas.

Also similar to airports, I doubt that the local monopoly is illegal since it's usually the city that sets it up. The problem here seems to be that they were messing with transmissions, which the FCC has control over.

Although I agree, just because it's legal doesn't make it less of a pain. Back when I was an exhibitor at conferences, we used to get Ikea furniture delivered to the hotel, carry it in, assemble it ourselves, and just leave it at the end of the conference. It was about 1/8 the price of rental furniture.

Different convention centers have different rules, but the ones I went to used to allow you to assemble anything you could bring in the front doors. If it came in the back doors you'd need to pay drayage and assembly fees. We had a collapsible booth that was very useful in this regard.

<comment><USER17> Convention centers are often built with taxing authority bonds, and then the monopolies used as kickbacks to local unions and service providers. Very cozy.

<comment><USER18> Or, in other MadLibs terms:

___Municipal facilities___ are often built with ___municipal obligation/revenue____ bonds, and then the monopolies used as ___opportunities___ to local unions and service providers.

</comment></comment></comment></comment><comment><USER19> How were they blocking personal hot spots? The article doesn't get into details. Since they were providing their own wifi, they weren't using a jammer. Were they blasting deauth packets at any hotspot not on their whitelist? Were they using mdk3?

<comment><USER7> According to their response (cited in another comment) they were spoofing de- auth packets, and were only doing so for hotspots determined to be physically within their proprietary space. It's not hard to do that via triangulation.

<comment><USER20> You repeatedly and willfully ignore the invalidating part of this - that they -do not own the airwaves-, inside their 'proprietary space' or otherwise. It is unlicensed spectrum, anywhere, precisely because we can't control (easily) the transmission of radio waves.

<comment><USER7> They don't, and you don't either. The attitude that hotspots' use of unlicensed spectrum is sacrosanct, while failing to extend that same doctrine to venue owners, just reeks of entitlement. The attempt to put one group of unlicensed-spectrum users above another has no basis in law.

<comment><USER21> What _does_ have basis in law is that, while on unlicensed spectrum, you can't willfully mess with other people's transmissions. Period, point blank, end of discussion. They were doing this. They violated the law. They got fined. This is not up for debate.

\- On your property? Doesn't matter. Still illegal.

\- They're using your SSID? Doesn't matter. Still illegal.

\- You entered into a contract to block all other signals? Doesn't matter, you entered into a contract to do something expressly illegal.

\- Too many radios will make the local spectrum unusable? Doesn't matter, the band is unlicensed. Still illegal.

We can talk all day about the should haves and the would haves, but the practical and legal facts of this case are quite clear.

<comment><USER7> > You entered into a contract to block all other signals? Doesn't matter, you > entered into a contract to do something expressly illegal.

Incorrect. There are many things that are illegal without consent, but legal with it. Sex, for example. In this case, as soon as you enter into an appropriately worded contract, that de-auth packet stops being interference and starts being an agreed-to part of that contract. Therefore it's none of the FCC's business. It _might_ be the subject of a civil suit, but that's a different matter.

That's why I've said repeatedly that Smart City's misdeed (and Marriott's before them) was not the mere sending of de-auth packets. Condemning de-auth packets is like condemning screwdrivers. The real problem is that they did not _obtain consent_ for that use of the tool. They could have made that part of the convention registration, and they would have been OK (though they would almost certainly have faced an outcry). It's no different than a company forbidding the same thing within their corporate HQ building, which almost everybody here seems to believe is OK. I see a lot of people throwing words like "legitimate" and "illegitimate" around today, but nobody seems to have a realistic definition handy. I find it amazing that so many here want the government making technical distinctions for us, which they never do well, instead of relying on the simple notion of consent (or lack thereof) between parties.

<comment><USER20> The law says 'x'. As enforced by the FCC.

Your contract as a private party, with another private party, does not absolve either of you from your obligations under law. The FCC is a third party to this contract, and your 'sex' example is irrelevant (on many different levels).

<comment><USER7> So what is your solution, other than hoping the FCC will get the definitions right to allow the practices that are convenient for you and disallow those that are inconvenient - and not overreach into still more areas of communications, and not be generally corrupt, and so on? If rigorously applied, the precedent set here _WOULD_ apply to corporate networks doing the same thing, with the FCC involved in deciding which rogue APs are or are not "legitimate" threats to security. Oh boy, they'll sure get that one right! As I said, consent is at least a clear and enforceable standard, plus it gets the FCC _out_ of everyone's boardrooms and bedrooms.

<comment><USER21> Thankfully, the law is not C++ and we have this thing called "judgement".

This is unlawful interference, pure and simple.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER22> If only they could do the same thing for airports (e.g. LAX) where they don't explicitly block your signals, but they also don't allow any cell towers to be built in the area...

<comment><USER23> I'm convinced that LAPD has a few Stingrays set up at LAX - my phone shows full service but the connection is terrible and I always lose about 30% of my battery life between touch down and getting in a car.

<comment><USER24> Maybe you can confirm this if you live in LA? That would be a cool catch.

[http://www.slate.com/blogs/future_tense/2014/12/31/snoopsnit...](http://www.slate.com/blogs/future_tense/2014/12/31/snoopsnitch_is_an_app_by_the_german_srlabs_that_detects_imsi_catchers_stingrays.html)

</comment></comment></comment><comment><USER25> At a large convention, would personal Wifi hotspots even work reasonably?

There are only 11 Wifi channels available in the US, and since the channels are considerably wider than the center frequency separation each overlaps with several adjacent channels--meaning that in a given area at most 3 wifi hotspots can operate before you start to get overlap.

Unless the power is kept _very_ low, so that only devices very near you can see your hotspot, I'd expect performance to be terrible if more than a handful of people fire up their hotspots.

Have I overlooked something?

<comment><USER26> mifi hotspots don't have that much range. so even if they interfere all you have to do is walk away 20 feet and everything is fine.

</comment></comment><comment><USER27> They should return the $750k directly to the people who they scammed out of $80 / day instead of to the FCC slush fund. I'm sure most/everyone paid with a credit card.

<comment><USER28> $80? SmartCity charged us over $1200 for three days of T1 Internet access because that was the only way we would be allowed to have Wifi for a demo we were doing in our booth in MInneapolis according to their rules.

Even after paying all that we were still blocked with deauth packets until we begged their network engineer to whitelist our MAC addresses.

</comment></comment><comment><USER29> The market would have adjusted and better devices that can circumvent their blocking would have become available.

Moreover, if Smart City chooses to block WiFi signal on their own private property, that is their business and not the FCC's. Of course they probably did this nefariously without the knowledge or consent of the private property owner.

Still pretty crummy of them to do that.

</comment><comment><USER30> What if the building is intentionally built as a Faraday Cage thus preventing an outside signal? This way the signal is passively blocked and they can still provide their wifi inside.

Not that I condone their behavior.

<comment><USER31> I think this would be a disaster for other reasons and EM bands. Doctors with Pagers. Parents who need to be informed of a sick kid at school, etc. You would be interfering with a public conveyance.

<comment><USER32> Many convention centers are, nonetheless, obviously built to ensure you won't get a signal inside the building and will have to pay for whatever overpriced service the convention center offers.

<comment><USER33> Even from a cynical-greed perspective, that seems catastrophically stupid. Businessfolks need to stay in touch. A convention center where cellphones don't work is a convention center that won't get a lot of repeat customers, and cellphones don't even offer the option of extorting your visitors to use your in-house service like wifi does.

<comment><USER34> Sure it does. Have your venue be a faraday cage so that outside cellular service doesn't work inside. Setup cellular service inside your building, and enter into high cost roaming agreements with the major carriers, at such a rate that the carriers pass it on to customers. Much like cell service on cruise ships.

<comment><USER33> Can you _imagine_ the public outrage when people start finding $100 roaming charges on their cellphones because they _stayed at a hotel_? And the alternative is to notify all your potential customers that their phone costs more inside this building, before they actually give you any money. Your competitors would throw a party when they heard about it.

</comment></comment></comment></comment></comment></comment><comment> HG532e-W2XHCH Adil& Aminaal

</comment><comment><USER35> Sweet justice!

</comment><comment><USER36> TNCAP60F0DB

</comment><comment><USER36> TNCAP254B7A

</comment><comment> TNCAP25B7A<USER36>
</comment><comment><USER38> TNCAP254BA7

</comment><comment><USER39> People who care about this can upgrade their clients and APs to handle Management Frame Protection. Or they can complain to FCC and wait fourteen months.

</comment><comment><USER40> Bingo time. Today's free spaces:

"Why is the gov't punishing a successful business model?"

"The gov't should stay out of SmartCity's Freedom To Contract with the convention centers."

"If people don't like it, they can go outside the convention center, or not attend conferences at that convention center. No one is holding a gun to their head."</comment>


On becoming an expert C programmer - <AUTHOR> http://www.isthe.com/chongo/tech/comp/c/expert.html <comment><USER2> There's nothing magic about learning C versus any other language.

\- Read an authoritative source (K&R is good; there are better ones)

\- Read a bunch of good code (I mostly read tools and kernel sources)

\- Write crappy code and get better

Generally I want to write 10K lines of code in a new language before I probably don't suck at it. Varies on the language and paradigm, going to C++ from C took like five years (figuring out OOP, and painful lessons on what to avoid in C++), and apparently I'm never going to understand Haskell.

<comment><USER3> I'm a self-taught programmer. I started with Pascal (what seems like an age ago), then C, then VB5/6, then C# and JS and a bunch of other programming languages. At this point I felt like I could pick up about any mainstream programming language very quickly.

And then I tried to tackle Haskell. That was about five years ago, and I think I'm still at beginner/intermediate level with it. But I realized something. These days I have a career and family. Back when I was learning Pascal, I had a lot more time and mental focus on my hands. All the programming languages I've learned since (besides Haskell) were not much different than Pascal, not fundamentally so.

Haskell is fundamentally different. I definitely feel like my past programming experience helped me learn Haskell faster than if I had no experience, but that past experience was also a handicap. I had to discard a lot of assumptions and get to a more basic mindset of what the art of programmming entails. And like a lot of other folks, I found it to be a very rewarding (and useful) experience.

<comment> V-2 Modern C# does provide some FP constructs (in the form of LINQ, lambdas etc.). I know that having used them a lot made it easier for me to grasp Scala.

<comment><USER4> I found the reverse to be true - Learning FP paradigm stuff in Scala helped me pick up C#.

Finding out about Linq made me research functional-relational mapping for Scala. FRM makes so much sense to me.

</comment></comment></comment></comment><comment><USER5> Whenever I've looked at an open source C programs, they go well beyond what I've learned in K&R.

Learning C these days means mastering Make, autotools, macros, POSIX and Glib.

Knowing these is the difference between your contrived linked-list example and creating software that can actually be deployed and is useful.

<comment><USER6> You make an excellent point. Perhaps more so than with other languages, getting to grips with making C actually useful relies a lot on quite extensive knowledge of the build environment.

<comment><USER7> You also have to know about how computers work, how they represent numbers, how and where they store memory, how computers process information, you have to know about interrupts low level os stuff, networking protocols, physical hardware limitations, debugging low level byzantine failures. You have to know a lot more than just C syntax. I haven't even mentioned computer science, best practices, working with others, architecture and UI topics.

</comment></comment></comment><comment><USER8> Not mentionned, about being an expert C programmer, is knowing the pitfalls of C, (cf. undefined behaviors), and reading and knowing the ANSI C standard.

Of course, just knowing the language in and out is not enough, you also have to be a good programmer in general (algorithms, "design patterns", software architecture, software engineering, etc).

But writing C code without undefined behavior, and avoiding its numerous pitfalls is absolutely necessary.

<comment><USER9> "Not mentionned, about being an expert C programmer, is knowing the pitfalls of C, (cf. undefined behaviors)"

I am an expert in C, I had been decades writing on it and other languages, and managing teams of coders. We created a company that used it a lot.

I can't understand what undefined behaviors C has, because it is the most simple and defined language I do know of. I have lots of experience writing assembler,fortran, Lisp, c++, python, objective C and also use C#, java, javascript and other web languages and functional languages from time to time.

c++, java could be extremely undefined because the behavior depends on conventions, committees and implementations. E.g we had to change some code because of different compilers interpretation of the standars.

But c? c is basically portable assembler. If you understand how computers work it is extremely reliable bar none. We have ported years of work of dozen programmers in one day. With c++ and "write once, run everywhere marketing" java we spent months.

It was also terribly frustrating for the team. Fontforge author had a similar experience writing c++ compilers and that experience was so traumatic the interface of Fontforge is so ugly as he does not want to use c++ with a ten foot pole.

We try to avoid pitfalls more in high level languages because the programmer has the ability to write code without understanding what is really happening in the processor, or even in the program. Recipe programmers population is growing a lot this days.

<comment><USER10> >If you understand how computers work it is extremely reliable bar none.

On my processor, INT64_MAX + 1 will be INT64_MIN, a negative value. But the compiler is free to turn

      for (int64_t i = 1; i > 0; i++) {
      	f(i);
      }

into an infinite loop. Understanding how the computer works without reading about undefined behavior will make you fall into these kinds of traps.

<comment><USER11> missing overflow guards is just one of the big disappointments in c, if you have experience with asm for any popular processor atm.

<comment><USER12> Wasn't part of the scope of the language. It's a doble edged sword, but I could see that being a good thing too. If you want raw speed, and know what you're doing, it could be OK not to have overflow guards.

</comment></comment></comment></comment></comment><comment><USER13> You're an expert C programmer when your C program has enough users that its buffer overflows get CERT advisories from Homeland Security.

</comment><comment><USER14> There is plenty of C code to look and learn: Linux, PostgreSQL, lua & luajit, sqlite, redis, cairo, nanomsg, libuv, etc. etc

<comment><USER11> Id's Quake and Doom sources are a classic in this matter. I looked a bit at wsw, a fork of Quake 2. Now, my code is full of structs with function pointers. It's like I just internalized the more elaborate syntax and now it's all Hammers and Nails. I mean, function pointers to functions returning function pointers, for example.

      typedef int (*foo) ();
      foo * bar ();
      foo * p = bar;

not rocket science, but ambiguous at first sight when compressed to one line. I hope that kind of syntax is as complicated as it get's, because I'd like to think C semantics aren't really difficult. That is until implementing customized data types on top.

As mentioned in another comment, learning the toolchain is just as important and it's not without reason, that Don Knut takes forever writing about compiler design. Never mind the ventures into the algorithmic side of things.

<comment><USER15> [http://ideone.com/ZOvq0n](http://ideone.com/ZOvq0n)

You probably meant this:

[http://ideone.com/wuZI2o](http://ideone.com/wuZI2o)

<comment><USER11> thanks. welp, I'm still learning

<comment><USER15> Consider using ( void ) instead of () when declaring anything with zero parameters.

</comment></comment></comment></comment></comment><comment><USER16> This answer ([http://programmers.stackexchange.com/a/229245/7146](http://programmers.stackexchange.com/a/229245/7146)) is about managing code complexity but the lesson applies equally as well to becoming a better programmer with any language.

</comment><comment><USER17> For me c is kind of a wierd language. Wierd in that the language itself is incredibly simple, I think anyone could learn c syntax and usage in about 2 days max. But I think where most people get hung up with on c are the concepts, you do need to know about compiling and linking, static vs dynamic libs, lots of details about how computer architecture / memory works, and to get anything done you need know POSIX and the concepts behind any libraries you use. Its not like ruby or other dynamic languages where you could basically have no idea how HTTP works and still write a webapp.

<comment><USER18> The development of a (good) web-server in pure python likely still requires knowledge of language internals. If depending on libraries, it just depends on the libraries. Web frameworks with "Batteries included" seem rather rare on the C shore, though, maybe because statically compiled languages are in general not used as frequently in web-development. Therefor it's an unfair comparison.

To leverage C's power, libraries should also tend to stay general enough, too, no?

Most compilers or interpreters are complicated under the hood. Fixing a bug in the compiler to get your code working (and submitting a patch), that's mastery.

</comment></comment><comment> vezzy-fnord Freecode is now frozen, but you may want to check out its informal successor Freshcode: [http://freshcode.club/](http://freshcode.club/)

</comment><comment><USER19> C is still my favourite language. Sure it has issues but it works how my brain works or is it my brain works how C works? Either way it just makes sense to me.

</comment><comment><USER20> In my experience, one of the easiest ways is to just get employed by a company, where coding is done in C. You will have to code in that language a lot and the colleagues can help you. I also learned a few languages myself in my spare time (PHP, Python), but that is not nearly as effective.

If you want to really be an expert on C (or in anything imho), you just have to do it fulltime.

</comment><comment><USER21> > Always, always, always write code as if it will last 30 years.

Well said. But if i do 'git blame' and see a code is like 30 years old. First thing to come to my mind is it must me some kind crappy old legacy code

I know it is wrong. It is substance that matters. But lately somehow i programmed to myself to like newer code then older code. I need to step out that misconception.

</comment><comment><USER22> C is a cakewalk compared to C++ but a lot harder to do right, even when experienced, because of its more low level constructs

<comment><USER23> Sure. Climbing a mountain is a cakewalk compared to descending an erupting volcano as well.

The analogy being that C++ appears to make things simpler (descending) but the destination is filled with peril.

</comment></comment><comment><USER24> "DBell is one of the best programmers on the planet."

How would one verify this?

I tried a couple of his sample C programs.

One of them was one source and one header file and compiled easily and quickly. A+. But then I looked at what the program did and realized I had written several iterations of the same utility myself years ago, using only the shell, sed, tr and ed or vi. I guess maybe his point of writing this in C is that he envisions a system that lacks those programs?

Then I tried another sample, which was a little more complex.

It failed to compile. Looks like he assumed Linux but failed to state the program is not portable. F.

I am always on the lookout for truly great C programmers.

Is DBell really as good as Noll says?

<comment><USER25> It would be good if you could mention precisely what programs have you tested and perhaps provide some links.

<comment> V-2 I agree with 101914. See my comment: [https://news.ycombinator.com/item?id=8511826](https://news.ycombinator.com/item?id=8511826)

</comment></comment></comment><comment><USER26> "It is somewhat easy to write a program that works. It requires practice and effort to write code that you can maintain and support."

Truer words were never spoken.

</comment><comment> V-2

       Look at some of DBell's code:

       http://www.tip.net.au/~dbell/
       http://www.isthe.com/chongo/tech/comp/calc/index.html

       Learn from it. DBell is one of the best programmers on the planet.

I have nothing against Mr DBell, whom I don't know, but... don't learn from it, please.

       Weather 1.9 - Java application to plot weather observations from the Australian Government's Bureau of Meteorology (BOM) web site.

I did look at it.

Controller.java is over 1200 lines long. Don't learn from people who create classes that big (aka God objects).

SunriseSunset.java contains nearly 100 lines of commented out code. That's another bad practice.

What's more, it consists mostly of a main method commented as "Simple main to test the class". This is a so-called poor man's unit test, it doesn't use assertions, it just prints some results out to be verified by the programmer manually. Which is another antipattern.

His FileInfo.java (part of his FileSelection 2.0) contains tautological comments like:

        //
        // Get the suffix path.
        //
        String suffixPath = fullPath.substring(prefixPath.length());

Gee, you don't say. Redundant comments, another antipattern.

isDirectoryEmpty (in the same file) happily ignores an exception:

        boolean isEmpty = true;

        try
        {
            stream = Files.newDirectoryStream(directoryPath);

            for (Path path : stream)
            {
                String name = path.getFileName().toString();

                if (!name.equals(".") && !name.equals(".."))
                {
                    isEmpty = false;
                    break;
                }
            }

    	stream.close();
    	stream = null;
        }
        catch (IOException e)
        {
        }
        finally
        {
            Utils.safeClose(stream);
        }

        return isEmpty;

Meaning that if an IOException occurs (for whatever reason), the method will tell you that the directory is empty, even if that's not true.

Setting stream to null after closing it makes no sense whatsoever (it's a local variable, it's not going to survive exiting the method).

Closing it in the try block makes no sense to me either, because Utils.safeClose is going to execute either way; that's how the finally clause works. It looks like the author assumed that finally only executes if an exception happens. No, it is run in either case.

So, what's the point of closing the stream twice? And if it does serve some purpose, now that would require leaving a comment, because it's totally unobvious. Not "getting the suffix path", which is blatantly obvious.

I could go on. This is poor quality code, I'm hardly a great programmer (working on it!), but it's not up to my production standards.

If the man is "one of the best programmers on the planet", the planet can't be Earth.

<comment><USER27> >So, what's the point of closing the stream twice?

The first stream.close() does not get executed if an IOException occurs.

<comment><USER28> The whole point of a finally block is to have the cleanup code in it that should be called regardless of whether or not an exception occurred in the first place.

So the first stream.close should not be there if the 'finally' block already contains one, and it _will_ be executed twice if an exception does _not_ occur.

</comment></comment></comment><comment><USER29> The article advises learning to play music because a lot of good programmers play music. A lot of programmers are also white. Please become white if you can.

<comment> vezzy-fnord Not a valid comparison at all. One is a learned skill, the other is an innate phenotype.

<comment> V-2 That's true, but the point is that this correlation could be pure coincidence, or at least not causative. (If it actually occurs to start with - it would be interesting to create a poll and verify whether most reputed programmers are indeed more musical than general population.)

Many programmers have stereotypical geek interests like RPG, Star Wars etc. but it doesn't mean that these contribute to their programming skills in any way. Being socially awkward doesn't make you Sheldon Cooper :)

<comment><USER30> Except there is a large body of research which shows the effect of music on cognitive ability to support the assertion</comment></comment></comment></comment>


Check Out Quik's New Website Let us know. - <AUTHOR> http://www.quik.is

<comment><AUTHOR> Let us know your opinions and comments !</comment>