<?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"><channel><title><![CDATA[Catcocode]]></title><description><![CDATA[Catcocode]]></description><link>https://catcocode.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 23:19:08 GMT</lastBuildDate><atom:link href="https://catcocode.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[🦄 First function for every developers: "Hello World" with Solidity]]></title><description><![CDATA[Basic introduction to Solidity with "Hello World"]]></description><link>https://catcocode.hashnode.dev/first-function-for-every-developers-hello-world-with-solidity</link><guid isPermaLink="true">https://catcocode.hashnode.dev/first-function-for-every-developers-hello-world-with-solidity</guid><category><![CDATA[Web Development]]></category><category><![CDATA[Web3]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Solidity]]></category><dc:creator><![CDATA[Bynx Patrika]]></dc:creator><pubDate>Thu, 25 Nov 2021 13:00:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1637776672114/7mTnS41XY.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've been having an interest in Solidity for a while and there is no better time to start than now! So enough talking.</p>
<h2 id="heading-solidity">✨ Solidity</h2>
<blockquote>
<p>Solidity is a statically-typed curly-braces programming language designed for developing smart contracts that run on Ethereum. </p>
</blockquote>
<p>from  <a target="_blank" href="[https://soliditylang.org/">Solidity document</a> </p>
<h2 id="heading-getting-started">🚀 Getting Started</h2>
<p>Now we are going to start diving in to coding. </p>
<p>Firstly, go to  <a target="_blank" href="https://remix.ethereum.org/">Remix IDE</a>. This is a code editor for coding, deploying and debugging smart contracts without having to install anything on our computers. Think of it like a playground for smart contracts.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1637600821566/_uqP6sbxU.png" alt="remix.ethereum.org_.png" /></p>
<p>Then click on the little file icon under the default_workspace to create a new file. We are going to name it <em>Hello.sol</em>, as you can guess .sol is for Solidity file. And put in these code.</p>
<pre><code><span class="hljs-comment">// SPDX-License-Identifier: UNLICENSED</span>
pragma solidity &gt;=<span class="hljs-number">0.7</span><span class="hljs-number">.0</span> &lt;<span class="hljs-number">0.9</span><span class="hljs-number">.0</span>;

contract Hello {

    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">greeting</span> (<span class="hljs-params"></span>) <span class="hljs-title">public</span> <span class="hljs-title">pure</span> <span class="hljs-title">returns</span> (<span class="hljs-params"><span class="hljs-keyword">string</span> memory</span>) </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-string">"Hello there"</span>;
    }

}
</code></pre><p>We'll go through every lines step by step.</p>
<p><strong><em>// SPDX-License-Identifier: UNLICENSED</em></strong></p>
<p>This is a machine-readable  <a target="_blank" href="https://spdx.dev/">SPDX license identifiers</a>. It will be the first line of every smart contracts. The compiler will give us a warning if it's not there. If we don't want to specify a license or if the source code is not open-source, just use the special value <em>UNLICENSED.</em></p>
<p><strong><em>pragma solidity &gt;=0.7.0 &lt;0.9.0;</em></strong></p>
<p>Source files should be annotated with a version pragma so the files won't be compiled by a compiler that does not meet the version requirement. In this one it works on a compiler starting with version 0.7.0 and less than 0.9.0.</p>
<p><strong><em>contract</em></strong></p>
<p>A contract is a collection of code (functions) and data (variables) that resides at a specific address on the Ethereum blockchain. It works like a class in other programming languages.</p>
<p><strong><em>function greeting () public pure returns (string memory)</em></strong></p>
<p>Here comes our first function! There are several parts and might look confusing at first, I went WTF the first time I saw this. But after breaking it down, it is easier to split into 5 parts.</p>
<ol>
<li><p><em>function</em>  : This is a keyword for defining a function.</p>
</li>
<li><p><em>greeting ()</em> : A function name. Inside the parantheses is its parameters which we don't have for now.</p>
</li>
<li><p><em>public</em> : In Solidity, functions are public by default. This means anyone can call our contract's function and execute its code. Another keyword is <em>private</em>, using private and other contracts cannot call this function.</p>
</li>
<li><p><em>pure</em> : Function modifiers. We use <em>pure</em> in this one because this function doesn't even read from the state of the app — its return value depends only on its parameters. The example values are:</p>
<p>   <strong>pure</strong> : Pure functions, which means it's not even accessing any data in the app.
   <strong>view</strong> : View function, meaning it's only viewing the data but not modifying it.</p>
