ASCII and Unicode quotation marks - <AUTHOR> https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html <comment><USER2> I hate the "" -> "" thing with a passion. I don't know how much productivity that the world has lost with that "" shit.

It doesn't look that much better, and it always fucks with me at random times. That shit is on the list of annoying problems that shouldn't exist in the first place, along with the \nl\cr thing, and the txt saved as rtf thing, and the UTF-8 encoding-character-at-the-beginning-of-the-file or whatever it is called.

Someone complains your program gives them an error when they open a csv file you sent them. You tested your program, it works. You go on the phone with them for 30 minutes, try to figure out what the fuck was going on. There it is, it was opened in a program that meddles with that "" and replaces it with the "" shit.

Also, there has to be at least one time you're fucked by the "" -> "" snobbiness when you go to a random Wordpress site and paste the command they tell you to do to the command line and realize it doesn't work. You pull your hair for a couple of minutes, and there is that sneaky " thing. Wordpress does that for anything it doesn't think as code (inb4 "good programmers don't paste commands from wordpress to GNU+bash").

One of the first things that I do when I set up a new Mac computer is to turn that damn "" -> "" """"feature"""" off.

<comment><USER3> > at-the-beginning-of-the-file

That thing's the BOM.

<comment><USER4> Which you don't really need with UTF-8, it only has a purpose for UTF-16+.

<comment><USER5> It's useful to tell a text editor "This is UTF-8, not Windows-1252 or ISO-8859-1 or whatever you might be used to".

<comment><USER6> No, just do 8-bit clean, don't SCREW with the encoding if you weren't asked to.

<comment><USER7> An editor can't "just do 8-bit clean", it has to display the characters. The same bytes will sometimes be displayed differently in utf-8 and (e.g.) ISO-8859-1.

I'm not sure if a BOM is a good way to handle it, but saying 'just do 8-bit clean' doesn't work when you're displaying or printing the characters for humans to understand.

</comment></comment></comment></comment></comment></comment><comment><USER8> The fact that ASCII does not have balanced quotes is one of the great catastrophes of computing. It makes everything more complicated than it needs to be, from embedding code in strings to parsing CSV files, to regexps. For example, if I want to embed a quoted string in another quoted string, I have to escape the inner quotes like so:

"This is string containing an embedded \"quoted\" string"

Then I have to think about whether or not the system I'm going to send that string to is going to "helpfully" remove the backslashes, in which case I need to write:

"This is a string containing an embedded \\\"quoted\\\" string"

God help you if you want to go two levels deep.

All this horrible complexity could have been avoided if we could just write:

«This is a string containing an «embedded» quoted string»

Alas.

<comment><USER9> The complexity might be minimized, but not avoided. You would still need an escape mechanism for something like «She said «The \» key on the server doesn't work.»»

ASCII did add <>, [], and {}, any of which could have been used for quoted strings, had the programming language designers chosen that option.

