<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Post on Dan Kleiman</title>
    <link>https://dankleiman.com/post/index.xml</link>
    <description>Recent content in Post on Dan Kleiman</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 16 Feb 2019 11:31:03 -0500</lastBuildDate>
    <atom:link href="/post/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Roll Your Own Database: Part 1</title>
      <link>https://dankleiman.com/2019/02/16/roll-your-own-database-part-1</link>
      <pubDate>Sat, 16 Feb 2019 11:31:03 -0500</pubDate>
      
      <guid>https://dankleiman.com/2019/02/16/roll-your-own-database-part-1</guid>
      <description>Warning: This post is NSFW. In this series, we are going to build a really, really simple database management system that you should by no means use in a production work environment.
Here&amp;rsquo;s the experiment:
 Start with a naive implementation of a database &amp;ndash; read and write from a local csv file Reach for all the normal features we use every day: basic CRUD, aggregate queries, complex joins Realize that our basic implementation falls short Look at how these problems are solved in modern systems  Think of the whole series as one giant experiment in Cunningham&amp;rsquo;s Law: &amp;ldquo;the best way to get the right answer on the internet is not to ask a question; it&amp;rsquo;s to post the wrong answer.</description>
    </item>
    
    <item>
      <title>Seed Data for Your WIP SQL Queries</title>
      <link>https://dankleiman.com/2019/02/05/seed-data-for-your-wip-sql-queries</link>
      <pubDate>Tue, 05 Feb 2019 20:41:59 -0500</pubDate>
      
      <guid>https://dankleiman.com/2019/02/05/seed-data-for-your-wip-sql-queries</guid>
      <description>In my last post, I wrote about steps you can take to make writing complicated queries more manageable. One aspect that I didn&amp;rsquo;t cover in that post is how to set sample data to work with during the writing process. Assuming you&amp;rsquo;re not working directly in your production database as you test out new queries (right? right?? right???), you need some way to work on your new ideas.
In this post, I want to share some tips and tricks for creating reliable, reproduceable test data to help you develop new ideas in SQL.</description>
    </item>
    
    <item>
      <title>Stop Writing SQL Backwards</title>
      <link>https://dankleiman.com/2019/01/02/stop-writing-sql-backwards</link>
      <pubDate>Wed, 02 Jan 2019 09:21:26 -0500</pubDate>
      
      <guid>https://dankleiman.com/2019/01/02/stop-writing-sql-backwards</guid>
      <description>How many times have you started off building a complicated analytical SQL query like this?
SELECT . . . . uh??? . . SELECT * FROM . . . SELECT . . .  And you get stuck trying to figure out exactly what you want to select. You&amp;rsquo;re thinking about averages, group by&amp;rsquo;s, the order of your results or some change you want to see over time and the query editor is just sitting there, taunting you, because in SQL, you have to know up front what you want to select into your final results.</description>
    </item>
    
    <item>
      <title>3 Ways to Level Up Your SQL as a Software Engineer</title>
      <link>https://dankleiman.com/2018/02/06/3-ways-to-level-up-your-sql-as-a-software-engineer</link>
      <pubDate>Tue, 06 Feb 2018 12:31:44 -0500</pubDate>
      
      <guid>https://dankleiman.com/2018/02/06/3-ways-to-level-up-your-sql-as-a-software-engineer</guid>
      <description>&lt;p&gt;If you are a software engineer and you have just enough SQL to write queries that count, sum, average join and maybe sub-select, then I&amp;rsquo;m writing this post for you. If, when you need more complicated analysis or computation, you pull your query results into excel or your favorite scripting language to do more processing, then I have some good news.&lt;/p&gt;

&lt;p&gt;There&amp;rsquo;s a whole lot more you can do right in SQL and it&amp;rsquo;s not too bad to learn how to do it.&lt;/p&gt;

