Show HN: HTML5 Admin (updated version) - <AUTHOR> http://www.html5admin.com/changelog/

<comment><USER2> Thanks @chickerun!

<comment><AUTHOR> Yeah, I've received the email for the free update (I bought the first release), so I wanted to make an heads up here :-)

Awesome template, thank you!

<comment><USER2> you're welcome :)</comment></comment></comment>


The Privacy Threat from Always-On Microphones Like the Amazon Echo - <AUTHOR> https://www.aclu.org/blog/privacy-technology/privacy-threat-always-microphones-amazon-echo <comment><USER2> We need the regulate the platforms. They all need to start implementing client-side processing if they want to do processing.</comment>


The Trouble with HomePod Reviews - <AUTHOR> https://mondaynote.com/the-trouble-with-homepod-reviews-585075add9d2 <comment><USER2> Quality sound quality testing is rare, mostly due to the fact that most of it is more marketing than reality (see beats headphones for example). Even the audiophile units often perform the same as a simple yamaha unit, but boy are they pretty, and made with exotic woods, solid silver, and handmade german capacitors.

Concerning room tuning: A similar issue happened about 20 years ago with the advent of this tech in car stereos. It isn't at all new, I still own an Eclipse head unit with the feature. It will play a frequency sweep from the speakers, and used the mics to localize (fade and balance), eq, and normalize the volume.

The problem is, as the listener, we almost always prefer our idiosyncratic music prefrences over a "flat" or generically "enhanced" eq and dynamics curve. And at least in the high quality (as opposed to SPL/loudness) domain of car audio, we have mostly moved back to manual adjustment. Many high end users still use sweeps and meters, easier than ever with smartphones, but still fine tune by ear.

Not altogether different than the tube vs solid state argument. Solid state amps are measurably cleaner and clearer, with less distortion, and greater frequency range. But the type of harmonic distortion produced by tube amplification is almost universally preferred by listeners when tested.

For humans, tune for the human, not the room.</comment>


Tim Schafer's effect on Indie Game Kickstarter Campaigns - <AUTHOR> http://bufr.tumblr.com/post/17487886152/tim-schafer-breathes-life-into-indie-gaming

<comment><USER2> I would love to see how many new accounts were created and what other projects they backed.</comment>


Object-relational impedance mismatch - <AUTHOR> https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch <comment><AUTHOR> I am under the impression that ORM are not helpful. I am in particular not sure why people still use them. I think that part of the response lies in the fact that people don't want to learn SQL, at least that was my position before reading about the subject. Now that I know SQL and knowing that correctly using an ORM can not be done without understanding the generated SQL, I am wondering why ORMs are very popular.

ORM seems to me like a dangerous indirection.

Nowdays I use aiohttp (a python asyncio http framework) with psycopg2 (via aiopg) on a rather large application with only a serialization/validation framework named Colander. I don't feel the need for an ORM. It does the job. What I am doing wrong?

<comment><USER2> I felt that ORM systems were negative 15 years ago. They have improved quite a bit since then. An increasing number of competitive frameworks have come out and the incumbent frameworks have improved. The situation is much better than when that "Vietnam" article came out. I think many people use a lightweight ORM such as Colander and if you are happy with that, that is great.

These days though I am using SQL very differently than the old days. I used to use MySQL, PostgreSQL and sometimes Microsoft SQL Server but lately if I use SQL it is SQLite. Today I am much likely to use some kind of graph or document database such as DynamoDB or OpenLink Virtuoso, but it has been a long process to get confident enough in the new tools.

What I see missing from most db tools is the ability to map functions from the host langage to the query language in back. For instance, if you write something like

lambda x: 5 _x-2_ x*x+7

you should be able to compile that the SQL or SPARQL or whatever equivalent. Microsoft's LINQ framework approaches that with a lot of specific features built into the runtime and language. In either Python or Java you can run a (or the) compiler/decompiler on an expression, make an AST, convert that AST into a query AST and send it to the database engine.

<comment><USER3> Opaleye can do this

[https://hackage.haskell.org/package/opaleye](https://hackage.haskell.org/package/opaleye)

(The generated code may not be the easiest to read, but I hope the point comes across)

        > let paulHoulesFunction = (\x -> 5 * x - 2 * x * x + 7); paulHoulesFunction :: Num a
        => a -> a

        > traverse_ putStrLn (showSqlForPostgres (queryTable table1))
        SELECT "column10_1" as "result1_2",
               "column21_1" as "result2_2"
        FROM (SELECT *
              FROM (SELECT "column1" as "column10_1",
                           "column2" as "column21_1"
                    FROM "table1" as "T1") as "T1") as "T1"

        > traverse_ putStrLn (showSqlForPostgres ((fmap . fmap) paulHoulesFunction (queryTable table1)))
        SELECT "column10_1" as "result1_2",
               ((5 * ("column21_1")) - ((2 * ("column21_1")) * ("column21_1"))) + 7 as "result2_2"
        FROM (SELECT *
              FROM (SELECT "column1" as "column10_1",
                           "column2" as "column21_1"
                    FROM "table1" as "T1") as "T1") as "T1"</comment></comment></comment>


I challenge you to remove the gray ad using Adblock - <AUTHOR> https://0x1b.pw/adblock/ <comment><USER2> This is a pointless challenge, because it has none of the characteristics of an actual ad.

For tracking, security, and analytics reasons, ad providers almost always originate ads from a separate domain than the content provider's.

<comment><AUTHOR> Correct, it isn't supposed to be used with ad providers that Adblock may (or may not) already block, it's supposed to work with internal ads that would come from the same domain as the content providers.

<comment><USER2> Who does that, though? Even the big content providers that have their own ad platforms (e.g. Yahoo!) serve ads from separate domains.

</comment></comment></comment><comment><USER3>
      var removeGrayImage = function() {
    	$("img").each(function(idx, el) {
    		var canvas = $("<canvas/>")[0];
    		canvas.width = el.width;
    		canvas.height = el.height;
    		canvas.getContext("2d").drawImage(el, 0, 0, el.width, el.height);
    		var pixel = canvas.getContext("2d").getImageData(1, 1, 1, 1);
    		var r = pixel.data[0];
    		var g = pixel.data[1];
    		var b = pixel.data[2];
    		if(r == 183 && g == 183 && b == 183) {
    			$(el).css({opacity: 0});
    		}
    	});
      };

<comment><USER4> Damn, you went for the same solution as me. I didn't think anyone else would so obtuse as to use a canvas to access the raw image data.

Here's my equivalent solution:

      var canvas = document.createElement('canvas');
      canvas.height = 1;
      canvas.width = 1;
      var twodctx = canvas.getContext('2d');
      var blockImg = null;
      var qs = document.querySelectorAll('img');
      for (var i = 0; i < qs.length; i++) {
        var img = qs[i];
        twodctx.drawImage(img, 0, 0, 1, 1);
        var imgd = twodctx.getImageData(0,0,1,1);
        if (imgd.data[0] == imgd.data[1] && imgd.data[0] == imgd.data[2] && imgd.data[3] == 255) {
          var badDiv = document.createElement('div');
          badDiv.style.display = 'none';
          document.body.appendChild(badDiv);
          badDiv.appendChild(img.parentNode.removeChild(img));
          break;
        }
      }

</comment></comment><comment><USER5> Why would you even want to block ad blocking? That's like trying to control what someone else can do with their computer. It seems really unethical.

</comment><comment><USER6> It still has a style that the other image doesn't:

        style="height: 250px; width: 250px;"

After that, other than positionally blocking them, there's nothing that can be done short of visually inspecting the element.

You could modify the script to randomly place the ad either first or second, so you don't need the third  tag with no src.

What is the goal of this experiment?

<comment><USER7> _What is the goal of this experiment?_

I'm guessing intern at an ad network pitches he can come up with an "unblockable ad" to his boss.

Boss wants to go home for the holiday weekend so he says, "OK, whatever kid" as he's walking out the door just after lunch.

Intern signs up with a one-hour old HN account and posts his masterpiece here and starts playing whack-a-mole with the dozens of methods to trivially block the "unblockable ad".

After a couple hours, everyone gets bored and goes back to work. The intern frets and worries all weekend that he promised his boss an unblockable ad and won't be able to deliver on Tuesday when everyone is back in the office. Come Tuesday, he goes into the office, sweating and nervous to discover his boss wasn't in the slightest bit paying attention to whatever it was he was saying last Friday.

<comment><AUTHOR> Thats a nice story, but unfortunately not the truth. This was simply a spur of the moment idea and I wanted to see if it worked, which to a relative degree it did, hence why I posted it. The main goal of posting it is to show how easy it would be for a website to show ads to a user, even with an extension such as Adblock enabled. In regards to the account, I haven't had a need for a HN account before now.

Sorry if you didn't like it.

</comment></comment></comment><comment><USER8> Probably trivial to fix, but:

        var found = false;
        $('img').each(function(i, elem) {
            var e = $(elem);
            if( e.attr('src') !== '' && !found ) {
                e.attr("style","opacity:0.0;");
                found = true;
            }
        });

</comment><comment><USER9> $("div > img:nth-child(2)").get(0).src = "[http://dev.w3.org/2007/mobileok- ref/test/data/ROOT/GraphicsF...](http://dev.w3.org/2007/mobileok- ref/test/data/ROOT/GraphicsForSpacingTest/1/largeTransparent.gif";)

