<?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: Maria Yudina</title>
    <description>The latest articles on DEV Community by Maria Yudina (@mariayudina).</description>
    <link>https://dev.to/mariayudina</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%2F332895%2F982ece05-2287-4a9a-971b-05362cb41d31.jpeg</url>
      <title>DEV Community: Maria Yudina</title>
      <link>https://dev.to/mariayudina</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mariayudina"/>
    <language>en</language>
    <item>
      <title>A little bit about Lua</title>
      <dc:creator>Maria Yudina</dc:creator>
      <pubDate>Sat, 03 Dec 2022 12:37:40 +0000</pubDate>
      <link>https://dev.to/mariayudina/a-little-bit-about-lua-24p4</link>
      <guid>https://dev.to/mariayudina/a-little-bit-about-lua-24p4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lua&lt;/strong&gt; is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded systems and applications. It was first released in 1993 and is used in a wide range of fields, including game development, web development, and scientific computing.&lt;/p&gt;

&lt;p&gt;Some of the key features of Lua include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Small size:&lt;/strong&gt; Lua has a small footprint, with the entire interpreter fitting in just over 100KB of memory. This makes it well-suited for use in embedded systems and applications with limited resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to learn:&lt;/strong&gt; Lua has a simple and straightforward syntax, making it easy to learn for beginners. It also has a large and active community, with many resources available to help new users get started.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; Lua is a multi-paradigm language, meaning it supports different programming styles, such as procedural, object-oriented, and functional. This makes it versatile and allows it to be used in a wide range of applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensibility:&lt;/strong&gt; Lua is designed to be easily extended with C libraries, allowing developers to add new functions and features to the language. This makes it a popular choice for game development, where it is often used as a scripting language.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hello, World!
&lt;/h2&gt;

&lt;p&gt;Here are some basic concepts and syntax to start with the language. &lt;/p&gt;

&lt;p&gt;First, Lua is a dynamically-typed language, which means that you don't need to specify the type of a variable when you declare it. Instead, the type of a variable is determined at runtime based on the value it is assigned.&lt;/p&gt;

&lt;p&gt;There are eight basic types in Lua: &lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt;, &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;userdata&lt;/code&gt;, &lt;code&gt;thread&lt;/code&gt;, and &lt;code&gt;table&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, the following code shows how to declare and initialize a variable in Lua:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Declare a variable named "x"
x = 10

-- Declare a variable named "name"
name = "John"

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

&lt;/div&gt;



&lt;p&gt;In this code, the &lt;code&gt;x&lt;/code&gt; variable is assigned the value 10, which is a &lt;code&gt;number&lt;/code&gt;, and the &lt;code&gt;name&lt;/code&gt; variable is assigned the value "John", which is a &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Important to mention:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The type number represents both integer numbers and real (floating-point) numbers, using two subtypes: integer and float. Standard Lua uses 64-bit integers and double-precision (64-bit) floats, but you can also compile Lua so that it uses 32-bit integers and/or single-precision (32-bit) floats. The option with 32 bits for both integers and floats is particularly attractive for small machines and embedded systems. (See macro LUA_32BITS in file luaconf.h.) - &lt;a href="https://www.lua.org/manual/5.4/manual.html#2"&gt;https://www.lua.org/manual/5.4/manual.html#2&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Next, Lua uses indentation to define code blocks, rather than using braces like many other languages. This means that you should indent your code to show which statements are part of a code block, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Define a function named "hello"
function hello()
    -- Print a greeting to the console
    print("Hello, world!")
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The indentation of the &lt;code&gt;print&lt;/code&gt; statement indicates that it is part of the &lt;code&gt;hello&lt;/code&gt; function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic syntax
&lt;/h2&gt;

&lt;p&gt;In the Lua programming language, there are several reserved words and tokens that have special meaning and cannot be used for other purposes.&lt;/p&gt;