&lt;p&gt;In this post, I&amp;rsquo;m going to cover a few concepts that have recently helped me do more computation, better analysis, and it turns out, more efficient querying&amp;hellip;and I hope they help you too.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Keeping an Engineering Notebook</title>
      <link>https://dankleiman.com/2018/01/28/keeping-an-engineering-notebook</link>
      <pubDate>Sun, 28 Jan 2018 22:52:26 -0500</pubDate>
      
      <guid>https://dankleiman.com/2018/01/28/keeping-an-engineering-notebook</guid>
      <description>&lt;p&gt;The best upgrade I&amp;rsquo;ve made to my workflow in the past year was to start keeping an engineering notebook.&lt;/p&gt;

&lt;p&gt;Whenever I start a new project, the first thing I do is create a new section in my engineering notebook. It&amp;rsquo;s really simple. With a tiny script, I generate a dedicated folder for the new project, plus three sub-folders and a README:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    some_new_work
        |__ notes/
        |__ data/
        |__ scripts/
        |__ README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As simple as this structure seems, it has had a tremendous impact on my work. In this post, I want to try to unpack why and how I think that&amp;rsquo;s working.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>More Efficient Solutions to the Top N per Group Problem</title>
      <link>https://dankleiman.com/2017/11/07/more-efficient-solutions-to-the-top-n-per-group-problem</link>
      <pubDate>Tue, 07 Nov 2017 20:46:05 -0500</pubDate>
      
      <guid>https://dankleiman.com/2017/11/07/more-efficient-solutions-to-the-top-n-per-group-problem</guid>
      <description>&lt;p&gt;In my last post, I tried to tackle getting &lt;a href=&#34;https://dankleiman.com/blog/2017/10/30/top-n-per-group-in-bigquery/&#34;&gt;the Top N Results per Group&lt;/a&gt; from a BigQuery dataset.&lt;/p&gt;

&lt;p&gt;When I tweeted out the post, I got some great feedback and suggestions for more efficient ways to get the same results, so in this post I want to try to understand &lt;em&gt;why&lt;/em&gt; the alternatives are more efficient.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Top N Per Group in BigQuery</title>
      <link>https://dankleiman.com/2017/10/30/top-n-per-group-in-bigquery</link>
      <pubDate>Mon, 30 Oct 2017 19:29:32 -0400</pubDate>
      
      <guid>https://dankleiman.com/2017/10/30/top-n-per-group-in-bigquery</guid>
      <description>&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; After I posted this initially, I got some &lt;a href=&#34;https://twitter.com/Dan_Kleiman/status/925921880397287425&#34;&gt;great&lt;/a&gt; &lt;a href=&#34;https://www.reddit.com/r/bigquery/comments/7aecfe/top_n_per_group_in_bigquery/&#34;&gt;feedback&lt;/a&gt;, so I wrote a follow-up post &lt;a href=&#34;https://dankleiman.com/2017/11/07/more-efficient-solutions-to-the-top-n-per-group-problem/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this post, we are going to explore a strategy for collecting the &lt;strong&gt;Top N results per Group&lt;/strong&gt; over a mixed dataset, all in a single query.&lt;/p&gt;

&lt;p&gt;I stumbled onto this solution the other day, mostly driven by the fear that I was re-scanning my BigQuery data too often. At the time, the only way I knew how to look at a Top 10 list of a subset of the data was to add a &lt;code&gt;WHERE&lt;/code&gt; clause limiting the whole data set to a single group and combine with &lt;code&gt;ORDER BY&lt;/code&gt; and &lt;code&gt;LIMIT&lt;/code&gt; clauses.&lt;/p&gt;

&lt;p&gt;For each group, I would just modify the &lt;code&gt;WHERE&lt;/code&gt; clause, rescan all the data, and get new results. I thought there had to be an easier way to get the same ordered subset for any particular group in the data, all at once.&lt;/p&gt;

