<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Cristhian Jose Apaza Arhuata on Medium]]></title>
        <description><![CDATA[Stories by Cristhian Jose Apaza Arhuata on Medium]]></description>
        <link>https://medium.com/@cristhian.cjaa?source=rss-4d2de4b3721c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SEA0IrwKeQSIj9L5pn90jQ.jpeg</url>
            <title>Stories by Cristhian Jose Apaza Arhuata on Medium</title>
            <link>https://medium.com/@cristhian.cjaa?source=rss-4d2de4b3721c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 16:50:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cristhian.cjaa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Recursion and stack]]></title>
            <link>https://medium.com/@cristhian.cjaa/recursion-and-stack-53d2768446dd?source=rss-4d2de4b3721c------2</link>
            <guid isPermaLink="false">https://medium.com/p/53d2768446dd</guid>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[lenguaje-c]]></category>
            <dc:creator><![CDATA[Cristhian Jose Apaza Arhuata]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 04:19:48 GMT</pubDate>
            <atom:updated>2022-02-28T04:19:48.029Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*k6zP83pJHZb7inDLMHubAA.png" /><figcaption>Recursion</figcaption></figure><p>In this article we will talk a little about how a recursive function works, we will explain it with a stack to better understand it and we will use the C programming language as a base.</p><h3>What is recursion?</h3><p>Recursion is a process in which a function is called directly or indirectly within the same function n times.</p><h3>How does recursion work?</h3><p>To explain it we will use a stack and a series of images.<br>We will also use the following code, which is a C language function that calculates the power of a number where x is the base and y is the exponent.</p><pre>float _pow_recursion(float x, float y)<br>{<br>    if (y == 0)<br>        return (1);<br>    if (y &lt; 0)<br>        return (_pow_recursion(x, y + 1) / x);<br><br>    return (_pow_recursion(x, y - 1) * x);<br>}</pre><h3>Steps</h3><h4>Step 1:</h4><p>We need a main function in this case since we are talking about C language that calls the function.</p><pre>#include &lt;stdio.h&gt;</pre><pre>int main() <br>{  <br>  int x = 2;<br>  int y = 4;<br>  printf(&quot;%f&quot;, _pow_recursion(x, y));<br>  return (0);<br>}</pre><h4>Step 2:</h4><p>Then the main function will be the first to be activated and appear on the stack and followed by the first call to the recursive function (_pow_recursion)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*_dANHalN-K-TWwOQ7wVuYg.png" /></figure><h4>Step 3:</h4><p>In this case the variable Y is the exponent, and it will indicate the n times that the function will be called until it reaches zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*IV3z7nEfghjpfActx1gpJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*5xv3USsjhPh_0nHfs1NEJQ.png" /></figure><h4>Step 4:</h4><p>Once one of the calls returns something, the trigger begins and the stack is emptied, in this case each value returned is multiplied by the variable X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*Gayq2ieEvxeZLyB6CeknLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*69VooYYoe6PT7qHME8uPog.png" /></figure><h4>Step 5:</h4><p>And this is how we return to the main function, and as we see in the previous image, the return is accumulated, in this case the final accumulated is</p><blockquote>(8 * 2) = 16</blockquote><h4>Step 6:</h4><p>Finally the main function displays the result on the screen after being called n times the power function used in the example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*TYTBNsIVIJ3627YODVYL7A.png" /></figure><p>As we saw in the example at the beginning, the stack fills up until the same function stops calling itself, once this happens the stack begins to empty one by one taking what is returned by the function that was above it, until you reach the main function or the one that calls you at the beginning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53d2768446dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mutable and Immutable Objects in Python]]></title>
            <link>https://medium.com/@cristhian.cjaa/mutable-and-immutable-objects-in-python-da5bc78bc552?source=rss-4d2de4b3721c------2</link>
            <guid isPermaLink="false">https://medium.com/p/da5bc78bc552</guid>
            <category><![CDATA[lenguaje]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Cristhian Jose Apaza Arhuata]]></dc:creator>
            <pubDate>Mon, 31 Jan 2022 18:13:05 GMT</pubDate>
            <atom:updated>2022-01-31T18:13:05.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*2b1XZfmsRKHrzRJz_Wbflw.jpeg" /><figcaption>Python</figcaption></figure><p>Python traces its origin back to the early 1990s, when Guido Van Rossum, a worker at Centrum Wiskunde &amp; Informatica (CWI), a Dutch research center, had the idea of ​​developing a new language based on a previous project, the Python language. “ABC” programming, which he himself had developed together with his colleagues.</p><p>In this article we will talk a little about the Is() and Type() functions and we will learn about mutable and immutable objects.</p><h3>What is Python?</h3><p>Python is a widely used, object-oriented, interpreted, high-level programming language with dynamic semantics, used for general-purpose programming.</p><p>Python is an easy language to read and write due to its high similarity with human language. In addition, it is an open source multi platform language and, therefore, free, which allows you to develop software without limits.</p><h3>Function id() and type() in Python</h3><h4>id():</h4><p>The id() function es an inbuilt function in Python, returns the identity of object. It is the address of object in memory, which will be unique and constant throughout the lifetime of object.</p><blockquote>Syntax</blockquote><blockquote>id(object)</blockquote><blockquote>Example:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*6UPrifUf0QpdKVgeiBT61A.png" /><figcaption>Id() — Python</figcaption></figure><h4>type():</h4><p>The type() function es an inbuilt function in Python, returns the type of the specified object.</p><p>If a single argument (object) is passed to type() built-in, it returns type of the given object, but If three arguments (name, bases and dict) are passed, it returns a new type object.</p><pre><strong>Parameters:<br>name:</strong> name of class, which later corresponds to the __name__ attribute of the class.<br><strong>bases :</strong> tuple of classes from which the current class derives. Later corresponds <br>        to the __bases__ attribute.<br><strong>dict : </strong>  a dictionary that holds the namespaces for the class. Later corresponds <br>        to the __dict__ attribute.</pre><pre><strong>Return type:<br></strong>returns a new type class or essentially a metaclass.</pre><blockquote>Syntax</blockquote><blockquote>type(object)<br>type(name, bases, dict)</blockquote><blockquote>Example</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*Z9TsHTyWz_6XNxERH9wKOQ.png" /><figcaption>type() — Python</figcaption></figure><h3>Mutable and Immutable objects</h3><p>There are two types of objects in python <strong>Mutable </strong>and <strong>Immutable objects</strong>. Whenever an object is instantiated, it is assigned a unique object id. The type of the object is defined at the runtime and it can’t be changed afterwards. However, it’s state can be changed if it is a mutable object, to summaries the difference, mutable objects can change their state or contents and immutable objects can’t change their state or content.</p><h4>Mutable objects</h4><p>They are those objects that can change their content without changing your id after their creation, and among them we have: lists, byte arrays, sets, and dictionaries.</p><blockquote>Lists</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*qmckQJMYWMsCUAdhVGDcfQ.png" /></figure><blockquote>Byte Arrays</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*KvSP0y_zohwq3WokJsPwMw.png" /></figure><blockquote>Sets</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*9x429Ee-8ARg4_NZLxJxzA.png" /></figure><blockquote>Dictionaries</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*eI1IKhm1LvhoUd0KrbgP7Q.png" /></figure><h4>Immutable objects</h4><p>They are those objects that can’t change their content without changing your id after their creation, and among them we have numeric data types, strings, bytes, frozen sets, and tuples.</p><blockquote>Numeric data types</blockquote><p>In those we can include boolean, floats, complex numbers, fractions, and decimals</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*4h_F5OgGOVUTHD5NzSS3Mg.png" /></figure><blockquote>String and Bytes</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*I118ZpLJq02Md5hehCHtFg.png" /></figure><blockquote>Tuples</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*3nmlN9NpgLkAeC_7wVwRxQ.png" /></figure><h3>Conclusions</h3><p>Both mutable and immutable objects have different uses and their own uses, none is much better than another, but on different occasions one may be more appropriate than another.</p><p>Immutable objects are quicker to access and are expensive to <strong>change</strong> because it involves the creation of a copy.</p><p>Use of mutable objects is recommended when there is a need to change the size or content of the object.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da5bc78bc552" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens every time we use ls in the Unix Shell?]]></title>
            <link>https://medium.com/@cristhian.cjaa/what-happens-every-time-we-use-ls-in-the-unix-shell-811b0d51b390?source=rss-4d2de4b3721c------2</link>
            <guid isPermaLink="false">https://medium.com/p/811b0d51b390</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[unixlinux]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Cristhian Jose Apaza Arhuata]]></dc:creator>
            <pubDate>Thu, 09 Dec 2021 07:38:42 GMT</pubDate>
            <atom:updated>2021-12-09T14:58:37.022Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQ0IUbj-9qE9KZTXOz6QpQ.jpeg" /><figcaption>UNIX command interpreter</figcaption></figure><p>This article is intended to explain briefly and easily step by step what happens when you type “ls -l * .c” and press enter in the shell.</p><h4>What is Unix Shell?</h4><p>A Unix shell is the term used in computing to refer to the command interpreter of operating systems based on Unix and the like, such as GNU / Linux, and that is its traditional user interface. Through the instructions provided by the interpreter, the user can communicate with the kernel and, by extension, execute said commands, as well as tools that allow him to control the operation of the computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GJ1Ifvd96MLtYDwsRoJaA.gif" /><figcaption>Unix Shell</figcaption></figure><h4>What is the command line?</h4><p>Linux which command is used to identify the location of a given executable that is executed when you type the executable name (command) in the terminal prompt. The command searches for the executable specified as an argument in the directories listed in the PATH environment variable.</p><h4>What is PATH?</h4><p>PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files in response to commands issued by a user. It increases both the convenience and the safety of such operating systems and is widely considered to be the single most important environmental variable.</p><p>PATH (which is written with all upper case letters) should not be confused with the term path (lower case letters). The latter is a file’s or directory’s address on a filesystem (i.e., the hierarchy of directories and files that is used to organize information stored on a computer)</p><h4>What is ls command?</h4><p>ls is one of the basic commands that any Linux user should know. The ls command lists files and directories within the file system, and shows detailed information about them. It is a part of the GNU core utilities package which is installed on all Linux distributions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*4Wn2j375U_Qxu8D74ef4jw.png" /><figcaption>ls Command</figcaption></figure><p>Once a command is executed, a process is created and three streams are opened (stdin, stdout, stderr)</p><p><strong>stdin:</strong> called standard input, in which case the process reads the input data. By default, stdin refers to the keyboard. STDIN is identified by the number 0.</p><p><strong>stdout:</strong> called standard output, in which case the process writes the output data. By default, stdout refers to the screen. STDOUT is identified by the number 1.</p><p><strong>stderr:</strong> called standard error, in which case the process writes the error messages. By default, stderr refers to the screen. STDERR is identified by the number 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiLT9gAe9jEaBfe7Wa9_gQ.png" /><figcaption>Process</figcaption></figure><h4>What are the steps</h4><p>For example, if we execute the command ls -l * .c</p><ol><li>The command is divided into instructions <em>separated using spaces, tabs, and operators</em>, that is, the name of the executable and its parameters are separated independently</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qj84cdOBreR-lCnnXuxSfw.gif" /></figure><p>2. This allows us to distinguish between the main commands and their options and parameters.</p><p>3. The expansions in this case the “* .c” are analyzed and all the files ending in “.c” are replaced by their interpretation in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*JWzP3zQkk9iLhUQcjuIxtw.png" /></figure><p>4. The executable is executed, in this case it is a command that is inside the PATH folder, and all its parameters are passed to it</p><p>5. The system analyzes and displays the result on the screen, which may be an error message in case of failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*hdN4OIPes3RkFzD-pS-flA.png" /><figcaption>Result ls -l *.c</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=811b0d51b390" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C Static Libraries]]></title>
            <link>https://medium.com/@cristhian.cjaa/c-static-libraries-b01dc9660937?source=rss-4d2de4b3721c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b01dc9660937</guid>
            <category><![CDATA[gcc]]></category>
            <category><![CDATA[static-libraries-in-c]]></category>
            <category><![CDATA[static-library]]></category>
            <category><![CDATA[lenguaje-c]]></category>
            <dc:creator><![CDATA[Cristhian Jose Apaza Arhuata]]></dc:creator>
            <pubDate>Wed, 03 Nov 2021 00:17:43 GMT</pubDate>
            <atom:updated>2021-11-03T00:17:43.206Z</atom:updated>
            <content:encoded><![CDATA[<p>C Static Libraries — in simple words they are a collection of object-files (.o), accompanied by header files (.h), which generally contain variables and functions defined for use in any application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*-zxEfCdOtl8vAtnbXzofFA.png" /><figcaption>Image 1 — C Static Libraries</figcaption></figure><h4>Why use libraries</h4><p>It is an orderly way of working, separating general functionalities that can be used in different programs from their own logic that they may have, these libraries at the time of generating the general executable are part of your code through which you can carry the machine program in machine without the need for libraries.</p><h4>How they work</h4><p>We can say that the static libraries are the ones that are “embedded” in the final executable, that is, once we have our final executable they will be part of our code, then we can eliminate the previously generated library and our program would work normally, but if we modify something in our generated library we must recompile the code.</p><h4>How to create them</h4><ol><li>First we must organize all our code preferably create a new folder that contains all the necessary files (.c and .h). Then we organize our header files to make sure that our functions, variables and others are correctly defined</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*7mr30a-8d9VCKCohEWTISw.png" /><figcaption>Image 2 — Header files</figcaption></figure><p>2. Followed by the above we can obtain the .o from the .c files, for this it is necessary to use the gcc and only reach the compilation step we will use the following command</p><pre><strong>my_user$</strong> gcc -c *.c</pre><pre><strong><em>alternative command</em> &quot;my_user$</strong> gcc -fno-pie -Wall -pedantic -Werror -Wextra -c *.c&quot;</pre><p>3. Once all of the above is done, it is time to generate our library, this will be very exciting and you only need a command as simple as:</p><pre><strong>my_user$ </strong>ar -rc &lt;name_library&gt; *.o</pre><p>With the command “-r” we make sure to overwrite the library in case there is one with the same name.</p><p>4. The final part, we only have to index the content to have it in a more orderly way and we can navigate in it faster for this we will use the command:</p><pre><strong>my_user$ </strong>ranlib &lt;name_library&gt;</pre><p>Now we are ready to learn how to use them.</p><h4>How to use them</h4><ol><li>Again it is very important to organize everything, then first you have to move all the libraries (.a) that we need in the folder where our code of the program where we want to use them is located.</li><li>Once this is done we only need to be able to name the library together with the remaining code to make it part of our code with the following command.</li></ol><pre><strong>my_user$ </strong>gcc main.c &lt;name_library.a&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b01dc9660937" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCC — The steps of compilation]]></title>
            <link>https://medium.com/@cristhian.cjaa/gcc-the-steps-of-compilation-7a8f866adac3?source=rss-4d2de4b3721c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a8f866adac3</guid>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[gcc]]></category>
            <category><![CDATA[gcc-compilers]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Cristhian Jose Apaza Arhuata]]></dc:creator>
            <pubDate>Mon, 04 Oct 2021 23:51:39 GMT</pubDate>
            <atom:updated>2021-10-05T23:38:41.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>GCC — The steps of compilation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*-4w3tT3vqz4RTM_9DgbH-w.png" /><figcaption>GCC Steps</figcaption></figure><p>GNU Compiler Collection, better known by its acronym GCC, is a group of several compilers, all of them are free software, originally created to compile C language, but currently it is also used for C ++, Objective-C, Fortran, Ada, Go, and D.</p><p>This group of compilers is derived from UNIX, it was released for the first time on May 23, 1987.</p><p>Its growth is due to the fact that it is free software and many independent programmers used it as a base to create their own buffs.</p><p>The GCC process is composed of 4 steps:</p><ol><li>- Preprocessing</li><li>- Compilation</li><li>- Assembly</li><li>- Linking</li></ol><h4>Preprocessing</h4><pre><strong>holberton$</strong> gcc -E main.c</pre><p>.It is the first step and has three main functions</p><p>a.) Search all header files, what we commonly know as libraries, and add them within the content of the source code.</p><p>b.) Replace constants and symbolic functions with their value in all source code.</p><p>c.) Finally, delete all kinds of documentation, that is, comments, since this is not useful for the machine.</p><p>In this step we obtain everything that is only necessary to move on to the next steps.</p><p>In the following image we will compare the original file together with its result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*-wCjO7yU-yb_YWrG1i7I1A.png" /><figcaption>Preprocessed file</figcaption></figure><h4>Compilation</h4><pre><strong>holberton$</strong> gcc -S main.c</pre><p>It receives the file obtained in the previous step, here we are already in the middle part of the whole process.</p><p>Generate a file with extension .s that contains assembly code that is equivalent to your source code that you have written, in general lines the information is placed in registers.</p><p>It generates a record (relocation information) of the functions that we invoke in our source code, to then indicate to the computer in which order they should be executed and what parameters they have, this record serves so that the linker can be clear about what definitions it should get at the moment to make executable.</p><p>At this point you can still make direct modifications such as text strings.</p><p>In the following image we can see the registration of the functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*zjYBqtCLQWNAlRAX6u6iKg.png" /><figcaption>Assembly code — Contents of the .s file</figcaption></figure><h4>Assembly</h4><pre><strong>holberton$</strong> gcc -c main.c</pre><p>Its main function is to take as input what was obtained in the previous step (assembler) and convert it into machine language or object code (binary), it does not generate an executable file as such but a file with extension .o.</p><p>It contains the things What should be done? so that the system functions but not the How should it be done?</p><p>The content of this file is already unreadable to the human eye</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*aZslr_p11COeBEQXzpT5Mw.png" /><figcaption>Object code — Content of the .o file</figcaption></figure><h4>Linking</h4><pre><strong>holberton$</strong> gcc main.o funs.o varia.o cons.o</pre><p>It is the last step and completes all the rest (how to do it) that was missing in the assembly step in machine language, in order to obtain a functional executable file.</p><p>It is normal that the code of a program is divided into several files, one may contain the functions and another the calls to these and the order in which they must be executed both independently generate their own object or binary code, but they are not related .</p><p>This last process is responsible for combining all these object codes in a single file, also in binary worse, with all the complete instructions, therefore it is already an executable that we can start using.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a8f866adac3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>