Image Dithering: Eleven Algorithms and Source Code - <AUTHOR> http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/ <comment> mark-r The article doesn't put enough emphasis on the need for gamma correction. If you dither a pure gray area of level 128, it will become approximately 50% white and 50% black. But when you display that back on the screen, because of gamma effects it will look closer to a level of 186!

A few years ago there was a need for 15-bpp or 16-bpp color images on phones rather than the 24-bpp images we usually work with, and dithering was a great way of producing them. No idea how much need there is today though.

<comment><USER2> 24bpp is not enough for shallow gradients which don't come from a photographic source (especially in dark images). I frequently dither 48bpp material for 24bpp displays.

I typically use Sierra Lite.

I've recently been experimenting with error diffusion along continuous space- filling curves (I forget where I saw this technique first), and using color difference functions (CIEDE2000) to gauge quantization error. These are overkill, but it sure beats doing it the same boring way forever.

Frankly, I would like it if the CRTCs attached to modern GPUs had some ability to apply dither (even just ordered dither) to buffers as they're scanned out, while exposing more precision to applications.

<comment><USER3> Unless you are integrating many pixels (how many and with what weights depends on the future processing, intended output, and viewing conditions for the image) I would not expect using a fancy color difference formula for comparing individual pixels to give a particularly useful result. Indeed, the whole point of dithering (especially with high resolution output) is that we can adjust the average light coming from a several-pixel-wide blob by brightening or darkening individual pixels, and thereby make finer distinctions in light level, since the individual pixels are not really noticed. I'm also pretty skeptical about the space-filling curve thing. Those both sound like placebo features to me.

<comment><USER2> Well, I did say _experimenting_ , didn't I?

