<?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 Corbin Coleman on Medium]]></title>
        <description><![CDATA[Stories by Corbin Coleman on Medium]]></description>
        <link>https://medium.com/@Corbin_Coleman?source=rss-570e69497272------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Corbin Coleman on Medium</title>
            <link>https://medium.com/@Corbin_Coleman?source=rss-570e69497272------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:50:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Corbin_Coleman/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[Mutate This! Or Not… A Tale of Python Objects]]></title>
            <link>https://medium.com/@Corbin_Coleman/mutate-this-or-not-a-tale-of-python-objects-e7d5ba395769?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7d5ba395769</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Tue, 31 Jan 2017 00:10:34 GMT</pubDate>
            <atom:updated>2017-01-31T00:10:34.733Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*16nqX2OkKDpgLVVbq1LskA.png" /></figure><p>One of the benefits of a language like Python is that it allows a programmer to use object oriented programming. This means that the programmer can create different instances of an object that all share methods and functionality. So, you can have multiple instances of the same type of object and each one would be able to do all of the same things as the other instances of that same type.</p><p>If you need to figure out what class an object is you can use the builtin Python function type() on a given instance of that object:</p><pre>&gt;&gt;&gt; a = 1<br>&gt;&gt;&gt; type(a)<br>int</pre><p>This can be useful to know what datatype a given variable is, especially if you aren’t the one assigning the variable. So, say you created a function that somebody else is going to use, but you only want specific datatypes passed to that function, you can use type() to make sure what they passes matches what you want.</p><p>Another useful tool available in Python is the id() function. This returns the memory address of a given variable.</p><pre>&gt;&gt;&gt; a = 1<br>&gt;&gt;&gt; id(a)<br>18384677723</pre><p>What this can show you is if two given objects are actually the same object. If two objects are actually the same object their ids are the same. This means that the variable you created is actually pointing to the same space in memory for that object. This is how Python handles immutable objects. Whenever you create a variable that’s immutable and then set a second one equal to that same value, both variable names point to the same space in memory. So, if you were to check these variables ids using id() they would be the same.</p><pre>&gt;&gt;&gt; name = &quot;Holberton&quot;<br>&gt;&gt;&gt; school = &quot;Holberton&quot;<br>&gt;&gt;&gt; id(name) == id(school)<br>True</pre><p>Python does this to help conserve memory usage. Since these objects are immutable they can’t be changed, so that space in memory is always going to hold those values. Meaning you can create as many variables pointing there as you want and they can’t change what’s inside. However, when the object is mutable it’s a little different.</p><p>With a mutable object Python always puts it in a new space in memory, even if they are initialized with the same values. So, if you were to create two lists, with the same values inside, but assign them to two separate variables, they would have separate ids.</p><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = [1, 2, 3]<br>&gt;&gt;&gt; id(a) == id(b)<br>False</pre><p>This is because you can change a list. So, if you were to change the list ‘a’ in the above example, you wouldn’t necessarily want to change the list ‘b’ because they are two separate lists. However, you can create an alias in Python. This alias allows to have two variable names point to the same mutable object in memory.</p><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = a<br>&gt;&gt;&gt; id(b) == id(a)<br>True</pre><p>Python’s main goal with all these ways of handling its variables is to be as efficient with the computers memory as possible. There’s no reason to keep creating different instances in memory of something with the same value if it’s immutable. Since the object is never going to change there’s no harm in having all the variables point to the same place in memory. But since mutable objects can change it’s better to have them in different places in memory whenever a new instance is created, even if it’s initialized with the same values because those values may change later on, and if one instance changes, you don’t want every instance to change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7d5ba395769" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Versus Dynamic Libraries]]></title>
            <link>https://medium.com/@Corbin_Coleman/static-versus-dynamic-libraries-e5b9dcff9274?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5b9dcff9274</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[cisfun]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Mon, 16 Jan 2017 06:08:59 GMT</pubDate>
            <atom:updated>2017-01-16T06:08:59.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*kRURYcFIRkc0sKtQk3k8-w.jpeg" /></figure><p>To start from the beginning, what is a library? In C libraries are files that contain a collection of functions. These files can be linked to C programs during compilation and help make the executable file. When linked to a C file that file now has access to the functions that were defined within that library.</p><p>There are two different types of C libraries that can be made. The first is a static library. The second being a dynamic, or shared, library. Both types of libraries accomplish the basic tasks of libraries mentioned above, but they do it slightly differently. They do have some similarities as well though. They both needed to be created first, for one. Then those object files need to be made into the library itself. Then the programming that is going to be using the library needs to be compiled and linked to that library.</p><p>How these steps actually works is a little different for the two libraries, however. The examples given will be shown using the commands for a Linux system. To create they object files for a static library all the necessary C files must be compiled using gcc. As an example, if the library needed to contain files named hello.c and bye.c the command would look like this:</p><pre>$ gcc -c hello.c bye.c</pre><p>This would then create two new files; hello.o and bye.o. After that the files would then need to be created into the actual library. To do this the archiver command (ar) is used. So, the next command given would then be:</p><pre>$ ar rcs libhellobye.a hello.o bye.o</pre><p>This would then created a library file named libhellobye.a containing the object files hello.o and bye.o. Then the library could be linked to the necessary C file when that program is compiled. Like so:</p><pre>$ gcc -static greet.c -L -lhellobye -o greets</pre><p>This would then create an executable file named ‘greets’, that has a copy of the libhellobye.a file in it. Notice that when giving the library name the ‘lib’ prefix and ‘.a’ suffix are left off. They are both attached by the ‘-l’ flag.</p><p>Now it’s a similar process to create a dynamic library, but some of the flags used with the commands change. So, using the same files as an example to create the object files for a dynamic library would look like this:</p><pre>$ gcc -c -fPIC hello.c bye.c</pre><p>This would create two object files hello.o and bye.o. The -fPIC flag used with gcc creates position-independent code that’s usable in a shared library, allowing the library to be dynamic. Then the next step is to create the actual dynamic library. This time gcc is used again, instead of the ar command. So, this time the command looks like this:</p><pre>$ gcc -shared hello.o bye.o -o libhellobye.so</pre><p>This time the library name is libhellobye.so to show that it is a shared library. The only step left is to link it with the C file and create the executable. The command used to do that looks like this:</p><pre>$ gcc -L. greet.c -lhellobye -o greets</pre><p>The output of this command would also be an executable named greets. However this executable doesn’t contain a copy of the hellobye library that it was linked to. Since the library was created and linked dynamically that means that the executable just has access to it at run time. This allows the same library to be used by multiple executable files at the same time. Allowing the executables to be smaller in size and taking up less memory overall on the machine they’re stored on. It also allows for changes to be made to the library without having to recompile the executables accessing the library, since they don’t need to have the library in the executable to work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5b9dcff9274" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s a Static Library?]]></title>
            <link>https://medium.com/@Corbin_Coleman/whats-a-static-library-e4af90245691?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4af90245691</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[static-library]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Sun, 06 Nov 2016 22:59:43 GMT</pubDate>
            <atom:updated>2016-11-06T22:59:43.899Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6m6gsuEA_R7rFJkotRUxSQ.jpeg" /></figure><p>What’s a Static Library? Well, first what’s a library? For most people in day to day life a library is a building that houses a selection of various books. Each book is placed on the shelf and organized by author and title. Well, a library in the C programming language is very similar. Rather than being a building it is a file on a computer system. This file contains a series of object files, which would be similar to the books housed by a real world library, these object files are files that can be called inside the source code of a program if the library is properly linked.</p><p>This leads to what makes a C library a Static library. A static library contains object files that are linked to the source code during the linking process of compilation, but aren’t necessary when actually running the program. Meaning that the only file a person would need to have to run the program would be the executable file that is made during compilation.</p><p>To make a static library in Unix is pretty simple. All that needs to be done is to run the program ar, which stands for archiver. This program puts copies of any object files a user names into an archive file, which is effectively the same thing as a static library. As an example, a user could use the command like this:</p><p>ar rc liballfiles.a *.o</p><p>This command would create a library named “liballfiles.a” which would contain copies of all the files in the current directory that ended with a “.o” which labels them as an object file. The r flag tells the command to replace any object files that already exist with newer versions if there are any. The c flag tells the command to create the library if it doesn’t already exist. If the library already exists the new files will just be added to the already existent library.</p><p>Once the library is created it actually needs to be used. To do this it must be linked to the source code during compilation. This is a simple process really. All a user has to do is add the proper flag and library name when compiling their program. It could look something like this:</p><p>gcc main.c -L. -lallfiles</p><p>This would compile the C file main.c and then like the library allies, or liballfiles.a. The “lib” prefix and “.a” suffix are left off because they will be added by the linker during compilation in order to search for the library files. The “-L.” command tells the linker to look in the current directory, represented by the “.”, for possible libraries as well as in any standard locations it would look for libraries in.</p><p>Now the user has both created and effectively linked their library to their source code. When the executable is ran any of the symbols in the library that were mentioned and used inside the source code will be available in the executable. So, no other files, other than the executable, will be necessary to run the program.</p><p>That’s that. A quick lesson on what static libraries are, how to make one, and how to use them with your own program.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4af90245691" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compiling C Code on Linux Using gcc]]></title>
            <link>https://medium.com/@Corbin_Coleman/compiling-c-code-on-linux-using-gcc-904781113497?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/904781113497</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 05:18:28 GMT</pubDate>
            <atom:updated>2016-10-13T05:18:28.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*PP5M1zP5bI0XtwHWYg0bFA.gif" /></figure><p>The C programming language is a high level programming language. This means, that it’s easier for people to understand than it is for the computer to understand. So, to make it understandable for the machine the C language has to be compiled and translated into machine language. One way to do this through the Linux system is to use the command gcc to run a file through the compiler. The command line input would look something like this:</p><pre>user@ubuntu:~/c$ gcc main.c</pre><p>In this example we are running the command gcc on the file main.c. Which will tell the system to compile the C code inside the file main.c and output an executable file. The executable file will be able to run the code that has been written in main.c. However, there are a few steps to go through to get from the text file into being an executable running C code.</p><p>The first step is to send the code through a Preprocessor. A Preprocessor has three tasks. It first goes through the code and removes an comments in the code. This is done because comments are unnecessary to the functionality of the code. After it removes the comments, it looks at the headers and adds any code from the headers. For example, if the files starts with #include&lt;stdio.h&gt; the Preprocessor adds the code from the stdio.h file to the rest of the C code in the file. The next step is to identify any macros that are being used and replace them with the code that they were set to represent.</p><p>After the source code goes through the Preprocessor it is sent to the compiler. The compiler than looks at the code given from the Preprocessor and translates it into assembly language. Assembly language is still mostly readable by humans, but not quite as clear as the C language itself. It looks a little like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*R9IFsxtHH1YS8_K6Xuu9WA.png" /></figure><p>After the code has been converted into Assembly language it is sent through the Assembler. The Assembler takes the Assembly language code and converts it into object code, also known as machine language. Object code is in binary, so it’s a series of 1s and 0s that the computer can read and interpret as commands. This step is necessary because computers run in binary and can only interpret things in 1s and 0s. As an example the code produced by the Assembler might look something like this:</p><p>111111110000101100011000010101110001001110000101010011110010100101101010010100000011111111000101000100111110011000111001</p><p>Where that is actually just nonsense I typed out, code properly translated into machine language has meaning to it and every 1 and 0 changes how the computer interprets the code. Once the file has been translated into machine language it is sent through a Linker.</p><p>There are often many different files that all have code to essential to the program that is trying to be compiled. The job of the Linker is to combine all of these files together. So, it will grab any code that may be stored in a different file than the source code and put them into one file together. This one file being the executable that we are looking for. If there are any errors in the compiling process the Linker will output these error messages.</p><p>Once the source code has been through the Preprocessor, the Compiler, the Assembler, and the Linker, we are left with a single executable file. This file holds all the code needed to run whatever it is we were trying to create in C. You can then run the executable file and watch all your coding go to work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=904781113497" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Difference Between a Hard Link and a Symbolic Link]]></title>
            <link>https://medium.com/@Corbin_Coleman/the-difference-between-a-hard-link-and-a-symbolic-link-14b062898202?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/14b062898202</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Tue, 11 Oct 2016 07:12:03 GMT</pubDate>
            <atom:updated>2016-10-11T07:12:03.107Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*MjMgehVLJzxYBsttsX839w.png" /><figcaption>A Hard Link vs a Shadow Link</figcaption></figure><p>What is the difference between a hard link and a symbolic link in computer software? Simply they are both files that point towards another file to give the file multiple names it can be opened by. They are both created in Linux using the ln command. Used without options the ln command will create a hard link to a file. For example if I had a file named “couch” and I wanted to create a hard link titled “potato” I’d use the ln command like this:</p><p>ln couch potato</p><p>This would then create a hard link file called “potato”. So, if somebody was to try to open the file “potato” it would open up the file “couch” since the two are linked together. To make that same link, but instead make it symbolic you would simply add the “-s” flag to the command ln. Like this:</p><p>ln -s couch potato</p><p>By making the link symbolic the two files “couch” and “potato” don’t have to be kept on the same memory. Say, you put the file “couch” on a CD, you could still access it with the symbolic link “potato” even if “potato” was on the computers hard drive. This, however doesn’t work with hard links.</p><p>Another benefit to symbolic links is that they can be created even without a file to link to, and be linked later. Whereas, a hard link must have a file to link to when it is created.</p><p>That’s the basic of symbolic and hard links. From how to create them to some key differences between the two.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14b062898202" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Happens When You Type ls *.c]]></title>
            <link>https://medium.com/@Corbin_Coleman/what-happens-when-you-type-ls-c-d8eb74bf6324?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8eb74bf6324</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Tue, 11 Oct 2016 06:40:39 GMT</pubDate>
            <atom:updated>2016-10-13T05:52:52.256Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*9epP6H3yCrb37X3O50gp5w.png" /><figcaption>An example of the basic use of the ls command in the shell.</figcaption></figure><p>In the most simple way possible the command ls *.c lists all the files in the current directory that end with “.c”. But what exactly is going on in the shell to get us there?</p><p>The first thing the shell does is check the input given to it for different words. So, with the command ls *.c, the shell recognizes two separate words here since ls and *.c are separated by spaces. Now that it has the two words it looks at the first to see if it’s an alias for another command. If there is an alias set up the shell looks at the new command and sees if it’s an alias, and will keep doing this until it finds a command that is not aliased to anything else. So, if ls had an alias setup for rm, but rm didn’t have any aliases then the shell would replace the ls with rm in the command. Thus making:</p><p>ls *.c</p><p>into:</p><p>rm *.c</p><p>Which is a drastically different command. Once, the shell has found the appropriate command, the non-aliased one, it will then look to the second word it sees. In this case “*.c”, and see if there is any expansions to run. In this case we have the ‘*’ character, which is an expansion. The ‘*’ expansion looks for all files ending with what follows it, in this case “.c”. If the the “.c” had happened before the ‘*’ then it would look for all files that started with “.c”. It would this expand this out to list all those files in the command line. So, assuming are ls wasn’t aliased this would look something like this:</p><p>ls foo.c boo.c</p><p>After that the shell would then run the command with all the arguments given. So in this situation it would list the names of all the files in the directory matching those names it previously put in the command line. Once it runs the command it exits and then the shell prints the command prompt based off of what is set in the PS1 variable.</p><p>Then that’s that. The shell has properly ran the command given to it, and the user can now give the shell any other command they need to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8eb74bf6324" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’ve wanted to work with computers since I was a little kid.]]></title>
            <link>https://medium.com/@Corbin_Coleman/i-ve-wanted-to-work-with-computers-since-i-was-a-little-kid-2fa592d4dee1?source=rss-570e69497272------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fa592d4dee1</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[college]]></category>
            <dc:creator><![CDATA[Corbin Coleman]]></dc:creator>
            <pubDate>Sat, 02 Apr 2016 19:44:52 GMT</pubDate>
            <atom:updated>2016-04-02T19:44:52.012Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve wanted to work with computers since I was a little kid. My dad has worked in the software engineering field my whole life. Sometimes he would take me with him to work and I’d get to walk around his offices and see what everybody was working on. The things that these men and women were making always excited me. These individuals could write some code and create amazing things. I knew that I wanted to work in a place like that when I grew up and got a job of my own. I wasn’t quite sure what I wanted to do though.</p><p>During this same time in my life, and even now, I loved playing video games and really wanted to make them myself one day. When I was younger I didn’t know how they were made though. So, when my dad told me that he knew people that actually made video games I was filled with joy. He went on to introduce me to some of the men and women who were working on some video games at the time. Through this I learned that video games were made a lot like the different software programs my dad’s coworkers were working on. It was all coding, just with a different end goal. Right then I knew that my life goal would be to become a software engineer for video games. I could combine two things I was always interested in.</p><p>I think Holberton is a great way to put myself in a position to achieve this goal. The school fits a lot of the way that I work. I like actually doing things to learn rather than learning how things might work and on occasion applying it. The best way for me to learn is by doing something, over and over again if I have to, but just doing it works the best. To see that there’s a school that shares this philosophy is great to me. Beyond that the idea that anybody should be able to have access to this school if they can prove they have the drive to be there is amazing to me. I believe education to be something for everybody. It shouldn’t be restricted because of somebody’s background. That’s part of what bothers me about the traditional education system. As well as the unnecessary classes one has to take to get a degree. The schooling system forces a person to have a set number of hours in a classroom, whether that class is beneficial or even related to that individual’s area of study. Which is one of the reasons I was interested in Holberton. There’s none of that excess schooling going on. Holberton is a software engineering school and that’s what they do. No fluff or excess. I wanna be a software engineer and that’s what Holberton is gonna teach me to be. That means to me that the best choice for me to achieve my goals is to go to Holberton.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fa592d4dee1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>