&lt;p&gt;Here is a list of some of the reserved words in Lua:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;and&lt;/code&gt;: Used to perform a logical AND operation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;break&lt;/code&gt;: Used to break out of a loop or switch statement.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;do&lt;/code&gt;: Used to begin a block of code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;else&lt;/code&gt;: Used as part of an if statement to specify the code to be executed if the condition is not true.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;elseif&lt;/code&gt;: Used as part of an if statement to specify additional conditions to be tested.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;end&lt;/code&gt;: Used to indicate the end of a block of code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;false&lt;/code&gt;: Used to represent the Boolean value false.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;for&lt;/code&gt;: Used to create a loop.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;function&lt;/code&gt;: Used to define a new function.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;goto&lt;/code&gt;: Used to jump to the specified label.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;if&lt;/code&gt;: Used to create a conditional statement.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;in&lt;/code&gt;: Used as part of a for loop to iterate over the elements of a table or other data structure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;local&lt;/code&gt;: Used to declare a local variable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nil&lt;/code&gt;: Used to represent the absence of a value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;not&lt;/code&gt;: Used to perform a logical NOT operation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;or&lt;/code&gt;: Used to perform a logical OR operation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;repeat&lt;/code&gt;: Used to begin a loop that repeats until a specific condition is met.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;return&lt;/code&gt;: Used to return a value from a function.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;then&lt;/code&gt;: Used as part of an if statement to indicate the code to be executed if the condition is true.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;true&lt;/code&gt;: Used to represent the Boolean value true.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;until&lt;/code&gt;: Used to end a repeat loop and specify the condition that must be met to exit the loop.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;while&lt;/code&gt;: Used to create a loop that continues as long as a specific condition is true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to reserved words, there are also several tokens in Lua that have special meaning and cannot be used as identifier names. These include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;+&lt;/code&gt;: Used to perform addition.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-&lt;/code&gt;: Used to perform subtraction.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt;: Used to perform multiplication.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/&lt;/code&gt;: Used to perform division.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%&lt;/code&gt;: Used to perform modulo division.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt;: Used to perform exponentiation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;#&lt;/code&gt;: Used to get the length of a string or table.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;..&lt;/code&gt;: Used to concatenate two strings.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&lt;/code&gt;: Used to compare two values to see if the first is less than the second.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;=&lt;/code&gt;: Used to compare two values to see if the first is less than or equal to the second.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;==&lt;/code&gt;: Used to compare two values to see if they are equal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~=&lt;/code&gt;: Used to compare two values to see if they are not equal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&lt;/code&gt;: Used to compare two values to see if the first is greater than the second.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;=&lt;/code&gt;: Used to compare two values to see if the first is greater than or equal to the second.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;=&lt;/code&gt;: Used to assign the value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(&lt;/code&gt;: Used to begin a block of code or an expression.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;)&lt;/code&gt;: Used to end a block of code or an expression.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{&lt;/code&gt;: Used to begin a table constructor.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;}&lt;/code&gt;: Used to end a table constructor.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt;: Used to index a table.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;;&lt;/code&gt;: Used to separate statements.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:&lt;/code&gt;: Used to separate a method name from its arguments.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;,&lt;/code&gt;: Used to separate items in a list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.&lt;/code&gt;: Used to access a field of a table or object.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&lt;/code&gt;: Used to perform a bitwise AND.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~&lt;/code&gt;: Used to perform a bitwise XOR &lt;code&gt;print(3 ~ 5)&lt;/code&gt; or as unary bitwise NOT &lt;code&gt;print(~7)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;|&lt;/code&gt;: Used to perform a bitwise OR.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;: Used to perform left shift.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;: Used to perform right shift.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;//&lt;/code&gt;: Used to perform the floor division.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;::&lt;/code&gt;: Used to define labels for blocks of code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;...&lt;/code&gt;: Used to represent varargs, which are a variable number of arguments passed to a function.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More information you can find in &lt;a href="https://www.lua.org/manual/5.4/"&gt;the official manual&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Variables
&lt;/h2&gt;

&lt;p&gt;In Lua, there are three kinds of variables in Lua: global variables, local variables, and table fields. Variable names must begin with a letter or underscore character, and they can contain letters, numbers, and underscores. They are case-sensitive, so &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;X&lt;/code&gt; are considered to be different variables.&lt;/p&gt;

&lt;p&gt;In the Lua programming language, variables are assumed to be global unless explicitly declared as local. Local variables have lexical scoping, meaning they can be freely accessed by functions defined inside their scope. Before a variable is assigned a value for the first time, its value is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Statements
&lt;/h2&gt;

&lt;p&gt;In the Lua programming language, a statement is a piece of code that performs a specific action or task. There are several different types of statements in Lua, and each has a specific syntax and purpose.&lt;/p&gt;

&lt;p&gt;Here are some examples of common statements in Lua:&lt;/p&gt;

&lt;p&gt;Assignment statement: Used to assign a value to a variable. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conditional statement: Used to execute a block of code only if a certain condition is met. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if x &amp;gt; 10 then
  print("x is greater than 10")
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loop statement: Used to repeatedly execute a block of code. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while x &amp;lt; 20 do
  x = x + 1
  print(x)
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function definition statement: Used to define a function. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add(a, b)
  return a + b
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function call statement: Used to call a function. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;result = add(10, 20)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are just a few examples of the types of statements that are available in the Lua programming language.&lt;/p&gt;

&lt;h2&gt;
  
  
  In Conclusion
