<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Software Engineering on jeffcarp</title>
    <link>/categories/software-engineering/</link>
    <description>Recent content in Software Engineering on jeffcarp</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 29 Nov 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="/categories/software-engineering/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Favorite Technical Books</title>
      <link>/posts/2024/favorite-technical-books/</link>
      <pubDate>Fri, 29 Nov 2024 00:00:00 +0000</pubDate>
      <guid>/posts/2024/favorite-technical-books/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s a quick list of my favorite software engineering books I&amp;rsquo;ve read over&#xA;the years. I plan to keep this list updated as I discover (or am recommended,&#xA;hint hint) more.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/984428.Crypto&#34;&gt;Crypto: How the Code Rebels Beat the Government—Saving Privacy in the Digital Age&lt;/a&gt;, Levy&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/7602360-cryptography-engineering&#34;&gt;Cryptography Engineering: Design Principles and Practical Applications&lt;/a&gt;, Ferguson, Schneier, Kohno&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/23463279-designing-data-intensive-applications&#34;&gt;Designing Data-Intensive Applications&lt;/a&gt;, Kleppmann&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/61148808-designing-machine-learning-systems&#34;&gt;Designing Machine Learning Systems&lt;/a&gt;, Huyen&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/56344415-reinforcement-learning&#34;&gt;Reinforcement Learning&lt;/a&gt;, Winder&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/32899495-hands-on-machine-learning-with-scikit-learn-and-tensorflow&#34;&gt;Hands-On Machine Learning with Scikit-Learn and TensorFlow&lt;/a&gt;, Geron&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/27968891-site-reliability-engineering&#34;&gt;Site Reliability Engineering&lt;/a&gt;, Beyer, Jones, Petoff, Murphy&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.goodreads.com/book/show/8474434-linux-kernel-development&#34;&gt;Linux Kernel Development&lt;/a&gt;, Love&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Quickly saying “no” to ideas is harmful</title>
      <link>/posts/2024/quickly-saying-no/</link>
      <pubDate>Mon, 23 Sep 2024 00:00:00 +0000</pubDate>
      <guid>/posts/2024/quickly-saying-no/</guid>
      <description>&lt;p&gt;I’ve observed during my software engineering career the different reactions&#xA;senior engineers have when new ideas are brought up.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes when an idea is presented, usually by a junior engineer, a senior&#xA;engineer will chime in very quickly to emphatically describe why it won’t work.&#xA;I think this is very harmful to team culture for a couple reasons.&lt;/p&gt;&#xA;&lt;p&gt;First, it reinforces the bias toward authority for senior engineers. When any&#xA;engineer brings up an idea, even if it’s overall a bad idea, there is always a&#xA;nugget of truth &amp;ndash; they observed a real issue and offered a real solution.&#xA;Immediately shooting down ideas discards this truth.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deciding between a static and dynamic site</title>
      <link>/posts/2024/static-vs-dynamic/</link>
      <pubDate>Thu, 04 Jan 2024 00:00:00 +0000</pubDate>
      <guid>/posts/2024/static-vs-dynamic/</guid>
      <description>&lt;p&gt;Hi, I’m trying to blog more this year. Maybe not every day, but more&#xA;frequently.&lt;/p&gt;&#xA;&lt;p&gt;In &lt;a href=&#34;/posts/2023/file-formats-for-chinesedict/&#34;&gt;a recent post&lt;/a&gt; I mentioned I’ve&#xA;been working on a fast frontend for a Chinese-English dictionary. In the spirit&#xA;of &lt;a href=&#34;https://jvns.ca/blog/2021/05/24/blog-about-what-you-ve-struggled-with/&#34;&gt;&amp;ldquo;blog about what you&amp;rsquo;ve struggled&#xA;with&amp;rdquo;&lt;/a&gt;,&#xA;the biggest challenge I’m currently facing is choosing between designing the&#xA;site as front-end heavy or back-end heavy.&lt;/p&gt;&#xA;&lt;p&gt;I’ve written two initial versions of the site: one as a fully static website&#xA;and one as a fully backend app in Go. Despite the server-side version being&#xA;written in Go, I’m not super happy with the load time of the app. Even when the&#xA;server is warmed up, the initial document load time is 30-40ms, whereas the&#xA;static site is 10-20ms.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Considering File Formats for ChineseDict</title>
      <link>/posts/2023/file-formats-for-chinesedict/</link>
      <pubDate>Tue, 05 Dec 2023 00:00:00 +0000</pubDate>
      <guid>/posts/2023/file-formats-for-chinesedict/</guid>
      <description>&lt;p&gt;Recently I&amp;rsquo;ve been hacking on &lt;a href=&#34;https://chinesedict2.web.app/&#34;&gt;ChineseDict&lt;/a&gt;, a&#xA;fast web frontend to look up Chinese words. I started the project originally to&#xA;fulfill a specific use case: when practicing chatting with friends or watching&#xA;a video, I need search results in milliseconds, not seconds.&lt;/p&gt;&#xA;&lt;p&gt;The website uses the &lt;a href=&#34;https://cc-cedict.org/wiki/&#34;&gt;CC-EDICT&lt;/a&gt; dictionary to&#xA;power the results. I now want to expand each term with examples and extra data&#xA;in a way that&amp;rsquo;s easy to store on disk and update via git commit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to clone a Google Source Repository in Working Copy iOS</title>
      <link>/posts/2020/how-to-clone-gcp-repo-working-copy/</link>
      <pubDate>Sat, 19 Dec 2020 02:00:00 -0700</pubDate>
      <guid>/posts/2020/how-to-clone-gcp-repo-working-copy/</guid>
      <description>&lt;p&gt;I recently went through this process and couldn&amp;rsquo;t find a guide (though I swear one existed at some point in the past). Here&amp;rsquo;s how to clone a git repository from Google Source Repositories in the Working Copy iOS or iPadOS app:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Navigate to &lt;a href=&#34;https://source.cloud.google.com/&#34;&gt;https://source.cloud.google.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pick out the repo you want to clone and open the clone dialog (it looks like a &amp;ldquo;+&amp;rdquo; icon)&lt;/li&gt;&#xA;&lt;li&gt;Go to the &amp;ldquo;Manually generated credentials&amp;rdquo; tab&lt;/li&gt;&#xA;&lt;li&gt;Click on &amp;ldquo;Generate and store your Git credentials&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Go through the authentication flow&lt;/li&gt;&#xA;&lt;li&gt;You should be prompted to copy a shell command onto your clipboard&lt;/li&gt;&#xA;&lt;li&gt;Go to the Working Copy iOS app&lt;/li&gt;&#xA;&lt;li&gt;Go to Settings (the gear icon) &amp;gt; Authentication Cookies&lt;/li&gt;&#xA;&lt;li&gt;Tap the &amp;ldquo;+&amp;rdquo; icon and import from clipboard&lt;/li&gt;&#xA;&lt;li&gt;You should now be able to clone the repository using the &lt;code&gt;https://source.developers.google.com/p/...&lt;/code&gt; URL&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Hope that helps if you&amp;rsquo;re in the same boat.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Grace Hopper 2019 Trip Report</title>
      <link>/posts/2020/grace-hopper-2019-trip-report/</link>
      <pubDate>Sun, 16 Aug 2020 00:00:00 +0000</pubDate>
      <guid>/posts/2020/grace-hopper-2019-trip-report/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;IMG_20191002_001805.jpg&#34; alt=&#34;The GHC logo.&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Despite this trip report being over 9 months late, I wanted to share it because&#xA;I can&amp;rsquo;t stop thinking about how positive an experience this conference was.&#xA;Grace Hopper is the largest women in tech conference in the world, with around&#xA;25,000 attendees flying into Orlando, FL from all parts of the world for the&#xA;2019 conference. In previous years I had been interested in attending but&#xA;hadn&amp;rsquo;t gotten the chance—and I (as a man) also strongly did not want to take&#xA;the spot of a potential woman visiting the conference. This year I was lucky to&#xA;get the chance to attend and thought it would be a valuable experience to learn&#xA;how to be a better ally and advance the cause of women in tech, as well as&#xA;learn about the latest tech from across the industry.&lt;/p&gt;</description>
    </item>
    <item>
      <title>用20行Python构建Markov Chain语句生成器</title>
      <link>/posts/2020/markov-chain-python-zh/</link>
      <pubDate>Sat, 04 Jul 2020 10:44:41 -0800</pubDate>
      <guid>/posts/2020/markov-chain-python-zh/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;A bot who can write a long letter with ease, cannot write ill.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;small&gt;&lt;em&gt;—Jane Austen, Pride and Prejudice&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;&#xA;&lt;p&gt;这篇文章将引导您逐步学习如何使用Python从头开始编写马尔可夫链(&lt;a href=&#34;https://en.wikipedia.org/wiki/Markov_chain&#34;&gt;Markov&#xA;Chain&lt;/a&gt;)，以生成好像一个真实的人写的英语的全新句子。&#xA;简·奥斯丁的《傲慢与偏见》(&lt;a href=&#34;https://www.goodreads.com/book/show/1885.Pride_and_Prejudice&#34;&gt;Pride and Prejudice by Jane&#xA;Austen&lt;/a&gt;)&#xA;是我们用来构建马尔可夫链的文字。&#xA;&lt;a href=&#34;https://colab.research.google.com/drive/14KjFfYEVhFl3nyuGZtFi1vnv5hN88Qn2&#34;&gt;Colab&lt;/a&gt;&#xA;上有一篇可运行的笔记本版本。&lt;/p&gt;&#xA;&lt;p class=&#34;aside&#34;&gt;&#xA;Read&#xA;&lt;a href=&#34;/posts/2019/markov-chain-python/&#34;&gt;the English version of this post here&lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup&#34;&gt;Setup&lt;/h2&gt;&#xA;&lt;p&gt;首先下载“傲慢与偏见”的全文。&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# 下载Pride and Prejudice和并切断头.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;!&lt;/span&gt;curl https:&lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt;www&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;gutenberg&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;org&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;files&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1342&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1342&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0.&lt;/span&gt;txt &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; tail &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;n&lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;32&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;content&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;pride&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;prejudice&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# 预览文件.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;!&lt;/span&gt;head &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;n &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;content&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;pride&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;prejudice&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current&#xA;                                 Dload  Upload   Total   Spent    Left  Speed&#xA;100  707k  100  707k    0     0  1132k      0 --:--:-- --:--:-- --:--:-- 1130k&#xA;PRIDE AND PREJUDICE&#xA;&#xA;By Jane Austen&#xA;&#xA;&#xA;&#xA;Chapter 1&#xA;&#xA;&#xA;It is a truth universally acknowledged, that a single man in possession&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;添加一些必要的导入。&lt;/p&gt;</description>
    </item>
    <item>
      <title>I&#39;m Joining Waymo</title>
      <link>/posts/2019/im-joining-waymo/</link>
      <pubDate>Sun, 10 Nov 2019 15:38:38 -0800</pubDate>
      <guid>/posts/2019/im-joining-waymo/</guid>
      <description>&lt;p&gt;Quick life update: I&amp;rsquo;ve left the Chrome team and joined Waymo (formerly the&#xA;Google self-driving car project). I&amp;rsquo;ll be working on ML infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;It was a fantastic whirlwind 3 years working on infrastructure for Chromium and&#xA;helping to&amp;ndash;in a very small way&amp;ndash;push the open web forward. On the team I&#xA;launched &lt;a href=&#34;https://wpt.fyi/&#34;&gt;wpt.fyi&lt;/a&gt;, a resource to help align the APIs of all&#xA;browsers.  I worked on syncing source code across repos. I launched a couple&#xA;TensorFlow ML models. And I helped make the bug tracker quicker and more useful&#xA;for everyone in the project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Things I Learned as a First-Time Intern Host</title>
      <link>/posts/2019/things-i-learned-first-time-intern-host/</link>
      <pubDate>Sat, 31 Aug 2019 11:13:25 -0700</pubDate>
      <guid>/posts/2019/things-i-learned-first-time-intern-host/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;baybridge.jpg&#34; alt=&#34;The Bay Bridge&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I hosted an intern for the first time this summer. It was my first time being&#xA;somebody&amp;rsquo;s manager and it became a huge learning experience for me as well as a&#xA;really fun time. My intern worked on &lt;a href=&#34;https://bugs.chromium.org/p/chromium/issues/list?mode=chart&amp;amp;q=Component%3ABlink&amp;amp;can=2&#34;&gt;adding many features to velocity-tracking&#xA;charts&lt;/a&gt;,&#xA;&lt;a href=&#34;https://chromium.googlesource.com/infra/infra/+/master/appengine/monorail/tools/ml/trainer2/&#34;&gt;rewriting our ML models in TensorFlow&#xA;2.0&lt;/a&gt;,&#xA;and a few other projects.&lt;/p&gt;&#xA;&lt;p&gt;Here are the biggest areas where I struggled as a host and the important&#xA;lessons I took away from those experiences.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How I Host Static Sites With Automatic Deploy on Green</title>
      <link>/posts/2019/how-i-host-static-sites-with-automatic-deploy-on-green/</link>
      <pubDate>Sun, 03 Feb 2019 23:19:44 +0000</pubDate>
      <guid>/posts/2019/how-i-host-static-sites-with-automatic-deploy-on-green/</guid>
      <description>&lt;p&gt;This site, &lt;a href=&#34;https://www.jeffcarp.com/&#34;&gt;jeffcarp.com&lt;/a&gt;, is written in markdown&#xA;and uses the &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo static site generator&lt;/a&gt;. This post walks&#xA;you through how I set automatic building, testing, and deployment to Firebase&#xA;hosting.&lt;/p&gt;&#xA;&lt;h2 id=&#34;project-setup&#34;&gt;Project Setup&lt;/h2&gt;&#xA;&lt;p&gt;I assume we&amp;rsquo;re starting from a working Hugo project. For more on how to set&#xA;that up, see the &lt;a href=&#34;https://gohugo.io/getting-started/quick-start/&#34;&gt;Hugo docs&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;testing-setup&#34;&gt;Testing Setup&lt;/h2&gt;&#xA;&lt;p&gt;I want the site to be Deploy-on-Green (i.e. only if it passes the tests). The&#xA;CI setup I use is &lt;a href=&#34;https://cloud.google.com/cloud-build/docs/&#34;&gt;GCP Cloud&#xA;Build&lt;/a&gt;. I develop and debug these&#xA;tests locally using the &lt;code&gt;local-cloud-build&lt;/code&gt; command &lt;a href=&#34;https://cloud.google.com/cloud-build/docs/build-debug-locally&#34;&gt;documented&#xA;here&lt;/a&gt;. The steps&#xA;I want are:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Build a Markov Chain Sentence Generator in 20 lines of Python</title>
      <link>/posts/2019/markov-chain-python/</link>
      <pubDate>Wed, 16 Jan 2019 10:44:41 -0800</pubDate>
      <guid>/posts/2019/markov-chain-python/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;A bot who can write a long letter with ease, cannot write ill.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;small&gt;&lt;em&gt;—Jane Austen, Pride and Prejudice&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;&#xA;&lt;p&gt;This post walks you through how to write a &lt;a href=&#34;https://en.wikipedia.org/wiki/Markov_chain&#34;&gt;Markov&#xA;Chain&lt;/a&gt; from scratch with Python in&#xA;order to generate completely new sentences that resemble English.&lt;/p&gt;&#xA;&lt;p&gt;The text we&amp;rsquo;ll be using to build the Markov Chain is &lt;a href=&#34;https://www.goodreads.com/book/show/1885.Pride_and_Prejudice&#34;&gt;Pride and Prejudice by&#xA;Jane Austen&lt;/a&gt;. You&#xA;can follow along here or grab a runnable notebook version of this post on&#xA;&lt;a href=&#34;https://colab.research.google.com/drive/14KjFfYEVhFl3nyuGZtFi1vnv5hN88Qn2&#34;&gt;Colab&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>It&#39;s OK to Make Mistakes in Coding Interviews</title>
      <link>/posts/2018/its-ok-to-make-mistakes-in-interviews/</link>
      <pubDate>Tue, 25 Sep 2018 01:02:51 -0700</pubDate>
      <guid>/posts/2018/its-ok-to-make-mistakes-in-interviews/</guid>
      <description>&lt;p&gt;Imagine you&amp;rsquo;re an interviewer in a software engineering interview. The&#xA;interviewee writes a method and it&amp;rsquo;s completely wrong. They go on to implement&#xA;other parts of the problem, then later realize there&amp;rsquo;s a bug and come back and&#xA;fix the original method.&lt;/p&gt;&#xA;&lt;p&gt;One thing that isn&amp;rsquo;t super clear for both interview candidates and interviewers&#xA;is how to treat mistakes like this. The candidate definitely made a mistake. But&#xA;their final implementation is correct. Should they be penalized?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Doing Cryptography in TensorFlow</title>
      <link>/posts/2018/cryptography-in-tensorflow/</link>
      <pubDate>Sat, 23 Jun 2018 13:00:14 -0700</pubDate>
      <guid>/posts/2018/cryptography-in-tensorflow/</guid>
      <description>&lt;!--&#xA;After building a system with TensorFlow in Autumn 2017 and taking a course&#xA;on Cryptography in Winter 2018, I saw some interesting parallels.&#xA;&#xA;TensorFlow is marketed as a Machine Learning framework, but under the hood it&#39;s&#xA;a general platform for doing computations in the structure of a graph.&#xA;Similarly, cryptographic algorithms are frequently structured as the&#xA;manipulation of vectors or matrices in the structure of a graph. I put together&#xA;a Python notebook to explore this interesting relationship.&#xA;--&gt;&#xA;&lt;figure&gt;&#xA;  &lt;div style=&#34;display:flex;&#34;&gt;&#xA;    &lt;div style=&#34;flex:1;&#34;&gt;&#xA;        &lt;img src=&#34;feistel.gif&#34; alt=&#34;A Feistel Network, the algorithm behind DES.&#34; /&gt;&#xA;    &lt;/div&gt;&#xA;    &lt;div style=&#34;flex:1;&#34;&gt;&#xA;        &lt;img src=&#34;nnet.png&#34; alt=&#34;A neural network.&#34; /&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    On the left: the Feistel Network from the DES cipher, implemented below. On the right: a deep neural network.&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;https://www.tensorflow.org/&#34;&gt;TensorFlow&lt;/a&gt;&lt;/strong&gt; is a popular machine learning&#xA;framework. If you look under the hood, TensorFlow is a general platform for&#xA;doing computation over tensors in the structure of a graph.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding the Security of Cryptographic Hash Functions</title>
      <link>/posts/2018/understanding-security-cryptographic-hash-functions/</link>
      <pubDate>Mon, 16 Apr 2018 21:33:26 -0700</pubDate>
      <guid>/posts/2018/understanding-security-cryptographic-hash-functions/</guid>
      <description>&lt;p&gt;Hash functions are an extremely versatile tool that you can find nearly&#xA;everywhere in software engineering.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bitcoin mining is done by &lt;a href=&#34;https://www.youtube.com/watch?v=bBC-nXj3Ng4&#34;&gt;repeatedly computing SHA256&#xA;hashes&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;git stores files internally using the SHA-1 hash of the content as the&#xA;filename (&lt;a href=&#34;https://en.wikipedia.org/wiki/Content-addressable_storage&#34;&gt;content-based&#xA;addressing&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;When you download an app, your phone verifies that the app you&amp;rsquo;re about to&#xA;run is the app you intended to download by computing a checksum (a hash of&#xA;the entire app) and comparing it to one provided by the app store. If the&#xA;values are different, that means someone might have changed the contents of&#xA;the app.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This article intends to give you a deeper understanding of cryptographic&#xA;hash functions, when to use them, and how to think about their security&#xA;properties.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Thoughts on Stanford&#39;s CS255 Intro to Cryptography</title>
      <link>/posts/2018/cs255-cryptography/</link>
      <pubDate>Sat, 31 Mar 2018 12:31:22 -0700</pubDate>
      <guid>/posts/2018/cs255-cryptography/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve always been interested in Cryptography &amp;ndash; the field is a really compelling&#xA;marriage of beautiful mathematics with critical real-world applications.  Much&#xA;of the modern internet would not be possible without the clever math behind&#xA;asymmetric encryption.&lt;/p&gt;&#xA;&lt;p&gt;This Winter quarter I took &lt;a href=&#34;https://crypto.stanford.edu/~dabo/cs255/&#34;&gt;Stanford CS255: Introduction to&#xA;Cryptography&lt;/a&gt;. To be honest, it was&#xA;quite challenging as I was still working full time as a software engineer on&#xA;Chrome, and I was never that strong in the math department. However, I got a&#xA;ton out of this course and solidly recommend it to anyone interested. The&#xA;professor &amp;ndash; Dan Boneh &amp;ndash; was amazing and made the complex topics approachable.&#xA;He publishes the textbook for the course for free&#xA;&lt;a href=&#34;https://toc.cryptobook.us/book.pdf&#34;&gt;here&lt;/a&gt;. Here are some interesting things&#xA;I picked up from the course that I want to take with me.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Export Evaluation Results in Tensorflow</title>
      <link>/posts/2018/export-evaulation-results-tensorflow/</link>
      <pubDate>Fri, 05 Jan 2018 21:33:26 -0700</pubDate>
      <guid>/posts/2018/export-evaulation-results-tensorflow/</guid>
      <description>&lt;p class=&#34;aside&#34;&gt;&#xA;  &lt;b&gt;2019 update:&lt;/b&gt; just a heads up, this post is about TensorFlow 1.x. For&#xA;  TensorFlow 2.x, you probably want to check out&#xA;  &lt;a href=&#34;https://www.tensorflow.org/guide/keras/custom_callback&#34;&gt;Keras custom&#xA;  callbacks&lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;p&gt;In TensorFlow if you&amp;rsquo;re using a &lt;a href=&#34;https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator&#34;&gt;&lt;code&gt;tf.estimator&lt;/code&gt;&lt;/a&gt; model, for instance &lt;a href=&#34;https://www.tensorflow.org/api_docs/python/tf/estimator/DNNLinearCombinedClassifier&#34;&gt;&lt;code&gt;tf.estimator.DNNLinearCombinedClassifier&lt;/code&gt;&lt;/a&gt;, and as part of your automated training infrastructure you want to save the evaluation results as a JSON file, it&amp;rsquo;s not super straightforward, so here&amp;rsquo;s how to do it.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say you define your &lt;code&gt;EvalSpec&lt;/code&gt; like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;eval_spec &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; tf&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;estimator&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;EvalSpec(eval_input_fn,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  steps&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;hparams&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;eval_steps,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  exporters&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;[exporter],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;eval&amp;#39;&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;You&amp;rsquo;ll need to write a new exporter class that will take the &lt;code&gt;eval_result&lt;/code&gt; from your evaluation step and save it to a file using the &lt;code&gt;GFile&lt;/code&gt; API.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Example: Save and Load a TensorFlow Model</title>
      <link>/posts/2017/save-and-load-tensorflow-model/</link>
      <pubDate>Sun, 19 Nov 2017 19:07:30 +0000</pubDate>
      <guid>/posts/2017/save-and-load-tensorflow-model/</guid>
      <description>&lt;p class=&#34;aside&#34;&gt;&#xA;  &lt;b&gt;2020 update:&lt;/b&gt; just a heads up, this post is about TensorFlow 1.x. For&#xA;  TensorFlow 2.x, you probably want to check out&#xA;  &lt;a href=&#34;https://www.tensorflow.org/tutorials/keras/save_and_load&#34;&gt;this guide&#xA;  &lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;p&gt;This post details how to save and load a TensorFlow model using the &lt;code&gt;DNNClassifier&lt;/code&gt; API.&lt;/p&gt;&#xA;&lt;p&gt;The key idea here is that you define a function or a class beforehand that takes a model directory (in which it will save and restore the model parameters), adds that to &lt;code&gt;RunConfig&lt;/code&gt;, and returns a &lt;code&gt;tf.contrib.learn.Estimator&lt;/code&gt;, for example, &lt;code&gt;tf.contrib.learn.DNNClassifier&lt;/code&gt;. See &lt;code&gt;make_estimator&lt;/code&gt; for more details.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Chrome Security Architecture</title>
      <link>/posts/2017/chrome-security-architecture/</link>
      <pubDate>Sun, 22 Oct 2017 19:07:30 +0000</pubDate>
      <guid>/posts/2017/chrome-security-architecture/</guid>
      <description>&lt;p&gt;While in Tokyo for&#xA;&lt;a href=&#34;https://www.youtube.com/playlist?list=PL9ioqAuyl6UK7Z0HHswBM5JgAp-izn_3S&#34;&gt;BlinkOn8&lt;/a&gt;,&#xA;a gathering for Blink and Chromium contributors, I gave a talk at a coding&#xA;school about the security architecture of Chromium. &lt;a href=&#34;https://bit.ly/chrome-sa-talk&#34;&gt;Here are the&#xA;slides&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not an authority when it comes to security or specifically security in&#xA;Chrome, but I&amp;rsquo;m really interested in it and I hope this deck has some&#xA;information you find interesting as well.&lt;/p&gt;&#xA;&lt;iframe&#xA;    width=&#34;480&#34; height=&#34;300&#34;&#xA;    sandbox=&#34;allow-scripts allow-same-origin&#34;&#xA;    frameborder=&#34;0&#34;&#xA;    src=&#34;https://docs.google.com/presentation/d/e/2PACX-1vQYjvWdizWa8xl_EqRONOsZ2g36GZcGegX7ZD3QCFA3fED7cr7WVTy-O6bCQkACS2N1oPnaZpvMv7d8/embed?start=false&amp;loop=false&amp;delayms=3000&#34; /&gt;</description>
    </item>
    <item>
      <title>Where Web Payments are Going</title>
      <link>/posts/2016/where-web-payments-are-going/</link>
      <pubDate>Sun, 31 Jul 2016 15:15:40 +0000</pubDate>
      <guid>/posts/2016/where-web-payments-are-going/</guid>
      <description>&lt;p&gt;I gave a talk at the SF Payments Engineers meetup about Web Payments. Here&amp;rsquo;s&#xA;the blogified version of that talk. Check out the &lt;a href=&#34;https://speakerdeck.com/jeffcarp/web-payments&#34;&gt;slides from my talk&#xA;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Mobile checkouts are a terrible experience for customers. Both consumers and&#xA;merchants are both feeling the pain. Mobile checkouts convert about 66%&#xA;worse than desktop checkouts.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;img&#xA;    src=&#34;/images/2016/mobile-conversions.png&#34;&#xA;    alt=&#34;A presentation slide showing 66% fewer&#xA;conversions on mobile vs. desktop&#34;&gt;&#xA;  &lt;/img&gt;&#xA;  &lt;figcaption&gt;&#xA;    A slide from the PaymentRequest presentation at Google I/O 2016.&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Part of the problem is that every company needs to build their own credit card&#xA;form. Checkouts range from great UX to terrible UX, but the heterogeneity is&#xA;what really makes it a pain for consumers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>You are an engineering manager whether you realize it or not</title>
      <link>/posts/2016/you-are-an-engineering-manager/</link>
      <pubDate>Mon, 25 Jul 2016 21:33:26 -0700</pubDate>
      <guid>/posts/2016/you-are-an-engineering-manager/</guid>
      <description>&lt;p&gt;Over the past few months I’ve mentioned to friends that I want to learn engineering leadership skills. Each time the reaction is: “you want to get into management??” That’s not how I see it.&lt;/p&gt;&#xA;&lt;p&gt;As engineers we hold the lone wolf in high regard, the hoodie-wearing coder hacking away in the corner at a genius project. But large projects that deliver a ton of value are made by teams of engineers, not lone wolves.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reading Papers: Bufferbloat, SSL Warnings, Orleans, and more</title>
      <link>/posts/2015/reading-papers-bufferbloat-ssl-warnings-orleans/</link>
      <pubDate>Tue, 24 Mar 2015 00:00:00 +0000</pubDate>
      <guid>/posts/2015/reading-papers-bufferbloat-ssl-warnings-orleans/</guid>
      <description>&lt;p&gt;Inspired by the article &lt;a href=&#34;http://michaelrbernste.in/2014/10/21/should-i-read-papers.html&#34;&gt;&lt;em&gt;Should I read&#xA;papers?&lt;/em&gt;&lt;/a&gt; by&#xA;&lt;a href=&#34;http://michaelrbernste.in/&#34;&gt;Michael R. Bernstein&lt;/a&gt; and the amazing &lt;a href=&#34;http://paperswelove.org/&#34;&gt;Papers We&#xA;Love&lt;/a&gt; &lt;a href=&#34;https://github.com/papers-we-love/papers-we-love&#34;&gt;GitHub&#xA;repository&lt;/a&gt;, I set out at the&#xA;beginning of January 2015 with the goal of reading 15 academic papers. In this&#xA;post I want to share with you my notes for the 4 I loved the most.&lt;/p&gt;&#xA;&lt;h2 id=&#34;takeaways&#34;&gt;Takeaways&lt;/h2&gt;&#xA;&lt;p&gt;In a certain way reading papers is a comforting activity. In a world where the&#xA;front-end framework you&amp;rsquo;re using might be eclipsed in usefulness in 1 or 2&#xA;years, many of these papers present ideas that are as applicable today as they&#xA;were 43 years ago. Here are the publish dates of the 15 papers I read:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Visualizing JavaScript Project Structure</title>
      <link>/posts/2015/visualizing-javascript-project-structure/</link>
      <pubDate>Mon, 12 Jan 2015 00:00:00 +0000</pubDate>
      <guid>/posts/2015/visualizing-javascript-project-structure/</guid>
      <description>&lt;p&gt;Recently I thought to myself: fairly frequently I dive into a big JS codebase&#xA;and need to poke around for a while to get acquainted with the project&#xA;structure, wouldn&amp;rsquo;t it be nice if I could have a more visual way of seeing the&#xA;whole thing to make sense of it all?&lt;/p&gt;&#xA;&lt;p&gt;It was this need I was trying to fill when I embarked on my &lt;a href=&#34;https://www.braintreepayments.com/braintrust/walking-the-talk-open-dev-time-at-braintree&#34;&gt;open&#xA;dev&lt;/a&gt;&#xA;project last Friday. In this post I&amp;rsquo;ll try to walk through the steps I took so&#xA;you can replicate them. If you want to just to play with the final project,&#xA;it&amp;rsquo;s available as an npm module named &lt;code&gt;jsviz&lt;/code&gt; (npm:&#xA;&lt;a href=&#34;https://www.npmjs.com/package/jsviz&#34;&gt;jsviz&lt;/a&gt;, GitHub:&#xA;&lt;a href=&#34;https://github.com/jeffcarp/jsviz&#34;&gt;jeffcarp/jsviz&lt;/a&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How System Calls Work</title>
      <link>/posts/2014/how-syscalls-work/</link>
      <pubDate>Thu, 18 Sep 2014 16:36:39 +0000</pubDate>
      <guid>/posts/2014/how-syscalls-work/</guid>
      <description>&lt;h2 id=&#34;why-should-you-care-about-syscalls&#34;&gt;Why should you care about syscalls?&lt;/h2&gt;&#xA;&lt;p&gt;As a web developer, learning about syscalls and the infrastructure around them&#xA;can make you feel quite a bit more confident in debugging and reasoning about&#xA;how systems will perform. Ruby and C++ both have their own idiomatic ways of&#xA;opening files, but in the end they both end up using the syscall &lt;code&gt;open()&lt;/code&gt;. This&#xA;is because userland processes (like web applications) have &lt;strong&gt;only one&lt;/strong&gt; way of&#xA;communicating with the operating system: syscalls.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Weird and Cool things from Linux Kernel Development</title>
      <link>/posts/2014/weird-and-cool-linux-kernel/</link>
      <pubDate>Fri, 12 Sep 2014 00:06:15 -0700</pubDate>
      <guid>/posts/2014/weird-and-cool-linux-kernel/</guid>
      <description>&lt;p&gt;Recently I picked up &lt;a href=&#34;http://www.amazon.com/Linux-Kernel-Development-3rd-Edition/dp/0672329468&#34;&gt;Linux Kernel&#xA;Development&lt;/a&gt;&#xA;by Robert Love since I like his posts on Quora. Here are the things that I&#xA;thought were cool or just surprised me.&lt;/p&gt;&#xA;&lt;h3 id=&#34;threaded-trees&#34;&gt;Threaded Trees&lt;/h3&gt;&#xA;&lt;p&gt;Are cool. They act both like trees and linked lists.&lt;/p&gt;&#xA;&lt;h3 id=&#34;child-processes-vs-threads&#34;&gt;Child processes vs Threads&lt;/h3&gt;&#xA;&lt;p&gt;The only difference between a child process and a thread in Linux is whether&#xA;the CLONE_VM flag was passed to clone(), which copies the parent&amp;rsquo;s address&#xA;space which allows the child to access the parent&amp;rsquo;s memory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unforseen Perks of Pair Programming</title>
      <link>/posts/2014/unforseen-perks-of-pair-programming/</link>
      <pubDate>Sun, 15 Jun 2014 19:03:46 +0000</pubDate>
      <guid>/posts/2014/unforseen-perks-of-pair-programming/</guid>
      <description>&lt;p&gt;As someone who had never pair programmed before, it was exciting to get thrown&#xA;into the deep end during my first week at Braintree where engineers pair nearly&#xA;100% of the time.&lt;/p&gt;&#xA;&lt;p&gt;The relative merits of pair programming have already been spoken about at&#xA;length.&lt;sup&gt;&lt;a href=&#34;#pair-1&#34;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;&lt;a href=&#34;#pair-2&#34;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&#xA;This post is not an attempt to argue one way or another. Whether it works for&#xA;any organization is probably too context-dependent for any axioms I could lay&#xA;down.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Interviewing 2 Years in: What Worked</title>
      <link>/posts/2014/interviewing-2-years-in-what-worked/</link>
      <pubDate>Fri, 06 Jun 2014 00:00:00 +0000</pubDate>
      <guid>/posts/2014/interviewing-2-years-in-what-worked/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m almost pee-my-pants excited to announce that next week I&amp;rsquo;ll be joining the&#xA;team at &lt;a href=&#34;https://www.braintreepayments.com/&#34;&gt;Braintree&lt;/a&gt; and&#xA;&lt;a href=&#34;https://venmo.com/&#34;&gt;Venmo&lt;/a&gt; to work on their JavaScript SDK.&lt;/p&gt;&#xA;&lt;p&gt;Now that my job search is over, I want to share the lessons I learned from&#xA;interviewing as a software engineer 2 years into my career. Most of these are&#xA;not new (or specific to being 2 years into your career), but these points are&#xA;what specifically helped me the most.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intro to Angular.js Talk</title>
      <link>/posts/2014/intro-to-angular-js-talk/</link>
      <pubDate>Mon, 28 Apr 2014 23:40:24 +0000</pubDate>
      <guid>/posts/2014/intro-to-angular-js-talk/</guid>
      <description>&lt;p&gt;On April 24 I gave a talk, Introduction to Angular.js, to the &lt;a href=&#34;https://www.meetup.com/html5livecode/events/173124562/&#34;&gt;SF HTML5 Live Code meetup group&lt;/a&gt;. Here&amp;rsquo;s the screencast:&lt;/p&gt;&#xA;&lt;iframe width=&#34;560&#34; height=&#34;315&#34;&#xA;src=&#34;https://www.youtube.com/embed/fK4DBauAfJs?si=t4wGVVkKpDpNg32S&#34;&#xA;title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay;&#xA;clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34;&#xA;referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;</description>
    </item>
    <item>
      <title>Things learned while preparing for Angular Live Code</title>
      <link>/posts/2014/things-learned-preparing-for-angular-live-code/</link>
      <pubDate>Tue, 22 Apr 2014 00:00:00 +0000</pubDate>
      <guid>/posts/2014/things-learned-preparing-for-angular-live-code/</guid>
      <description>&lt;p&gt;This week I learned that there&amp;rsquo;s nothing quite like signing up to teach&#xA;something to make you realize you don&amp;rsquo;t actually know the material all that&#xA;well.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m giving an &lt;a href=&#34;http://www.meetup.com/html5livecode/events/173124562/&#34;&gt;introduction to AngularJS&#xA;talk&lt;/a&gt; this Thursday at&#xA;Startup House SF. You should come by if you want to learn about AngularJS.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s Tuesday and 124 people have signed up and I&amp;rsquo;m kind of nervous to say the&#xA;least.  I&amp;rsquo;ve tried to channel my nervousness into preparation (we&amp;rsquo;ll see if it&#xA;pays off or not). Here are a few things I&amp;rsquo;ve learned in the process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Two interesting IE JavaScript quirks</title>
      <link>/posts/2014/two-ie-js-quirks/</link>
      <pubDate>Fri, 14 Mar 2014 00:00:00 +0000</pubDate>
      <guid>/posts/2014/two-ie-js-quirks/</guid>
      <description>&lt;p&gt;In the past month I&amp;rsquo;ve diagnosed and fixed a couple particularly pernicious&#xA;bugs relating to JavaScript quirks in Internet Explorer. Hopefully if you&#xA;haven&amp;rsquo;t run into these before, this will save you some pain in the future.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-window-does-not-inherit-from-objectprototype&#34;&gt;1. &lt;code&gt;window&lt;/code&gt; does not inherit from &lt;code&gt;Object.prototype&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Oddly enough, according to the ECMAScript specification, the global &lt;code&gt;window&lt;/code&gt;&#xA;object does not necessarily have to inherit from &lt;code&gt;Object.prototype&lt;/code&gt;. In Chrome,&#xA;FF, and Safari, it does, but in IE it does not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>JavaScript&#39;s Mutative vs. Non-Mutative Array Methods</title>
      <link>/posts/2014/mutative-vs-non-mutative-array-methods-in-js/</link>
      <pubDate>Thu, 20 Feb 2014 12:00:04 +0000</pubDate>
      <guid>/posts/2014/mutative-vs-non-mutative-array-methods-in-js/</guid>
      <description>&lt;p&gt;This is an issue that has endlessly tripped me up in JavaScript and I hope this post will help clarify things a bit and hopefully discover a pattern one can use to discern between mutative and non-mutative array methods.&lt;/p&gt;&#xA;&lt;p&gt;First, let me define what I mean when I say mutative:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// If a method is mutative, that means it changes the original array.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;foo&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;];&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;foo&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;reverse&lt;/span&gt;();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;foo&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// [3, 2, 1]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Notice how we didn&amp;#39;t assign foo to new variable, reverse() acted upon it in place.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// In contrast, non-mutative array methods return a new copy of the original array.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Here, the new array concat() generates is lost since we didn&amp;#39;t assign it&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;];&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;concat&lt;/span&gt;([&lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;]);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// [1, 2, 3]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Now if we assign it, bar becomes the new array.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;concat&lt;/span&gt;([&lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;]);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;bar&lt;/span&gt;); &lt;span style=&#34;color:#75715e&#34;&gt;// [1, 2, 3, 4, 5]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;table&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;th&gt;Mutative&lt;/th&gt;&#xA;    &lt;th&gt;Non-Mutative&lt;/th&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice&#34;&gt;splice&lt;/a&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice&#34;&gt;slice&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift&#34;&gt;shift&lt;/a&gt;, &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop&#34;&gt;pop&lt;/a&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat&#34;&gt;concat&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift&#34;&gt;unshift&lt;/a&gt;, &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push&#34;&gt;push&lt;/a&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every&#34;&gt;every&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse&#34;&gt;reverse&lt;/a&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter&#34;&gt;filter&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort&#34;&gt;sort&lt;/a&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach&#34;&gt;forEach&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf&#34;&gt;indexOf&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf&#34;&gt;lastIndexOf&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join&#34;&gt;join&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map&#34;&gt;map&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce&#34;&gt;reduce&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight&#34;&gt;reduceRight&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some&#34;&gt;some&lt;/a&gt; *&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString&#34;&gt;toLocaleString&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;  &lt;tr&gt;&#xA;    &lt;td&gt;&lt;/td&gt;&#xA;    &lt;td&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString&#34;&gt;toString&lt;/a&gt;&lt;/td&gt;&#xA;  &lt;/tr&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;NB: the functional methods marked with a * can be mutative if the function you pass to them modifies the original array. In my expierience this has been especially true in the case of Array.prototype.forEach.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Japanese Programming</title>
      <link>/posts/2013/japanese-programming/</link>
      <pubDate>Mon, 25 Feb 2013 00:00:00 +0000</pubDate>
      <guid>/posts/2013/japanese-programming/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m certainly guilty of being a little to anglo-centric from time to time&#xA;(pizza is an American food, right?), so I was pleasantly surprised when I found&#xA;out that you can program in languages other than English. You can see the full&#xA;list on&#xA;&lt;a href=&#34;http://en.wikipedia.org/wiki/Non-English-based_programming_languages&#34;&gt;Wikipedia&lt;/a&gt;.&#xA;Since I&amp;rsquo;m into both computers and Japan, I thought I&amp;rsquo;d give a few of them a&#xA;spin.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dolittle-ドリトル&#34;&gt;Dolittle ドリトル&lt;/h2&gt;&#xA;&lt;p&gt;According to its &lt;a&#xA;href=&#34;http://ja.wikipedia.org/wiki/%E3%83%89%E3%83%AA%E3%83%88%E3%83%AB_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E)&#34;&gt;Wikipedia&#xA;page&lt;/a&gt;, Dolittle is a programming language for education developed by &lt;a href=&#34;http://ja.wikipedia.org/wiki/%E5%A4%A7%E9%98%AA%E9%9B%BB%E6%B0%97%E9%80%9A%E4%BF%A1%E5%A4%A7%E5%AD%A6&#34;&gt;Osaka&#xA;Electro-Communication&#xA;University&lt;/a&gt;.&#xA;Its creators called it Dolittle because they wanted to make a programming&#xA;language that made it very easy to start programming.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