Victory?

</comment><comment><USER10> The point of ad blocking is not to block all ads, just to block the most atrociously annoying and privacy invading ones. If the end game is that advertisers all calm down and stick to static images that do not double as web bugs we will all be happy.

</comment><comment><USER11> If I'm going through the effort to block an ad it's safe to assume I'm not going to click through, so you're doing a lot of work to not get a click.

Not to mention, if I encountered this on a real page I would just leave...

</comment><comment><USER12> I'm not sure how I feel about helping OP create un-blockable ads.

</comment><comment><USER13> Is Adblock a requirement? Opera has built-in element blocking: I clicked "Block elements", clicked the "ad", clicked "Done," and ... done :)

<comment><AUTHOR> Hm, tried it with Opera and it is indeed blocking it. However, the image still shows when the page is reloaded. So eh, kinda works.

<comment><USER13> Interesting...it indeed shows up on reload.

</comment></comment></comment><comment><USER14> This works assuming assuming OP doesn't change the page again:

      // First clear the interval assigned to window
      var highestTimeoutId = setTimeout(";");
      for (var i = 0 ; i < highestTimeoutId ; i++) {
          clearTimeout(i);
      }
      // Then empty the script tag
      $('script').eq(3).empty();
      // Then hide the image;
      $('img[src^="img"]').eq(0).hide();

<comment><AUTHOR> Very good solution, well done.

</comment></comment><comment><USER15> With the element hiding extension[1] installed:

0x1b.pw##IMG:first-child

But I imagine you could work around this by adding a null IMG element before the ad. Also, I'm pretty sure this would break any non-toy page.

[1]: [https://addons.mozilla.org/en- US/firefox/addon/elemhidehelpe...](https://addons.mozilla.org/en- US/firefox/addon/elemhidehelper/)

<comment><AUTHOR> Updated, not the cleanest way to do it but indeed adding a dummy image as the first child should stop it.

<comment><USER16> This is an arms race situation. The winner is simply the last one to move. I'm not sure exactly what you're trying to implicitly say, but it was already pretty clear that the whole ad removal thing was an arms race. It's obvious that neither side can Win Forever.

</comment></comment></comment><comment><USER17> Can I use other extensions? It's dead simple with Remove It Permanantly. [https://addons.mozilla.org/en-US/firefox/addon/remove-it- per...](https://addons.mozilla.org/en-US/firefox/addon/remove-it-permanently)

<comment><AUTHOR> Updated, try again.

<comment><USER17> Yeah, I have no idea now. Nice job :)

</comment></comment></comment><comment><USER18> $($("img")[0]).attr("style","position: absolute; left: -10000px;")

<comment><AUTHOR> Updated, try again ;)

<comment><USER19> Sorry, you don't get to work around successes every time someone posts one in order to claim that nobody can do it. The GP did it, the challenge has been won.

<comment><USER20> You don't get a prize, he's working WITH HN on an experiment.

<comment><USER19> I know you don't get a prize, but a challenge is one specific thing. This is a new challenge now.

</comment></comment></comment></comment></comment><comment><USER21> If a site did this I'd just leave tbh. I turn everything off and opt into advertising on sites I find I enjoy (if it turns out those sites had bad ads I just turn them off again).

</comment><comment><USER22> Block both, wonder why the site has nothing on it, leave.