&lt;p&gt;It turns out, there is a much more efficient way to solve this problem.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Don&#39;t Blow Your BigQuery Budget on Unknown Data!</title>
      <link>https://dankleiman.com/2017/10/06/dont-blow-your-bigquery-budget-on-unknown-data</link>
      <pubDate>Fri, 06 Oct 2017 14:55:37 -0400</pubDate>
      
      <guid>https://dankleiman.com/2017/10/06/dont-blow-your-bigquery-budget-on-unknown-data</guid>
      <description>&lt;p&gt;It&amp;rsquo;s easy to blow your BigQuery budget when you are exploring a new data set. Because you&amp;rsquo;re billed for the amount of data scanned, not the ultimate result set, when you don&amp;rsquo;t know what you&amp;rsquo;re looking  for, you can end up with wasteful queries.&lt;/p&gt;

&lt;p&gt;In this post, I&amp;rsquo;m going to share some tips for more efficiently scanning data in BigQuery when you don&amp;rsquo;t quite know what you need.
&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>GoBridge with Bill Kennedy</title>
      <link>https://dankleiman.com/2017/02/12/gobridge-with-bill-kennedy</link>
      <pubDate>Sun, 12 Feb 2017 15:18:04 -0500</pubDate>
      
      <guid>https://dankleiman.com/2017/02/12/gobridge-with-bill-kennedy</guid>
      <description>&lt;p&gt;Last weekend, I had the chance to volunteer at a GoBridge event taught by Bill Kennedy of Ardan Labs. I&amp;rsquo;m trying to make &lt;a href=&#34;https://dankleiman.com/blog/2016/12/29/my-5-strategies-for-learning-go-in-2017/&#34;&gt;2017 my year of learning Go&lt;/a&gt;, so helping out at the event felt like a natural extension and a great way to connect with more people in the Go community.&lt;/p&gt;

&lt;p&gt;Going in with Ruby as my first language, I braced myself for static typing and wanted concurrent programming to bend my brain, but that&amp;rsquo;s not really what happened at all.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>My 5 Strategies for Learning Go in 2017</title>
      <link>https://dankleiman.com/2016/12/29/my-5-strategies-for-learning-go-in-2017</link>
      <pubDate>Thu, 29 Dec 2016 09:29:22 -0500</pubDate>
      
      <guid>https://dankleiman.com/2016/12/29/my-5-strategies-for-learning-go-in-2017</guid>
      <description>&lt;p&gt;Over the past couple of years, one thing I&amp;rsquo;ve become more and more aware of is the unease and uncertainty of diving into a new project. Not matter what the new X is, I find I always go through the same set of uncomfortable feelings on my initial approach.&lt;/p&gt;

&lt;p&gt;Now, though, I&amp;rsquo;m starting to become familiar enough with this process that &amp;ndash; even though the discomfort doesn&amp;rsquo;t go away in the initial learning stages &amp;ndash; I can embrace it, coexist with it, and forge ahead in learning, because of the strategies I&amp;rsquo;m going to lay out here.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Rails Security Exercises from Bearclaw</title>
      <link>https://dankleiman.com/2016/09/24/rails-security-exercises-from-bearclaw</link>
      <pubDate>Sat, 24 Sep 2016 06:05:49 -0400</pubDate>
      
      <guid>https://dankleiman.com/2016/09/24/rails-security-exercises-from-bearclaw</guid>
      <description>In this post, I&amp;rsquo;m going to tell you what I learned doing a series of Rails security exercises developed by Bearclaw, a Rails security consultancy.
Before I go into the exercises, though, I want to send a huge thank you to Ali Najaf, founder of Bearclaw. What I&amp;rsquo;ve learned here is due to the thoughtfulness of the exercises he&amp;rsquo;s put together and his willingness to try something new by sharing them with me.</description>
    </item>
    
    <item>
      <title>Nice Try, NilClass</title>
      <link>https://dankleiman.com/2016/04/10/nice-try-nilclass</link>
      <pubDate>Sun, 10 Apr 2016 07:13:27 -0400</pubDate>
      
      <guid>https://dankleiman.com/2016/04/10/nice-try-nilclass</guid>
      <description>I love that feeling when a new concept starts to come together in your mind and you can point to all the converging sources of insight.
