<?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 jraleman on Medium]]></title>
        <description><![CDATA[Stories by jraleman on Medium]]></description>
        <link>https://medium.com/@jraleman?source=rss-4485c8b59ed7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ozu6keUf2ZFp3Qwg5TyTwg.png</url>
            <title>Stories by jraleman on Medium</title>
            <link>https://medium.com/@jraleman?source=rss-4485c8b59ed7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:58:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jraleman/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[POV from a Developer: Why Launching a Project Is Just the Beginning]]></title>
            <link>https://jraleman.medium.com/pov-from-a-developer-why-launching-a-project-is-just-the-beginning-e9fc16ae7706?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9fc16ae7706</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[point-of-view]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Sat, 01 Feb 2025 03:40:20 GMT</pubDate>
            <atom:updated>2025-02-01T03:44:17.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndfhS63PvBbAiV7ay3NpuQ.jpeg" /></figure><p>As developers, we often treat a project’s launch like it’s the finish line. The final checkpoint after endless lines of code, late nights spent on a computer screen, with countless of bugs squashed. It feels like the ultimate triumph. You hit deploy, the world gets to see your creation, and you… exhale. It’s out there. Done. Finished.</p><p>Except it’s not.</p><p>Here’s the plot twist: launching isn’t the end. In reality, it is the starting line. The start of something bigger, messier, and infinitely more rewarding — if you embrace it. Let’s explore why launch day is really day one, and why it matters for everyone, not just developers.</p><h3>The Thrill of Launching a Project</h3><p>Let’s not downplay it, launching is exciting… It’s the culmination of effort, creativity, and grit. We can divide this thrill or feeling into 3 parts:</p><ol><li><strong>Validation of Effort</strong>: It’s not just an idea anymore… It’s real, tangible, and something that the world can actually use.</li><li><strong>Creative Triumph</strong>: Turning lines of code into something functional and meaningful is its own kind of magic.</li><li><strong>The Great Illusion</strong>: It’s tempting to believe, “This is it. I’ve arrived.” The illusion of finality can be deceiving.</li></ol><p>But the reality? Launch day is merely a milestone, not the destination.</p><h3>Post-Launch Reality: The Work Begins</h3><p>The curtain’s up, the world’s watching… Now comes the real stuff, the post-launch. Here’s what it looks like:</p><h4>1. Feedback: The Real Test</h4><p>Users will surprise you. They’ll:</p><ul><li>Break things in ways you never imagined.</li><li>Use your app for purposes you didn’t foresee.</li><li>Have opinions — some useful, some… let’s say, not so much.</li></ul><p>Feedback is your lifeline. It’s raw, honest, and crucial. But it also requires humility. You thought you knew your product? Your users will teach you otherwise!</p><h4>2. Maintenance: The Grind</h4><p>Think your job is done? Think again. Post-launch means:</p><ul><li><strong>Fixing Bugs</strong>: From small annoyances to show-stopping errors.</li><li><strong>Pushing Updates</strong>: New features, better functionality, smoother experiences.</li><li><strong>Monitoring Performance</strong>: Ensuring it scales and runs reliably under real-world pressure.</li></ul><h4>3. Scaling: Growing Pains</h4><p>Success brings its own set of headaches. When your user base grows, so do the challenges:</p><ul><li>Infrastructure creaks under the load.</li><li>Code that worked fine for 100 users struggles with 10,000.</li><li>Your team stretches to handle it all.</li></ul><p>Scaling is exciting. But it’s also demanding — and relentless.</p><h3>Shifting Perspective: Viewing Launch as the Starting Line</h3><p>Here’s the mindset shift: launch day isn’t the finish line. It’s the starting line. Here’s how to embrace it:</p><h4>1. Adopt a Growth Mindset</h4><p>The best developers see their projects as evolving, not static. To thrive post-launch:</p><ul><li><strong>Celebrate Progress</strong>: Acknowledge the win of launching but stay hungry for what’s next.</li><li><strong>Welcome Feedback</strong>: Even the tough critiques can lead to breakthroughs.</li><li><strong>Stay Curious</strong>: Tech moves fast. Keep learning, iterating, and improving.</li></ul><h4>2. Learn from Iterative Success</h4><p>The most successful products didn’t peak at launch. Consider:</p><ul><li><strong>Instagram</strong>: Born as a check-in app called Burbn, it pivoted into photo-sharing after user insights.</li><li><strong>Slack</strong>: A byproduct of a failed game that revolutionized workplace communication.</li></ul><p>Their early versions were far from perfect (or even of the same scope of implementation). Growth came through relentless iteration.</p><h3>Balancing Pride and Patience</h3><p>Post-launch can feel like a grind. High stakes. High pressure. Here’s how to stay grounded:</p><h4>1. Set Realistic Expectations</h4><ul><li><strong>Pace Yourself</strong>: Great things take time.</li><li><strong>Be Transparent</strong>: With stakeholders, users, and yourself.</li><li><strong>Avoid Burnout</strong>: Rest is as important as work.</li></ul><h4>2. Celebrate the Small Wins</h4><p>It’s not all doom and grind. Take joy in moments like:</p><ul><li>A user’s positive review.</li><li>Squashing a tricky bug.</li><li>Watching your system handle a spike in traffic without breaking.</li></ul><p>These wins add up. They fuel your momentum. Enjoy them.</p><h3>The Developer’s Role in the Bigger Picture</h3><p>Developers don’t just build tools. We shape experiences. We solve problems. Here’s how:</p><h4>1. Empathy: Build for People</h4><p>Your code isn’t abstract. It’s for real users. To serve them well:</p><ul><li><strong>Understand Their Needs</strong>: Dive into their world. Solve their problems.</li><li><strong>Design for Accessibility</strong>: Inclusion matters. Build for everyone.</li><li><strong>Listen to Feedback</strong>: Users will show you what works — and what doesn’t.</li></ul><h4>2. Collaboration: The Secret Ingredient</h4><p>Tech isn’t built in silos. Success comes from teamwork:</p><ul><li><strong>Work with Stakeholders</strong>: Align your vision with business goals.</li><li><strong>Collaborate with Peers</strong>: Peer reviews and brainstorming elevate everything.</li></ul><h3>Conclusion</h3><p>Launching a project is amazing... But it’s just the beginning. The real journey starts after the launch button is pressed — a journey of growth, learning, and endless possibilities.</p><p>Whether you’re a developer or someone cheering them on, remember: great things are always a work in progress. Let’s celebrate the effort it takes to keep building, improving, and dreaming bigger.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9fc16ae7706" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I gain back my motivation]]></title>
            <link>https://jraleman.medium.com/how-i-gain-back-my-motivation-8facaebce191?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8facaebce191</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[habits]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Wed, 09 Dec 2020 09:03:33 GMT</pubDate>
            <atom:updated>2020-12-09T09:10:44.615Z</atom:updated>
            <content:encoded><![CDATA[<p>Motivation is one of those things that come and go, frequently. I may feel motivated during the day, for a couple of hours or, maybe even days. On the other hand, lack of motivation may also manifest during the day, for a couple of hours, or maybe even days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*M7LYp8ibPy0_NnqR" /><figcaption>Credits: <a href="https://images.unsplash.com/photo-1456406644174-8ddd4cd52a06?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&amp;ixlib=rb-1.2.1&amp;auto=format&amp;fit=crop&amp;w=748&amp;q=80">Image taken from Unsplash</a></figcaption></figure><p>Better yet, I would describe motivation as a positive mindset, the desire to be able to achieve a goal. Motivation is a vehicle that can be used to drive the bumpy road that leads to the goal, the end result. Of course, you can walk down the road, but that in itself is quite an achievement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ILTRpHsyknuXrZcL" /><figcaption>Credits:<a href="https://images.unsplash.com/photo-1578271984813-9c4e628acf9e?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&amp;ixlib=rb-1.2.1&amp;auto=format&amp;fit=crop&amp;w=1575&amp;q=80"> Image taken from Unsplash</a></figcaption></figure><blockquote>What you find is that motivation often comes after starting the task, not before.</blockquote><p>Take for example, my working out routine. I get out of bed, I do some stretches, and I hit the floor and do at least five pushups. That’s it. Most of the time, even when I wasn’t motivated to work out, I manage to gain some motivation while exercising. It may take a few seconds, couple of minutes, or some time. If I still feel not motivated or feel tired, I stop… but at least I managed to work out a little bit that day and not break the habit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*DhI5hhkGyh0a0TF-" /><figcaption>Credits: <a href="https://images.unsplash.com/photo-1549060279-7e168fcee0c2?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&amp;ixlib=rb-1.2.1&amp;auto=format&amp;fit=crop&amp;w=1500&amp;q=80">Image taken from Unsplash</a></figcaption></figure><p>As James Clear, author of “Atomic Habits” says:</p><blockquote>We often think that motivation is something that we are supposed to have before we do work, but motivation will come as a result of doing some small bit of work and then we can trust that the rest of the process will flow easily</blockquote><p>This is a good thought to have when you feel like procrastinating. He has called this process <a href="https://jamesclear.com/how-to-stop-procrastinating">“The two-minutes rule”</a>, because a habit shouldn’t take more than a couple of minutes.</p><p>And this is how I get back my motivation… Just spend two minutes doing a task, and try to see if you energy level improves. If not, take a break and try again later. If it does, give it time, until you get into the flow state. This is where time passes fast, you are having fun doing the task, and break free from procrastinating. This happens a lot while coding.</p><p>Remember, you got this! Have a nice day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8facaebce191" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the C Function strtrim()]]></title>
            <link>https://jraleman.medium.com/implementation-of-the-c-function-strtrim-1a1ea0c60b38?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a1ea0c60b38</guid>
            <category><![CDATA[implementation]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 01:51:01 GMT</pubDate>
            <atom:updated>2019-07-01T01:51:01.059Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*EMNRL7Y58gHN0ze99bBbDg.png" /><figcaption>Notice the difference between the strings. Some extra spaces in there, right?</figcaption></figure><p>First, let’s take a look at the man page of this function. We can use the <a href="https://www.gsp.com/cgi-bin/man.cgi?section=3&amp;topic=strtrim">FreeBSD version</a> of this function.</p><pre><em>strtrim</em> removes all whitespace characters from the beginning and the end of a string.</pre><p>In other words, it will remove all the unnecessary white that you might have in a string, for instance:</p><pre>char *str = &quot;   Hello world! &quot;<br>             ^^^            ^</pre><p>Now that we know what it to do, let’s divide this implementation into small steps.</p><ol><li>Get the position within the string, where there is no white space at the beginning of it. In the case above, it would be index = 3, because str[3] == &#39;H&#39;</li></ol><pre>/*<br>** Auxiliary function to skip white spaces<br>*/</pre><pre>int is_white_space(char c) {<br>    return (c == &#39; &#39; || c == &#39;\t&#39; || c == &#39;\n&#39;);<br>}</pre><pre>/*<br>** Iterate through the whitespaces at the beginning of the string<br>*/</pre><pre>int get_first_position(char const *str) {<br>    int i = 0;<br>    while (is_white_space(str[i])) {<br>        i += 1;<br>    }<br>    return (i);<br>}</pre><p>2. Now let’s find the last valid position in the string.</p><p>str[15] == &#39;!&#39;</p><pre>/*<br>** Get the length of a string<br>*/</pre><pre>int get_str_len(char const *str) {<br>    int len = 0;<br>    while (str[len] != &#39;\0&#39;) {<br>        len += 1;<br>    }<br>    return (len);<br>}</pre><pre>/*<br>** Find the last position in a string that is not a white space<br>*/</pre><pre>int get_last_position(char const *str) {<br>    int i = get_str_len(str) - 1;<br>    while (is_white_space(str[i])) {<br>        i -= 1;<br>    }<br>    return (i);<br>}</pre><p>3. And then let’s copy this into a new array of character with the correct size, so we can have the length of the &quot;Hello World!&quot; string, without any white space at the beginning and or end of this string.</p><pre>/*<br>** Returns the correct length of a trimmed string<br>*/</pre><pre>int get_trim_len(char const *str) {<br>    return (get_last_position(str) - get_first_position(str));<br>}</pre><p>4. And now we can copy the correct characters to our trim string.</p><pre>/*<br>** Allocates a new string with removed whitespace characters from the beginning of the source string `str`<br>*/</pre><pre>char *strtrim(char const *str) {<br>// Variables declaration<br>    char *trim = NULL;<br>    int i, len, start, end;</pre><pre>// Check if the string exists<br>    if (str != NULL) {<br>        i = 0;<br>        len = get_trim_len(str) + 1;<br>        trim = (char *)malloc(len);<br>        start = get_first_position(str);</pre><pre>// Copy content to trim string<br>        while (i &lt; len) {<br>            trim[i] = str[start];<br>            i += 1;<br>            start += 1;<br>        }</pre><pre>// Null terminate the trimmed string.<br>        trim[i] = &#39;\0&#39;;<br>    }<br>    return (trim);<br>}</pre><p>And now, we can create a new c file called trim.c and compile the strtrim() function implementation with a main() function.</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;</pre><pre>/*<br>** Auxiliary function to skip white spaces<br>*/</pre><pre>int is_white_space(char c) {<br>    return (c == &#39; &#39; || c == &#39;\t&#39; || c == &#39;\n&#39;);<br>}</pre><pre>/*<br>** Iterate through the white spaces at the beginning of the string<br>*/</pre><pre>int get_first_position(char const *str) {<br>    int i = 0;<br>    while (is_white_space(str[i])) {<br>        i += 1;<br>    }<br>    return (i);<br>}</pre><pre>/*<br>** Get the length of a string<br>*/</pre><pre>int get_str_len(char const *str) {<br>    int len = 0;<br>    while (str[len] != &#39;\0&#39;) {<br>        len += 1;<br>    }<br>    return (len);<br>}</pre><pre>/*<br>** Find the last position in a string that is not a white space<br>*/</pre><pre>int get_last_position(char const *str) {<br>    int i = get_str_len(str) - 1;<br>    while (is_white_space(str[i])) {<br>        i -= 1;<br>    }<br>    return (i);<br>}</pre><pre>/*<br>** Returns the correct length of a trimmed string<br>*/</pre><pre>int get_trim_len(char const *str) {<br>    return (get_last_position(str) - get_first_position(str));<br>}</pre><pre>/*<br>** Allocates a new string with removed whitespace characters from the beginning of the source string `str`<br>*/</pre><pre>char *strtrim(char const *str) {<br>    char *trim = NULL;<br>    int i, len, start, end;<br>    if (str != NULL) {<br>        i = 0;<br>        len = get_trim_len(str) + 1;<br>        trim = (char *)malloc(len);<br>        start = get_first_position(str);<br>        while (i &lt; len) {<br>            trim[i] = str[start];<br>            i += 1;<br>            start += 1;<br>        }<br>        trim[i] = &#39;\0&#39;;<br>    }<br>    return (trim);<br>}</pre><pre>/*<br>** Let&#39;s rock and roll<br>*/</pre><pre>int main(int argc, char const *argv[]) {<br>    if (argc &gt; 1) {<br>        for (int i = 1; i &lt; argc; i += 1) {<br>            printf(&quot;[%d] \&quot;%s\&quot;\n&quot;, i, strtrim(argv[i]));<br>        }<br>    }<br>    return (0);<br>}</pre><p>Let’s test it out!</p><pre>&gt; gcc trim.c<br>&gt; ./a.out &quot;  Neque porro quisquam&quot; &quot;      est qui dolorem ipsum quia     &quot; &quot;dolor sit amet&quot; &quot; consectetur&quot; &quot;adipisci &quot; &quot;   velit.. .    &quot;</pre><p>Resulting in the following output…</p><pre>[1] &quot;Neque porro quisquam&quot;<br>[2] &quot;est qui dolorem ipsum quia&quot;<br>[3] &quot;dolor sit amet&quot;<br>[4] &quot;consectetur&quot;<br>[5] &quot;adipisci&quot;<br>[6] &quot;velit.. .&quot;</pre><p>And so, we are done with our strtim() implementation. Hope this has been a good read to get you started on doing implementations of other functions!</p><p>Peace out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a1ea0c60b38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[42 Silicon Valley: The Good, the Bad, and the Ugly?]]></title>
            <link>https://jraleman.medium.com/42-silicon-valley-the-good-the-bad-and-the-ugly-b80fbb6d5d2f?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b80fbb6d5d2f</guid>
            <category><![CDATA[storyofmylife]]></category>
            <category><![CDATA[ecole-42]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Tue, 06 Nov 2018 21:46:21 GMT</pubDate>
            <atom:updated>2018-11-06T22:22:51.204Z</atom:updated>
            <content:encoded><![CDATA[<p>Probably you are asking yourself, what is this?</p><p>A meme is worth than 9001 words:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*hUJ0HZESx-CcwmZpWe7gSQ.jpeg" /><figcaption>Education just improved. Source: <a href="https://www.prnewswire.com/news-releases/filemaker-and-42-silicon-valley-announce-partnership-for-software-engineer-intern-program-and-strategic-app-development-300513759.html">prnewswire.com</a></figcaption></figure><p>I would describe 42 as a tuition free coding school that revolves in a peer-to-peer ecosystem. It is very similar to a workplace, where critical thinking and problem solving skills go hand by hand, and a project based curriculum that can be completed at your own pace.</p><p>A student needs to have patience, determination, intuition, and a problem solving mindset. That’s why logic tests are simple, minimalist, and without instructions. There are people that English is not their native language, and it is not fair for a test to test you on some unrelated skills, making a non-existent language barrier between the test and the candidate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_jJgnh5Uz1iCV9dRYJ7ug.jpeg" /><figcaption>If you can understand these words… klk fren. Source: <a href="https://www.critica.com.pa/nacional/que-xopa-loco-298099">critica.com.pa</a></figcaption></figure><p>The school wants you to succeed. They want you to be a better person, someone who can proudly say: “I am a software engineer, and I am ready for any challenge”. :)</p><p>Pisciners (candidates) and cadets (students) should respect people, resources, yourself, and think about the future. Always be perseverance, have some discipline with a manageable schedule to allow workflow and learn at the same time. Also, there is a lot of diversification, morality, work ethics, and cultures… share some stories, make new friends, and learn from them. It is like going to a different country, within the school.</p><p>Candidates don’t need coding experience, none of us were born with computer science knowledge. We start from the same line, but some people are better than others, that is the harsh truth. But in no way you should be giving up. Just keep practicing and studying, practicing and studying, practicing and studying… you will get better. Improvements matters, comparisons are just a reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*cc62JB6LR7iSNuo2Cn_SYA.jpeg" /><figcaption>Be like Midoriya, never give up. Source: <a href="https://aminoapps.com/c/anime/page/blog/boku-no-hero-academia-memes-pt-2/YMtb_uqmQVQYnkRoxak8dn6g0YDxd">aminoapps.com</a></figcaption></figure><p>Because of the French roots of the school, it feels very unique compared to American traditional university and schools. Xavier Niel, along with Kwame are the responsible of making 42 School Silicon Valley a reality! And the Bocal (the administration) cares about you. It is a small school, feels a lot like home.</p><p>Interestingly, what a person learn from 42 School, varies between them. This is because, 42, is the answer to life, the universe and everything. Yes, it is a coding school, but it is also type of vocational school. We have musicians, professional poker players, designers, actors, painters, and an alpaca shearer… keinen Spaß. ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*qZPInhaLaAgWey3slyfMdw.jpeg" /><figcaption>Looking good. Source: <a href="https://www.openherd.com/store/services/287/alpaca-shearing-service">openherd.com</a></figcaption></figure><p>It is very easy to make friends… I think that is what I got more from this school. I will always be thankful for this opportunity.</p><p>Getting myself stuck on a problem, and trying so hard to solve it, but taking a very long time to do it is one of the worst feelings. By contrast, solving this problem will bring you joy at the end. It is like a video game. It feels good. Like beating a Contra without using the Konami Code type of good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*u4i1qG8SJE1f1zXCuTFxiA.jpeg" /><figcaption>The good old days… Source: <a href="https://www.msx.org/news/en/story-of-the-konami-code">msx.org</a></figcaption></figure><p>But if I find myself on a situation like this, I will try my best on seeking for some help. First, I will DuckDuckGo it, because screw Google. If I can’t find a solution, I will use Google because it is better. If not avail, it’s time for StackOverflow. No solutions? Time to go to the GitHub repository of the technology I am using and see the issues. Nothing? Open an issue and cry because it will take a while for help to come to you.</p><p>But what if I can go and search for help? That is where 42 comes into play. By knowing the different skills of people, you know who is good with JavaScript, Python, UI/UX design, Assembly, GraphQL, etc…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FsS8Olqe3x5FZ-jfgDOJPQ.jpeg" /><figcaption>Or any other JS framework… Source: <a href="https://imgur.com/gallery/saM7G">imgur.com</a></figcaption></figure><p>So… 42 School is the best school out there, right?</p><p>I don’t know. But I know that 42 has some issues too, not everything is unicorn and rainbows. This is because for every good, there is some bad. It is logic. But I guess it can’t be helped. It is hard to keep motivation high when you code everyday, every time. Without friends, without a plan, without determination, or without the thirst for knowledge and the will to be one of the best, it is going to be hard to keep up with the dorm requirements and the strict deadlines.</p><p>One of the reasons might be that the Piscine, the totally not boot-camp, introductory test program that you need to complete to be accepted as a student, is fast paced. It is Sonic fast. And the regular program is at your own pace fast. If you are lazy, you are not going to level up in life.</p><p>Internships and jobs are required at 42 School. Maybe they want us to grow personally, get some greens, and be successful on life? Our foundation as a society is to contribute back, and one way to do it is to work. The important thing is that you enjoy doing it. It is what going to define you later in life. If you do well in 42 School, you already are working on your teamwork, communication, knowledge in doing research, rigor, creativity, adaptability, and other soft skills.</p><p>Of course, soft skills are important, but you are going to use your technical skills. Soft skills are just for help. I see it more or less like bonus on your skill branch of yourself. For this reason, a mandatory level should be reached before being able to apply for an internship. It used to be level 7, then it went to level 10, and I think it went back to level 7?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*KceboIH0ywsw2ecu2qMCZw.jpeg" /><figcaption>I don’t know anymore… Source: <a href="http://www.quickmeme.com/meme/3stsfb">quickmeme.com</a></figcaption></figure><p>Because the school is small, growing, and just starting… it feels a bit incomplete. This is not a negative view at all, it is just the way the world works. For example, I only went to one school my whole life, from kindergarten to high school. During my childhood, I have seen some similar transitions and situation that 42 School is going through.</p><p>I am a believer that 42 School has great potential, but is up to us, the students to make it the best coding school in the entire world.</p><p>In conclusion, if you want to visit the school, or even better, apply… do it. It has been by far the best experience of my life, I have grown a lot, and my perspective of the world changed… at least in some way. By the way, pizza at Le Tiki at Corse is overrated. The pizza at Sorrento, Panama City is better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*TxkrowOP71AG7Z0-r9UxYw.jpeg" /><figcaption>Best. Pizza. Ever.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b80fbb6d5d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ternary operators vs if-else statements]]></title>
            <link>https://jraleman.medium.com/ternary-operators-vs-if-else-statements-6c26f7d034f7?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c26f7d034f7</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[operators]]></category>
            <category><![CDATA[ternary]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Sun, 07 Jan 2018 04:49:13 GMT</pubDate>
            <atom:updated>2019-07-29T03:55:36.292Z</atom:updated>
            <content:encoded><![CDATA[<p>You have probably seen a ternary operator (also known as a conditional expression) before in a source file, or somewhere else. In C, and in a lot of language with similar syntax, we use the ? character to represent this operator.</p><p>Most beginners (by my own experience), find it a bit difficult to understand this operator, even though they have already mastered the if and else statements. I believe the reason for this is that it is a bit difficult to read and to write it, because having different operations in the same line can be confusing. Really.</p><p>Most likely, you already know how to use them, or at least, how to read and understand the logic behind them. In case you don’t, maybe the following “beautiful” ASCII art representation that I just made for you guys, will help you out.</p><pre>       yes<br>   __ __ __ __ <br>  |           |<br>  |           |<br>  |           ^<br>condition ?  true  : false<br>  |                    ^<br>  |                    |<br>  |__ __ __ __ __ __ __|<br>         no</pre><p>A ternary operator takes three arguments. The first one (1st) is the condition, the second one (2nd) is executed if the condition is true, and the third one (3rd) is executed if the condition is false.</p><p>In layman’s term, it’s just an {if-else} statement in one (1) line!</p><h3>When to use them?</h3><p>Personally, I use them when I want to set a value to a variable, depending on a condition. For example, let’s say that if x == 42 , I want the variable y to be True . If x is not equal to 42 , then the value of the variable y is False .</p><p>So, how do I write that? Just like this…</p><pre>bool y = (x == 42) ? true : false;</pre><p>Easy! <a href="https://goo.gl/LRQYfD">Try it</a> yourself. Also, here is the <a href="https://goo.gl/Tpoc4s">Python version</a>, just because:</p><pre>y = &quot;True&quot; if x == 42 else &quot;False&quot;</pre><h3>How about an if-else statement?</h3><p>In this case, I would argue and be against it. Why? Take a look at this code:</p><pre>bool y;</pre><pre>if (x == 42){<br>  y = true;<br>}<br>else {<br>  y = false;<br>}</pre><p>To “translate” it to a ternary operator, we would do it the following way:</p><pre>? -&gt; if (x == 42) {}<br>y -&gt; true;<br>: -&gt; else {}<br>y -&gt; false;</pre><p>So we can have something like this, assuming you want it to be in one line:</p><pre>bool y; if (x == 42) {y = true;} else {y = false;}</pre><p>Which is ugly and unnecesary, because we can write it like this:</p><pre>bool y = (x == 42) ? true : false;</pre><p>See? So much cleaner! We reduced seven (7) lines of code to just one (1) line. :)</p><h3>When should I avoid it?</h3><p>Ternary operators are awesome, but they’re not always needed. Suppose you just want to execute a function, or do multiple operations… don’t use ternaries.</p><p>Which one would you prefer?</p><pre>if (x == 42) {<br>  std::cout &lt;&lt; &quot;code is executed&quot; &lt;&lt; std::endl;<br>  code();<br>}<br>else {<br>  std::cout &lt;&lt; &quot;nothing happened&quot; &lt;&lt; std::endl;<br>}</pre><p>vs</p><pre>(x == 42) ? ((std::cout &lt;&lt; &quot;code is executed&quot; &lt;&lt; std::endl), code()) : (void)(std::cout &lt;&lt; &quot;nothing happened&quot; &lt;&lt; std::endl);</pre><p>Yeah, now it’s easy to see why.</p><h3>Conclusion</h3><ul><li>Use ternary operators to set a value to a variable, or to reduce code if necessary.</li><li>Use if-else statements for everything else.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c26f7d034f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Golf: strlen() implementation]]></title>
            <link>https://jraleman.medium.com/code-golf-strlen-implementation-ec293cd2b647?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec293cd2b647</guid>
            <category><![CDATA[procrastination]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[code-golf]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Fri, 15 Dec 2017 05:25:51 GMT</pubDate>
            <atom:updated>2017-12-15T05:27:59.535Z</atom:updated>
            <content:encoded><![CDATA[<p>Can you do a strlen implementation in just one line? Being that line under 80 characters (no cheating), and without the use of if-else statements, and/or while loops?</p><p>Yes, you can.</p><pre>size_t strlen(const char *s) <br>{<br>   return((*s)?(strlen(++s)+1):(size_t)*s);<br>}</pre><p>Don’t believe me? Try to <a href="https://goo.gl/tFrWfr">compile it</a>.</p><h3>How does it work?</h3><p>Recursion :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*AndJ2iutw6ZujcFvM5aURg.png" /><figcaption>First, let’s create our string, a simple “Hello world!”.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*fTKenefnkAENQS1QrFXz9Q.png" /><figcaption>Next, by recursion, we will iterate the whole array (string), until we find the null character.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*fzwXKFYUNfbhRr_h-4isKQ.png" /><figcaption>Now, we have our pointer (used as a counter) value saved in memory.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*FfriUDQSEx96fdJM1PYGIA.png" /><figcaption>And viola! We exit from the recursion, and return the length of the string.</figcaption></figure><p>Procrastinating much?</p><p>Maybe…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec293cd2b647" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C Programming Language: Types, Structures, and Enumeration]]></title>
            <link>https://jraleman.medium.com/c-programming-language-types-structures-and-enumeration-dc7849081eb5?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc7849081eb5</guid>
            <category><![CDATA[enumeration]]></category>
            <category><![CDATA[structure]]></category>
            <category><![CDATA[type]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Fri, 13 Jan 2017 11:06:00 GMT</pubDate>
            <atom:updated>2018-01-07T04:52:32.855Z</atom:updated>
            <content:encoded><![CDATA[<p>Before getting into this subject, we first need to understand exactly <em>what is a type</em> in C.</p><h3>What is a type?</h3><p><em>“A type refers to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dijPIval5TDw0byv.jpeg" /><figcaption>yummy</figcaption></figure><p>Let’s say that every donut in the image above is a type. The chocolate one is an <strong>int</strong>, the one with the sprinkles are <strong>unsigned int</strong>, the one with white icing and sprinkles is a <strong>char</strong>, and so on… Every single one is different in <em>some way</em> from another one. The following table provides details of some of the standard types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pLSsL0k1TpTR53wkdh_Eg.png" /></figure><p>Now that we know about types, let’s jump into the enumerated types.</p><h3>What is a structure?</h3><p>A data structure is just the organization of data, in a particular way that can be used efficiently. Think of it as the deck of cards. Each card is an element from the structure (deck), in which the elements (card) has a given value. Something like this:</p><pre>typedef struct s_deck<br>{ <br>    card2 = 2;<br>    card3 = 3;<br>    ... <br>    cardKing = 13;<br>    cardAS = 14;<br>}</pre><p>I know that each card is unique from each other in some way, such like 8th of Spade and 8th of Hearts; they have the same value, but different name, color, etc… For the sake of this tutorial, we just gonna cared about the value of the card (number).</p><h3>What is an enumeration?</h3><p>In simple terms, it’s an ordered list of all the items in a collection. It particulary refers to a listing of all of the elements of a set. The enumerated types consists of integral constants and each integral constant is give a name. Keyword enum is used to defined enumerated data type. For example:</p><pre>#include &lt;stdio.h&gt;</pre><pre>enum week_days  <br>{ <br>    monday,<br>    tuesday,<br>    wednesday,<br>    thursday,<br>    friday,<br>    saturday,<br>    sunday<br>};</pre><pre>int main(void)  <br>{<br>    printf(&quot;Monday is the %dst day of the week.\n&quot;, monday);<br>    printf(&quot;Thursday is the %dth day of the week.\n&quot;, thursday);<br>    printf(&quot;Sunday is the %dth day of the week.\n&quot;, sunday);<br>    return (0);<br>}</pre><p>Here, we created an enumerated type called week_days, that have a list of the days of the week. Then we print out the numerical value of some days. For example, moday is the first day, tuesday is the second day, and so on... <br><a href="https://goo.gl/WeQjeZ">Compile the code above, and see its output.</a></p><pre>Monday is the 0st day of the week.<br>Thursday is the 3th day of the week.<br>Sunday is the 6th day of the week.</pre><p><strong>Wait… what?</strong></p><p>We seem to be a day of. Monday the 0st day? This is totally wrong! But wait… remember that <strong>real programmers count from zero</strong> ;) <br> So how do we fix this? <a href="https://goo.gl/n87Y61">Just add ‘+1’ at the end of the day (to increment its value by one), so 0 will be 1, and 1 will be 2…</a></p><pre>printf(&quot;Monday is the %dst day of the week.\n&quot;, monday + 1);<br>printf(&quot;Thursday is the %dth day of the week.\n&quot;, thursday + 1);<br>printf(&quot;Sunday is the %dth day of the week.\n&quot;, sunday + 1);</pre><p>Actually… I don’t like this. Sure, it’s “fixed”, but not really. What if I want to use a day somewhere else? I’ll need to keep adding ‘+ 1’ in every place, and the code will not be that readable. What can we do? Just assign the correspondeatat values inside the enumerated type! See the following snippet bellow:</p><pre>enum week_days  <br>{ <br>    monday = 1,<br>    tuesday,<br>    wednesday,<br>    thursday,<br>    friday,<br>    saturday,<br>    sunday<br>};</pre><p><a href="https://goo.gl/6qZ9uV">Now try to compile it </a>without the ‘+ 1’ inside the main function. Each element is assigned to a value, in this case an integer of values from 1 to 7, representing the respective order of the days.</p><h4>Sources</h4><ul><li><a href="http://mvn.edu.in/mvnlms/mod/book/view.php?id=1591">Data Types MVN University</a></li><li><a href="http://www.sitesbay.com/cprogramming/c-enum">Sitesbay — Enumeration in C</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc7849081eb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compilation: Learn CS Concepts with Super Mario 64]]></title>
            <link>https://jraleman.medium.com/compilation-learn-cs-concepts-with-super-mario-64-79f8b3796a81?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/79f8b3796a81</guid>
            <category><![CDATA[rng]]></category>
            <category><![CDATA[pannenkoek]]></category>
            <category><![CDATA[float]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[super-mario-64]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Fri, 25 Nov 2016 15:09:28 GMT</pubDate>
            <atom:updated>2017-07-24T05:51:35.644Z</atom:updated>
            <content:encoded><![CDATA[<p>Here is a list of some videos that can help you understand better some of the basic computer science concepts. Shout-out to <strong>Pannenkoek2012</strong> for making this videos, check his <a href="https://www.youtube.com/user/pannenkoek2012">Youtube Channel!</a></p><h4>Floating Points</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9hdFG2GcNuA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9hdFG2GcNuA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9hdFG2GcNuA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c327f503826e77a2553b176b3ebc8fca/href">https://medium.com/media/c327f503826e77a2553b176b3ebc8fca/href</a></iframe><h4>Underflow / Overflow</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdokE1J5wlhE%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdokE1J5wlhE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdokE1J5wlhE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b693c16797491a318937f6fc7e3acfc5/href">https://medium.com/media/b693c16797491a318937f6fc7e3acfc5/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FT-YtojVHfKc%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DT-YtojVHfKc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FT-YtojVHfKc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/41c0914e43220a08a80772c8a77c3c31/href">https://medium.com/media/41c0914e43220a08a80772c8a77c3c31/href</a></iframe><h4>Random Number Generator</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMiuLeTE2MeQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMiuLeTE2MeQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMiuLeTE2MeQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d09dd860d6d3445127c30883fae67fbf/href">https://medium.com/media/d09dd860d6d3445127c30883fae67fbf/href</a></iframe><h4>Vectors and Scalars</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXL8TCplAaWc%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXL8TCplAaWc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXL8TCplAaWc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd2d7acb7360bfcf0d0afb93385a231c/href">https://medium.com/media/bd2d7acb7360bfcf0d0afb93385a231c/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrJjFXBFiyas%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrJjFXBFiyas&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrJjFXBFiyas%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc5cd51c2ce7b668a1ea99ed2efa0484/href">https://medium.com/media/bc5cd51c2ce7b668a1ea99ed2efa0484/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3lADTcTkAvk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3lADTcTkAvk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3lADTcTkAvk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1d35c70fb0c4d3cea3b281f5989b265/href">https://medium.com/media/e1d35c70fb0c4d3cea3b281f5989b265/href</a></iframe><h4>Memory Stack</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9xE2otZ-9os%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9xE2otZ-9os&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9xE2otZ-9os%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8457c83bd46cdfafb8ea2f6b205cfe96/href">https://medium.com/media/8457c83bd46cdfafb8ea2f6b205cfe96/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79f8b3796a81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C Programming Language: Passing a Function as a Parameter]]></title>
            <link>https://jraleman.medium.com/c-programming-language-passing-a-function-as-a-parameter-90d52fe842ea?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/90d52fe842ea</guid>
            <category><![CDATA[parameter]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Tue, 08 Nov 2016 05:29:03 GMT</pubDate>
            <atom:updated>2019-07-29T18:59:46.588Z</atom:updated>
            <content:encoded><![CDATA[<p>After reading this title, you’re probably feeling like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*zP_4nagFm1AlPN0w.jpg" /></figure><p>This may be a little hard to understand as first. I mean, a function parameter? You probably have some questions, such as:</p><ul><li><strong><em>The fuck is that!?</em></strong></li><li><em>How does it works?</em></li><li><em>When should I use it?</em></li><li><em>Is it really worth it?</em></li></ul><p>Fear no more! I shall answer all these questions, and more! ;)</p><h3>Declaration</h3><p>First, how do I declare this? A simple prototype for a function which takes a <em>function parameter</em> (sometimes called a formal parameter), is something like this:</p><p>void myfunction(void (*f)(int));</p><p><em>So… what???</em></p><p>This states that a parameter f will be a pointer (*f) to the function myFunction, which has a void return type and which takes just a single int parameter. In lay man&#39;s terms, myFunction takes an argument of a function type void, that returns a type void, and takes an int as an argument; (void (*f)(int)).</p><p>If you’re not following yet, let’s try this.</p><ul><li>void myFunction(void (*f)(int));</li></ul><p>And inside the parameter, we have:</p><ul><li>void *f(int);</li></ul><h3>Funtion Call</h3><p>Try compiling the following <a href="https://goo.gl/eYziCm">program</a> and see if it works.</p><pre>#include &lt;stdio.h&gt;</pre><pre>void printNumber(int nbr)  <br>{<br>    printf(&quot;%d\n&quot;, nbr);<br>}</pre><pre>void myFunction(void (*f)(int))  <br>{<br>    for(int i = 0; i &lt; 5; i++) <br>    {<br>        (*f)(i);<br>    }<br>}</pre><pre>int main(void)  <br>{<br>    myFunction(printNumber);<br>    return (0);<br>}</pre><p>If this was a tad hard to understand, maybe try <a href="https://goo.gl/M9oh1B">this one</a>.</p><pre>#include &lt;stdio.h&gt;</pre><pre>void print()  <br>{<br>    printf(&quot;Hello World!&quot;);<br>}</pre><pre>void helloworld(void (*f)())  <br>{<br>    f();<br>}</pre><pre>int main(void)  <br>{<br>    helloworld(print);<br>    return (0);<br>}</pre><p>It’s recommended to create functions that can work with a variety of parameter types. You can do this by declaring the parameter to by of type void *, and then casting the appropriate type in the function body, i.e.: void (*f)(int).</p><h3>Another Example</h3><p>Now that we’re pros with functions parameter, let’s try doing some functions that may be helpful for you.</p><p>void striter(char *s, void(*f)(char *));</p><p>This function applies the function f to each character of the string passed as argument. Each character is passed by address to f to be modified if necessary. We can build this function in this way:</p><pre>void striter(char *s, void (*f)(char *)) <br>{<br>    if (s)<br>    {<br>        for (int i = 0; s[i]; i++)<br>        {<br>            f(&amp;s[i]);<br>        }<br>    }<br>    return ;<br>}</pre><ul><li>if(s) makes sure the function is protected (so when it get&#39;s a null pointer, it does nothing.</li><li>for (int i = 0; s[i]; i++) begins the counter to sweep by each character of the string.</li><li>f(&amp;s[i]); takes the address of each character of the string, and pass it into the function f.</li></ul><h3>Completed Code</h3><pre>#include &lt;stdio.h&gt;<br>void printNumber(int nbr)  <br>{<br>    printf(&quot;%d\n&quot;, nbr);<br>}<br>void myFunction(void (*f)(int))  <br>{<br>    for(int i = 0; i &lt; 5; i++) <br>    {<br>        (*f)(i);<br>    }<br>}<br>int main(void)  <br>{<br>    myFunction(printNumber);<br>    return (0);<br>}</pre><pre>#include &lt;stdio.h&gt;<br>void print()  <br>{<br>    printf(&quot;Hello World!&quot;);<br>}<br>void helloworld(void (*f)())  <br>{<br>    f();<br>}<br>int main(void)  <br>{<br>    helloworld(print);<br>    return (0);<br>}</pre><pre>void striter(char *s, void (*f)(char *)) <br>{<br>    if (s)<br>    {<br>        for (int i = 0; s[i]; i++)<br>        {<br>            f(&amp;s[i]);<br>        }<br>    }<br>    return ;<br>}</pre><h3>Sources</h3><ul><li>Niyaz’ answer to <a href="http://stackoverflow.com/questions/9410/how-do-you-pass-a-function-as-a-parameter-in-c#9413">How do you pass a function as a parameter in C?</a></li><li><a href="http://math.hws.edu/bridgeman/courses/331/f05/handouts/c-c++-notes.html">http://math.hws.edu/bridgeman/courses/331/f05/handouts/c-c++-notes.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90d52fe842ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Template: Un Makefile para gobernarlos a todos!]]></title>
            <link>https://jraleman.medium.com/template-un-makefile-para-gobernarlos-a-todos-61eebdada9f0?source=rss-4485c8b59ed7------2</link>
            <guid isPermaLink="false">https://medium.com/p/61eebdada9f0</guid>
            <category><![CDATA[template]]></category>
            <category><![CDATA[español]]></category>
            <category><![CDATA[makefile]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <dc:creator><![CDATA[jraleman]]></dc:creator>
            <pubDate>Wed, 02 Nov 2016 17:58:37 GMT</pubDate>
            <atom:updated>2017-07-24T05:54:54.315Z</atom:updated>
            <content:encoded><![CDATA[<p>Un makefile es un archivo de texto que tiene un conjunto de reglas, para automatizar la compilacion un programa, de forma simple y organizada. Make se puede usar para compilar cualquier lenguaje, pero en este caso usaremos el Lenguaje C.</p><h3>Planilla de Makefile</h3><p>El siguiente <strong>Makefile</strong> lo puedes usar como planilla para compilar sus programas en C de forma muy rapida.</p><pre># Nombre del programa<br>NAME       = &lt;nombre&gt;</pre><pre># Flags de compilacion<br>FLAGS      = -Wall -Wextra -Werror -g -Ofast</pre><pre># Directorios<br>SRC_DIR    = ./srcs/<br>OBJ_DIR    = ./obj/<br>INC_DIR    = ./includes/<br>LIBFT_DIR  = ./libft/<br>MINLBX_DIR = ./minilibx/</pre><pre># Archivos fuentes y objetos<br>SRC_FILES  = $(wildcard $(SRC_DIR)/*.c)<br>OBJ_FILES  = $(SRC_FILES:.c=.o)</pre><pre># Direcciones<br>SRC        = $(addprefix $(SRC_DIR), $(SRC_FILES))<br>OBJ        = $(addprefix $(OBJ_DIR), $(OBJ_FILES))<br>LIBFT      = $(addprefix $(LIBFT_DIR), libft.a)<br>MINLBX     = $(addprefix $(MINLBX_DIR), libmlx.a)</pre><pre># Linkers<br>LNK        = -Ofast </pre><pre># Se compila el archivo binario (ejecutable).<br>all: obj $(NAME)</pre><pre># Crea la carpeta donde estara los objetos.<br>obj:<br>   <a href="http://twitter.com/mkdir">@mkdir</a> -p $(OBJ_DIR)<br>$(OBJ_DIR)%.o:$(SRC_DIR)%.c<br>   <a href="http://twitter.com/gcc">@gcc</a> $(FLAGS) -I $(INC_DIR) -o $@ -c $&lt;</pre><pre># Se compila los objetos con las librerias y archivos<br>$(NAME): $(OBJ)<br>   <a href="http://twitter.com/echo">@echo</a> &quot;(ﾉ◕ヮ◕)ﾉ*:・ﾟ✧ Compilando, espere unos segundos...&quot;<br>   <a href="http://twitter.com/gcc">@gcc</a> $(OBJ) $(LNK) -lm -o $(NAME)<br>   <a href="http://twitter.com/echo">@echo</a> &quot;(•̀ᴗ•́)و $(NAME) generado!&quot;</pre><pre># Remueve todos los archivos objetos<br>clean:<br>   <a href="http://twitter.com/rm">@rm</a> -Rf $(OBJ_DIR)<br>   <a href="http://twitter.com/echo">@echo</a> &quot;¯\_(ツ)_/¯ Objectos removidos!&quot;</pre><pre># Remueve todos los archivos objetos, binarios, y sus respectivas carpetas<br>fclean: clean<br>   <a href="http://twitter.com/rm">@rm</a> -f $(NAME)<br>   <a href="http://twitter.com/echo">@echo</a> &quot;(╯°□°）╯︵ ┻━┻ $(NAME) removido!&quot;</pre><pre># Hace un re-make (como si se hubiera ejecutado Make por primera vez)<br>re: fclean all</pre><pre># Le dice al make que estos nombre no son archivos<br>.PHONY: all clean fclean re</pre><p>Se asume que tienen la siguiente estructura de carpetas en el directorio del proyecto. Algo como esto.</p><pre>proyecto/  <br>  |-- includes/<br>  |   |-- archivos.h<br>  |-- libs/<br>  |   |-- archivos.a<br>  |-- srcs/<br>  |   |-- archivos.c<br>  |-- Makefile</pre><p><em>La carpeta obj se creara automaticamente con sus respectivos archivos objetos.</em></p><h3>Disclaimer</h3><p>Usar los wildcards, como [$(wildcard $(SRCDIR)/*.c)], se puede considerar una mala practica, ya que si se tienen archivos que no se desean compilar (o archivos que se olvidaron quitar), el programa puede ser que no funcione correctamente. Asi que usalo con responsabilidad. ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61eebdada9f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>