</comment><comment><USER23> $('img:first').replaceWith(function() { return $('

') })

</comment><comment><USER24> $('img')[1].hidden = true;

</comment><comment><USER25> ermm? Just right click the image, adblock -> remove this image.

Of course reloading the page will bring it back due to way it's done, I guess that's supposed be the challenging part.

<comment><AUTHOR> Indeed, from a content creator standpoint - I wouldn't care if the image got removed after you'd seen it since I would of already got the impression.

</comment></comment><comment><USER26> seems you check for height being zero, but not max-height

$('img[src^="img"]').eq(0).css("max-height", "0");

</comment><comment><USER27> Easy Greeezy

</comment><comment><USER28> height: 0;</comment>


Ask HN: Best introductory video courses on ML and Deep Learning? - <AUTHOR> Hi there! I'm looking for an easy way to get started with AI/ML/DL.
I don't necessarily need to go super deep into details, I'm more interested in a practical high-level overview.
I know about Andrew Ng course [1], 3blue1brown videos [2], and Berkeley AI course [3]. What else would you recommend?
[1] https://www.coursera.org/learn/machine-learning
[2] https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi
[3] https://www.youtube.com/playlist?list=PLIeooNSdhQE5kRrB71yu5yP9BRCJCSbMt <comment><USER2> [http://www.fast.ai/](http://www.fast.ai/)

[https://www.udacity.com/course/intro-to-machine-learning-- ud...](https://www.udacity.com/course/intro-to-machine-learning--ud120)

[https://agi.mit.edu/](https://agi.mit.edu/)

[https://www.youtube.com/watch?v=eLbMPyrw4rw&list=PL6EE0CD029...](https://www.youtube.com/watch?v=eLbMPyrw4rw&list=PL6EE0CD02910E57B8)

[https://www.youtube.com/watch?v=2pWv7GOvuf0&list=PL7-jPKtc4r...](https://www.youtube.com/watch?v=2pWv7GOvuf0&list=PL7-jPKtc4r78-wCZcQn5IqyuWhBZ8fOxT)

[https://www.youtube.com/watch?v=NfnWJUyUJYU&list=PLkt2uSq6rB...](https://www.youtube.com/watch?v=NfnWJUyUJYU&list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC)

<comment><USER3> fast.ai Making neural nets uncool again. fast.ai is dedicated to making the power of deep learning accessible to all.[0]

Udacity. Intro to Machine Learning: Pattern Recognition for Fun and Profit[1]

MIT 6.S099: Artificial General Intelligence[2]

Lecture Series on Artificial Intelligence by Prof. P. Dasgupta, Department of Computer Science & Engineering, Indian Institute of Technology, Kharagpur[3]

DeepMind. Reinforcement Learning Course by David Silver[4]

Stanford Winter Quarter 2016 class: CS231n: Convolutional Neural Networks for Visual Recognition.[5]

[0] [http://www.fast.ai/](http://www.fast.ai/)

[1] [https://eu.udacity.com/course/intro-to-machine-learning-- ud1...](https://eu.udacity.com/course/intro-to-machine-learning--ud120)

[2] [https://agi.mit.edu/](https://agi.mit.edu/)

[3] [https://www.youtube.com/watch?v=eLbMPyrw4rw&list=PL6EE0CD029...](https://www.youtube.com/watch?v=eLbMPyrw4rw&list=PL6EE0CD02910E57B8)

[4] [https://www.youtube.com/watch?v=2pWv7GOvuf0&list=PL7-jPKtc4r...](https://www.youtube.com/watch?v=2pWv7GOvuf0&list=PL7-jPKtc4r78-wCZcQn5IqyuWhBZ8fOxT)

[5] [https://www.youtube.com/watch?v=NfnWJUyUJYU&list=PLkt2uSq6rB...](https://www.youtube.com/watch?v=NfnWJUyUJYU&list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC)

</comment></comment><comment><USER4> One important skill you will need is feature engineering. Formal methods for it aren't typically in ML ciriculums, but it's worth understanding if you're interested in applications if ML.

Deep learning addresses it to some extent, but isn't always the best choice if you don't have image / text data (eg tabular datasets from databases, log files) or a lot of training examples.

I'm the developer of a library called Featuretools ([https://github.com/Featuretools/featuretools](https://github.com/Featuretools/featuretools)) which is a good tool to know for automated feature engineering. Our demos are also a useful resource to learn using some interesting datasets and problems: [https://www.featuretools.com/demos](https://www.featuretools.com/demos)

<comment><USER5> I am playing with an encrypted dataset, so this comes very useful. Any tips on how to take advantage of it or about its strengths and weaknesses?

</comment></comment><comment><USER6> Not a video course, but an excellent book: "Hands-On Machine Learning with Scikit-Learn and TensorFlow" by Aurélien Géron. Provides a gentle and high quality introduction to Machine Learning with practice from the very beginning. I wish I had this book when I was starting. It explains everything from data engineering, through how algorithms work, to practical applications. Everything in Python 3, covering pandas, scikit-learn, tensorflow. It is absolutely wonderful!

[1] [http://shop.oreilly.com/product/0636920052289.do](http://shop.oreilly.com/product/0636920052289.do)

<comment><USER7> As a person who did a lot of Deep Learning... learning in 2017, I think this was my favorite.

Fast.ai was fine, but I felt like most of my learning for the things I cared about came from reading research papers, watching Karpathy's CS231n lectures, and blog posts that went into detail on particular concepts.

But when at certain points I felt confused on certain concepts, Geron's book did a pretty good job explaining things slowly and in great detail, especially with respects to the code he wrote. It's still a book I'll pick up for 20-40 minutes every other day to help my mind recall about how something works.

Funnily enough, I've spent the last few months reading Sutton/Barto's Intro to Reinforcement Learning (along with Silver's lectures on DeepMind's YouTube Channel) and only realized Geron touches upon RL a little bit in the latter part of the ML book.

</comment></comment><comment><USER8> Have you tried Andrew Ng's course? And I don't mean the one from the start of Coursera, but the original Stanford ML Course he taught at the blackboard. This ML course has all the math done by hand instead of skipped over.

[https://www.youtube.com/view_play_list?p=A89DCFA6ADACE599](https://www.youtube.com/view_play_list?p=A89DCFA6ADACE599)

<comment><USER9> bad link?

<comment><USER10> [https://www.youtube.com/playlist?list=A89DCFA6ADACE599](https://www.youtube.com/playlist?list=A89DCFA6ADACE599)

</comment></comment></comment><comment><USER11> I'll give another recommendation for [http://www.fast.ai/](http://www.fast.ai/)

I went through the first phase of the course as an intro to AI/DL and thought it was really great from a high-level perspective. If you have a decent understanding of Python you'll have a working model running on AWS within the first few hours of the course which is very rewarding.

It does a better job than I expected explaining the underlying intuition of the math, but doesn't dive deep into the actual formulas. There are obviously tradeoffs to this approach and if you want to continue in the field you'll need to do something to fill in this background, but as far getting your hands dirty and understanding the basics I really liked the fast.ai approach.

<comment><USER12> As a beginner I cannot recommend this class in its current form. The first lecture with its setup walk through is outdated and I have trouble understanding how to do a work around.

<comment><USER13> Part 1v2 was just released, it uses pytorch. Check it out, I was in the fall fellowship and can heartily recommend it.

<comment><USER12> This is welcomed news, thank you for the update. Can you link to v2? On the site I just see part 1, v1 with the AWS set up. This is the beginner unfriendly/outdated one I am referring to, and I don't see the updated version you're referring to.

<comment><USER13> I just checked the course forum, and Jeremy asked us not to share on high traffic sites until theyve finished the new website. I think it'll be out within a week or so, so check the fast.ai site for updates. Should be soon!

<comment><USER12> Okay, I will check in a week or so. Thanks.

</comment></comment></comment></comment></comment></comment><comment><USER14> I liked Yaser Abu-Mostafa's Caltech ML course. A bit dated (2012), but solid introduction to the basics (such as VC dimensions). However, given your stated preferences, other recommendations (such as fast.ai) are probably better suited.

[https://work.caltech.edu/telecourse.html](https://work.caltech.edu/telecourse.html)

<comment><USER15> I found this course pretty interesting, since it gives some perspective on what sorts of guarantees people want that DL doesn't provide, but I wouldn't necessarily recommend starting with it unless you have a theory bent.

</comment></comment><comment><USER16> If you're interested in learning Reinforcement Learning, then I can't recommend David Silver's lecture series highly enough. Youtube videos and slides are available for the entire thing. [http://www0.cs.ucl.ac.uk/staff/D.Silver/web/Teaching.html](http://www0.cs.ucl.ac.uk/staff/D.Silver/web/Teaching.html)

<comment><USER17> I wouldn't really classify this as an introductory course. Some background in A* search, Markov processes etc is required. David has a fantastic narration style and this is one of those courses where I had to step out because I had other responsibilities and not because I got bored with the content.

</comment></comment><comment><USER18> [https://cs231n.github.io/](https://cs231n.github.io/)

</comment><comment><USER19> If you want to see projects coded in Python (random forests, word2vec, convolutional neural nets), I recently finished producing this set of videos: [https://www.packtpub.com/big-data-and-business- intelligence/...](https://www.packtpub.com/big-data-and-business- intelligence/python-artificial-intelligence-projects-beginners-video)

</comment><comment><USER20> I've learned a ton from [https://www.kadenze.com/courses/creative- applications-of-dee...](https://www.kadenze.com/courses/creative-applications- of-deep-learning-with-tensorflow/info)

</comment><comment><USER21> As much as I love Ng, I vastly prefer Hinton's lectures. Something about that English accent.

</comment><comment><USER22> If you speak french, I would recommend Hugo Larochelle channel:

[https://www.youtube.com/user/hugolarochelle](https://www.youtube.com/user/hugolarochelle)

</comment><comment><USER23> I took the coursera specialisation one week ago. It takes you from the very basics to some more complex modules like keras or tensorflow. If you are into it and have time, the whole 4 courses can be done in the free week: [https://www.coursera.org/specializations/deep- learning](https://www.coursera.org/specializations/deep-learning)

</comment><comment><USER24> Fast.ai, you can checkout the forum here: [http://forums.fast.ai/](http://forums.fast.ai/)

</comment><comment><USER25> I'll add another vote for course.fast.ai since I'm currently working through it. The instructors are serious about delivering a practical course that will get you right into the process of training and playing around with the code. Also, one of the best parts of their courses (they're offering a few simultaneously) is the community of learners that hang around on the forums.

</comment><comment><USER26> I found the "Bay Area Deep Learning School" 2-day lecture series to be very good:

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

[https://www.youtube.com/watch?v=9dXiAecyJrY](https://www.youtube.com/watch?v=9dXiAecyJrY)

</comment><comment><USER27> A pretty short introduction to machine learning created by myself: [http://lausbert.com/2018/01/14/the-shortest-introduction- to-...](http://lausbert.com/2018/01/14/the-shortest-introduction-to-machine- learning/)

</comment><comment><USER28> Ideal to practice, learn, and teach machine learning:

[https://bigml.com/ml101](https://bigml.com/ml101) [https://bigml.com/education/videos](https://bigml.com/education/videos)

</comment><comment><USER29> MIT 6.034 Artificial Intelligence, Fall 2010

[https://www.youtube.com/watch?v=TjZBTDzGeGg&list=PLUl4u3cNGP...](https://www.youtube.com/watch?v=TjZBTDzGeGg&list=PLUl4u3cNGP63gFHB6xb- kVBiQHYe_4hSi)

</comment><comment><USER30> getting your feet wet

andrew ng's machine learning course: [https://www.coursera.org/learn/machine- learning](https://www.coursera.org/learn/machine-learning)

to get up to date on convnet architecture

Fei-Fei Li and Karpathy's cs231n: [https://cs231n.github.io/](https://cs231n.github.io/)

if you want to go deep

geoff hinton's neural networks for machine learning coursera: [https://www.coursera.org/learn/neural- networks](https://www.coursera.org/learn/neural-networks)

</comment><comment><USER31> Andrew Ng's deeplearning.ai course is pretty accessible for beginners.

</comment><comment><USER32> How about Microsoft's AI School [https://aischool.microsoft.com](https://aischool.microsoft.com)

</comment><comment><USER33> this talk really enlightened me: [https://www.infoq.com/presentations/neural- networks-introduc...](https://www.infoq.com/presentations/neural-networks- introduction)

it is not a full course, but more an introduction.

</comment><comment><USER34> Fast.ai

</comment><comment><USER35> Can we name the links so that we know what each is? @mindcrime

<comment><USER2> I would have but I was half asleep when I first posted that. Luckily someone else came along and labeled them in a reply. :-)

</comment></comment><comment><USER36> Just recently I have written a "Machine Learning for Web Developers in JavaScript" blog post [0]. If you are a web developer, it might be interesting for you. It outlines my approach of learning it and gives a couple of great resources for JavaScript enthusiasts. Otherwise, I will just post a couple of the materials I used below. It's not only video courses, because I believe it's always useful to stimulate all senses.

\- [0] [https://www.robinwieruch.de/machine-learning-javascript- web-...](https://www.robinwieruch.de/machine-learning-javascript-web- developers/)

Podcast:

\- [http://ocdevel.com/podcasts/machine- learning](http://ocdevel.com/podcasts/machine-learning)

Courses:

\- [https://www.coursera.org/learn/machine- learning](https://www.coursera.org/learn/machine-learning)

\- [https://de.udacity.com/course/machine-learning-engineer- nano...](https://de.udacity.com/course/machine-learning-engineer-nanodegree-- nd009)

\- [https://www.coursera.org/specializations/deep- learning](https://www.coursera.org/specializations/deep-learning)

\- [http://course.fast.ai/](http://course.fast.ai/)

Books:

\- [https://www.amazon.com/gp/product/B014X01SS0/](https://www.amazon.com/gp/product/B014X01SS0/)

\- [http://www.deeplearningbook.org/](http://www.deeplearningbook.org/)

\- [http://neuralnetworksanddeeplearning.com/](http://neuralnetworksanddeeplearning.com/)

\- [https://www.safaribooksonline.com/library/view/deep- learning...](https://www.safaribooksonline.com/library/view/deep- learning/9781491924570/)

Math:

\- [http://www.fast.ai/2017/07/17/num-lin- alg/](http://www.fast.ai/2017/07/17/num-lin-alg/)

\- [https://www.khanacademy.org/math/linear- algebra](https://www.khanacademy.org/math/linear-algebra)

\- [https://www.khanacademy.org/math/statistics- probability](https://www.khanacademy.org/math/statistics-probability)

\- [https://www.khanacademy.org/math/calculus- home](https://www.khanacademy.org/math/calculus-home)

JavaScript ML:

\- [https://bri.im/](https://bri.im/)

\- [https://github.com/javascript-machine- learning](https://github.com/javascript-machine-learning)

</comment><comment><USER37> tried fast.ai?</comment>


Black box trading: why they all blow up - <AUTHOR> http://globalslant.com/2015/06/black-box-trading-why-they-all-blow-up/ <comment><USER2> This justifies Nassim Taleb's Black Swam.</comment>


How UI-driven state increases accidental complexity - <AUTHOR> https://evgenii.info/ui-driven-state/ <comment><USER3> The proposed approach is correct for the proposed use-case. The problem is, lots of UI state isn't handsome, core data like in this example. What about storing the width of a resizable panel? Or the state of a dropdown that can be open or closed? Do you create a dozen little flags in your store for these? Or do you put a flag on each domain object (todo list item, for example) that's not actually relevant to your business logic (you don't want dropdown state getting stored in your database)? Typically you'd make this a local flag internal to each component instance, but what happens when something else in your UI cares about it and has to respond to it? And any of these answers will bind it to your UI concerns, in all different ways. In fact, this state is _directly_ UI-pertinent. It doesn't mean anything _outside_ of the UI.

There are no catch-all answers to these questions. In every case, when you decide where to put your state, you're making compromises. Often, very uncomfortable ones. It is my opinion that the most intrinsically hard thing about building and maintaining UIs is managing state. Unlike most software where "state" is really just either data or an implementation detail along the way to producing output, UIs have real, irregular, messy state baked into their bones. State that can't be eliminated by refactoring, because it really means something.

<comment><USER4> The way I handle this, at least in React, is to create a context provider that handles my component's view state, then write my UI element as a consumer of that view state by wrapping it in an HOC. Then, if any other component wants to subscribe to the particular user interaction that drives the component I'm writing, they can simply tap into the existing context with an HOC that I've already written for them.

This way view state is kept outside of my global store, my UI component and its state controller is fully composable and extractable (meaning more reusable), and any other UI element within the same context can view and update my UI component as it pleases.

Another great thing about this is that you can scope your view state (or context) however you want. You can put it on the page level, the app level, or really wherever you want. You don't have to worry about cleaning up or resetting state because the context provider will be unmounted when the user navigates away (unlike a redux store).

<comment><USER5> Can you describe this implementation with just vanilla js? What's the gist here, you're using namespaced events? I'm just curious what this would look like outside of the world of React.

<comment><USER4> There are a lot of approaches you can take with vanilla js, but if your UI follows a component architecture that's modeled as a tree (App > Pages > Widgets), what I'm saying is that you take all of your interactive UI components and separate them into two nodes (a parent and a child). The parent P holds the state and provides callbacks to all descendants, one of which is the child C that you are writing. C is a pure component, meaning it holds no state and only invokes callbacks. You can put any number of "display" components in between P and C, but they should still be able to communicate.

Now, if any components you build in the future also need access to P's state, you can easily implement it as a new pure component that is a descendant of P. Since it has access to the callbacks, it will be able to update our original component C by invoking them.

With this setup, your app is basically separated into two "classes" of components, providers and consumers. Each provider holds the state and callbacks specific to itself only, which means you can easily pull out an individual provider and consumer to reuse in a new place (instead of being dependent on a global store).

The biggest benefit here is that future components can interact with P and by extension C without changing any code in P or C. Furthermore, if you want two parallel widgets with independent state, you can just create two instances of P as siblings, with C as descendants of both of them. If you wanted to do the same with a global store, you would most likely have to update your implementation to support parallel state tracking.

Another benefit is that you don't have to "clean up" the state when P is discarded. For example, if you are using a global store, and you navigate to a new page, you have to implement a callback to clear the widget state from the global store or risk loading stale state when the user navigates back. With this approach, since P has been removed from the tree, its state will be discarded along with it.

The only stuff I put in my global store is stuff that is actually relevant to my entire application. For example the user's username and preferences.

<comment><USER5> So my initial feeling is that it almost seems like you are reimplementing base React. Isn't this effectively prop drilling, with a bunch of child components lifting state up to the global parent component (so that they all get updates?). Apologies if I'm simplifying it.

<comment><USER4> Well I'm using React so I can't be re-implementing it :)

I'm not advocating for any ground breaking paradigms here, I guess my only point is that the common advice to just throw everything into Redux (global store) is bad advice. You should only put global state into your global store. The common alternative is to silo state and functionality/UI into one component. I'd argue the third alternative, taking the best of both worlds, enables far more productivity. Basically creating mini-Redux stores that are only focused on one bit of user interaction. These are far more reusable, and since they're scoped locally they eliminate a lot of edge cases (and they're composable!).

<comment><USER6> This sounds quite nice. I wonder if proper Redux stores could be used for that (because you can create many of them).

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> Don't model data based on the component hierarchy, but model it in the best possible way. But the "best" approach depends - the same trade-offs as in database schema design applies here.

If most operations require data joins then pick a de-normalized structure. Then most data is often available with a single hash lookup. Though this makes updates difficult and mistakes can and often do lead to inconsistent data.

A normalized data-structure which use ids to refer to related elements makes it easy to add, update, and delete entities; but reads might require multiple joins which in turn makes the code complex.

We can choose between the two by listing out the possible operations and deciding which cases are more frequent. But this is often a moving target in a growing application.

The best approach I've so far found is to design data structures in a way that "invalid states are impossible". I will not link to Yaron Minsky and Richard Feldman's excellent talks on this here. This principle often results in elegant data structures that would've eluded me otherwise.

The second addition that is necessary is to use a statically typed language. Elm, Reason, and PureScript are the only choices in front-end at the moment because of soundness, sum/union types, and exhaustive pattern matching. A typed functional language makes refactoring an easy, mechanical, and reliable process which suddenly makes our code much more malleable and hospitable than before.

<comment><USER8> I believe fable, f# transpiled via babel, would also fit into your list of elm reason and pure script

</comment></comment><comment><USER9> Another angle to consider is that even within the context of UI state, the natural shape of the data may not match the renderer's state.

For example, if you're building a "pong widget" \- the UI state is pretty straightforward across the board (paddle position, ball position, etc.) - <USER2> that's going to have an "impedance mismatch" when targeting DOM vs. GPU. The former may want things in a left-to-right tree structure[0], the latter may want paddle-meshes first regardless of their position on the screen[1].

Separation of concerns is a wonderful- even essential thing, but can be tricky for large real-world projects.

[0] that's not _really_ a problem here - CSS grid with named areas could solve it in this specific use-case

[1] e.g. to avoid shader switching

</comment><comment><USER10> The store is just a global variable. That's all it is, dressed up pretty.

You still have to structure your data, and scope it properly. Some of the state will live in the store, and some in the components. It will be different from application to application.

</comment><comment><USER11> > The most of Redux-applications look alike. They have a similar file > structure and reasonable test coverage. They use the same middlewares and > same libraries to force immutability. The developers, who work on them, use > the same devtools.

This assumption is not really correct in my experience - most of the projects I worked on use redux, but some of them use ducks/feature driven approach, some have reducers separate from components. Some use sagas, some thunks and rare examples use hooks/no sidefx management at all. None use immutablejs and some use immer to discard pain of doing deep {...oldState, field: {...oldStateField, val: newVal}}. What author describes is good advice though, the whole idea is you only keep actually global state normalized and use selectors to construct the representation you need.

</comment><comment><USER12> The more obvious solution here would be to use a selector instead of using the state directly. Then your 'view' of the data is not tied to the underlying structure of the state.

Sure, you can denormalize too - but all the more reason to use selectors then to restructure your data.

</comment><comment><USER13> Controller. You need a controller. Or a smart model, in this simple case.

That's what react/redux has done to you, selling this 'immutable functional' flavoured thing. While it is immutable at the programming surface, it is actually a series of complex updates with little to no help from the 'store' for convenient access. In pure js, when you want project.tasks, you just:

      class Project {
        get tasks() {
          return db.tasks.filter(x => x.project_id == this.id && !x.deleted)
        }
      }

      class Task {
        get project() {
          return db.projects.find(x => x.id == this.project_id)
        }
        del() {this.deleted=true}
      }

      db.tasks = [].map(Task)
      db.projects = [].map(Project)

      ... in a view:
      h(button, {bind:[cr, 'add_task']}, '+')
      cr.project.tasks.map(task =>
        ...
        h(check, {bind:[task, 'done']})
        h(button, {bind:[task, 'del']}, 'x')

      ... in a controller:
      add_task(project) {
        db.tasks.push(new Task({project}))
      }

In "immutable functional state transformer based on async-dispatched store", which these re-whatever buzzwords are, you cannot have neither smart data items, nor a good controller that could join unrelated objects together, nor recombinable data sources, nor nice testable api boundaries. And when someone whispers MVC, you think about web 1.0 patterns, with it's "MC in MVC is backend roundtrip" meaning.

This particular example is a set of five dead-simple classes (DB, Project, Task, TaskListController and TaskListView), almost all orthogonal and useful/testable on their own. Easy for imperative thinking and managing^, cause UI is suddenly imperative. You constantly _battle_ with immutability, lack of control, state copy-transfer and tons of boilerplate for a simple action, can't you see? You're doing a monad bind operation by hand, because there is no do-notation in your language, and where there is, it exists and is called "do" for a reason. How did they miss that completely? /rant

^ e.g. want to see deleted tasks? Write a getter in a controller or a db (depending on locality requirements) and use it in a view as if it was a pojo array. Reimplement on demand to leave your tests and logic intact.

<comment><USER14> Isn't this what selectors are for?

<comment><USER11> It is, gp is talking about the tech they don't grok.

<comment><USER13> Maybe.

I don't grok how one can write 100+ ceremony loc to filter a todo by a ".completed" flag and still think it is okay to burn a barrel of cash and half a day to implement that [1]. I also don't grok how this approach can work any "faster" or battery/memory-saving or be used sanely in apps slightly bigger than my generic todolist. It is both millions of dollars of bootstraps, boilerplates and learning curves for what supposed to be a simple logic.

Maybe I'm wrong, but it feels almost like a conspiracy to justify 6.5-figure contracts and nothing more. And the rest of developers just rationalizing around this phenomenon.

[1] [https://redux.js.org/recipes/computing-derived- data](https://redux.js.org/recipes/computing-derived-data)

</comment></comment></comment></comment><comment><USER15> That second "model" is insane... is that actually something people do?

<comment><USER16> Oh yes.

Rushing to the first workable solution, no code review to speak of, deploying, open the next issue. Repeat.

</comment></comment><comment><USER17>
      In contrast, it doesn't happen with a denormalized, UI-agnostic state:

Isn't it the other way around? the UI-agnostic state IS the normalized version; the UI-aware state ready to be consumed is the denormalized one.

The choice is pretty simple to me: keep the State normalized, de-normalize it in selectors for consumption in the UI. Those selectors will look pretty much the same as the reducers you'd be writing anyway.

<comment><USER18> Came just to post this. The state he's described is definitely normalized, and the UI-specific one is denormalized.

And I think your advice is exactly right: project your normalized state into a view that's useful for consumption by other components. Basically, the same pattern we've been applying to relational databases for decades.

</comment></comment><comment><USER19> It's an interesting tension.

One reality is that you can model the domain really well, keep it decoupled from the UI, and be able to maintain the app for the long term. Unfortunately if you have any neurotypicals involved they are going to feel mentally and maybe even physically uncomfortable from the discipline and won't rest until it is all tangled up again.

Another approach is to make the system very shallow, design the data structures to represent the UI you want directly, and hopefully gain enough in simplicity that you can deal with long-term evolution in creative ways such as end-to-end versioning.

The difficulty of reconciling the two has been one of the problems with UML, RDF, Graph Viz, Low Code, etc.

Some of the description of a system is unrelated to how it is visualized, yet, if you don't support manual layout and routing the visualizations you make will be meaningless. (In 2020 people are still too polite to tell the makers of hairball graphs that they should go back to the drawing board, but in 2005 there was a "emperor's new clothes" phenomenon where people didn't trust their instincts -- at least now they'll be honest with somebody else.)

</comment><comment><USER20> I wish there was more experimentation in the front end landscape. Right now every major framework mixes state, logic and view. It doesn't matter if your state and logic is extracted into hooks, at the end of the day you're still mixing things by importing modules that directly add state and logic to components. I'd love to see a non-trivial app written __without using a single useXXX or class component__. The only thing your view layer is allowed to do is dispatch an action, or call an effect, which is interpreted outside that view layer. Of course this raises all sorts of questions, such as what about 100 instances of the same dropdown component which now all need to store their state somewhere. But I'd still like to see what working with that would feel like. I think The Elm Architecture would be pretty close to that (or exactly that, I don't know).

(I'm not saying the above would be better than what we have, just that it seems like it should be properly explored)

<comment><USER21> I mean... have you heard about redux? This is pretty much what you are describing. If you are looking for UI experimentation js framework are a good resource ;-)

I have used redux in a medium sized app.

The advantage is that there are lots of documentation. Developper can lean on those resources and the result is an architecture that is shared easily among multiple teams.

The disadvantage is that handling asynchronous effects is unclear. Also sometimes adding a flag to manage some subcomponent state require a lot of work. It also clutters your centralized state. It can also be a pain to manage forms this way. And by that I mean managing the state of a form that is in the process of being filled.

Currently my favorite way of designing js apps is a mixed approach. Put all your business code in model classes. Only centralize the state that is important to your application. Sprinkle local states when appropriate. Use hooks & context to inject your model classes in the right components.

<comment><USER20> Haha I should have mentioned this probably but yes I use redux a lot. The thing is that I suspect that the vast majority of people mix and match redux and local state. And what I have in mind is a strict, 100%, no exceptions separation. Just for experimentation purposes.

> The disadvantage is that handling asynchronous effects is unclear.

To be honest to me this is one of the areas where redux really shines. I've had great success with both redux-saga and redux-observable

</comment></comment></comment><comment><USER22> I believe that both approaches make sense at appropriate app layers, but the key is the ability to handle data structure evolution.

Being able to change data schema with little overhead allows to operate on a less normalized structure and adjust it more frequently. Meanwhile, designing a highly normalized schema and implementing complicated queries takes time and still doesn't make it entirely proof against the future.

Nitpick: UI-agnostic data schema example is what conventionally is referred to as _normalized_ —closer to a theoretical canonical form, independent of query convenience at runtime. The other example, where tasks are child nodes of a project, would be the denormalized one.

</comment><comment><USER23> I have mixed feelings about this - partially because a so called "UI State" stores relations between types. Flat stores are a lot like simple tables. I've yet to be convinced one approach is superior to the other. I agree with container components and it's the containers job to shape the data. In theory if we had M projects and N tasks - we'd have to perform M*N lookups to get project names for each task.

Most client applications don't expect a million records, and in the grand scheme either approach might not matter; however, maintaining object relations gives us a clear overview of how data links together, making it easier to debug and demystify.

<comment><USER23> for the example provided by the author - one way without redesigning is perhaps adding a timestamp to the data and adjusting the container component to return sorted results by time added may yield the expected results.

</comment></comment><comment><USER24> It's a trade off. UI-agnostic state is a leaky abstraction. Data doesn't appear out of nowhere - You would have to battle proper data selection on the server regardless. Only this time - with reduced user interaction context.

</comment><comment><USER25> As I see it, the takeaway is that an accidental benefit of SQL is that it can never resemble any UI?

</comment><comment><USER26> This is not accidental complexity.</comment>


Ask HN: iOS developers, where did you learn? - <AUTHOR> I want to start getting into iOS development. I have already done some basics with Android, and want to start on iOS. There are some cousera courses out there, and obviously a lot of Youtube and guides. Is there anything that stands out as being extra effective? <comment><USER2> I attended "The Big Nerd Ranch: ([https://www.bignerdranch.com/](https://www.bignerdranch.com/)) back in like 2001. It was in a remote resort in Georgia. They only had 3-4 employees, IIRC. It was a heads down week, focused, touch. Aaron was amazing and often stayed until 11pm - Midnight because we all were still up implementing what we were learning into personal projects.

I remember that class had folks from all walks of life. A guy who owned an auto-body place, an M.D, a stock broker, Los Alamos Labs, IIRC. My memory is a bit fuzzy here but there were only 8 of us.

</comment><comment><USER3> Start by making an app you want, then when you get stuck on a certain feature (eg: how to get GPS location?) then you google / stack overflow it. After completing multiple apps, you should have a long lasting grasp on multiple iOS dev concepts.

<comment><USER4> This is really the best way to go, it's how I did it.

Tutorials are nice but it's too easy to watch them and go "yeah I get it" - Never actually implement what they're saying because you convince yourself that understanding is all you need, but no implementation (because it's 'boring') means no spaced repetition and you forget most of the material.

Code, get stuck, google, implement, <= that cycle forces you to code it and the delay of you doing this writes it to your memory better

<comment><USER5> Building something and struggling through the myriad of roadblocks seem to be the best way of learning anything programming related. I was a C developer, then started building web apps. I thought I was a good programmer through my C experience, but was amazed with how many technologies I had to learn to build a modern site. None of it was "hard" just a large quantity of stuff to learn and struggle through, one database or library at a time.

</comment></comment></comment><comment><USER6> I tried to build an app and then googled each problem I hit (How to display a button on iOS. How to change label text on iOS. How to play a sound in iOS...). A few apps later and I had a decent grasp on a lot of concepts.

</comment><comment><USER7> Raywenderlich.com was my lifeblood getting started

</comment><comment><USER8> Start simple and get something on your phone - that's how I did it. My personal opinion: stick to official iOS developer documentation and code samples first. That way you'll get a good feeling how e.g. Swift should be used.

My mistake was reading too much open sourced code on Github and adapt a lot of bad coding habits.

The Stanford courses are great too [https://itunes.apple.com/us/course/developing-ios-11-apps- wi...](https://itunes.apple.com/us/course/developing-ios-11-apps-with- swift/id1309275316)

</comment><comment><USER9> One of the ways I learned was through examples provided by Apple. What I would do is download the example, see how it worked and then change something small. Once I fully understood how that feature/component/class worked I would re- implement it with whatever logic I wanted to use in my own application.

This has worked for pretty much any mobile project I've done. I'm currently doing the same thing with ARKit + Vision framework.

</comment><comment><USER10> Went from Android to iOS too. Basically did a lot of back and forth between Stack Overflow and Xcode. Apple documentation was pretty helpful too, I wish I had more time ingesting it. I'd recommend making lots of small projects to experiment one thing at a time. Then build your bigger projects from those small blocks.

</comment><comment><USER11> I think the iOS Books from Big Nerd Ranch are really worth the money. Just build an app while you are reading it, and at the end you should have a solid fundament to continue learning.

Also the Stanford online courses are really really good.

But dont mix to many sources.

</comment><comment><USER12> [https://www.letsbuildthatapp.com/](https://www.letsbuildthatapp.com/) is pretty good, good place to start and get intermediate understanding.

</comment><comment><USER13> I also went the "google each problem" way. I had programming experience before I started.

</comment><comment><USER14> Stanford's online courses.</comment>


How do you program securely? - <AUTHOR>

I'm a sole developer in a non-IT company. I use C# for programming and AWS.I'm responsible for everything here. How would I be able to stay secure? How should I start in order to program securely? Any good Books? <comment><USER2> Start here for some reading material: [https://github.com/paragonie/awesome- appsec](https://github.com/paragonie/awesome-appsec)

Get to know the static analysis tools out there, check out OWASP (for web apps), and learn threat modeling. Application security isn't a one-time thing, it's something that is constantly evolving and changing. Learn the processes, then go into the details from there into your chosen technology stack. I've also read this book, which is good but doesn't go very in deep with the technical stuff: [http://www.amazon.com/Enterprise-Software-Security- Disciplin...](http://www.amazon.com/Enterprise-Software-Security-Disciplines- Addison-Wesley-ebook/dp/B00QFI5S94)

Application security isn't just about programming either. It entails elements of risk management, architecture security, configuration management and many other disciplines to be performed effectively.

</comment><comment><USER3> A personal favorite of mine is this book "Fuzzing: Brute Force Vulnerability Discovery", by Michael Sutton

[http://amazon.decenturl.com/fuzzing](http://amazon.decenturl.com/fuzzing)

Best looking at how hackers are getting in, as-well as programming defensively. Tobias Klein's "A Bug Hunter's Diary" is a good read too:

[http://amazon.decenturl.com/bug-hunter](http://amazon.decenturl.com/bug- hunter)

<comment><AUTHOR> Published in 2007 & 2011\. Are there updated editions?

<comment><USER3> There's a more recent book out titled "The 7 Qualities of Highly Secure Software" (2012) [http://amazon.decenturl.com/secure- software](http://amazon.decenturl.com/secure-software) Worth a read

There's also "Threat Modeling: Designing for Security" [http://amazon.decenturl.com/threat- modeling](http://amazon.decenturl.com/threat-modeling) (2014)

</comment></comment></comment><comment><USER4> Learn threat modeling first. It will change the way you think about programs.</comment>


How to give an Ignite talk - <AUTHOR> http://readncode.com/blog/productivity-today/

<comment><USER2> Excellent talk! Great ideas, practical pieces of advice! You're talented in giving such talks! Keep it up, bro!

</comment><comment><USER3> Great speech. You can tell some serious prep time went into this.

</comment><comment><USER4> This is great advice. Very useful for my next talk.

</comment><comment><USER5> great talk, keep up</comment>


Farewell America - <AUTHOR> http://www.scribd.com/doc/19350839/Wegelin-Document-on-American-Taxes-and-Assets

<comment><USER2> This appears to be identical with <http://news.ycombinator.com/item?id=800869> where there is already much discussion.</comment>


Show HN: Mixing WebGL and HTML, Both Rendered Out in React - <AUTHOR> http://subdued-health.surge.sh/ <comment><USER2> This looks really nice. I did a three.js CAD tool [1] for a client during this last year and really wanted to use something like this, but ended up building something custom.

The main thing I knew I wanted was a declarative specification of the objects in our scene. I knew it would be a nightmare to fiddle around with manually adding and removing bits of the scenegraph in response to input.

Ended up just doing diffs on the part of the Redux state that mapped to the scene, and automatically discarding and re-running the mesh construction code for the parts of the state that changed.

It actually worked well enough and didn't cause any problems I noticed (in terms of convenience of use and performance), but I wouldn't want to re-write it for each project that could use it.

One thing I do wonder about with this though is whether there's really a benefit to using the tag language to specify three.js objects. For folks already familiar with the three.js library it's going to be a nuisance to use the tag language instead, and it doesn't appear to me to be more concise or convenient in any way. But maybe I just feel that way because I've been writing js to construct three.js objects for years :)

[1] [https://www.youtube.com/watch?v=e21tqZebl60](https://www.youtube.com/watch?v=e21tqZebl60)

<comment><AUTHOR> Hey that's amazing, and your tool is really advanced! It's exactly the purpose of this, we're making a cad system as well and it's been hell with the current way of how we chose to do it. We're using redux and getting the scene graph to adapt with manual subscribers - it's led to something that is very hard to understand. That is why i'm writing the reconciler now.

The benefit of using tags (jsx) is that objects become fully managed. The most clear indication to me is still effects. [https://codesandbox.io/embed/mo0xrqrj79](https://codesandbox.io/embed/mo0xrqrj79) You can drop that in and it works. Make it conditional and once it gets unmounted the render loop goes back to normal. Almost magic, but then again, react for the dom had the same benefits.

<comment><USER2> Your tool looks very cool :)

> The benefit of using tags (jsx) is that objects become fully managed

I'm not sure I follow here. I assume that by 'become fully managed' you mean that React will reconstruct as necessary based on what is declared in the jsx?

So maybe that is just the nature of writing React renderers specifically, the only option for getting your objects managed is to map them to jsx?

> The most clear indication to me is still effects.

This does look much nicer than other examples I've seen of using effects. I have only limited experience with them personally. They weren't needed for our tool. Incidentally I am probably setting up some SSAO on another project today though so I'll be likely be digging more into them later.

<comment><AUTHOR> with managed i mean that the view is now merely a reflection of state. Basically just like with the dom:

        {condition &&
hello
}

The div is there as long as the condition is true. But of course it can now also be a mesh, or a component that can clean itself up after the unmount.

We did this manually before, which usually meant watching out for objects to remove themselves, they'll have to communicate up their hierarchy to inform parents and so on. This wasn't straight forward in three, so there was a lot of prototype hacking and terrible things like that, i'm so glad this will be all gone.

</comment></comment></comment></comment><comment><USER3> This looks really cool. Although I'm not very familiar with React, I can provide some insight into the history of mixing GL/HTML content for anyone that's interested:

Three.js has had something called the CSS3DRenderer for like 5+ years now. It uses CSS 3D transformation effects to proportionally scale/distort HTML content to what the Three.js viewport is doing. It does most of the heavy lifting for you in terms of matrix math, but you still need to write a lot of glue code if you want a unified feel. I worked with it a lot in 2014, and it felt like alien technology at the time. Ultimately I settled on purely immediate mode though, because you can't apply custom post-process effects to DOM content beyond whatever CSS effects offer.

Famo.us as it originally existed launched in 2015 and was all about mixing WebGL/HTML content, but they pivoted shortly after launch. Some interesting developments came out of that, however:

Their VP of Product, Zach Brown, ended up founding Haiku in 2016, and their first product Animator[0] just officially launched for Mac. I view it as a more capable replacement for Adobe Edge, which was a fantastic little tool for animating HTML content. How flexible Animator actually is in terms of mixing GL/HTML content, I'm not sure. It'd probably need to take the modern Adobe Flash approach and decouple the tool output from the underlying client runtime to succeed at that.

Following the famo.us pivot, community members founded a project called Infamous with the goal of keeping the mixed content dream alive. While most people fell away, one person (Joe Pea) did stay the course and has spent the past few years since then developing Infamous[1], which is basically an entire framework built off the premise of mixing GL and HTML content.

I'm not sure if it's ready for prime time yet, but it sure looks good and I'm extremely impressed with Joe's perseverance. Just looking at the commit history messages, you can kind of get a feel for all the little issues that mixing GL and HTML content creates.

[0] [https://www.haikuforteams.com/](https://www.haikuforteams.com/)

[1] [https://github.com/trusktr/infamous](https://github.com/trusktr/infamous)

<comment><USER4> I was one of the core contributors to Famo.us' WebGL engine. Feel free to ask any questions about "mixed mode" (i.e. WebGL interlaced with DOM)

</comment></comment><comment><AUTHOR> PS. Full code for the demo: [https://codesandbox.io/embed/ly0oxkp899](https://codesandbox.io/embed/ly0oxkp899)

</comment><comment><USER5> How do you read this thing? All I see is "React Three Fiber".

It put my laptop on Takeoff mode (fans full speed!) with Firefox.

<comment><USER6> > It put my laptop on Takeoff mode (fan's full speed!) with Firefox. This is > why all this movement to rebuilding a browser in browser is ineffective.

Non sequitur.

Your computer is doing more processing. There's WebGL, which will engage your graphics card. If it is on your CPU, the CPU will consume more power. Depending on your laptop, you could have a discrete graphics card, which will be switched to and consume more power. There are animations, etc.

It is not only because of React. In fact, by avoiding unnecessary DOM changes, it's probably an advantage (although this would have to be measured).

Unless you are telling us that you were playing fortnite or something and your fans didn't spin up, but this thing caused them to spin up.

<comment><USER5> You missed the point that it doesn't work at all, so it is obviously broken in someway in Firefox.

I run multiple VMs and do 3d work (in fact, mostly direct opengl stuff) on my laptop and it hardly ever goes to takeoff mode with just some simple rendering.

<comment><USER7> It's broken in Chrome too - there's no content asides from 'Reach three fibre' and the links. I would have expected at least a description to exist on the page.

<comment><AUTHOR> I ran it both in Chrome and Firefox, seems to be working. Could i bother you for error logs?

<comment><USER8> Well, it appears broken for me... But I don't have any errors in the logs.

Firefox 65.0.1 (64bit), Linux (5.0.0).

There are a couple warnings about a particular extension:

> warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader

The rest just appears to be successful parsing messages.

(But it worked really well in Konqueror & Chromium, so that's something.)

<comment><AUTHOR> I googled that, looks like an issue in FF: [https://github.com/mrdoob/three.js/issues/9716](https://github.com/mrdoob/three.js/issues/9716) Basically i just channel through regular three without creating much of a dependency. If it doesn't work in react-three-fiber, then i doesn't work in threee-js. But they're so big that usually these webGL bugs are either fixed quickly by them, if it's their fault, or they're filling vendor issues.

<comment><USER8> three.js have marked it as a wontfix and referred it onto Firefox. It's sitting in Bugzilla as a 6-month+ old bug.

Safari and Chrome both had to work around the same thing, so it seems like there's some contention around who is to blame here.

Either way, three.js is (partially) broken for Firefox users.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> This is really cool. When I learned React in 2016, it was fairly easy for me to pick up the basic ideas because it reminded me of common patterns from my years as an graphics (OpenGL) developer. I also love using WebGL, as I spent a lot of time honing my OpenGL skills, so making apps in WebGL is second nature. I looked for a package like this back then. Great job!

<comment><AUTHOR> I do a lot of 3d stuff at my job, first openGL, then three, but it's too easy to make a mess with the inflating approach and unmanaged variables everywhere. I hope this will make a difference.

<comment><USER10> You could always implement a central store using an implementation of Node streams. By building a custom store you can allow a React component to access and adjust only the values it needs to render (hooks make this prettier), then share the store with your rendering framework. In that scenario React and your WebGL layer share a central "source of truth" with all of the protection from concurrency issues that React states provide.

<comment><AUTHOR> This we had in place, but without react driving the scene we used manual Redux subscribes. Every change meant figuring out what part of the scene graph needed to be added/removed or changed. Basically the same problem one would face with jQuery and the dom.

</comment></comment></comment></comment><comment><USER11> Oh, very pretty. Thank you for your work.

I used React for VR/AR, to interweave three.js (objects, assorted cameras and shaders) with assorted DOM trees (left and right eyes, foreground (pixel aligned) and background (high-bandwidth - video and such)). This looks helpful.

<comment><AUTHOR> That would be one of the things i would love to explore. Does three do this automatically or is there something the app needs to specifically calculate?

<comment><USER11> I'm on linux, and thus a custom stack, from tracking to UI. With three.js providing only bare rendering. It's not a path I'd recommend.

Most current VR/AR exploration uses Unity (Windows) on vendor platforms (SteamVR (Windows), ARKit, etc) and Vive/Rift/WMR/phone hardware.

Three.js is focused on WebVR. WebVR has been Windows-only. And very not transparent about status (very "aspirational" reporting). I fuzzily recall some year-ago VR work in a three.js dev branch. You might also look at A-Frame[1] and AR.js[2]. But this is not an area I keep track of.

The three.js WebVR folks do aspire to "automatically". Historically, it very _very_ hasn't been. Add more "very"s.

Now, big picture, I'd be unsurprised by the transition to AR/VR being shockingly rapid. And unexpectedly soon. So there might now be some path that "just works". And it could be worth starting to track, so if there's a new niche you might like, you're aware of it.

But historically... VR, noun: A field covered in hirsute yaks. And the trampled bodies of people's years, expended shaving them in hope of wonderful fruit, while it was still unripe.

[1] [https://aframe.io/](https://aframe.io/) [2] [https://github.com/jeromeetienne/AR.js/blob/master/README.md](https://github.com/jeromeetienne/AR.js/blob/master/README.md)

</comment></comment></comment><comment><USER12> Here is a webgl project I've been working on that is written in gopherjs. You will have to quickly register to play with it.

[https://imetatroll.com](https://imetatroll.com)

Map Editing

[https://www.youtube.com/watch?v=CE2Apyf- KOE](https://www.youtube.com/watch?v=CE2Apyf-KOE)

Angled View of the Scene

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

</comment><comment><USER13> Brilliant. Bravo.

<comment><USER14> Agreed. I just forwarded this to our designer. If this works well enough, we might end up with a few slick effects on our new react website. We've been using css transitions for a while and they add some playfulness to the UX. But this is way more impressive.

<comment><AUTHOR> Glad to hear that. If you need anything, ping me on github, i'm open to add functionality.</comment></comment></comment>