<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeremy Noring on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Noring on Medium]]></description>
        <link>https://medium.com/@jeremy.noring?source=rss-dcd31e99ddb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vqTCobrFxtXwdiiWuWGP6Q.jpeg</url>
            <title>Stories by Jeremy Noring on Medium</title>
            <link>https://medium.com/@jeremy.noring?source=rss-dcd31e99ddb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:06:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeremy.noring/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[More Perfect Engineering]]></title>
            <link>https://medium.com/@jeremy.noring/more-perfect-engineering-616f0311f7cc?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/616f0311f7cc</guid>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 23:10:29 GMT</pubDate>
            <atom:updated>2020-01-25T23:13:28.770Z</atom:updated>
            <content:encoded><![CDATA[<h4>Better people, practices, patterns and processes</h4><h3>Gender bias, hiring objectively, and fostering growth among females in engineering</h3><p>Hold on to your butts. This one’s gonna be messy.</p><p>Full disclosure: I work for <a href="https://www.hirevue.com/">HireVue</a>. We make products for video interviewing, automated assessments, talent identification, etc. Part of the reason I’m interested in this subject is: I’m deeply concerned about fairness in hiring.</p><p>But also, more generally speaking, I’m interested in what we can learn from the science around gender bias to change how we hire, mentor and grow our engineers. I want to spend some time talking about both the current research in science/engineering involving gender bias, and then what sort of things engineering might consider to improve the situation. This will be a multi-part posting, because there’s a lot of research on this subject.</p><p>Let’s discuss:</p><h4><a href="https://www.pnas.org/content/pnas/109/41/16474.full.pdf">Science Faculty’s Subtle Gender Biases Favor Male Students</a>, Corinne A. Moss-Racusin, John F. Dovidio, Victoria L. Brescoll, Mark J. Graham, and Jo Handelsman</h4><p>In this 2012 study, the authors sent two nearly identical resumes to 127 science faculty members at research oriented universities. The only thing different between resumes: <em>the first name of the candidate was either Jennifer or John</em>. They picked a roughly equal number of male and female science faculty to send these resumes to; these faculty were asked to “…provide feedback on the materials of an undergraduate science student who stated their intention to go on to graduate school, and who had recently applied for a science laboratory manager position.” Faculty were specifically asked to evaluate:</p><ol><li>Perceived competence of the student,</li><li>Hireability,</li><li>The extent to which the student was deserving of faculty mentoring, and</li><li>Salary offers</li></ol><p>Figure 1 paints a pretty grim picture of the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*79XPRAdR1-fUCQNNjthtiQ.png" /></figure><p>Across the board, female applicants were seen as less competent, less hirable and less worthy of mentorship. However, Table 1 was what really blew my mind:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uyJ48yX0xFT1G48nuFe6w.png" /></figure><p>Whoa. The gender of the science faculty <strong>did not matter when evaluating a female target student</strong>; there was a statistically similar difference in competence, hireability, salary and how deserving the candidate was of mentorship. Simply put, women discriminated against women just as much as men did. This is one of those results that should remind everyone that bias is complicated and surprising.</p><p>Lastly, faculty participants’ scientific field, age, and tenure status had no effect on the results; the bias was pervasive among faculty and not limited to a certain subgroup.</p><p>My takeaway from this study:</p><ol><li>Gender bias is scientifically demonstrable — even as recent as 2012 — among a cohort I would expect to be less prone to bias (academics are decidedly sensitive to this subject).</li><li>Male and female faculty both discriminated against a female applicant in a surprisingly similar way.</li><li>A female candidate who is hired is seen as less worthy of mentorship and compensation than an equivalent male candidate.</li><li>This research implies an engineering department could hire a weaker candidate strictly on the basis of gender, race, etc.</li><li>I suspect many of these academics think “awareness” is sufficient; it is clearly not (unfortunately bias doesn’t care how “woke” you are). I don’t say this to be antagonistic; I say this because it’s clear understanding bias and combating it on a societal level are two entirely different things.</li></ol><p>I particularly found the “mentorship” disparity unnerving, because it implies once someone is hired they may not be afforded equivalent support as their male counterpart — this will undoubtably impact their long-term growth as an engineer, for example.</p><h3>What Do We Do About This?</h3><p>This is a tougher question, that doesn’t have clear answers. Here’s my thoughts:</p><ul><li>Bias is more complicated than most people assume.</li><li>I see little evidence that humans are good at making hiring decisions (i.e. <strong>the status quo is unimpressive to me</strong>). A simple name change on a resume leads to statistically significant discrimination. Not only is this bad business, but it is unethical.</li><li>The evidence from this study implies: we cannot improve bias simply by hiring people from a disadvantaged group. (There may be other reasons to do this, however)</li><li>Compensation for a position should be done solely on the basis of qualifications, to the best of the business’s ability. No more “off the cuff” pay decisions by some random manager; the business should look at people doing equivalent work and ensure the person being hired is compensated fairly compared to their cohort, or a comparable cohort of individuals.</li><li>Onboarding, training, mentorship and long-term growth should have a goal of being process driven and standardized across candidates.</li><li>Companies should be measuring their <a href="https://en.wikipedia.org/wiki/Disparate_impact">disparate impact</a>. And frankly, I believe it should be made publicly available.</li><li>Companies should constantly be measuring if compensation is fair, and they should be required to report statistics on their compensation among impacted groups. This data should also be made publicly available.</li><li>Interview/hiring processes should be standardized, ask a common set of questions, and have consistency between candidates.</li></ul><p>Lastly, I do not believe we can ever fully eliminate bias from our process — we are all human, and to err is human. But that is not to say we can’t do better. I believe we should all be striving towards “more perfect,” and while this paper does not paint a rosy picture, it does make it clear we can improve dramatically if we decide to do so.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=616f0311f7cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regrettable Code, Episode 1]]></title>
            <link>https://medium.com/@jeremy.noring/regrettable-code-episode-1-767dc1b92bd1?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/767dc1b92bd1</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Sun, 27 Jan 2019 21:27:33 GMT</pubDate>
            <atom:updated>2020-05-29T17:49:47.689Z</atom:updated>
            <content:encoded><![CDATA[<h4>It’s easy to talk about pretty code. Let’s talk about nasty code and see what we can learn from it.</h4><h4>Background</h4><p>The product I was working on has a concept of an Account. On a given Account there may be one-to-many Teams to which users belong. There was a RESTful API that allowed querying various settings of Account and Team objects of the form</p><pre>/api/v1/features/team-&lt;id&gt;</pre><p>For example, /api/v1/features/team-21 would return all features of team 21. There was also a form of the endpoint that would return <em>all</em> teams and their respective settings:/api/v1/features/team-*</p><h4>The Problem</h4><p>In a nutshell, on some accounts with many teams, querying for team-21 was slow. Querying for team-* was <em>exceptionally slow — </em>for an account with 500ish teams, it would easily take ten to fifteen seconds to return a response.</p><h4>Let’s Profile!</h4><p>My initial gut was: someone probably stuck a database query in a loop or something silly like that, and I’d fix it with a simple change to make a single database call. To confirm this hypothesis, I did a quick profile.</p><p>This code was in python, so cProfile was a quick way to get some timings against a production account. A call tocProfile.run(&#39;features = _inner_fetch_all_features(&quot;team-*&quot;, account_id)&#39;) gave me results. And the results were very, very unexpected.</p><p>The first profile returned in 11.935 seconds. The first thing that leapt out was this code was spending an extraordinary amount of time in some class called AttrDict :</p><pre>ncalls  tottime  percall  cumtime  percall filename:lineno(function)</pre><pre>...</pre><pre>11825    0.049    0.000    0.060    0.000 attrdict.py:26(__getattr__)<br>384912/432    1.762    0.000    7.012    0.016 attrdict.py:39(deepcopy)<br>454032/64800    0.650    0.000    6.943    0.000 attrdict.py:49(&lt;genexpr&gt;)<br>    23650    0.023    0.000    0.023    0.000 attrdict.py:58(__setstate__)</pre><p>…<strong>roughly 59% of the entire time spent</strong> was in AttrDict. Whoa. Did not expect. The other item that was fishy involved a library called pickle :</p><pre>46859    0.178    0.000    0.347    0.000 pickle.py:1033(load_dict)<br>        3    0.000    0.000    0.000    0.000 pickle.py:1093(load_global)<br>        3    0.000    0.000    0.000    0.000 pickle.py:1128(find_class)<br>    11825    0.032    0.000    0.088    0.000 pickle.py:1135(load_reduce)<br>   225226    0.497    0.000    0.797    0.000 pickle.py:1156(load_get)<br>   106928    0.180    0.000    0.258    0.000 pickle.py:1170(load_put)<br>   175038    0.393    0.000    0.626    0.000 pickle.py:1199(load_setitem)<br>    11825    0.091    0.000    0.271    0.000 pickle.py:1217(load_build)<br>    58684    0.081    0.000    0.117    0.000 pickle.py:1256(load_mark)<br>        1    0.000    0.000    0.000    0.000 pickle.py:1260(load_stop)<br>        1    0.011    0.011    4.788    4.788 pickle.py:1386(loads)<br>        1    0.000    0.000    0.000    0.000 pickle.py:83(__init__)<br>        1    0.000    0.000    0.000    0.000 pickle.py:835(__init__)<br>        1    1.183    1.183    4.777    4.777 pickle.py:851(load)<br>    58684    0.094    0.000    0.132    0.000 pickle.py:876(marker)<br>    88873    0.230    0.000    0.348    0.000 pickle.py:917(load_int)<br>        2    0.000    0.000    0.000    0.000 pickle.py:967(load_string)<br>    36414    0.116    0.000    0.168    0.000 pickle.py:985(load_unicode)<br>    11825    0.027    0.000    0.056    0.000 pickle.py:999(load_tuple)</pre><p>The remaining 40% was spent in pickle , which was some library for serializing/deserializing python objects.</p><p>I was a bit stunned at this point; <em>not a single slow spot involved database code, </em>which meant this was purely some algorithmic problem in python. And for some reason, it was slow <em>when there were more teams</em>.</p><h4>Those Still Waters Run Deep</h4><p>I decided the first thing I’d go after was AttrDict.deepcopy , since that was the slow spot. This also turned out to be a poor assumption, because I didn’t fully understand what this code was doing and why, but we’ll get to that shortly.</p><p>AttrDict looked like so (I’ve removed fluff):</p><pre>class AttrDict(dict):<br>     <em>&quot;&quot;&quot;<br>     Dict that allows attribute access<br>     &quot;&quot;&quot;<br>     </em>def __getattr__(self, name):<br>         try:<br>             return self[name]<br>         except KeyError:<br>             return super(AttrDict, self).__getattribute__(name)<br> <br>     def __setattr__(self, name, value):<br>         self[name] = value<br> <br>     @classmethod<br>     def deepcopy(cls, other):<br>         if isinstance(other, basestring):<br>             return other<br>         elif isinstance(other, collections.Sequence):<br>             assert isinstance(other, list)<br>             return [AttrDict.deepcopy(item) for item in other]<br>         elif isinstance(other, collections.Mapping):<br>             assert isinstance(other, (AttrDict, dict))<br>             return AttrDict(<br>                 (key, AttrDict.deepcopy(value))<br>                 for key, value in other.iteritems()<br>             )<br>         else:<br>             return other</pre><p>So AttrDictwas basically a python dict with some flair. One piece of flair was the ability to access the dictionary members with a dot syntax similar to javascript. So instead of some_attrdict[&#39;blah&#39;], you could write some_attrdict.blah. This code was likely ripped off from stack overflow somewhere, since whoever wrote this <a href="https://stackoverflow.com/questions/2352181/how-to-use-a-dot-to-access-members-of-dictionary">wasn’t the first person to desire this functionality</a>.</p><p>The second part was deepcopy, the offending code. At first glance, it took some object called other and would recursively create a deep copy of that. One interesting side-effect of this was supplied dict objects would be turned into AttrDict.</p><p>The other interesting part was: this code was using isinstance, and abusively. isinstance is pricy, because it needs to check an object’s inheritance hierarchy to see if the supplied object — or some child class — is of the supplied type.</p><p>There was also some pointless asserting (footnote: our asserts run in production. None of these had fired as far back as I had log history for, so they are worthless), and a nonsensical if/else structure.</p><p>So win. I can rewrite this to improve performance and that may help. I changed to:</p><pre>@classmethod<br> def deepcopy(cls, other):<br>     other_type = type(other)<br>     if other_type in [dict, AttrDict]:<br>         return AttrDict(<br>             (key, AttrDict.deepcopy(value))<br>             for key, value in list(other.items())<br>         )<br>     elif other_type is list:<br>         return [AttrDict.deepcopy(item) for item in other]<br>     else:<br>         return other</pre><p>…there was no need to check for string types because they followed the same path as the else path: return other.</p><p>And rather than use isinstance each time, use type once and check for specific types I knew were supported. This change was not without risk: it meant I could no longer properly handle inherited objects like the code previously did. To mitigate this, I confirmed this updated code delivered the same results in production.</p><p>After configuring prod to re-run this code so I could get a clean profile, the bulk of AttrDict now consumed roughly two seconds. <em>Not great</em>, but acceptable. Given this was less than the other offending chunk of code, I decided to move on to pickle.</p><h4>This Must Be The Pickle</h4><p>First, I found where we were using pickle. There was a chunk of code that would fetch account features, that cached them to avoid regenerating:</p><pre>def _all_features(account_id):<br>     cache_key = _get_cache_key(account_id)<br>     account_features = cache.get(cache_key)<br>     if account_features:<br>         try:<br>             account_features = AttrDict(pickle.loads(zlib.decompress(account_features)))<br>         except (...):<br>             ...<br>         else:<br>             return account_features<br> <br>     account_features = _split_features(_query_features(account_id))<br>     cache.set(cache_key, zlib.compress(pickle.dumps(account_features)))<br>     return account_features</pre><p>A basic overview:</p><ol><li>Try to fetch features out of a cache.</li><li>If they exist, decompress with zlib, hydrate them with pickle, and return those.</li><li>If they don’t exist, re-generate them, dehydrate with pickle, compress with zlib, save to the cache and return them.</li></ol><p>After reading this code, I had more questions than answers. A few thoughts/ideas that went through my head:</p><ol><li>The whole reason we were using pickle was definitely because of AttrDict. At some point, someone decided we needed to cache this stuff. But because we were using AttrDict, we needed a way to serialize/deserialize python objects.</li><li>The use of zlib was odd. After consulting a coworker, I learned <em>this was because a cache object had a 1 MB limit, and for accounts with many teams, we had exceeded that limit. So zlib compression was added as a quick stop-gap measure.</em></li></ol><p>The second part kinda floored me; what the heck was pickle persisting that would bump into a 1 MB limit? Also, if all we were ultimately storing was dict/list objects, what did it matter if we used pickle? We could serialize with json.</p><p>I did some quick terminal hacking to see how JSON would compare:</p><pre>In [35]: json_compressed = zlib.compress(json.dumps(account_features))  </pre><pre>In [36]: pickle_compressed = zlib.compress(pickle.dumps(account_features))</pre><pre>In [37]: len(pickle_compressed) <br>Out[37]: 642794  </pre><pre>In [38]: len(json_compressed) <br>Out[38]: 50585</pre><p>…goodness gracious. The compressed payload with pickle is <strong>twelve times the size</strong>. But it gets worse:</p><pre>In [41]: start = time.clock()<br>     ...: json_compressed = zlib.compress(json.dumps(account_features))<br>     ...: <strong>print</strong> time.clock() - start<br>     ...: <br>0.035571  </pre><pre>In [42]: start = time.clock()<br>     ...: pickle_compressed = zlib.compress(pickle.dumps(account_features))<br>     ...: <strong>print</strong> time.clock() - start<br>     ...: <br>1.201328</pre><p>…working with a JSON payload was exceptionally faster — roughly 35x for hydrating/dehydrating the payload. Swapping from pickle to json alone would solve this problem.</p><p>But one major snag: when taking an AttrDict , dumping to JSON, compressing, decompressing and then loading with JSON, we would lose AttrDict entirely — it’d come back as dict, not AttrDict. And updating vast swaths of our codebase that used AttrDict was out of the question. I’d never make it through QA in a reasonable amount of time, nor would I be able to have confidence in such a massive change.</p><p>And then I remembered deepcopy. I could do this:</p><pre>account_features = AttrDict.deepcopy(json.loads(zlib.decompress(account_features)))</pre><p>…when rehydrating, and that would automatically convert dict to AttrDict. Problem solved. And adding one additional deepcopy operation was irrelevant, even though that was the previous offending code. We were already doing hundreds of them (see profile above) and this codepath was called only once.</p><p>Edit: it was pointed out that rather than using deepcopy, it would be preferable to use json.load&#39;s object_hook feature:</p><pre>json.loads( zlib.decompress(account_features), object_hook=AttrDict)</pre><p>…this was roughly 5x better than the deepcopy strategy. Thank you!</p><h4>Except Not Solved :/</h4><p>At this point, it was lightning fast for accounts with small team counts, and 2–3 seconds for accounts with 500ish teams. So I created an account with a thousand teams to get a sense of performance.</p><p><em>I was right back at ten seconds for </em><em>team-*.</em></p><p>It was this moment that I put it together; my problem with this endpoint wasn’t bad python code, although that was a contributing factor. <strong>It was that I had a big-O problem</strong>. If 500 took me 2.5 seconds, and a 1000 took me 10 seconds, that mapped almost perfectly to O(n^2). The underlying algorithmic problem still existed, and it grew with the addition of teams.</p><p>Unfortunately, at this point I had to acknowledge one other frustrating reality of engineering. My improvements were already good enough to get this work through QA. We didn’t have any accounts with more than 500 teams. I asked our QA people to create a new defect for 1000 teams to track the issue moving forward, and closed out the bug ticket.</p><p>As much as I wanted to figure it out and fix it, <em>perfect is the enemy of good enough</em>. Adios, amigo.</p><h4>Git History, A Few Take-Aways, A Few Random Musings</h4><p>I did, however, dig through the git history to figure out what the heck the deal was with AttrDict and pickle :</p><ol><li>It was written five years prior by a junior developer. The intent was definitely just convenience — the ability to do some_attr_dict.blah instead of some_attr_dict[&#39;blah&#39;]. The bad if/else logic and nonsensical asserting also made more sense given a junior developer. At this time, however, the codebase was small and there probably was little consequence to AttrDict</li><li>A few days later, a more senior developer added the ability to pickle this object so we could start caching it. The caching was added to address performance issues. It’s unclear what those performance issues were; there was no clear history on why this was done.</li><li>At some point, when the cache exploded as we gained accounts with more and more teams, some other developer added zlib compression to the caching. I can’t fault this decision; it was an emergency fix when stuff started exploding in production.</li></ol><p>My takeaways from all of this:</p><ol><li>I think adding a wrapper around basic python types like dict and list should be avoided. That decision had serious consequences down the line, for what appears to be nothing more than syntactic sugar.</li><li>It is unfortunate the senior developer didn’t push the junior developer towards simplicity for the sake of simplicity. Although, that brings up:</li><li>It is unfortunate our code review process did not exist at the time AttrDict was written. The original code is the sort of stuff I would have asked be rewritten or justified.</li><li>It is unfortunate the performance issues that warranted pickle weren’t clearly communicated in git history, or some linked defect in an issue tracker. It makes me understand why having clear guidelines around commit messages is so vitally important for large, long-term codebases.</li><li>This is an interesting study in the long-term consequences of a programming choice. It is clear to me this is one of those places where “clever” code had serious consequences and the business would have been better off without it.</li><li>It is clear to me as a senior developer, it is important to mentor junior developers towards <a href="https://en.wikiquote.org/wiki/Ward_Cunningham#The_Simplest_Thing_that_Could_Possibly_Work">the simplest thing that could possibly work</a>.</li></ol><p>And some other random, final musings:</p><ol><li>It turns out there are heaps of language <a href="https://www.thoughtco.com/what-is-a-snoot-1691037">SNOOTS</a> out there who have <a href="http://canonical.org/~kragen/isinstance/">some pretty involved discussions</a> about isinstance; Bjarne Stroustrup even argued against including such a feature in C++, which is kinda mind-blowing since that language can’t seem to find a bell or whistle that <em>shouldn’t</em> be included.</li><li><a href="https://github.com/PyCQA/pylint/issues/1659">pep guidelines implicitly push people towards </a><a href="https://github.com/PyCQA/pylint/issues/1659">isinstance</a>, and that is arguably not a great thing. isinstance isn’t particularly performant, and it absolutely is not the same as type . In digging through git history, I found a merge request where a senior developer went through our codebase mindlessly replacing type with isinstance because pep said so.</li><li>isinstance , type, and string handling <em>suck</em> due to python 2 -&gt; python 3 conversion issues. For a while I was banging my head on deepcopy string handling until I realized I didn’t need to do it at all.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=767dc1b92bd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Did Google cripple Edge’s youtube performance?]]></title>
            <link>https://medium.com/@jeremy.noring/did-google-cripple-edges-youtube-performance-ce5169d3e5f4?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce5169d3e5f4</guid>
            <category><![CDATA[edge]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[chrome]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Wed, 19 Dec 2018 06:47:49 GMT</pubDate>
            <atom:updated>2020-05-29T17:52:46.185Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently <a href="https://news.ycombinator.com/item?id=18697824">this article</a> has been making the rounds on slashdot and other tech sites. The TL;DR of the article is a Microsoft intern insinuates that Google may have intentionally crippled Edge video rendering performance on youtube:</p><blockquote>I very recently worked on the Edge team, and one of the reasons we decided to end EdgeHTML was because Google kept making changes to its sites that broke other browsers, and we couldn’t keep up. For example, they recently added a hidden empty div over YouTube videos that causes our hardware acceleration fast-path to bail (should now be fixed in Win10 Oct update). Prior to that, our fairly state-of-the-art video acceleration put us well ahead of Chrome on video playback time on battery, but almost the instant they broke things on YouTube, they started advertising Chrome’s dominance over Edge on video-watching battery life. What makes it so sad, is that their claimed dominance was not due to ingenious optimization work by Chrome, but due to a failure of YouTube. On the whole, they only made the web slower.</blockquote><p>My initial reaction to this wasn’t “<em>gee, that’s suspicious…</em>” but more along the lines of “<em>wait a minute… I’m pretty sure I’ve written that exact code</em>?”</p><p>I’m a video engineer who has written a video player from scratch, and I have independently positioned a blank div on top of our video element. Here’s source code for disbelievers (apologies in advance for the Angular):</p><blockquote>&lt;div class=”ie-idiot-shield noselect” ng-if=”customSkinSupported” ng-click=”togglePlayPause($event)”&gt;&lt;/div&gt;</blockquote><blockquote>…</blockquote><blockquote>// IE has these insane keypress handlers that totally steal *everything*, and do hideous things to all of our logic.<br> // So far I’ve found no way to disable the player when it has focus. So we use this shield to overlay a faux window<br> // on top of IE to prevent anyone from actually selecting it.<br> .ie-idiot-shield {<br> position: absolute;<br> width: 100%;<br> height: 100%;<br> background: rgba(0,0,0,0.0);<br> z-index: 3;<br> }</blockquote><p>Here’s the git commit message (8/2015):</p><blockquote>Finally, a fix for IE’s insane keypress logic</blockquote><blockquote>By overlaying an unselectable transparent element on top of my video element, I can effectively prevent someone ever from selecting it, and this avoids a huge amount of keypress nightmare logic that currently exists. I’ll clean up the other hacky crap in the html5 lib in a bit, but this should make my life way easier.</blockquote><p>Here’s an alternate hypothesis of what may have happened at google:</p><ol><li>Some product manager in YouTube decided accessibility was a major initiative. Because, y’know, blind people.</li><li>They wanted to add standard keypress logic to their video player.</li><li>They quickly realized nope: &lt;video/&gt; has no such thing. (this subject probably warrants its own blog post; one major omission of the standard is, IMO, standardized accessibility across implementations)</li><li>They quickly realized some browsers are heinous and you want to block their keypress handlers entirely.</li><li>Some programmer found a workaround. The same one I did.</li><li>Some completely separate arm of the business decided to discuss battery life. We’re talking about a company with 85,000 employees here, so this is hardly far fetched.</li></ol><p>Knowing this, here’s a few things to keep in mind:</p><ol><li>The statement by the MSFT intern smacks of someone who too quickly attributes malice where no such accusation is appropriate.</li><li>A “state of the art” rendering engine? Well, apparently it isn’t “state of the art” enough to handle a blatantly obvious test case. It can’t handle <em>something on top of it.</em> That isn’t “state of the art.”</li><li>What precisely is wrong with positioning another HTML element on top of a video element? The whole point of the video element is: it’s a legit part of the DOM instead of some mangy &lt;object&gt; tag like we had prior to HTML5. It is 100% legit to put a blank div on top of the video element, or nearly any other element for that matter. Welcome to the web.</li><li>Why would the already dominant browser in the market go out of their way to cripple some minor player in the field? And to cripple them on a <em>single</em> video streaming site (what about netflix, hulu, prime, etc.)? And knowing full well that 95% of web users honestly don’t care? The argument doesn’t pass the smell test.</li></ol><p>As a video engineer, I have to say this:</p><ol><li>Edge’s WebRTC implementation sucks.</li><li>Edge’s video tag implementation is a confounding factor I won’t miss.</li><li>Edge lacks MediaRecorder, despite repeated requests to MSFT to implement. Ever implement a webassembly version of libvpx and libopus? I have. You know why? Edge.</li></ol><p>Yeah, Chrome is a monoculture, but it’s like the entire collective hive mind of programmers is ignoring that <em>it’s a monoculture for a reason</em>. It’s a monoculture because consumers prefer it. If, as developers, we don’t want a monoculture, then our only option is: make a product consumers find more compelling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce5169d3e5f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[There Are No Long Moves; There Are Only Strong Moves.]]></title>
            <link>https://medium.com/@jeremy.noring/there-are-no-long-moves-there-are-only-strong-moves-c99dbe87f91b?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c99dbe87f91b</guid>
            <category><![CDATA[success]]></category>
            <category><![CDATA[motivational]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[climbing]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Thu, 21 Sep 2017 18:15:57 GMT</pubDate>
            <atom:updated>2017-09-21T18:24:23.920Z</atom:updated>
            <content:encoded><![CDATA[<p>This statement was purportedly made by Lynn Hill. I’m not sure if she actually said this (it’s a bit of climber lore that was passed on to me by way of mouth), but this is who she is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o07mc00N0dr0hcHY." /><figcaption>Lynn Hill on El Capitan</figcaption></figure><p>Who is <a href="https://en.wikipedia.org/wiki/Lynn_Hill">Lynn Hill</a>? She was the first woman to climb a route graded 5.14a (for non-climbers, think of the most difficult thing you think you could climb, and then multiply that difficulty by a thousand), and the first person to free The Nose on El Capitan. The latter accomplishment was unrepeated by <em>anyone </em>for a decade.</p><p>But I think it’s impossible to talk about Lynn Hill without talking about <a href="https://en.wikipedia.org/wiki/Jean-Baptiste_Tribout">J.B. Tribout</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zv0QP7RuUFfMjJPO." /><figcaption>J.B. Tribout rockin’ the 80s euro-trash look</figcaption></figure><p>Who is J.B. Tribout? He was a famous French climber in the 80s and 90s. He is also now somewhat infamous for his claim that no woman would ever climb 5.14. Hill responded to this declaration by flying to France and climbing <em>his</em> 5.14, <em>Masse Critique, </em>and in fewer tries than it took Tribout. Gauntlet thrown, bitches.</p><p>“When people say ‘it can’t be done’, or ‘you don’t have what it takes’, it makes the task all the more interesting,” said Hill. I think her biggest contribution to climbing may have been her unflappable determination. It’s what I love most about this story.</p><p>To be clear, <strong>I don’t want to talk about climbing in this post</strong>. Climbing is frankly pretty boring for non-climbers. If you, dear reader, have ever found yourself stuck in a room of climbers, they were probably talking incomprehensibly about stuff that made no sense to you at all. And probably waving their arms around while doing it.</p><p>I want to talk about what I’ve learned in two decades of climbing.</p><h3>Disclaimer</h3><p>I’m not good at any of this; it is a constant battle. It’s hard, takes practice and perseverance, etc.</p><h3>Break Big Problems into Small Problems</h3><p>This is the <a href="https://www.mountainproject.com/v/the-pipe-dream/105739677">Pipedream Cave</a>, in Maple Canyon, UT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*w_BXdD6qtsWuFs03." /></figure><p>This photo is taken from the back of the cave, looking out. It is a monster. The more proud lines are 100+ feet in length, much of which is dead-horizontal climbing. When you belay someone from the back of this cave, <em>you don’t even have to look up. You look sideways</em>.</p><p>Routes in here are really, really long, and unless you possess ungodly endurance and superb technique, doing any of them is likely a multi-month (year?) siege, where the route has to be broken down into constituent parts, rehearsed, refined, rehearsed again, bled upon, and (hopefully) finally completed.</p><p>These routes are too big to fathom doing all at once. They have to be broken apart, attacked in pieces, and re-combined into one whole.</p><h3>Who You Surround Yourself With is Vital</h3><p>If you aren’t climbing with someone who pushes and motivates you, you will not improve. You should seek out the best climber you can find, and mercilessly exploit them for every ounce of knowledge and expertise they have.</p><h3>Work is Greater than Talent</h3><p>This is Alex Puccio:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S1GfCpsv3e1WpEJ2." /><figcaption>They make her check those guns at the airport</figcaption></figure><p>She’s won the American Bouldering Series ten times, and is arguably the most successful female American boulderer of her generation. She’s clearly very talented, but where she sets herself apart, I believe, is an unbelievable work ethic. And it shows. In the immortal words of Shaq, “Excellence is not a singular act, but a habit. You are what you do repeatedly.”</p><h3>Unfocused Strength is Useless</h3><p>You can be physically strong, but strength has to be applied with a focus. If your technique is poor, you’ll fail. If your footwork is poor, you’ll fail. If your head game is bad, you’ll fail. Strength is a <em>pre-requisite</em> for success, not a defining characteristic of success.</p><h3>Failure is Healthy</h3><p>Non-climbers would look at this and think it looks like failure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Kf3-rvXatzNW5p3n." /><figcaption>Goin’ for a ride</figcaption></figure><p>I look at this and think: mission accomplished, you earned your dinner. Any day where you do not fail means one of two things:</p><ul><li>You weren’t trying</li><li>You didn’t push yourself hard enough</li></ul><p>Falling is not a sign of failure. Falling is a sign that you’re actually applying yourself, pushing yourself, trying to improve your climbing. If you <em>aren’t falling, you are failing</em>.</p><h3>Fear is a Useless Primal Emotion</h3><p>I’m sure a few thousand years ago, fear served me well. But with climbing, it is toxic. Climbing — and many things in life — are about mitigating and managing fear, not being overcome by it. When you are afraid, it is impossible to think clearly and make good decisions. So when you’re in a situation like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ofTWLv9fysz_m_vh." /><figcaption>Jorgeson run out on El Cap</figcaption></figure><p>The only thing fear is going to do is shake you off those holds and send you for a fifty foot ride. It is an impossible emotion to remove entirely — we’re all afraid of something — but it has to be managed. And management of it takes practice.</p><h3>There Are No Long Moves</h3><p>I’m too short.</p><p>I’m not good at that style of climbing.</p><p>I ran out of chalk.</p><p>It’s too hot.</p><p>There was a dog barking/kid yelling/my water tasted funny/etc.</p><p>Cry me a river. Making excuses is pointless. What’s important to focus on is how to salvage today, and what to do better tomorrow. You don’t hear this guy complaining about his missing finger:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1f6h_ukjWx6hAELA." /><figcaption>Pro-tip: power tools are sharp, Tommy</figcaption></figure><p>Think about what you can do today and where you want to go tomorrow. Yesterday is over.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c99dbe87f91b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebRTC pro-tips]]></title>
            <link>https://medium.com/@jeremy.noring/webrtc-pro-tips-98f90acad007?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/98f90acad007</guid>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Tue, 19 Sep 2017 02:18:40 GMT</pubDate>
            <atom:updated>2017-09-19T02:23:51.339Z</atom:updated>
            <content:encoded><![CDATA[<p>A random splattering of pro-tips for creating a product around WebRTC that I’ve learned over the last few years.</p><h3>General tips</h3><ul><li>Use <a href="https://github.com/webrtc/adapter">adapter.js</a> — it’s going to save you an inordinate amount of pain. Otherwise, you have to deal with an incredible amount of browser (and browser version!) nuance that simply isn’t worth your time.</li><li>If you utilize a plug-in, create a polyfill for navigator.mediaDevices.getUserMedia, navigator.mediaDevices.enumerateDevices, RTCPeerConnection, MediaStream and MediaStreamTrack. It’s less work in the long run.</li><li>Don’t allow old versions of Chrome and Firefox. For Firefox, at most I’d support the last LTS version (right now, that’s 52). For Chrome, I’d allow at most the last four-ish versions. Old versions of these browsers open yourself up to all sorts of pain.</li></ul><h3>SFU/MCU</h3><p>If your conferences are any more than a few people, you’ll almost definitely need a <a href="https://webrtcglossary.com/sfu/">Selective Forwarding Unit</a> or a <a href="https://webrtcglossary.com/mcu/">Media Control Unit</a>. General tips:</p><ul><li>Make sure your SFU/MCU supports <a href="https://webrtcglossary.com/bundle/">bundle</a> and <a href="https://webrtcglossary.com/rtcp-mux/">rtcp_mux</a>.</li><li>If doing audio only or video only (think screen sharing) is important, make sure your SFU/MCU supports that.</li><li>Pay attention to the signaling channel. This is a non-standard channel that implements call setup for WebRTC. Make sure it’s a protocol you like, that the exchanges between client and server are reasonable, etc. Ugly wire format for this = debugging hell. Understand it before you commit.</li><li>Make sure your SFU/MCU supports VP8, VP9 and Opus codecs at a bare minimum. H.264 support is also good. Other weird codecs are pretty much irrelevant.</li><li>If you need recording, make sure you test that out. Particularly with packet loss and latency.</li><li>If you’re using an SFU, make sure that SFU implements RTCP termination. Many simple implementations simply forward RTCP traffic from a source to all receivers (and vice-versa) which is incredibly wrong in a number of profound ways.</li><li>I’d recommend beating the crap out of any solution you plan on using with network tests simulating packet loss and delay. The quality of how an MCU handles this can vary dramatically.</li></ul><h3>TURN</h3><p>Sad reality: at some point you’ll have to relay, because in many instances a peer-to-peer connection cannot establish, or it doesn’t make much sense. <a href="https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT">Traversal Using Relays around NAT</a> is the standard way of doing that:</p><ul><li>If you <em>aren’t</em> using a TURN server, your product is going to be a failure on any serious enterprise network. Go get <a href="https://github.com/coturn/coturn">coturn</a>.</li><li>Make sure you have TURN listening on port TCP 443. This’ll let you pick up TCP 443 (and HTTP CONNECT), which is necessary for corporate compatibility.</li><li>If you’re using an SFU or MCU, consider running TURN along-side your software, and forcing everyone to relay through TURN. It’s sixes this way and can actually simplify a few things.</li></ul><h3>Debugging</h3><ul><li><a href="https://test.webrtc.org/">https://test.webrtc.org</a> is a great site to test out webrtc connections. The code is also available <a href="https://github.com/webrtc/testrtc">here</a>.</li><li>chrome://webrtc-internals is awesome. Even more awesome is that same page, but for all the other browsers that don’t support it (about:webrtc in firefox is pretty much a waste of time). You can get that with <a href="http://git clone https://github.com/fippo/webrtc-externals">this extension</a>.</li><li>Always test out your service with Chrome Canary and Firefox Developer. That way you can learn about incompatibilities with your system before they bite you in prod.</li></ul><p>That’s all for now. Feel free to comment with your own hard-earned tips.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98f90acad007" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The fifteen minute WebRTC demo]]></title>
            <link>https://medium.com/hackernoon/the-fifteen-minute-webrtc-demo-3f5cf3a71fc4?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f5cf3a71fc4</guid>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Wed, 26 Jul 2017 00:47:43 GMT</pubDate>
            <atom:updated>2019-05-25T05:51:02.599Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://hackernoon.com/tagged/webrtc">WebRTC</a> tutorials always have something in them like “look what you can do in fifteen minutes!” It is a testament to WebRTC’s <a href="https://hackernoon.com/tagged/design">design</a> that this is even possible: fifteen minutes to get a working peer-to-peer demo is pretty astounding. And by and large, these tutorials are legit: you can get some pretty awesome crap working in well under an hour.</p><p>That said, the difference between a working demo and something ready for production is significant. For example,</p><ul><li>What browsers are you going to support?</li><li>Will it be deployed on corporate networks? Will the solution have to handle proxies and firewalls?</li><li>Is it 1–1 chat, or will it be a multi-party conference?</li><li>How will you help users configure their microphones, speakers and cameras?</li><li>Will you support iOS and Android clients, possibly through a native app?</li></ul><p>…these are….not simple questions. In the most trivial case, everybody is using Chrome and it’s all 1 on 1 chats and it’s generally fairly easy. But the reality is you’re probably going to have a Product Manager of Doom (PMoD) insist you support IE11, Safari, a gaggle of mobile phones, and a room with 2 to 10 concurrent parties. And that’s where stuff gets….hard.</p><p>Let’s start with browsers. Maybe you get lucky and your PMoD only wants Chrome. Yay! Skip to the next section.</p><p>Or not. They want IE11 and Safari. This means: a plug-in. Your options are some <a href="https://github.com/sarandogou/webrtc-everywhere">github projects that use a fairly old version of WebRTC</a>, <a href="https://skylink.io/plugin/">pay Temasys</a>, or roll your own unholy union of open source software, like <a href="https://github.com/firebreath/FireBreath">Firebreath</a> plus <a href="https://www.openwebrtc.org/">OpenWebRTC</a> or <a href="https://webrtc.org/native-code/">Chrome’s WebRTC implementation</a>.</p><p>This also likely means supporting an installer (possibly for both Windows and OSX), potential MPEG-LA licensing issues if you include H.264 support and a doubling/quadrupling of QA effort, since plug-ins frequently behave differently than native implementations in some rather crucial ways. You might also get to deal with other fun stuff like cross-platform drawing models if you opt for the home-grown solution.</p><p>Lastly, even with an installer, inside certain companies users are going to be blocked even from installing. So you’ll need a way to deploy internally in those companies, and handle updates.</p><p>Let’s say your PMoD primarily wants to use your product with fortune 500 companies. Now your problem is: every one of those companies is going to have some god-awful proxy/firewall infrastructure combined with a healthy dose of random anti-virus software running locally that is going to stymie every effort to seamlessly deploy your product.</p><p>You will absolutely need a TURN server, like <a href="https://github.com/coturn/coturn">coturn</a>, and you will absolutely need to support both HTTP CONNECT and TCP 443, because certain network security types don’t seem to understand A) there’s a whole wide world of networking beyond HTTPS and B) UDP isn’t a fad.</p><p>Even with a TURN server and 443 access, there’s going to be networks that simply won’t cooperate. For those, you’ll have to track down some person inside this monolithic company and convince them to grant you access. Good times.</p><p>Lastly, you’ll have to scatter these TURN servers around the world, because your users are world-wide.</p><p>You start to build up a tiny army of servers in AWS.</p><p>Your PMoD isn’t done with you yet. Now they want more than two people in the same conference. The problem is: as you add people to a conference, you’re going to run into <a href="http://mathworld.wolfram.com/HandshakeProblem.html">the handshake problem</a>. Basically, as you add more people, the number of connections will be dictated by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/1*jx2qkohdeaNEEJ_Je2FYeA.png" /></figure><p>So if you have four people, that’s 4(4–1)/2, or six connections. Going to eight suddenly means you have 8(8–1)/2, or <em>twenty eight</em><strong><em> </em></strong>connections. Your PMoD thinks ten sounds good; that puts you at <em>45 connections to be established, worst case scenario</em>.</p><p>Sadly, this won’t scale. At ten people, each person in the room has to push data to nine other participants. Most people lack the upstream bandwidth to do this. You’ve got a Real Problem™.</p><p>So how do we get around this? We use a Selective Forwarding Unit (SFU), a Multi-point Control Unit (MCU), or you tell your PMoD they’re on drugs and you can support four (maybe five??) people in a P2P full mesh of doom:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*z3FBc7OcHh_hjhP8sgnndA.png" /></figure><p>Of course, suddenly you need infrastructure — a <em>lot</em> of it, and likely redundant in case some server dies. And that server needs to be rock solid, since it’s a single point of failure for a conference. And you likely need it deployed all around the world, because there’s a serious latency penalty for a user in Australia trying to connect to your media server in the eastern United States. And that infrastructure is going to have to work with your TURN servers. And you need to make a decision about SFU or MCU, both of which have really distinct tradeoffs.</p><p>Your PMoD sends you a frantic email; the CEO tried out the product, and her camera didn’t work right and she couldn’t hear anyone else. Turns out the speakers were turned down and the camera was in use with Skype. It also turns out This Is Your Problem™.</p><p>You need to provide ways for people to enumerate, configure and test their hardware. This sucks pretty bad, for a number of reasons:</p><ul><li>Windows kinda sucks at sharing between apps. Example: camera is claimed by Skype. Chrome fails to get camera.</li><li>Windows really sucks at managing audio devices. You have your default microphone, but you also have a default communications device, and nobody seems to understand this very well because on some basic level it’s incomprehensible.</li><li>Power users always want to configure their speaker output. They want it to come through their headset, not through their computer speakers (duh), so gonna have to be able to configure that.</li><li>Except Firefox doesn’t allow that. No speaker configuration for you.</li><li>And Firefox’s getUserMedia implementation is insane. Every time you request access to mic and camera, it throws up a permission prompt. Thanks a lot, Firefox.</li><li>Which reminds me: god forbid the user who accidentally denied that permissions prompt in Chrome or Firefox. That’s a support call. Crappo.</li><li>Oh, also, your Fortune 500 customers keep installing Chrome/Firefox with camera and mic access disabled by an administrator. Thanks a lot guys. Thanks for everything.</li></ul><p>…you’ll also need some way of measuring microphone strength, deciding the video stream is legit, and allowing users to configure their speakers correctly. For a serious project, these aren’t niceties; they’re crucial to actual success in the real world.</p><p>And then come all the various other junk: muting audio/video, allowing people to swap hardware mid-conference, providing people tools to debug their devices, etc.</p><p>PMoD doesn’t understand why they can’t use iOS. No problem, you say. I’ll just port some WebRTC library to mobile, create a native app, implement all of the signaling necessary for the SFU/MCU solution that we ended up selecting, and voila: done. Piece of cake!</p><p>Oh, and then I’ll do most of that all over again, but for Android.</p><p>This requires an intimate knowledge of stuff like an SDP offer/answer exchange, trickle ICE, DTLS negotiation, native code and so forth. Your project takes a three month hit. It also tightly couples you to some SFU/MCU that you opted for because signaling isn’t a part of the WebRTC standard.</p><p>…that damn fifteen minute demo. Look what it got you.</p><p>I shouldn’t complain. I really am not complaining. It used to be that it’d take a sizable team (teams??) of engineers to launch a solution like this. Now, with WebRTC, it’s entirely possible to have a small team manage all of this infrastructure for a single company.</p><p>It isn’t for the faint of heart — you’ll want some media and networking gurus, and someone with SIP/SDP experience can really save your butt, and someone who is fearless in the face of some ungodly native code. But it’s within the realm of reason.</p><p>Just beware the 15 minute demo.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f5cf3a71fc4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/the-fifteen-minute-webrtc-demo-3f5cf3a71fc4">The fifteen minute WebRTC demo</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hold your horses, Webkit. You don’t have WebRTC support yet.]]></title>
            <link>https://medium.com/@jeremy.noring/hold-your-horses-webkit-you-dont-have-webrtc-support-yet-75098649658f?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/75098649658f</guid>
            <category><![CDATA[safari]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Thu, 08 Jun 2017 17:01:52 GMT</pubDate>
            <atom:updated>2017-06-09T21:14:19.570Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Update: </em><a href="https://bugs.webkit.org/show_bug.cgi?id=173141"><em>https://bugs.webkit.org/show_bug.cgi?id=173141</em></a><em> was filed to address lack of VP8 support. Please leave a comment if it’s important to you!</em></p><p>I was really excited to see <a href="https://webkit.org/blog/7726/announcing-webrtc-and-media-capture/">media capture and peer connection support finally land in Webkit</a>, and also really excited to see that Apple explicitly pointed out WebRTC support in their latest WWDC. It shows that finally, all major browsers are beginning to coalesce around WebRTC. As a developer, that means there’s a light at the end of the tunnel.</p><p>As always, however, the devil is in the details. And there is one gigantic, gaping detail missing from Webkit’s WebRTC implementation: <strong>VP8 support</strong>.</p><p><a href="https://tools.ietf.org/html/rfc7742#section-5">VP8 is one of the mandatory-to-implement codecs in WebRTC</a>, the other being H.264. VP8 is royalty free and defended by Google, so there’s very little technical reason not to adopt it; Firefox, Chrome and Edge all have VP8 support. So the decision not to include VP8 support is, on some basic level, purely a technologically “partisan” move by Apple. In Webkit, <a href="https://bugs.webkit.org/show_bug.cgi?id=167257">they actually went out of their way to disable VP8 from libwebrtc</a>.</p><p>Why is this a big deal? It forces all traffic to H.264. This means any WebRTC infrastructure a company has must support H.264. For example, if a company has a selective-forwarding-unit (SFU), that SFU now has to support H.264, and any/all plug-in technology being used to cover old browsers has to support H.264 and any mobile apps they deploy using WebRTC now has to support H.264….and so on.</p><p>Those shiny little demos people have of Safari interoping with Chrome and Firefox? That’s quaint, <em>but in the real world, this is a serious pain in the ass for developers and interop between browsers.</em></p><p>Apple and Webkit guys: seriously I love you for adding this. But <em>please</em> reconsider the decision to remove VP8 from WebRTC. <strong>Until it’s in there, Safari is not a standards compliant browser that fully supports WebRTC.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75098649658f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Public Lands in Utah]]></title>
            <link>https://medium.com/@jeremy.noring/public-lands-in-utah-f46e37e78ae3?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f46e37e78ae3</guid>
            <category><![CDATA[utah]]></category>
            <category><![CDATA[public-lands]]></category>
            <category><![CDATA[environment]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Sun, 05 Mar 2017 00:03:01 GMT</pubDate>
            <atom:updated>2017-03-06T20:11:20.828Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been an avid climber for the last twenty years. I spent most of my youth in the deserts and crags of southern and central Utah, largely on public lands. So the current political climate of the Utah legislature — unabashedly pushing for state ownership of public lands and attempting to rescind/modify established national monuments— is a huge concern for me.</p><p>I wrote my state representative, Chris Stewart. Unfortunately I was unable to call and speak with anyone (I could not find a number). Unsurprisingly, I got what was most likely a stock reply to people like myself: a page of facts and positions that argue Stewart’s side. From a “noreply” email, so if I want to have a dialog, I have to repeatedly send a response via a web form.</p><p>Since that would be tedious, I decided I’d respond to statements made by Stewart in public. Full response by Stewart can be found at the bottom.</p><p>Stewart argues Bear’s ears is too large because it does not respect the “smallest area compatible” clause of the <a href="https://en.wikipedia.org/wiki/Antiquities_Act">Antiquities Act</a>:</p><blockquote>…in reading the Antiquities Act…I believe that the President exceeded his Congressionally mandated authority. Section 2 of Antiquities Act reads:</blockquote><blockquote>That the President of the United States is hereby authorized, in his discretion, to declare by public proclamation historic landmarks, historic and prehistoric structures, and other objects of historic or scientific interest that are situated upon the lands owned or controlled by the Government of the United States to be national monuments, and may reserve as a part thereof parcels of land, the limits of which in all cases shall be confined to the smallest area compatible with proper care and management of the objects to be protected…</blockquote><blockquote>Undoubtedly, there are antiquities in that region that warranted attention. However, at 1.35 million acres, it is very hard to argue that this was the smallest area compatible with the proper care and management of those objects. Over ninety percent of the artifacts are located in just 300,000 acres. I think it’s also important to note that the acreage of all five of Utah’s National Parks could fit within 800,000 acres. This means that all of Utah’s National Parks could fit within the new monument with hundreds of thousands of acres to spare.</blockquote><p>Basically, the argument is “it’s really big, how can that be a proper use of the antiquities act?” He goes on to assert “ninety percent of the artifacts are located in just 300,000 acres.” But if you look at Obama’s statement, he clearly created <a href="https://obamawhitehouse.archives.gov/the-press-office/2016/12/28/statement-president-designation-bears-ears-national-monument-and-gold">Bears Ears</a> to protect more than just artifacts: “to protect some of our country’s most important cultural treasures, including <strong>abundant rock art, archeological sites, and lands considered sacred by Native American tribes</strong>. Today’s actions will help protect this cultural legacy and will ensure that future generations are able <strong>to enjoy and appreciate these scenic and historic landscapes.</strong>”</p><p>In other words, it’s about more than just “artifacts,” but lands considered sacred by Native American tribes, and lands considered scenic and historic. This is completely within Obama’s scope of power for use of the Antiquities Act. Numerous court cases have clarified this (see Cameron v. United States, Cappaert v. United States, United States v. California, etc.). If Stewart doesn’t like this, he is part of the legislative body that could clarify/rescind the Antiquities Act, but I see no evidence Obama did not adhere to the spirit of the act.</p><p>Lastly, the native American coalition pushing for national monument designation <a href="https://bearsearscoalition.org/proposal-overview/">wanted 1.9M acres set aside</a>. The actual monument ended up being 1.3M acres.</p><p>Stewart disagrees with Obama’s proposed tribal commission to advise management of the lands:</p><blockquote>…there are significant concerns with how the new Monument is to be managed. President Obama declared that various tribal interests would be represented in the management of the Monument. I think that such promises similarly exceed Presidential authority. Article IV of the U.S. Constitution is clear that Congress, not the Executive has the power to make management decision for property of the United States. I believe that co-management with Native Americans for the underlying lands must be approved by Congress, and cannot be set up through Presidential mandate, notwithstanding the broad powers of the Antiquities Act. Therefore, such promises of co-management by the President are empty on their face.</blockquote><p>This argument is specious at best. Obama did not enact any sort of “co-management” of the lands. He established “…a Bears Ears Commission to ensure that tribal expertise and traditional knowledge help inform the management of the Bears Ears National Monument.” Stewart portrays this as “co-management” when the reality is it’s just a commission that can <em>inform the management</em> of Bears Ears.</p><p>To say nothing of the general petulance of this argument: these lands are preserved precisely for their significance to tribal interests in the area, so quibbling about who gives them a seat at the table to inform management of these lands is just silly.</p><p>Stewart complains that Obama should have waited for the public lands initiative:</p><blockquote>A few days before declaring the new monument, former President Obama advised his successor that “going through the legislative process is always better” than relying on executive powers. Such a process was underway at the time of the Monument designation. This process, known as the Public Lands Initiative (PLI), was working its way through Congress. While the PLI had not yet crossed the finish line, I firmly believe that it would have passed during the 115th Congress and gained the approval of President Trump. Unlike the Presidential mandate, the PLI did have the broad-based support of local residents and I believe would have offered less contentious management for the area.</blockquote><p>This response is tone-deaf to my entire correspondence with Stewart. The PLI, sponsored by Utah Reps. Rob Bishop and Jason Chaffetz, would protect part of the Bears Ears region while opening other swaths of land for oil and gas development. Critics of the bill include tribal leaders, environmentalists and people like myself who enjoy outdoor recreation on Utah’s vast and amazing public lands.</p><p>Also, the PLI does not have “broad-based” support of local residents. As someone who speaks for many involved in outdoor recreation in Utah, this is a blatant falsehood. <strong>Mr. Stewart, I am a local resident. I do not support this piece of legislation. People in Salt Lake City are also your constituents.</strong></p><p>Stewart claims the Grand-Staircase Monument lead to an economic state of emergency:</p><blockquote>In dedicating the Monument without local buy in, the former President may have set up long-lasting conflict with local populations. I have personally witnessed this conflict in Garfield and Kane Counties by residents who have complained about the establishment of the Grand Staircase-Escalante National Monument for the last 20 years. Indeed, the Garfield County Commission declared an economic state of emergency last year due to the declining enrollments in the Escalante Schools, which the Commission blamed on the Grand-Staircase Monument.</blockquote><p>Unfortunate as this may be, these simply aren’t facts. State data indicate that Garfield County’s job numbers and unemployment today are not much different than they were 19 years ago when the monument was designated. Jobs have hovered around 2,200 and the jobless rate is 8.6 percent, the same as it was in the late 1990s. I’m not an expert in demographics by any measure, but I fail to see the link between the national monument designation and issues faced by people of Garfield and Kane County. After all, these counties are already 80 to 90% federal land, so swapping the designation on a portion of that land simply doesn’t matter.</p><p>The whole of Garfield county composes roughly 5,000 individuals. The state of Utah could easily provide support to this community to resolve the issue of educational funding. That’s a much easier problem to solve, so it’s unclear to me why state management of these lands is the obvious solution.</p><blockquote>Even if you disagree with the validity of economic emergency, you have to admit that the local discontent with the monument is real.</blockquote><p>Agree. <strong>And you have to agree that the local discontent with your position on this issue with people in Salt Lake City and other parts of the state — Utahs you represent — is also real.</strong> Why is the obvious solution to this problem for the state to claim federal lands?</p><p>Stewart claims monuments lock people out:</p><blockquote>Fourth, in viewing the management practices of other national monuments, it appears quite clear that access is lost over time. Roads and trails are closed without sufficient local input. Long-standing activities, such as grazing, are limited, even in places where the monument proclamation guarantees their continued practice. It seems that locking people out, rather than land management, becomes the ultimate concern for monument managers. I find this to be contrary to the mission of our public land agencies.</blockquote><p>Well that’s interesting, Mr. Stewart, because your job in Congress is to approve the budget of the federal agencies that oversee these public lands. They’ve been running a huge shortfall for decades, <a href="http://publiclands.utah.gov/wp-content/uploads/2014/11/1.%20Land%20Transfer%20Analysis%20Final%20Report.pdf">according to a study conducted by the University of Utah</a>; they note that “Deferred maintenance is a continuing problem for both the BLM and Forest Service. The combined deferred maintenance backlog for both agencies (in Utah) is estimated to be almost $100 million.” So if you’re concerned about roads and trails being closed, maybe you should start pushing to fully fund federal agencies that oversee these lands.</p><p>Second, it’s absurd to claim monument management’s concern is locking people out. The very notion of preserving public lands for future generations to come is anathema to this claim.</p><p>Lastly, it’s worth noting that according to this same study, there is literally no way the state of Utah could oversee public lands at a net gain with the current price of oil and gas. It’s also worth nothing that federal infusion into the state with respect to public land is worth billions, as is Utah’s tourism industry. So haggling over grazing rights seems odd when there are more stake-holders at the table than ranchers.</p><p>I think the public lands debate is one in which you have frankly been deceitful and/or manipulative of the public. Here’s how I see it:</p><ol><li><a href="https://www.opensecrets.org/politicians/summary.php?cid=N00033932">You received $87,300 dollars from oil and gas companies during the 2016 elections</a> — your single largest source of campaign financing. The sector total was $122,500, mostly from PACs. When you take these contributions, I find it difficult to believe you will remain objective.</li><li>You seem to relentlessly push for state ownership of these lands, despite the fact that reasonable estimates (see study above) show this will cost the state of Utah hundreds of millions of dollars at current oil and gas prices.</li><li>You seem to pay lip service (at best) to large swaths of your constituents. Hikers, backpackers, hunters, anglers, bikers, off-roaders, canyoneers, birders, climbers, skiers and anyone else who values public lands and open spaces. I feel like if I’m not a member of Kane or Garfield county, or a rancher, or an oil and gas executive, you basically ignore me.</li><li>Many of your responses to constituents in #3 are tone-deaf.</li><li>The tens of millions of dollars the state has spent on lawsuits involving public lands probably could have made a significant difference to people in counties suffering from issues that likely have nothing to do with federal monuments.</li><li>The wasted effort trying to convert federal lands to state lands could have been used to bolster federal funds to the state of Utah to resolve the maintenance backlog on our federal lands.</li></ol><p>In conclusion, we don’t agree. We aren’t going to agree. I wish you the best in your 2018 election; I, for one, will not vote for you, and will encourage others to follow suit so long as you adopt these public lands positions.</p><p>Stewart’s full letter:</p><blockquote>Thank you for your recent letter regarding the Bears Ears National Monument. I understand that this is a very passionate issue for many Utahns. I appreciate the time you took to voice your opinion on the issue.</blockquote><blockquote>Like you, I am proud to live in Utah. I live here because of its beauty and abundant natural resources. I love hiking and rock climbing, skiing, and just generally being outdoors. I think we are all blessed to have some of the most incredible natural spaces on earth at our doorstep.</blockquote><blockquote>My love of our state, however, has not led me to agree with the creation of the Bears Ears National Monument. Let me explain why. First, in reading the Antiquities Act, the authority that President Obama used to create the Monument, I believe that the President exceeded his Congressionally mandated authority. Section 2 of Antiquities Act reads:</blockquote><blockquote>That the President of the United States is hereby authorized, in his discretion, to declare by public proclamation historic landmarks, historic and prehistoric structures, and other objects of historic or scientific interest that are situated upon the lands owned or controlled by the Government of the United States to be national monuments, and may reserve as a part thereof parcels of land, the limits of which in all cases shall be confined to the smallest area compatible with proper care and management of the objects to be protected…(Emphasis Added).</blockquote><blockquote>Undoubtedly, there are antiquities in that region that warranted attention. However, at 1.35 million acres, it is very hard to argue that this was the smallest area compatible with the proper care and management of those objects. Over ninety percent of the artifacts are located in just 300,000 acres. I think it’s also important to note that the acreage of all five of Utah’s National Parks could fit within 800,000 acres. This means that all of Utah’s National Parks could fit within the new monument with hundreds of thousands of acres to spare.</blockquote><blockquote>Second, there are significant concerns with how the new Monument is to be managed. President Obama declared that various tribal interests would be represented in the management of the Monument. I think that such promises similarly exceed Presidential authority. Article IV of the U.S. Constitution is clear that Congress, not the Executive has the power to make management decision for property of the United States. I believe that co-management with Native Americans for the underlying lands must be approved by Congress, and cannot be set up through Presidential mandate, notwithstanding the broad powers of the Antiquities Act. Therefore, such promises of co-management by the President are empty on their face.</blockquote><blockquote>Third, as I am sure that you are aware, there is significant opposition to the new monument. Not a single elected official who represents the area supports the monument designation. A few days before declaring the new monument, former President Obama advised his successor that “going through the legislative process is always better” than relying on executive powers. Such a process was underway at the time of the Monument designation. This process, known as the Public Lands Initiative (PLI), was working its way through Congress. While the PLI had not yet crossed the finish line, I firmly believe that it would have passed during the 115th Congress and gained the approval of President Trump. Unlike the Presidential mandate, the PLI did have the broad-based support of local residents and I believe would have offered less contentious management for the area.</blockquote><blockquote>In dedicating the Monument without local buy in, the former President may have set up long-lasting conflict with local populations. I have personally witnessed this conflict in Garfield and Kane Counties by residents who have complained about the establishment of the Grand Staircase-Escalante National Monument for the last 20 years. Indeed, the Garfield County Commission declared an economic state of emergency last year due to the declining enrollments in the Escalante Schools, which the Commission blamed on the Grand-Staircase Monument. Even if you disagree with the validity of economic emergency, you have to admit that the local discontent with the monument is real.</blockquote><blockquote>Fourth, in viewing the management practices of other national monuments, it appears quite clear that access is lost over time. Roads and trails are closed without sufficient local input. Long-standing activities, such as grazing, are limited, even in places where the monument proclamation guarantees their continued practice. It seems that locking people out, rather than land management, becomes the ultimate concern for monument managers. I find this to be contrary to the mission of our public land agencies.</blockquote><blockquote>Finally, I simply believe that there is a better way. I have spoken with state officials and the entire Federal Delegation. We are convinced that this area deserves protection, but we are open to a variety of different management approaches that do not involve a Presidential declaration. And, contrary to the talking points of environmental pressure groups, none of these conversations has involved selling or leasing the precious lands of the Bears Ears for resource development, and such accusations are offensive.</blockquote><blockquote>Again thank you for the time you spent contacting me regarding Bears Ears National Monument. While we may disagree, I hope you will continue to reach out as you have concerns. I likewise hope that in the future we will find issues on which we agree and can work together.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f46e37e78ae3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I ❤ ffmpeg, part 3]]></title>
            <link>https://medium.com/@jeremy.noring/i-ffmpeg-part-3-ab084f74556c?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab084f74556c</guid>
            <category><![CDATA[gif]]></category>
            <category><![CDATA[videos]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 21:56:47 GMT</pubDate>
            <atom:updated>2017-02-15T22:22:02.279Z</atom:updated>
            <content:encoded><![CDATA[<p>By far the best thing about ffmpeg is actually an entirely separate project: x264. Without a doubt, x264 is a crown jewel of the open source community. It regularly dominated H.264 encoding performance (both in terms of speed and quality), solidly trouncing commercial offerings.</p><p>A couple handy tricks with this library — as I mentioned a few posts ago, you can rapidly make a high quality copy of something using the ultrafast preset, like so:</p><pre>ffmpeg -i &lt;some_file&gt; -c:v libx264 -crf 18 -preset ultrafast -c:a libopus &lt;some_output_file&gt;.mkv</pre><p>-crf specifies a constant rate factor — lower means higher quality video, but higher bitrate. Higher means lower quality at the expense of bitrate. -preset specifies a bundle of encoding parameters; it’s basically a convenient short-hand.</p><p>-crf 18 is, for all intents and purposes, nearly lossless. -preset ultrafast is blisteringly quick, due to x264’s very heavy assembly optimizations.</p><p>Another thing I love is x264 has really sophisticated rate control. For example, you can ask x264 to hit a quality target but cap at a maximum bitrate. Example:</p><pre>ffmpeg -i &lt;some_file&gt; -c:v libx264 -crf 22 -maxrate 1000k &lt;some_output_file&gt;</pre><p>Why would you want to do this? This is awesome if you don’t know how many bits you reliably need to use to process the incoming video, but still need a capped bitrate (say, because you’re distributing video online). This dramatically cuts down the size of most files, but gives you protection against generating utterly massive files at the expense of quality.</p><p>Regarding -preset, in descending order of speed are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. The default preset is medium.</p><p>For most encoding, I find medium or slow to be appropriate. If you’re authoring something for long-term storage/distribution, it’s likely worth the hit for the veryslow preset. placebo shouldn’t be used. For infrequently accessed video (so not streamed often) or short-term video, faster, fast and medium are good options.</p><p>If you’re going to be processing an absurd amount of video with a common theme/style, it may be worth testing and overriding individual features set by a preset.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab084f74556c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I ❤ ffmpeg, part 2]]></title>
            <link>https://medium.com/@jeremy.noring/i-ffmpeg-part-2-8f036572d6ab?source=rss-dcd31e99ddb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f036572d6ab</guid>
            <category><![CDATA[gif]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jeremy Noring]]></dc:creator>
            <pubDate>Fri, 10 Feb 2017 17:20:55 GMT</pubDate>
            <atom:updated>2017-02-10T17:20:55.244Z</atom:updated>
            <content:encoded><![CDATA[<p>I ❤ ffmpeg, part 2</p><p>One of the great things you can do with ffmpeg is clean up and normalize video. For example, maybe you want to boost track volume. You can get volume info with:</p><pre>ffmpeg -i &lt;some file&gt; -af volumedetect -vn -f null -</pre><p>That produces output like:</p><pre>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] n_samples: 7207936<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] mean_volume: -33.0 dB<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] max_volume: -10.2 dB<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_10db: 15<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_11db: 28<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_12db: 96<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_13db: 173<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_14db: 344<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_15db: 702<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_16db: 1431<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_17db: 2922<br>[Parsed_volumedetect_0 @ 0x7fd768fab4a0] histogram_18db: 5495</pre><p>We can see max volume on this file is -10.2 dB; we can boost this to a normal volume with:</p><pre>ffmpeg -i &lt;some file&gt; -af volume=10.2dB -c:v copy &lt;some output file&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f036572d6ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>