<?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: purfectcat</title>
    <description>The latest articles on DEV Community by purfectcat (@purfectcat).</description>
    <link>https://dev.to/purfectcat</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%2F560033%2F33ff9a4e-8bc8-4042-8318-3be9acefb502.png</url>
      <title>DEV Community: purfectcat</title>
      <link>https://dev.to/purfectcat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/purfectcat"/>
    <language>en</language>
    <item>
      <title>Linux talk after 20 years of use</title>
      <dc:creator>purfectcat</dc:creator>
      <pubDate>Thu, 14 Jan 2021 22:40:07 +0000</pubDate>
      <link>https://dev.to/purfectcat/linux-talk-2hkb</link>
      <guid>https://dev.to/purfectcat/linux-talk-2hkb</guid>
      <description>&lt;p&gt;Have been using many Linux distributions over the years. Here's my take on them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.gentoo.org/"&gt;Gentoo&lt;/a&gt; linux: great linux distro but for students/unemployed, compile everything on your system.. who has time for that?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://debian.org"&gt;Debian&lt;/a&gt; Linux: great distro but many vulnerabilities and software often outdated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://ubuntu.com"&gt;Ubuntu&lt;/a&gt;: debian based, canonical a bit shady, hate snaps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://getfedora.org/"&gt;Fedora&lt;/a&gt;: ok distro, fedora package management is slow, the company may cancel the distro at any point (CentOS where are you?)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.opensuse.org/"&gt;Suse&lt;/a&gt;: german distro, uses rpms. works okayish&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Slackware: old distro, don't think it had a package manager 20 years ago. Maybe things changed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mint: had a security issue, domain ssl expired. Based on ubuntu, but don't really trust them&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manjaro: new packages, but unstable distro&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is really hard to find a good Linux &lt;a href="https://bsdnerds.org/best-linux-for-beginner/"&gt;distro&lt;/a&gt;, even after 20 years of Linux.  So the BSDs maybe?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HFVjWCPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/13tdb03sgtg6u8jpxo0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HFVjWCPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/13tdb03sgtg6u8jpxo0u.png" alt="linux, gnu, microsoft"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  BSD Unix
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://openbsd.org"&gt;OpenBSD&lt;/a&gt;: takes security very seriously. But at the same time, can't do all my coding work on it. Still uses X instead of Wayland? seems more server orientated. Is it worth it? a &lt;a href="https://bsdnerds.org/why-a-secure-computing-platform-will-never-exist/"&gt;secure computer&lt;/a&gt; will never exist&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://freebsd.org"&gt;FreeBSD&lt;/a&gt;: ipv6 security hole fixed yet? not gonna use this&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NetBSD: never used, any good?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_DKL8bIx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9wcjn9o3jczcf7nxox1w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_DKL8bIx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9wcjn9o3jczcf7nxox1w.jpg" alt="bsd unix"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Commercial systems?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Windows: no thanks, doesn't even come with bash&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mac: works as average user, annoys me as developer. Had some issues with Lua packages, app store annoys me about passwords, apple complaining about signing etc. It's no fun developing on mac&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sure you can do &lt;a href="https://vuejsexamples.net/"&gt;vuejs&lt;/a&gt; on all of them, but I'm regularly doing system level programming. Looking for a system that takes security seriously but is also good for development.&lt;/p&gt;

&lt;p&gt;So what do you use for development?  &lt;/p&gt;

&lt;p&gt;Thus far I'm stuck with Debian/Ubuntu. I enjoyed Gentoo but don't have time to install it.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Python function</title>
      <dc:creator>purfectcat</dc:creator>
      <pubDate>Thu, 14 Jan 2021 18:20:12 +0000</pubDate>
      <link>https://dev.to/purfectcat/python-function-3g1j</link>
      <guid>https://dev.to/purfectcat/python-function-3g1j</guid>
      <description>&lt;p&gt;Hello, everybody and welcome to a &lt;a href="https://python.org"&gt;python&lt;/a&gt; 3 article. We're going to be discussing the basics of a python function.&lt;/p&gt;

&lt;p&gt;The idea of a function is to assign a set of code and possibly variables known as parameters to a single bit of text.&lt;/p&gt;

&lt;p&gt;So you can think of it a lot like why you choose to write and save a program rather than writing out the entire program every time you want to execute it or in a much smaller scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create function
&lt;/h2&gt;

&lt;p&gt;So to begin a &lt;a href="https://pythonspot.com/functions/"&gt;function&lt;/a&gt; you define the function by using the Keyword &lt;strong&gt;def&lt;/strong&gt; short for Define?&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;food&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt;
    &lt;span class="n"&gt;task&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in this notifies python of the impending function definition&lt;/p&gt;

&lt;p&gt;From there you're going to type out whatever name you want to refer to your function as now you want to be kind of careful&lt;br&gt;
in the name of your function.&lt;/p&gt;

&lt;p&gt;Just like you would want to be careful in the name of your variable you want to choose &lt;em&gt;something unique&lt;/em&gt;, and it's not going to conflict with anything else.&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;food&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'2x bread'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'3x cheese'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lZ7p16dB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4rt3ef0gmfdu5jazvues.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lZ7p16dB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4rt3ef0gmfdu5jazvues.jpg" alt="paperclip. I see you are learning Python, can I help you?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules
&lt;/h2&gt;

&lt;p&gt;Now if you define a function and you call the &lt;a href="https://pythonbasics.org/time-and-date/"&gt;time&lt;/a&gt; it's going to conflict with the time module should you use it so you don't want to use time?&lt;/p&gt;

&lt;p&gt;So for us, we're just going to use example and after the definition of the functions name you have the parentheses and within the parentheses you have any parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"this is in C&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For now, we're just gonna leave those empty, but I will show you guys in some future article how to use parameters after.&lt;/p&gt;

&lt;p&gt;Going to be your function block so as you type code and you hit enter you've got this is all contained in your &lt;a href="https://pythonprogramminglanguage.com/functions/"&gt;function&lt;/a&gt;&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;inside&lt;/span&gt; 
    &lt;span class="n"&gt;inside&lt;/span&gt;
    &lt;span class="n"&gt;inside&lt;/span&gt;
    &lt;span class="n"&gt;inside&lt;/span&gt;

&lt;span class="n"&gt;outside&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then finally when you come over here and start typing more code that's outside of the function.&lt;/p&gt;

&lt;p&gt;so this is the function so that's kind of the idea of python functions whereas other programming languages generally you're going to have curly braces and you type within the curly braces.&lt;/p&gt;

&lt;h2&gt;
  
  
  When do we use functions?
&lt;/h2&gt;

&lt;p&gt;In Python, you use functions &lt;em&gt;all the time&lt;/em&gt;. Even functions of other people or the python standard library like the &lt;a href="https://python-commandments.org/python-input-function/"&gt;input&lt;/a&gt; function&lt;/p&gt;

&lt;p&gt;we use just &lt;strong&gt;indent&lt;/strong&gt; and indent only so for example. We're just going to say print basic function. so this is the function basics&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