Right now, I can&amp;rsquo;t tell if I&amp;rsquo;m fooling myself, hiding some logic, or making my code more readable with this particular concept, but when I put together these three pieces of information, I think I start to see something emerge. I&amp;rsquo;ve been inspired to do some more digging into these kinds of questions lately thanks to the awesome new Ruby Book Club Podcast.</description>
    </item>
    
    <item>
      <title>Migrating Posts and Pages from Wordpress to Jekyll</title>
      <link>https://dankleiman.com/2016/03/11/migrating-posts-and-pages-from-wordpress-to-jekyll</link>
      <pubDate>Fri, 11 Mar 2016 13:55:15 -0500</pubDate>
      
      <guid>https://dankleiman.com/2016/03/11/migrating-posts-and-pages-from-wordpress-to-jekyll</guid>
      <description>&lt;p&gt;&lt;em&gt;This is Part 1 in a series on &lt;a href=&#34;https://dankleiman.com/blog/2016/03/09/migrating-from-wordpress-to-jekyll/&#34;&gt;Migrating from Wordpress to Jekyll&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The documentation for &lt;a href=&#34;https://jekyllrb.com/docs/quickstart/&#34;&gt;getting started with Jekyll&lt;/a&gt; is great. I&amp;rsquo;m not going to rehash everything that&amp;rsquo;s covered there.&lt;/p&gt;

&lt;p&gt;Instead, this post and the others in the series will be more like, &amp;ldquo;here&amp;rsquo;s the order I wish I had done things in&amp;rdquo; or &amp;ldquo;here&amp;rsquo;s everything I ended up needing to pull together to get stuff working&amp;rdquo;. I hope it helps you and saves you time if you ever decide to do a similar migration from a self-hosted Wordpress install to Jekyll.&lt;/p&gt;

&lt;p&gt;So here we go&amp;hellip;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Migrating from Wordpress to Jekyll</title>
      <link>https://dankleiman.com/2016/03/09/migrating-from-wordpress-to-jekyll</link>
      <pubDate>Wed, 09 Mar 2016 13:09:18 -0500</pubDate>
      
      <guid>https://dankleiman.com/2016/03/09/migrating-from-wordpress-to-jekyll</guid>
      <description>&lt;p&gt;So, I&amp;rsquo;ve decided to migrate my &lt;a href=&#34;http://dankleiman.com&#34;&gt;Tai Chi site at dankleiman.com&lt;/a&gt; from Wordpress to a new static site using Jekyll.&lt;/p&gt;

&lt;p&gt;Since I haven&amp;rsquo;t posted there in almost two years, but I get a steady stream of new subscribers who want to learn about Tai Chi, qigong, and meditation, I thought it would be good to give the 300+ pages and posts a more evergreen feel.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>I Hate Voicemail: Straight to SMS with Twilio</title>
      <link>https://dankleiman.com/2015/09/15/i-hate-voicemail-straight-to-sms-with-twilio</link>
      <pubDate>Tue, 15 Sep 2015 08:02:19 -0400</pubDate>
      
      <guid>https://dankleiman.com/2015/09/15/i-hate-voicemail-straight-to-sms-with-twilio</guid>
      <description>&lt;p&gt;I hate checking my voicemail. I hate the nagging voicemail icon on my phone that won&amp;rsquo;t be dismissed unless I actually check my voicemail. I hate how listening to a voicemail, capturing relevant information from it, and calling someone back breaks up the normal flow of how I communicate with people all day long: asynchronously, via written communication like email or text.&lt;/p&gt;

&lt;p&gt;These days, when I want to talk to someone, we plan a time to talk and that&amp;rsquo;s fine. But some people still call and leave me a black-box-of-a-voicemail that I have to wade into.&lt;/p&gt;

&lt;p&gt;I needed some way to cut voicemail out of my life&amp;hellip;so I hooked up a Twilio app to handle it for me.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>