</li>
</ol>
<ol>
<li><em>returns ()</em> : What the function returns. Noticing the <em>memory</em> keyword? This is for reference type parameter in Solidity.</li>
</ol>
<p>What is a reference type? There are 2 ways we can pass an argument to a Solidity function:</p>
<blockquote>
<p>By value, which means that the Solidity compiler creates a new copy of the parameter's value and passes it to the function. This allows the function to modify the value without worrying that the value of the initial parameter gets changed.</p>
<p>By reference, which means that the function is called with a reference to the original variable. So, if it changes the value of the variable it receives, the value of the original variable gets changed too.</p>
</blockquote>
<h2 id="heading-how-can-we-test">✔️ How can we test?</h2>
<p>Ctrl + S to save and go to deploy menu in the left side bar. It will show some information about our contract. We don't need to set anything for now, so just click the deploy button. After it's done we can see that our Hello contract appears in the <em>deploy contracts</em> section. Click on the arrow on the left side of the contract's name and it will reveal the <em>greeting</em> button. Remix even creates this for us for easily testing!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1637600837778/Txvy1jA4F.jpeg" alt="Pasted_Image_22_11_2564_BE_23_41.jpg" /></p>
<p>Click on the button and... our work is done!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1637774531841/3tqxo3p_8.jpeg" alt="Pasted_Image_25_11_2564_BE_00_20.jpg" />
<img src="https://media.giphy.com/media/Nx0rz3jtxtEre/giphy.gif" alt="Hello there" /></p>
<p>But not so soon.</p>
<p>Function that return static responses wouldn't do. Let's mofidy the greeting function a bit...</p>
<pre><code> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">greetingWithName</span> (<span class="hljs-params"><span class="hljs-keyword">string</span> memory _name</span>) <span class="hljs-title">public</span> <span class="hljs-title">pure</span> <span class="hljs-title">returns</span> (<span class="hljs-params"><span class="hljs-keyword">string</span> memory</span>) </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">string</span>(abi.encodePacked(<span class="hljs-string">"Hello there"</span>, <span class="hljs-string">" "</span>, _name));
  }
</code></pre><p>Now we get the function that can accept a string as a parameter and returns it with the previous sentence. Save and deploy again and now we can 'hello there' to Obi-Wan as many times as we'd like.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1637774784059/IBSnoYO35.jpeg" alt="Pasted_Image_25_11_2564_BE_00_25.jpg" /></p>
<p><strong>Note</strong></p>
<ul>
<li><p>It is best practices that the parameter name is started with an underscore like _variableName, so it can easily distinguish the scope of the variables.</p>
</li>
<li><p><em>abi.encodePacked</em> is a function to append a string to another.</p>
</li>
</ul>
<hr />

