Super Tiny Compiler - <AUTHOR> https://github.com/thejameskyle/the-super-tiny-compiler <comment><AUTHOR> This is really quite beautifully done. If you're impatient, go straight to the JavaScript code (but the README is worth reading too):

[https://github.com/thejameskyle/the-super-tiny- compiler/blob...](https://github.com/thejameskyle/the-super-tiny- compiler/blob/master/super-tiny-compiler.js)

For someone like me who always goes, "Comments? Meh. The _code_ should be the comments!" it's an eye-opener.

The code has a _lot_ of comments. But not this kind:

      i++;  // Increment i

It's about 200 lines of actual code plus another 500 lines of comments explaining what is going on. And 75 lines of old-school ASCII header art like you used to see on line printers back in the '60s, just to appeal to old- timers like me.

It takes you through tokenizing raw code, parsing the tokens into an AST, transforming the AST into a form the code generator can use, and then generating code from it.

A great example of how to teach a concept with a small amount of code and informative comments.

<comment><USER2> And once you understand the basics, you can move onto something more interesting like this _self-compiling_ compiler:

[http://homepage.ntlworld.com/edmund.grimley- evans/cc500/](http://homepage.ntlworld.com/edmund.grimley-evans/cc500/)

This one is fun too, since it contains both a bytecode compiler and its interpreter VM:

[https://github.com/rswier/c4](https://github.com/rswier/c4)

(Previously discussed on HN at [https://news.ycombinator.com/item?id=8576068](https://news.ycombinator.com/item?id=8576068) and [https://news.ycombinator.com/item?id=8558822](https://news.ycombinator.com/item?id=8558822) )

I think a Lisp compiler isn't quite as interesting for beginners as something that handles the more usual syntax with precedence etc., since it's so trivial that it leaves the "how does a 'real' compiler parse" question unanswered.

In that respect, I would suggest beginning with a simple recursive-descent parser that can handle the usual maths expressions - then extending it to e.g. all the operators in a C-like language is not a huge leap (table-driven precedence-climbing can be derived from recursive descent and makes this much easier), and it also leads to the opportunity for a compiler that can parse and compile itself - unless you are also writing the compiler in Lisp.

The AST stuff can come later; with expressions, the parser can perform evaluation as it parses, which gives the opportunity to write a calculator. Generating an AST is just replacement of evaluation with creation of tree nodes.

IMHO "it can compile itself" (as well as other non-trivial programs) is a good goal, and really makes people pay attention because it dispels the notion that compilers are somehow "magic".

<comment><USER3> > In that respect, I would suggest beginning with a simple recursive-descent > parser that can handle the usual maths expressions - then extending it to > e.g. all the operators in a C-like language is not a huge leap (table-driven > precedence-climbing can be derived from recursive descent and makes this > much easier), and it also leads to the opportunity for a compiler that can > parse and compile itself - unless you are also writing the compiler in Lisp.

I'd suggest starting with a Top Down Operator Precedence ("Pratt") parser, they're beautiful magic for the working man, highly declarative and slightly mind-bending in that they seem so simple they shouldn't work, they make expressions with infix priority a _joy_ to handle.

<comment><USER2> TDOP, Pratt, precedence-climbing, I think they're all referring to the same, if not extremely similar, method of using a loop in the main recursive function that compares precedences and decides whether to recurse or loop:

[https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing](https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing)

[http://javascript.crockford.com/tdop/tdop.html](http://javascript.crockford.com/tdop/tdop.html)

They're definitely very simple, and can be derived by refactoring a recursive descent parser and observing that there's no need to make a chain of nested recursive calls to the right level when the function can be called directly to "jump" to the desired level. The simplicity is probably why it's been rediscovered several times and has different names.

<comment><USER3> TDOP and Pratt are exactly the same thing, Vaughan Pratt is the inventor, Top Down Operator Precedence is the name he gave to the algorithm. And TDOP never "recurses or loops" (the precedence tells it whether it should stop looping). Part of the interest is how object-oriented it is, the main parsing loop ("expression" in the Crockford article) just tells a token "parse yourself as prefix" or "parse yourself as infix preceded by (AST)"

<comment><USER4> They're the same algorithm expressed in different styles: structured for precedence climbing, and as you say OO or 'data driven' for Pratt.

[https://github.com/darius/sketchbook/blob/master/parsing/pre...](https://github.com/darius/sketchbook/blob/master/parsing/precedence_climbing.py#L29)

[https://github.com/darius/sketchbook/blob/master/parsing/pra...](https://github.com/darius/sketchbook/blob/master/parsing/pratt.py#L13)

</comment></comment></comment></comment></comment></comment><comment><USER5> If you don't need something as super-tiny, but don't want to go all-out Dragon book, Niklaus Wirth has released an updated copy of his classic "Compiler Construction" for free, now targeting a subset of his Oberon language. All in 130 pages. No fancy functional methods aimed at a language high in the Chomsky hierarchy, but all the basics are there. (I consider it one of IT's biggest losses that we don't follow Wirth more, go notwithstanding)

[http://www.inf.ethz.ch/personal/wirth/CompilerConstruction/C...](http://www.inf.ethz.ch/personal/wirth/CompilerConstruction/CompilerConstruction1.pdf)

<comment><USER6> I second that reference. Side benefit is there's compilers, useful code, and a whole OS with great docs to experiment with afterwards.

</comment></comment><comment><USER7> Really great work. Thumbs up.

As an experienced programmer who only recently got into compilers, I have a few, open ended, somewhat advanced, questions about the transformer phase (for anyone to comment, thanks in advance).

It appears to me that the transformer is like the guts of the compiler, everything else is more like support system. And more often than not, the purpose of transformation ends up being 'optimization', but of course you could do transformation for other purposes. However this phase ends up being very hairy logic if the programmer is not careful.

Anyway, my questions are:

\- is there any consensus on creating a DSL for providing transformation rules instead of hand coding them in the programming language?

\- There is the nanopass compiler framework in scheme [0]. Is that one of the superior ways of doing things? or are there any serious criticisms about that technique?

\- Is there a relationship between compiler transformations and 'term- rewriting systems'?

\- OMeta/OMeta2 pattern matching on context-free-languages?

Whether it's nanopass-framework, OMeta2, term-rewriting system, or some other DSL, I guess what I'm trying to get at is how can that phase be made more 'formal', so I guess at this point we get into the area of 'formal systems' and 'formal semantics' etc, etc.

I would appreciate if there is recommended reading (books, survey papers, etc) on this topic.

[0] [https://github.com/akeep/nanopass- framework](https://github.com/akeep/nanopass-framework)

<comment><USER8> Here's one data point:

* Automatic Generation of Peephole Superoptimizers: [http://lambda-the-ultimate.org/node/2800](http://lambda-the-ultimate.org/node/2800)

</comment></comment><comment><USER9> Jon Harrop had an article in the F# Journal a while back where he wrote an x86 JIT compiler for a small functional language in about 200 lines of code. It could express Fibonacci programs, and the compiler's performance beat the equivalent F# program on that toy benchmark.

I think the article itself is behind a paywall, but it looks like he put a similar version of the code on Github: [https://github.com/jdh30/FSharpCompiler/blob/master/FSharpCo...](https://github.com/jdh30/FSharpCompiler/blob/master/FSharpCompiler/FSharpCompiler/Tests.fs)

</comment><comment><USER10> As an aside, I've noticed that some modern compilers (Go and Clang are the ones I've studied recently) bundle the tokenization phase and the lexing phase into a higher-level lexer. Which is to say that instead of, say, turning a token pair (PUNCTUATION, "&&") they produce (LOGICAL_AND, "&&"), for example. It makes sense, but surprised me, since if you look at classical compiler books, they generally promote the more formal two-level pipeline of tokenization before lexical analysis.

</comment><comment><USER11> It's well written. It's clever. The comments style does a great job of explaining the concepts.

My only gripe is, although translating one high level language (lisp) to another (c) is _technically_ a compiler, in practice most people think of something producing output at a lower level of abstraction than the input.

This would be even neater if it could emit assembly.

<comment><USER12> I get your point and agree about assembly, but I also think most people would agree that C _is_ a lower level of abstraction than LISP.

One reason to "stop" at C might be that assembly itself tends to be a bit verbose, so not very suitable when aiming for shortness of code as a major feature. Generating assembly would perhaps obscure the things being taught with a bunch of details that are of course interesting, but sort of beside the point. Just guessing, I'm not the original author of course.

<comment><USER11> I take your point as well.

I guess I'm coming at this as a novice with a recent interest in compilers. I was working through a tutorial series for writing a compiler in Go, but it got frustrating when I realized the author's example language wasn't going to output anything lower than C.

I've since found a series that does show how to output to assembly (68000 no less) and I'm finding it much more rewarding.

<comment><USER13> I see the educational value in building a compiler to C if you want to introduce people to parsing, AST transformations, visitor pattern etc.

But a lot of interesting parts about a compiler are lost when you compile to a high-level language instead of machine code: code selection (to a large extent), register allocation, operation scheduling.

Doing a compiler _backend_ right is much more challenging than doing a compiler frontend right, which is why tutorials usually skip it, and also why people are so grateful for LLVM, which gives a common compiler backend for about every platform imaginable.

<comment><USER14> Right - all these compiler tutorials, and many compiler textbooks are about the front-end only. The back-end is where all the fun and magic is.

</comment></comment></comment></comment></comment><comment><USER15> Here's the same thing in Haskell, using Parsec

        stmt = fmap (++ ";") expr
        expr = call <|> lit
        call = fmap
               (\(fn:args) -> fn ++ "(" ++ intercalate "," args ++ ")")
               (between (str "(" >> spaces) (str ")" >> spaces) (many1 expr))
        lit = (many1 digit <|> many1 letter) <* spaces

<comment><USER16> With enough libraries, everything fits into a few lines. How big is Parsec itself?

<comment><USER17> The answer to your question is "Not really _that_ big": 3.5kloc with comments/whitespace and 1.6kloc without.

Your point is valid that much of this is the library's doing, but I think more of the difference than you're letting on is just from how well-suited functional languages are to this sort of work compared to dynamic scripting languages. Parsec is practically a Haskell standard library, anyway; I wouldn't discount it any more than I would discount using Node's buffer or stream module.

</comment></comment></comment><comment><USER18> In my opinion, the core function "compiler" \-- is absolutely beautifully written (The crowning gem of this well-written compiler).

It's abstract without being too abstract (exactly the right level of abstraction), and it's a model of simplicity, comprehensibility (especially for people new to compilers), and elegance:

function compiler(input) {

      var tokens = tokenizer(input);
      var ast    = parser(tokens);
      var newAst = transformer(ast);
      var output = codeGenerator(newAst);

      // and simply return the output!
      return output;

}

In short, a great starting point (especially for beginners) to conceptualize and subsequently delve into the depths of what goes on in a compiler.

An A+ and Two Thumbs Up for your efforts. The teaching potential of this compiler (which is always what I'm looking for in compilers) is huge!

<comment><USER19> Isn't this exactly what functional programming people have been harping on about for decades now?

</comment></comment><comment><USER20> One small suggestion to make it more friendly for the casual reader. Include input and output for every step.

I want to see what the final output is...

<comment><USER21> Author here, you could look at the test.js file in the repo.

I want to make an interactive tutorial for this in the future that should hopefully be even more helpful

</comment></comment><comment><USER22> Nice, but it needs to say up front what it does (i.e., compile a Lisp-ish PL to a C-ish PL).

EDIT. After a bit of analysis:

The _lexer_ is basically a state machine. Each kind of token consists entirely of characters in a single class, so the usual state machine is modified to give some states a while loop that goes through characters until the token ends.

The _parser_ is basically recursive-descent. The grammar is awfully simple, so only one parsing function (walk) is needed.

The _transformer_ traverses the AST, identifies function calls, and produces a new AST with function calls marked. I'm not sure why the transformer is written as a separate piece of code. It seems to me that the functionality it adds could easily be integrated into either the parser or the code generator. And then the compiler would be even tinier.

And the _code generator_ traverses the transformed AST and spits out C-like code.

</comment><comment><USER23> Thanks! I was just telling people yesterday that I have decided to learn more about either compilers or operating-systems. You made my choice easier, I am going with compilers by studying the Super Tiny Compiler :)

<comment><USER13> So next week, I'd like to see a "Super Tiny Operating System" on the frontpage.

<comment><USER16> It's called Oberon.

</comment></comment></comment><comment><USER24> Honestly isnt that the perfect example how a lot of comments make code actually way less readable?

The code is pretty cool tho :)

<comment><USER21> I added a separate file without any code comments as well.

[https://github.com/thejameskyle/the-super-tiny- compiler/blob...](https://github.com/thejameskyle/the-super-tiny- compiler/blob/master/super-tiny-compiler-unannotated.js)

<comment><USER24> Thanks for taking the critic serious. I didnt ment to make you do this tho. I was just pointing something out.

I dont think there is a thing like to much comments when you explain something in a way that even noobs should understand.

Your presentation software btw is damn cool.

</comment></comment></comment><comment><USER25> For a more advanced but still very approachable JS example check out the lexer and parser in the GraphQL code base ([https://github.com/graphql/graphql- js](https://github.com/graphql/graphql-js))

</comment><comment><USER26> I have been working slowly through Sestoft's _Programming Language Concepts_ , and through that I wrote a tiny interpreter in F# of a mini Forth-like language: [http://ideone.com/24I5y0](http://ideone.com/24I5y0)

Inspired by this though, I decided I'd try re-writing it into a compiler for it instead, targeting the MicroMini VM[0], and here it is: [http://ideone.com/czXhoM](http://ideone.com/czXhoM)

[0] [https://github.com/jarcane/MicroMini](https://github.com/jarcane/MicroMini)

</comment><comment><USER27> This is a great read and motivates me to create DSLs for everything. That being said, can anyone recommend one or more of their favorites references for creating DSLs? If it is relevant, my target audience are researchers in healthcare.

<comment><USER28> I've collected some compiler resources on Github. There are a couple other small C compilers, for example.

[https://github.com/melling/ComputerLanguages/blob/master/com...](https://github.com/melling/ComputerLanguages/blob/master/compilers.org)

</comment></comment><comment><USER29> Before this I could never read and understand any compiler/interpreter code in one sitting.

This is so simple and elegant, that with one reading I could understand it very clearly. (Albeit it covers a very small, simple language)

</comment><comment><USER30> Thank you. This was a very informative read indeed. I'm currently in the process of rewriting a hobby compiler[1] that I hacked together over a year ago. This time I wanted to do it properly, and hence have been scouting on the web for a short, concise and to the point, tutorial that briefly explains most of the important concepts that I need to know be for I begin. This was exactly that tutorial.

[1]: [https://github.com/runarberg/ascii2mathml](https://github.com/runarberg/ascii2mathml)

<comment><USER31> You should take a look at Bison - [http://www.gnu.org/software/bison/](http://www.gnu.org/software/bison/) \- it takes a while to understand how to use it, but is well worth the effort.

<comment><USER32> Having used Bison as well has my own hand-written compilers, I personally would suggest that Bison is _not_ worth it. With recursive descent, you end up writing the same BNF structure anyways, but you don't have to fight the Bison file structure just to decorate the tree and you can much more easily work around syntax errors.

<comment><USER33> Whether one uses a parser generator's output as part of a compiler is one thing, but one should at least pass the grammar of the language through a parser generator to let it check the grammar for ambiguity.

</comment></comment></comment></comment><comment><USER34> Does this also count? It's approx 50 lines: [http://tinyurl.com/oofj8mz](http://tinyurl.com/oofj8mz)

</comment><comment><USER35> Everything is awesome about this even the logo.

Somebody knew what they were doing when they geared this towards the kind of people that inhabit sites like HN.

Good job. :)

</comment><comment><USER36> I am not sure what's super tiny about this one, is it the language that it supports?

From the title, I had expected a contender to [http://tinycc.org/](http://tinycc.org/) or [http://ioccc.org/years.html#2001_bellard](http://ioccc.org/years.html#2001_bellard)

</comment><comment><USER37> As someone just starting out on their first pet language, this is an amazing resource. I've already read a book on the subject and I think I learned more reading this than the book.

It makes me second guess my choice to use a parser generator (PEG.js) which I don't fully understand yet, this makes it seem simple enough that I could write my own.

Thanks so much for this resource!

</comment><comment><USER38> Interesting enough today I was thinking if we have an AST of a program we could have tools that apply semantic analysis like ownership in rust and achieve the same benefits of it in any language.

Does someone know any already existing tool like this ?

Cheers !

<comment><USER39> LLVM. Easiest way to write your own compiler pass.

However, it's going to be tricky to handle ownership between threads as those are not intrinsic to most languages and therefore not native for the compiler, instead they are just a call to a linked in function (fork/clone/pthread_create/std::thread). Compilers for are unaware that the function actually invokes a system call which performs 'odd' (spawning a new thread) behaviour for a function. So in order to have some notion of 'ownership' by a thread you'd need to recognize all different ways of spawning a new thread for the different operating systems and platforms your compiler should support.

</comment></comment><comment><USER40> I wrote a tokenizer the other day without really knowing what I was doing and it's reassuring to see that it doesn't work that differently from this one.

Anyway, this is very cool.

</comment><comment><USER41> What languages are the input and output? Or is that a stupid question?

<comment><USER21> No stupid questions.. I keep getting similar feedback. I'll do a better job of explaining it.

To answer your question, it's taking a lisp-style syntax and turning it into a C-style syntax (specifically JavaScript- the output AST is actually a valid Babel AST)

        (add 2 (subtract 4 2))

        Into

        add(2, subtract(4, 2))

</comment></comment><comment><USER42> HAHAHAH this is great

</comment><comment><USER43> Brilliant

</comment><comment><USER44> > Possibly the smallest compiler ever

>Run with node test.js

</comment><comment><USER45> should be called "super tiny interpreter"

<comment><USER39> Why? It's not actually interpreting anything, merely transforming (compiling) the lisp-like syntax into c-like syntax without executing it.

</comment></comment><comment><USER46> Why in javascript??? Ugh. Maybe it's great, but javascript sucks and should never be used for a compiler.

<comment><USER21> Hi I wrote the compiler, the reasons for JavaScript are:

\- It was for my conference talk for a JavaScript audience.

\- JavaScript is the language I use for 99% of my work.

\- JavaScript has a much larger audience.

\- I'm a maintainer of a JavaScript compiler ([http://babeljs.io/](http://babeljs.io/)) and I want more people to be able to contribute.

\- JavaScript is totally fine for a compiler.

Also, hating on programming languages is dumb.

</comment></comment><comment><USER47> It's worth pointing out that Lisp is homoiconic, meaning that the code you see has the same structure as its AST, so writing a parser for a Lisp is pretty trivial and is part of the reason why this compiler looks super short. Other languages like C, however...

The "code generator" part of this compiler doesn't do much, since it only translates from one high level language to another, not machine code which would understandably be far more complicated, as other commenters have pointed out.

This is a compiler from an altitude of 50km in the stratosphere, and won't actually teach you much about real world compilers that do so much more under the hood. Sorry to be Mr. Cranky HN commenter (ok, I'm not sorry).</comment>


Effects of Exercise and Physical Activity on Anxiety - <AUTHOR> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3632802/ <comment><USER2> Part that mirrors my own experience:

> _Exposing someone with high anxiety sensitivity to the physiological > symptoms they fear, such as rapid heartbeat, in the context of physical > exercise increases their tolerance for such symptoms (McWilliams and > Asmundson, 2001). This exposure reveals that the feared physiological > sensations may be uncomfortable, but do not pose a serious threat (Ströhle > et al., 2009). Repeated exposures through regular aerobic exercise may also > facilitate habituation to the feared sensations (Beck and Shipherd, 1997)._

When you feel a panic or anxiety attack coming on, your body is going to start feeling "off", and often this will be accompanied with a massive dump of adrenaline. At that point, your brain is looking for a way to justify why it is feeling super alert and anxious, and will do all kinds of shit to justify what is, at heart, a primarily physiological mechanism. If you only ever experience {sweat, heavy breathing, light-headedness, high heart-rate, energy dump, shakes} in the context of anxiety, any single one of those symptoms starts to pattern-match as "oh god here we go again".

By exercising, you show yourself those symptoms in a context that you have control over and you can (if this reasoning is sound) desensitize yourself to them. Additionally, if you find yourself having a state like this, hopping on a bicycle/going for a run/whatever can help both burn the energy/agitation and also satisfy the flight urge you might experience.

I am not a doctor, this was a way of dealing with a temporary spike in anxiety due to severe burnout, your mileage may vary, etc.</comment>


Analyse Asia #15: The Golden Gate from San Francisco to Singapore - <AUTHOR> http://analyse.asia/2015/01/31/episode-15-golden-gate-san-francisco-singapore/ <comment><AUTHOR> Synopsis: We interview Vinnie Lauria (@vlauria), founding partner of Golden Gate Ventures in Singapore. We discuss how Vinnie moved from Silicon Valley to Singapore with his wife Kristine Lauria (our guest on episode 6), the Kauffman fellowship, the back stories behind the most interesting start-ups in Southeast Asia: RedMart, 99.co, Carousell, Bilna and Coda Payments where they have shifted the ground with follow-up investments from Sequoia, Softbank and other major players entering the region. We discuss the challenge in navigating Southeast Asia landscape from legal, infrastructure, payments to talent acquisition.</comment>


Ask HN: What email tools do you use to track opens? - <AUTHOR>

For some outbound email we use Mailchimp, but a lot of first time emails also go out through Gmail. What tools do you use and what are their pros/cons? <comment><USER2> Without trying to hijack your thread, I'm curious exactly HOW opens are tracked by these apps. They seem to stand by them (but they're evil marketing people).

Seems liek they just embed an image in your email. When it loads, they have a unique ID so they know which email was opened. Now, most email apps are starting to block images from displaying by default. Wouldn't this HUGELY skew the open rates? And if these rates are inconsistent (image week 0 default gmail is to open images, week 3 it's turned off... how could you make that comparison?)

So you could have massive swings in open rates due to a specific provider changing their policies. Or any number of other reasons.

So why do you track opens at all? Isn't that metric so inconsistent and inaccurate that it'd be better to track something else entirely?

<comment><AUTHOR> Good point. Spypig likely has the problem of skewed open rates due to image blocking and we chose not to use due to that issue.

Tracking opens for 'cold emails' or even referral-based emails is important but can be replaced with persistence. As long as persistence is constrained with a measure of decency.

I get referrals from the businesses who join our site and use email to initiate outreach to them. I just want to know who's opening versus who's not as it affects what script we use for a follow up phone call.

</comment></comment><comment><USER3> I'm in the middle of deciding which tools to use. Constant Contact, Mail Chimp, and iContact have a lot of the same functionalities. I think there are a few standard functions you need and the rest comes down to how well you like the software's dashboard environment.</comment>


Spring cleaning: Five Google projects that need to die - <AUTHOR> http://arstechnica.com/gadgets/2014/04/spring-cleaning-five-google-projects-that-need-to-die/

<comment><USER2> I checked the list, i would say yes to Orkut because Google is focused on Google+ but i am wondering why quick office and Google Now? Google is aggressive on Google Now they released this in-order to compete with Apple Siri, but best part is Google Now is available to mac & iPhone user if they are using Google chrome. Last but not the least there are project like Google Glass and many other which need to be removed because they are just eating money and resource in my opinion.</comment>


Reddit prepares to launch new news website 'Upvoted' - <AUTHOR> http://www.wired.com/2015/10/no-comments-allowed-reddits-new-news-site-upvoted/ <comment><USER2> > Rather it will post sponsored content paid for and approved by advertising > partners—and written by the same editorial team that writes editorial posts. > "They're going to be just as interesting as actual content," Chang says. "It > could be a piece on Tesla, a piece on how WiFi works, no matter what it'll > be good content—and it'll just happened to be sponsored."

This gives me some disquiet. I realise that this is what advertisers want - high quality ads that can't be blocked, but I think its harmful. In general, I avoid going to sites that have a policy of doing this.

<comment><USER3> I talked to an Australian magazine that will remain nameless where the executive on the other side of the table told me their business model was 100% sponsored content. I couldn't tell, from their website. Every single article was a sophisticated ad. He said they were doing fantastically and growing fast, users wanted that kind of stuff.

It reminds me of Ogilvy's book on advertising [1]; Ogilvy's experience taught him that informative ads that explained the advantages of the product were most successful with customers. Sponsored content is exactly that, and the opposite might be something like clickbait [2].

Sponsored articles are accessed voluntarily by the customer clicking on them and reading them, and returning to the site; they are unobstrusive being mostly made of text and of (relatively) higher editorial quality, with good photography and so on. I wonder if they are the future of advertising.

On the topic of being unable to filter advertorial content from, well, content, I don't think it's as clear cut as ads vs not-ads, since every writer has their own set of opinions and presents their world view only (with few exceptions). A necessary life skill is critical thinking, learning to dissect an argument, examine its assumptions and data, and come to an independent conclusion as to the point it is making.

[1] core principles are summarized in his "house ad": [http://smartonlinesuccess.com/wp- content/uploads/2012/04/dav...](http://smartonlinesuccess.com/wp- content/uploads/2012/04/david-ogilvy-how-to-create-advertising-that- sells.jpeg)

[2] famously (NSFW): [http://www.lazygamer.net/general-news/a-history-of- evony-ads...](http://www.lazygamer.net/general-news/a-history-of-evony-ads- the-insanity-continues/)

<comment><USER4> In Denmark, you are required by law to state if an article is paid content or not. The law extends to both articles in magazines, but also the web, including blogs.

The ads are not only happening in articles, it is also happening on Vine, where companies sponsor videos of popular users:

[http://mashable.com/2014/07/22/sneaky-vine- ads](http://mashable.com/2014/07/22/sneaky-vine-ads)

[https://www.youtube.com/watch?v=2YhqXUekgEc](https://www.youtube.com/watch?v=2YhqXUekgEc)

<comment><USER5> How on earth do they define that? If an advertiser gives me a discount off their product, does that count? What if an advertiser provides a "review copy" of something? What if a company already pays for advertising on my site, and I write about one of their products?

<comment><USER4> It is written like this:

>§4. An advertisement shall be designed, in a way that it will be clearly recognisable as an advertisement of whatever form and whatever media in which it is placed."

If you receive a review-copy you should state that, and if you get a discount you should also write that. I am not sure about if the company already pays for advertisement, but they want to stop hidden advertisements.

Some bloggers have received hefty fines for violating this, but it seems like the readers are more used to the concept now.

<comment><USER6> How does this work in TV programs where there are embedded product placements?

<comment><USER4> It is a mess.

On all Danish produced TV production created after 01/07-2013, product placement is banned. This includes films as well, since they can be broadcasted.

But foreign produced films and series are not included in this, so we can still be able to enjoy James Bond on TV.

The trade association suggested to show a notice in the program, or afterwards, when they used product placement, but it was never put in law, and was it was banned instead.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> As of Tuesday at midnight, here's what you see at [http://upvoted.com](http://upvoted.com): [http://i.imgur.com/KsnPvXN.png](http://i.imgur.com/KsnPvXN.png)

<comment> r-w Could it end up being built on WordPress?

<comment><USER8> Sure. Something to monitor reddit for highly upvoted and interesting content. Once it hits a certain threshold, add the post to WP. Generate the cache entry and you're pretty well set.

<comment> r-w Well, I was commenting in particular on the fact that the site is currently a private WordPress server. The plan appears to be a bit more involved than aggregation, comprising interviews with Reddit OPs and curated articles written by Reddit staff themselves (although they're probably hiring mostly new people to work on that).

</comment></comment></comment></comment><comment><USER9> Almost no mention of it on Reddit prior to this story [0] aside from rumors in a couple small Subreddits. Feels weird as a Reddit user to see something like this out in the news without attempts for creating community buy-in, as if the Reddit team has lost faith in aligning with their user base and instead leans toward working around them.

EDIT: The Wired article is starting to make its way around [1]

[0] [https://www.reddit.com/search?q=upvoted.com&sort=new&t=week](https://www.reddit.com/search?q=upvoted.com&sort=new&t=week)

[1] [https://www.reddit.com/r/technology/comments/3nnw6v/reddit_l...](https://www.reddit.com/r/technology/comments/3nnw6v/reddit_launching_new_site_called_upvoted_that/)

<comment><USER10> Lets be honest here: Reddit has done a lot of censoring lately. It's not a surprise you're not hearing anything about Upvoted on Reddit, it's just sad.

<comment><USER11> ...what? How does that make sense? You think Reddit is censoring discussion of its _own news website_?

</comment></comment></comment><comment><USER12> I think it's a smart and awesome decision.

Curated reddit. It solves so many problems and can offer a lot of value to everybody.

\- People who want "clean" and moderated reddit get what they want,

\- advertisers get what they want,

\- and, hopefully, reddit users get what they want(because there will be less pressure to moderate reddit.com).

At the very least they will capture all the value that buzzfeed and other bad blogs are currently taking from reddit.

Everybody wins.

<comment><USER13> I feel that this can disincentivize commenting. I am probably going to be a user of Upvoted, taking me out of Reddit where I comment when a story compels me to do it. If there is more people like me, you will reduce your commenting user base.

</comment></comment><comment><USER14> > But most importantly, it just isn't Reddit.

I think the thing that would set Upvoted apart, and that's basically the one reason it could work, is the fact that under the hood it _is_ Reddit. Reddit has an enormous community that practically supplies stories and also validates them as "traffic-worthy".

I've seen several articles on other news sites that were clearly inspired by a popular post on Reddit, though I can't currently find a good example. If other people are doing it, why not Reddit themselves?

<comment><USER15> Every terrestrial radio station I've listened to has a story a couple times a month about the "top 10 things people said about something" that is lifted directly from a top post in /r/AskReddit. Some stations mention that it's from Reddit, but some don't.

</comment></comment><comment><USER16> Buzzfeed, usvsth3m, The Metro and their ilk just recycle reddit submissions anyway, I think it makes sense for reddit to take a slice of that pie themselves.

</comment><comment><USER17> Eh. This feels like what Digg pivoted into, a news website. Except of course, Reddit will be providing the content so it will be more straightforward. Interestingly they mention that it has been in the works for the last year, it seems like this is going to be a basic Wordpress site (unless the hosting page currently is misleading).

<comment><USER18> Using wordpress as a CMS would be quite suitable. I would assume what makes more than 'just another wordpress site' will the back end. Load balancing, caching etc.

I would have expected a custom landing page though.

<comment><USER19> DNS for the domain only has a 300 second TTL. The site can easily be pointed somewhere else before the launch.

      ;; QUESTION SECTION:
      ;upvoted.com.                   IN      A

      ;; ANSWER SECTION:
      upvoted.com.            300     IN      A       126.96.36.199
      upvoted.com.            300     IN      A       22.214.171.124

</comment></comment></comment><comment><USER20> I've got a feeling that the Reddit community won't be too keen on this, mostly seeing it as another news organization "stealing" their content. IMO a good way to get users behind this would be to compensate the original posters for their content being posted on Upvoted.

<comment><USER21> 9.5-year-old Reddit account here, so perhaps my view is atypical, but I see this as Reddit's answer to the new Digg, and to the broader trend of editorial curation as a counterpart (not necessarily a competitor) to aggregation.

Reddit has web aggregation and communities pretty much sewn up as a market. How can they grow? By leveraging their insight into that traffic to create their own publication. I think they see their audience for Upvoted as people who know what Reddit is, and perhaps use it, but aren't power users and just like to have interesting and entertaining stuff presented to them.

Best of luck to them, I certainly don't think Upvoted's success is written in stone (especially given Reddit's history of half-delivering on their initiatives).

<comment><USER22> >I see this as Reddit's answer to the new Digg

Why does the new Digg need answering though? It's now nothing but an obscure website that is only mentioned in connection to how big it once was.

</comment></comment></comment><comment><USER23> > Nor, despite its name, will it have any kind of upvoting system

Well the name says the stories have already been upvoted, so no system of the sorts are really implied anyway. I'm sure there are more takes on that though.

</comment><comment><USER24> If I wanted editorial content and spin I'd read mainstream news.

</comment><comment><USER25> Seems like Reddit has the same fate as Digg after all.

</comment><comment><USER26> So tomorrow Reddit launches its own version of 9gag?

<comment><USER25> More like own version of Digg

</comment></comment><comment><USER27> > Reddit has a reputation as the dark, unruly id of the Internet

Stopped reading there.

<comment><USER28> Sorry, but it's true. From what I've observed, Reddit has started to supplant 4chan in that role in the public eye.

<comment><USER27> ? From what I've observed, people either don't know much about Reddit (usually over 40 y/o), or they talk about Reddit like an established site. See Bloomberg's interview with Sam Altman posted today. See the consistently incredible turn out of famous figures to Reddit's AMA series.

I mean, how can a website with 200 million users be considered a "dark corner"? Absurd.

<comment><USER29> I'm over 40 and my reddit badge looks like this:

[https://s3.amazonaws.com/redditstatic/award/9_year_club-40.p...](https://s3.amazonaws.com/redditstatic/award/9_year_club-40.png)

I don't think it's an entirely absurd statement.

</comment></comment></comment></comment><comment><USER30> Also [https://news.ycombinator.com/item?id=10336961](https://news.ycombinator.com/item?id=10336961).</comment>


Show HN: MynderMail – Fastest and Best Way to Send Yourself Notes - <AUTHOR> https://play.google.com/store/apps/details?id=com.uxiomatic.mynderMail

<comment><AUTHOR> Any feedback?</comment>


Jeff Bezos, Jack Ma, and the Quest to Kill EBay - <AUTHOR> https://medium.com/s/story/jeff-bezos-jack-ma-and-the-quest-to-kill-ebay-bb4992dc5020 <comment><USER2> A fascinating read, and a fair bit of intellectual humility in the conclusion: "To beat a network effect, you may start at point A, but you're going to be successful only by steering to some distant point B, which will always be a related market. And you may not know exactly where point B is until you've gone through several rounds of innovation."</comment>


US Going Same Route as Greece, Portugal: Economist - <AUTHOR> http://finance.yahoo.com/news/US-Going-Same-Route-as-Greece-cnbc-3198218354.html

<comment><USER2> Wow this is a scary point to bring up, but I'm glad someone finally has. I've read numerous articles on this issue but no one has had the nerve to say that the US is a has-been economy. That the days of bountiful growth that followed WWII are unique. The growth curve experienced in that time is not going to be reproducible in the future.

The US was the dominant economy in the 20th century only because, I would argue, it was the only one running in the race who wasn't flat on the track with a sprained ankle. Now that Europe is long done rebuilding itself, and Asian countries have found some post-colonial stability, now that everyone is healthy and ready to race, America finds itself falling behind because it was used to running in a race of one. So how competitive were we ever in the past? We'll never know since a race of one really isn't a race, much less does it count as competition...

We'll see how this race turns out...</comment>


One-rotor drone is equal parts awkward-looking and adorable - <AUTHOR> http://www.engadget.com/2016/05/06/one-rotor-drone-is-equal-parts-awkward-looking-and-adorable/?utm_source=gravitytx-exchange-fromAOLtoengadget&ncid=gravitytx-fromAOLtoengadget&cps=gravity_7543_-802879577801734660 <comment><USER2> 10 years ago or so heard of a similar concept -- a drone which would rotate and the idea was that its center of gravity was outside of its body, and due to persistence of vision it would be very hard to spot.

[http://veratech.aero/phantom.html](http://veratech.aero/phantom.html)

There was only a patent and a demo page (above), haven't heard much since then.</comment>


Zynga Is In Talks To Buy "Draw Something" Maker OMGPOP - <AUTHOR> http://techcrunch.com/2012/03/19/zynga-is-in-talks-to-buy-draw-something-maker-omgpop/

<comment><USER2> Not just make their own?

<comment><USER3> There may be a reason beyond the product that they're doing this; it might be a talent acquisition, they might think Draw Something has too much traction for them to compete, or they might think the company's portfolio of games is strong. OMGPOP has stuggling making a hit (until DrawSomething), so now that they're in the national spotlight, Zynga might like what they have to offer.</comment></comment>


Coordination and the Art of Scaling - <AUTHOR> https://speakerdeck.com/pbailis/coordination-and-the-art-of-scaling <comment><USER2> The video corresponding to those slides is available here: [https://cloudant.com/cloudantcon-videos/](https://cloudant.com/cloudantcon- videos/)</comment>


Experts Analyze the App That Broke Iowa - <AUTHOR> https://www.vice.com/en_us/article/3a8ajj/an-off-the-shelf-skeleton-project-experts-analyze-the-app-that-broke-iowa <comment><USER2> "Honestly, the biggest thing is—I don't want to throw it under the bus—but the app was clearly done by someone following a tutorial."

HAR!

</comment><comment><USER3> So it sounds like for people able to use the app (maybe limited in part due to the use of TestFairy free tier (from a different vice article)), the app correctly got data into Google Cloud Functions, but a script used to transfer the data from there to the Iowa Democratic Party (not sure what they were using) didn't work correctly (due to a "data formatting error"). Some people were confused by the three six digit numbers needed, a precinct id, PIN, and two-factor code (auth0, according to the other vice article with screenshots).

ProPublica also found there was a MITM vulnerability:

[https://www.propublica.org/article/the-iowa-caucuses-app- had...](https://www.propublica.org/article/the-iowa-caucuses-app-had-another- problem-it-could-have-been-hacked)

However, even if the app didn't mess up numbers there seem to be a bunch of issues with the numbers:

[https://www.nytimes.com/2020/02/06/upshot/iowa-caucuses- erro...](https://www.nytimes.com/2020/02/06/upshot/iowa-caucuses-errors- results.html)</comment>


Bringing D3.JS to Jupyter Notebook with Py-D3 - <AUTHOR> http://www.residentmar.io/2016/09/12/py-d3.html <comment><USER2> How do you pass data from python to js? e.g. a list of values to plot.</comment>


British spy agency GCHQ hacked EU ally Belgium's telecoms firm using NSA tech - <AUTHOR> http://www.spiegel.de/international/europe/british-spy-agency-gchq-hacked-belgian-telecoms-firm-a-923406.html

<comment><USER2> The lack of outcry concerning this revelation is disturbing. It seems like more attention is being paid to whether or not the telecom firm informed the Belgian government in time, than the fact that a European ally is spying on us.

<comment><USER3> I rather suspect this has been flagged or otherwise prevented from reaching the HN front page.

<comment><USER4> Yes, why isn't this on the front page? Come on HN moderators, fix this!

</comment></comment></comment><comment><AUTHOR> That's one way to deepen a diplomatic relationship.

</comment><comment><USER5> [http://mybroadband.co.za/news/security/87025-mtn-suspects- it...](http://mybroadband.co.za/news/security/87025-mtn-suspects-it-is-victim- of-nsa-hack.html)

</comment><comment><USER6> Breaking news - spies spy!

<comment><USER4> Did you even read the article?!!

<comment><USER6> Yes, I have.

What do you think is so unbelievable in the body of the article that's not summed up by what I said?</comment></comment></comment>


Bad USB-C cable destroys laptop - <AUTHOR> https://plus.google.com/+BensonLeung/posts/aFWWeiybe4P <comment><USER2> HN has previously had a story on the author, a Google engineer who tests USB-C cables on Amazon to make sure they're spec-compliant. He does some amazing work:

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

I don't have any devices right now that use USB-C, but whenever I see a deal pop up for one, I usually check the Amazon listing to see if this guy has reviewed/certified the cable yet.

I recommend others do the same. It's not worth damaging your $800+ laptop because you wanted to save $10 on a cable.

<comment><USER3> Frankly the C plug spec seems overly convoluted.

Each cable needs one of 3 resistors depending on them being a A/B-to-C cable, 1.5A C-to-C cable, or 3A C-to-C cable.

Note that the A-to-C cable may well be able to carry 3A, but it shall never use the 3A C-to-C resistor (what many of the cables he find as faulty does).

Note that all this resistor shenanigans are all independent of the Battery charging spec that has been around for some years, and also the Power Delivery spec that was introduced along with the 3.1 USB spec (can be used for all ports) and the C port spec.

Never mind that a C port has so many extra pins compared to a A or B port, that one would think that id-ing a A-to-C cable would have been as simple as looking for life on any of those extra pins.

<comment><USER4> > Each cable needs one of 3 resistors depending on them being a A/B-to-C > cable, 1.5A C-to-C cable, or 3A C-to-C cable.

No, for C-to-C connections, the resistance is provided by the host ("downstream-facing") port, not the cable. The resistor in an A-to-C cable is basically emulating the signal that would otherwise be provided by the host.

There's no such thing as a "1.5A C-to-C cable"; all type-C cables are required to deliver at least 5A. The limiting factor is the host, not the cable, which means the cable _must not_ incorrectly advertise capabilities that the host doesn't support.

> Never mind that a C port has so many extra pins compared to a A or B port, > that one would think that id-ing a A-to-C cable would have been as simple as > looking for life on any of those extra pins.

That's exactly what the new CC pin is used for. Right now the spec says "legacy cables should connect CC via a 56kΩ resistor", but it wouldn't matter if instead the requirement had been "legacy cables should leave CC disconnected"; the issue is that cable manufacturers are ignoring the spec.

<comment><USER5> A world with smart cables is a dumb world. I want smart devices/adaptors and cheap dumb cables.

<comment><USER6> USB cables aren't smart cables by any stretch of the imagination—not when we've got standards like Thunderbolt. A single resistor is not unreasonable complexity on top of the requirements to get the pinout correct.

</comment></comment></comment></comment></comment><comment><USER7> TL;DR; USB-C cable had GND tied to Vbus and Vbus tied to GND (opposite as it should be)

Honestly, I'm surprised that this isn't something that thelaptop and other such USB adapters aren't equipped to deal with. This is only slightly worse in my book than a USB adapter being fried from shorting the Vbus and GND pins together

<comment><USER8> Why would you design in reverse polarity protection? It adds cost, and the mechanical connector already makes it impossible for VDD to short to GND in USB type C because of its rotational symmetry.

<comment> andrey-g I constantly have Vdd shorts due to ground loops when measuring stuff. But a more frequent case is worn out cables (every lightning cable I've owned has eventually broke).

Its not rare enough of a failure mode to ignore.

<comment><USER8> Yes, and that's why the USB spec puts the burden of protecting against electrical shorts on the controller. The device side shouldn't have to worry about trying to shunt 100 Watts of power somewhere.

I mean this kind of protection is way beyond typical ESD protection due to the power involved. It would add a lot of cost to do this, maybe even a dollar or two in raw material.

<comment><USER9> If you stop the current from flowing, you don't have to shunt any power anywhere.

You'd have to open the circuit in the face of 5V of potential hooked up backwards, not really a tall order.

<comment><USER8> I don't want to be a broken record, but you're right, not a tall order, but no it's unreasonable on account of cost. It's impossible for USB C to be hooked up backwards by its mechanical design, so why guard against it? The high-side transistor to prevent reverse polarity faults could be 3 to 4 cents in manufacturing cost! It's also not trivial to make sure that transistor trips fast enough to prevent all your low-voltage ICs from being destroyed.

<comment><USER9> Sure, but the magnitude of that cost matters a lot. You were saying a dollar or two in raw materials to protect against 100W, now you're saying three or four cents. A few cents to protect hundreds of dollars in equipment from electrical faults seems worthwhile to me.

<comment><USER4> That makes sense from the consumer's point of view. But imagine you're a manufacturer, producing USB device controller chips by the million. Would you really be willing to spend tens of thousands of dollars to protect against a failure mode that can only happen due to some other company's extreme negligence?

<comment><USER5> Tens of thousands of dollars total is far less than it costs a company just to moot the question.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER10> I wonder if this one cable was miswired or it's something consistently wrong with the product. Either way that something like that could make it out of the factory demonstrates terrible or no QA/QC.

I've never used the Twinkie but it looks pretty cool. This shows that it may be worth adding some simple protection to the circuit to prevent simple miswires from damaging it or the host PC.

<comment><USER11> >I wonder if this one cable was miswired or it's something consistently wrong with the product.

He bought more to find out: [https://plus.google.com/+BensonLeung/posts/EBGMagC46fN](https://plus.google.com/+BensonLeung/posts/EBGMagC46fN)

<comment><USER12> > He bought more to find out:

I don't think so. From TFP:

"Here are some pictures of the torn down SurjTech 3M cable that fried my Pixel."

Cable, singular. :)

<comment><USER13> From one of his comments

>I ordered one more of each of Surjtech's products before they pulled their listing today, so yes.

</comment></comment></comment></comment><comment><USER14> For those unfamiliar, this person (Benson Leung) is a Google employee that has been testing USB-C cables to make sure they match the specs. His efforts were previously discussed on HN[0].

[0] [https://news.ycombinator.com/item?id=10508494](https://news.ycombinator.com/item?id=10508494)

</comment><comment><USER15> Reverse polarity protection is often not done with diodes for the reasons explained. It is more common to use a p-channel MOSFET (or ideal diode controllers when there are multiple power sources) when more than a trivial amount of power is used by the design. They are not cheap when properly sized, but are not ruinously expensive either and are not too large for most designs.

<comment><USER16> There should be a crowbar diode between the rails. If the design is too cheap for an input fuse, the source will limit/disable the short current.

<comment><USER17> Crowbar isn't a diode, and it doesn't protect against reversed polarity, and it's a bad idea on the input because you're relying on the other device to limit current properly, when it's the other device which got the voltage wrong in the first place.

<comment><USER16> It acts like a literal crowbar, so why not call it a crowbar?

There are likely already plenty of diodes across the rails (the body diodes of the chips), so without a fuse the power is already limited by just the source. IMHO you might as well try and protect the circuit from foreseeable power- limited situations like frayed cables and the OP.

<comment><USER17> I'm saying a crowbar isn't a diode, and you're saying that you should call a crowbar a crowbar? Color me confused. Usually a crowbar is a circuit with a triac or SCR in it designed to protect against overvoltage.

This isn't about frayed cables. Frayed cables don't do this. This is about a cable which is wired the opposite of the way it should be. A minimal protection circuit is probably going to cost around $0.20 in quantity (Si2323 on Mouser). For a $500 Chrome Pixel C, the protection circuit is worth the effort if more than 1 in 2,500 ($500 / $0.20) laptops would fail due to charger cables with reversed polarity.

If you think that fewer than 1 in 2,500 laptops will fail this way, then don't bother.

<comment><USER16> Crowbar is a general concept - a short across a supply. A diode across the rails acts as such, so I referred to it as a crowbar. I'm familiar with SCR- based active crowbar circuits - what we're disagreeing about is narrow- prescriptive versus wide-descriptive usage of a term.

Most frayed cables are going to simply short or open, but the right combination of such would cross wires. But sure, they're going to be rare.

On a $500 device I would indeed expect a modicum of robustness against negligently designed cables and other weirdness. I mean, I'm not the only one that doesn't have a cable tester and buys cables without a connected-equipment warranty, right? Historically, electrical connections have been designed to deal with weird shit. Do you think you could kill an RS-232 port with _any_ permutation of connections?

Of course the cost metric explains _why_ devices are no longer robust. In fact the manufacturer only has to worry about in-warranty failures, and furthermore only the ones they can't blow off as "user error". Just because devices are designed for the 4 month (or whatever it's down to) upgrade cycle, doesn't mean that informed consumers shouldn't call out designers of such equipment as the cheapskates they are!

<comment><USER8> Ugh. Am I the only one who appreciates cheap things for what they are? Over- engineering something is a bad thing, just as under-engineering it is too. It makes things more expensive than they have to be.

There's an art to designing something to last for no longer than it has to, and to use not a single part that isn't necessary. How much worse would our lives be if we had to pay industrial/commercial prices for all of our goods?

<comment><USER12> > It makes things more expensive than they have to be.

Consumer electronics are -generally- _ridiculously_ cheap these days. I welcome more "overengineering", even if it drives up the cost somewhat. :)

<comment><USER18> The problem is cost != quality in any reliable way any more.

<comment><USER12> That's an entirely separate issue from the one that my comment speaks to. :)

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER19> I think at some point Amazon should take some heat. They should at least de- emphasize uncertified cables or require vendors to have licensed the USB logo.

If you buy a power strip, even a cheap one, you at least get some assurance that it is UL rated and probably won't burn your house down. USB isn't just a keyboard connector anymore... We should have some assurance that cables are legit and safe.

<comment><USER20> Amazon in Germany happily sells you power strips / connectors you can't use in Germany without effectively voiding your insurance if your house burns down (e.g. T-connectors that let you connect two Schuko plugs to a single wall outlet without a cable).

Granted, for some of them it adds a small disclaimer "Only for export" but let's be honest: if you're selling to consumers, you're not selling for export.

</comment></comment><comment><USER21> Seems to be a kind of bait-and-switch operation, see this G+ comment by Lance Nanek: _> >It's pretty common on amazon for some good items to be shipped to get some good ratings, then for the seller to replace them with cheap, almost non-functional, shoddy replacements. It's happened to me before with bicycle equipment (pushing the button on a rear light pushed right through the casing, etc.). So it's entirely possible you got a good one from their initial offering, then they started selling something else.<<_

<comment><USER5> These are the wonders of globalization. USA consumer protection laws don't apply to foreign manufacturers using noname brands.

<comment><USER22> > These are the wonders of globalization. USA consumer protection laws don't > apply to foreign manufacturers using noname brands.

That's false if you buy stuff on Amazon. That's true if you buy goods on a chinese website. USA consumer protection laws certainly apply since Amazon is a US corporation. Otherwise Amazon would be selling controlled substances like it's an Rx.

</comment></comment></comment><comment><USER23> Interesting that most of the reviews for Anker and Aukey products on Amazon have a variation of the same "I was provided with a free sample of this product in exchange for my unbiased professional review."

<comment><USER24> How on earth do you think the tech review industry works? 99% of the reviews you've read utilize free gear provided by the vendor. Some publications have taken steps to curb potential excesses, but at least when I was freelancing (2000-2005), almost all writers were provided gear for free, and allowed to keep said gear.

Ethical journalists can attempt to ignore the impact of gratis equipment, but it's difficult in the best of situations. Just as difficult as trying to ignore the impact of a "helpful" PR department. Apple was particularly good at this; I was provided with every version of the iPad for reviews. Once Apple got over their death march, this dried up, and dealing with their PR firm became tedious. HP provided notebooks, PDAs, anything, with no expectation or real system for returning equipment. The only vendors I ever dealt with that were strict about returns were Kodak/Canon with their DSLRs and lenses. These were normally around $10K or greater, so I was not surprised at all.

Bias is implicit in any review where the publication isn't purchasing the items it reviews. I'm not sure how Sweethome and the Wirecutter work, though I know they make $$ off of purchase referrals through Amazon.

<comment><USER6> There's a big difference between giving review samples to journalists to review and publish on their own sites, and giving samples to be reviewed in bulk on Amazon in the same context of customer reviews and aggregated together with the same scores, with only a footnote of disclosure. Getting review samples isn't the problem; the reviews are just being published in the wrong manner. It's particularly inexcusable that the reviews solicited in this manner are eligible to be tagged as "verified purchaser" reviews.

<comment><USER24> The "Verified Purchaser" tag is just so that people know the reviewer actually received and ideally evaluated an actual unit, as opposed to a sockpuppet review. What's your issue with his review? He actually reviewed the actual units, compared them to the specs, and gave his professional opinion. All in a place where it can do the most good, as opposed to posted to some defunct Google blog.

<comment><USER6> I think you lost track of the context. Benson Leung's reviews aren't the ones including the disclaimer; he probably is spending his own (or Google's) money to actually purchase the products. This is different from the astroturfing spammers whose reviews are tagged as "Verified Purchaser" but the text of the reviews shows that they didn't have to actually purchase the product. Those spam reviews are rarely anything but vacuous and are certainly not professional opinions in the same sense as Benson Leung's.

</comment></comment></comment></comment></comment><comment><USER25> The item appears to have been removed from amazon now.

Clicking the link to the item[1] on the review page leads to a 404.

[1]: [https://www.amazon.com/SurjTech%C2%AE-Standard-Adapter- Devic...](https://www.amazon.com/SurjTech%C2%AE-Standard-Adapter-Devices- Macbook/dp/B01937P0O6/)

<comment><USER26> Question is, did they pull it for real or did they only do so to relist it without having that review show up?

</comment></comment><comment><USER27> Breaking test equipment should probably force a recall by itself. I wonder what the Amazon procedure is for reporting faulty items?

<comment><USER16> Yes, a recall of the "test equipment".

<comment><USER27> I'm pretty sure you can blow up any test equipment with a sufficiently screwed up test subject.

<comment><USER16> Sure, but reverse voltage should be nowhere near sufficient.

<comment><USER28> Do you mind explaining why? Short circuits are common, and are mitigated against. Reversed voltage is exceedingly rare, especially for USB C with mirrored contacts.

<comment><USER16> The purpose of test equipment is to diagnose weird situations - hence why OP broke two of them trying to understand what was happening. Its requirements are to be as robust and transparent as practical. The other end of the cable could likely be bare wires connected ad-hoc with alligator/mini clips.

FWIW because the USB PD device is connecting two separate grounds, this same failure could have happened from a single broken ground wire.

<comment><USER28> > The purpose of test equipment is to diagnose weird situations...Its > requirements are to be as _robust and transparent as practical_

That doesn't set a clear-cut boundary, does it? What seems practical to you might be impractical to the test equipment maker - especially when cost is considered. Should the test equipment be robust enough to handle 1000+ amps? I'd say no, someone else (maybe even you) might say yes.

</comment></comment></comment></comment></comment></comment></comment><comment><USER29> SurjTech. SurgeTech? Seems an oddly appropriate name.

</comment><comment><USER30> Killed a laptop when plugging in my phone (with the old 30 pin connector). Turns out a bit of foil from a wrapper had become stuck in the slot on the phone.

Since this was in the bad old day the laptop was fixable for under $200 so it wasn't too bad.

Still, makes sense to keep an eye on what you plug into your computer.

<comment><USER31> I recently fried my laptop (still worth $500 on ebay and was $1800 new...), from a cheap chinese pcie adapter.

I would love to know where or how I could repair it for and how much.

<comment><USER32> You can find motherboards and other components on eBay. [http://www.laptopinventory.com/](http://www.laptopinventory.com/) has a very good catalog and excellent how-to videos. I have done parts replacement on a few of my laptops (screens, keyboards, touchpads) and if you have ever added RAM to a laptop the process for the other components is not really any different.

</comment></comment></comment><comment><USER33> I guess he learned that step 1 should be using the ohmmeter and step 2 should be plugging it into hundreds of dollars of equipment.

<comment><USER34> Do you really test each USB cable you buy like that?

<comment><USER35> We're talking about a guy whose job is to test USB cables.

<comment><USER36> from what i remember, it was not his job -- he worked on products that have usb-c components (like the pixel laptops) and wanted to make sure the products on amazon were up to spec. you can see his reasoning here: [https://plus.google.com/+BensonLeung/posts/LH4PPgVrKVN](https://plus.google.com/+BensonLeung/posts/LH4PPgVrKVN)

</comment></comment></comment></comment><comment><USER37> His review has 1,120 positive votes out of 1,121; I don't think I have seen _anything_ get near that high with just one 'unhelpful' vote.

[https://www.amazon.com/review/R2XDBFUD9CTN2R/ref=cm_cr_rdp_p...](https://www.amazon.com/review/R2XDBFUD9CTN2R/ref=cm_cr_rdp_perm)

</comment><comment><USER38> He is brave to do his testing on such a nice computer. I hope he somehow gets this covered. Amazon should pay him for his work.

<comment><USER39> He's a Google employee, presumably using corporate hardware to advance the USB C ecosystem that the Pixel line is shepherding. I'd be shocked if Google didn't let him replace it.

</comment></comment><comment><USER40> Surely this product should be removed from sale by Amazon until the manufacturer can investigate?

</comment><comment><USER41> Reversed polarity? So, how does that even happen? Are they assembling cables by hand, individually? And not testing them?

</comment><comment><USER42> I tried to get a bit of dust out of the USB port of my MBP with a metal tweezers. Sparks flew and that was the end of that laptop.

</comment><comment><USER43> USB-C seems like a really bad standard if the cable can destroy expensive electronics.

EDIT: Even if the cable is wired and built correctly (which is apparently difficult for manufacturers to get right), cables fray and tear all the time. I foresee a lot of dead electronics upcoming.

<comment><USER44> It's not the standard that's bad, it's the actual wiring of it.

That's akin to saying:

The US power grid is a bad standard because I wired up my house wrong and it burned down.

<comment><USER45> It seems more like saying:

The US power grid is a bad standard because I wired up my house wrong and it burned the power station down.

<comment><USER9> How so? The charger was fine (I presume, it's not mentioned either way), the charged device got fried.</comment></comment></comment></comment>


The FogBugz Plugin Architecture - <AUTHOR> http://www.fogcreek.com/FogBugz/blog/post/The-FogBugz-Plugin-Architecture.aspx

<comment><USER2> Instead of having your plugins be able to execute SQL commands, why not use something like ActiveRecord + NHibernate (or some other ORM) with LINQ? NHibernate 2.1 was just released with LINQ support, so you could do something like:

int BugCount = Bug.Where(case => case.Id = caseId).Count();

(Where caseId is a parameter or something). It'd really simplify the API and keep you from doing safety checks on the SQL passed by the plugins. You might even be able to simply some of your "display" code to use Dynamic LINQ queries for the sorting and so forth.

I've been using the ASP.NET MVC + NHibernate + ActiveRecord + LINQ "stack" for several months now (though I've been an ASP.NET developer for about five years), and I have to say that my productivity has gone way up thanks to it.

<comment><USER3> FogBugz targets .NET 2, which lacks .NET Expressions; they'd have had to build their own AST model, without C# support. I wouldn't be surprised if, whenever FogBugz gets around to requiring .NET 3.5, they start supporting LINQ queries against the exposed datasets, but I wouldn't hold your breath.

<comment><USER2> Oh, that's too bad. I'm thinking about writing a plugin for FogBugz, and that would have been nice to have (it won't stop me from writing it though ;)

Perhaps they could check out LINQbridge (<http://code.google.com/p/linqbridge/>). I don't know if that could be adapted to work for them and ease the transition to .NET 3.5, but perhaps its something to look at. (It _almost_ replicates LINQ on the 2.0 framework.)

</comment></comment></comment><comment><USER4> FogCreek still prefix their classes with 'C'? Oh Joel... :(

<comment><USER5> Please explain for the dummies: is this sort of naming convention just a fad that is out of style or has some of the latest advances in technology made it obsolete?

<comment><USER6> Ignore the Hungarian haters.

Joel's stance on Hungarian notation is laid out here: <http://www.joelonsoftware.com/articles/Wrong.html>

<comment><USER7> _Ignore the Hungarian haters._

Which would be basically everyone who didn't learn to write software on Windows.

If you have a reasonable type system and language, leverage it to enforce semantics that Spolsky suggests you use Hungarian notation to imply by convention.

You'll be much less likely to be castigated by the individual who has to maintain your code after you. Microsoft has put Hungarian notation to rest, nobody else o speak of uses it, and you shouldn't either.

<comment><USER6> The type of Hungarian notation Spolsky uses at Fog Creek is different than the Hungarian once pushed by Microsoft. He goes over that in the linked article. I'm not defending it - I've never tried it - but it obviously works for Joel.

Also, if you're working at Fog Creek, the guy who has to maintain your code after you will also be using Hungarian.

<comment><USER7> _The type of Hungarian notation Spolsky uses at Fog Creek is different than the Hungarian once pushed by Microsoft._

Hungarian notiation (of any variety) started (and ended) at Microsoft.

 _Also, if you're working at Fog Creek, the guy who has to maintain your code after you will also be using Hungarian._

If you're working at Fog Creek you're writing code in a custom in-house programming language as well as using Hungarian notation. I don't think the example is generally useful or applicable to anyone else.

</comment></comment></comment></comment></comment></comment><comment><USER8> I wonder if they will let people charge for their plugins and create a plugin store rather than a gallery..

<comment><AUTHOR> It is planned, but not implemented yet. We're also still gauging interest.

<https://developers.fogbugz.com/default.asp?W133></comment></comment>


Ask HN: Best books on AI - <AUTHOR> It feels like the whole world wants to make sure the whole world knows how they feel about AI/AGI. I'm curious what the best books are to get a better understanding of AI than I can from just reading Medium and Techcrunch posts? <comment><USER2> If you want to have a clear grasp of the AI/AGI challenge, "SuperIntelligence" by Oxford philosopher/mathematician Nick Bostrom is a must. [https://www.amazon.co.uk/d/Books/Superintelligence- Dangers-S...](https://www.amazon.co.uk/d/Books/Superintelligence-Dangers- Strategies-Nick-Bostrom/0199678111)

Now if you have a bit of a math/engineering background and want to understand how modern AI really works, the two best books/shortcuts to go from beginner to expert are: \- Ian Goodfellow's "Deep Learning" [http://www.deeplearningbook.org/](http://www.deeplearningbook.org/) \- Richard Sutton's "Reinforcement Learning: An Introduction" [http://incompleteideas.net/sutton/book/](http://incompleteideas.net/sutton/book/)

</comment><comment><USER3> I found the first chapter of Deep Learning by Ian Goodfellow et. al. to do a good job going over the basic structure of AI as well as some useful history. The book is published online for free by MIT as well, which is great. www.deeplearningbook.org

</comment><comment><USER4> My recommendation would be to go back to the original sources. Hardly anyone (on Medium or Techcrunch, that is) would know about Arthur Samuel's checkers playing program. His paper, "Some Studies in Machine Learning Using the Game of Checkers", can be found in the compilation, "Computers and Thought" by Feigenbaum and Feldman.

Another good resource is the three-volume set, "The Handbook of Artificial Intelligence ", also by Feigenbaum. It's a very thorough catalog of programs developed in the 60s and 70s that illustrate various techniques used in AI programs.

In the words of Alan Kay, "the past is vast".

</comment><comment><USER5> _Artificial Intelligence: Case Studies in Common Lisp_ , Peter Norvig. It is also a really good book on programming in general.

<comment><USER6> Norvig also wrote the classic Artificial Intelligence: A Modern Approach

<comment><USER5> I'm more a fan of his Common Lisp book because it has running code instead of pseudo-code and that code is simpler than the Common Lisp code he wrote for _A Modern Approach_.

<comment><USER7> I'm a fan of the AIMA book, too. But the Lisp code for it kind of failed to excite me...

<comment><USER5> I don't think Norvig was all that excited about it either (or at least whatever excitement there was may have worn off): [http://norvig.com/python- lisp.html](http://norvig.com/python-lisp.html)

Though I guess it is probably better if he describes it himself, [https://news.ycombinator.com/item?id=1803815](https://news.ycombinator.com/item?id=1803815)</comment></comment></comment></comment></comment>


A million people cut the cord in the last 3 months, cable companies are worried - <AUTHOR> http://bgr.com/2017/10/31/cord-cutting-best-cable-alternative-2017-directv-now-vs-hulu-youtube/ <comment><USER2> They do not seem too worried. Comcast raised my basic internet bill by another $20 per month and when I called to cancel they did not even try to keep me.

<comment><USER3> Similar story here. When my promo rate expired my bill went way up, I told them I was going to cancel and they didn't seem interested at all. Usually they would negotiate a bit.

<comment><USER4> With this many people quitting I wonder if the call center staff have blown their KPI's already and just given up?

</comment></comment></comment><comment><USER5> And then the FCC will cut Net Neutrality so we have to pay to use the Internet like a cable package.</comment>