Can regular expressions parse HTML or not? - <AUTHOR> http://www.johndcook.com/blog/2013/02/21/can-regular-expressions-parse-html-or-not/ <comment><USER2> The correct answer doesn't just depend on what you mean by "regular expressions", it also depends on what you mean by "parse". And perhaps also what you mean by "HTML".

Case in point: A while back I ran into a nasty bug in our software which would cause it to crash with a stack overflow exception. It turned out to be that the problem was in how HTML Agility Pack would respond to certain kinds of particularly poorly-formed HTML documents.

Now, we had chosen to use HTML Agility Pack in part because of all the comments to the effect of "NOOOOOO don't use regex, use Agility Pack!" complete with links to a certain famous Stack Overflow answer that are littered around the internet. But in analzying the situation in more detail, we discovered a few things: First, we were just stripping tags, so our parsing needs were very minor compared to what HTML Agility pack does. Second, generating a full-on parse tree for an HTML document was kind of harming us, in that doing so takes both time and RAM, two things we were trying to be light on. Third, we could afford to be fairly tolerant of a missed tag or some lost content, but the parser giving up was a minor tragedy. Noisy results were far better than no results for our purposes.

The upshot of all this being, for our "HTML parsing" needs, regular expressions turned out to be _exactly_ the right tool for the job. Following that realization, it was the work of only one afternoon to fix the bug, and as a side benefit dramatically improve both the engine's performance and the quality of its output.

Long story short, what passes for common wisdom on the Internet is no substitute for knowing what you're doing.

</comment><comment><USER3> > HTML in the wild can be rather wild.

One easy way to get an idea of how complicated this can be is checking out the parsing algorithm in the HTML5 spec [1] (section 12).

To start the complexity, HTML is not XML and not all tags are created equal. Void elements like <img> and <br> don't have matching close tags and contents for things like <textarea> and <script> are treated as text (you can't nest more tags inside). Then you have the issue of javascript being able to call document.write at HTML-parsing times, something you need to hope doesn't happen or parsing becomes intractable. Finally, There is a vast number of rules and special cases that kick off when you have missing or mis-nested tags or tags being put in the wrong places.

[1] <http://www.whatwg.org/specs/web-apps/current-work/multipage/>

</comment><comment><USER4> On the theoretical side, pure regular expressions (w/o PCRE extensions) can actually parse HTML to the extent that most browsers can. The expressions would be gigantic, unmaintainable messes, and probably not even possible to write by hand, but nonetheless it's more of a practical problem than an issue of formal language power.

For example, WebKit sets a maximum DOM nesting limit of 512 [1], and most other browsers have a limit as well. A context-free language restricted to a finite maximum production depth becomes a regular language, so WebKit's parsing _could_ be done by an NFA or DFA, and the parser could be encoded as a regular expression if desired. But the only plausible way to write such an expression correctly would be to mechanically "compile" it from a grammar. So you're going to need the grammar anyway, at which point you might as well use it directly.

[1] [http://trac.webkit.org/browser/trunk/Source/WebCore/page/Set...](http://trac.webkit.org/browser/trunk/Source/WebCore/page/Settings.h#L408)

<comment><USER5> Why does webkit have a limited tag depth?

<comment><USER6> Logically to avoid denial of service attacks, with exhaustion of memory etc.

<comment> T-hawk And here's the canonical example in XML: <http://en.wikipedia.org/wiki/Billion_laughs>

</comment></comment></comment></comment><comment><USER7> IMO The probablity of a given page being well formed, or being non-well formed in a manner that will not completely screw the parser is probably very low. Therefore, you should use a dedicated html parser for parsing html.

<comment><USER8> I agree as far as parsing most HTML. I use regular expressions all the time when I'm working with HTML I've written by hand because I know what's there.

I just find it interesting that the efficacy of regular expressions can be framed as a computer science question, a practical question, and a statistical question.

<comment><USER9> In practical terms, how often are you actually _parsing_ HTML? Building a DOM, rendering...

A knee-jerk reaction to 'HTML' and 'regular expression' being used in the same sentence is like someone seeing 'goto' without understanding the context and shouting "goto considered harmful!"

I recently use some combination of perl's split() and regexes to trivially pull all links from a piece of markup. I had to suppress the "Don't parse HTML with regular expressions!" voices echoing in my head the whole time I was writing it. I'm OK with the code now, of course.

<comment><USER8> Goto statements are a good example. It's easier to recite "goto is harmful" than to say "In most situations, other control structures are more expressive and easier to maintain than goto statements. However, there may be rare occasions, particularly in low-level system programming, where goto statements could be preferable."

"Don't parse HTML with regex" is good general advice, but no more an absolute than avoiding goto statements.

<comment><USER10> >rare occasions, particularly in low-level system programming, where goto statements could be preferable

Or something as simple as "break 2;"

</comment></comment></comment></comment></comment><comment><USER11> This can easily be summarized -- if the target HTML meets a modern specification and has no serious syntax errors, or if we're really talking about XHTML, which has a much stricter syntax, then no problem. Otherwise parsing the target will produce endless difficulties.

But then, if the HTML has syntax problems or contains inconsistent syntax, then no approach is entirely reliable, which means it's not about regular expressions any more.

</comment><comment><USER12> This post reminds me of Clarence Thomas' explanation of his short opinions. This is the perfect example of a "5 cent idea in a $10 sentence."

Post adds nothing of substance to the following:

 _"Well-formed HTML is context-free. So you can match it using regular expressions."_

 _"But most HTML you see in the wild is not well-formed. And just because you can, doesn't mean that you should."_

which wasn't even written by him.

<comment><USER13> 5 cent ideas in $10 sentences is pretty much describing half of HackerNews.

</comment></comment><comment><USER14> The topic in #regex on irc.freenode.org:

READ THIS FIRST: Need help? 1) Language/platform. 2) Sample string. 3) Desired result. 4) Your attempt. | Do NOT use RegEx to parse HTML! | Do NOT tell us a RegEx doesn't work if you aren't testing it in the language you asked about! | Intro: <http://bit.ly/XrnV> | Home: <http://bit.ly/KEo1Gx> | FAQ: <http://bit.ly/L949Mk> | Quiz: ? quiz | Regex website: <http://regex101.com/>

Note the part "Do NOT use RegEx to parse HTML!" ...

You can use regex to to parse HTML, but it's a verry bad idea. Basicly you would nee to reimplement the HTML definition in regex, otherwise your regex will screw up.

</comment><comment><USER15> In general, no. Regular expressions match regular languages but HTML is a context-free language. Every regular grammar is context-free but not all context-free grammars are regular.