I found the thing which inspired my space filling curve exploration: [https://www.compuphase.com/riemer.htm](https://www.compuphase.com/riemer.htm)

The Butteraugli score between the standard lena and the Riemersma dither is about 0.5 better than the standard Floyd-Steinberg one.

Approaches like this come closer to back-propagation of errors, the lack of which is where some of the artifacts of unidirectional dither come from. In practice, any decent (full bleed) error diffusion dither works perfectly fine going between 16 and 8 bit planes, but why shouldn't I try some things out which (as you are quick to point out) may have very little value.

Heck, even gamma correction isn't strictly necessary when you're going from 16 to 8 bit sRGB.

<comment> mark-r Yes, once you start working on a very small segment of the curve it's close enough to linear and gamma correction becomes overkill.

<comment><USER3> I could see it making a difference in average color of very noisy regions, especially brightly colored ones. I suspect you could deliberately construct an image where the difference could be seen by human observers.

</comment></comment></comment></comment></comment></comment><comment><USER4> There's a really good technique for getting rid of the wormy or snake-like textures in Floyd-Steinberg: add another term to the threshold proportional to (some monotonic function of) the distance to the nearest preceding dot. This tends to make the dots very nicely spaced. These ideas were, among other places, used in Gutenprint.

A bit of description, and ancient but working GPL'ed code here: [http://www.levien.com/artofcode/eventone/](http://www.levien.com/artofcode/eventone/)

A paper containing the basic output-dependent feedback idea: [http://levien.com/output_dependent_feedback.pdf](http://levien.com/output_dependent_feedback.pdf)

</comment><comment><USER5> Dithering trades sample resolution for sample frequency to convey the same information. For images, the underlying sample frequency usually doesn't change but the _apparent_ spatial sample frequency becomes lower in order to achieve more than one effective bit per (coarser) sample.

For one-dimensional signals like audio, the underlying sample frequency is usually increased while decreasing the sample resolution (often to 1 bit per sample). This keeps the effective Nyquist frequency where it needs to be while pushing noise much higher in frequency where it's very easy to remove with an analog filter. Delta-sigma modulation is perhaps the most common method of audio dithering (although the delta-sigma literature rarely uses the D word).

The reason images and audio usually use dithering in opposite ways is that images are usually post-processed for lower true sample resolution (and higher effective sample resolution) _after_ sampling, while audio is often sampled _initially_ at much higher than the Nyquist frequency because dithering is a planned part of the audio processing chain. But not always! Those are merely common use cases.

<comment><USER6> I'm not sure I follow. To me dithering comes from quantization. I don't think you should think of dithering in frequency space.

[https://bjango.com/images/articles/gradients/dithering- extre...](https://bjango.com/images/articles/gradients/dithering-extreme.png)

Illustrates the same signal dithered or not. No sampling rate involved.

And please correct me if i'm wrong, but you can not trade sample accuracy for sampling rate.

<comment><USER7> You can trade sample accuracy for sample rate. This is how I directly interpret ordered dithering. The following line on the wikipedia article communicates (maybe) this:

"The size of the map selected should be equal to or larger than the ratio of source colors to target colors. For example, when quantizing a 24bpp image to 15bpp (256 colors per channel to 32 colors per channel), the smallest map one would choose would be 4x2, for the ratio of 8 (256:32). This allows expressing each distinct tone of the input with different dithering patterns."

Same idea applies to 1D signals (from [https://www.wikiwand.com/en/Delta- sigma_modulation](https://www.wikiwand.com/en/Delta-sigma_modulation) : " used to convert high bit-count, low-frequency digital signals into lower bit-count, higher-frequency digital signals")

same idea: [https://www.wikiwand.com/en/Class- D_amplifier](https://www.wikiwand.com/en/Class-D_amplifier) [https://www.wikiwand.com/en/Pulse- density_modulation](https://www.wikiwand.com/en/Pulse-density_modulation)

</comment></comment></comment><comment><USER8> Also a paper about halftoning on laser printers:

[http://users.eecs.northwestern.edu/~pappas/papers/pappas_ist...](http://users.eecs.northwestern.edu/~pappas/papers/pappas_ist94.pdf)

I have never used a laser printer that did implement anything like this, the usual halftoning sucks. Once I handcrafted a file with a 600 dpi Floyd- Steinberg image (the native resolution of the printer I hadd) and it resulted in much better results, I didn't bother calibrating the gray levels though.

<comment><USER9> I came to the same conclusion just this week. I got the best print simply by matching the density of my black and white laser printer with the black dots I wanted it to print.

Specifically, I used the ImageMagick operations "-dither FloydSteinberg -monochrome" for more contrast or "-dither FloydSteinberg -remap pattern:gray50" for more fidelity to the original image.

I was surprised that the prints were better without adjusting for gamma. If I converted the image to a linear color space before the dither operation, the print came out too dark. I'm guessing that the gamma in the non-linear color space compensated for the dot gain on the printer to cancel out the effect.

<comment><USER8> > I was surprised that the prints were better without adjusting for gamma.

Ha, it was the same for me. I used imageworsener where I had to explicitly specify -nogamma for this effect.

An other place where wrong gamma handling accidentally works is text anti- aliasing. It turns out that for small font size the wrong handling of colorspace results in more readable text than the gamma-correct method only for dark text on light background [1]. No wonder people don't like to use light fonts on dark background (like terminals).

[1] [https://www.freetype.org/freetype2/docs/text-rendering- gener...](https://www.freetype.org/freetype2/docs/text-rendering- general.html#experimental-stem-darkening-for-the-auto-hinter)

</comment></comment></comment><comment><USER10> What a coincidence, I just stumbled upon this article a few hours ago while trying to find out which error diffusion algorithm is used by Photoshop out of curiosity.

I've been playing with dithering recently to create braille art[0] and this series of articles[1] by the libcaca developers has been a huge help. It also goes over model based dithering algorithms which tend to give the best results.

[0]: Example [https://pastebin.com/raw/cRt4GL8j](https://pastebin.com/raw/cRt4GL8j)

[1]: [http://caca.zoy.org/study/index.html](http://caca.zoy.org/study/index.html)

</comment><comment><USER6> Two modern use cases where dithering is more important than ever:

\- Tone mapping hdr to display colors

\- Alpha style transparency in deferred rendering

Also one case I heard about but don't know much details is audio.

Dithering is important and powerful any time some precision is discarded.

<comment><USER11> Yep, Photoshop does dithering by default when converting from 16bpp (or higher) to 8bpp. Many, many image processing apps & libraries don't do this, and I wish they would!

This is a little different than the article though -- all the article's dithers are good at half-toning, or 1bpp images. If your destination is 16bpp images, or 16-bit audio, you don't need error diffusion, just a decent sequence of random numbers.

<comment><USER12> Why does one need dithering to go from 16-bit to 8-bit? Can't I just shift the value to the right by 8 bits?

<comment><USER11> Just to add to what @grenoire said -- if you only shift/truncate then there are times when can see (or hear) the difference between 1 bit. You can truncate, numerically speaking, but depending on what you're doing, the result won't be very good.

When taking an image from a higher range down to 8-bits per channel, there are two specific cases where you tend to see bad banding problems. When doing high quality poster prints like a giclee or photo print, the printer's color gamut is drastically different from a monitor, so banding that you don't notice on a monitor can suddenly become a plainly visible eye sore in a print. This is a big problem if you're paying $100 for your large format print.

The other problem is when resizing an image down. The resampling process smoothes out noise in an image. Normally, a DSLR photo has a signal to noise ratio that is less than 8 bits, meaning even 16 bit RAW photos have noise that is stronger than the lower 8 bits. You can usually truncate the lower 8 bits without noticing. But if you resample the image and downscale it, the noise is smoothed and banding can appear. This can happen with photos of any large flat field of color, like a wall or the sky.

</comment></comment></comment></comment><comment><USER13> Previous discussion: [https://news.ycombinator.com/item?id=11886318](https://news.ycombinator.com/item?id=11886318)

Another good page on image dithering: [http://bisqwit.iki.fi/story/howto/dither/jy/](http://bisqwit.iki.fi/story/howto/dither/jy/)

</comment><comment><USER14> The article mentions ordered dithering but fails to list void-and-cluster and similar variants thereof. Those parralelize really well (unlike error diffusion), don't result in obvious patterns (unlike normal ordered dithering) and can be run on gpus. It's quite useful to dither high bit depth videos to 8bit in realtime. Dithering HDR content has the benefit of not introducing banding on SDR displays.

</comment><comment><USER15> Despite the criticism and glossing over in this article, I believe that ordered dithering gives the most aesthetically pleasing result myself.

<comment><USER16> Ordered dithering has also a very important feature : it's stable wrt. animations. If you try moving a single pixel in an animation using floyd steinberg, the error spread can be huge and has visible effects on the whole image. OD, however, has a limited scope and is much more resistant to animation.

See this image : [http://bisqwit.iki.fi/jutut/kuvat/ordered_dither/jittest_flo...](http://bisqwit.iki.fi/jutut/kuvat/ordered_dither/jittest_floyd.gif)

now see the whole article at [http://bisqwit.iki.fi/story/howto/dither/jy/](http://bisqwit.iki.fi/story/howto/dither/jy/) , it's really good.

</comment></comment><comment><USER17> Seeing a dithered image really brings me back to the mid 90's. Seeing a dithered photograph reminds me of the early web or AOL. You used to remove colors from GIFs to save space on web pages, as few as you could as long as the image was still tolerable.

With a 1MB SVGA card, you could pick between 16-bit color at 800x600, or 8-bit (256 colors) @ 1024x768. Did you value higher resolution, or not having to palette shift every time you switch apps?

</comment><comment><USER18> I was showing coworkers an example of the Floyd Steinberg algorithm today.

The following images have the same amount of colors, namely black and white.

[https://i.imgur.com/stQUl5E.gif](https://i.imgur.com/stQUl5E.gif)

[https://i.imgur.com/mw8IX9N.gif](https://i.imgur.com/mw8IX9N.gif)

Source image:

[https://i.imgur.com/diR72k2.jpg](https://i.imgur.com/diR72k2.jpg)

<comment><USER19> My suspicion is that you didn't handle the gamma correctly as mentioned in another comment.

<comment><USER8> [https://imgur.com/595mX6m](https://imgur.com/595mX6m)

Done with imageworsener[1].

        imagew -cc 2 -dither f -grayscale diR72k2.jpg diR72k2_dither.png

[1] [http://entropymine.com/imageworsener/](http://entropymine.com/imageworsener/)

</comment></comment></comment><comment><USER20> [http://uwspace.uwaterloo.ca/bitstream/10012/3867/1/thesis.pd...](http://uwspace.uwaterloo.ca/bitstream/10012/3867/1/thesis.pdf) is one of the best general papers I've read on the subject.

</comment><comment><USER21> These images, especially the last one, bring back a tonne of nostalgia about early 90s Apple Macintoshes and my HP Deskjet 310.

I wonder what artifacts of the limitations of modern technology will be remembered with nostalgia by those growing up with today's equipment.

</comment><comment><USER22> After having seen neural networks used to transform images, could we train a neural network to dither images ?

(obligatory NN comment :-))</comment>


Ind.ie phone - <AUTHOR> https://ind.ie/phone/

<comment><USER2> this isnt just a phone. the manifesto -- and i use the term loosely -- is more or less about subverting the oss community because.. UxD.

the phone - it's a pipedream, unless they actually get the capital to design & produce the full stack, and the baseband. oh the baseband. it needs to be able to be reloaded at intervals, checksummed, isolated etc.

the project aims for a true indienet, one where every client is a peer in a privacy empowered social network, as if that isn't an oxymoron per definition.

my biggest gripe, isn't the goals, it's the language and the blanket generalizations.

oh and don't forget, the alpha client for the social network is osx only.</comment>


Detecting Malware with Downloader Graph Analytics - <AUTHOR> http://www.umiacs.umd.edu/~tdumitra/blog/2015/10/10/detecting-malware-with-downloader-graph-analytics/ <comment><USER2> I wonder how common it is for malware to obfuscate later stage payloads?

If I hide my executables inside an image (or zip, pdf, docx) and download them with URLDownloadToFile, will this evade detection?</comment>


Words that make valid sentences - <AUTHOR>

Given 5 randomly chosen words.  What is the likelihood that it makes a valid sentence? The list of valid available words does not include proper nouns.  Plural/singulars are treated as different words.  Interesting thought experiment and wanted to see what other people come up with. <comment><USER2> 1\. Create a list of common words, the more the better. Let's say we list a common spelling dictionary of 80,000 words.

2\. Create an order-5 permutation of the list (a result in which the order of the words matters). For an 80,000 word dictionary, that's 3.27 x 10^24 test sentences, each of five words.

3\. Scan the result sentence set, using a heuristic able to distinguish valid sentences from invalid ones. Let's say that one optimized validation test requires one millisecond -- in that case, the test would require 1.04 x 10^14 years, 7536 times the age of the universe.

Meaning this is a much easier question to ask than answer.

EDIT: Another approach is to make an arbitrary assumption about the structure of a five-word sentence, like pronoun-noun-noun-verb-noun: "The calico cat ate breakfast.". Crude and limited, and many apparently valid results will be meaningless, but it makes the estimate easier.

We realize that random words have a probability of being pronouns, nouns or verbs, pp, pn and pv. The probability of producing a valid sentence (pvs) using the described template is therefore:

pvs = pp * pn * pn * pv * pn

Just generate the probability values by scanning a dictionary, identifying the word types (easier said than done), perform the above equation, and you have your answer.

<comment><USER3> Complementing the thought on sentence structures: 5 word sentences could be extracted from existing texts. Tagging them would give you the set of possible sentence structures.

Hopefully there wouldn't be too much trouble with ambiguous word types, e.g. green can be either an adj or noun.

</comment></comment><comment><USER4> It depends completely on whether you are looking for "valid" in a structural sense or a semantic sense. If a structural sense, lutusp's second approach looks very do-able. There are a lot of cases to consider and it would most likely mean pulling out an old grammar book that actually teaches these things but it could be approached systematically. It also would mean making some assumptions about verb forms, ie I would only want to have to choose the verb at random and not the form.

If "valid" in a semantic sense, I wouldn't have a real clue where to start. The structural requirements give you an upper bound and a quick initial test. Perhaps you could start with a small set of words and observed how they scale upwards?

</comment><comment><USER5> Randomly chosen from what? Or, to put it another way, does every word have the same probability of selection or is each word's probability weighted based upon frequency.

If "crwth" is as likely as "is" then the likelihood of a meaningful sentence is lower than if actual word frequencies come into consideration.

[http://en.wikipedia.org/wiki/Crwth](http://en.wikipedia.org/wiki/Crwth)

</comment><comment><USER6> A simple way to try it, in Python:

        >>> import random
        >>> words = open('/usr/share/dict/words').read().split()
        >>> words = filter(str.islower, words)
        >>> ' '.join(random.sample(words, 5))

<comment><AUTHOR> How would you know if the word combination is a valid sentence? NLTK?

<comment><USER6> I just parsed them manually; I didn't come up with any syntactically valid combinations in the first 100 attempts.</comment></comment></comment>


My Reaction to React - <AUTHOR> https://pseudoconcurrentthought.wordpress.com/2016/01/26/my-reaction-to-react/ <comment><USER3> I went down a similar path a few years ago when starting a new project. Instead of learning a new framework I wrote my own. It took less time overall, since the logic wasn't especially hard to write, and it was easier to debug - at first. Everything changed as soon as another developer, then two, then three, started working on it with me. They were not happy about learning how to use my custom MVC framework.

Perhaps the most valuable thing about frameworks is that they are common languages. They make it easier for developers to dive into a new code base and quickly understand what's going on. It's not entirely about functionality. I think this is partly why framework usage seems to be so trend and style driven; everyone wants to be using what everyone else is using.

<comment><USER4> 100% agree on the common language front. The real challenge is when you're dealing with a language that has framework saturation, so there isn't really a "common" framework.

Ruby and Python have Rails and Django which goes a LOOOOONG way in fixing this problem. Not many languages have that one, dominant framework and usually that's because people keep inventing new ones to deal with shortcomings of current ones OR that the frameworks do so little on top of what the language already offers that it's easy to create your own. Javascript and PHP are clear cut cases for the latter since both languages are out of the box built for the web. jQuery was the last real unification in the Javascript world.

I don't entirely care which framework becomes dominant as much as I just want A framework to become dominant. React looks like it is gaining that momentum, but you immediately see the problem play out when there's a thread about how great React is followed by 100 "X is better because it doesn't handle Y the way that React does" followed by another post about how "X is worse because of the way it handles Y". There's something about the Javascript world that seems ready to create new frameworks instead of contributing to existing ones.

I took a sales class years ago and the biggest takeaway from it was "People buy pain relief". jQuery was dominant because it solved a huge pain point, cross browser compatibility, in a way that made natural sense for people working in the browser by using CSS references...AND it was built to run side by side with any other JS library (Prototype, Mootools, etc) so you could safely invest in learning it and know you'd be able to use it on any project that came along. During a time when IE6 compatibility was a big deal this was huge. During a time when a lot of people were trying to solve the problem and you'd inevitably end up on a project that chose one of the other dozen options, side by side compatibility was huge.

These were major points of pain relief that jQuery brought to the table and that's how it won.

<comment><USER5> The problem with coalescing around React is that it's not really a framework. The lack of a default Rails-like monolith encourages every dev to assemble their project from a la carte pieces - so every React app has a different project structure, a different data library, a different build tool, etc. Even worse: since everyone wants to build their app "the right way", there's constant churn as new best practices and micro-libs are introduced every couple of months.

I'm really hoping that one of these React dialects will win out soon, as it's not really a "common language" until everything is mutually intelligible.

<comment><USER6> Doesn't seem like it will ever be that way for React to be honest. If you want a JS monolith try Ember. Angular 2 may also be that way since it uses Ember's CLI tool.

<comment><USER5> I love Ember - and one of the best things about it is its emphasis on convention over configuration. React is the exact opposite. While it's an amazing library, it only makes up one part of a front-end stack, which causes everyone to waste tons of time deciding on what the other parts should be.

A set of sane, accepted defaults would help the community tremendously. Personally, I'm hopeful that that's what React/Redux/Webpack turns out to be.

<comment><USER4> I'm going to take a leap and assume you've done some Rails work because Ember tends to have a lot of Rails users.

In Rails, there's a default view layer handled by ERB but it can be mixed and matched with HAML, Slim or any other view layer. Likewise, you can use ERB, HAML and Slim outside of Rails entirely.

There are frameworks like Meteor that let you have an interchangeable view layer. There are others that build the entire full stack framework around THEIR view layer.

If Meteor made React the default view layer...that would be a step towards unifying the fronts. One full stack system with a shared layer that can be use inside or outside of that particular framework.

</comment></comment></comment></comment></comment></comment><comment><USER7> Am I the only one that thinks that the author is trolling? I mean, the final code has obvious flaws:

a) Difficult to read and mantain. (Compare with the version below).

b) Inefficient in a real world scenario as it has to recreate the DOM every time the model changes.

c) Difficult to test as it requires a DOM API.

d) XSS issues (Text returned from the service is not escaped in the DOM!)

e) Non isomorphic (Unless we have a DOM API in the server capable of emiting plain HTML).

Nevertheless, I agree that using React for such a trivial project would be too much, but there are other alternative frameworks that would fit for this kind of task (e.g. riot.js, Cycle.js, [Insert here your favourite one]).

My React version:

      const DATA = {
        name: 'John Smith',
        imgURL: 'http://lorempixel.com/100/100/',
        hobbyList: ['coding', 'writing', 'skiing']
      }

      const App = ({ profileData }) => (

          <Profile { ...profileData } />
          <Hobbies { ...profileData } />

      );

      const Profile = ({ name, imgURL }) => (

{name}

      );

      const Hobbies = ({ hobbyList }) => (

My hobbies:

            { hobbyList.map( (hobby, idx) => (

{ hobby }

            ))}

      );

      ReactDOM.render(<App profileData={DATA} />, document.getElementById('content'));

<comment><USER8> I fully agree that his version has flaws, and I certainly am not convinced that he presents a credible case against using React. But to be fair, I think part of his rationale for doing things this way is to avoid the configuration needed to develop with React. I'm somewhat ignorant, so what is the necessary tooling/configuration needed to convert this file to something that can easily be executed in the browser?

<comment><USER7> It is a misconception that you need a lot of configuration to start with React. The minimum setup requires just to import the React libs in your webpage and to transpile your code to ES5 using Babel in case you are using JSX/ES6 (recomended).

Of course for bigger projects, it pays off to use an automatic build tool like webpack or gulp.

[https://jsbin.com/keyuqohusa/edit?html,js,output](https://jsbin.com/keyuqohusa/edit?html,js,output)

[https://babeljs.io/repl/#?experimental=false&evaluate=true&l...](https://babeljs.io/repl/#?experimental=false&evaluate=true&loose=false&spec=false&code=%20%20const%20DATA%20%3D%20%7B%20%20%20%20%0D%0A%20%20%20%20name%3A%20'John%20Smith'%2C%0D%0A%20%20%20%20imgURL%3A%20'http%3A%2F%2Florempixel.com%2F100%2F100%2F'%2C%0D%0A%20%20%20%20hobbyList%3A%20%5B'coding'%2C%20'writing'%2C%20'skiing'%5D%0D%0A%20%20%7D%0D%0A%0D%0A%20%20const%20App%20%3D%20\(%7B%20profileData%20%7D\)%20%3D%3E%20\(%0D%0A%20%20%20%20%3Cdiv%3E%0D%0A%20%20%20%20%20%20%3CProfile%20%7B%20...profileData%20%7D%20%2F%3E%0D%0A%20%20%20%20%20%20%3CHobbies%20%7B%20...profileData%20%7D%20%2F%3E%0D%0A%20%20%20%20%3C%2Fdiv%3E%0D%0A%20%20\)%3B%0D%0A%0D%0A%20%20const%20Profile%20%3D%20\(%7B%20name%2C%20imgURL%20%7D\)%20%3D%3E%20\(%0D%0A%20%20%20%20%3Cdiv%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%3Ch3%3E%7Bname%7D%3C%2Fh3%3E%0D%0A%20%20%20%20%20%20%3Cimg%20src%3D%7BimgURL%7D%20%2F%3E%0D%0A%20%20%20%20%3C%2Fdiv%3E%0D%0A%20%20\)%3B%20%20%20%20%0D%0A%0D%0A%20%20const%20Hobbies%20%3D%20\(%7B%20hobbyList%20%7D\)%20%3D%3E%20\(%0D%0A%20%20%20%20%3Cdiv%3E%0D%0A%20%20%20%20%20%20%3Ch5%3EMy%20hobbies%3A%3C%2Fh5%3E%0D%0A%20%20%20%20%20%20%3Cul%3E%0D%0A%20%20%20%20%20%20%20%20%7B%20hobbyList.map\(%20\(hobby%2C%20idx\)%20%3D%3E%20\(%0D%0A%20%20%20%20%20%20%20%20%20%20%3Cli%20key%3D%7B%20idx%20%7D%3E%7B%20hobby%20%7D%3C%2Fli%3E%0D%0A%20%20%20%20%20%20%20%20\)\)%7D%0D%0A%20%20%20%20%20%20%3C%2Ful%3E%0D%0A%20%20%20%20%3C%2Fdiv%3E%0D%0A%20%20\)%3B)

<comment><USER9> I think the issue people have with React is that a lot of tutorials assume you are already using NPM/Babel.

If you're using a module importer already then adding React to your stack is pretty easy. For example with JSPM:

$ jspm install --dev react react-dom $ npm install --save-dev babel-preset- react

Then add 'react' to your .babelrc preset.

In your ES6 javascript file you can now use react via:

import React from 'react';

\----

That's it.

However, if you have none of that already set up... Then you'll naturally be persuaded that now is the time to get a 'modern' javascript environment setup and doing so can take time. It took me about 2 days of beating through RequireJS --> Webpack --> JSPM before I settled on the latter.

Figuring all that was difficult, but looking back on it was extremely useful to now have all my Javascript bundling done within JSPM rather than using some Django bundler, and downloading raw JS files from the internet without evening using Babel to help me write ES6/ES7.

</comment></comment></comment></comment><comment><USER10> Okay I think the author is severely misinformed as to why we use React. I say this because the very first thing he says is to use MVC architecture and then goes on to write his own framework ( _from scratch???????_ )

...Why?

This solves none of the problems React was designed to solve and only makes things more complicated by introducing new APIs only you know.

Yes, this approach with vanilla JS is great for small apps. What makes you think this app won't grow?

I hardly see how this is a reaction to React other than to say "I didn't really read into why people are using React or what it's trying to solve, but I'm pretty sure I can solve this problem with my own framework I just whipped up.

Sorry for the brash delivery.

<comment><USER11> I'm not really fighting you on the merits of frameworks (which should be obvious to everyone), but are you implying that implementing a design pattern is equivalent to building a framework?

<comment><USER10> Not at all but what is the end goal of this if we consider that the code base will increase in size? You'd likely start adding more and more things to it to make it easier to work with and eventually you've unintentionally rolled your own framework.

React could also still be implemented as part of the author's view because they haven't covered any of the problems with large cascading data updates. So there's literally no argument against React in this post. It's basically just a post about how to implement a design pattern in a language, React doesn't even need to be mentioned. I might even call it click bait.

<comment><USER12> He's not trying to make an argument against React. I take him at his word here, mostly because it was indeed helpful for me:

"If you want to use React, fine, I am not trying to convince anyone not to. I just want to show that components in a JavaScript application are quite simple to do and do not require any framework at all to do so."

There are a lot of less experienced web developers being steered towards react that can gain a lot by understanding what is being laid out here, whereas I think more advanced developers like yourself have so much assumed knowledge that its hard for you to see past what from your perspective are glaring differences/inadequacies in the approach he's taking in the article.

<comment><USER13> _> He's not trying to make an argument against React._

I disagree. He actually _is making an argument against React_ but disguising it with a _passive-aggressive_ writing style. That said, it doesn't mean his article is not helpful because like you said, it _did_ help you.

I interpreted the following paragraph as passive-aggressive:

 _" If you want to use React, fine, I am not trying to convince anyone not to. I just want to show that components in a JavaScript application are quite simple to do and do not require any framework at all to do so."_

It follows the very familiar template of X-is-overkill-so-let-me-enlighten- you-young-grasshopper. Another example would be, "Hey, if you want to use a bazooka to kill a house fly, don't let me stop you but I just want to point out you can take a plain old rolled up newspaper and just swat at with a quick motion of the arm."

That type of rhetorical construct has been common sport in technical discussions for decades.[1]

Why interpret his paragraph like that? Look at his previous 2 paragraphs about seeing another "react, angular, ember", etc and how it's just tiring. (In other words, he's telegraphing to readers that he's intelligent enough not to have to learn them or need them.)

Yes, he does show the underlying skeleton of a "view" by showing some homegrown Javascript code but notice how he leaves out the concept of "DOM diffing algorithm". The virtual DOM is one of the features that makes React perform better with many components and changes.

Now if the author starts implementing more and more things that React does to achieve feature parity, he will end up inventing his own Pseudoconcurrentthought-framework. At that point, someone else will come along and write " _the Pseudoconcurrentthought framework is not necessary. You can do it with plain old Javascript_ " At the point, the cycle of critique will have repeated itself.

[1]E.g. "Angular is overkill when you can just use JQuery"; "JQuery is overkill when you can just use plain Javascript getelementbyid()"; "Using Javascript on the web page form is overkill to compute sales tax since you can just issue a POST and have the server send back another HTML page with the new sales tax amount", and so on and so on.

<comment><USER12> I don't really think we disagree on that much here. I think the only place we veer off is that I feel as though he's just trying to talk to his audience, vs being passive-aggressive.

The intended reader, as I interpreted it, would be the someone that reads Javascript Fatigue articles and goes "hell yeah". For this person the abundance of frameworks probably does feel tiresome. The person for whom this kind of advice would be patronizing doesn't seem to be who this article was meant for (although now I see what you mean by the title being click-bait)

</comment></comment></comment></comment></comment></comment><comment><USER14> React is just a library. It is the ideas behind it that are important:

a) building web front-ends by dividing them into components which are first- class citizens of the codebase, and can be composed, parameterized and reused, just like pure functions. [1]

b) expressing the view as a pure function of state has replaced any need to mutate the DOM manually and think about transitions ($.remove(), $.append() etc.). We need virtual-dom and diffing to be able to pull this off successfully, which makes this abstraction irreducible.

c) interspersing content-inside-code (JSX) is better than code-inside-content (template languages like Angular). [2]

The recent 'React fatigue' is due to people trying to figure out how to best manage state within this framework and causing a lot of noise in the process. And that is perfectly fine, but if you are confused by it, just use vanilla React and React's immutability helpers, keep all the state in the root node and pass everything down as props {...this.props}, and then when you get a hang of it, hop on to Redux. There is no 'one true way'; as long as your app works and you can hold it in your head, everything is fine.

[1] - [http://www.jasimabasheer.com/posts/on- react.html](http://www.jasimabasheer.com/posts/on-react.html) [2] - [http://www.jasimabasheer.com/posts/evolution-of-view- templat...](http://www.jasimabasheer.com/posts/evolution-of-view- templating.html)

<comment><USER15>
        There is no 'one true way';
        as long as your app works and
        you can hold it in your
        head, everything is fine.

With all due respect, this is the major criticism of adopting React, given that it's still in active development and given that many who are looking at using it have established apps using other patterns already.

<comment><USER14> React's API is fairly stable, and has been for a long time. Redux has almost become the de-facto standard for new projects, but again, it is just a library around a good idea: do all state transitions inside a pure function - get an input, return a new output, and the entire view gets re-rendered with it.

You can use React's immutability helpers inside it, or or performance in large state trees, use ImmutableJS that gives persistent immutable data-structures. This comes at the cost of having to use its own methods like map and filter, instead of normal JS everywhere.

But that is pretty much it. There are a few more other concerns that'll necessitate the use of redux-thunk, (which at its core is a few lines long), but you don't need to worry about any of this upfront. The thing with React is that unless you make costly architectural decisions upfront, you can always learn as you build, and figure out the right way to structure your project. Once you've built a fairly large project, you'll form your own set of opinions on which way you like to think about front-end code, and that'll inform you on your next project.

There is a learning curve, but with React, you are always thinking about fundamental things like encapsulation and message-passing than trying to learn non-transferable knowledge about a particular framework's quirks and conventions.

<comment><USER15> You don't need to sell it to me, I see the advantages--but precisely because I understand those advantages, I actually intend to complete my next project with Cycle.js [1].

[1]: [http://cycle.js.org](http://cycle.js.org)

<comment><USER14> Awesome! A lot of smart people have been saying good things about Cycle.JS, but I unfortunately have been unable to wrap my head around it. The idea of putting stream of user-generated events front and center appeals to the puritan in me, but I find it more natural to think about the front-end beginning with the rendered view, and events and their mutation (uni- directional actions) later.

The Elm language is yet another area that gives the fear of missing out on the 'better than yesterday's abstraction'. But as long as I'm able to build great software with the tools I know and patterns my brain is comfortable manipulating, they can wait. This is the line of thinking that I mentioned in the original post about no one true way.

</comment></comment></comment></comment></comment><comment><USER16> I don't get the boilerplate around App.main:

        var App = {
            main: (function() {
                window.addEventListener('load', function() {
                    // ... initialization ...
                });
            })()
        };

The initialization code is with an event handler function, fine. But then:

\- Then registering of that event handler is stuffed into a closure, although it doesn't declare any variables or pollutes the global namespace in any way.

\- This closure is then called immediately and its return value is stored into App.main, although it doesn't return anything, so App.main is declared as "undefined".

So there are two layers around that code which serve no purpose at all. Why not simplifying it? All you want is an App namespace and an event handler for window / load:

        var App = {};

        window.addEventListener('load', function() {
            // ... initialization ...
        });

Or, if you want a "real" main function (i.e. an "App.main" that is actually a function):

        var App = {
            main: function() {
                // ... initialization ...
            }
        };
        window.addEventListener('load', App.main)

If you put your


News:yc was rejected from the App Store - news-yc http://newsyc.me/rejection.html <comment><AUTHOR> On the other hand, there are several nice Hacker News apps for Android. Even better, if they were needlessly and rudely rejected as this app was, it would be trivial to install them anyway (except for AT&T phones). Once again, Apple shows that if you develop for iOS, you run the very real risk of your hard work being for nothing. How many apps have to get rejected before people realize this?

<comment><USER2> (There are several HN apps in the App Store.)

</comment></comment><comment><USER3> How about some screenshots of what your app looks like? There could be very simple changes that you need to make to get it accepted.

<comment> news-yc The homepage (linked just under the post, <http://newsyc.me/>) has there's a few screenshots, and there's also a slightly outdated video (<http://vimeo.com/21962215>) on Vimeo.

<comment><USER4> I took the liberty of downloading the source, compiling it and taking a few screenshots - see <http://www.dropmocks.com/mUuib>.

Looks like a clean job using stock UI controls.

As for your question in the README of whether it works on Xcode prior to v4, it works out-of-the-box on v3.2.6.

Good job!

</comment></comment></comment><comment><USER5> If you're not going to be on the app store any time soon, those of us who have not chosen to pay the $99 to compile code for the devices we own might really appreciate an ipa.

I completely understand if you'd rather wait and see if you can get revenue from it before making that choice, but just know that you do have an eager and ready audience if you decide to pursue other means of distribution.

</comment><comment><USER6> Your app does look like a step up from vanilla form field entry in mobile safari. It is about as basic an app as one can make, though. After reading your reference to Flipboard I was expecting an innovative user experience, though. Instead it's widgets straight off the palette in IB, but orange.

Have you considered something more ambitious on the UI front?

<comment><USER2> Ugh. I have it with ambitious apps. The app store needs so many more perfect standard apps. Custom controls are easy to get wrong. You have to be a genius to do an ok job with custom controls and most aren't.

This looks like a HN app I would actually like to use (as opposed to all the others currently in the App Store). Looks can be deceiving, though, the app might not be to my liking in some subtle way.

</comment></comment><comment><USER7> Yes, please appeal.

I use one of the existing (paid) HN apps, it has less functionality than yours, and, bonus, yours includes source code, so if something annoys me I can fix it myself.

I started writing my own, but now that seems kind of redundant :)

</comment><comment><USER8> Maybe you could contact PG and see if he'd be willing to partner with you on it? Then it becomes an "official" app rather than an aggregator. Best of luck either way.

</comment><comment><USER4> How do you use telekinesis?

<comment><USER4> For those who downvoted, look at <https://github.com/newsyc/newsyc/blob/master/CREDITS>. It lists telekinesis by Nicholas Jitkoff (who wrote Quicksilver). It wasn't clear to me how he's using it in the code.

<comment> news-yc Ah, okay, that makes sense. I only use a tiny part of it, just a category for URL parameter parsing (it was the best one I could find online and the license worked out fine): [https://github.com/newsyc/newsyc/blob/master/Classes/Categor...](https://github.com/newsyc/newsyc/blob/master/Classes/Categories/NSURL%2BParameters.m)</comment></comment></comment>


BrandColors – Official color codes for the world's biggest brands - <AUTHOR> http://brandcolors.net/ <comment><USER2> cool resource :) thanx!</comment>


Show HN: Warmly - what do you think? 2devs/1week - <AUTHOR> https://play.google.com/store/apps/details?id=com.chaoscollective.warmly

<comment><AUTHOR> Full disclosure: I'm one of the devs.

This was a whirlwind project we worked on to improve the experience of waking up. Jarring, buzzing sounds are great for real alarms in crisis situation, but getting out of bed shouldn't be alarming.

By quietly playing weather sounds and slowly increasing the volume over a few minutes it's actually pleasant to hear the "alarm" go off in the morning.

The Google Play store is flooded with alarm clock apps, so realistically it'll be hard to get visibility (even though we're super excited about it). Anyone have thoughts about how to get this in front of more people?</comment>


Former Microsoft Canada President: Wifi in Schools is a Potential Health Hazard - <AUTHOR> http://www.techvibes.com/blog/wifi-in-schools-is-a-potential-health-hazard-2013-05-10

<comment><USER2> There are very real problems with buildings that cause health problems in people: mould, especially in poorly maintained air handling systems, vapours from paint or new furniture - and they are often hard to track down.

And now this fellow comes and wants to blame everything on wireless internet. Words fail me.

<comment><USER3> Yea, like the asbestos lined "portable classrooms" they packed Canadians into for almost 50 years.

</comment></comment><comment><USER3> This is ridiculous.

How on earth did he land a Job as president of Microsoft?

Or is this just some ploy to prop up his future public speaking career?

</comment><comment><USER4> Apparently knowledge of basic physics isn't a prerequisite for being president of a major corporation. Who knew?

</comment><comment><USER5> Why is this posted here?

Is it interesting because it's a former Microsoft exec?

Is it interesting because people don't know that this claim is false?

Is it interesting for some other reason?

</comment><comment><USER6> Lol so much hate. I wish the article could provide the points that he was making.

</comment><comment><USER7> "Some of these kids have a doctor's note to prove it."

Hilarious!</comment>


Ubuntu Precise daily builds available on Brightbox Cloud - <AUTHOR> http://brightbox.com/blog/2012/03/20/ubuntu-precise-daily-images/

<comment><USER2> Woohoo. Lowering the barrier of entry to testing stuff ftw!

</comment><comment><USER3> Does this come with Ruby 1.9?

<comment><USER4> Ruby 1.8 is still the default in precise, though 1.9.3 packages are included in the repositories.</comment></comment>


Show HN: Archive websites from the command line - <AUTHOR> https://github.com/marvelm/erised <comment><USER2> At first glance I love this, looking forward to putting it through its paces. I often use wget to backup local copies of websites and it's been frustrating having no easy/automatic system to (a) keep easy information about when the snapshot was taken and (b) allows me to incrementally relate that snapshot into a network of historical info

<comment><AUTHOR> Thanks for checking out the project. You can also query the underlying database at ~/.erised/erised.sqlite3 if you prefer SQL over JSON strings.

</comment></comment><comment><USER3> Cool.

How does it work? What's under hood?

<comment><AUTHOR> It uses Electron under the hood.

[https://electron.atom.io/](https://electron.atom.io/)

<comment><USER3> ok, but does it archive whole website or just one page (given URL)?

<comment><AUTHOR> It only archives the one page.</comment></comment></comment></comment>


A Pint-Sized Earley Parser - <AUTHOR> http://joshuagrams.github.io/pep/ <comment><USER2> I like Loop's tutorial: [http://loup-vaillant.fr/tutorials/earley- parsing/](http://loup-vaillant.fr/tutorials/earley-parsing/)

</comment><comment> david-given I lived for years in Earley. That's totally not confusing.

Cache invalidation and naming: the two hard problems in computer science...

</comment><comment><USER3> My first use of the marpa parser was one of those rare occasions where you are pleasantly stunned at the quality, speed, and flexibility of a library.</comment>


You can't Javascript Under Pressure. - <AUTHOR> http://games.usvsth3m.com/javascript-under-pressure/

<comment><USER2> Was an interesting exercise :), I got in at 10:15 with all the SO I had to do.

</comment><comment><USER3> A very fun game :)

</comment><comment><AUTHOR> A very fun little game--let's do avoid spoilers though, folks.</comment>


Show HN: Start-up project, a curated Video Wall - <AUTHOR>

As part of perth.startupweekend.org we've built a curated video wall called viralityapp.co<p>We'd love to get some feedback and for you guys to crank our real time analytics up so we survive tonight's presentation. <comment><USER2> Pretty cool! Very fast paced when I first look at it, but the idea of having the most popular videos zoom by and clicking on one whenever it piqued your interest is good.

It seems that you have backwards and forwards mixed up (at least with what I think they would do -- I imagine scrolling left to right as going forward rather than the reverse)

Also, you maybe want to put some explanation modals in the app (I'm guessing you're bootstrapped) -- Some color wouldn't kill you, and also you could get some icons.

Maybe you want to do some sort of interactive tracking of trending videos? I'm not sure if/how you're doing that now, but however you're measuring virality would probably be it.

Otherwise, not much else to say, it's got a pretty good (read: simple) UX, and does exactly what it sets out to do.</comment>


Border between Belgium and the Netherlands at Baarle-Hertog/Baarle-Nassau (2017) - <AUTHOR> https://brilliantmaps.com/baarle-hertogbaarle-nassau/ <comment><USER2> That's an interesting story and I wonder why the two governments today wouldn't work together to clean that up a little bit, since it seems like it's bringing a fair amount of troubles for the people.

I also wonder if the story about the restaurant clients needing to change table is true tho. In theory, sure, but come on. Do you really expect police to come in with a map of the border and enforce the fact that clients should not be sitting at table #4 but table #5 is ok? That seems a little ridiculous too.

Also, does that imply that business on the border have to be incorporated in both countries? If not, does the Belgian business have to comply to Dutch laws since it's in part physically located in the Netherlands? In that case, is it really only subject for what's physically in the Netherlands? What if the kitchen is on Belgium side, The Netherlands are not allows to do proper health and safety inspection?

As I write this I realise that it brings a lot of interesting questions and everything must be very complicated over there!

<comment><USER3> As the countries are very friendly and work together in almost anything, this is not a big problem in practice. Presumably some very small scale hustling is tolerated as no government official really cares. When there is an actual problem, the two governments arrange another land swap. There is one every few years. Nobody cares, it gives both our monarchs something to sign on an official visit and gets another sheer for international cooperation from the press.

If you want to have some fun, you can smoke pot while standing on the border and holding it in your left, Dutch hand. If you're really daring you swap it over to your right, Belgian hand, and congrats, you're an international drug smuggler. If a cop sees it and you're unlucky, I suppose he'll ask a few puffs from you - Yeah I saw that happen in real life, and that was in Brussels a.k.a Belgium and as far from the boundary as you can get.

<comment><USER4> This, once in a while a land swap if needed. Else no one cares. The Dutch are fun neighbours.

<comment><USER5> Land swaps can be a royal PITA; the highest point in Finland is most of the way up a mountainside; the peak is just across (as in, within a stone throw) the border, in Norway.

To mark the centennial of Finnish independence, there was a campaign in Norway to give the Finns a few hundred square metres of Norway, so that they could get a highest point which was indeed a local maximum.

Too bad the Norwegian constitution says you cannot give away bits of the country; a land swap was suggested to ensure both countries remained the same size afterwards, but apparently this, too, would violate the constitution...

<comment><USER6> I wonder if they could both agree to wage a fake war for an hour, then sign a peace treaty detailing the new border.

<comment><USER5> A couple of Norwegian conscripts technically invaded Finland earlier this year; while patrolling the border, they accidentally strayed onto the other side.

(Not as hard as it may sound; the border isn't marked as such, only with the occasional pole here and there.)

<comment><USER7> invading requires intent to occupy

<comment><USER5> I guess it depends on whose definition you use; Norwegian papers at the time quoted experts (presumably a professor of international law, though I can't remember) who claimed that legally speaking, having troops in uniform venturing into another country counted as an invasion.

Considering all the notes being passed back and forth afterwards, the conscripts must be kicking themselves for not keeping quiet about it; they weren't observed by Finnish border guards; rather, they notified their officers when returning to base that they'd crossed the border; the army notified the DoD, which notified the Foreign Department, which notified the Finns, who said 'Huh?'

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> The ugliest of all borders must have been Dahala Khagrabari at the border between India and Bangladesh. It was the only third order enclave until India ceded the tiny piece of land to Bangladesh in 2015:

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

It was a piece of India within Bangladesh, within India, within Bangladesh - which itself would be enclaved within India if not for a small border with Myanmar.

<comment><USER9> _> ...which itself would be enclaved within India if not for a small border with Myanmar._

And international waters; the jargon term for that is _semi-enclave_ (if there hadn't been the border with Myanmar, that is).

</comment></comment><comment><USER10> How were things before the EU and Schengen area were formed? Has it always been legal to cross Dutch-Belgian border in this town, or did people get in trouble for walking into the wrong street?

Lack of border wall does not mean lack of border. There was a big story here in Canada a couple of months ago about a French woman accidently crossing the border between Canada and the US and having to spend two weeks in detention.

[https://www.cbc.ca/news/canada/british-columbia/jogger- who-a...](https://www.cbc.ca/news/canada/british-columbia/jogger-who- accidentally-crossed-u-s-border-from-b-c-detained-for-2-weeks-1.4717060)

<comment><USER11> The fact that we don't have an open border between the U.S. and Canada is a real shame. Just a waste of everyone's time to indulge the U.S. border paranoia. I'm not really worried about the US being flooded with poutine and hockey.

Or even better, a sort of super-Schengen area including the EU, the US, Canada, and Japan. Yeah, I know I'm dreaming, but it's not like this set of countries would produce mass migration or security issues that would cause problems beyond the economic benefit of a free migration. [https://news.ycombinator.com/item?id=17382400](https://news.ycombinator.com/item?id=17382400)

<comment><USER12> I think the reason why US wants a border with Canada is that the immigration policies of those 2 countries are widely different.

<comment><USER10> And one of the main reasons Canada wants a border with the US is that gun control policies between our countries are widely different. But EU countries also have widely different immigration and gun control policies, yet somehow they managed to form a union. I am sure these are not irreconcilable differences.

<comment><USER13> ...and now quarrel among themselves after several waves of refugees want to become immigrants. So the union tried to distribute the refugees somewhat evenly, which led to further quarrels.

It's just as if me and my girlfriend and all of our neighbours have to accept refugees into our apartments, after our senior neighbour, crazy refugee lady, invited them over. The refugees all want to stay in my girlfriend's room because it's nicer, but most our neighbours collectively decided that we should split them between ourselves according to room size. My girlfriend reluctantly agrees, but I'm quarelling with her and the neighbours over the refugee issue. This can only lead to one thing: breakup.

</comment></comment></comment></comment></comment><comment><USER14> Makes The City and the City ([https://en.m.wikipedia.org/wiki/The_City_%26_the_City](https://en.m.wikipedia.org/wiki/The_City_%26_the_City)) suddenly more realistic!

<comment><USER15> That was a great story - but the ending was a bit of a let down.

Tip to the reader: There absolutely nothing supernatural, or extrahuman, going on whatsoever.

</comment></comment><comment><USER3> I once heard how the border between the 2 countries close to Maastricht was established: Maastricht was the first city not conquered by the Belgian revolutionaries. There were some military units stationed there, and 1 or more canons. As a result, the border was defined as everything that could reasonably be reached by shooting these canons from Maastricht.

<comment><USER16> The cannons are still there, they're down the street from my house.

The general who was then in charge of Maastricht was much despised by the locals because of his decision then to be loyal to the Dutch king. So when his remains were ordered to be moved when a new road was build (decades later), the workers who were supposed to do it didn't, and a lamp post was built on his grave. They're redoing that area now and the new park that is being built there, will have an old lamp post in a weird spot as a reminder of this historical quirk.

(Very OT but I find it such a cool story that I thought I had to share :) )

<comment><USER3> I always get the impression that Belgium never really intended to split off from The Netherlands. Unfortunately, the Dutch king of the time was completely out of touch with what his new subjects wanted, even while heavily investing in his new country.

Efforts to finally get the stubborn guy to at least give some token gestures to a small number of mostly irrelevant demands got so completely out of hand, that people more or less accidentally started a revolution.

The feelings of the newborn Belgium governement seemed more or less : Oh shit, we accidentally liberated this country. How did we become the governemnt in the first place? What are we gonna do? Then asking some French noble to be the king and getting a 'no' from him wasn't helping much either.

</comment></comment></comment><comment><USER17> Slightly off topic maybe, but it always surprises people that the Netherlands has a border with France. It's just in the Caribbean on the island of St. Maarten / Saint Martin. Obligatory YouTube clip "Holland vs. The Netherlands" [https://m.youtube.com/watch?v=eE_IUPInEuc](https://m.youtube.com/watch?v=eE_IUPInEuc)

<comment><USER18> Even more complicated: The country of The Netherlands does not border France, but the Kingdom of The Netherlands does, as St. Maarten is a separate country within the kingdom.

St. Maarten isn't part of the EU, but St. Martin is. But inhabitants of St. Maarten are EU citizens, and there is no hard border between the two parts even though there should be one, as this is a border of the Schengen Area.

This means that I, a citizen of the country of The Netherlands with a identity card but without a passport, am allowed to travel directly to France via Belgium, and I can book a flight and enter St. Martin, but I am not allowed to visit St. Maarten!

<comment><USER19> Your last part interest me, what do citizens of the netherlands have to do to visit St. Maarten or other parts of the Kingdom of The Netherlands ? Get a visa ?

In France we differentiate between parts of France proper (mainalnd France, Corsica, Guiana), our overseas departments (used to be more complicated but now they're "almost" parts of France), and our overseas collectivity like St. Martin. But as a French citizen I can visit pretty much any that I want without the need to ask anyone for permission.

Additionnaly, how is "your" part of the Island governed; fully autonomous or has the royal family (real/actual) oversight or is the governement of the Netherland overseeing it or ... ? Our way is mostly "they have their local governement but if the French one tells them something they do it".

It's interesting to me, especially since New Caledonia being the only dependance who didn't ask to be integrated but to move away will have to decide between autonomy or independance

<comment><USER18> "Someone" got it right, you need to have a passport. A visa is only required for stays exceeding 180 days a year. You also need to book a return ticket.

The Netherlands (the country) also has overseas territories, namely Bonaire, Saba, and St. Eustatius. They are considered regular municipalities, but you still need to have a passport to visit them. They also have some duration limitations to prevent migration from the mainland.

About the governance: Long story short, it's complicated. Some laws apply to the Kingdom so they're for both continental and overseas, but most laws are made only for country of The Netherlands. The other countries are mostly self- governing, including making their own laws, but stuff like international treaties and military is done on the Kingdom level, which in practice means it's done by the Country. To give an example: after Irma, St. Maarten had to formally ask The Netherlands for help, otherwise the military would not have been allowed to give any assistance, as it could be considered an invasion. In general, any form of intervention is seen as a form of neo-colonialism. We try to intervene as little as possible.

</comment></comment></comment></comment><comment><USER20> Reminded me of the exclave Point Roberts, Washington. There was a story linked to here on HN a while back.

[https://en.wikipedia.org/wiki/Point_Roberts,_Washington](https://en.wikipedia.org/wiki/Point_Roberts,_Washington)

[https://www.atlasobscura.com/places/point- roberts](https://www.atlasobscura.com/places/point-roberts)

It seems to me that Netherlands and Belgium are handling the situation somewhat more pragmatic.

</comment><comment><USER21> > I also wonder if the story about the restaurant clients needing to change > table is true tho. In theory, sure, but come on. Do you really expect police > to come in with a map of the border and enforce the fact that clients should > not be sitting at table #4 but table #5 is ok? That seems a little > ridiculous too.

It seems far fetched, as you would expect a restaurant to have one legal address, and which rules apply depend on the rules of that country.

<comment><USER22> As locals in a town of several thousands and ~2Km at the widest part the police wouldn't really need a map to know every single place. Also the border is literally drawn on the pavement in most if not all places.

</comment></comment><comment><USER23> Tom Scott did a video on this border.

[https://youtube.com/watch?v=oE93J33SfHY](https://youtube.com/watch?v=oE93J33SfHY)

</comment><comment><USER24> Some nice entertaining education about maps/borders is provided by the "Map Man" over here: [https://www.youtube.com/playlist?list=PLfxy4_sBQdxy3A2lvl-y3...](https://www.youtube.com/playlist?list=PLfxy4_sBQdxy3A2lvl-y3qWTeJEbC_QCp)

To bad they stopped making new ones.

<comment><USER25> I've been watching this guy's channel, who has lots of content about interesting borders and such:

[https://www.youtube.com/channel/UCJVnko6tQ56PYB5BNNChPGg](https://www.youtube.com/channel/UCJVnko6tQ56PYB5BNNChPGg)

</comment></comment><comment><USER26> I know you wonder, yes in Dutch part there are coffeeshops where people can buy pot.</comment>


Net Neutrality Op-Ed in the Wall Street Journal Was Written by Comcast Attorney - <AUTHOR> https://theintercept.com/2017/12/14/that-net-neutrality-op-ed-in-the-wall-street-journal-was-written-by-a-comcast-attorney/ <comment><USER2> I am always impressed by the number of motte and bailey commentors here. The WSJ cravenly lets the most hated corporations write featured Op-eds and that's normal? Ho-hum? Business as usual!?

We need to seriously reconsider what we want out of journalism. I don't want to live anywhere where this sort of media is okay. I'm not sure why anyone else is suddenly okay with this either. The "Free Market" was supposed to be a tool to more efficiently organize labor and capital, not _enslave us_. It is supposed to work _for us_ , it is _our tool_. But if _readers_ are now _okay_ with _literal_ shilling in media, then that's it. We've been captured by our own tools, slaves to our own machines.

I keep questioning my decision to have a Washington Post subscription, but I'll sleep better tonight knowing it goes towards something that at least _tries_ to be journalism.

<comment><USER3> Why shouldn't someone publish their view?

<comment><USER4> It can take a while to get used to the lingo:

Professional person that agrees with you - expert.

Professional person that disagrees with you - shill.

I'm conflicted on this. I do not think the Obama era measures are the be all and end all of net neutrality legislation, but Trump's blatant pro big business and anticompetitive instincts are always a threat to consumer interests. Whichever way we as individuals decide or lean, it's always worth listening to both sides of the argument.

<comment><USER5> Is it disagreement if it's paid for? How's it any different than an ad?

<comment><USER4> Suppose an attorney for the Electronic Frontier foundation posts an article or opinion piece on a digital rights legal issue. This has happened many times and I don't remember ever seeing anyone call them a shill, yet they are a professional person paid to argue on these issues in public and in court. How is that different from advertising? How about legal experts on human rights? Environmental activism? Is anyone working for Greenpace as a lawyer or scientific adviser an environmentalist shill? If not, then how can we use that slur against people working for energy companies?

I'm not some corporatist shill making this argument. I'm just making a liberal plea for tolerance and respect in public discourse.

Legal experts on many different sides of many different debates have a reasonable expectation to have their opinions and arguments heard in public without harassment, abuse and intimidation. However there is a reasonable expectation of disclosure of such interests.

The argument in this specific case seems to be n the amount of detail in the disclosure, but the fact is he was a Democrat appointee and he works for a law firm that represents Comcast. There was an attempt at some level of disclosure and he wasn't actually acting as an attorney for Comcast. I don't think this is as big a deal as is being made about it.

</comment></comment></comment></comment></comment><comment><USER6> > _The op-ed contained an unusual disclaimer:_

>>> _Mr. Leibowitz was a Democratic commissioner at the FTC from 2004-13 and chairman beginning in 2009. As a partner at the law firm Davis Polk & Wardwell, he represents both technology companies and broadband providers._

> _The reference to both industries reads as an effort to be upfront about any > potential conflict of interest, but also to suggest that Leibowitz has > clients on both sides of the issue, so his argument is dispassionate. Tech > companies, historically, support net neutrality, while broadband providers > oppose it._

The op-ed was prefaced with a contextual paragraph. So this wasn't a "sleeper" influencing public opinion, _a la_ Ender's Game. The WSJ made sure this highly-public person was properly contextualized.

<comment><USER7> The Op-ed was not prefaced by such a contextual paragraph.

Please see: [https://www.wsj.com/articles/everybody-calm-down-about- net-n...](https://www.wsj.com/articles/everybody-calm-down-about-net- neutrality-1513124905)

The second paragraph of the commentary by the The Intercept contained your quoted section, which is at the end of the op-ed and not visible in the first page of the paywalled opinion article.

<comment><USER8> Fair point, but I wouldn't expect to see anything but a corporate friendly op- ed in the Wall Street Journal, nor would I think anyone who regularly reads the Wall Street Journal. Even the New York Times can be pretty corporate/middle of the road.

<comment><USER9> Op-eds are often supposed to be seen as different (and interesting) than what the paper's editorial board and columnists typically argue. "Op-ed" is supposed to be an abbreviation for "opposite editorial" \-- though of course the pinion editor (who is usually part of the editorial board) has final say in that

<comment><AUTHOR> I'd never before heard it claimed that "Op Ed" was short for "Opposite Editorial", and had presumed it was short for the catchall "Opinion / Editorial". But you are correct: [https://english.stackexchange.com/questions/204681/op-ed- or-...](https://english.stackexchange.com/questions/204681/op-ed-or- editorial).

It seems worth clarifying, though, that "Opposite" is referring to the layout of the page (ie, the "facing the editorial page"), and not to the position in the debate (not "arguing against the editorial position"). The two earliest first cited usages in the OED makes this clear:

      1924   R. H. Lyman World Almanac 25/1
        This 'op. ed. page' (page opposite the editorial page) is
        unique in American newspapers. It is a page of opinion in
        all the arts.

      1931   J. W. Barrett World, Flesh, & Messrs. Pulitzer iv. 82
        Swope developed..the idea of a distinctive 'opposite
        editorial page' consisting of two 'columnists', one book
        reviewer and the daily output of the dramatic critic. We
        called this the 'op-ed' for short.

</comment></comment></comment></comment></comment><comment><USER10> It seems like the author is just looking for something to be angry about. He ascribed his own meaning to a disclaimer in an article and then gets angry that it doesn't meet his expectation. Worse than that is the fact that it really shouldn't matter -- Jon Leibowitz could be head ball-fondler at Comcast for all it matters to his argument. This entire piece is spreading massive amounts of FUD because a guy wrote a thing and wasn't explicit _enough_ for his taste.

My favorite bit:

> To go a step further, Leibowitz's view is also wrong. Net neutrality > supporters fear that kicking enforcement over to the FTC means that > broadband providers would only get caught discriminating against websites > after the fact. And the FTC is focusing on stopping "deception," which > critics have said could mean that if a company discloses to the customer it > will block or throttle certain content, the agency won't step in.

Author apparently doesn't understand that the following paragraph is _literally_ the intended outcome of the plan. It's right there in explicit detail on pg 133 of the plan.

> We eliminate the conduct rules adopted in the Title II Order—including the > general conduct rule and the prohibitions on paid prioritization, blocking, > and throttling. We do so for three reasons...

</comment><comment><USER11> I just don't see the issue here. They disclose that his law firm represents broadband providers. That, the fact that it's an Op-Ed, and the content of the article ought to be enough for readers to understand that it's an opinion piece and likely to be biased.

<comment><USER12> The same way people should be able to discern fake news from real? Sadly, most people just aren't that discerning.

</comment></comment><comment><USER13> Is it just my techbubble, but how can such a law come through, if the general public opposes it so much? I mean how corrupt or ignorant have you to be to not notice this.

<comment><USER14> >how can such a law come through, if the general public opposes it so much?

It's not a law, it's a decision made by a federal regulatory agency. Only Congress can enact laws. The FCC commissioners are appointed by the president, so they're more like a branch of the executive branch than anything else. Congress can overrule them, but they're unlikely to do so under the current makeup, because:

>how corrupt or ignorant have you to be

The Republican Party is plumbing new depths of corruption and ignorance by the hour. Nothing would surprise me at this point.

<comment><USER15> Except it was a Republican who tried to move a NN type law through, and it was the Democrats who only wanted to move forward with the common carrier designation.

[https://morningconsult.com/2017/01/23/thune-net- neutrality-r...](https://morningconsult.com/2017/01/23/thune-net-neutrality- repeal-threat-bring-democrats-compromise/)

</comment></comment></comment><comment><USER16> I wish all our energy being spent on NN would go towards breaking ISP monopolies, it would achieve the same goals of NN including better services, cheaper prices.

<comment><USER17> What would you do to break the ISP monopolies?

<comment><USER18> I'd decouple the content creation from the network delivery. How soon before cable companies start zero-rating their own content? Also, local regulations granting monopolies have to start being rolled back, or municipalities buy the infrastructure from the ISPs and let them compete to use it.

</comment></comment></comment><comment><USER19> While there is a case to be made about news op-eds and their overall influence this article is more noise than content. The disclaimer says he represents _broadband providers_. There is no coming back even if it says _technology companies_.

</comment><comment><USER20> Paraphrasing the most relevant line in any comment on this article.

> Agree with it or not, it isn't, in fact it is expicitly not, objective > journalism.

credits: [https://news.ycombinator.com/item?id=15931916](https://news.ycombinator.com/item?id=15931916)

</comment><comment><USER21> And if you expect the WSJ to be anything other than pro-corporate, I've got a bridge to sell you.

<comment><USER22> I didn't expect anything different from the WSJ, but it's worth pointing out that pro-net neutrality is also "corporate" in a way. Small to medium size Internet commerce / content businesses have largely been the driving force behind public awareness of net neutrality, in my opinion.

(I've noticed this time around that the largest Internet companies have largely kept quiet about the issue this time around. The fact that there has been such a big public response to this to me shows how important keeping an Internet around that is more than just Google/Facebook/Amazon is.)

</comment></comment><comment><USER23> Who exactly is leading the pack here?

</comment><comment><USER7> Well heck, the FCC decision^d^d^d^d^d^d^d^d stand-up comedy was written by an Verizon attorney so why not some comedy in the WSJ?

Edited for support: [https://gizmodo.com/fcc-chairman-is-laughing-at- americans-wh...](https://gizmodo.com/fcc-chairman-is-laughing-at-americans- who-dont-want-to-1795193063) [https://youtu.be/DzHleu03fxY](https://youtu.be/DzHleu03fxY)

</comment><comment><USER24> WSJ did a really good job with this too. I opened the News app on my iPad after work today and found this story at the top of my feed. Their stories are usually paywalled, so I was surprised they featured anywhere near the top, and I tapped, curious.

The argument _did_ seem pretty fair and balanced. It presented both sides (or seemed to). On reflection (and I wouldn't have reflected if not for The Intercept's story) the article basically echoed Ajit Pai's argument saying anyone who gets up in arms about regulating ISPs is overreacting.

And it _almost_ made me believe I was naive for thinking the repeal was a grave moment in Internet history.

I don't know how they got the story so highly ranked on Apple News, but the pessimist in me wants to say money changed hands.

<comment><USER25> When I went to the story I had to sign in... how'd you get around that?

<comment><USER26> Apple News seems to give me full access without a subscription. I don't know if this is a temporary, promotional thing.</comment></comment></comment>


SNOBOL4 - <AUTHOR> http://www.snobol4.org/ <comment><USER2> I loved Shobol4! When I learned it as part of a survey-of-languages class in college (on an IBM mainframe), it was well before I had exposure to the UNIX/C/awk/regexp world, so its pattern-matching powers were a revelation.</comment>


The Far Side: Uncommon, unreal, and (soon-to-be) unfrozen - <AUTHOR> https://www.thefarside.com/ <comment><USER2> 1999 letter from Larson:

[https://web.archive.org/web/19991021233828/http://www.portma...](https://web.archive.org/web/19991021233828/http://www.portmann.com/farside/home.html)

<comment><USER3> 1999 seems pretty late into the evolution of the web for a creator to be so concerned with scattered instances of their work being shared online. 1995-96 I'd believe--the web was mostly still new, norms hadn't adjusted to its presence. But by 1999, the web was well underway, and it would've been weird for random scans of comic strips _not_ to be found freely in all corners of the internet. Did he really email hundreds of site owners?

(Unless the places he was sending his form letter to were hosting most of his back catalog, which would amount to full-scale piracy.)

<comment><USER4> The site hosting that letter is called "Gary Larson comic of the week".

<comment><USER3> Totally missed that, facepalm</comment></comment></comment></comment>


Startups are using insect larvae to produce protein-rich animal feed - <AUTHOR> https://www.nytimes.com/2019/09/21/climate/insects-animal-feed-climate-change.html <comment><USER2> Meanwhile, in China...

"Cockroach farms multiplying in China" (2013)

[https://www.latimes.com/world/la-fg-c1-china- cockroach-20131...](https://www.latimes.com/world/la-fg-c1-china- cockroach-20131015-dto-htmlstory.html)

> Wang Fuming ... is the largest cockroach producer in China (and thus > probably in the world), with six farms populated by an estimated 10 million > cockroaches. He sells them to producers of Asian medicine and to cosmetic > companies that value the insects as a cheap source of protein as well as for > the cellulose-like substance on their wings.

> Since Wang got into the business in 2010, the price of dried cockroaches has > increased tenfold, from about $2 a pound to as much as $20, as manufacturers > of traditional medicine stockpile pulverized cockroach powder.

> "I thought about raising pigs, but with traditional farming, the profit > margins are very low," Wang said. "With cockroaches, you can invest 20 yuan > and get back 150 yuan," or $3.25 for a return of $11.

> China has about 100 cockroach farms, and new ones are opening almost as fast > as the prolific critters breed. But even among Chinese, the industry was > little known until August, when a million cockroaches got out of a farm in > neighboring Jiangsu province.

<comment><USER3> That is surprising given the appetite for pork in China and their high prices.

<comment><USER4> And, given that cockroaches are expected to survive nuclear holocaust, you won't have an Asian Roach Flu epidemic wipe out your business.

</comment></comment></comment><comment><USER5> > You Might Not Want to Eat Bugs. But Would You Eat Meat That Ate Bugs?

Ummm. Free-range chickens _love_ insects. Trout also eat lots of insects. And pigs. Well, I'm not going into what pigs will eat.

<comment><USER6> AFAICT, chickens also eat any rodents stupid enough to go near them. If chickens were our size they'd be terrifying.

<comment><USER5> If they were our size, they'd be velociraptors.

<comment><USER7> I think you mean Utahraptor [1]. Velociraptors are about chicken sized [2]

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

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

<comment><USER5> Fair enough.

Present day, I'd say mainly watch out for eagles. At least, if you're a child. Ostriches too, but they won't hunt you.

</comment></comment></comment></comment></comment><comment><USER8> I just posted a podcast episode, 222: Why Eat Insects [http://joshuaspodek.com/guests/rants-raves-and-monologues- vo...](http://joshuaspodek.com/guests/rants-raves-and-monologues-volume-7), on why we're seeing all these clever new ways to create food: bugs, vertical farming, fake meat, in-vitro meat, etc.

Why didn't we think of them before?

Not because now we're more clever. _Because we had better options._ We're scraping the bottom of the barrel.

Few meat eaters choose crickets over steaks and hamburgers, but we've squandered what was once plenty. We've become more efficient, but we've lost abundance.

With a lower population we could keep abundance.

<comment><USER9> There's a lot of money chasing meat-alternative startups. And that means a lot of PR and PR dollars.

It's hard for me to imagine we are scraping the bottom of the barrel when pork chops are 99 cents a pound in the grocery store.

<comment><USER10> Yeah, probably not. But then there is a lot of government intervention in American farming.

</comment></comment></comment><comment><USER11> The first scene in Blade Runner 2049 takes place in a 'protein farm'. The farmer grows parthogenic worm-like creatures in pits filled with some sort of nutrient goo.

Parthogenic means they can reproduce asexually, and they're all clones of each other. Indeed, the few animals that reproduce like this can do so extremely fast.

<comment><USER12> Exactly what I was thinking of. I'm sure it's only a matter of time before we go from insects->livestock->humans to insects->humans as shown in Blade Runner 2049.

<comment><USER11> I believe in the movie it is implied that the protein is used on replicants of humans, or of animals which are then consumed by humans. Though it's never really that clear, I suppose.

<comment><USER13> The world in the movie was quite devoid of animal farming / husbandry.

As an aside Snowpiercer had a related concept - grinding cockroaches to make protein bars...

<comment><USER11> Not animal farming. Replicants of animals.

Remember the snake and the owl in the original movie?

</comment></comment></comment></comment></comment><comment><USER14> HN Title: > Startups are using insect larvae to produce protein-rich animal feed

Article title: > You Might Not Want to Eat Bugs. But Would You Eat Meat That Ate Bugs?

Sentence from article: > AgriProtein is among a _small number of start-ups_ that are using insect larvae

</comment><comment><USER4> So, what would an intrepid startup rancher feed a herd of roaches?

</comment><comment><USER15> Someone attempt to make a case for me for how raising insects for protein can ever compete against farming duckweed.

Duckweed has no negative associations with eating insects, it doubles in volume every 2 or 3 days,it produces high levels of proteins with several vitamins including D, it can be grown from sewage if needed, it cleans up polluting waterways, the list goes on and on.

No need for cages, artificial lights, heaters, smell, special insect feed, etc.

<comment><USER16> Thanks for the comment!

[https://en.wikipedia.org/wiki/Lemnoideae](https://en.wikipedia.org/wiki/Lemnoideae) [Duckweed]

</comment></comment><comment><USER17> I'm guiding myself in life after this saying: There's actually no such thing as waste.

I totally agree that that kind of industry could help feed a growing human population in a way that's less damaging to the environment.

We are making progress!

<comment><USER18> Why not just feed cows on grass, which is what they traditionally eat? In the UK cows usually graze outdoors in fields during the summer, and in the winter they usually stay in barns where they are fed on hay and silage (usually from fermented grass).

<comment><USER3> Logistics and relatedly prices I believe is why. The tradition there was because grass was cheaper to grow than hay to feed them. Now it is the opposite and has probably been so for a while.

Grass takes more time to fatten them for slaughter and it being cheaper to bring the feed to them than to cattle drive them around to even cheap feeds.

Maize (the winner of the local grain corn title) is a type of grass technically but one whose mutated seed size and height are way up there and given that it is human edible (even the field corn variants which are terrible tasting) the trophic layer issues become egregiously obvious.</comment></comment></comment>