<p>And that's it for now. Thanks for dropping by. Hope this help introduce some basic Solidity. The next article will be more in dept about states. Stay tuned!</p>
]]></content:encoded></item><item><title><![CDATA[The Pomodoro Technique 🍅: more focus, more productive]]></title><description><![CDATA[Are you struggling to be more productive? It’s a blessing when we get into the flow when we need to get some works done. But when our though keep shifting…]]></description><link>https://catcocode.hashnode.dev/the-pomodoro-technique-more-focus-more-productive</link><guid isPermaLink="true">https://catcocode.hashnode.dev/the-pomodoro-technique-more-focus-more-productive</guid><category><![CDATA[Productivity]]></category><category><![CDATA[workathome]]></category><dc:creator><![CDATA[Bynx Patrika]]></dc:creator><pubDate>Tue, 09 Nov 2021 08:16:45 GMT</pubDate><content:encoded><![CDATA[<p>Are you struggling to be more productive? It’s a blessing when we get into the flow when we need to get some works done. But when our though keep shifting to ‘what I’m going to eat for lunch?’ or ‘where will I go after work?’, we’re fucked.</p>
<p>Recently I have finished a course called  <a target="_blank" href="https://www.coursera.org/learn/mindshift">Mindshift: Break Through Obstacles to Learning and Discover Your Hidden Potential </a> on Coursera and there were something that interested me. It was The Pomodoro Technique.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636444959822/BFbzYsSnq.png" alt="image.png" />
source:  <a target="_blank" href="Link">https://shedoesitcoaching.com/wp-content/uploads/2018/11/Pomodoro-300x266.png</a> </p>
<p>Before I jump right into The Pomodoro, There is a few thing that should be explained.</p>
<p><strong>Thinking Modes</strong></p>
<p>Brains have two modes of operation: focused and diffuse. They work just like their names</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636445480450/zNrkg5zPL.png" alt="brain.png" /></p>
<p>Focused mode is what happens when you deeply concentrate on one thing, likes doing math problems. The brains try to understand, evaluate or memorize what you’re doing.
Diffuse mode is when you’re not really concentrate on anything. The though run randomly just like when you’re jogging and thinking about anything just to pass the time. This is when the brains find connection and overall of the big pictures.
Normally, focused mode is what you need when you work on something. But sadly the brains can’t stay in this mode for very long, you will find yourself scrolling through social media or immerse in Youtube instead.</p>
<blockquote>
<p>But lucky for us, the brains work best when they switch between the two modes.</p>
</blockquote>
<p>And that leads to The Pomodoro Technique.</p>
<p><strong>The Pomodoro Technique</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1636445201989/UPLelg7Xi.png" alt="image.png" />
source: https://project-management.com/wp-content/uploads/2019/04/What-is-Pomodoro-Technique-and-How-to-Utilize-it-to-Maximize-Productivity%EF%BB%BF-1024x538.jpg</p>
<p>Pomodoro technique is a time management method which aims to maximize productivity through focused sessions of work. It takes advantages of the above concept of the switching between focused and diffuse modes.</p>
<p><strong>How to apply?</strong></p>
<p>Using this technique, first you decide what task need to be done, then you set the timer to 25 minutes and start to work. The 25 minutes of work is called Pomodoro session. In this session you have to really concentrate on the task at hand, absolutely no Facebook and Instagram. After each sessions you take a break for 5 minutes. This will change the brain’s thinking mode from focused to diffuse. In this 5 minutes you can do anything that not related to work likes take a short walk, go buy a cup of coffee. And after 3 – 4 Pomodoro sessions you can take a longer break.</p>
<p><strong>How can it helps?</strong></p>
<ol>
<li><p>Focus
Pomodoro technique helps improve productivity by improving focus on the task at hand. As each of the sessions is planned about what to do and planned breaks improve self-discipline and make you concentrate on the given task. You can adjust how long each session is, it doesn’t have to always be 25 minutes, depending on your work styles.</p>
</li>
<li><p>Less Distractions
As to maximize the productivity of each sessions, you should keep your phone away if possible. But really you just have to control yourself.</p>
</li>
<li><p>Refreshing
When you take a break your brain also take a break too. It enters diffuse mode and helps you to understand the overall pictures. It likes when you’re stuck at a problem for some time, you really focus but can’t solve it. And after you stop and not really thinking hard about the problem, it suddenly come to mind.</p>
</li>
</ol>
<p>And that all about Pomodoro. There might be other techniques that works well too, but for me this is sure worth a try.</p>
]]></content:encoded></item></channel></rss>