See [http://stackoverflow.com/questions/590747/using-regular- expr...](http://stackoverflow.com/questions/590747/using-regular-expressions- to-parse-html-why-not) for details. Also

[http://stackoverflow.com/questions/5175840/is-html-a- context...](http://stackoverflow.com/questions/5175840/is-html-a-context-free- language)

And then you have attempts to recover when HTML is ill-formed: <http://en.wikipedia.org/wiki/Tag_soup>

<comment><USER16> Is your comment aimed at people who didn't read the linked article?</comment></comment>


Email clients on Linux - <AUTHOR> I need a email client on Linux that I can use to send patches to mailing lists, inline reply to email threads etc. Most of them have issues with word-wrapping, mangling text, inserting extra characters etc..
Which email clients do you use on Linux? Would you recommend it? How do you address these issues?
Would appreciate any suggestions. Thanks. <comment><USER2> I'm using KMail here and works fine, this might help [https://www.kernel.org/doc/html/v4.17/process/email- clients....](https://www.kernel.org/doc/html/v4.17/process/email-clients.html)

<comment><AUTHOR> Have tried kmail long time ago, but currently on a gnome based desktop. I'm afraid install kmail would mean that I need to pull a load of dependencies..</comment></comment>


Ask HN: How much of your earnings do you save? - <AUTHOR>

I always tell myself that I want to save at least 25% of what I make but as much as I try it always seems to fall to about 10 to 15%. So I am curious, for the young engineers and developers, how much are you saving? Is it just me or there is a lot of us? <comment><USER2> About 48% at the moment.. But that's really for a 3 month travel and code mission at the end of the year. I also put 10% pre tax in a super. I should probably salary sacrafice and put more in but I'd rather have a bit left over to manage myself. (Put chunks into long term stocks every once in a while, equates to roughly 10% (part of that 48%)

</comment><comment><USER3> More than 30% here. But we have no children at the moment. :P</comment>


How the number zero was 'discovered' - <AUTHOR> http://www.bbc.com/future/story/20161206-we-couldnt-live-without-zero-but-we-once-had-to <comment><USER2> We really are quite unkind in naming the numbers, or at least the difficult ones. We call them Zero (via Fibonacci's "zephiram", from the Arabic "sifr" meaning "empty"). Negative (from the Latin "negare", "to deny"). Irrational. And so on, in an escalation of denial: Imaginary. Transcendental. Supernatural. Surreal. There's more than a suggestion here that, on encountering the construction of each, the gut feeling is to reject their right to exist.

(Counterpoint; the ones we like are the ones we can grasp intuitively, and they receive more complimentary names: positive, natural, rational, prime. "integer" is Latin for "complete, sound, healthy")

It won't end, we'll always be discovering new number systems, so perhaps we should reserve terms now. Paradoxical numbers, anyone? Or repugnant?

<comment><USER3> My dictionary gives "integer" as

> _early 16th cent. (as an adjective meaning 'entire, whole'): from Latin, > 'intact, whole,' from in- (expressing negation) + the root of tangere 'to > touch.' Compare with entire, also with integral,integrate, and integrity._

Indeed, whole numbers is another word for integers, dated in English, but that's what they are called in some other languages like German and Russian.

I also suspect _natural_ is like in _natural philosophy_ : occurring in nature, not like the other meaning of _innate_ , although the two meanings are closely related.

 _Imaginary_ is due to Descartes ([https://en.wikipedia.org/wiki/Complex_number#History](https://en.wikipedia.org/wiki/Complex_number#History)):

> _[...] sometimes only imaginary, that is one can imagine as many as I said > in each equation, but sometimes there exists no quantity that matches that > which we imagine._

It says Descartes didn't like them, but _imaginary_ literally means _not occurring in nature_ , and this was presumably before people accepted mathematical concepts as being as real as anything else.

 _Transcendental_ also literally means _beyond the algebraic numbers_ , since that's the definition, that's what they transcend.

Surreal numbers are surreal because somebody (Conway?) needed to attach a prefix to _real_ , and my dictionary says _sur-_ is the same as _super-_. My dictionary says it is _surreal_ that is the odd word here: a backformation for _surrealism_ , which is some kind of art movement (I wouldn't trust some French painters to get English etymology right, eh? ;)).

Also, what about dyadic, and p-adic, numbers? Ordinal numbers? Hyperreal?

<comment><USER4> To add to this, "rational number" comes from "ratio" [2], not "rationality".

They look similar because (per [1]) they both come from Latin _ratio_ ("reckoning, accounting"), which derives from _reri_ (think, judge).

[1] [http://www.dictionary.com/browse/ratio?s=t](http://www.dictionary.com/browse/ratio?s=t)

[2] They're the numbers expressible as one integer divided by another.

<comment><USER5> I realize not everyone is the same as myself, but I really wish that this etymology was explained when the concept of the rational number was introduced. I have trouble with rote memorization, but little trouble so long as I can derive a thing from first principles. Realizing that rational number comes from ratio seems so obvious in hindsight, but would have been so very helpful to my in-school self oh so long ago.

<comment><USER6> When I took math in high school, our textbook had little blurbs that pointed out historical curiosities in regards to math. (The only one I remember clearly is an ancient Greek Queen? maybe Middle Ages, who did a lot of work on conic sections. So maybe it's not such an effective teaching tool since I didn't remember who exactly she was or when or where she lived).

Anyway, all the people who said stuff like "When are we going to use X math topic in real life" were even more flummoxed by random math historical facts that weren't going to be on the test.

Anyway, at least for me, I think I passed a point of maturity where I don't feel "bombarded" when I encounter additional information in regards to a math topic. I did poorly in math in high school, and, at the time, I felt that the less information, the better-- I could only integrate so much. But now at my age (almost 40) learning additional historical facts seems to help me understand the topic better.

</comment></comment></comment></comment></comment><comment><USER7> I'm going to take this opportunity to plug this series of videos on imaginary numbers, which covers the discovery/invention of zero to a small extent: [https://www.youtube.com/playlist?list=PLiaHhY2iBX9g6KIvZ_703...](https://www.youtube.com/playlist?list=PLiaHhY2iBX9g6KIvZ_703G3KJXapKkNaF)

I think it's just under an hour's worth of videos, in five minute chunks, covering both mathematics and history.

</comment><comment><USER8> Nice photo of the oldest zero known, at Angkor Wat, Cambodia, dated 683 AD [http://www.smithsonianmag.com/history/origin-number- zero-180...](http://www.smithsonianmag.com/history/origin-number- zero-180953392/)

The previous contender was the zero at Gwalior in India, dated 876 AD [http://www.ams.org/samplings/feature-column/fcarc-india- zero](http://www.ams.org/samplings/feature-column/fcarc-india-zero)

<comment><USER9> Wow... thanks, I never knew about that. As background to those unfamiliar with the region, ancient Southern Indian voyagers established Hindu kingdoms throughout this region (Indonesia, Cambodia, Vietnam). As such it follows that Indian systems of numeracy had also penetrated what is now central Vietnam (the Champa kingdom) and Indonesia (Srivijaya/Palembang).

</comment></comment><comment><USER10> I've commented on this on a previously-posted story[1] but the history of zero is really worth digging into. I'll repost the little poem I mentioned previously:

>U 0 a 0, but I 0 thee

>O 0 no 0, but O 0 me.

>O let not my 0 a mere 0 go,

>But 0 my 0 I 0 thee so.

As noted in the comments here, "cipher" used to be another name for zero/0, so the above reads as:

>You sigh for a cipher, but I sigh for thee

>O sigh for no cipher, but O sigh for me.

>O let not my sigh for a mere cipher go

>But sigh for my sigh, for I sigh for thee so.

Which, of course, explains why Neo, The One from the Matrix, had an enemy named Cypher.

1: [https://news.ycombinator.com/item?id=9196813](https://news.ycombinator.com/item?id=9196813)

</comment><comment> happy-go-lucky The etymology at [https://en.m.wikipedia.org/wiki/Śūnyatā](https://en.m.wikipedia.org/wiki/Śūnyatā) is helpful.

> "Śūnyatā" (Sanskrit) is usually translated as "emptiness," "hollow, > hollowness," "voidness." It is the noun form of the adjective śūnya or > śhūnya, plus -tā:

> śūnya means "zero," "nothing," "empty" or "void". Śūnya comes from the root > śvi, meaning "hollow".

> -tā means "-ness"

There are many loanwords meaning shunya or zero in many Indian languages and they are all adopted from Sanskrit.

<comment><USER11> Any cognates (even distant ones) in any Indo-European tongues?

<comment> happy-go-lucky Are these what you're looking for? [https://en.wikipedia.org/wiki/Indo- European_vocabulary](https://en.wikipedia.org/wiki/Indo-European_vocabulary)

</comment></comment></comment><comment><USER12> > In 1299, zero was banned in Florence, along with all Arabic numerals, > because they were said to encourage fraud. Zero could easily be doctored to > become nine, and why not add a few zeros on the end of a receipt to inflate > the price?

I'm really curious about this part. It sounds like they were already using Arabic numerals. How did they intend to express numbers like the ones mentioned in the first paragraph, like 101?

<comment><USER13> They were using Roman numerals. It's true that with Roman numerals and writing out the number using words, it's harder to forge. See [https://m.reddit.com/r/AskHistorians/comments/49z4d6/why_did...](https://m.reddit.com/r/AskHistorians/comments/49z4d6/why_did_florence_ban_hinduarabic_numerals_in_1299/)

</comment></comment><comment><USER14> I find zero to be an interesting concept in the applied math world because depending on how you want to visualize it, it leads to different numerical methods. For example, think of how we represent a zero vector on a computer. Basically, we have an array of floating point numbers, but it's sort of hard to exactly pin down when we want to define this array as zero. We could look at all of the individual elements; we could sum them; etc.

Anyway, the two most used methods are to call a vector zero when its norm is zero or to call a vector zero when it's orthogonal to all other vectors in the space. The first approach leads to least-squares approaches, which gives things like GMRES or QMR in linear algebra or first-order system least-squares (FOSLS) finite element methods. The second approach leads to Galerkin and Petrov-Galerkin algorithms, which gives things like CG in linear algebra or more standard Galerkin or Petro-Galerkin finite element methods.

Anyway, that's just an aside, but I wanted to add that how we visualize zero has a definite computational, algorithmic affect.

</comment><comment><USER15> > shunya

Straight from Buddhist meditation, meaning "emptiness" -> and now it's the basis of math and science. And it's not just zero, take a look at the pronunciation of numerals in Sanskrit:

0 śūnya - Arabic "ṣifr" -> Latin "zephir" -> "zero"

1 éka - Greek "ena" -> Latin "unus" -> English "one"

2 dvi - like the prefix "di-" or "bi-" meaning double, German "zwei" -> English "two"

3 trí - like "three"

4 catúr - like "quatre" in French

5 pañca - like Greek "pénte"

6 ṣáṣ - like six, or "șase" in Romanian

7 saptá - like seven, or "șapte" in Romanian

8 aṣṭá - like German "acht", English "eight"

9 náva - like nine, or "nouă" in Romanian, which also means new in both languages (new sounds like nine)

10 dagan - like Latin "decem"

It's amazing how much Sanskrit is in our languages.

<comment><USER16> Greek _ena_ has nothing to do with that. It comes from _sem-_ , the same root as that of lat. _semel_ 'once' and other words. If you want a Greek cognate to _unus_ and _one_ there is only (ancient greek) _οἰνή_ 'one on a dice'. Sanskrit _eka_ has _ka_ instead of expected _na_ for some reason, otherwise it agrees with the rest.

<comment><USER15> I worked on intuition and Google :-)

<comment><USER17> Can you give some more context regarding what your response means?

<comment><USER15> It means I recognized the similarities and researched them on Google.

</comment></comment></comment></comment></comment><comment><USER11> > _In 1299, zero was banned in Florence, along with all Arabic numerals, > because they were said to encourage fraud. Zero could easily be doctored to > become nine, and why not add a few zeros on the end of a receipt to inflate > the price?_

No doubt, the ban was supported by arguments about how it's making everyone more productive by catching problems early and eliminating a whole class of errors.

And so that would be where we can trace the origins of static typing.

</comment><comment><USER18> A fantastic longer read on the topic is "Zero: The Biography of a Dangerous Idea" by Charles Seife – highly recommended!

<comment><USER19> I love popular math book recommendations, but that particular one gets pretty terrible reviews: [http://www.ams.org/notices/200009/rev- gray.pdf](http://www.ams.org/notices/200009/rev-gray.pdf)

<comment><USER20> For an alternate take on it, see this positive review: [http://www.maa.org/press/maa-reviews/zero-the-biography- of-a...](http://www.maa.org/press/maa-reviews/zero-the-biography-of-a- dangerous-idea).

</comment></comment></comment><comment><USER21> Timeline of Ancient history [https://en.wikipedia.org/wiki/Timeline_of_ancient_history](https://en.wikipedia.org/wiki/Timeline_of_ancient_history)

</comment><comment><USER22> From the picture in the article "The Babylonian symbol for an absence of numbers".

Then that is not 0, that is null!</comment>


States with Medical Marijuana Have Fewer Painkiller Deaths - <AUTHOR> http://www.smithsonianmag.com/smart-news/states-medical-marijuana-have-fewer-painkiller-deaths-180952552/?no-ist <comment><USER2> Side note: acetaminophen is a much bigger threat than most opioid analgesics themselves. It's directly involved in something like 10% of all overdoses in the US. There's no practical reason for opioids like hydrocodone to be mixed with it (as opposed to just being prescribed/administered concurrently) except that you get sick if you try to take enough of the opioid to get high. Personally, I feel that hepatotoxicity is a poor abuse deterrent, both in theory and practice.

<comment><USER3> There are around 115 U.S. acetaminophen deaths per year, versus around 17k opioid analgesic deaths. That said, as far as I can tell there is no reason to take it acetaminophen ever; for pretty much any use case, there is another drug that's more effective and safer.

[http://www.propublica.org/article/tylenol-mcneil-fda- behind-...](http://www.propublica.org/article/tylenol-mcneil-fda-behind-the- numbers)

[http://www.cdc.gov/media/releases/2013/p0220_drug_overdose_d...](http://www.cdc.gov/media/releases/2013/p0220_drug_overdose_deaths.html)

<comment><USER4> There are some painkillers that contain both; which column do those go in?

<comment><USER3> Whichever one kills you. The Tylenol takes several days to kill you, whereas the opiates would be entirely worn off by then, so it should never be ambiguous.

<comment><USER2> The article clearly states that there were 16,651 overdose deaths "involving" opioids. It does not say anything about cause of death or exclusion of other drugs.

</comment></comment></comment></comment></comment><comment><USER5> I haven't read the scientific study on JAMA, but I would venture to speculate that there could be several reasons for such sharp drops in mortality due to opioid overdoses:

\- fewer people resort to opioids for recreational purposes, due to higher availability of marijuana

\- alcohol + opioids is a deadly combination. People who are high on marijuana tend to drink less, because alcohol doesn't go well with marijuana either. Marijuana, however, can be combined with many drugs and tends to enhance the experience, requiring less of the drug.

\- Marijuana makes people more cautious and health-conscious due to it's capacity to induce temporary paranoia and anxiety at larger doses.

A quick google search for 'marijuana combined with heroin' led me to a forum where people are reporting full-blown panic attacks when combining the two, with users generally reporting that the two drugs tend to enhance one another. Such panic attacks are powerful experiences and can be life-changing in a positive way.

Several countries have eased on marijuana prohibition due to the opiod addiction problem getting out of control (Switzerland, Portugal, Spain and probably other countries) and as a consequence saw decreases in overdoses and HIV infections so this study just corraborates what has been observed in other places around the world.

<comment><USER6> Marijuana and Alcohol are considered economic compliments actually. The more you smoke the more likely you are to drink and vice versa.

<comment><USER7> It looks like the research on this is mixed.

See

The Legalization of Recreational Marijuana: How Likely is the Worst-Case Scenario?, with Daniel Rees. _Journal of Policy Analysis and Management_ 33 (2014) 221-232.[1]

and

Williams, Jenny, Rosalie Pacula, Frank Chaloupka, and Henry Wechsler. 2004. "Alcohol and Marijuana Use among College Students: Economic Complements or Substitutes?" _Health Economics_ 13: 825-843.[2]

It seems that the research based on natural experiments is intrinsically better than the price-related studies, and so far, that indicates that marijuana legalization reduces alcohol consumption.

Anderson's research also indicates that medical marijuna legalization resulted in a significant decrease in traffic fatalities, which is a huge win.[3]

[1][http://dmarkanderson.com/Point_Counterpoint_07_31_13_v5.pdf](http://dmarkanderson.com/Point_Counterpoint_07_31_13_v5.pdf)

[2][http://www.uic.edu/orgs/impacteen/generalarea_PDFs/HCAS_Alc_...](http://www.uic.edu/orgs/impacteen/generalarea_PDFs/HCAS_Alc_pot_06-26-01.pdf)

[3][http://www.dmarkanderson.com/Medical_Marijuana__Accidents_an...](http://www.dmarkanderson.com/Medical_Marijuana__Accidents_and_Alcohol_7-8-13_v1.pdf)

PDFs may differ from published versions.

</comment></comment></comment><comment><USER8> "However, the study authors caution that their analysis doesn't account for health attitudes in different states that might explain the association."

As the article suggests, correlation does not equal causation. Looking at this map: [https://en.wikipedia.org/wiki/File:Map-of-US-state- cannabis-...](https://en.wikipedia.org/wiki/File:Map-of-US-state-cannabis- laws.svg)

one can imagine numerous other reasons that might lead to differential rates of painkiller (ab)use between states. Socioeconomic status is fairly clear to me (states with higher status are more likely to have medical marijuana), other correlations are a bit more of a can of worms.

<comment><USER9> They do account for unemployment, but I agree with you. More evidence needed.

</comment></comment><comment><USER10> I'm a big fan of recreational weed (ideally sativa strains), but my experience with indica strains for pain relieve is not good. I find that rather than making me forget about chronic pain that I currently experience (neck cramps, sore muscles, etc) it makes me remember/re-experience pain from years-old injuries. Surgical scars I got when I was in my teens and haven't felt since suddenly have dull unignorable sensations of pain. A toe I broke a year ago starts hurting again. Etc.

Nobody that I have mentioned this too has ever said they experienced the same so I've usually just written it off as some sort of strange psychosomatic thing, but the article's passing mention that _" marijuana doesn't replace the pain relief of opiates. However, it does seem to distract from the pain by making it less bothersome."_ makes me wonder if something is actually going on here.

<comment><USER11> Sativa is probably the better strain for pain relief, as it contains primarily THC (which is analgesic), whereas indicas contain roughly equal amounts of THC and CBD (which is anxiolytic and sedative).

A lot has been said in this debate and a sort of misguided idea that has been floating around lately is that the therapeutic effects of cannabis are entirely due to CBD, but this is _not_ the case. Current thinking is that the cannabinoid receptor type 1 -- CB1 -- is responsible for analgesic (anti-pain) and recreational properties, while CB2 is responsible for antiinflammatory effects; these are both targeted by THC, not CBD. CBD binds to a novel binding site GPR55 (iirc) and to 5-ht1a, which is believed to be partially responsible for the prosocial effects of MDMA, but not to cannabinoid receptors. Wrt. cancer, a bad summary is that THC activates some parts of the body's natural cancer defenses via CB2 (all CB2 agonists do so) and CBD might have some strange, mechanism-not-yet-determine antiproliferative activity. However, these effects may be too modest to be practically useful (who knows?); cancers easily become resistant to CB2 agonists.

While I'm blabbering I might as well dispense with the idea propounded by some that cannabis should only be used medically in the form of precisely calibrated extract compositions: this idea, while attractive, is simply too expensive, and unfair to poor people seeking pain relief, somnolescence, etc. However, from what I've seen here today, it might not be bad to try to implement a system where doctors can prescribe a specific terpenoid ratio w.r.t. THC, CBD, and THCV; the last is an antagonist and may give strains a "ceiling" effect, which can be useful if people need to smoke all day for some reason.

<comment><USER12> Indicas don't contain roughly equal amounts of THC and CBD -- the difference between the two is at least an order of magnitude. An exemplar indica might have 20% THC and 1.5% CBD, which would be considered an extremely high level of CBD. Your main point is still valid though, I just wanted to make the relative quantities clear.

Some nonspecific examples of tested strain concentration:

[https://budgenius.com/strains.html?tab=0&high_rating=0&sleep...](https://budgenius.com/strains.html?tab=0&high_rating=0&sleep_aid=0&pain_relief=0&nausea_relief=0&anxiety_relief=0&appetite_stimulation=0&location=&coordinates=&radius=10)

<comment><USER11> > An exemplar indica might have 20% THC and 1.5% CBD, which would be > considered an extremely high level of CBD.

[https://budgenius.com/ATF-B-Shangri-La-Farms- BG0010001EB64.h...](https://budgenius.com/ATF-B-Shangri-La-Farms- BG0010001EB64.html)

[https://budgenius.com/Titan-OG-7-Points-Medical- BG0010001EE9...](https://budgenius.com/Titan-OG-7-Points-Medical- BG0010001EE99.html)

Many strains according to this site of yours certainly seem to contain significantly more than 1.5% CBD. Ditto this study:

[http://www.amjbot.org/content/91/6/966.full](http://www.amjbot.org/content/91/6/966.full)

... which doesn't include any modern US strains but provides strong support for the idea that there are plants with large amounts of both CBD and THC. I actually may have made a separate mistake...

>Elevated levels of CBDV and/or THCV were much more common in plants of C. indica than in plants of C. sativa. Plants with elevated levels of THCV, sometimes exceeding THC, were detected in all four biotypes of C. indica, but not in all accessions.

So my memory has failed me, or the common-wisdom I absorbed: Cannabis indica contains more of both THC and CBD than Cannabis sativa, but _also_ contains larger amounts (and proportion) of the antagonist homologue THCV. And modern strains are all really hybrids anyway.

<comment><USER12> Hmm, to be honest, I've never encountered any strain above 1.5% or so CBD, so that takes me by surprise, a bit. I also have access to a fairly diverse selection of MMJ options in a permissive state, so I'm surprised I haven't seen any strains like that.

Learn something new every day, I suppose. I appreciate the info - I'll keep on the look out.</comment></comment></comment></comment></comment>


Show HN: Zapier for Developers - <AUTHOR> https://stdlib.com/blog/introducing-build-on-standard-library/ <comment><USER2> Sounds really interesting. Are there examples in React?

<comment><USER3> Founder here, Build is all about connecting APIs — so it's producing backend code that connects ecosystems together. Workflows run as serverless APIs. :)</comment></comment>


Cognitive Assistant that Learns and Organizes - <AUTHOR> http://caloproject.sri.com

<comment><AUTHOR> guys please share more links and information on how to get started in with CALO and NLP</comment>


19% of the most popular Docker containers have no root password - <AUTHOR> https://techerati.com/news-hub/19-of-the-most-popular-docker-containers-have-no-root-password/ <comment><USER2> Does getting root in a container typically give you access to much more then the application?

<comment><USER3> Last time I checked docker isn't quite multi tenant oob so a root user could spy on other containers network traffic which could be a great jumping off point to gain further access to other parts of the infrastructure.

You could also modify the application logic which the user running the app shouldn't have in a properly set up container.</comment></comment>


Pycharm alternative - <AUTHOR> I need a Pycharm alternative, with javascript and docker support. <comment><USER2> [http://www.catb.org/esr/faqs/smart- questions.html](http://www.catb.org/esr/faqs/smart-questions.html)</comment>


IPv6 Test - <AUTHOR> http://ipv6test.google.com/ <comment><USER2> <http://test-ipv6.com/> is much more detailed about how you might fail/be failing.

My iphone gets 10/10, 9/10 (I haven't fixed the DNS server to have IPv6 access yet).

The Google page fails to detect that I do in fact have IPv6 randomly some of the time...

</comment><comment><USER3> Looks like I won't run into any problems. Has anyone failed the test yet?

<comment><USER4> I've tried it from three locations today (home on Clear wimax ISP, T-Mobile 3G, and a coffee shop) and haven't seen any ipv6 connectivity yet.

</comment></comment><comment><USER5> I've been reading about IPv6 over IPv4 tunnel brokers and I have a question.

Aren't they basically carrying all the data requested back back forth like an ISP over an (ipv4) ISP? So you are basically doubling the traffic needed? If so, how are there free tunnels, how do they make money? How is it even practical?

<comment><USER6> The two big tunnel brokers are primarily run by network transit companies for whom bandwidth is less an issue and who benefit from more IPv6 traffic and the experience that managing and debugging it provides.

I suspect that tunneled traffic volumes will always be low enough not to significantly affect the bottom line, as anyone willing to maintain a manually configured tunnel will move to native IPv6 transit as soon as possible and higher volume production business needs will use native/load balancers/proxy servers instead of tunnels.

</comment></comment><comment><USER7> To start with, there's no IPv6 for <http://ipv6test.google.com/>

Check this: <http://paste.userlinux.net/62/>

Edit: previous link shows that I have IPv6 connectivity and Google test page is wrong.

<comment><USER8> What Google seems to be testing is whether you will be able to connect to a site that is served by both IPv4 and IPv6 (i.e. A and AAAA DNS records).

I believe their message is incorrect. It should be "Your system is not using IPv6 connection by default OR you don't have it."

Also, the IPv6 is available on <random>.ds.ipv6test.google.com, which is what they use to check your conectivity.

<comment><USER7> The say "You don't have IPv6, but you shouldn't have problems on websites that add IPv6 support", and that's incorrect. I have an IPv6 address, I have full IPv6 connectivity and actually I have IPv6 prioritized over IPv4.

Honestly, I don't see how are they testing if I have an IPv6 address when their web it's not accessible using IPv6. I can be wrong, though :)

Edit: OK, point for you. Although the system tries IPv6 first, may be Firefox is using IPv4 for that page because there's no IPv6 on ipv6test.google.com.

But I still think it's wrong because they're doing false negatives.

<comment><USER2> I get "Yes, looks like you're using IPv6 already. Welcome to the future of the Internet!"

I think they are detecting via Ajax to an ipv6 only domain so the test page does not need ipv6.

So it must be misdetecting you. It was being intermittent for me earlier...

</comment></comment></comment></comment><comment><USER9> ok, so this is a dumb question, but if i see:

      # ping6 ::1
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.054 ms
      ...
      # ping6 2a00:1450:8002::6a
      connect: Network is unreachable

does that mean that my isp isn't supporting ipv6? as far as i can tell, my system is configured to do so (i am worried about the "pure ipv6" part, not ipv4+6, which is fine).

[edit: updated with an ipv6 address from [http://www.cyberciti.biz/faq/howto- test-ipv6-network-with-pi...](http://www.cyberciti.biz/faq/howto-test- ipv6-network-with-ping6-command/)] [edit2: updated again with google address from below]

<comment><USER6> assuming by ping6 2001:0db8:200:f101::1 you mean ping6 to a real IPv6 address rather than the 2001:db8::/32 demonstration address, then yes, you probably have a link local IPv6 address only. You can also check by running ifconfig (or the similar utility for your OS) and looking for a globally routable IPv6 addresses on your network interface. If you only have addresses starting with fe80 then you are likely link local only and not getting anything globally routable from your ISP.

<comment><USER9> thanks. i fixed the address (i hope). and i do have an "fe80" address.

</comment></comment></comment><comment><USER10> My iPhone at home half fails. It tells me I don't have IPv6, but I think I do. I can access ipv6.google.com without problem.

<comment><USER11> ipv6.google.com is not an IPv6-only site. It simply has IPv6 support.

<comment><USER6> ipv6.google.com is in fact an IPv6 only site that is not accessible at all over IPv4.

<comment><USER12> This seems true. I don't have IPv6 and the page failed to load for me.

</comment></comment></comment></comment><comment><USER6> weird.. test-ipv6.com gives me 10/10 for full dual stack compatibility and ipv6test.google.com says I don't have IPv6 at all. Anyone else getting this?

edit: it looks like Safari must run dns requests both as IPv4 and IPv6 and uses whichever returns first. Refreshing a few times found the IPv6 is ready message on ipv6.google

<comment><USER2> Intermittently, yes. Some of the time it detects IPv6 correctly...

Is that 10/10 on both lines? The first 10/10 just means you have working IPv4, and you don't have a broken IPv6 that will cause problems. So you get 10/10, 0/10 if you just have working ipv4 and no ipv6...

</comment></comment><comment><USER13> What are the workarounds they talk about?

<comment><USER2> Here is a useful guide to the kinds of issues and fixes you might get [http://www.getipv6.info/index.php/Customer_problems_that_cou...](http://www.getipv6.info/index.php/Customer_problems_that_could_occur)

</comment></comment><comment><USER14> 10/10 for your IPv4 stability and readiness, when publishers offer both IPv4 and IPv6 0/10 for your IPv6 stability and readiness, when publishers are forced to go IPv6 only</comment>


What Happened When I Wrote a Letter to President Obama (Hint: He Answered) - <AUTHOR> http://thewell.jopwell.com/posts/what-happened-when-i-wrote-a-letter-to-president-obama-rocket-science-boeing-tiffany-davis-georgia-tech/ <comment><USER2> > _(Hint: He Answered)_

How is that a hint.. Feels like "hint" is not the right word to use in this case</comment>


A seismic mapping milestone: Team produces 3-D map of Earth's interior - <AUTHOR> http://exactlyscience.com/archives/11765.html <comment><USER2> Blogspam of

[https://blogs.princeton.edu/research/2017/03/28/princeton- le...](https://blogs.princeton.edu/research/2017/03/28/princeton-led-team- produces-3-d-map-of-earths-interior/)

Original has detail and links to participating agencies.</comment>


Facebook just kept all password in plaintext (no hashing) - <AUTHOR> https://www.wired.com/story/facebook-passwords-plaintext-change-yours/ <comment><AUTHOR> I sort of remember they asked me how to authenticate users when they interviewed me (of course the answer is to store and compare the hashes on the password).

Besides the security implications: isn't it faster to compare hashes rather than having to compare strings? (the hash computation can be done in the browser) It is also easier to store a hash field rather than passwords (hashes are fixed size whereas password strings are variable size); so why would they be doing something like this?

</comment><comment><USER2> that is an unbelievable thing.</comment>


Google's Real Problem – GTD? - <AUTHOR> http://gigaom.com/2010/10/31/google's-real-problem-–-gtd/ <comment><USER3> I think Google still attracts "algorithms & textbooks" sorts of software engineers. I don't see how it would be as attractive to the kinds of engineers that want to create products and businesses, and have a lot of power and control and freedom over what they're doing. I keep hearing about how one of the attractions of working for Google is knowing that your code will be used by millions of people, and run on thousands of servers, etc. You know what? I could give a shit. In reality, you will most likely only be writing a very small portion of the system the endusers will interact with. I'd rather write _the entire system_. And would you care inherently about how many machines it will run on? Personally I care more about creating lots of cool products that real people use, that make me money (ideally, a ton of money), and honestly, I don't really care whether it's running on millions of servers or merely a single or a dozen machines. Whatever. I also don't necessarily care about working with other "smart" people, at least as Google defines them. I do care a heck of a lot more about making new stuff, and learning new stuff, and getting to apply it, especially closer to the bigger picture end of the spectrum, and the product or business level of abstraction.

As a user of Google's services, I love 'em.

As a potential employee -- totally not interested and hard to see the attraction.

<comment><USER4> Don't be so eager to give up on working with "smart" people - it sure beats alternative!

<comment><USER5> That was why my phone interview with Google turned me off to it... the interviewer and the recruiter had different DAYS on their schedules to talk to me, and the interviewer proved to be... well, not exactly the sharpest tack in the box. Or he wasn't paying attention, because he asked me questions that I had already provided answers to...

(Him: Wait, how will you swap those two entries? You can't just move them back and forth. Me: using the "swap" function that I described immediately after you described the problem?)

</comment></comment></comment><comment><USER6> I find it always somewhat odd when a person with only superficial knowledge about a topic (e.g. "Google", "Apple" etc) claims to be able to spot their "Real Problem" or their "Biggest Issue". While the article might be a well- reasoned guess, it is still just a guess, based on a very small number of facts.

I could have taken the article seriously if it had been written by a former employee, or by someone who actually interviewed people working at Google. But that way, the title seems to be just link bait. Nothing against link bait, but above all, the essential purpose of a title is to reflect the content, isn't it?

"My personal quick guess about a problem at Google: GTD" would have been a more honest title. It wouldn't be as sensational, but it would at least reflect the real substance of the article.

<comment><USER7> Supporting evidence for the author's thesis:

"So we're adding a new process to our existing review system, in which every engineering project leader will be required to maintain a privacy design document for each initiative they are working on. This document will record how user data is handled and will be reviewed regularly by managers, as well as by an independent internal audit team."

This sounds awfully like the dreaded reviews (security, perf, globalization, internationalization, accessibility, etc.) at MSFT that gobbled up the time of PMs + devs. That's not to say that Google shouldn't have privacy design docs, just that they're an unfortunate consequence of scale.

Quote from [http://googleblog.blogspot.com/2010/10/creating-stronger- pri...](http://googleblog.blogspot.com/2010/10/creating-stronger-privacy- controls.html)

<comment><USER6> In how far does this affect the criticism?

Even if GTD was a real issue with Google, how will the author know that they don't have much bigger issues?

</comment></comment></comment><comment><USER8> I think inertia is a problem that all organisations face, eventually. It's really hard work to keep a company flexible, professional and profitable as it grows.

Given time, Facebook will have this issue. Your company will have this issue. Beauracracy grows organically unless you keep paring it back, especially if you hire people who are afraid of taking risks, and many people are.

<comment><USER9> I don't think that is what the OP is saying.

The problem is not associated with risk taking but its opposite - <USER2> things after the primary risk has been tackled. I have no idea what happens inside Google, but as a user of their products I am often shocked (given their resources) at the lack of polish, at the seeming unwillingness to tackle that infamous last 20% that takes the 80% of the time. I can only assume this is policy of some sort since it is so pervasive.

In my experience running software projects, getting things done (as in DONE DONE) is a skill that is loosely correlated with sheer smarts if at all. The best project managers/geek herders I know could never survive a technical interview with Google, but they have this ability to focus things so it all clicks together. I have always wondered whether Apple is the kind of company that seeks those kind of skills.

As an example, think of some hyper competent PAs - they might not have higher degrees in mathematics, but they have an uncanny ability to create order out of chaos. Good software project managers are like that - the eye of calm in the storm of smartness.

If you are the kind of person who is bothered on a personal level by unfinshed stuff (what some personality analysts call a "completer finisher"), I can imagine working at a place where the organization is always on the lookout for the next shiny could be very frustrating. That could be plausible reason for these departures, though that is only speculation.

<comment><USER10> I think it's down to designing an interview process that minimizes the chance of bad hires which has been written about before. The qualities you mention and more subjective and thus there is more chance someone hired based on those qualities could be a bad hire.

<comment><USER9> I agree that it is hellishly difficult to hire for that kind of GTD ability. However I put it to you that if you have 25,000 employees, you must have fluked some of these personality types even with just technical interviews. Ergo if these people are not being leveraged, it says that your culture does not value those skills, and that you have some very frustrated people.

</comment></comment></comment></comment><comment><USER11> Misleading title: GTD generally refers to a productivity management system; the article doesn't actually refer to the system in any way.

<http://en.wikipedia.org/wiki/Getting_Things_Done>

<comment><USER12> Thank you. I was hoping someone would bring attention to this. Complete misuse of "GTD."

</comment></comment><comment><USER13> As an outside observer Google appears to slow down on the development of new projects very noticeably. Why hasn't Google Docs been evolving at the rate a company with the resources of Google can afford?

<comment><USER14> When have great resources ever helped rapid evolution in computing?</comment></comment>


Zealandia: Earth's Hidden Continent - <AUTHOR> http://www.geosociety.org/gsatoday/archive/27/3/abstract/GSATG321A.1.htm <comment><USER2> [https://en.wikipedia.org/wiki/List_of_tectonic_plates](https://en.wikipedia.org/wiki/List_of_tectonic_plates)

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

</comment><comment><USER4> Australia is already the weakest continent. And unless, from that figure, we're also making Arabia-landia, India-landia, etc. continents as well...

"Stop trying to make <Zealandia> happen. It's not going to happen." -Regina George</comment>


India Launches Chandrayaan-2 Moon Mission on Second Try - <AUTHOR> https://www.nytimes.com/2019/07/22/world/asia/chandrayaan-india-moon-launch.html <comment><USER2> This is great! Success here would show how much is possible with $146MM and encourage others to invest in space exploration as well. India's space program, ISRO, put a satellite into Mars orbit in 2014 for $73MM.

Reuters article: [https://in.reuters.com/article/space-exploration-india- moon-...](https://in.reuters.com/article/space-exploration-india-moon- idINKCN1UH0WC)

<comment> T-A > Success here would show how much is possible with $146MM

… when you're paying Indian salaries. I'm pretty sure that paying NASA, ESA or JAXA engineers less than 12k USD/year [1] would result in exactly 0 of them staying on the job.

[1] [https://www.glassdoor.com/Salaries/india-aerospace- engineeri...](https://www.glassdoor.com/Salaries/india-aerospace-engineering- salary-SRCH_IL.0,5_IN115_KO6,27.htm)

<comment><USER3> You can always outsource your rocket launches to India to benefit from these low, low costs :)

<comment> T-A According to Table 4 in [1], a GSLV launch was $47 million in 2017, so a bit lower than e.g. a Falcon 9 launch ($61.2 million in the same table).

Taking the $146 million quoted above at face value, that means 2/3 of Chandrayaan-2's cost was independent of launch cost. Let's say about $100 million.

Another comment here is implying that those $100 million do not include labor. I find that hard to believe; it is (or should be) common knowledge that the bulk or aerospace project costs is labor [2], so it would make no sense to forgo standard accounting practice and only report what amounts to a bill of materials. But if we nevertheless assume that comment is correct, it would mean that you should _at least_ double the estimated cost for developing something equivalent to Chandrayaan-2 at developed-country aerospace salaries. So you would be (optimistically) spending something like $200 million on the probe, and saving maybe $15 million out of a total cost ~ $250 million by launching it from India rather than e.g. the US.

Once the added administration and logistics costs are taken into account, I wonder if you would be saving anything at all.

[1] [https://www.gao.gov/products/GAO-17-609](https://www.gao.gov/products/GAO-17-609)

[2] Aerospace project management handbook (2017)

</comment></comment></comment></comment><comment><USER4> Great news on the launch. But it ain't over till the land rover starts transmitting, so to speak. This will orbit earth for a bit till the moon snags it into its own orbit, and then it lands on the moon in September.

<comment><USER5> Yes, Chandrayaan-1 already crash landed on moon once. The new part of this mission is soft landing for a rover, which will only happen in early September.

<comment><USER4> Chandrayaan-1 operated for 312 days and seven years later it was found still circling the moon [1]. The Moon Impact Probe (MIP) crash-landed on the moon, possibly by design.

[1] [https://edition.cnn.com/2017/03/10/health/nasa- chandrayaan-s...](https://edition.cnn.com/2017/03/10/health/nasa-chandrayaan- spacecraft-found/index.html)

</comment></comment></comment><comment><USER6> I just feel that headline is not accurate. It seems to be suggesting that first try failed, when it was actually aborted.

<comment><USER7> Nytimes does that fairly often. Theres always an undertone of negativity about Indias space program. But they're just responding to market needs cant really blame them.

<comment><USER8> >> But they're just responding to market needs

you don't seem to have journalism high in you r opinion

<comment><USER9> I doubt Journalists hold present-day journalism in high opinion.

NewYrokTimes is perhaps the biggest offender who gets away with this. All I can say is after reading Noam Chomsky's Manufacturing Consent, I can never trust NYT.

<comment><USER8> 100 agree. Although rather unclear, my comment was hinting at the fact that even if we all think that journalism is not what it used to be, cynicism shouldn't win over idealism...

</comment></comment></comment></comment></comment><comment><USER10> For those interested, this video succinctly explains the entire Chandrayaan-2 Moon mission: [https://www.youtube.com/watch?v=LhWK_pZrXl4](https://www.youtube.com/watch?v=LhWK_pZrXl4)

</comment><comment><USER11> How about any of the following headlines.

India Launches Chandrayaan-2 Moon Mission after brief delay.

India Launches Chandrayaan-2 Moon Mission after a week's delay.

India Launches Chandrayaan-2 Moon Mission.

<comment><USER12> no buddy that's not how bbc,nyt or aljazeera works for india.

they will always say 'india did this good but naah there was something' lol

i feel bad for these type of depressed people who always push salty stuff

</comment></comment><comment><USER13> It's spectacular, if I read correct they used a technology Which Israel has failed to use to land successfully on moon. I might be wrong, feel free to chime in.

<comment><USER14> Where did you read this? It didn't mention this in the linked article.

By technology, if you mean rockets, then yes every country uses rocket technology to escape earth's gravity.

<comment><USER15> No bro, this guy talks in broad sense only.

</comment></comment></comment><comment><USER16> I expected such headlines from BBC, but not the NYT. Surprisingly, the BBC headline was much better than this one.

<comment><USER12> bbc headline was better because there was a feminine angle. 30% of isro people are women. and two women were commanding this isro. so they can't speak negative even if they has to.

since american media don't do research they followed good old negative path. altho to be fair some of american media is honest but you gotta follow them otherwise google won't tell you about their positive stuff.

</comment></comment><comment><USER17> What happened to first one?

<comment><USER2> This is the problem with the headline. Launches get delayed, rescheduled, aborted, cancelled for many reasons. This mission has had launch dates moved around several times over the last couple years. This headline is referring to having the launch aborted about a week ago.

</comment></comment><comment><USER18> Apart from using almost 95% of homegrown technologies, One high feat is that the entire mission cost around $141 million which is half the cost of Latest Avengers Movie..

<comment><USER13> I want to know how did they acquire this technology. I've heard china simply steals technology (or atleast accused of stealing by western media), but what about india, does India too steals technology or what exactly is their process to get the technology they need?

Are these scientists working for Isro previously worked for other organizations like NASA where they acquired know how from?

And if it's really homegrown technology, then why we haven't seen better phones or drones or 3d printer or whatever new, coming out of India?

Or does it mean, in India innovation which is not supported by government, doesn't take off?

Not sure why I am being downvoted , I asked this question in good faith.

<comment><USER19> Why are you assuming that Indian scientists and engineers cannot develop things themselves? That is bad faith.

<comment><USER13> Chinese scientists and engineers can also develop things themselves, then why are they accused of stealing technology often? If something is possible doesn't mean it's the best option they've on hand.</comment></comment></comment></comment>


Style, hand pick & download icons for your project - <AUTHOR>

At www.iconbench.com you can style icons before you download them. <comment><AUTHOR> Thanks man ! fixed !

</comment><comment><USER2> throws a JS alert dilaogue when try to signup</comment>


14% of U.S. Adults Can't Read (63% of Prison Inmates) - <AUTHOR> http://www.livescience.com/culture/090110-illiterate-adults.html

<comment><USER2> Of course, the headline is misleading- It should read "14% of U.S. Adults Lack Basic Prose Literacy Skills"

Even then, I had a hard time finding meaningful info on exactly what constitutes "BPLS", beyond some vague statements in the article. If someone can find some sample questions from this "BPLS" test, please comment on this thread.

The little I could find out about BPLS on a brief Googling suggests that a person that can read given the conventional definition of "reading" can still fail a "BPLS" test relatively easily.

</comment><comment><USER3> More information here:

<http://en.wikipedia.org/wiki/Literacy_in_the_United_States>

 _A five-year, $14 million study of U.S. adult literacy involving lengthy interviews of U.S. adults, the most comprehensive study of literacy ever commissioned by the U.S. government, was released in September 1993. It involved lengthy interviews of over 26,700 adults statistically balanced for age, gender, ethnicity, education level, and location (urban, suburban, or rural) in 12 states across the U.S. and was designed to represent the U.S. population as a whole. This government study showed that 21% to 23% of adult Americans were not "able to locate information in text", could not "make low- level inferences using printed materials", and were unable to "integrate easily identifiable pieces of information."_

<comment><USER4> Wow. That doesn't sound like it has much to do with reading, specifically. Frankly, it's more like saying "nearly 25% of Americans are well below average intellectually", which doesn't even seem very remarkable if the top of the curve isn't especially flat.

<comment><USER5> You should be careful switching between absolute and relative statements.

</comment></comment></comment><comment><USER6> Well -- not quite as bad as it sounds. 25.5 million people living in America are both foreign born and don't speak English at home. Roughly 85% of them are adults, and roughly half of them (I am going to say probably skewing towards adults) report that they have difficulty with English.

Which if we do the math is something like 3% of the US population not being able to read English primarily because they're not able to speak it. Bad news for them, but the reasons for their problem (and the solutions to address it) are pretty different than for the rest of the illiterate population.

See official Census data:

[http://www.census.gov/population/cen2000/stp-159/foreignborn...](http://www.census.gov/population/cen2000/stp-159/foreignborn.pdf)

<comment><USER3> From the first reference link at the Wikipedia link I gave earlier:

<http://nces.ed.gov/pubs93/93275.pdf>

 _In considering the results, the reader should keep in mind that this was a survey of literacy in the English language — not literacy in any universal sense of the word. Thus, the results do not capture the literacy resources and abilities that some respondents possess in languages other than English._</comment></comment>


Showing impossible to understand Javascript: Obfuscated Quine - <AUTHOR> http://oim.ae/nL9Yie

<comment><USER2> Why does it only work in Chrome?

<comment><USER3> 1\. Function to String conversion produces different results in different browsers.

      var f = []['concat']; (f + '');
      // Chrome
      "function concat() { [native code] }"
      // IE (9)
      "
      function concat() {
        [native code]
      }
      "

This script tries to extract letters from that string representation, which fails if the string is different. (This is also used as an anti-debugging measure in some JS malware, to prevent researchers from replacing document.write with alert() or similar.)

2\. Iterating over the window object doesn't work the same way in IE: [http://blogs.msdn.com/b/ericlippert/archive/2005/05/04/41468...](http://blogs.msdn.com/b/ericlippert/archive/2005/05/04/414684.aspx)

In particular, this script tries to extract strings 'sessionStorage', 'getComputedStyle', 'onchange' by iterating over the window object, all of whom fail in IE.

<comment><AUTHOR> Good job on figuring it out! Thanks for spending the time.

</comment></comment></comment><comment><USER3> Nice trick!

      var f = []['concat']; // Array.prototype.concat
      f()[0]; // returns the global window

The rest of the script appears to mostly be old tricks - convert stuff to strings, combine characters in strings to compose expressions, pass them to eval...</comment>


Giant Plumes of Oil Forming Under the Gulf - <AUTHOR> http://www.nytimes.com/2010/05/16/us/16oil.html

<comment><USER2> It's interesting how little we know about some of this fluid-mixing stuff still, despite the basic principles being centuries old, and simple versions of the experiments being standard school experiments. I guess they're complex enough that there's huge ranges of stuff where we don't have good enough theoretical models, so only know what's been experimentally measured? In this case, it was surprising to me for some reason that it's unknown how dispersants will function at mile-deep water pressures; surely there's some sort of model for that? Or is it just that we're not confident in the model?

Vaguely related, I ran across recently that apparently scientists don't yet fully understand the effect that makes drinks like ouzo and absinthe get cloudy-white when you add water, due to some sort of stable oil/water emulsion being produced: <http://en.wikipedia.org/wiki/Ouzo_effect></comment>


Small Memory Software: Patterns for systems with limited memory - <AUTHOR> http://www.smallmemory.com/book.html <comment><USER2> The one thing that I was strongly expecting but didn't seem to find any mention of when I was quickly paging through is the idea of using simpler, constant-space algorithms (e.g. streaming style, keeping only what's needed in memory) and in general _reducing the amount of code and data_.

Likewise, the use of C++ and Java in a book about "limited memory" is a bit unusual.

Then again, I'm _really_ not keen on the whole "patterns" thing, because from experience I've found it tends to replace careful thought with dogmatic application of rules that might not be relevant at all to the situation at hand.

<comment><USER3> Why is C++ not good? It doesn't grow memory usage on its own. If you can put C code on something, you can do C++ as well. We're talking about things up to 10 MB. It's perfectly fine on those. (actually the smaller your target, the less difference there is - you don't really have to care about APIs or calling conventions on an 8K chip)

Java has many different versions. For example the smallest one (JavaCard) can run on tiny chips in smartcards, so Java as a whole may be a bad generalisation, but it's definitely possible.

<comment><USER4> You can write C++ code that works like an equivalent C program, but that code also looks like the equivalent C program -- only with slightly less modern syntax.

Writing good, modern C++ means using the external template libraries and all kinds of (relatively) heavyweight goodies. The trouble is it's difficult to predict the space cost of those goodies -- so on systems where that matters it's just easier to think in terms of C.

<comment><USER5> Regardless of if you're coding in C or C++ for micros, you're not going to be using much, if any, of the standard library anyways. You'll probably be rolling your own routines for a lot of stuff because so many libraries, even those for micros, are rather oversized for when you're truly constrained.

I've used templates in C++ libraries for the purposes of varying memory constraints and mcu capabilities. Being able to write a library once and deploy it on 8 bit and 32 bit chips without FPUs and chips with fpus means saving a lot of time, and it writes code that's just as efficient. Finally, a lot of C/C++ compilers for small devices have routines to give a pretty good guess as to how much RAM your code's going to need, so you can figure out ahead of time if a routine is really worth it.

</comment></comment></comment></comment><comment><USER6> I realize that small memory discipline is not something that serves a modern programmer well. Spending time on optimizing memory usage is often completely useless as a new version or new feature will invalidate the effort and the overall effect on the system, compared to other work the programmer could be doing, would not be cost effective.

That said, understanding how to design in tight memory constraints is useful. While typically only seriously practiced by embedded systems developers, having habits that minimize memory use can have a large impact at scale. The paper gives some good reasons on what the benefits of those habits are, but I also think that, as a percentage of the total, programmers living in constrained memory spaces are a specialization not the mainstream any more.

<comment> awinter-py We're not living in constrained memory spaces on desktop but we sometimes are in the cloud.

In my experience 'small-batch distributed jobs' (~5 machines) are often candidates for memory optimization. Especially if written in high-level languages without easy access to struct packing.

<comment><USER7> I think we _are_ living in memory constrained spaces on the desktop. For some time now I have found the impetus for upgrading to a new computer has been to gain more RAM. More RAM usually requires changing RAM/DIMM type which necessitates new Motherboard and therefore new CPU. It has been that way since I had a 8 Meg machine.

It boggles me that a machine that could hold six hundred uncompressed 1080p video frames is my most memory constrained computer.

<comment><USER8> For what it's worth, I've had the opposite experience throughout my life. I've never actually upgraded to the physical/motherboard memory limits before I end up buying a new motherboard anyway when changing CPU sockets.

</comment></comment></comment></comment><comment><USER9> At least this serves to remind people they must think about memory, at least sometimes. The rule today seems to be to use as much memory as possible, load gigantic frameworks or use super-heavy languages for the most simple of tasks. I only notice because my computer do not have all the memory a normal modern computer has.

<comment><USER10> How many memory does your computer have?

I run Gnome and Debian. I looked a bit at the System Monitor. All the standard unix tools (like cron...) are tiny. They only use few Kb. They big consumers are gui related and the heaviest is Firefox with 500 Mb. I have 4Gb of ram.

<comment><USER9> I have 1GB, but yes, all system tools are tiny. Browsers are heavy. Chrome was very light until some time ago, but now it is as heavy as Firefox.

Some webpages are use a hell lot of memory.

But there are big problems with webapps, too. For example, there are small apps that do super basic things and that can't be run on a Heroku free dyno. Mainly those written with Ruby on Rails, I guess -- like Discourse, and other small apps I've seen, but I've seen others.

<comment><USER11> Have a look at ublock vs adblock plus comparison featured yesterday: [https://news.ycombinator.com/item?id=11277135](https://news.ycombinator.com/item?id=11277135)

</comment></comment></comment></comment><comment><USER12> I've owned the print version of this book for many years; it's like the GoF book for embedded systems. Solid material presented very well. Kudos to the authors for releasing the PDFs!

</comment><comment><USER13> Chapter 2 is basically a textbook description of how Android handles memory.</comment>