&lt;/h2&gt;

&lt;p&gt;The Lua programming language is a powerful and versatile language that is well-suited for a wide range of tasks. It is small, fast, and easy to learn, making it a popular choice for embedded systems and game development.&lt;/p&gt;

&lt;p&gt;If you are interested in learning more about the Lua language, there are many resources available to help you get started. Some recommended resources include the &lt;a href="https://www.lua.org/"&gt;official Lua website&lt;/a&gt;, which contains &lt;a href="https://www.lua.org/docs.html"&gt;documentation&lt;/a&gt; and &lt;a href="https://www.lua.org/start.html"&gt;tutorials&lt;/a&gt;, and the &lt;a href="https://www.lua.org/lua-l.html"&gt;Lua mailing list&lt;/a&gt;, which is a great place to ask questions and get help from the community. There are also many books and &lt;a href="https://www.codecademy.com/learn/learn-lua"&gt;online courses&lt;/a&gt; available that can help you learn more about the language and its features.&lt;/p&gt;

&lt;p&gt;Overall, Lua is a great language to learn and use, and it offers many benefits for developers who want to build efficient and powerful applications.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>lua</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to add a condition in SQL with GROUP BY</title>
      <dc:creator>Maria Yudina</dc:creator>
      <pubDate>Sat, 03 Dec 2022 11:10:55 +0000</pubDate>
      <link>https://dev.to/mariayudina/how-to-add-a-condition-in-sql-with-group-by-5ej3</link>
      <guid>https://dev.to/mariayudina/how-to-add-a-condition-in-sql-with-group-by-5ej3</guid>
      <description>&lt;p&gt;To add a condition to a &lt;code&gt;GROUP BY&lt;/code&gt; clause in SQL, you can use the &lt;code&gt;HAVING&lt;/code&gt; keyword. The &lt;code&gt;HAVING&lt;/code&gt; keyword is used to specify a condition that must be met by the grouped records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT statements... GROUP BY column_name1[,column_name2,...] [HAVING condition];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, the following query uses the &lt;code&gt;HAVING&lt;/code&gt; keyword to only include groups that have a count greater than 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT column1, COUNT(*)
FROM table
GROUP BY column1
HAVING COUNT(*) &amp;gt; 1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query will group the records in the table by the values in column1 and only include groups that have more than one record. The &lt;code&gt;HAVING&lt;/code&gt; clause is typically used together with an aggregate function, such as &lt;code&gt;COUNT&lt;/code&gt; or &lt;code&gt;SUM&lt;/code&gt;, to check for a condition on the values that are being grouped.&lt;/p&gt;

&lt;p&gt;It's important to note that the &lt;code&gt;HAVING&lt;/code&gt; clause is used after the &lt;code&gt;GROUP BY&lt;/code&gt; clause and it operates on the grouped records, whereas the &lt;code&gt;WHERE&lt;/code&gt; clause is used before the &lt;code&gt;GROUP BY&lt;/code&gt; clause and it operates on the individual records before they are grouped.&lt;/p&gt;

&lt;p&gt;Overall, the &lt;code&gt;HAVING&lt;/code&gt; keyword is a useful tool for adding conditions to &lt;code&gt;GROUP BY&lt;/code&gt; clauses in SQL.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Check Directory Size in Ubuntu</title>
      <dc:creator>Maria Yudina</dc:creator>
      <pubDate>Sat, 03 Dec 2022 11:05:51 +0000</pubDate>
      <link>https://dev.to/mariayudina/how-to-check-directory-size-in-ubuntu-pfd</link>
      <guid>https://dev.to/mariayudina/how-to-check-directory-size-in-ubuntu-pfd</guid>
      <description>&lt;p&gt;To check the size of a directory in Ubuntu, you can use the du command. This command stands for "disk usage" and it shows the amount of disk space used by the specified files or directories.&lt;/p&gt;

&lt;p&gt;Options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-h , --human-readable

-s, --summarize

-a, --all

-c, --total

--max-depth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the du command, open a terminal window and navigate to the directory whose size you want to check. Then, type du followed by the name of the directory, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du /path/to/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will display the size of the directory in kilobytes. If you want to see the size of all the files and directories inside the specified directory, you can use the &lt;code&gt;-a&lt;/code&gt; option like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -a /path/to/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will display the size of each file and directory inside the specified directory, along with the total size at the end.&lt;/p&gt;

&lt;p&gt;You can also use the -h option to display the size in a more readable format, such as megabytes or gigabytes, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -ah /path/to/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will display the size of each file and directory in the specified directory in a human-readable format.&lt;/p&gt;

