<?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 Declan Nnadozie on Medium]]></title>
        <description><![CDATA[Stories by Declan Nnadozie on Medium]]></description>
        <link>https://medium.com/@declannnadozie?source=rss-19a5c2156b4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gswBSuIJblD2XRJZ.</url>
            <title>Stories by Declan Nnadozie on Medium</title>
            <link>https://medium.com/@declannnadozie?source=rss-19a5c2156b4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:38:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@declannnadozie/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[How to Programmatically Topup ICP Canister -Part 1]]></title>
            <link>https://medium.com/@declannnadozie/how-to-programmatically-topup-icp-canister-part-1-76412efc9b60?source=rss-19a5c2156b4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/76412efc9b60</guid>
            <dc:creator><![CDATA[Declan Nnadozie]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 23:36:23 GMT</pubDate>
            <atom:updated>2024-07-20T23:36:23.370Z</atom:updated>
            <content:encoded><![CDATA[<p>There are times in your business logic, where you would love your canister to automatically topup itself, maybe use some of its profits, in exchange for cycles. In this blog will show you how to do that.</p><p><a href="https://www.declannadozie.dev/articles/how-to-programmatically-topup-icp-canister">https://www.declannadozie.dev/articles/how-to-programmatically-topup-icp-canister</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76412efc9b60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Write Elixir Modules on Ejabberd]]></title>
            <link>https://medium.com/@declannnadozie/how-to-write-elixir-modules-on-ejabberd-288dbfe0b582?source=rss-19a5c2156b4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/288dbfe0b582</guid>
            <category><![CDATA[ejabberd]]></category>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Declan Nnadozie]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 01:22:01 GMT</pubDate>
            <atom:updated>2021-08-23T09:19:43.855Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oN-WFiGwffE4wR1IG_7iA.png" /></figure><p>You need a license to read this, and your license is to Understand Elixir</p><p>Check my first part, how i compiled ejabberd with elixir <a href="https://medium.com/@declannnadozie/start-elixir-module-development-in-ejabberd-in-linux-1802bca373c4">here</a></p><p>In your /lib folder you might see a file named mod_presence_demo.ex<br>you can create a new file &lt;mod_filename&gt;.ex or use the file above.</p><p>Your file must have these functions or look like these</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3678e4bbe6bcaebb87e57e7e7cc65472/href">https://medium.com/media/3678e4bbe6bcaebb87e57e7e7cc65472/href</a></iframe><p>Me: Should i explain what the functions mean?<br>Audience Minds: No!!!!<br>Me: check <a href="https://docs.ejabberd.im/developer/extending-ejabberd/modules/">here</a> if you want to know</p><p>In your start functions, is where you register your IQ handlers or Event handlers /Hooks. In our scope, i will show how to do IQ handlers, with custom namespace called “medium:reader”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62ea54eb40dd1d42f189dbe8752d3249/href">https://medium.com/media/62ea54eb40dd1d42f189dbe8752d3249/href</a></iframe><p>You have two choices of the first argument in add_iq_handler, its either :ejabberd_sm(used when IQ is directed to a user) or :ejabberd_local(used when the IQ is directed to the server itself). The Last argument is the name of the function that will handle IQ requests of your .</p><p>Lets Add one more function. This functions decodes element and returns it, but because we dont know what to do with it, we just return it.(I advise to do so). Check <a href="https://stackoverflow.com/a/57640311/8587899">here</a> to understand why</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bedc3d9e3dc6084e86bc5e67dc9026fb/href">https://medium.com/media/bedc3d9e3dc6084e86bc5e67dc9026fb/href</a></iframe><p>Then we finally declare a function that handle things.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3de89d5075f7152165f3dce2d8d470c/href">https://medium.com/media/b3de89d5075f7152165f3dce2d8d470c/href</a></iframe><p>But remember iq_stanza is a record in Erlang world. record is equivalent to class in java/c#/c++ or struct in C/C#. Record is not a fundamental type in Elixir, so Elixir sees it as a Tuple. until you require the Record module, that makes Elixir see it as Record. Check <a href="https://hexdocs.pm/elixir/Record.html">here</a> to know about Record module.</p><p>At the beginning of the module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db457c8f56d623474272da596c625d86/href">https://medium.com/media/db457c8f56d623474272da596c625d86/href</a></iframe><p>The Handler function must return :ignore atom or a iq response.<br>NB: IQ response / return value must have the “to” attribute value be the user it intends to send to. <br>People make mistake of writing this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5feaae81333d735b0bc221fc563ab147/href">https://medium.com/media/5feaae81333d735b0bc221fc563ab147/href</a></iframe><p>So lets return response. remember we created a record called iq from deps/xmpp/include/xmpp_codec.hrl. You can see i made the “to” the Jid of the “from”(sender)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9c7da74832e11b76d7cbb3bef4913e5/href">https://medium.com/media/e9c7da74832e11b76d7cbb3bef4913e5/href</a></iframe><p>Finally to close the post</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff3f62afedd9844d971393e31e5d1f8f/href">https://medium.com/media/ff3f62afedd9844d971393e31e5d1f8f/href</a></iframe><p>You should have an idea whats going on above.</p><p><strong>TL;DR</strong> Here’s what your final file looks like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/235f88d315e76cdba9306e69aa6f91d1/href">https://medium.com/media/235f88d315e76cdba9306e69aa6f91d1/href</a></iframe><p>If this solved the mysteries of Ejabberd Module Development. Give me a 👏</p><p>Am open for hiring in Javascript, Kotlin(Android) and Ejabberd</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=288dbfe0b582" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start Elixir Module Development in Ejabberd in Linux]]></title>
            <link>https://medium.com/@declannnadozie/start-elixir-module-development-in-ejabberd-in-linux-1802bca373c4?source=rss-19a5c2156b4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1802bca373c4</guid>
            <category><![CDATA[ejabberd]]></category>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Declan Nnadozie]]></dc:creator>
            <pubDate>Sat, 17 Aug 2019 21:30:02 GMT</pubDate>
            <atom:updated>2019-08-18T00:00:22.122Z</atom:updated>
            <content:encoded><![CDATA[<p>I wont lie, i took me 3 days to really understand what the docs is saying.</p><p>step 1. Clone the repo</p><pre>git clone <a href="https://github.com/processone/ejabberd.git">https://github.com/processone/ejabberd.git</a></pre><p>Make sure you have these dependencies (In fact create a check list)</p><ul><li>GNU Make</li><li>GCC</li><li>Libexpat 1.95 or higher</li><li>Libyaml 0.1.4 or higher(sudo apt-get libyaml-dev)</li><li>Erlang/OTP 19.1 or higher. We recommend using Erlang OTP 21.2.</li><li>OpenSSL 1.0.0 or higher, for STARTTLS, SASL and SSL encryption.(sudo apt-get libssl-dev)</li><li>Zlib 1.2.3 or higher, for Stream Compression support (<a href="http://xmpp.org/extensions/xep-0138.html">XEP-0138</a>). Optional.</li><li>And Elixir(make sure you have it installed)</li></ul><p>Step What again?(Whatever)</p><pre>cd ejabberd/<br>mix deps.get<br>mix compile</pre><p>Make sure you have internet connection</p><p>NB. you might see error, like No such file or directory e.g gd.h not found,</p><p>it means it could not find lib&lt;name of file&gt;, is not installed on your system</p><p>Do</p><pre>sudo apt-get lib&lt;name of file&gt;-dev. In our case sudo apt-get libgd-dev</pre><p>type in your console,(mix will continue from where the previous error stopped)</p><pre>mix compile (again)</pre><p>Why do this, so you wont have the pain of searching for explanations, wasting network time… Just give me a clap if it really helped you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1802bca373c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging C++ Node Addon in VScode]]></title>
            <link>https://medium.com/@declannnadozie/debugging-c-node-addon-in-vscode-d9c2e8a2362b?source=rss-19a5c2156b4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9c2e8a2362b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[addons]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Declan Nnadozie]]></dc:creator>
            <pubDate>Fri, 24 May 2019 00:53:45 GMT</pubDate>
            <atom:updated>2019-05-24T00:53:45.794Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fimgur.com%2FYOuLZdC&amp;src=https%3A%2F%2Fimgur.com%2FYOuLZdC%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=imgur" width="900" height="869" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cc4b30924b9076d82c2897899f4b161/href">https://medium.com/media/7cc4b30924b9076d82c2897899f4b161/href</a></iframe><p>You, have finally activated your Brotherhood of steel Vscode… about to debug some irradiated bugs in Node addon…. How do you do that?</p><h3>Prerequisites</h3><pre>vscode_cpp extension....<br>gcc (all linux distro have gcc)</pre><p>let your script property in your package.json of the Addon Development Folder… be like this</p><pre>&quot;scripts&quot;: {</pre><pre>&quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,</pre><pre>&quot;rebuild:dev&quot;: &quot;node-gyp -j 16 rebuild --debug&quot;,</pre><pre>&quot;build:dev&quot;: &quot;node-gyp -j 16 build --debug&quot;,</pre><pre>&quot;clean&quot;: &quot;node-gyp clean&quot;,</pre><pre>&quot;build&quot;: &quot;node-gyp -j 16 build&quot;,</pre><pre>&quot;rebuild&quot;: &quot;node-gyp -j 16 rebuild&quot;</pre><pre>},</pre><p>create launch.json in your .vscode, add these</p><pre>{</pre><pre><em>// Use IntelliSense to learn about possible attributes.</em></pre><pre><em>// Hover to view descriptions of existing attributes.</em></pre><pre><em>// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387</em></pre><pre>&quot;version&quot;: &quot;0.2.0&quot;,</pre><pre>&quot;configurations&quot;: [</pre><pre>{</pre><pre>&quot;type&quot;: &quot;cppdbg&quot;,</pre><pre>&quot;request&quot;: &quot;launch&quot;,</pre><pre>&quot;name&quot;: &quot;Debug&quot;,</pre><pre>&quot;preLaunchTask&quot;: &quot;npm: build:dev&quot;,</pre><pre>&quot;program&quot;: &quot;<em>path_to_node_runtime</em>&quot;,</pre><pre>&quot;args&quot;: [&quot;<em>name_of_js_file_that_will_run_your_addon</em>.js&quot;],</pre><pre>&quot;cwd&quot;: &quot;${workspaceFolder}/&quot;</pre><pre>}</pre><pre>]</pre><pre>}</pre><p>in your js file</p><pre>const addon = require(&quot;build/Debug/name_of_your_addone.node&quot;)</pre><p>Now place you break points</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYW3EI8G79jiS7CjMB98Ow.png" /></figure><p>click the play button at the debug sections…… Thank You(Gimme a clap, if it really helped you)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9c2e8a2362b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create A Splash Screen in Android With Kotlin Coroutines and Fragment]]></title>
            <link>https://medium.com/@declannnadozie/create-a-splash-screen-in-android-with-kotlin-coroutines-and-fragment-da27fb1a946a?source=rss-19a5c2156b4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/da27fb1a946a</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[fragments]]></category>
            <category><![CDATA[coroutine]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Declan Nnadozie]]></dc:creator>
            <pubDate>Mon, 10 Dec 2018 14:12:45 GMT</pubDate>
            <atom:updated>2019-03-31T00:57:02.261Z</atom:updated>
            <content:encoded><![CDATA[<p>Create A Splash Screen in Android With Kotlin Coroutines and Fragment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3gaCbyMBpffEs_jD" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I know there are so many tutorials on creating splash screen on Android(java).</p><p>But here i will show you, how to do that magic with Kotlin and Coroutines in Fragments. Fun huh?</p><p>Lets Go</p><pre>class SplashFragment : Fragment(), CoroutineScope{<br>    override val coroutineContext: CoroutineContext<br>        get() = Dispatchers.Main + <em>Job</em>()<br>    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {<br>        return inflater.inflate(R.layout.<em>splash_fragment</em>, container, false)<br>    }<br><br>    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {<br>        <em>launch </em><strong>{<br>            </strong><em>delay</em>(3000)<br>            <em>withContext</em>(Dispatchers.Main)<strong>{<br>                </strong>(<em>activity </em>as MainActivity).movetoNext()<br>            <strong>}<br>        }<br>    </strong>}<br>}</pre><p>CoroutineScope is an interface for Creating A multi-threading(coroutine) handler. it like “Yo your CIA handler(CoroutineScope) is SplashScreen, so all agents(coroutines) should answer to this guy (SplashScreen).</p><p>Dispatchers.Main is telling Kotlin, this Scope runs on the Main thread, which is the UI thread, check <a href="https://kotlinlang.org/docs/reference/coroutines-overview.html">here</a> for more details.</p><p>In the onViewCreated method, you created a coroutine/job/a mission which will delay itself for 3000 milliseconds, and go back to the Main thread, then call the next function.</p><p>Note: while a job/coroutine is created the Main Thread still continue where its going(like a bomber, drop a bomb and keep on going). When the job is completed, it reports back to the Main thread with through this function <em>withContext</em>(Dispatchers.Main).</p><p>moveToNext() function is just a custom function i made to call the MainActivity, that splashScreen is Done.</p><p>Thank you for reading. Gimme a clap, if it helped you :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da27fb1a946a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>