[https://en.wikipedia.org/wiki/String_literal#Paired_delimite...](https://en.wikipedia.org/wiki/String_literal#Paired_delimiters) points out that PostScript and Tcl have a string literal which allows matched quotes.

      PostScript: (The quick (brown fox))
      Tcl: {The quick {brown fox}}

<comment><USER10> Ruby lets you use arbitrary tokens for string literals with %s{} (where the braces can be a bunch of things). I wish more languages would adopt this tbh.

<comment><USER11> C++11 has this feature too [1], e.g.:

        const char * str = R"*^*(This is string containing an embedded "quoted" string)*^*";

[1] [http://en.cppreference.com/w/cpp/language/string_literal](http://en.cppreference.com/w/cpp/language/string_literal)

</comment></comment></comment></comment><comment><USER12> I'm pretty sure text like:

      ``quoted''

Is how you're supposed to write short quotes in the TeX/LaTeX typesetting system.

[edit: My point being that the author seems to think this type of quoting originated with X11... which is actually newer than TeX (X11 was first released in 1984), and that the prevalence of this type of quoting likely originated with TeX when it was released in 1978... which isn't mentioned at all in the article. In fact, since TeX/LaTeX is what all the CS, Physics, and Math types were using for journal articles, it is likely the X11 font bitmap glyphs were intentionally shaped like curly quotes to make editing your TeX source files prettier.

At least, that's how I remember it...]

<comment><USER13> Another giveaway of a TeX-savvy writer out of water is when you see --- for em-dash, _i.e._ , '—'.

<comment><USER13> Does HN markdown understand — or ‘?

 _EDIT:_ Nope.

<comment><USER14> It doesn't need to. You can put the mdash directly in comments: —

As opposed to regular dash: -

<comment><USER15> Well, since my keyboard doesn't have an mdash key, if there's no support for something like — or --- then I can't use mdashes.

<comment> mark-r If I need a special character, I find a web page or document that has it and use copy/paste.

<comment><USER4> I have an A4 pinned next to me with all the windows Alt codes. Old-school methods are fastest and I subconsciously learn them by heart over the years.

<comment> mark-r Nice idea. I don't need them often enough to bother. Do you have a source for the chart?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER16> MS PGothic, a very common font in Japan, still uses this type of quote. "Quoting like this'' (double quote, then two single quotes) looks the most natural in this font. "Using two double quotes" looks quite odd (see screenshot) [1]

If you've ever seen an English-language page on a Japanese website that used weird quotes, this is probably why.

[1] [https://i.imgur.com/zcuFZa1.png](https://i.imgur.com/zcuFZa1.png)

<comment><USER17> Ah, the old dead giveaway "this game was translated from japanese and we CBA to handle localisation properly" fonts.

</comment></comment><comment><USER18> The usage of of an accent as syntax in markup and programming languages annoys me to no end. And it will still be used, to this day, the latest example are template string in Javascript.

• It is semantically idiotic because it's an accent, not a character.

• It is visually annoying because you almost can't see the thing.

• It is bad for usability, because on non-US keyboards the accents are implemented as dead keys. Yes, accent + space gives you the character but that's really unintuitive for people who grew up expecting accents only over letters.

<comment><USER19> Same, I've never cared for it. For these reasons I've decided to take a stand and avoid using the grave accent for anything in a programming language I'm working on. Same goes for the dollar sign, because it's somewhat Americentric, and as a currency character it doesn't have any great semantic or mnemonic value except for, well, currency units. I guess you could argue for $trings (BASIC) or $calars (Perl) if you have $igils, but I don't.

Sacrificing these bits of ASCII is fine by me, because the language is small enough, and I also allow Unicode. For example, curved quotes are allowed and can be nested or contain ASCII quotes without escaping:

        // Character literals
        '''
        =
        '\''

        // Text literals
        "Some "text" with "curved quotes"."
        =
        "Some \"text\" with "curved quotes"."

For the sake of usability, of course, everything in the core language & standard library has an ASCII spelling, like in Perl6. I'd like for other languages to adopt this view as well. If new languages allow proper Unicode notation in some sensible places, then programming editors' input methods will catch up, e.g., automatically replacing "->" with "→" or "\theta" with "θ" (like Emacs' TeX input mode).

Also, does anyone know of a reference for keyboard layouts from around the world that includes estimates of the number of people using them? I've tried to keep things relatively easy to type on all the major layouts I know of, but I don't want to alienate anyone if I can help it.

<comment><USER20> > Same goes for the dollar sign, because it's somewhat Americentric, and as a > currency character it doesn't have any great semantic or mnemonic value > except for, well, currency units.

By that metric, wouldn't & be too Anglo-centric, and # be too Euro-centric? There are layouts out there on which neither is readily available.

<comment><USER19> I suppose so. It's just one of the many small judgement calls you make when designing a language, and definitely falls into the category of "design" more than engineering or science. At some point I decided that grave and dollar were out, while ampersand and octothorpe are in. And you can still define a dollar-sign operator if you want, it's just not in the core language or standard library.

English is the lingua franca of programming, so it's hard to avoid some Anglicisms (like ampersand meaning "and", dot instead of comma for decimals, and English-language keywords) without going against strong precedents set by other languages. If I really wanted to be pedantic, I might use /\ and \/ for logical "and" and "or"—those spellings are the major reason that the backslash even exists in ASCII.

</comment></comment></comment></comment><comment><USER21> It's very odd for me to see the grave accent (`) as quoting mark in bash and other programming languages. I understand that the accent alone lose its function for the human language. But still uncomfortable to se an accent as delimiter to a string.

<comment><USER22> I'm not even sure why ASCII has a grave accent. There are no combining marks so you could never write it over another letter.

Edit: I forgot HTAB was actually part of ASCII. Oh well!

<comment><USER23> On a teletype, ALL characters are combining marks because you can backspace (another ASCII character derived directly from teletype codes) and type another character overtop it.

<comment><USER24> Are you old enough to remember when you printed your code on a teletype machine that blank spaces were represented by a "b" with a slash through it? I hated that.

Even worse, I remember one shop where the teletypes didn't have question marks, so people used capital P's instead.

</comment></comment></comment></comment><comment><USER25> to add to the confusion:

' PRIME (U+2032)

" DOUBLE PRIME aka inch mark (U+2033)

have their own codepoints

[http://practicaltypography.com/foot-and-inch- marks.html](http://practicaltypography.com/foot-and-inch-marks.html)

which describes implications for typesetting coordinates and other things:

118° 19′ 43.5″

118° 19' 43.5" wrong (curly quotes, although it renders identical in some fonts)

118° 19' 43.5" right

<comment> mark-r Those should be added to the document, with a note that they are NOT quotes!

<comment><USER25> I doubt this will ever be updated, since it's reference for a very specific, 20 year old, code interpretation related proposal und not meant for type setting.

But for anything related to contemporary typesetting on the web I recommend _Practical Typography_ and especially the _Type Composition_ chapter:

[http://practicaltypography.com/type- composition.html#links](http://practicaltypography.com/type- composition.html#links)

Including notes on quotes and apostrophes:

[http://practicaltypography.com/straight-and-curly- quotes.htm...](http://practicaltypography.com/straight-and-curly-quotes.html)

[http://practicaltypography.com/apostrophes.html](http://practicaltypography.com/apostrophes.html)

<comment><USER26> Hmm. I was going to link the classic [https://alistapart.com/article/emen](https://alistapart.com/article/emen) (and I guess I just did), but I noticed a disclaimer at the top pointing out that it "is now obsolete." And how! It proclaims that not enough text editors support UTF-8 yet, which thankfully hasn't been true in ages

</comment></comment></comment></comment><comment><USER27> It just occurred to me how much easier certain text-operations (like syntax highlighting, regular expressions and other parsers) if we consistently used the right unicode symbols for quotes and apostrophes

<comment><USER28> The only languages I know off the top of my head that use balanced delimiters for strings are M4 and Perl 6.

Hey, imagine being able to nest strings without escaping! What a concept!

<comment><USER29> Perl does that as well, and you can even choose the delimiters you wanna use:

> _For the constructs except here-docs, single characters are used as starting > and ending delimiters. If the starting delimiter is an opening punctuation > (that is (, [, {, or < ), the ending delimiter is the corresponding closing > punctuation (that is ), ], }, or >). If the starting delimiter is an > unpaired character like / or a closing punctuation, the ending delimiter is > the same as the starting delimiter. Therefore a / terminates a qq// > construct, while a ] terminates both qq[] and qq]] constructs._

</comment></comment></comment><comment><USER30> FYI For a long time GNU coding standards prescribed using the grave accent, but this changed some years ago now

[https://www.gnu.org/prep/standards/html_node/Quote- Character...](https://www.gnu.org/prep/standards/html_node/Quote- Characters.html#Quote-Characters)

<comment><USER31> From the link:

> Although GNU programs traditionally used 0x60 ('`') for opening and 0x27 > (''') for closing quotes, nowadays quotes '`like this'' are typically > rendered asymmetrically, so quoting '"like this"' or ''like this'' typically > looks better.

Is this link saying I can quit using `QUOTES' in my Emacs-documentation? That style always struck me as odd :)

<comment><USER32> Curved single quotes ('...') are recommended now:

[https://www.gnu.org/software/emacs/manual/html_node/elisp/Do...](https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation- Tips.html)

</comment></comment></comment><comment><USER33> CSB: Years ago I was working on a team that developed a scripting language and we had this recurring problem where someone would write up a code sample in a Word document and it would break if you cut and pasted it because all of the single and double quotes would be Unicode. My boss was this tough guy who tried to snap the whole team to a standard of strictly disabling that behavior in all of our Office applications, but I piped up and said maybe we should just make the language treat all of those characters like apostrophes and quotes.... I think around version 5 they finally made an API for doing proper anti-injection escaping because you pretty much needed a PhD to get it right due to all of the variations introduced by the extended characters.

<comment><USER34> Or ... use a text editor?

<comment><USER33> You know a lot of PMs who write specs in notepad?

</comment></comment></comment><comment><USER4> What bothers me about Unicode isn't that apostrophe (U+0027) is overloaded by having two semantic meanings ("apostrophe" or "single straight quote"), but that they exacerbate the confusion by recommending to overload "right single quote" (U+2019) to _also_ mean apostrophe.

We now have two characters for apostrophe and extra ambiguity for processing correct right single quotes. Great job not breaking historical documents Unicode.

<comment><USER35> And now, imagine that your own name has an apostrophe in it. Like my family name. I can tell you, I crashed many databases and in 90% of the cases where people need to find again my name in a database, it is ending up with requesting my address because each time a different character is put by the clerk doing the data entry and they cannot match my name. Even state level authorities are bad, really bad, at it.

</comment></comment><comment><USER36> > _Please do not use the ASCII grave accent (0x60) as a left quotation mark > together with the ASCII apostrophe (0x27) as the corresponding right > quotation mark (as in `quote ')._

Tell that to GCC:

      /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function `_start':
      (.text+0x18): undefined reference to `main'

Looks good to me, by the way.

> _Where ``quoting like this '' comes from_

I did it for a while out of a habit acquired from working with TeX. In TeX, it is the source code syntax for encoding quotes. Of course, it is lexically analyzed and converted to proper typesetting.

> _If you can use only ASCII's typewriter characters, then use the apostrophe > character (0x27) as both the left and right quotation mark (as in 'quote')._

It looks like shit in any font in which the apostrophe is a little nine, which is historically correct. What you want is a little "six" on one side and a "nine" on the other, or at least some approximation thereof. Even if the apostrophe is crappily rendered as a little vertical notch, it still pairs with a backwards-slanted `.

(The representation of apostrophe as a little vertical notch, I suspect, caters to literals in programming languages.)

> _If you can use Unicode characters ..._

then you should still stick to ASCII unless you have other good reasons to. ``Can'' is not the same thing as ``should'', let alone ``must''.

> _For example, 0x60 and 0x27 look under Windows NT 4.0 with the TrueType font > Lucida Console (size 14) like this:_

The idea that people should change their behavior because of which font is default on the Windows cmd.exe console is laughable.

<comment><USER37> > then you should still stick to ASCII unless you have other good reasons to.

Why? Using non-ASCII Unicode characters acts like a nice canary for detecting character encoding issues. Besides, why would I purposely limit my text to ASCII? It doesn't even suffice for English, let alone almost any other language I use — including my native language Dutch, German, and Japanese.

<comment><USER36> All sorts of reasons. Diagnostic printf message in some embedded firmware. Do you need to drag Unicode into it? Git log message. Ditto.

<comment><USER38> > Diagnostic printf message in some embedded firmware. Do you need to drag > Unicode into it?

Why not? The firmware itself would usually have no reason to care about the details of a diagnostic message's encoding, whether that be ASCII or UTF-8 - it can mostly just treat strings as bags of bytes. There might be some byte values that are special (nul terminator, % for printf, etc.), but UTF-8 is a superset of ASCII and represents extended characters using only bytes with the highest bit set, so there will never be 'false positives' of the special byte values. Other than that, the bytes can stay uninterpreted as they go over whatever serial port or diagnostic protocol the device is using, until they eventually show up on - most likely - some sort of terminal application on a modern computer, which probably supports UTF-8 already. So in most cases it should 'just work'.

Of course, there are situations where it won't just work, such as if the firmware needs to display the diagnostic message on a screen (by itself), but from what I've seen those are the minority.

edit: As for Git, what's wrong with people writing log messages in their language of choice? (Other than the social issue of it making it harder for English speakers to use the codebase.)

</comment></comment></comment></comment><comment><USER39> Things become really fun when you're trying to figure out why that command fails when you've copy/pasted it from another application window.

Often it's the quotes which have been silently (automatically) converted to a visually similar (but functionally incompatible) character variant.

</comment><comment><USER40> It seems that half of the people in this company use the wrong acute sign `as an apostrophe instead of ' or '. Unfortunately it's the half that creates presentations and talks to customers.

It looks terrible and to me it's a disgrace!

Example: it`s versus it's or it's. (first one is wrong).

<comment><USER41> I've seen a café which had its name written in large, lit letters on the façade and it included the following gem: Cafe`. Yes, the wrong accent, and not even combined. Easy access to DTP tools (or even a word processor) for the typographically uneducated masses ends up with quite painful results sometimes.

</comment></comment><comment><USER42> In another life, I analyzed enterprise data. Variation in quotation marks was a common problem. I mean, is it "D'arcy" or "D'arcy"? Sometimes, I think, people would mangle data in spreadsheets, with auto-correct on.

</comment><comment><USER26> While I can't expect many to follow suit, I myself often type educated quotes and nice apostrophes. The macOS keyboard combinations (nearly-intuitive combinations of Option-(Shift)-[ and -] for ""'') have long been committed to muscle memory. And since nearly all (web) file formats seem to be UTF-8, the days of manually typing “ and friends are long, long gone.

Benefits of typing and using typographer's quotes directly in your JS/JSON/HTML/source:

1\. No backslashes or other escape sequences needed!

2\. WYSIWYG

3\. Retina screens and gorgeous modern fonts mean that your sloppy quotes will look extra bad if you just use ASCII quotes

</comment><comment><USER43> I would fain use the curly quotes if only Darwin's groff(1) wouldn't barf on them. For the time being, man pages for one still need to quote like ``this''.

<comment><USER44> In troff you can escape " " ' ' as \\(lq, \\(rq, \\(oq, \\(cq respectively.

If you're writing manpages, though, you should be using the -mdoc macros ([https://manpages.bsd.lv/mdoc.html](https://manpages.bsd.lv/mdoc.html)), which have "Dq" and "Sq" macros that wrap the arguments in double and single quotes respectively.

</comment></comment><comment><USER45> I find it interesting that the article includes a German keyboard that doesn't include the proper ,,'' (or ,') quotation glyphs. However it does include grave and acute accents as well as French primary quotations (<< and >>) though not the secondary guillemots (quotation characters < and >) none of which are used in German text.

And of course I used ascii analogues to type these into HN :-(

<comment><USER46> >And of course I used ascii analogues to type these into HN :-(

But why, though? To the best of my knowledge, HN supports unicode quite well, including the following quotes: »«›‹""'' (available with the help of AltGr and sometimes shift from keys y, x, v, b when selecting the German keyboard layout on my computer).

<comment><USER45> I'm using a travel laptop on a plane and it came with a US keyboard

</comment></comment></comment><comment><USER47> > The Unix m4 macro processor is probably the only widely used tool that uses > the `quote' combination as part of its input syntax; however, even that > could be modified via changequote.

I remember staring for a long time at the file when I first saw an m4 macro. My brain was telling, surely this has go to be a typo, but then everything worked as expected. Then I learned that's a proper way of quoting there.

</comment><comment><USER48> It's a little bit off-topic since the article was primarily about quotation marks and coding, but it would have been good if it mentioned that an ʻokina (as found in "Hawaiʻi") is neither an apostrophe nor a left quotation mark.

[https://en.wikipedia.org/wiki/%CA%BBOkina](https://en.wikipedia.org/wiki/%CA%BBOkina)

</comment><comment><USER49> It's worse for other languages. Russian quotation marks are « and ». Thanks to early computers being predominantly from/designed in the US, they are now highjacked by American quotes.

Same probably goes for French and other languages with their own sets of quotation marks.

<comment><USER50> «Russian» quotation marks are actually the « French » ones with different spacing. There's another, less used set of quotes in Russian, so called "German" ones (used as inner quotes and in handwriting). English quotes are widely accepted though.

<comment><USER51> Modern Chinese usage includes all of 《》〈〉「」『』【】"" and probably others, roughly in that order. Modern typographic convention is perhaps 《 _title_ 》「 _quote_ 」 but that's surely opine and debatable. Hong Kong and Taiwan have their own typesetting conventions, distinct from mainland China, and in the latter case no doubt influenced by Japanese occupation and cultural inflow (manga, etc.). Historically for most of Chinese history written language had no punctuation, and sentence endings were merely inferred from context, which was historically clearer 也. See [https://en.wikipedia.org/wiki/Chinese_punctuation](https://en.wikipedia.org/wiki/Chinese_punctuation) and [https://en.wiktionary.org/wiki/%E4%B9%9F#Definitions](https://en.wiktionary.org/wiki/%E4%B9%9F#Definitions) (definition #4)

</comment></comment></comment><comment><USER4> So why isn't there a straight single quotation, but there is a straight double quotation? I get it probably arose from compatibility reasons, but nowadays Unicode should be able to offer something?

P.S. Major coincide I was googling this very question yesterday?

</comment><comment><USER52> For reference, the BIOS text-mode font included with some IBM PCs (I've observed this on NetVistas and ThinkPads myself, at least) renders ` as a nice-looking opening quote, and ' looks like a nice closing quote.

</comment><comment><USER53> Honestly I've been seeing `quote' in bash and other CLIs for my entire career and always thought they were just funny or strange, but carried no meaning.

</comment><comment><USER54> MRI ruby still does this in some error messages. I hate it. Always messing up my copy-and-paste into `` markdown too.

</comment><comment><USER55> Could do with a (2007) suffix.</comment>


Ask HN: New Hacker News T-shirts? - <AUTHOR> Hello, are there any plans to sell Hacker News t-shirts again?  Mine is starting to show its age.  (And, as a quick aside, I still haven't met anyone who knew it's a Hacker News t-shirt.)  Thanks! <comment><USER2>
      Mine is starting to show its age.

That's a _hardware_ problem.

</comment><comment><USER3> There is such a thing as a Hacker News t-shirt?!

Shut up and take my money!

Seriously tho, I'm game. How do I get one?

<comment><AUTHOR> They were last available on 2013 March 19: [https://teespring.com/hntees#pid=6&cid=619&sid=front](https://teespring.com/hntees#pid=6&cid=619&sid=front)

...unless my Google skills are also showing their age and I haven't found a valid link for it.</comment></comment>


Jool – stateful NAT64 for Linux - <AUTHOR> http://www.jool.mx/

<comment><USER2> How does it compare to [http://www.litech.org/tayga/](http://www.litech.org/tayga/)

<comment><USER2> To answer myself: [http://www.jool.mx/intro.html](http://www.jool.mx/intro.html) points out tayga is stateless. When you don't have an IPv4 address for every node you want to publish to the IPv4 side, you might be forced to use a "stateful" NAT64 instead: Jool</comment></comment>


Circumference datacentre-in-a-box - <AUTHOR> https://www.crowdsupply.com/ground-electronics/circumference <comment><USER2> Too little memory per node ;-(</comment>


Show HN: Gistdeck - Presentation Software for Gists - <AUTHOR> https://gistdeck.herokuapp.com/

<comment><USER2> Very nice, but the only way to make this effective is for everyone to have this bookmarklet installed. I supposed you could put a link at the top of your gist, though.

Nice job!

</comment><comment><USER3> Looks great, is it bad i'm already wishing it could export to pdf for speakerdeck? Does that defeat the simplicity?

<comment><USER4> This is at odds with the simplicity, but there's no question that an artifact of the enhanced version is important for publishing a slide deck.

Quick tests with the Chrome "Print to PDF" and a "convert to PDF" extension failed miserably...

</comment></comment><comment><USER5> Doesn't work for me - get the reformatted page but keys don't work. Linux FF 10.0.5

<comment><USER4> Thanks for the feedback, I haven't tested in Firefox yet.

<https://github.com/nzoschke/gistdeck/issues/5></comment></comment>


Reasons you should delete-and-recreate your Facebook account - <AUTHOR> https://medium.com/@abhidilliwal/3-reasons-you-should-delete-and-recreate-your-facebook-account-f355e4cf9265 <comment><USER2> Why would you WANT fb to have correct data, as if their data mining is a good thing?</comment>


San Franciso Is Over: Europe Home to Next Big Hit - <AUTHOR> https://www.businessinsider.com/vs-says-san-francisco-is-over-europe-home-to-next-big-hit-2019-5 <comment><USER2> Please stop posting businessinsider links on hackernews. We need to pay for it. This is not a community to make some money.

</comment><comment><USER3> Yea no... This PR article is flat out misleading (and I´m being generous here).

1) The article ignores the power of networks which is the main reason SF is the titan that it is. Niall Ferguson and Peter Thiel have written extensively about the topic and SF in particular if you´d like to read a thing or two about it.

2) I recently had a successful exit in the US and have been interviewing dozens of startups a months to invest in here in Stockholm (where I live). And it´s safe to say that the quality of available early-stage startups is sub-par at best in comparison to what SV or the US in general has to offer. Granted this is my subjective opinion but I dare say it isn´t far off the truth considering that I have started and worked on companies in both places.

3) "The environment has led to a re-evaluation of the city's prominence for buzzy tech start-ups. House prices in San Francisco are four times the national average. And the average house price is now $1.3 million"

The dishonesty of not mentioning that Stockholm´s housing cost is rising much faster (relative to income) than SF´s housing market is rather astounding. [https://www.hemnet.se/salda/bostader?location_ids%5B%5D=1803...](https://www.hemnet.se/salda/bostader?location_ids%5B%5D=18031)

4) "Europe is where the value-add is possible between funding rounds, you can get sometimes three times the value for European companies over US for the same money," says Söjgren."

Saying "sometimes" (which represent the edge cases) to provide a sense of general well-being is just toxic. Evaluations and capital are about as dry here as the freaking desert. That creates an environment where competition between VC firms is none-existent which in turn makes it incredibly difficult for early stage startups to even make it off the ground due to down pressure on round sizing and equity demands. This is the case especially when you keep in mind the level of employment tax expenditures that exist here compared to the US. Besides, how in hell do you get 3x the value for the same money? By that logic we should all start companies in Estonia or Lativa or India or anyone of 200 places on earth where we get 20x the value for the money. So Sweden in this context is the worst option on the table because there are no networks, the round sizes are small, the costs are huge and the local talent pool as abysmal.

5) "Investors are now joining the dots with smart money flowing into an increasingly competitive European scene."

If that was the case the Swedish krona would have higher demand which would push the price of SEK higher against USD or EUR. In reality however, money has been escaping Sweden and SEK in general. See the 5 year charts:

[https://www.tradingview.com/symbols/SEKEUR/?exchange=FX_IDC](https://www.tradingview.com/symbols/SEKEUR/?exchange=FX_IDC)

[https://www.tradingview.com/symbols/SEKUSD/?exchange=FX_IDC](https://www.tradingview.com/symbols/SEKUSD/?exchange=FX_IDC)

Sigh...</comment>


How organizational practices can compensate for individual shortcomings (1998) [pdf] - <AUTHOR> http://faculty-gsb.stanford.edu/heath/documents/rob-cognitive%20repairs.pdf

<comment><USER2> In searching for more about this I found this book that references the paper:

[http://books.google.co.uk/books?id=v_40AwAAQBAJ&pg=PT39&lpg=...](http://books.google.co.uk/books?id=v_40AwAAQBAJ&pg=PT39&lpg=PT39&dq=COGNITIVE+REPAIRS:+HOW+ORGANIZATIONAL+PRACTICES+CAN+COMPENSATE+FOR+INDIVIDUAL+SHORTCOMINGS&source=bl&ots=GLnqAQuD_R&sig=XXW3Q9BeOH69IHTDWQn9PZLO0Hg&hl=en&sa=X&ei=ifv9U6qCHYye7AbT7YG4Bg&redir_esc=y#v=onepage&q=COGNITIVE%20REPAIRS%3A%20HOW%20ORGANIZATIONAL%20PRACTICES%20CAN%20COMPENSATE%20FOR%20INDIVIDUAL%20SHORTCOMINGS&f=false)</comment>


HN Meta: Highly rated off-topic comments dominating discussion - <AUTHOR> One thing that I've been noticing lately has been highly rated, off topic comments with lots of replies floating to the top of a discussion.   Because they have lots of replies, the on topic discussion gets pushed way down the screen.   These are good comments and good discussion; but they're off topic and hide comments discussing the actual article at the bottom the screen.   Is there anything we can do about it?<p>examples:   https://news.ycombinator.com/item?id=11266796, https://news.ycombinator.com/item?id=11262239 <comment><USER2> In the first example, I think that the order has changed. I guess your complain is about the #3: [https://news.ycombinator.com/item?id=11266874](https://news.ycombinator.com/item?id=11266874)

As the minimaxir said, it's more tangent than off-topic. I think that this comment is too general and the discussion gets drafted to general opinions. I usually prefer comments that are more specific about the current submission.

</comment><comment><USER3> I'm not sure why you say the top comment in either of those threads are off- topic. Slight tangents maybe, but not off-topic.</comment>


A day in the life of Software Developers [Infographic] - <AUTHOR> http://imgur.com/FiL1C As promised, I am providing the detailed information of what programmers do every day. This was a result of a survey taken in reddit and HN with over 3000 software developers. HN: you made this, please be proud :) The kind people at Trend Collective ([1] http://www.trendcollective.com/) grabbed the information of the survey and designed an awesome infographic. I would like to thank them, namely Paul Moretti, for their professionalism, fast and good design work and ease of incorporating changes.<p>If you need any design work, really consider these guys.. I interfaced with designers previously and these guys are just great. <comment><USER2> An average 2h/day of actual coding ? I don't feel like I'm extremely productive, since I can't bear having to code in work hours, and I'm way more efficient at home. But 2h seems really low.

<comment><USER3> Man! The best day is the one I dont have to code at all..</comment></comment>


Somebody just won 310 BTC ($2M): Bitcoin Challenge solved within 8 days - <AUTHOR> https://www.chepicap.com/en/news/4306/somebody-just-won-310-btc-bitcoin-challenge-solved-within-8-days.html <comment><USER2> Must be really cool to win something like that, but how hard would be to convert this back to normal funds again? Would any of the coin exchanges allow you to just withdraw $2M?</comment>


Elon Musk is creating a media credibility rating site to fight fake news - <AUTHOR> https://twitter.com/elonmusk/status/999367582271422464 <comment><USER2> Smart people are dumping on this as naïve and impossible [0], while the mastermind behind many disinformation campaigns loves the idea [1].

It only seems impossible because it's never been done, just like rockets self- landing on autonomous ocean drones seemed impossible five years ago.

When people hear "crowdsourcing" they think "free-for-all". But it doesn't have to be that way. With clear rules and strong moderation, it's possible to build a meritocracy of truth.

I would start by logging the predictions of pundits and publishing their win/loss ratios.

Next I'd index news stories published 3+ years ago where hindsight gives us greater certainty what actually happened. That would establish the Bayesian prior of credibility for each organization and author.

You'll always have trolls and propagandists with "evidence" that the world is flat but that's what shadow banning is for.

[0] [https://twitter.com/NateSilver538/status/999400424435314690](https://twitter.com/NateSilver538/status/999400424435314690)

[1] [https://twitter.com/JamesOKeefeIII/status/999370127421378561](https://twitter.com/JamesOKeefeIII/status/999370127421378561)

</comment><comment><AUTHOR> Vote if you think it's a good idea: [https://twitter.com/elonmusk/status/999374720368689153](https://twitter.com/elonmusk/status/999374720368689153)</comment>


Details of horrific first voyages in transatlantic slave trade revealed - <AUTHOR> https://www.independent.co.uk/news/world/americas/transatlantic-slave-trade-voyages-ships-log-details-africa-america-atlantic-ocean-deaths-disease-a8494546.html <comment><USER2> _" Almost completely ignored by the modern world, this month marks the 500th anniversary of one of history's most tragic and significant events – the birth of the Africa to America transatlantic slave trade."_

A (relatively) small step in the right direction: The slave trade and its origins is one of the primary focuses of the incredible new museum in Washington DC: the National Museum of African American History and Culture (NMAAHC), steps away from the Washington Monument. This museum is a national treasure. I highly, highly recommend it to anyone who might have an opportunity to visit. The subject matter, the incredibly detailed and thorough exhibits, the culturally infused architecture, the underground memorial, and many other factors all combine to create one of the most engrossing and memorable museum experiences in the US. It's a must-see if you're in DC.

</comment><comment><USER3> as a black person, it is hurtful and alarming to read these comments and see how people in our industry feel about the slavery of my people. the callous, cold minimizations lack humanity.

</comment><comment><USER4> In school, I used to wonder how people survived this voyage if they were shackled below the whole trip (3 weeks). Wouldn't the stores they were in, which were only a few feet high (couldn't stand up), fill up with feces?

Apparently they were let up on deck for 2 hours a day.

If anyone has any clarification to add to this / that wasn't in the article, please add.

<comment><USER5> I still wonder how anyone can do that to other human beings for three weeks. Even if you don't view them as the same status, they can clearly speak and think and come from societies with tools, clothing, art and shelter. Were the slave traders all sociopaths?

I also wouldn't want to do that to any animal, although apparently it's seen as acceptable with factory farming.

<comment><USER6> Contemporary Westerners constantly underestimate a human's ability to commit unthinkable atrocities under the right conditions. I don't know if it's our education's fault. Maybe we just don't bother to ever emphasize this point. Maybe it's too uncomfortable of a subject to deal with.

This last century has presented a rich buffet of historical options to choose from when looking for examples of ideologies that allowed otherwise perfectly normal, God-fearing, salt of the earth folk to turn into horror-machines of rape, mutilation and slaughter. Western Europe, Eastern Europe, Africa, Asia, you name it. Maybe even a relative or a next door neighbor in our very own US of A, sent to the wrong Vietnamese village at the wrong time. That seed of pure horror is in all of us, and it's ready to rear its ugly head when the conditions are right.

I don't think as a species we've quite figured out how to suppress it.

<comment><USER7> Pinker's "Better Angels of our Nature" is a masterwork on the subject. It's also a terrific read and will change your view of history and make you happy to be alive in the present!

[https://en.m.wikipedia.org/wiki/The_Better_Angels_of_Our_Nat...](https://en.m.wikipedia.org/wiki/The_Better_Angels_of_Our_Nature)

<comment><USER6> I've been meaning to read it, however the criticism from historians about it has made me somewhat uncomfortable about it: [https://en.wikipedia.org/wiki/The_Better_Angels_of_Our_Natur...](https://en.wikipedia.org/wiki/The_Better_Angels_of_Our_Nature#Criticism)

Is there anything conclusive about how cherry-picked the numbers in the book are?

</comment></comment></comment></comment></comment><comment><USER8> Auto-loading video. RIP mobile data...

</comment><comment><USER9> I made it through 1/4 of the article and couldn't take the reading experience. I'm on an iPhone and it was nonstop ads and odd breaks in content. Bummed!

<comment><USER10> Safari's Reader Mode is ideal for this scenario. You won't see the associated media (at least not on this particular page), but you can read the story in peace.

<comment><USER11> Why should you have to use a "reader mode" in the first place?

++ As in it's a "workaround" for an issue that should never have been allowed to exist in the first place - bloat, ads etc.

That aside, umatrix on firefox mobile has been the best improvement in mobile browsing.</comment></comment></comment>


Naborly: Taking advantage of Coronavirus to drum-up business - <AUTHOR> https://www.torontonews.online/2020/04/04/this-company-is-encouraging-landlords-to-report-tenants-who-didnt-pay-april-rent/ <comment><AUTHOR> Quite appaling. This looks like a Ycombinator company given the board composition.</comment>


Don't forget to close your HTML tags - <AUTHOR> http://www.sewingandembroiderywarehouse.com/embtrb.htm <comment><USER2> Noting the generator was Frontpage, thought I'd check it out in IE9, where it works fine - even if you use dev tools to change the document mode to standards.

</comment><comment><USER3> Interesting. The font tags appear to have been closed with </font color>. What's weirder is that there are no line breaks so it kind of seems as if an IDE did this.

<comment><USER4> The generator is listed as frontpage 5.0.

</comment></comment><comment><USER5> Absolutely hilarious: <http://imgur.com/UogN3lU>

<comment><USER6> I feel the browser is trying to tell me something about my afternoon: <http://imgur.com/UzgATO1>

</comment></comment><comment><USER7> So, what's going on here? Why does the font size keep increasing like that from not closing tags?

<comment><USER8> They are using EM's for font-size, which is a relative measurement.

This means that if you set your font-size to 1.5em, and you have an element inside (as a result of the unclosed tag) also set to 1.5, the one inside is set to 1.5 times that size (or 2.25 of the original 1em). That cascades on and on and on and...

</comment></comment><comment><USER9> Utterly hilarious.

</comment><comment><USER10> Something I always forget to do! thanks for the reminder.</comment>


Ask HN: Best resources for machine learning? - <AUTHOR>

I wasn't able to participate in the Stanford Machine Learning experimental class last fall because of time constraints, but I'm fascinated by ML and would like to experiment with it.<p>What are the ebooks, blogs, user groups, getting started articles, etc. out there that you like most? <comment><USER2> <http://mahout.apache.org>

<http://machinelearning.reddit.com>

<http://mloss.org>

<http://jmlr.csail.mit.edu/>

<http://shop.oreilly.com/product/9780596529321.do>

[http://www.amazon.com/Algorithms-Intelligent-Web- Haralambos-...](http://www.amazon.com/Algorithms-Intelligent-Web-Haralambos- Marmanis/dp/1933988665)

[http://www.amazon.com/Mahout-Action-Sean- Owen/dp/1935182684/...](http://www.amazon.com/Mahout-Action-Sean- Owen/dp/1935182684/ref=pd_sim_b_4)

[http://www.amazon.com/Collective-Intelligence-Action- Satnam-...](http://www.amazon.com/Collective-Intelligence-Action-Satnam- Alag/dp/1933988312/ref=pd_sim_b_5)

[http://www.amazon.com/Machine-Learning-Hackers-Drew- Conway/d...](http://www.amazon.com/Machine-Learning-Hackers-Drew- Conway/dp/1449303714/ref=pd_sim_b_9)

[http://www.amazon.com/Machine-Learning-Action-Peter- Harringt...](http://www.amazon.com/Machine-Learning-Action-Peter- Harrington/dp/1617290181/ref=pd_sim_b_2)

<http://www.metaoptimize.com/qa>

<http://stats.stackexchange.com>

<comment><AUTHOR> Thanks so much!

<comment><USER2> I almost forgot, there's a great thread on this topic on Quora as well:

[http://www.quora.com/Machine-Learning/What-are-some-good- res...](http://www.quora.com/Machine-Learning/What-are-some-good-resources- for-learning-about-machine-learning-Why)

LOTS of good stuff there. Have fun!

</comment></comment></comment><comment><USER3> The class is starting again in three weeks: <https://www.coursera.org/course/ml>.

I'm pretty much in the same boat as you. Looking forwards to it!</comment>


Show HN: My evening fun project, see your facebook friends most popular links - <AUTHOR> http://thelikewall.com

<comment><AUTHOR> Hi all, this is my submission :)

I wrote this to get a feel for Facebook's APIs and see what fun I can have with a bit of Javascript. I'm not sure if it's worth developing any further, but any thoughts, comments or questions would be really appreciated.</comment>


Scientists find a winning strategy for rock-paper-scissors - <AUTHOR> http://arstechnica.com/science/2014/05/win-at-rock-paper-scissors-by-knowing-thy-opponent/

<comment><USER2> > _This should work unless your opponent has read this article_

Not even that. This won't work if you're playing someone who's consciously trying to play mind games.

(Usually the actual mind-games played are meaningless, but they alter the kind of instinctive psychology that underlies this strategy.)

</comment><comment><USER3> You can always over think it...

"The battle of wits has begun. It ends when you decide and we both drink, and find out who is right...and who is dead."</comment>


The Security Value of Inefficiency - <AUTHOR> https://www.schneier.com/blog/archives/2020/07/the_security_va.html <comment><AUTHOR> This reminds me of the book "Slack" by Tom DeMarco (2001):

[https://wiki.c2.com/?SlackByTomDeMarco](https://wiki.c2.com/?SlackByTomDeMarco)

Adding a little bit of redundancy into a system is better for the overall performance of that system. However redundancy costs money so it is important to strike the right balance between slack and efficiency.</comment>


LinkedIn under fire for censoring Tiananmen Square posts - <AUTHOR> http://www.theguardian.com/technology/2014/jun/04/linkedin-tiananmen-posts-china-censorship

<comment><USER2> "Update: A LinkedIn spokesperson responded to our request for comment, saying that the company sent a mistaken notification advising a small number of users in Hong Kong that their Tiananmen Square-related content was blocked, but that LinkedIn did not actually block content outside of mainland China (meaning Hong Kong LinkedIn is uncensored)."

[http://qz.com/216691/linkedin-is-censoring-posts-about- tiana...](http://qz.com/216691/linkedin-is-censoring-posts-about-tiananmen- square-even-outside-mainland-china/)

That response doesn't seem to explain the deletion of British resident Helen Couchman's posts on the subject... but LinkedIn may have mistakenly considered her a resident of the mainland, since she formerly lived there (and may have set up her account on those servers).

(UPDATE: Not to give LinkedIn too much of an out. Even if it was a mere blunder rather than an embrace of global censorship, making errors about this incredibly politically sensitive topic still says something about competence and general preparedness for doing business with China.)</comment>


Apple: Updates to Coding Terminology - <AUTHOR> https://developer.apple.com/news/?id=1o9zxsxl <comment><USER2> Here are the actual (inclusive language) changes from the style guide:

       Asia Pacific (n., adj.) - Don't list Japan separately; Asia Pacific includes Japan.
       Black (adj.) - Capitalize when referring to ethnicity or cultural identity.
       blacklist/whitelist (n., v.) - Don't use. Instead, use an alternative that's appropriate to the context, ...
       logic board - Not motherboard, mother board, main board, or main circuit board. ...
       master/slave - Don't use to describe the relationship between two devices or processes. ...
       slave - Don't use to refer to a device or process. See also master/slave.
       whitelist - Don't use. See also blacklist/whitelist (n., v.).

<comment><USER3> So "main" is also problematic now? I thought that was the replacement for git's master branch?

<comment><USER4> If you're referring to the mandate to say "logic board," I believe that is just a stylistic choice, not a cancellation of "main" in the sense you're thinking of.

<comment><USER5> Hah, I see where you're coming from. If your SOC has CPU, GPU, PCIe routing, and networking all packaged up, then the "main" board isn't doing anything all that main anymore. Unexpected sign of the times.

</comment></comment></comment></comment><comment><USER4> The deprecation of master/slave is something that crossed my mind some 20 years ago when I was setting jumpers on a IDE optical drive. What shall we substitute slave with, though, given that master is now main? Apache httpd has long used "worker"...

How about black hat (noun or proper noun) and white hat? They're identically problematic as blacklist/whitelist -- see [https://en.wikipedia.org/wiki/Black-and- white_dualism](https://en.wikipedia.org/wiki/Black-and-white_dualism)

<comment><USER6> I've seen "worker", "main", "parent/child", and "primary/replica" used as a replacement depending on the context.

<comment><USER7> I've heard complains from some in various tech industries that parent/child is non-inclusive. I'm not saying I think it should be changed, but doesn't the logic of the people advocating these changes demand that all terms be as inclusive as possible?

<comment><USER4> For that matter, "worker" implies something along the lines of "working class" or "unskilled laborer" which isn't all that friendly of a metaphor either. Kind of tough to think of a way to express "doesn't think for onesself, just takes orders" without being mean.</comment></comment></comment></comment>


Karnickel: AST Macros for Python - <AUTHOR> http://bitbucket.org/birkenfeld/karnickel/src <comment><USER2> Couple of questions:

1\. Can the macros execute code while expanding?

2\. Is there any way to use gensyms?

3\. In Common Lisp, the add-macro would probably use quasiquote and unquote, like this: (defmacro add (x y) `(+ ,x ,y))

Is there any way to use quoting?

<comment><AUTHOR> > 1\. Can the macros execute code while expanding?

Probably, since this 'expansion' occurs during runtime.

> 2\. Is there any way to use gensyms?

Gensym-type functionality could probably be added.

> 3\. In Common Lisp, the add-macro would probably use quasiquote and unquote, > like this: (defmacro add (x y) `(+ ,x ,y)) > Is there any way to use > quoting?

Not likely, since Python itself treats code and data differently.

The main benefit is in creating new statements, expressions and blocks to allow for new abstractions. But this is not quite the same as Lisp macros.</comment></comment>


PHP Woes - <AUTHOR> http://uokeke.com/blog/?p=93

<comment><USER2> News flash: A programming language requires knowledge of it's standard library of functions, and can be used in less than clean/optimal ways.

PHP is where it is because it's easy to install, works fairly well, has a huge/comprehensive built in library, and is usable by many types of people. It also has solid documentation on it's website.

If you're really worried about this, use a framework, or templating engine. Smarty is a relatively lightweight solution for splitting logic from presentation, and also handles caching for you.

<comment><AUTHOR> Thanks, I'll consider using Smarty. How about running background processes? What's the accepted way to implement them?

<comment><USER3> I don't think you can. PHP doesn't really run in a server like Java and .NET do. Zend does have a Server product (<http://www.zend.com/en/products/server>), I never tried it but it might offer background processes. I normally just use cron to trigger a url.

<comment><USER4> Or you can use cron to run a script written in PHP.

</comment></comment></comment></comment><comment><USER5> Dear Lord. This article shows so much ignorance about programming in general. If I was hiring, I wouldn't touch you with a ten foot pole...

<comment><AUTHOR> Please clarify on what aspects of the article you deemed ignorant?

<comment><USER6> Like thinking Intelissense is a language feature for instance, or trying to shoehorn an inherently web language into general purpose and complaining (it's doable, everybody does it but you have to accept it was not meant to).

<comment><AUTHOR> Sorry if it came off that way, I'll reword that part of the article as it seems to be misinterpreted. I understand that intellisense is a feature of an IDE, and not the language. I use netbeans with PHP, and it does have auto- complete. What I meant was that the code format used in C# was easier to use(maybe I am just used to it) than PHP's style.

I initially wrote the app in C#ASP.NET(2.0) but had trouble getting it to work well on the server with mono(problems with GDI), so I switched to PHP and used it as a learning experience. Perhaps I should have used a more general purpose language, but at the time I was unaware of the limitations of PHP.

</comment></comment></comment></comment><comment><USER7> PHP: by amateurs, for amateurs</comment>


Wrong Tomorrow - holding pundits accountable for predictions - <AUTHOR> http://wrongtomorrow.com/

<comment><USER2> I have this mental list of "things I would love to see and am too lazy to actually implement right now and maybe someone else will come up with the same idea and spare me the work".

And now I can cross another item off of that list.

<comment><USER3> Yep, I just wish people could bet on these predictions too. Unfortunately, that is illegal in the US ...

<comment><USER4> virtual currency

<comment><USER3> That defeats the whole point, unless the virtual currency is worth something in the real world - at the very least considerable social currency or (ideally) it should be exchangeable for real goods and services.

People bet differently when they have something real at stake - ever tried to play poker with no money behind the chips? It's a completely different (and completely boring) game. It's the reason the market instantly knew who was responsible for the Challenger crash (when it took Richard Feynman and the rest of genius scientists on the panel months to even have a plausible idea).

<comment><USER5> I'd love to see a reference on that Challenger remark -- seriously.

<comment><USER3> [http://www.scribd.com/doc/8142600/the-Stock-Market- Reaction-...](http://www.scribd.com/doc/8142600/the-Stock-Market-Reaction-to- the-Challenger-Crash)

Sorry for the scribd link. It's the first copy I found that wasn't behind a pay wall.

The gist is that within a few hours of the Challenger crash the stock for the company responsible for the component that failed went down far more than the stocks for other companies involved in building challenger. Interestingly, the equity value the stock lost (~200 Million USD) is almost exactly the same as the estimated total loss in profit (fines, lawsuits, updates to safety standards, lost contracts, etc).

<comment><USER6> Hmmm...so traders had a 1 in 4 shot of picking the correct company and they happened to do so? I remain unconvinced. I also remain unconvinced that this data is useful. It's not like we should let trader behavior influence safety investigations, right?

<comment><USER3> Go read "The Wisdom of Crowds" - it is chock full of examples like this.

No one is saying we should use markets for safety investigations - we are saying that we should use it predicatively.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER3> Reminds me of overcoming bias' stuff. For example: [http://www.overcomingbias.com/2009/02/who-are-macro- experts....](http://www.overcomingbias.com/2009/02/who-are-macro-experts.html)

We really need this sort of thing to take off ...

Unfortunately, the public hates them. When DARPA created a prediction market (PAM) there was so much public outrage that the head of the agency was fired.

<comment><USER7> The public hates prediction markets that try and predict terrorist attacks. Ones that make Scoble look like an ass are something else entirely.

</comment></comment><comment><USER8> This is extraordinarily important work to see done. Whether or not anyone is bothering to keep track of successful predictions affects the whole quality of predictions that will be publicly made, which affects the sanity of the whole society. Mod parent up and link to this project on your blog.

</comment><comment><USER9> Are there any categories besides right and wrong? I'd imagine that the success of some predictions is open to interpretation and/or ambiguous enough to defy easy categorization. A perfect example would be "Podcasting will be a factor in the 2006 congressional elections in the US." How much counts as "a factor?" Any amount > 0? How can we be sure one way or the other about this one, without some extensive analysis?

At the very least, I think some explanation of how the determination is made should be required.

<comment><USER10> The "WRONG" ones have some commentary:

<http://wrongtomorrow.com/predictions/26>

<comment><USER9> Not all of them. For example:

<http://wrongtomorrow.com/predictions/47>

<comment><USER10> Good eye. (Not that I can think much of any counter-example, there's still no explanation.)

</comment></comment></comment></comment><comment><USER11> Very, very cool. Kind of like the Obama promise-keeper website that I thought was cool, but then promptly forgot about. I'd like to suggest a couple of features, without which I probably will promptly forget this site as well:

      1)  E-mail or alert me when a prediction is verified correct, or expires, whichever comes first.
      2)  Mirror the URL at which the prediction is made.

Great work launching the site, and best of luck to you.

</comment><comment><USER12> If you peruse the Bloomberg wire and keep track of stock analyst predictions, this site could grow into a "forecast analyzer" of stock "experts." Of course, someone needs to login and edit whether the prediction was correct.

<comment><USER13> Actually, I remember reading sth about a hedge fund that employed just that approach. They had every analyst or broker send in their predictions or collected them from somewhere and kept track of who did well and who did not. The better someone did (the article did not say which measure the fund used), the more business the fund would send their way (in terms of order flow), betting on their recommendations to go long or short. Presumably, their portfolio would have been optimized to account for forecast accuracy, expected gains, and some measure of risk. The difficult question here would be which measure to take as "forecast accuracy", and that also touches on the site. How wrong is wrong, and how right is right? You would need some measure of dispersion to judge whether someone was right. If there is a lot of noise in some variable (say the oil price), then basically anyone will have been right sometime when the forecast horizon is long enough. On the other hand, you couldn't really say someone was "wrong" in his forecast if he said X and, by the measure of dispersion used, the actual number lies within reasonable bounds around X. Another question I already mailed the site's creator is how the variables are actually defined and tracked. Yet another question is whether and how the forecasters can adjust their forecasts. Obviously, you should be able to update your 5y forecast if tomorrow something happens that topples your assumptions. It's totally legit to do that, and I would argue such a mechanism is the real point of the otherwise pointless forecasting game.

EDIT: There is one more question I find interesting. The measure by which forecast quality is judged should also somehow account for time dimension. Concretely, if the process you are tracking conforms 9 times out of 10 with your forecast path and then "explodes" or "collapses", are you good or bad? How far does it have to collapse or explode that you are "bad", how is the situation if the granularity is finer and you can observe 100 times instead of 10 (so the process is 98 or 99 times fine and then explodes)?

<comment><USER14> One hedge fund? This is a fairly standard strategy. Analysts publish their predictions. Services like First Call aggregate them, etc.

<comment><USER13> I didn't say "one" hedge fund pursues the strategy. I said I read about one. Also, aggregators do the exact opposite of what this hedge fund was doing: averaging. Whereas the point would be to measure their predictive accuracy individually.

<comment><USER14> Actually, the data providers just give you all the data, not average anything.

I've actually worked in that business. Have you?

</comment></comment></comment></comment></comment><comment><USER15> I, and I think lots of others, all have had this on a todo list. I think the reason they never seem to get built or take off is that there is such a lag between their establishment and their payoff.

I assume the trick is to have some dedicated submitters for a year, and then to really push the interesting right/wrong answers into the right social news sites. That should get them over the hump. I hope this site manages to do that. Bookmarked.

</comment><comment><USER16> Related: <http://www.longbets.org/>

</comment><comment><USER17> I love this in concept, but somehow feel like it'd be better established as some sort of data blog. Perhaps you could find some aspiring young writer out there willing to work for equity?

</comment><comment><USER18> Seems to be down at the moment... and now it's ok. Weird.

I agree completely with sethg... I had this idea floating around, and it's nice to see it. Do make it easier to see some statistics, and see wrong/right predictions, as that's a bit more interesting for the casual browser.

BTW, it's _really slow_ again.

</comment><comment><USER19> For some reason the #s in authors, don't match up with the actual author profile.

</comment><comment><USER20> Of all those, I tend to think T. Boone Pickens is the one who's most likely to turn out right.

The question is, if someone turns out to be right, does he get removed from the list?</comment>


Ask HN: What skills do self-taught Web Developers commonly lack? - <AUTHOR> <comment><USER2> I went down this path and am about 2yrs into the industry. Things I lacked:

1) Computer Science theory and concepts. I might know some buzzwords but I didnt initially understand things in depth. It took time working on projects to start grasping them.

2) Perspective on the industry. People get so caught up in language and framework wars. It's easy to just take someone's opinion and run with it. After a while you realize that there isn't really a right or wrong and focus on learning underlying concepts.

3) How to keep cool under sudden pressure. Releasing a bug into prod would scare the hell out of me. Sure, it's never a good thing, but even Apple releases bugs. Taking a second to breathe and calm down can make a huge difference in effectively tackling pop-up issues.

I'm sure I'm missing some but those are the ones that came to mind for me anyways.

</comment><comment><USER3> This question comes up a lot, I once saw this asked on Quora, will update this post once I get the link. IMHO I think most self-taught developers lack the basic CS concepts, myself being a self-taught developer created a list of topics that I study every morning -> [https://github.com/nkudo/daily- study](https://github.com/nkudo/daily-study)

Currently learning algorithms and I've been enjoying it so far, learnt a lot and some of the knowledge gained helped me in a recent interview where I was asked what data-structure the HTML DOM used. I am a JavaScript person so I'm reading this book -> [http://www.amazon.com/Structures-Algorithms-JavaScript- Micha...](http://www.amazon.com/Structures-Algorithms-JavaScript-Michael- McMillan/dp/1449364934)

</comment><comment><USER4> I'm a self-taught web developer. I think every web developer was when I started out.

I'd like to add a defiant similar question and an answer to go with it.

What do non-self-taught web developers lack?

Experience :)

Tongue in cheek. I still have gaps all over when it comes to CS, paradigms, patterns, and I'm perpetually at odds with all the tooling around these days.

</comment><comment><USER5> In general, self-taught Web Developers tend to lack some of the computer science theory. This may show up when you work on a large project and you need to sort and ingest a million records at a time. There can also be a tendency to be attracted to the newest trends out there when a more conservative approach might pay better dividends.

</comment><comment><USER6> \- team work, unless somebody learned this skill in other way

\- SCRUM - it would be hard to teach oneself SCRUM without job environment

\- jargon (I didn't know what "pull request" or "ticket" ment before I went to the first job)

\- courage, self-assurance (because of lack positive feedback from other programmers - people who learn programming on jobs are in better situation than self learners)

\- realism, cynicism (Self taught programmers are sometimes too optimistic or too pessimistic and dont have sense of reality).

</comment><comment><USER7> Well if you have only worked by yourself previously then the obvious skill you need to learn is team work. Stuff like work delegation and handling expectations of others.

</comment><comment><USER8> general computer architecture like the max size of an integer. High level languages usually abstract this away. How a whole number is represented at the hardware level.

<comment><USER9> Genuine question - when would you need to know the int size? When do you think knowing how negative numbers are represented in binary would help a web developer? Seriously curious.

Edit: sure it's good to know, but that's another question.

<comment><USER8> If you're building a programming language and you arthimetic operations. You would need to handle the case of overflow and underflow.

Edit: a Web Developer doesn't need to know it but it's most likely part of a CD curiculem.</comment></comment></comment>


Launching a Mac App and Becoming the Top Paid App Globally - <AUTHOR> https://medium.com/developers-writing/how-to-launch-a-mac-app-and-become-1-top-paid-app-globally-4434bbfb51ee <comment><USER2> It's interesting that their views on competition run counter to what YC / Peter Thiel advocate for in all startups - that is, avoiding competitive spaces and going for monopolies. Perhaps monopolies are necessary for huge growth and investor upside, but it should be made clear that there's obviously space in startups for modest goals like a nice PDF reader, and I hope their employees makes a reasonable living off it at the very least.

Not sure if their business model will work out (given the sad state of affairs that is the Mac App Store) but I liked that they were transparent about it.

On another note... the Vimeo ad they released [https://vimeo.com/145400917](https://vimeo.com/145400917) features a white, well-dressed man working at an empty desk with nothing on it but a macbook, coffee mug, iPhone, and Moleskine notebook. I find this marketing trope hilarious and want to amass a collection of such images. Is someone already curating such a thing?

<comment><USER3> My office setup is almost exactly what you describe. Switch out the macbook for an imac and then add a height adjustable desk, some headphones, and a hydroflask.

The article though was pretty effective in making me want to try the app since I make a handful of pdfs and exporting from photoshop is a pain since I always forget the settings I want to use to make the file not gigantic.

But to your point, I kind of like the idea that people can make a business like this and eke out a nice income and have happy customers. It reminds me of a tooth whitening supply company I temped for a while back. They had 4 employees and were 100% happy with the number of customers they had and would get more via tradeshows, dentists liked their product, and the profits were really good. I imagine the owners knew that at a certain size managing the business would not allow them to live the lifestyle they enjoyed, so they just maintained it as is.

<comment><USER4> Well, PDF Expert can potentially bring $10M a year if we do it right. We just feel that the PDF experience with Adobe isn't great... And for people who work with PDFs that does matter.

Speaking about lifestyle business: we definitely decided not to do it. It's been 7 years, we grew to 85 people and 45 million users... that is why we are aiming for something that is much bigger and has much more impact! Have a look at Spark!

<comment><USER5> Here's to hoping you bring Spark to the Mac ;)

On PDF Expert, one feature I'd love to see would be an option to add links to sections of images in a PDF. That's the only thing I use Acrobat for, and it'd be incredible to be able to quit using it forever.

</comment></comment></comment></comment><comment><USER6> Purely from a user's perspective, the Mac app store has a considerable advantage in centrally managing updates. Non-MAS apps each have their own eclectic ways of updating. Some support automatic update checks, while users have to explicitly check others. For the ones with automatic updates, there are a number of ways it's handled. Users don't generally want scores of update daemons running, and the whole business of "On launch, check for update, notify the user and let them choose whether to update now" really feels like the web page pop-ups that are so popular. ("I launched the app to do work, not to see if there was an update. The update prompt is in my way.") This cries out for a better user experience.

<comment><USER7> Update on the way out? ie. Pop up with two options "close" and "update and close", at least this time you've already accomplished what you were after with the application.

<comment><USER8> Maybe it's just me, but when I am ready to quit an app the last thing I want to do is go through an update process.

<comment><USER9> Especially one that will relaunch the app when it's done.

Ideally, you'd want a system-level daemon that downloads and preps updates in the background, and either waits until the system is idle (I think Apple has some tech like this already for running Time Machine backups), with pending updates optionally installed on system shutdown (am I shutting down to save on battery, to restart, or because I'm about to leave the office and I don't care how long it takes for the system to shut down).

<comment><USER10> I think Kelly Sutton (of the late layervault) figured this out with his fork of sparkle, called "autosparkle" \- [https://github.com/layervault/Sparkle](https://github.com/layervault/Sparkle) . I haven't personally integrated it into my app yet, but supposedly it makes updates a much more silent process - which is really important for 'always-on' tray apps like layervault was, or the one I'm making.

Here's their announcement of it from 2013: [http://layervault.tumblr.com/post/50501747774/open- sourced-a...](http://layervault.tumblr.com/post/50501747774/open-sourced- autosparkle)

</comment></comment></comment></comment></comment><comment><USER11> It's interesting how he says videos are important. I find videos to be much slower to parse than reading features or reviews from notable people within the industry the app is part of. For example, in the case of Sketch, I didn't watch the video (didn't even know they had them until I checked today) but instead read what it's like to use the application from a couple different designers.

In the case of Dropbox (whoa, that was a long time ago), I think I just had it verbally recommended to me from techies or I just read about it on HN.

In fact, all of what I end up installing and using comes from the backs of people rather than videos. Maybes it's a generational thing.

<comment><USER4> Thanks for your comment, but from my experience - a good video can benefit greatly to the product. And true, younger crowd prefers video to the text :)

</comment></comment><comment><USER12> How do they get in touch with that "App Store Business Management" they spoke about? It's not like they make their emails available for any Joe Developer to talk to them.

<comment><USER13> I'm wondering about the same thing:

 _Apple is being very helpful these days, and they want developers to succeed. That is why you really should keep in touch with App Store Business Management and keep them updated on what you're building and when you're getting ready for a launch._

It's a highly rarefied group of developers who have a contact in App Store management that would be interested in hearing about an upcoming launch.

<comment><USER12> And how do they achieve it? Where do they even start?

We have two apps that have had nearly 4 million downloads across both app stores. Here's been the growth of our Mac app, for example: [http://qbix.com/calendar](http://qbix.com/calendar) . Our average reviews are very close to 5 stars out of 5 after thousands of reviews.

It's all organic. People just found us in the store. We were never contacted by Apple to get featured, and we had no way of contacting them, that we knew of. So I'm curious. It's not just about numbers.

<comment><USER13> The article mentions that they've been on iOS for almost eight years, so they must have been in the App Store at the very start. I imagine that helps to build a relationship.

That also makes their advice on this point rather difficult to apply. It's sort of like this marketing advice:

"It can be really helpful if the New York Times writes a two-pager about you. You should call up your contact on the editorial team in advance and tell them about what you're doing, so the story will be ready on launch day."

<comment><USER14> The author of the article has an answer to this question: "Go to WWDC"

</comment></comment></comment></comment></comment><comment><USER15> 10\. Release a quality app

It's not a buggy, slow, unusable piece of crap that a lot of low-end software is. It's easy to use and it works well.

</comment><comment><USER16> The time-limited trial is essential for selling productivity software, unfortunately most companies are doing it wrong.

Beyond Compare[1] has a 30-day trial that is 30 days of use - not just 30 consecutive days. If I actually use a piece of software 30 different times on different days, then it's definitely worth a purchase. It's too bad more developers don't design their trials this way.

[1] - [http://www.scootersoftware.com/](http://www.scootersoftware.com/)

<comment><USER17> I find time limited trials useless. For user, it is inconvenient, because maybe the time is not enough to test complex software. For developers it's bad because user can simply reinstall the software again when trial period is over.

In my apps, I limit the amount of data you can store in trial version. So, you can try it as much as you can. For example, if your software was an e-mail client, you could limit it to 30 messages in any folder (inbox, sent, trash).

<comment><USER18> Depends how you do it. Many apps that use time trials will often leave behind some preference file or registry key to block re-installing.

But it's probably not worth building that into your software (I don't) - customers will either get so sick of reinstalling every 30 days that they just buy your software, or they're so poor that they were never really going to be a customer anyway, so you may as well let them continue with the workaround until they can afford it.

Time trials can be useful though. While most customers buy within the first day of use (and typically the first hour!), anyone who tracks metrics knows that expiring the trial version also generates a boost in sales around day 29 / day 30 of the trial.

</comment></comment></comment><comment><USER19> Although not a top paid app for a side project my app is doing surprisingly well even outside the app store after I took it out recently.

The number one factor which he alluded to is which pricing strategy to follow. My app is not 70 but 9.99.

I too am using a time limited version and I am realizing that this isn't the best approach for my app either. So I am working towards something like what Sublime is doing.

One of the biggest learnings I have gotten from this experience is that an app is rarely a business and that the MAS is rarely a good distribution channel if you are doing something unique.

I could make at a minimum double as much as I am doing right now if i spent som more time on it (I will make around $50K the first year) and there is money to be made if you have something unique. Unfortunately thats hard to do on the MAS with Sandbox.

<comment><USER20> How did/do you market/promote it?

<comment><USER19> A combination. HN was a good first boost [https://news.ycombinator.com/item?id=9145007](https://news.ycombinator.com/item?id=9145007)

Then got in contact with a lot of websites. Was lucky to get som really good reviews on LifeHacker and MacUpdate plus other places. And then people started telling their friends about it.

Plus I have an email list now with +10K customers or potential customers.

</comment></comment></comment><comment><USER21> _It was crucial to pick the right business model for PDF Expert. Since we are a privately owned company and never raised any capital, we have to make profit in order to develop great software — an expensive endeavor these days._

Kudos to someone else who actually wants to make money these days, not just spark investor interest, burn a ton of other people's money and then retire to write a book while their company goes down in flames.

</comment><comment><USER22> I'm trying to figure out what's so great about this app. Is it just that it's available on iOS and OSX?

<comment><USER14> It scratches an itch.

It is polished.

It works well.

They marketed it like hell.

<comment><USER9> It's a few steps above Preview.app (Apple's built-in PDF viewer), but without all the bloat and the high price of Acrobat.

And it probably doesn't have anywhere near as many security vulnerabilities as Acrobat.

</comment></comment></comment><comment><USER23> Nice article. On a completely unrelated subject, the guy in the video left the machine unlocked. Bad guy.

</comment><comment><USER24> > PDF Expert is available at an introductory price of $19.99, but that will > rise in the near future to $60–70 once we add PDF editing and OCR.

$60–70 for a fancy PDF reader ? By doing this you will get only the people that really, really need your software, the others will turn away unable to justify such an expense for a non vital software.

A bit like an iPhone in fact. I could afford one, but I don't want to make sacrifices on other more important things. Sometimes I wonder if the peoples that make these prices live in a kind of "rich people bubble" where money grows on trees and 70 bucks for a PDF reader or almost a grand for a smartphone is just chump change.

<comment><USER25> But other PDF editors cost a lot more. PDFpen is worth $75, and Adobe Acrobat DC costs like $450 if purchased fully, not by subscription model.

Finally, it all depends on what exactly you need from the app. Fast, reliable and well-designed software can't be cheap - and I don't think it should.

<comment><USER26> I must admit I found the proposed $60 price a bit shocking when I read the article. Surely there are free software solutions which do much the same thing. I believe Okular can do most of the things the article alluded to.

<comment><USER25> That's true, $60 would be too much for current set of features. But this is a supposed price for updated version, which will be released soon, which includes powerful PDF editing features as well (similar to those in Acrobat Pro, for example).</comment></comment></comment></comment>


Show HN: How IFS Fractal Images Are Generated, an interactive guide - <AUTHOR> http://joelstrouts.com/2019/07/30/IFS.html <comment><USER2> Nice job!</comment>


Ho Ho, Oh No!  Germany Has a Santa Shortage - <AUTHOR> https://www.npr.org/2019/12/22/790107058/ho-ho-oh-no-germany-has-a-santa-shortage <comment><USER2> "Where would we be without humor?"

"Germany"</comment>


PostgreSQL when it is not your job - <AUTHOR> http://reinout.vanrees.org/weblog/2012/06/04/djangocon-postgres.html

<comment><USER2> As someone whose job it _is_ to keep peoples' PostgreSQL instances happy, this list is fairly comprehensive, and much of it is good. His advice about configuration directives towards the top of the article, however, is terrible.

In particular, work_mem: the article suggests setting it to 2-3x the size of the largest temp file you see. The thing you need to be mindful of with work_mem is that the limit is _per sort_. I have a process on one of my masters that periodically regenerates a materialized view. Each run leaves hundreds of mibibytes of temp files. Configured per the article's advice, it's eminently possible to exhaust physical memory on sorts (100 connections each doing 10 sorts, for example). Unfortunately, the Linux OOM-killer is naïve about postgres; it tends just to thump the postmaster. Fun times.

To the contrary, something low like 16MB is the general recommendation. You can tweak that per session, if you know you'll be doing larger sorts and don't want to spill to disk ("SET work_mem = $desired_value"), but there's no need to allocate 100s of mbytes to sort tens of tuples.

EDIT: Heed the advice about transactions under Django. At a previous gig, correcting the default behavior to leave a transaction open for sometimes _days_ at a time reduced the amount of bloat on some hotter, but small tables, by three orders of magnitude. VACUUM can't do its job if there are transactions open to whom the dead tuples it's trying to reclaim might still be visible.

Also important, the bit about IN() clauses. A few months ago, I was given a query that hadn't completed overnight and asked to make it go faster. It contained a moderately sized (but not massive) IN() clause, which I refactored into a JOIN. That was the only change I made, after which it ran in 3.7s.

EDIT: clarification.

<comment><USER3> Just out of interest, but how large was the "moderately sized" IN() clause? I am asking, as we are looking at postgresql as an alternative to MySQL, and we have some queries currently with up to 5000 values inside IN()

<comment><USER2> I don't remember specifically, but I believe it was in the thousands to low tens of thousands of rows. It's also not consistent. I've seen larger IN() clauses that never have a problem, and smaller ones that consistently do. It's been on my very low priority to-do list to put together some demo cases for the mailing lists, because overnight to < 4s just from that little refactor isn't the greatest...

<comment><USER4> Are we talking about IN clauses that contain a correlated subquery or something the optimizer would have a hard time determining was independent of outer context?

<comment><USER5> PostgreSQL is able to convert correlated subqueries with IN () clauses into joins in most cases. My guess is that it could have been two queries refactored into one.

</comment></comment></comment></comment></comment><comment><USER6> This advice is just copypasta.

It's also pretty dangerous and wrong.

Example: "shared-buffers. below 2GB: set it to 20% of full memory, below 32GB: 25% of your full memory." -- Don't do this. Set it to around 20% of your memory if you have a small machine, such as a vps or desktop. If you have lots of memory, set it between 2GB and 4GB. Anything above 8GB exceeds what it is designed to handle and can cause major performance problems, such as the database becoming unresponsive for 1-2 minutes.

"work_mem. Start low at 32/64MB. Look for temporary file lines in logs. Then set it to 2-3x the largest temp file that you see. This setting can give a huge speed boost (if set properly)." -- This is a great way to cause your database machine to swap to death. A single query can cause many times work_mem to be allocated (it can allocate this much for every sort or hash). So this really depends on how many connections you have and what the queries are. No silver bullet here, but 16-24MB usually works pretty well if you have enough memory.

maintenance_work_mem: 2GB is plenty. This is used whenever you create an index, and I think autovacuum also uses this setting. 10% is way too high.

checkpoint_timeout: the higher the better here, but keep in mind that if your db goes down and has to be started, it can take this long before it is available to accept queries. 5M is probably what I would use unless I knew I could accept more down time than that.

Also, changing linux kernel settings can make a huge difference, but tuning disk performance and dirty buffer sizes is a whole topic I won't get into here.

You can learn basically everything you need here: [http://www.2ndquadrant.com/en/postgresql-90-high- performance...](http://www.2ndquadrant.com/en/postgresql-90-high-performance/)

One thing not mentioned, but which can have a HUGE performance advantage, especially on virtualized disks or spinning disks that don't have a battery backed raid controller, is this: [http://www.postgresql.org/docs/9.1/static/wal-async- commit.h...](http://www.postgresql.org/docs/9.1/static/wal-async-commit.html)

<comment><USER7> > This advice is just copypasta.

> It's also pretty dangerous and wrong.

It's livenotes from a presentation, I expect Reinout van Rees noted the parts that interested him as the actual presentation has what you think "right":

> If you have lots of memory, set it between 2GB and 4GB. Anything above 8GB > exceeds what it is designed to handle

From the slides:

> Above 32GB (lucky you!), set to 8GB.

> This is a great way to cause your database machine to swap to death.

from the slides:

> But be careful: It can use that amount of memory per planner node.

maintenance_work_mem: 2GB is plenty. [...] 10% is way too high.

from the slides:

> 10% of system memory, up to 1GB. Maybe even higher _if you are having VACUUM > problems_.

(emphasis mine)

<comment><USER8> Hi, I'm the Reinout that made the notes. Yes, it was a live summary and his slides went by very fast. I'm surprised how much I got written down. So I had to leave stuff out, for instance the >32GB comment (which I did as it seemed applicable only to few people).

Masklinn, thanks for doing this bit of checking! For many people (including myself :-) the summary will be enough, but checking the actual presentation is a good idea if you run into problems.

</comment></comment></comment><comment><USER9> Part of the reason why PostgreSQL has so any knobs is that these things are not always thing that cookie cutter approaches work with. Although if you do need to worry about these, it probably is your job and you probably are at least going to learn it.

I am not convinced about his list of "stupid db tricks you should not do." For example:

1) Sessions in the db are sometimes a good thing and sometimes not. They do have a real performance cost (we have a query in LedgerSMB that for large db's takes 20x longer because of having to do this, but the performance cost is necessary and still worth it, though we will probably offer non-web-based alternatives instead later where this wont be necessary). Of course that query is actually using another table to provide "discretionary locks" of rows to a session.... and those locks MUST persist across transactions because of the fact we are mapping to a series of HTTP requests...

2) I dont know about celery queues, but with listen/notify, you can do some really cool message queuing in PostgreSQL.

3) Usually when my app has to store files attached to data, I usually find that it's simpler to put it in the db than the filesystem. That guarantees that the files are in the backups among other things. Also for larger files, PostgreSQL's lob interface (up to 2gb) provides seek operations and more. performance issues here end up occurring outside PostgreSQL.

I am with him on very long-running transactions.

COPY is good for some things, but if you are trying to create more portable code you probably want to do something like insert foo (....) values (...), (....), (....)....

I would also suggest it is important to know the difference between LIKE '%this%' and full text searching on PostgreSQL. These are not simple drop-in equivalents. However additionally LIKE '%this%' cannot use an index (though like 'this%' can, and you can do full text indexing on Pg).

<comment><USER5> Actually since PostgreSQL 9.1 LIKE '%this%' is indexable with the pg_trgm contrib module. Since it is based on the trigrams in your search query it obviously has its caveats, generally the longer the query the more effective the index lookup is. I would imagine for example '%th%' requires a full table/index scan since it contains zero trigrams.

[http://www.postgresql.org/docs/9.1/static/pgtrgm.html#AEN137...](http://www.postgresql.org/docs/9.1/static/pgtrgm.html#AEN137099)

<comment><USER9> But pg_trgm isn't really the same either, is it? I have looked at pg_trgm primarily for handling misspellings and suggested alternatives.

Also it wasn't clear to me how "%this%" would be differentiated from "his thin snake."

<comment><USER5> Yes, pg_trgm was built for that but someone figured out how LIKE could be hacked to use the trigram indexes (gist_trgm_ops, gin_trgm_ops). So if you have a * _trgm_ops index on the column normal LIKE and ILIKE queries may use that index.

I assume your example would be a false index hit which then is necessary to verify against the real value. The same would apply to make sure 'This' is not a hit when doing a case sensitive search for '%this%'. So index-only LIKE scans are not possible with * _trgm_ops indexes.

EDIT: I just realized how awesome the extensibility of PostgreSQL is. An extension can make a core operator such as LIKE indexable in an entirely new way without touching the core code.

<comment><USER9> The extensibility is really cool. And yeah, that looks like a very useful thing. Thanks for the pointer.

</comment></comment></comment></comment></comment><comment><USER10> Here's an attempt[0](by the creator of the Postgres High Perf Book, (and some patches by yours truly)) to automate PG configuration. It's not perfect, but certainly better than OOB settings

0 - <https://github.com/gregs1104/pgtune>

</comment><comment><USER11> One question on avoiding giant IN clauses with Django?

Say I have a class called Fridge, and a classes called Vegetables and Condiments.

Both of these have ManyToMany relationships between themselves and Fridge.

So something like:

        class Fridge(models.Model):
             condiments = models.ManyToManyField(Condiments)
             vegetables = models.ManyToManyField(Vegetables)

And here we have a QuerySet that represents our white fridges:

        qs = Fridges.objects.filter(color='white')

First query:

"Given a list of condiment IDs, get me all the fridges that have ANY of those condiments in them (modifying the original QuerySet).""

Second query:

"Given a list of vegetable IDs, get me all the fridges that have ALL of those vegetables in them (modifying the original QuerySet)."

How on earth would I do that without building a list of fridge IDs and adding an IN clause to my queryset?

Here are solutions that do it with IN clauses:

First query:

            condiment_ids = [...] # list of condiment IDs
            condiments = Condiment.objects.filter(
                id__in=condiment_ids).all()
            condiment_fridges = None
            for condiment in condiments:
                qs = condiment.fridge_set.all()
                if not condiment_fridges:
                    condiment_fridges = qs
                else:
                    condiment_fridges = condiment_fridges | qs
            qs = qs.filter(id__in=[l.id for l in condiment_fridges])

Second query:

            vegetable_ids = [...] # list of vegetable IDs
            vegetables = vegetable.objects.filter(id__in=vegetable_ids).all()
            vegetable_fridges = None
            for vegetable in vegetables:
                qs = vegetable.location_set.all()
                if not vegetable_fridges:
                    vegetable_fridges = qs
                else:
                    vegetable_fridges = vegetable_fridges & qs
            qs = qs.filter(id__in=[l.id for l in vegetable_fridges])

These solutions seem horrible and hackish and I was wondering if there was a better way to do them with Django. Something like object HAS these objects or object HAS ALL of these objects.

Should I just post this on StackOverflow instead?

<comment><USER12> Might be a good idea to take that to stackoverflow. My suggestion though would be to use that little sauce that we can't achieve programmatically yet. Human intelligence. How often do you think you're going to need this data ? How often does it change ?

Cache it based on that. Whatever way you do it, queries like this are expensive. If you need it often enough, throw it into memory and invalidate as necessary. More often than not, your cache invalidation will use less lines than what you wrote up there.

Also, don't be afraid to drop into raw sql if you really want to do something a certain way. The example you posted above clearly looks like the ORM working against you.

<comment><USER11> Ok, here's my question on StackOverflow: [http://stackoverflow.com/questions/10930169/how-do-i-get- dja...](http://stackoverflow.com/questions/10930169/how-do-i-get-djangos-orm- to-check-if-model-has-or-has-all-of-a-certain-relation)

</comment></comment></comment><comment><USER13> If you don't configure your shmmax first, you might have a problem when tweaking the memory setting in postgresql.conf.

Relevant doc: [http://www.postgresql.org/docs/9.1/static/kernel- resources.h...](http://www.postgresql.org/docs/9.1/static/kernel- resources.html)

<comment><USER2> TL; DR: Postgres will just fail to start if shmmax is too small, and the logs will reflect that. On Linux, you'd say:

      # sysctl -w kernel.shmmax=N

Where N is the desired maximum shm segment size. (You'll also want to increase shmall, to accommodate shmmax, and any other shared memory requirements you may have.)

EDIT: Of course, to make the change persist across reboots, you'll also want to add it to /etc/sysctl.conf. I've forgotten that part more than just in this comment...

<comment><USER14> Try this strategy instead of using sysctl to set individual values: \- edit /etc/sysctl.conf \- run "sysctl -p"

<comment><USER15> Yes, definitely. I just learned about -p recently, and had been editing the config AND running sysctl -w for way too long.

</comment></comment></comment></comment><comment><USER16> Some of the suggestions make PostgreSQL seem less mature than InnoDB, still: "[don't put] sessions in the DB", "[don't put] constantly-updated counters in the database", and "[don't put] task queues in the database."

My forum gets almost a million page views daily; we store all our data in a(n) InnoDB database, including sessions, task queues, and constantly updated counters. They work just fine and are not even bottlenecks when the isolation level is REPEATABLE READ.

We use SERIALIZABLE though, as a matter of principle, so we had to implement a more fancy schema, but everything happens in the InnoDB database. We don't have to worry about running VACUUM periodically either. I feel PostgreSQL may be a wee bit overhyped.

<comment><USER9> Sessions in the db are fine, depending on what you are doing with them. LedgerSMB for example uses them to track who is doing what right now in the db, as well as maintain per-user locks that have to persist across db transactions.

In most workflows there is no significant performance penalty here. The only problem is where we are checking those locks and trying to obtain them if they are not held by someone else. This is a significant problem and currently makes a query in a large db take about 20x as long.

It all depends on what you are doing. But yeah trying to have extra- transactional locks so you can do reliable locking across HTTP requests tying it to the session sucks :-)

</comment></comment><comment><USER17> for the memory portion, if the stated is true, why not postgresql just use them directly? that's fixed values based on the hardware it runs on.

</comment><comment><USER18> THIS

Thanks

Even better if it was a quick guide to all quirks PSQL

Dear DBAs, PostgreSql may be great and etc, but if I need to spin a DB for testing/proof of concept, you bet I'm going to use MySQL 20 out of 10 times.

"Go RTFM" sorry, I lost count of how many times I had to set up MySQL or PSQL and MySQL is much more intuitive and easy to work with.

PSQL is sincerely a waste of time and energy for small things. If I need scalability, etc, sure, get a dba and go for PSQL

"Stupid DB tricks you should not do:" don't forget no logs in the DB. Or jut put it in a totally separate DB, but hey, an append only file is ok

"Don't use gigantic IN clauses. Django generates them a lot. JOINs are fine, but IN isn't well-supported in postgres."

Oh really?!?! And then they say Django in PSQL is faster?! Maybe to something really simple. (not in my experience, maybe that's why some things are faster in MySQL)

And don't forget PgAdmin3 _rocks_

<comment><AUTHOR> Is MySQL faster at handling IN than PSQL? Just because it says it's not well- supported in PSQL doesn't mean it is in MySQL. I don't know either way, but I'd like to.

<comment><USER18> I'm not sure how Django constructs the query, but it certainly does differently between MySQL and PostgreSql (and Oracle) since this is in the Django driver</comment></comment></comment>