&lt;p&gt;Overall, the du command is a useful tool for checking the size of directories in Ubuntu.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>unix</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git errors: cannot checkout branch - error: pathspec 'branch_name' did not match any file(s) known to git</title>
      <dc:creator>Maria Yudina</dc:creator>
      <pubDate>Sun, 14 Nov 2021 13:40:58 +0000</pubDate>
      <link>https://dev.to/mariayudina/git-errors-cannot-checkout-branch-error-pathspec-branchname-did-not-match-any-files-known-to-git-59kg</link>
      <guid>https://dev.to/mariayudina/git-errors-cannot-checkout-branch-error-pathspec-branchname-did-not-match-any-files-known-to-git-59kg</guid>
      <description>&lt;p&gt;Sometimes after repository checkout you can encounter the error trying to switch branches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout branch_name
error: pathspec 'branch_name' did not match any file(s) known to git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix that you can remove remote origin and link it again.&lt;br&gt;
First, check the remote origin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote -v
origin  git@github.com:company/project_name (fetch)
origin  git@github.com:company/project_name (push)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then remove origin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote remove origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add remote origin again with correct path from your repository (copy from GitHub/GitLab/etc.):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin git@github.com:company/project_name.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull --ff-only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And set upstream to origin branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch --set-upstream-to=origin/current_branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this you should be able to switch between the branches as usual.&lt;/p&gt;

&lt;p&gt;This error message indicates that Git was unable to checkout the specified branch because it does not exist. This can happen for a few different reasons, including the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The branch name is misspelled or mistyped.&lt;/li&gt;
&lt;li&gt;The branch has already been deleted or is no longer available.&lt;/li&gt;
&lt;li&gt;The branch exists in a remote repository, but it has not yet been pulled or fetched to the local repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix this error, you will need to verify that the branch name is correct and that the branch exists in the local repository. If the branch name is correct and the branch still does not exist, you may need to pull or fetch the branch from the remote repository where it exists.&lt;/p&gt;

&lt;p&gt;If the branch has already been deleted or is no longer available, you will need to create a new branch with a different name or switch to a different existing branch.&lt;/p&gt;

&lt;p&gt;Overall, this error can be resolved by checking the branch name and ensuring that the branch exists in the local repository. If necessary, you can also try pulling or fetching the branch from the remote repository where it exists.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>How To Install Go on Ubuntu 20.04</title>
      <dc:creator>Maria Yudina</dc:creator>
      <pubDate>Sat, 06 Nov 2021 19:52:36 +0000</pubDate>
      <link>https://dev.to/mariayudina/how-to-install-go-on-ubuntu-2004-2mn6</link>
      <guid>https://dev.to/mariayudina/how-to-install-go-on-ubuntu-2004-2mn6</guid>
      <description>&lt;h2&gt;
  
  
  Check Ubuntu version
&lt;/h2&gt;

&lt;p&gt;First, run this command to make sure what version of Ubuntu you have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lsb_release -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install GoLang
&lt;/h2&gt;

&lt;p&gt;Download the &lt;a href="https://golang.org/dl/"&gt;latest&lt;/a&gt; GoLang archive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -OL https://golang.org/dl/go1.17.3.linux-amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check SHA256 Checksum just in case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sha256sum go1.17.3.linux-amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Extract everything to the &lt;code&gt;usr/local&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tar -C /usr/local -xvf go1.17.3.linux-amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update &lt;code&gt;PATH&lt;/code&gt; variable in &lt;code&gt;~/.profile&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add new row with &lt;code&gt;export&lt;/code&gt; at the end of the &lt;code&gt;~/.profile&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PATH=$PATH:/usr/local/go/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the changes and exit &lt;code&gt;nano&lt;/code&gt; editor. Now we have to refresh your profile. Run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installation and setup is done. Let's check if everything works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make sure everything works
&lt;/h2&gt;

&lt;p&gt;We will check Go version and create and run a simple program.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the version
&lt;/h3&gt;

&lt;p&gt;Run this command to check Go version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go version go1.17.3 linux/amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create and run 'Hello, World!'
&lt;/h3&gt;

&lt;p&gt;Let's create a simple Go program and run it.&lt;/p&gt;

&lt;p&gt;Create a directory and switch to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir hello_go
cd hello_go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have to create &lt;code&gt;go.mod&lt;/code&gt; file with the &lt;code&gt;go mod init&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go mod init test/hello_go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file where we'll write the program code in Go.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano hello.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy this example code to the file and save changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the changes and exit &lt;code&gt;nano&lt;/code&gt; editor.&lt;/p&gt;

&lt;p&gt;Run the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go run .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done!&lt;/p&gt;

</description>
      <category>go</category>
      <category>ubuntu</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
