<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Josh Stephens</title>
    <description>The latest articles on DEV Community by Josh Stephens (@tuxbsd).</description>
    <link>https://dev.to/tuxbsd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F18793%2F4e5e7f1b-1c58-4cb5-a5cb-390c82eaa974.jpg</url>
      <title>DEV Community: Josh Stephens</title>
      <link>https://dev.to/tuxbsd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tuxbsd"/>
    <language>en</language>
    <item>
      <title>A different way to slice in python</title>
      <dc:creator>Josh Stephens</dc:creator>
      <pubDate>Tue, 21 Nov 2017 22:27:00 +0000</pubDate>
      <link>https://dev.to/tuxbsd/a-different-way-to-slice-in-python-7ik</link>
      <guid>https://dev.to/tuxbsd/a-different-way-to-slice-in-python-7ik</guid>
      <description>&lt;p&gt;A very interesting topic came up in my local community slack channel. Someone asked how to do slicing using an object. At first I wasn't sure what they were talking about and why wouldn't the following work for them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;mylist&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a quick search someone found &lt;a href="https://docs.python.org/3.4/library/functions.html#slice"&gt;this&lt;/a&gt; reference in the python docs. Which was a good read but I still couldn't quite grasp why. Then it hit me. I remember C having something called macros and I was like oh hey a cool and shorten way to build a slice macro. &lt;/p&gt;

&lt;p&gt;So for example you could have&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;SL5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;my_new_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;my_list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;SL5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;my_other_new_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;my_other_list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;SL5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and now we created two new lists with the first five items in my_list and my_other_list. I still haven't found all the ways that this could be useful but I was pretty happy with how I was able to see a new concept and within a few minutes find a good use for it. &lt;/p&gt;

&lt;p&gt;PS. sorry for the rough post. This is my first real post on here besides my intro. Content creation is still my weak spot.   &lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Hi, I'm Josh Stephens</title>
      <dc:creator>Josh Stephens</dc:creator>
      <pubDate>Tue, 16 May 2017 14:38:07 +0000</pubDate>
      <link>https://dev.to/tuxbsd/hi-im-josh-stephens</link>
      <guid>https://dev.to/tuxbsd/hi-im-josh-stephens</guid>
      <description>&lt;p&gt;I have been coding for &amp;lt; 1 year professionally.&lt;/p&gt;

&lt;p&gt;You can find me on Twitter as &lt;a href="https://twitter.com/tuxbsd" rel="noopener noreferrer"&gt;@tuxbsd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in Nashville.&lt;/p&gt;

&lt;p&gt;I work for Spera Health&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: Python / JS.&lt;/p&gt;

&lt;p&gt;I am currently learning more about C and OS development.&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
