Nik Kantar 2018-05-28T00:00:00Z Nik Kantar https://nkantar.com PyCon 2018: The Afterfeels I went to PyCon (again) and it was amazing (again). https://nkantar.com/blog/pycon-2018 2018-05-28T00:00:00Z <p>I went to PyCon again this year, for the second time, and had a predictably great time.</p> <p>It's hard to do it service after the fact, given the extent to which it's a social event as opposed to a technical one. That said, trying is still a worthy endeavor, so let's!</p> <p><img src="/static/media/2018/05/pycon2018-badge.jpg" alt="PyCon 2018 badge"></p> <p>(Why I put "You look great" on my badge I don't <em>really</em> know, but my best guess is that I registered with the help of some whiskey. <code>¯\_(ツ)_/¯</code>)</p> <h2>People</h2> <p>I met a lot of new folks this year, more than the last time for sure. Naming them here would be weird, but I plan on reaching out to them over the next few days to follow up.</p> <p>Said meetings occurred mostly during meals, open spaces, and post-conference social events. PyCon attendees are generally such a lovely bunch that joining a random group for every food outing tends to be a really solid strategy.</p> <h2>Open Spaces</h2> <p>This year I didn't attend nearly as many ast last year. I went to the secret/config management one hosted by <a href="http://sedimental.org/">Mahmoud</a>, and was briefly at <a href="https://davidism.com/">David</a>'s Pallets/Flask session before having to step out. I was reminded about <a href="https://github.com/SimpleLegal/pocket_protector">Pocket Protector</a> and learned a few things about managing secrets (like don't store them in environment variables as your environment may find itself dumped into your logs) at the former, and got an overview of the state of the Pallets Projects portfolio at the latter. Neat.</p> <h2>Talks</h2> <p>All the talks are posted on YouTube, on the <a href="https://www.youtube.com/channel/UCsX05-2sVSH7Nx3zuk3NYuQ/videos">official channel</a>.</p> <p>A few of my favorites (in alphabetical order per author):</p> <ul> <li>Alex Gaynor — <a href="https://www.youtube.com/watch?v=L9Y2ap6vIMg">Learning From Failure: Post Mortems</a></li> <li>Allison Kaptur — <a href="https://www.youtube.com/watch?v=HuuYwUxM-ZY">Love your bugs</a></li> <li>Amber Brown ("HawkOwl") — <a href="https://www.youtube.com/watch?v=A5tPhUKljuY">How We Do Identity Wrong</a></li> <li>Christopher Neugebauer, Josh Simmons, Sam Kitajima-Kimbrel — <a href="https://www.youtube.com/watch?v=C7ZhMnfUKIA">How we designed an inclusivity-first conference on a shoestring budget and short timeline</a></li> <li>Esther Nam — <a href="https://www.youtube.com/watch?v=IYWlfVqBQLc">One weird trick to becoming a better software developer</a></li> <li>Hynek Schlawack — <a href="https://www.youtube.com/watch?v=wuCpCkrfeMs">How to Write Deployment-friendly Applications</a></li> <li>Irina Truong — <a href="https://www.youtube.com/watch?v=X4YHGKj3V5M">Adapting from Spark to Dask: what to expect</a></li> <li>Larry Hastings — <a href="https://www.youtube.com/watch?v=Jd8ulMb6_ls">Solve Your Problem With Sloppy Python</a></li> <li>Ned Batchelder — <a href="https://www.youtube.com/watch?v=duvZ-2UK0fc">Big-O: How Code Slows as Data Grows</a></li> <li>Sam Kitajima-Kimbrel — <a href="https://www.youtube.com/watch?v=0Z45gcIwwrQ">Bowerbirds of Technology: Architecture and Teams at Less-than-Google Scale</a></li> </ul> <p>But really, you should just go and watch everything.*</p> <h3>* Aside: What to <em>Actually</em> Watch</h3> <p>The reality is that there are way too many talks for you to watch them all, unless you happen to have <em>lots</em> of downtime. And if you do, there's always <a href="https://www.youtube.com/channel/UCrJhliKNQ8g0qoE_zvL8eVg/videos">PyCon 2017</a>, and <a href="https://www.youtube.com/channel/UCwTD5zJbsQGJN75MwbykYNw/videos">PyCon 2016</a>, and <a href="https://www.youtube.com/channel/UCgxzjK6GuOHVKR_08TT4hJQ/videos">PyCon 2015</a>, and <a href="https://www.youtube.com/user/PyCon2014">PyCon 2014</a>, and…you get the point. In all likelihood, you have to be picky, and I understand.</p> <p>My strategy is to try watching just about everything that isn't <em>entirely unrelated</em> to the things I do. I use Python to build web applications, to manage some of that stuff, and for general programming, so I effectively try and watch everything that isn't data science or machine learning. Yes, this means I miss a lot of really great stuff, but I get plenty out of most of what I do watch.</p> <p>That's because I end up watching talks about the web, but also on more general topics, such as static types, software engineering best practices, and the Python community itself. These are all at least somewhat interesting to me, tend to be valuable, and there is enough variety to expose me to new ideas.</p> <h2>Cleveland</h2> <p>I'll admit I didn't experience too much of the city, but what I did I quite enjoyed.</p> <p>PyCon was held at the Huntington Convention Center, right in Downtown Cleveland. This put us a few blocks from the Rock &amp; Roll Hall of Fame, tons of food, and Lake Eerie. I didn't get the see the Hall of Fame this time, but all the food I had was excellent, and the lake was a beautiful sight from my hotel room. Downtown architecture is also really interesting to someone not used to seeing much other than Los Angeles.</p> <h2>Next Time</h2> <p>I'll definitely be going next year, and am already excited for it. I actually thought about booking a hotel room before leaving…</p> <p>I hope to stay in the same hotel—the Hilton Cleveland Downtown—as it's a rather nice hotel on its own merits, <em>and</em> is connected to the convention center by a direct tunnel, allowing me to leave my jacket in the room and stop by there quickly before heading out in the evening if need be. It also means I'm 15 minutes away from my laptop at all times, which I didn't use at the conference <em>at all</em>, and would thus prefer to leave in the room unless I expect to need it for an open space or some unstructured hacking.</p> <p>My lightning talk didn't make it in this time, but I'm definitely going to try to speak again, and by then I'm hoping to develop the full version, so I can try for both.</p> <p>I'll participate in more open spaces, as they're generally pretty rewarding. Not doing so this year is a bit of a regret.</p> <p>I plan on hanging around for at least some of the sprints. It didn't work out this year for a variety of reasons, but I think I can make it happen if I prioritize it higher.</p> <p>And finally, I'll make sure I have time to see the Rock &amp; Roll Hall of Fame and nearby museums.</p> <p><em>See you next year!</em></p> <p><img src="/static/media/2018/05/pycon2019-slide.jpg" alt="PyCon 2019 slide"></p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20PyCon%202018%3A%20The%20Afterfeels">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> There's No Going Back Years of questionable JavaScript and generally slowing web have taught me to distrust my browser's back button. https://nkantar.com/blog/theres-no-going-back 2018-02-22T00:00:00Z <p>I clicked a link on a web page the other day and it hit me like a ton of bricks: I don't really trust my browser's back button any more, and I haven't in a <em>while.</em></p> <h2>Some (Sloppy) Backstory</h2> <p>Many, many moons ago&mdash;read: 1990-ish&mdash;the World Wide Web was created, largely for researchers to share <em>documents</em> (called <em>web sites</em>) with each other. These documents had <em>hyperlinks</em>, which were clickable parts that would lead to other documents. Web browsers used to navigate these documents had the ability to go backwards and forwards through the user's path.</p> <p>The Web as a platform has evolved greatly since then. We've piled on a great many features on top of this simple (to use) document sharing and linking platform to make something we call <em>web applications</em> on it, and that's what most of us are trying to load in our browsers most of the time.</p> <p>We use these rich web apps to communicate (e.g., Facebook, Gmail), buy and sell (e.g., Amazon, Shopify), watch TV (e.g., Netflix, YouTube), work (e.g., GitHub, Office 365), and do a myriad other things, and most of us very rarely peruse a site reminiscent of that original idea of linked documents for long. The landscape is quite different from what it was in the early days.</p> <h2>An Experiment and the Problem</h2> <p>Open up your Facebook feed, scroll down a few screens (as it live reloads to add more content to the bottom), then click a user's profile picture, then click on something on their user page. Now click the back button two times. You're not probably back on your feed, but it's likely the actual content has changed, and you don't see the post with the profile picture you clicked. Back button: <em>broken.</em></p> <p>This isn't an isolated scenario&mdash;I run into it on a variety of <del>sites</del> web apps just about daily, and I've noticed a learned behavior resulting from it: I open almost everything in a new tab and completely distrust the back button, even on sites where I <em>know</em> it will do the correct thing (like this one).</p> <p><em>This is crazy!</em></p> <p>Over the years, browsers have evolved their UIs. I used to remove everything from their toolbars except the back and forward buttons, refresh button, address bar, and search bar (when that was still a thing). Now they actually look like that out of the box, but the very first two elements of that UI are often unhelpful.</p> <p>Perversely, I've realized I open nearly <em>everything</em> in a new tab (Cmd-Shift-Click), often several times during my adventure to some destination, and then close all those tabs when I'm done. Why don't I just click through in a single tab? Because there's a chance I'll take the wrong turn, and if the back button does something weird (see the Facebook experiment above), I'll be annoyed and waste time figuring out where to navigate next.</p> <p>As I said, this is crazy.</p> <h2>One More Thing</h2> <p>Another part of this problem is how awfully slow the Web has become. My connection speed is generally pretty stellar, as I live in a very urban part of the Western world. The devices I use to browse the Web are built with fairly recent hardware and have very reasonable absolute performance. However, between the ad networks and the poorly architected backends and the heavy frontends, my computer has a hard time fetching and rendering much of what I ask for, in spite of being powerful enough to run <em>multiple virtual machines at once.</em></p> <p>Think about that for a second: I can ask my computer to pretend it's also several other computers, with a variety of operating systems, and it'll do just fine. But if I want to see Facebook, there's noticeable lag when displaying some small pictures and a bit of text. (Yes, I'm grossly oversimplifying, but you get the point.)</p> <h2>Real Talk&trade;</h2> <p>So, with the above being an obviously silly situation, can we stop breaking the back button? And&mdash;while I have your attention&mdash;the scroll? Thanks.</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20There%27s%20No%20Going%20Back">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Goals for 2018 Here we are again, with a bit of a twist. https://nkantar.com/blog/goals-for-2018 2018-02-10T00:00:00Z <p>A new year is upon us, which means it's time to talk about goals again.</p> <p>I started this in <a href="/blog/goals-for-2016" title="Goals for 2016">2016</a> (<a href="/blog/goals-for-2016-in-review" title="Goals for 2016 in Review">review</a>) and continued in <a href="/blog/goals-for-2017" title="Goals for 2017">2017</a> (<a href="/blog/goals-for-2017-in-review" title="Goals for 2017 in Review">review</a>). The scorecards aren't necessarily particularly impressive, but the act of reflecting alone has been fun and helpful.</p> <p>I had initially thought about changing things up for 2018 by not limiting myself to five things, allowing for more if I felt so inclined, but decided against it. Setting more goals would've required more forgiveness for not meeting them, possibly begging the question of why even bother.</p> <p>However, after some consideration, I've realized that instead of going with the usual five, I ought to set only one goal for this year:</p> <h2>1. Make <em>PyBeach</em> Happen</h2> <p><a href="/blog/announcing-pybeach/" title="Announcing PyBeach"><em><strong>PyBeach</strong></em></a> is a Python conference I'm organizing in LA in early 2019.</p> <p>While I'm (possibly foolishly) confident everything will be fine, the reality is that successfully putting on even a small regional conference is a big task. I'm also keenly aware that I've never done anything quite like this, and am therefore a poor judge of exactly how challenging it will be.</p> <p>Realistically then, I should focus on making sure my confidence isn't for naught.</p> <p>It's important to note that this in no way means I won't learn or accomplish anything else this year. I'm constantly learning new things, even unintentionally, and I've already got some traction with projects, with a much improved new major version of <a href="https://github.com/nkantar/Autohook" title="nkantar/Autohook on GitHub">Autohook</a> (which received a <a href="https://github.com/nkantar/Autohook/pull/2" title="Autohook PR">contribution</a>, a first for me!) and the first public release of <a href="https://github.com/nkantar/Keysort" title="nkantar/Keysort on GitHub">Keysort</a>. I also have type hints for <a href="https://github.com/nkantar/Parsenvy" title="nkantar/Parsenvy on GitHub">Parsenvy</a> in the works, and I'm sure other small things will materialize in time.</p> <p>But it's also important for me to be realistic and honest with myself, and I really want to make sure <em>PyBeach</em> is a huge success. And I have a great <a href="http://eirinikos.github.io/" title="Andrea Kao">co-conspirator</a> I can't disappoint!</p> <p>So, be cool and check out the PyBeach <a href="https://pybeach.org" title="PyBeach">website</a>, sign up for the exceedingly-low-volume <a href="https://tinyletter.com/PyBeach" title="PyBeach Announcements">newsletter</a>, and follow us on <a href="https://twitter.com/PyBeachLA" title="@PyBeachLA on Twitter">Twitter</a>. And if you want to be <em>super</em> cool, join our <a href="https://pybeach-slack-invite.herokuapp.com/" title="PyBeach Slack invite">Slack team</a> and help us make it happen!</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Goals%20for%202018">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Announcing PyBeach A new Python conference is coming to town. https://nkantar.com/blog/announcing-pybeach 2018-02-09T00:00:00Z <p>In 2017 I went to my first two conferences, <a href="https://us.pycon.org/2017/" title="PyCon 2017">PyCon 2017</a> and <a href="https://2017.northbaypython.org/" title="North Bay Python 2017">North Bay Python 2017</a>, and absolutely loved it.</p> <p><em>PyCon</em> was a huge (inter)national event with a stunning number of people from the fantastic Python community, a real tour de force. I spent the vast majority of my time on the hallway track (socializing with other attendees in the hallways), attending only the keynotes and a few other talks.</p> <p><em>North Bay Python</em> was a small regional conference about a tenth of the size, much more intimate. Most attendees watched all the talks of the single track, with socializing happening during breaks, at meals, and before and after the conference days themselves.</p> <p>Both conferences were amazing, and left me overjoyed to be part of this amazing community. However, <em>North Bay Python</em> did more than that&mdash;it inspired me to organize one.</p> <p>And so, before I was even back home, the idea of <a href="https://pybeach.org" title="PyBeach"><em><strong>PyBeach</strong></em></a> was born.</p> <p><em>PyBeach</em> is (going to be) an annual Python conference in Los Angeles, California, with the inaugural event slated for spring of 2019. It's meant to be a small regional conference, much like North Bay Python, with a focus on diversity of both topics and attendees.</p> <p>It's also very much a work in progress. If you'd like to get involved, you can invite yourself to the <a href="https://pybeach-slack-invite.herokuapp.com/" title="PyBeach Slack invite">Slack team</a> and your help will be more than welcome.</p> <p>If you'd just like to keep up with news and announcements, you should subscribe to the <a href="https://tinyletter.com/PyBeach" title="PyBeach Announcements">newsletter</a> and follow us on <a href="https://twitter.com/PyBeachLA" title="@PyBeachLA">Twitter</a>.</p> <p>I'll see you there! ;)</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Announcing%20PyBeach">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Goals for 2017 in Review Time for another look back, this time at 2017. https://nkantar.com/blog/goals-for-2017-in-review 2018-01-23T00:00:00Z <p>A year ago I <a href="/blog/goals-for-2017" title="Goals for 2017">set a few goals</a>, much like <a href="/blog/goals-for-2016" title="Goals for 2016">the year before</a>, and now it's time to review my results, also much like <a href="/blog/goals-for-2016-in-review" title="Goals for 2016 in Review">the year before</a>.</p> <p>Let's again begin with a scorecard:</p> <ol> <li><em>really</em> learn to touch type: &#x02717;</li> <li>write every week: &#x02717;</li> <li>learn a new programming paradigm: &#x02717;</li> <li>up my Python game: &#x02713;</li> <li>release one project each month: &#x02717;</li> </ol> <p><em>Score: 1/5</em></p> <h2>1. <em>Really</em> Learn to Touch Type: &#x02717;</h2> <p>I'd say I'm <em>significantly</em> better at typing, but I didn't invest the kind of concerted effort I intended, so no dice. I'd wager that at this point I'm close enough not to fret over it too much.</p> <h2>2. Write Every Week: &#x02717;</h2> <p>This <em>most definitely</em> didn't happen. I did better than in 2016, but mostly in the first few months of the year. I'm not really a <em>blogger</em> per se, so trying to force it results in quality below what I'd like for this particular platform.</p> <h2>3. Learn a New Programming Paradigm: &#x02717;</h2> <p>Analysis paralysis was the biggest challenge here. I had spent so much time deciding between Elixir, Elm, and React that I ended up with nothing. On the plus side, I did toy around with all three <em>a little bit,</em> and it looks like in 2018 I'll get to do some of it at work, so all is not lost.</p> <h2>4. Up My Python Game: &#x02713;</h2> <p>The one victory for 2016 was my understanding of Python. It's hard to put into words, but I feel much more in tune with the language philosophically. I'm not quite sure how much (more) expertise I have, but I feel like I understand what "pythonic" means far better than before, and that was the goal.</p> <h2>5. Release One Project Each Month: &#x02717;</h2> <p>This was going reasonably well for a few months, but faded in the second half of the year.</p> <p>Here's the list of released projects, in order of appearance:</p> <ul> <li><a href="https://github.com/nkantar/Autohook" title="nkantar/Autohook: A very, very small Git hook manager with focus on automation">Autohook</a>: A very, <em>very</em> small Git hook manager. Essentially a shell script meant to be symlinked to that looks for appropriately named scripts to run.</li> <li><a href="https://www.sendotterlove.com/" title="Send Otter Love">Send Otter Love</a>: Send cute otter pictures with puns to someone you love.</li> <li><a href="https://github.com/nkantar/Parsenvy" title="nkantar/Parsenvy: Enviously Elegant Environment Variable Parsing">Parsenvy</a>: Tiny library for environment variable parsing in Python with type support.</li> <li><a href="https://github.com/nkantar/SPI.vim" title="nkantar/SPI.vim: Sort Python Imports — Sort Python imports by module/package name">SPI.vim</a>: Vim plugin for Python <code>import</code> sorting.</li> <li><a href="https://pep20.org" title="PEP 20 ~ The Zen of Python">pep20.org</a>: Small tribute to <a href="https://www.python.org/dev/peps/pep-0020/" title="PEP 20 -- The Zen of Python &vert; Python.org">my favorite PEP</a>.</li> <li><a href="https://starminder.xyz" title="Starminder">Starminder</a>: GitHub starred project reminder.</li> <li><a href="https://funatparti.es/" title="funatparti.es">funatparti.es</a>: A meta-memetastic static site I'm not even really sure how to describe.</li> <li><a href="http://socalpython.com/" title="SoCal Python">SocalPython.com</a>: Static site for my local Python meetup group.</li> </ul> <p>All in all, I'm actually pretty happy with the results, as Autohook, Send Otter Love, Parsenvy, and Starminder have all been successes in their own ways:</p> <ul> <li>Autohook has 22 stars on GitHub as of this moment, and at least I'm using it.</li> <li>Send Otter Love actually profited a little when it was launched last Valentine's Day.</li> <li>Parsenvy is now part of all my Python personal projects.</li> <li>Starminder has 25 users.</li> </ul> <p>I'll give myself partial credit for this one.</p> <h2>Now What?</h2> <p>One (and a half) out of five is, uhh, definitely not great.</p> <p>That said, 2017 was a big year for me personally, with my priorities and rhythm shifting throughout the year, so I'm OK with it. Additionally, the successful projects have far surpassed anything I've ever accomplished before on my own, which is a huge win.</p> <p>In a few days I'll write up my thoughts for 2018. This time I plan on doing something different.</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Goals%20for%202017%20in%20Review">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Modifying a List in Place in Python A neat (if questionably legible) trick for modifying a list in place in Python, and a more Pythonic solution for the same problem. https://nkantar.com/blog/modifying-a-list-in-place-in-python 2017-10-05T00:00:00Z <p>One of the talks at the <a href="https://www.meetup.com/socalpython/events/243562264/" title="September meeting at Cars.com (Santa Monica) - SoCal Python (Los Angeles, CA) &vert; Meetup">most recent meeting</a> of <a href="https://www.meetup.com/socalpython/" title="SoCal Python (Los Angeles, CA) &vert; Meetup">SoCal Python</a> was about generators and in the Q&amp;A session after it somehow we landed on modifying a list in place. I'd like to share with you something neat I learned.</p> <p>But first&hellip;</p> <h2>"Why can't you modify the list in place the obvious way?"</h2> <p>Let's find out!</p> <div class="highlight"><pre><span></span><span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span> <span class="c1"># [0, 1, 2, 3, 4]</span> <span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">my_list</span><span class="p">:</span> <span class="o">...</span> <span class="n">my_list</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">element</span><span class="p">)</span> <span class="o">...</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span> </pre></div> <p>Turns out that because of how list iteration works in Python, we skip every other element. That's not exactly great.</p> <h2>"OK, so how do you do it?"</h2> <p>Here's some syntactic sugar:</p> <div class="highlight"><pre><span></span><span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span> <span class="c1"># [0, 1, 2, 3, 4]</span> <span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">my_list</span><span class="p">[:]:</span> <span class="c1"># note what we&#39;re iterating through</span> <span class="o">...</span> <span class="n">my_list</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">element</span><span class="p">)</span> <span class="o">...</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="p">[]</span> </pre></div> <p><small>(The `[:]:` notation almost looks like a little robot emoticon. (Remember emoticons? Before emoji?))</small></p> <h2>"Wat"</h2> <p>As it turns out, <code>my_list[:]</code> creates a copy of <code>my_list</code>.</p> <h2>"Is that it?"</h2> <p>There are other ways to copy a list that may be more legible, though. Here's one:</p> <div class="highlight"><pre><span></span><span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="o">=</span> <span class="n">list_copy</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span> <span class="c1"># [0, 1, 2, 3, 4]</span> <span class="o">&gt;&gt;&gt;</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">list_copy</span><span class="p">:</span> <span class="c1"># again note what we&#39;re iterating through</span> <span class="o">...</span> <span class="n">my_list</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">element</span><span class="p">)</span> <span class="o">...</span> <span class="o">&gt;&gt;&gt;</span> <span class="n">my_list</span> <span class="p">[]</span> </pre></div> <p>This is probably the more maintainable method of the two, but I don't find it as&hellip;fun.</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Modifying%20a%20List%20in%20Place%20in%20Python">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Crush Cancer 2017 Donate to cancer research and watch me do a grueling workout. https://nkantar.com/blog/crush-cancer-2017 2017-08-22T00:00:00Z <p>Cancer sucks.</p> <p>In 2012 I joined a <a href="http://dogtowncrossfit.com" title="DogTown CrossFit">fantastic gym</a> and one of the "side effects" was participating in <a href="https://www.youtube.com/watch?v=zkTsnF4A-FY" title="Crush Cancer 2012">Crush Cancer 2012</a> and raising $346 out of the $113,783 total. Having never really fundraised much of anything before, this was <em>major success</em> in my book.</p> <p>I also got a little too&hellip;creative, and pledged to do a burpee for each dollar raised. 346 burpees is a lot of burpees, so I broke them up over, uhh, two years or so, but the <a href="https://www.youtube.com/watch?v=gy28kFEzRlI" title="Crush Cancer 2012 Burpees">resulting video</a> is pretty hilarious.</p> <p><img src="/static/media/2017/08/crush-cancer-2012-full.jpg" alt="Crush Cancer 2012" title="Crush Cancer 2012"></p> <p>(That's me at Crush Cancer 2012, regretting everything, photographed by Omid Khalili.)</p> <p>Well, it's time for another round.</p> <p><del>I'm not offering any burpees this time around&mdash;I learned that lesson in 2012&mdash;but you should [donate anyway](https://www.crowdrise.com/dogtown-crushes-cancer/fundraiser/nikolakantar "DogTown Crushes Cancer - Nikola Kantar's Fundraiser"). I've set $500 as my goal, but will shamelessly up it if I get anywhere near that number fast enough. (And depending on your donation amount, you may be able to negotiate something like those infamous burpees&hellip;)</del></p> <p><em>Edit:</em> Against my (and everyone else's) better judgment, I will again do a burpee for every dollar donated. However, to avoid the 2012 fiasco, I will do them at a rate of no less than 100 per week, starting the week after the event. For example, If I reach my goal of $500, they'll be done by Sunday, November 26<sup>th</sup>, 2017. If the total ends up being so high as to make this impractical, I reserve the right to put myself through something just as grueling but doable at a faster pace. So go ahead and <a href="https://www.crowdrise.com/dogtown-crushes-cancer/fundraiser/nikolakantar" title="DogTown Crushes Cancer - Nikola Kantar&#39;s Fundraiser">donate</a> now, before you forget.</p> <p>Additionally, the actual workout event is open to public, so you can come and watch me suffer for 17 painfully long minutes, high mostly on adrenaline and questionable ideas about my own fitness.</p> <p>But really, it's more important that you <a href="https://www.crowdrise.com/dogtown-crushes-cancer/fundraiser/nikolakantar" title="DogTown Crushes Cancer - Nikola Kantar&#39;s Fundraiser">donate</a>.</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Crush%20Cancer%202017">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Introducing Starminder I got tired of forgetting all about my 400+ starred GitHub projects and made a reminder app. https://nkantar.com/blog/introducing-starminder 2017-07-31T00:00:00Z <p>TL;DR: Go check it out at <a href="https://starminder.xyz" title="Starminder">starminder.xyz</a>!</p> <hr> <p>I've been using GitHub for a few years, and have starred <a href="https://github.com/nkantar?tab=stars" title="nkantar&#39;s stars">457 projects</a> as of now. I have no real idea about what's in there.</p> <p>Some time ago I thought it'd be neat if I occasionally received an email with a few of those projects, just as a "hey, you once cared about this" reminder.</p> <p>So I made that.</p> <p><a href="https://starminder.xyz" title="Starminder">Starminder</a> actually lets you choose how many projects you want in this email, how often you want it (daily or a specific day each week), and what time of day you want it.</p> <p>And that's it.</p> <p>The repo is on <a href="https://github.com/nkantar/Starminder" title="nkantar/Starminder on GitHub">GitHub</a> if you'd like to contribute to it or follow its development.</p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Introducing%20Starminder">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> My New Vim Statusline I realized my statusline was still bloated, so I trimmed it even more. https://nkantar.com/blog/my-new-vim-statusline 2017-04-17T00:00:00Z <p>In January I wrote about <a href="/blog/my-vim-statusline" title="My Vim Statusline">my Vim statusline</a>, explaining all its parts and why they're enough for me not to care about using something like <a href="https://github.com/vim-airline/vim-airline" title="vim-airline/vim-airline on GitHub">Airline</a>.</p> <p>Since then I've realized:</p> <ol> <li>I don't actually read almost any of it, ever;</li> <li>There's a single command that deprecates three different parts at once.</li> </ol> <p>In light of this, I removed a lot of cruft and am much happier with the result, and I'd like to share it here:</p> <div class="highlight"><pre><span></span><span class="k">set</span> <span class="nb">statusline</span><span class="p">=</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>%F <span class="c">&quot; file path</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>\ <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>%{ReadonlyForStatusline<span class="p">()</span>} <span class="c">&quot; readonly ([!])</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>\ <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>%<span class="k">m</span> <span class="c">&quot; modified ([+])</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>%<span class="p">=</span> <span class="c">&quot; right-align from here</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>%{PasteForStatusline<span class="p">()</span>} <span class="c">&quot; paste ([p])</span> <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>\ <span class="k">set</span> <span class="nb">statusline</span><span class="p">+=</span>[%{ALEGetStatusLine<span class="p">()</span>}] <span class="c">&quot; ALE</span> </pre></div> <p>Here's what it looks like:</p> <p><img src="/static/media/2017/04/my-new-vim-statusline.png" alt="New Vim statusline"></p> <p>Yep, that's the whole thing. Here are the ingredients:</p> <ul> <li><strong>file path</strong>: self explanatory</li> <li><strong>readonly</strong>: shows <code>[!]</code> if the file is read-only</li> <li><strong>modified</strong>: shows <code>[+]</code> if the file has been modified but not saved</li> <li><strong>paste</strong>: shows <code>[p]</code> if paste mode is enabled</li> <li><strong>ALE</strong>: shows my <a href="https://github.com/w0rp/ale" title="w0rp/ale on GitHub">linter</a>'s flags (<code>[x3 !5]</code>/<code>[OK]</code>):<ul> <li><code>x</code> for errors</li> <li><code>!</code> for warnings</li> <li><code>OK</code> if all is well</li> </ul> </li> </ul> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20My%20New%20Vim%20Statusline">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p> Programmer, Developer, Engineer, Lexicographer What am I even supposed to call myself these days? https://nkantar.com/blog/programmer-developer-engineer-lexicographer 2017-04-14T00:00:00Z <p>I've been thinking about this for quite some time, but <a href="https://medium.com/@lateplate" title="Dan Kim">Dan Kim</a>'s <a href="https://m.signalvnoise.com" title="Signal v. Noise">Signal v. Noise</a> piece on <a href="https://m.signalvnoise.com/just-starting-out-ditch-the-full-stack-developer-label-11df9d3c7c6" title="Just starting out? Ditch the “full stack developer” label">"full stack developer"</a> finally prompted me to write down some of the, uhh, <em>results.</em></p> <p>Having first gotten a taste of programming when I was some seven or eight years old, the word I'd initially learned to describe the person doing it was "programmer". It seemed rather appropriate, and, well, still does.</p> <p>Sometime after that I'd caught wind of "developer" and no, I don't think it was thanks to <a href="https://www.youtube.com/watch?v=Vhh_GeBPOhs" title="Steve Ballmer: Developers">Steve Ballmer</a>. I've spent much of my professional career calling myself this.</p> <p>In the last few years, however, "engineer" has come to the forefront. As a result, I've now got the impression that we've starting taking ourselves too seriously, guilty as I may be of using it as well.</p> <p>I've now gone full circle back to "programmer". It honestly just seems the most accurate.</p> <p>I associate "developer" with construction and "engineer" with building physical things pretty heavily. I realize this is probably not be universal at all, but I find "programmer" to be the one I can explain best.</p> <p>Since I'm most definitely not a lexicographer, I'll just go with that. Maybe I'll also emphasize the things I actually know, like Python, just to be <del>clear</del> <em>explicit.</em></p> <hr /> <p>Want to respond with a comment or question, or have some feedback? <br /> <a href="mailto:nik@nkantar.com?subject=Blog:%20Programmer%2C%20Developer%2C%20Engineer%2C%20Lexicographer">Email</a> and <a href="https://twitter.com/intent/tweet?text=@nkantar%20">Twitter</a> are good direct options, but you could also write a piece of your own and send me the link. :)</p>