<?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 jimmco on Medium]]></title>
        <description><![CDATA[Stories by jimmco on Medium]]></description>
        <link>https://medium.com/@jimmco?source=rss-228af9acc80a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by jimmco on Medium</title>
            <link>https://medium.com/@jimmco?source=rss-228af9acc80a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 07 May 2026 19:01:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jimmco/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[Solana series — #2 Wallets]]></title>
            <link>https://jimmco.medium.com/solana-series-2-wallets-11dbded1ce14?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/11dbded1ce14</guid>
            <category><![CDATA[solana-network]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[wallet]]></category>
            <category><![CDATA[blokchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 22:32:28 GMT</pubDate>
            <atom:updated>2021-02-26T07:05:54.648Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solana 2021 series — #2 Wallets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*AauVkzxHZYdgn389-v6MPw.png" /></figure><p>In the <a href="https://jimmco.medium.com/solana-series-1-the-smart-contract-platform-highway-introduction-2e8de38b3ef6">first episode of this series</a>, I gave you some overview about Solana Project. Now, I will take you on a tour around Solana wallets because it’s the first thing you will interact with on Solana (or any other network). Note that it will be only brief summary (mainly for newcomers) so you have some basic idea what options are there.</p><h3>SOL Wallets basic categories</h3><ul><li>CLI — Solana Tools</li><li>Web -SolFlare, Sollet, MathWallet</li><li>Chrome Extension — Solong</li><li>Mobile — Trust Wallet, Coin87</li><li>HW — Leger S/X</li><li>Desktop/Mobile — Exodus</li><li>…</li></ul><h3>Wallet list</h3><h3>Solana CLI tools wallet</h3><p><a href="https://docs.solana.com/cli/install-solana-cli-tools">docs.solana.com/wallet-guide/cli</a></p><p>Core Solana command-line wallet. You interact directly with Solana network without any GUI in between. Most powerful option out there!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*VdthDbpjPik1eEDX6Gf2hA.png" /></figure><p>Pros: Complete functionality (wallet control, staking, …)</p><p>Cons: requires at least basic tech skills, not as user friendly as GUI wallets</p><h3>Solong</h3><p>solongwallet.com</p><p>Pros: Metamask-like browser extension, decent amount of functions</p><p>Cons: Missing some functionality (like no staking features yet)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*05UmluhAss9-bG8EUbQqeA.png" /></figure><h3>Sollet</h3><p>sollet.io</p><p>Pros: Open source, good functionality (tokens, …),</p><p>Cons: No staking functionality yet, very basic GUI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*9hvmNDFqL7bLVl3XuG29MA.png" /></figure><h3>Solflare</h3><p><a href="https://solflare.com/access-wallet">solflare.com</a></p><p>Pros: Nice, feature rich (tokens, staking)</p><p>Cons: Not open source yet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_T1XXFdc2LkWlXn4" /></figure><h3>Exodus</h3><p>exodus.com</p><p>Pros: Multi-chain, multi-coin, nice UI</p><p>Cons: Only send-and-receive SOL, DEX disabled for SOL (temporarily I guess)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*18FDi2XGaDZVpk8c.png" /></figure><h3>Math Wallet</h3><p><a href="https://mathwallet.org/en-us/">https://mathwallet.org/en-us/</a></p><p>Pros: Multiwallet — multiple networks supported, iOS, Android, Chrome extension, Web wallet</p><p>Cons: Basic SOL functions only</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*WfsB9rDC5a8yfLJcJBhcCQ.png" /></figure><h3>Crypto.com</h3><p><a href="https://crypto.com/en/index.html">crypto.com/en</a></p><p>Pros: Multi-coin wallet, mobile-only</p><p>Cons: Basic SOL functions only, SOL withdrawals not available (last time I checked)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*I9BnXwKMdEXR8Y42x-TEcQ.png" /></figure><h3>Coin98</h3><p><a href="https://coin98.app/">coin98.app</a></p><p>Pros: multi-chain wallet</p><p>Cons: Basic SOL functions only, mobile-only</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*hkflmiFIjEYCm-c_XJrwSA.png" /></figure><h3>Trust Wallet</h3><p>Pros: multi-chain wallet</p><p>Cons: Basic SOL functions only, mobile only</p><p><a href="https://trustwallet.com/">https://trustwallet.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*Z3minuac3vUmlhKhDtz2cg.png" /></figure><h3>Bonfida</h3><p><a href="https://bonfida.com/">https://bonfida.com/</a>wallet</p><p>Pros: ERC20 tokens support</p><p>Const: not all SOL functions (staking)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*K8cof3Utc-IeotJAXNulJQ.png" /></figure><h4>Swipe</h4><p><a href="https://www.swipe.io/">www.swipe.io</a></p><p>Pros: multi-chain wallet</p><p>Cons: Basic SOL functions only, mobile-only</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*Mr27AV0ZZR-CeQbhON6hZw.png" /></figure><h4>P2P Wallet</h4><p><a href="https://p2p-org.github.io/p2p-wallet-web/#/">p2p-org.github.io/p2p-wallet-web/#/</a></p><p>Pros: good integration with others</p><p>Cons: limited-functions for SOL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*GIEdBQl0DZ9bvNdPNPPR5Q.png" /></figure><h4>Leger wallet</h4><p><a href="https://www.ledger.com/">www.ledger.com</a></p><p>Pros: hardware+software wallet, HW wallet also supported in multiple other wallets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*RQxYtxrvomyanx-3zd13oQ.png" /></figure><h3>Conclusion</h3><p>Well, which one then? It really depends on your needs and preferences. Do you just need to send and receive SOL? Or do you want to stake SOL, or trade tokens on Solana Dexes, Serum, deposit ETC20 tokens, etc? Do you have tech skills?</p><p>Can I make any recommendation at all? Yes, I can definitely recommend Ledger Hardware Wallet (not for free, sorry) because it will give you extra layer of security usable in most wallets mentioned and you will use it for your Bitcoins and other crypto as well. There is bad news for Trezor HW wallet users, Solana doesn’t support Trezor yet but I’m pretty sure it will not take a long time and even Trezor will be supported soon.</p><p>Otherwise, there are some suggestions based on category you are in. Some wallets are open source, some are not. Also note that several wallets (mostly multi-chain wallets) are centralized and custodial, so you don’t own your crypto but just IOUs (crypto.com, etc).</p><ul><li>Tech skills &amp; security -&gt; CLI wallet</li><li>If you like Metamask -&gt; Solong</li><li>Token maniacs -&gt; Sollet</li><li>Aesthetics, features, staking -&gt; Solflare</li><li>Basic features and multiple coins -&gt; any multi-chain wallet</li></ul><p>It’s worth saying that most Solana wallets don’t have the polished quality of Ethereum or BSC wallets yet in general. It’s only showing that we here still quite early, which is good. It doesn’t mean these wallet are unusable, they are pretty decent (some less, others more), they are just not yet perfect.</p><p>What do YOU think about Solana wallets? And which one do you prefer and why? Please share you experience with us.</p><p>Do you want to support this series with some spare SOL? If so, thank you! 7N7XTh4QmuUm6PhpSApegRKnUAYWk83FLUmzs3ygLzNv</p><p>See you next time &amp; blessings!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11dbded1ce14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solana series — #1 Introduction]]></title>
            <link>https://jimmco.medium.com/solana-series-1-the-smart-contract-platform-highway-introduction-2e8de38b3ef6?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e8de38b3ef6</guid>
            <category><![CDATA[solana-network]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 16:16:23 GMT</pubDate>
            <atom:updated>2021-03-10T11:36:26.707Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solana series — #1 Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*zoLb-0Is-kmiHce4-KKh1w.png" /></figure><p>Welcome! Do you want to learn something about Solana project before summer comes? If so, then you’re on the right place.</p><p><a href="https://solana.com/">Web3 Infrastructure for Everyone</a></p><p>Solana is relatively new scalable hi-performance L1 smart contract block-chain built on very robust, reasonable, sober and rational premise.</p><p>Most blockchains are fighting to bring the best solution for the well known trilemma — decentralization, scalability, security. I would say it’s actually quadlemma — decentralization, scalability, security and composability.</p><p>Most of the other blockchains do pretty well either one or two areas but rarely any of them can perform well across all these aspects. Solana might be one of those exceptions and probably one of the best candidate to take over or share Ethereum’s crown and I will tell you why.</p><h4>What is the big deal?</h4><p>I guess you know Ethereum and you also know why it’s currently pretty expensive to buy few hundreds USD tokens or less on it. Most of us have the same experience. Ethereum is being eaten by its popularity and limited scalability (15TPS) . If you don’t invest $10k or more, it’s basically NO-GO zone. Known issue and not good situation. Even the new fee EIP1559 proposal will not really solve it and Ethereum 2.0 completion is quite far and it will not be easy for developers to implement it right anyway.</p><p>One of alternatives, like Binance Smart Chain (BSC) is much better these days but it’s basically ETH PoSA clone doesn’t solve the scalability issue (~50% of its capacity is already eaten) and it’s semi-centralized with only several validators so it’s CeDe solution.</p><h4>Alternatives</h4><p>Solana Ecosystem might not yet as great as Ethereum’s or BSC’s but it’s improving fast so it’s the best time to jump onboard, I assume. Cardano or Polkadot, next challengers, are under big hype and although these project are led by great persons and teams, Cardano smart contracts are not yet ready (probably soon) and Polkadot side-chain architecture is not as composable as Solana’s which might be a huge cons. Also Solana has much better entry price that those two which is also important factor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*CiMRbCSwYublmvb6" /></figure><p>Even more importantly, there is also no sharding (compared to Ethereum 2.0 for example) or side-chains or sub-networks (as on Polkadot or Avalanche) on Solana and therefore transactions are replicated across all the the nodes and it provides simple reasoning about state of our apps within the network.</p><h4>Sharding or not</h4><p>Also because of that, Solana provides the best possible composability as great as Ethereum 1.0 which should be preferred by developers in general as it supports the “Lego effect” without any obstacles. Sharding with good composability is difficult technical problem and as far as I know, only Radix DLT made it right so far.</p><p>Even if you have perfect sharding, for many cases it’s just better to know that every node in the network holds complete history. For some applications, sharding can be completely acceptable or even better because it can scale almost limitless, but for some other it might not be the best. In general, more critical application is, less sharding is appreciated. I think both sharded and non-sharded networks will be useful for certain type of applications.</p><p>And what is the Solana recipe for success? Technical skills, rational approach, well-thought architecture, strong hardware and optimized software. All this made by pretty qualified team. Now, let’s take a look at Solana basic properties.</p><h4>Technical specification</h4><ul><li>TPS: <strong>50,000</strong> (scales with better hardware and networking up to 700,000 TPS)</li><li>Decentralization: 658 global validators</li><li>Block time: <strong>~400ms</strong></li><li>Average fee per transaction: <strong>$0.00001</strong></li><li>Consensus: <strong>Proof of History (PoH)</strong></li><li>Block propagation: Turbine protocol</li><li>Transaction forwarding: Gulf Stream protocol</li><li>Parallel smart contract runtime Sealevel</li><li>Validation optimization: Pipelining</li><li>Horizontally-scaled account database Cloudbreak</li><li>Distributed leger store Archivers</li><li>Smart contract: YES <strong>(Rust, C, C++ and Solidity layer coming)</strong></li><li>No sharding</li><li>True composability</li></ul><h4><strong>Solana Token</strong></h4><p>As any other blockchain network, Solana has its own token called, surprisingly, Solana aka SOL.</p><ul><li>Unit: 1 SOL</li><li>1 Lamport = 0.000000001 SOL (named after computer scientist Leslie Lamport)</li><li>Total supply: ~ <strong>489 million SOL</strong></li><li>Circulating supply: ~ 264 million SOL</li><li>Current price: $16 (2021–10 -25)</li><li>Market cap: $4B</li><li>Fully Diluted market cap: $8B</li><li>Circulation / Total ratio: ~54%</li></ul><p>Where to Buy Solana token? Binance or FTX are probably the best places to buy SOL tokens right now.</p><h4>Incentives to hold and use SOL</h4><p>There are plenty incentives why to jump into and hold SOL tokens (no investment advice, though)</p><ul><li>Lots of new projects rising (DeFi and others) are being built on Solana</li><li>Many projects from Ethereum are migrating (or expanding) to Solana</li><li>Great smart contract chain (fast and very low fees aka fragment of USD cent, even way lower than on BSC)</li><li>SOL staking (you can delegate whatever SOL you have to Solana validators) and receive stake reward</li><li>Good entry price so far (compared to ADA, DOT, ETH, …)</li><li>Already some key applications (Serum, etc.)</li><li>Strong team and personalities behind Solana (Anatoy Yakovenko — Solana founder and also Sam Bankman-Fried (SBF)- FTX and Serum founder)</li><li>Future potential in general is pretty huge IMO</li></ul><h4>KISKIS</h4><p>How to keep my SOL tokens safe? There are multiple wallets beyond CLI wallet and we will take a look at it in detail in next episodes, for now just see the list below. Note right now only <strong>Leger Hardware Wallets</strong> (S and X) already support Solana so you can keep your private keys really safe.</p><h4>SOL Wallets</h4><ul><li>CLI — Solana Tools</li><li>Web -SolFlare, Sollet, MathWallet</li><li>Chrome Extension — Solong</li><li>Mobile — Trust Wallet, Coin87</li><li>HW — Leger S/X</li><li>Desktop/Mobile — Exodus</li></ul><p><strong>Smart contracts</strong></p><p>Smart contract on Solana can be written with robust programming language Rust (and C, C++ and Move) and for easier adoption by the Ethereum smart contract developers, there will be Solidity support very soon (according to some unconfirmed rumors). We will dive into this area in coming episodes.</p><h4>Conclusion</h4><p>If you should remember something about Solana, you should remember this:</p><ol><li><strong>✅ Solana DOES scale</strong></li><li><strong>✅ Solana IS composable</strong></li><li><strong>✅ Solana IS decentralized</strong></li><li><strong>✅ Robust, secure and fast platform with very low fees</strong></li><li><strong>✅ Growing ecosystem getting momentum</strong></li></ol><p><strong>In one sentence, Solana is ready for the future!</strong> I hope at least I made you more curious about Solana Project and we will definitely dive deeper in next episodes (where we will talk about Solana staking, smart contracts, tools, etc.). For now you can join one of Solana social channels (Telegram, Discord, … see the links below). Or you can try to break Solana :D (<a href="https://break.solana.com/">https://break.solana.com/</a>)</p><p>How about some cons? I already mentioned some and there are few more:</p><ul><li>ecosystem not as mature and polished as on Ethereum or BSC</li><li>no Solidity support yet for easy migration of Ethereum smart contracts</li><li>no Trezor or other HW wallets support (except Ledger)</li></ul><p><em>Disclosure: SOL is part of my crypto portfolio</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*EMkuGXZsVFqN6NExoGldYA.png" /></figure><p>Ok, that’s all for today and see you next time. Blessings!</p><h4>Support</h4><p>In case you want to support this series (and try Solana Network at the same time), feel free to contribute any amount of SOL (yes, even one cent micro-transactions are possible and welcome (+about $0.00001 fee) to the SOL address below.</p><p><em>7N7XTh4QmuUm6PhpSApegRKnUAYWk83FLUmzs3ygLzN</em></p><h4>Major Solana Resources</h4><p>[1] Web site — <a href="https://solana.com/">https://solana.com/</a></p><p>[2] Whitepaper — <a href="https://solana.io/solana-whitepaper.pdf">https://solana.io/solana-whitepaper.pdf</a></p><p>[3] Medium — <a href="https://medium.com/solana-labs">https://medium.com/solana-labs</a></p><p>[4] Forum - <a href="https://forums.solana.com/">https://forums.solana.com/</a></p><p>[5] Explorer — <a href="https://explorer.solana.com/">https://explorer.solana.com/</a></p><p>[6] Beach — <a href="https://solanabeach.io/">https://solanabeach.io/</a></p><p>[7] Reddit — <a href="https://reddit.com/r/solana">https://reddit.com/r/solana</a></p><p>[8] Telegram — <a href="https://t.me/solanaio">https://t.me/solanaio</a></p><p>[9] Discord — <a href="https://discordapp.com/invite/pquxPsq">https://discordapp.com/invite/pquxPsq</a></p><p>[10] Docs — <a href="https://docs.solana.com/">https://docs.solana.com/</a></p><p>[11] Github — <a href="https://github.com/solana-labs">https://github.com/solana-labs</a></p><p>[12] Congecko — <a href="https://www.coingecko.com/en/coins/solana">https://www.coingecko.com/en/coins/solana</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e8de38b3ef6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web apps with Flutter on Ubuntu (2020)]]></title>
            <link>https://jimmco.medium.com/web-apps-with-flutter-on-ubuntu-2020-19796762d343?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/19796762d343</guid>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 10:12:10 GMT</pubDate>
            <atom:updated>2020-11-26T10:14:28.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings everyone! Today (26th of Nov 2020) we will go through major steps to have Flutter Web Development ready-to-work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hBm48IEO940T9Kqj" /></figure><p>Why Flutter you may ask? There are many reasons, I advice to search for other articles referring this. But in short, Flutter is modern, popular, widely used framework — <em>“Write once -&gt; have native app everywhere — mobile (Android, iOS), </em><strong><em>web</em></strong><em>, desktop (Windows, macOS, Linux)”.</em></p><p>Flutter is made by Google engineers and although Google and some other Alphabet’s companies do some pretty bad stuff these days (censorship, search results manipulation, freedom restrictions, re-captcha, etc.), they still produce and maintain many pretty good policy-agnostic technologies that many developers like and use.</p><p>Note that this article works for Ubuntu 20.04 and compatible (and yeah, you will need several gigabytes of free space, at least 10 GB but rather make it 20 GB or more). Official Flutter documentation is good but it will not help you to solve all the troubles on the way you might have on Linux. This article will ease your burden little bit more. Ok, let’s open terminal and start.</p><h4>STEP 0 — Install OpenJDK 14</h4><p>You can use Oracle JDK as well and possibly other Java versions but OpenJDK 14 works just fine.</p><pre>apt install openjdk14-jdk</pre><p>Check Java version on path</p><pre>java --version<br>&gt; openjdk version &quot;14.0.2&quot; 2020-07-14<br>&gt; OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)<br>&gt; OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)</pre><p>Now define JAVA_HOME variable in ~/.profile file</p><pre>export JAVA_HOME=/usr/lib/jvm/java-14-openjdk-amd64/</pre><p>And execute .profile inside your current shell</p><pre>source ~/.profile</pre><h4>STEP 1 — Install Flutter</h4><p><a href="https://flutter.dev/docs/get-started/install/linux">Linux install</a></p><p>At the time of writing this article we have flutter 1.22.4 stable version available. Unpack it into your chosen directory &lt;INSTALL_PATH&gt;</p><pre>mkdir &lt;INSTALL_PATH&gt;<br>cd &lt;DOWNLOADS_DIR&gt;<br>tar xvf flutter_linux_1.22.4-stable.tar.xz -C &lt;INSTALL_PATH&gt;</pre><p>Add export path to flutter</p><pre>export PATH=&quot;$PATH:&lt;INSTALL_PATH&gt;/flutter/bin&quot;</pre><h4>STEP 2 — Install Android Studio</h4><p>Download Android Studio (current version 4.1.1)</p><p><a href="https://developer.android.com/studio">Download Android Studio &amp; App Tools - Android Developers</a></p><pre>tar xvf android-studio-ide-201.6953283-linux.tar.gz -C &lt;INSTALL_PATH&gt;</pre><p>Now run the Android Studio and install Standard Dependencies as offered.</p><pre>cd &lt;INSTALL_PATH&gt;/android-studio/bin<br>./studio.sh</pre><p>Choose <strong>Standard</strong> setup and let everything be installed.</p><h4><strong>STEP 3 — Install Android SDK Command-Line Tools</strong></h4><p>We need this add “Android SDK Command-line Tools” to run successfully certain commands needed for flutter otherwise you will meet lot of weird errors.</p><p>In Android Studio</p><ol><li>Open <strong>Tools</strong> &gt; <strong>SDK Manager</strong></li><li>From the left choose, <strong>Appearance &amp; Behavior</strong> &gt; <strong>System Settings</strong> &gt; <strong>Android SDK</strong></li><li>Select <strong>SDK Tools</strong> from the top menu</li><li>Check <strong>Android SDK Command-line tools</strong> and click ‘apply’ to install.</li></ol><h4>STEP 4 — Install Flutter and Dart plugin in Android Studio</h4><p>If you want to use Android Studio as you Flutter IDE, then it’s good to install Flutter and Dart plugins.</p><ul><li>File -&gt; Settings</li><li>Plugins, type “Flutter” to search the plug-in.</li><li>Click “Install”</li></ul><p>Flutter and Dart (you should be asked) plugins will be installed. IDE restart is needed after that.</p><h4>STEP 5— Accept flutter license</h4><p>Make Flutter licenses accepted with this command, confirm with ‘y’ whenever asked.</p><pre>flutter doctor --android-licenses</pre><h4>STEP 6— Set path to Android studio</h4><p>Now we need to tell Flutter where Android Studio is.</p><pre>flutter config — android-studio-dir=&lt;INSTALL_PATH&gt;/android-studio</pre><h4>STEP 7—Precache flutter</h4><p>Populates the Flutter tool’s cache of binary artifacts.</p><pre>flutter precache --verbose</pre><h4>STEP 8— Enable Flutter web support</h4><p>To enable web support we need to switch to channel beta as stable channel doesn’t support web development for now.</p><pre>flutter channel beta</pre><p>Make sure you’re on the latest build by running upgrade command</p><pre>flutter upgrade</pre><p>Now run precache again to populate flutter binary artifacts.</p><pre>flutter precache</pre><p>Now it’s time to enable web support</p><pre>flutter config --enable-web</pre><p>We should see something like this</p><pre>Flutter is already up to date on channel beta<br>Flutter 1.24.0-10.2.pre • channel beta • <a href="https://github.com/flutter/flutter.git">https://github.com/flutter/flutter.git</a><br>Framework • revision 022b333a08 (8 days ago) • 2020-11-18 11:35:09 -0800<br>Engine • revision 07c1eed46b<br>Tools • Dart 2.12.0 (build 2.12.0-29.10.beta)</pre><h4>STEP 9— Create and run project</h4><p>Time to go into your &lt;PROJECT_FOLDER&gt;, folder where your Flutter projects will reside.</p><pre>cd &lt;PROJECTS_FOLDER&gt;<br>flutter create flutter_web_app<br>flutter run -d chrome</pre><p>Now we should see open browser and Flutter Web Application running in it.</p><p>In case you have existing app that doesn’t have web support you will need to run first this command within existing Flutter project.</p><pre>flutter create .</pre><p>This will create additional web folder with expected files like index.html, etc. This is not necessary for development but it’s needed for steps like building release web app.</p><p>When you are happy with your and and need to generate release build use ‘build web’ command. Your build will be found in build/web folder and can be deployed on various servers.</p><pre>flutter build web</pre><h4><strong>STEP 10— Check installation</strong></h4><p>This step is just to see how our Flutter is doing.</p><pre>flutter doctor</pre><p>You should see something similar to this except VS Code (for this check you need to install VS Code and Flutter plugin in it). Not necessary if you plan to use Android Studio or other non-vscode editor. But if you want to have all checks green or you want to use vscode , then install vscode flutter plugin in it and run flutter doctor again.</p><pre>[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on Linux, locale en_US.UTF-8)<br>[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)<br>[✓] Android Studio<br>[✓] VS Code (version 1.51.1)<br>[✓] Connected device (1 available)</pre><p>That’s all for today. Now you can develop web applications with Flutter with all the comfort Flutter and Android IDE with particular plugins provide. I wish you all your applications run flawlessly and are making this world little bit better and less annoying and troubling place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19796762d343" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PostgreSQL 12 on Ubuntu 20.04]]></title>
            <link>https://jimmco.medium.com/postgresql-12-on-ubuntu-20-04-a9ae002c6946?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9ae002c6946</guid>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Sat, 21 Nov 2020 11:35:11 GMT</pubDate>
            <atom:updated>2020-11-21T11:35:11.026Z</atom:updated>
            <content:encoded><![CDATA[<p>For backend of our services and applications we usually need some good storage for persistent data, usually some centralized database. PostgreSQL is good pick for many cases. Check other places to find out why it’s good choice, I will strictly go after making it working here with few more words in the end. There is already PostgreSQL version 13 but we will use version 12 for two major reasons:</p><ol><li>It’s packed with the Ubuntu 20.04 distribution</li><li>It’s already well tested and widely used</li></ol><p>As we operate on Ubuntu 20.04, let’s log in as root and do the ‘magic’ without unnecessary ‘sudo’ typing.</p><pre>su - root</pre><h3>STEP#1 — Install PostgreSQL</h3><pre>apt install postgresql postgresql-client</pre><ul><li>postgresql — server</li><li>postgresql — client to connect PostgreSQL server</li></ul><h3>STEP#2 — Check the service</h3><pre>systemctl status postgresql.service</pre><p>you should see something like this</p><pre>● postgresql.service - PostgreSQL RDBMS<br>     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)<br>     Active: active (exited) since Sat 2020-11-21 08:40:52 UTC; 4min 20s ago<br>    Process: 848 ExecStart=/bin/true (code=exited, status=0/SUCCESS)<br>   Main PID: 848 (code=exited, status=0/SUCCESS)</pre><pre>Nov 21 08:40:52 vm1 systemd[1]: Starting PostgreSQL RDBMS...<br>Nov 21 08:40:52 vm1 systemd[1]: Finished PostgreSQL RDBMS.</pre><h3>STEP#3 — Check server can stop and start properly</h3><p>It’s not necessary step but it would be good to know if service can restart without issues.</p><pre># stop the service<br>systemctl stop postgresql.service<br># check it stopped as expected<br>systemctl status postgresql.service</pre><pre># start the service<br>systemctl start postgresql.service# check it started as expected<br>systemctl status postgresql.service</pre><h3>STEP#4 — Check the executable we can use</h3><p>Let’s find out what we can use with using apt-file. Let’s install it and create indexes.</p><pre>apt install apt-file<br>apt-file update</pre><p>Now check the files. Note we need to check postgresql-client-12 package because postgresql-client is just a metapackage and will not help here.</p><pre>apt-file list postgresql-client-12</pre><p>We should see these utilities</p><ul><li>clusterdb — to recluster tables in PostgreSQL database</li><li>createdb — create new PostgreSQL database</li><li>createuser — define new PostgreSQL user account</li><li>dropdb — remove a PostgreSQL database</li><li>dropuser — remove a PostgreSQL user account</li><li>pg_basebackup — to make a base backup of a PostgreSQL cluster</li><li>pg_config — list exports related to PostgreSQL instance</li><li>pg_dump — extract a PostgreSQL db into a script or archive file</li><li>pg_dumpall — extract a PostgreSQL database cluster into a script file</li><li>pg_isready — check PostgreSQL connection status</li><li>pg_receivewal — stream PostgreSQL log</li><li>pg_recvlogical — control PostgreSQL logical decoding streams</li><li>pg_restore — restore PostgreSQL database from pg_dump archive</li><li><strong>psql — PosgreSQL interactive terminal</strong></li><li>reindexdb — reindex PostgreSQL database</li><li>vacuumdb — garbage collect and analyze PostgreSQL database</li></ul><p>We can check the status of PostgreSQL and if it is ready to accept connections.</p><h3>STEP#5 — Check if postgres user is created</h3><pre>cat /etc/passwd | grep postgres</pre><p>We should see something like</p><pre>postgres:x:112:118:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash</pre><p>This means we have postgres user created. Let’s set password for this user</p><pre>passwd postgres</pre><h3>STEP#6 — Connect to the database</h3><p>Let’s login as postgres user</p><pre>su -l postgres</pre><p>And now connect to PostgreSQL instance and open interactive terminal</p><pre>psql</pre><h3>STEP#7 —Check the client</h3><p>Let’s create new database called ‘medium_db’ to see if it is working as expected.</p><pre>create database medium_db;</pre><p>Now check if the database exists</p><pre>\l</pre><p>We should see something like this</p><pre>Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   <br>-----------+----------+----------+-------------+-------------+-----------------------<br><strong> medium_db | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | </strong><br> postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | <br> template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +<br>           |          |          |             |             | postgres=CTc/postgres<br> template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +<br>           |          |          |             |             | postgres=CTc/postgres<br>(4 rows)</pre><p>All looks good.</p><h3>STEP#8 — Set postgres DB user password</h3><pre>alter user postgres password &#39;what_acomplex_password^&amp;*&#39;;</pre><p>This is database user password, don’t confuse with postgres Linux user machine password.</p><p>Let’s leave psql now with this command</p><pre>\q</pre><h3>STEP#9 — Enable remote access</h3><p>We might need to work with the database remotely.</p><p>For that, we need to do some setting changes Let’s edit postgresql.conf accordingly. Switch to root account again and use vim.</p><pre>vim /etc/postgresql/12/main/postgresql.conf</pre><p>If you want to allow all IP addresses to remotely access your PostgreSQL instance, you can add this line into connection and authentication section.</p><pre>listen_addresses = &#39;*&#39;</pre><p>Also edit /etc/postgresql/12/main/pg_hba.conf which is settings for client authentication control and add line below to the end of the file</p><pre>host all all 0.0.0.0/0 md5</pre><p>Be aware this is not good practice as it increase security risk. You should limit remote access as much as possible and rather put list of allowed IP addresses if you need remote access. Also don’t use psql remotely if you don’t have to.</p><p>Now restart the server</p><pre>service postgresql restart</pre><p>Also make sure your firewall is not blocking default port 5432 or whatever your config states. If your firewall is inactive (which is by default) you are good.</p><pre>ufw status<br># if inactive you should see<br>Status: inactive</pre><p>If your ufw (Uncomplicated Firewall) is active and port 5432 is blocked you can simply execute this command under root</p><pre>ufw allow 5432</pre><h3>STEP#10 —Connect DB from remote machine</h3><p>Let’s find out DB machine IP address</p><pre>ip address | grep global</pre><p>We should see something like</p><pre>inet <strong>[IP]</strong>/24 brd [MASK] scope global dynamic enp1s0</pre><p>On remote machine install just postgresql-client</p><pre>apt install postgresql-client</pre><p>Now connect to the remote database</p><pre>psql -U postgres -p 5432 -h <strong>[IP]</strong> medium_db</pre><p>Input ‘ what_acomplex_password^&amp;*’ and you should see</p><pre>psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1))<br>SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)<br>Type &quot;help&quot; for help.</pre><pre>medium_db=#</pre><p>Now you can use your database remotely and even with remote psql client.</p><p>That’s basically is for this tutorial, now you have your database ready to be used. Databases are usually the most critical part of the IT infrastructure. Election results can give you good example how critical database data, settings and security around your database might be. Once your database data is compromised it is very hard to fix it and find out what happened. You might unfortunately not even notice that your data were compromised!</p><p>Also be sure that for some use cases, traditional centralized databases are not even the best/right approach. Again, collecting election results or handling financial operations over centralized database is poor approach. For highly critical data, transparent public block-chains or some other similar approaches can give you much more security, transparency and fraud protection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9ae002c6946" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s go virtual with KVM on Ubuntu]]></title>
            <link>https://jimmco.medium.com/lets-go-virtual-with-kvm-on-ubuntu-a76630618295?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a76630618295</guid>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Wed, 11 Nov 2020 11:22:47 GMT</pubDate>
            <atom:updated>2020-11-11T11:22:47.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*_AkchGo0XXwQ0qN9" /></figure><p>As developers and other IT guys, we need to have playground to build and play. We need clean playground. We need cheap playground. We need Virtual Machines.</p><p>Although I used VirtualBox from Sun, later from Oracle, why not to try KVM. KVM is Kernel Virtual Machine solution, it has friendly license, it’s very flexible and very fast. Cons is, KVM is maybe not as user friendly as VirtualBox but it’s pretty close. Also KVM is not the best for GUI demanding virtualization. But for most kind of servers, it’s great. KVM works the best on Linux, possibly even on Mac and not at all on Windows. Here, I’m using Ubuntu 20.04 based distribution (Desktop for host, Server for VM). Let’s do it in 7 very single steps. Open your console and we can start.</p><h4>Step 1 — Verify if your processor can make it</h4><pre>egrep -c &#39;(vmx|svm)&#39; /proc/cpuinfo</pre><p>0 — your CPU cannot make it, other number means hooray!</p><h4>Step 2 — Verify if your virtualization is enabled in BIOS</h4><p>Install cpu-checker utility and run kvm-ok to find out.</p><pre>apt install cpu-checker<br>kvm-ok</pre><p>If you see something like this, then you’re good.</p><pre>INFO: /dev/kvm exists<br>KVM acceleration can be used</pre><p>If you are not good, restart computer go in to BIOS and enable VM support (see you motherboard manual for specifics)</p><h4>Step 3— Install KVM</h4><pre>apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager</pre><p>Short information about these packages:</p><ul><li>qemu-kvm — fast processor emulator, compatibility wrapper for kvm</li><li>libvirt-daemon-system — cross-product C virtualization API, libvirt daemon configuration</li><li>libvirt-clients — API and libvirt shell virsh and other client binaries</li><li>bridge-utils — utils for creating Linux Ethernet bridge(s)</li><li>virt-manager — desktop application for managing virtual machines</li></ul><h4>Step 4— Add current user to libvirt and kvm group</h4><pre>sudo usermod -aG libvirt $LOGNAME<br>sudo usermod -aG kvm $LOGNAME</pre><h4>Step 5 — Check the installation</h4><pre>virsh -c qemu:///system list</pre><p>You should see empty list of virtual instances.</p><pre>Id   Name   State<br>--------------------</pre><h4>Step 6— Create VM from Ubuntu Server 20.04 ISO</h4><ul><li>Download Ubuntu Server ISO <a href="https://ubuntu.com/download/server">https://ubuntu.com/download/server</a></li><li>Open Virtual Machine Manager</li><li>Click “Create New Virtual Machine”</li><li>Forward</li><li>Choose ISO or CDROM install media: Add path to the downloaded Ubuntu ISO file</li><li>Next and repeat until Ubuntu Virtual Machine Starts</li><li>Install your Virtual Machine whatever way you like and restart it.</li><li>Run virsh the same way you did in previous step and you should see</li></ul><pre>Id   Name          State<br>-----------------------------<br> 1    ubuntu20.04   running</pre><p>If you see this, then everything works as expected. Congrats! Now you can use Virtual Machine however you want.</p><h4>Step 7— Adjust VM resources and settings</h4><p>If you need to boost your VM up or spare some resources, shut down your VM, open Virtual Machine Manager, select your VM with right mouse and click “Open”. Now you should see all the VM settings palette. Here you can change:</p><ul><li>VM name, OS information</li><li>Current and maximum CPU allocation</li><li>Current and maximum Memory allocation</li><li>Boot options</li><li>Network, Display, Sound, USB settings</li><li>Etc.</li></ul><p>After the changes and new VM start, your virtual machine will have adjusted resources and device settings. That’s it. Enjoy your VM on KVM.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a76630618295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monero vs ShadowCash — Epic Anonymity Crypto Fight]]></title>
            <link>https://jimmco.medium.com/monero-vs-shadowcash-epic-anonymity-crypto-fight-c9491c79b5ae?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9491c79b5ae</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[monero]]></category>
            <category><![CDATA[shadowcash]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Tue, 13 Sep 2016 14:25:58 GMT</pubDate>
            <atom:updated>2016-09-13T14:28:14.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*tTO3ZwTKGHyZPdRA.jpg" /></figure><h3>General</h3><p>These weeks, anonymous cryptocurrency are driving the crypto markets. <a href="https://getmonero.org/home">Monero</a> is a heavyweight champion here. Let’s take a look if it can beat coming challenger called <a href="https://shadowproject.io/en">ShadowCash</a>.</p><h3>Proof of what</h3><p>Monero: PoW — CryptoNight (CPU, GPU)<br>ShadowCash: PoS — PoSv3</p><p>Winner: Monero<br>Detail: Users can benefit from mining which is usually more appreciated than pure PoS coins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/0*Zp6W2vxsGhRpgxla.jpg" /></figure><h3>Inflation (annual)</h3><p>Monero: 19.0388904656 %<br>ShadowCash: 2%</p><p>Winner: ShadowCash<br>Detail: Lower inflation is considered better. Note: Over years Monero inflation will decrease to almost zero but for now and coming years ShadowCash is having much lower inflation than Monero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/0*Dmks3yk3CtBPZTio.jpg" /></figure><h3>Price / MarketCap</h3><p>Monero: 12.19$ / 156m $<br>ShadowCash: 2.12$ / 14m $</p><p>Winner: Draw<br>Detail: ShadowCash is cheaper for new investors but if you already invested in Monero then higher price might not necessarily disadvantage for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/0*tw3B-Xi8x7vYbR_p.jpg" /></figure><h3>Codebase</h3><p>Monero: based on CryptoNote<br>ShadowCash: based on Bitcoin</p><p>Winner: ShadowCash<br>Detail: Bitcoin codebase is considered better (more secured and proven) than CryptoNote in general.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/0*WauYrA_R2Sq_7d-q.jpg" /></figure><h3>Community</h3><p>Monero: large community<br>ShadowCash: small community</p><p>Winner: Monero<br>Detail: Larger community is definitely big benefit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*Alqz5cye0ZUccutN.jpg" /></figure><h3>Documentation</h3><p>Monero: average quality<br>ShadowCash: good quality</p><p>Winner: ShadowCash<br>Detail: Documentation and resource quality is important for new users and developers. Subjectively ShadowCash is one level higher here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*3E-Y0mnBxalFrili.jpg" /></figure><h3>Anonymity features</h3><p>Stealth addresses, Ring Signatures, Zero Knowledge Proofs, Untraceable, Unlinkable, End to end Anon<br>Monero: Yes<br>ShadowCash: Yes</p><p>Winner: Draw<br>Detail: Both projecs are top quality in terms of anonymity features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*YlQvBC2nVzJjaMSj.jpg" /></figure><h3>Wallet features</h3><p>GUI Wallet, HTML Interface, Lite Wallet, HD Wallet, Multisignatures</p><p>Monero: No<br>ShadowCash: Yes</p><p>Winner: ShadowCash<br>Details: Monero lacks (for now) GUI wallet and other GUI tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/0*UcEdW4GXtZeC6KEr.jpg" /></figure><h3>Other features</h3><p>Encrypted chat, marketplace</p><p>Monero: No<br>ShadowCash: Yes</p><p>Winner: ShadowCash<br>Detail: Monero doesn’t provide these additional features (chat, etc.) as part of the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/0*8P9GaMCJuS8rECTK.jpg" /></figure><h3>Trading</h3><p>Monero: 7&gt; exchanges<br>ShadowCash: 3&gt; exchanges</p><p>Winner: Monero<br>Detail: Broader availability and higher liquidity are better. Monero is much better here, there are even many XMR tradeable pairs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/0*_H9RH8-No-NG7smj.jpg" /></figure><h3>And a winner with is…….</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*Dfpy932_cfW_BoO9.jpg" /></figure><h3>with final score 5 : 7</h3><h3>Congratulations go to ShadowProject Team!</h3><h3>Conclusion</h3><p>It seems that both projects are great although ShadowCash seems (quite surprisingly) a bit better than Monero and there is also lot of other awesome competitors in the area (<a href="https://www.dash.org/">Dash</a>, coming <a href="https://z.cash/">ZCash</a>, <a href="https://v.cash/">VCash</a> and others). Of course selected criteria are kind-of subjective (as they can never truly be completely objective) but author’s effort was to give kind of fair comparison to find the best project from these two. If any of these projects wins mainstream adoption it will be great because real war is between anonymous crypto-currencies in general and central banks controlling fiat money.</p><p>Disclaimer: This article is not meant to be an investment advice of any kind and so invest carefully based on your own judgement and only with money you can easily lose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9491c79b5ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Async on fibers]]></title>
            <link>https://jimmco.medium.com/async-on-fibers-c140ecc9fdbd?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c140ecc9fdbd</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Mon, 18 Apr 2016 12:23:14 GMT</pubDate>
            <atom:updated>2016-04-18T12:24:46.728Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*UqngWjDd4t0yj2KSROycAA.png" /></figure><p>If you’re get used to synchronized way of coding with using threading, etc. and you go into environment like node.js, you’re exposed to an enormous usage of callback practically all the time. By practicing you will be able to read it but in general it’s not very transparent because it’s harder to follow flow and it can lead to “pyramid-code” and “callback hell”.</p><p><a href="https://www.npmjs.com/package/fibers">Fibers</a> are one way how to give your code more synchronized look without changing asynchronous nature.</p><h4>Callback</h4><p>Let’s start with a usual callback way. We have code that triggers some long running code (simulated with setTimeout here).</p><pre>function doSomethingTimeConsuming(description, <strong>callback</strong>) {<br>    setTimeout(function() {<br>        callback &amp;&amp; callback(null, &#39;result for &#39; + description);<br>    }, 1000);<br><br>}<br><br>function doSomething (description) {<br>    console.log(description + &#39; initiated&#39;);<br>    doSomethingTimeConsuming(description, <strong>function(err, res) {<br>        console.log(description + &#39; done with result &#39; + res);<br>    }</strong>);<br>}<br><br><br>doSomething(&#39;first long-time job&#39;);<br>doSomething(&#39;second long-time job&#39;);<br>console.log(&#39;All commands given&#39;);</pre><p>When we execute it we will get output below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*DmyQZbJQqN-rZIydh3_ltQ.png" /></figure><p>This is a quite common style and it doesn’t look that bad until we have more complicated code where pyramid scheme occurs. Anyway it would be nice to get rid with all callbacks.</p><h4>Sync style in async environment</h4><p>This is something what would be desired:</p><pre>function doSomethingTimeConsuming(description) {<br>    setTimeout(function() {<br> <strong>       var result = &#39;result for &#39; + description;<br>        return result;</strong></pre><pre><strong> </strong>   }, 1000);<br><br>}<br><br>function doSomething (description) {<br>    console.log(description + &#39; initiated&#39;);<br> <strong>   var result = doSomethingTimeConsuming(description);</strong><br>    console.log(description + &#39; done with result &#39; + res);<br>}</pre><pre>doSomething(&#39;first long-time job&#39;);<br>doSomething(&#39;second long-time job&#39;);<br>console.log(&#39;All commands given&#39;);</pre><p>This obviously will not work as the results are not known when evaluated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*pdZsXs8mnrBjTL-Iqo-80Q.png" /></figure><h4>Fibers</h4><p>Fibers allows us to wrap the code to write it like synchronized block but without blocking others. But it’s not for free (at least in terms of coding). We need to to additional changes.</p><ul><li>require “fibers” library (1)</li><li>create fiber variable in long-running function(2)</li><li>pass result to fiber (3)</li><li>fiber must yield until result is given not to block others (4)</li><li>wrap and run request into Fiber (5)</li></ul><pre><strong>var Fiber = require(&#39;fibers&#39;); // (1)</strong><br><br>function doSomethingTimeConsuming(description) {<br><strong>    var fiber = Fiber.current; // (2)</strong><br>    setTimeout(function() {<br><strong>        fiber.run(&#39;result for &#39; + description); //(3)</strong><br>    }, 1000);<br><strong>    var results = Fiber.yield(); //(4)<br></strong>    return results;<br>}<br><br>function doSomething (description) {<br> <strong>   Fiber(function() { // (5)</strong><br>        console.log(description + &#39; initiated&#39;);<br>        var result = doSomethingTimeConsuming(description);<br>        console.log(description + &#39; done with result &#39; + result);<br><strong>    }).run();</strong><br>}<br><br>doSomething(&#39;first long-time job&#39;);<br>doSomething(&#39;second long-time job&#39;);<br>console.log(&#39;All commands given&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*9VEOjmY7D_a3TxIiN-UOQg.png" /></figure><p>Now the code works as expected with eliminating all callbacks.</p><p>Fibers are possible way but every one must decide when it’s worth to use it or to use callback or another library like <a href="https://github.com/caolan/async">Async</a>, <a href="https://github.com/creationix/step">Step</a>, <a href="https://github.com/aldonline/syncify">Syncify</a> or wait to async in ES7.</p><blockquote>For the LORD has called you back from your grief — as though you were a young wife abandoned by her husband,” says your God. (Isaiah 54:6)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c140ecc9fdbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debian Jessie at your service]]></title>
            <link>https://jimmco.medium.com/debian-jessie-at-your-service-546f922e510f?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/546f922e510f</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[systemd]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Sun, 10 Apr 2016 10:20:47 GMT</pubDate>
            <atom:updated>2016-04-10T18:27:08.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*ZEJfZFlt7oJzON3FC3Tetg.png" /></figure><p>Recently I needed to create custom server service on Debian Jessie (wich is version 8) and there is <a href="https://en.wikipedia.org/wiki/Systemd">systemd</a> used as a service system. Systemd is very complex but if you are not an expert, this brief article will show you simple way for creating general server service.</p><pre>Topic: Create own systemd service<br>OS: Debian 8 (Jessie)<br>Tool: systemctl, service, vim</pre><h4>List services</h4><p>“systemctl” is basic command to work with systemd service. When executes, it lists all services. Just type:</p><pre>systemctl</pre><h4>Create service</h4><p>Service definition files (on Debian 8) are located under /lib/systemd/system/. We just need to create a new one. Our newly created file will be /lib/systemd/system/myservice.service</p><pre>[Unit]<br>Description=My custom service<br>After=network.target</pre><pre>[Service]<br>Type=forking<br>PIDFile=/run/myservice.pid<br>ExecStart=/root/bin/myServiceStart.sh<br>ExecStop=/root/bin/myServiceStop.sh<br>StandardOutput=syslog<br>StandardError=syslog<br>SyslogIdentifier=myservice</pre><pre>[Install]<br>WantedBy=multi-user.target<br></pre><p>Referenced sh scripts contain server execution instructions, “Type forking” provides daemon like process execution usually used with optional PIDFile. Here we need network service as a prerequisite and we expect scripts output available in syslog. This definition should work well for some terminal server service executed from script files. If you have another type of service, you’ll have to modify it according to your specific needs.</p><h4>Enable service</h4><p>Here we are using “systemctl” but we can also use “service” command for hese obvious operations.</p><pre>systemctl <strong>enable</strong> myservice</pre><h4>Disable service</h4><pre>systemctl <strong>disable</strong> myservice</pre><h4>Stop service</h4><pre>systemctl <strong>stop</strong> myservice<br># or<br>service myservice stop </pre><h4>Start service</h4><pre>systemctl <strong>start</strong> myservice<br># or<br>service myservice start</pre><h4>Service logging and status</h4><p>To see log messages you can just read syslog content:</p><pre>cat /var/log/syslog</pre><p>We can also check service status like this:</p><pre>systemctl status myservice</pre><p>That’s all, everything should work now. For more about systemd, check <a href="https://www.freedesktop.org/software/systemd/man/">man pages</a>.</p><blockquote>Slaves, obey your earthly masters with fear and trembling, with a sincere heart, as you would Christ, not by the way of eye-service, as people-pleasers, but as servants of Christ, doing the will of God from the heart, rendering service with a good will as to the Lord and not to man, knowing that whatever good anyone does, this he will receive back from the Lord, whether he is a slave or free. (Ephesians 6:5)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=546f922e510f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript mixins and fundamentals]]></title>
            <link>https://jimmco.medium.com/javascript-mixins-and-its-fundamentals-5499a5072be2?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5499a5072be2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Mon, 28 Mar 2016 18:12:28 GMT</pubDate>
            <atom:updated>2016-03-29T07:25:57.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*s2i5Xtt-JvJmmZMCEZCRUw.png" /></figure><p>When I started with JS, I really had poor understanding of things behind objects. Still far from being an expert in the area, some fog has disappeared. In strong OOP languages, we usually compose classes or use inheritance. in JS, especially before ES6, we have just objects which we can extend via mixins. Here JS can be quite confusing for traditional OOP developers. To understand JavaScript mixins, it is needed to understand objects and their prototypes.</p><h4>Objects</h4><p>An object in JS is some composite for a bunch of key-value pairs sometimes called properties including reference into “upper” objects called prototypes. We can imagine this like some bunch of added behavior and properties accessible. From OOP perspective, it is like super-class.</p><p>To create a new object with an undefined prototype we use Object.create function.</p><pre>var objectWithUndefinedPrototype = Object.create(null);</pre><p>To add new property name and value to this object we have multiple ways how-to do it, most simple is “dot” notion:</p><pre>objectWithNotDefinedPrototype.name = &#39;John&#39;;</pre><p>Often we create objects with basic “Object” prototype. For this we can use simplified construction:</p><pre>var objectWithObjectPrototype = {};<br>// which is a syntax suggar for<br>var objectWithObjectPrototype = Object.create(Object);</pre><h4>More about prototypes</h4><p>Prototype can be understood also as a pointer to another object. It allows property chain lookup. So we can utilize content defined in object prototype. Property lookup goes from used object up to top prototype until it’s found if there is any in the chain. The lookup is stopped when a property is found or there is no upper prototype (ie. it’s null) and then an undefined value is returned.</p><h4>More about properties</h4><p>As we can simply create property just by simple notion &lt;object&gt;.&lt;property_name&gt; = &lt;property_value&gt;. There is more detailed way by using Object.defineProperty function.</p><pre>var dog = Object.create(null);<br>Object.defineProperty(dog, &#39;name&#39;, {<br>  value: &quot;Woofy&quot;,<br>  writable: true,<br>  enumerable: true,<br>  configurable: true<br>});</pre><h4>Define properties with common defaults</h4><p>We can create a function to simplify property definition.</p><pre>var config = { <br>  writable: true, <br>  enumerable: true, <br>  configurable: true <br>};</pre><pre>var defineProperty = function(obj, name, value) {<br>  config.value = value;<br>  Object.defineProperty(obj, name, config);<br>}</pre><pre>var person = Object.create(null);<br>defineProperty(dog, &#39;name&#39;, &#39;Woolfy&#39;);<br>defineProperty(dog, &#39;age&#39;, 7);</pre><h4>Create object hierarchy</h4><p>Prototypes are basic stones for creating object hierarchies similar to inheritance in OOP languages. Like this, we can create object “circle” which can utilize properties from object “shape”. If we pass “shape” as parameter to Object.create parameter, circle will have shape as its prototype.</p><pre>var shape = Object.create(null);<br>defineProperty(shape, ‘color’, ‘black’);</pre><pre><strong>var circle = Object.create(shape);</strong><br>defineProperty(circle, &#39;radius&#39;, 1);</pre><pre>// now we can check<br><strong>console.log(circle.color); // black</strong><br>console.log(circle.radius); // 1</pre><h4>Prototypes with __proto__</h4><p>There is a special properties called __proto__. We can create the same with this property</p><pre>var shape = {};<br>shape.__proto__ = null;<br>shape.color = &#39;black&#39;;</pre><pre>var circle = {};<br>circle.radius = 1;<br><strong>circle.__proto__ = shape;</strong></pre><pre>// now we can check<br><strong>console.log(circle.color); // black</strong><br>console.log(circle.radius) // 1</pre><p>Note that shape is not the same as shape from the previous example as its prototype is “Object” here.</p><p>Construction below is the same and so {} is a syntax suggar for creating objects with Object prototype.</p><pre>var myObj = {};<br>var myObj = Object.create(Object);<br></pre><h4>Getting prototype</h4><p>By using Object.getPrototypeOf we can get prototype of the object.</p><pre>var myObj = {};<br>Object.getPrototypeOf(myObj); // =&gt; Object<br>// or<br>myObj.__proto__; // Object</pre><h4>Constructor functions and “new” keyword</h4><p>Keyword “new” creates new object so-called “instance of the function”. We can use “instanceof” keyword to check instance type.</p><pre>function Dog() {};<br>var dog = new Dog();</pre><pre>console.log(dog instanceof Dog); // ==&gt; true</pre><h4>‘this’ reference keyword</h4><p>Using “new” injects “this” reference to the new object that is being created and can be used in this constructor function. Note: Be careful when calling such a function (instead of using “new” keyword). In such a call “this” would refer to global scope instead of function scope.</p><pre>function Dog() {<br>  this.name = &#39;Woolfy&#39;;<br>}</pre><pre>var woolfy = new Dog(&#39;Woolfy&#39;);<br>foo.name; // ==&gt; &#39;woolfy&#39;;</pre><h4>Function prototype</h4><p>Note that “prototype” is not necessarily equal to “__proto__”. There is a relation, though. When new object is created, __proto__ of the new object is the same as “prototype” property of function which created the object. There is simple example</p><pre>function Dog(name) {<br>  this.name = name;<br>}</pre><pre>var woolfy= new Dog(&#39;Woolfy&#39;);<br>woolfy.__proto__ == Dog.prototype; // =&gt; true</pre><h4>Classes</h4><p>Until ES6, we have several approaches for creating structures similar to class. Let’s start with “anti-pattern” approach where we refer to outer function.</p><pre>function Dog(name) {<br>  this.name = name;<br>  this.getName = getDogName;<br>}<br>function getDogName() {<br>  return this.name<br>}</pre><pre>var dog = new Dog(&#39;goofy&#39;);<br>console.log(dog.getName());</pre><p>Let’s do it better without exposing outer function</p><pre>function Dog(name) {<br>  this.name = name;<br>  this.getName = function() {<br>    return this.name;<br>  }<br>}</pre><pre>var dog = new Dog(&#39;goofy&#39;);<br>console.log(dog.getName());</pre><p>Another approach by using prototype</p><pre>function Dog(name) {<br>  this.name = name;<br>}<br>Dog.prototype.getName = function() {<br>  return this.name;<br>}</pre><pre>var dog = new Dog(&#39;goofy&#39;);<br>console.log(dog.getName());</pre><p>There are other ways how to achieve the same, for example by using object literals. Anyway, ES6 ha brought “class” keyword so we can define prototypes of objects in cleaner OOP fashion.</p><pre>class Dog {<br>  constructor (name) {<br>    this.name = name;<br>  }<br>  getName() {    <br>    return this.name;<br>  }<br>}</pre><pre>var d = new Dog(&#39;woofy&#39;);<br>console.log(d.getName());</pre><h4>Mixins</h4><p>Mixins allow us to compose/expand multiple objects. Mixin is done by Object.assign function. A first parameter is an object prototype that is going to be expanded and a second parameter is an object that should be added.</p><pre>function Dog(name) {<br>  this.name = name;<br>  this.getName = function() {<br>    return this.name;<br>  }<br>}</pre><pre><br>const Colored = {<br>  color: &#39;red&#39;,<br>  getColor: function() {<br>    return this.color;<br>  }<br>};</pre><pre><strong>Object.assign(Dog.prototype, Colored);</strong><br>var d = new Dog(&#39;woory&#39;);<br>console.log(d.getColor());</pre><h4>Functional mixins</h4><p>We can rewrite this into a functional form.</p><pre>function Dog(name) {<br> this.name = name;<br> this.getName = function() {<br>   return this.name;<br> }<br>}</pre><pre>const Colored = (target) =&gt; <br>  Object.assign(target, {<br>  color: ‘blue’,<br>  getColor() {<br>    return this.color;<br>  }<br>});</pre><pre>Colored(Dog.prototype);<br>var d = new Dog(‘woory’);<br>console.log(d.getColor());</pre><p>There are some more constructions possible as JS is very flexible but for basic understanding this should be enough. When compared with some traditional OOP languages, JS is more powerful allowing more advanced constructions and also requires a slight mental shift. On the other hand, syntax tends to be more error-prone. Although ES6 brings more transparent constructions, historical burden stays.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5499a5072be2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dart in JavaScript sea]]></title>
            <link>https://jimmco.medium.com/dart-in-javascript-sea-d91529907e12?source=rss-228af9acc80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d91529907e12</guid>
            <category><![CDATA[dartlang]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[jimmco]]></dc:creator>
            <pubDate>Thu, 24 Mar 2016 18:39:46 GMT</pubDate>
            <atom:updated>2016-03-24T18:59:06.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*xCzFleITY9iOqtsz4hU7MA.png" /></figure><p>In times when JavaScript was much slower and more terrible than it’s now, I’ve used Dart for a web/canvas app and found it very nice. Dart Editor based on Eclipse RCP worked (surprisingly) well and Dart language provided all language features I expected that time.</p><p>Today, in time of ES6, when JS and node.js is quite a synonym for a web development, one might ask: Is there still a place for Google Dart?</p><p>I’ve read many articles about this (mainly written in 2015) and it seems that opinions were mostly against Dart. As many developers tend to follow mainstream technologies, challenger must always bring something special.</p><p>We have March 2016 now and JavaScript is constantly evolving but still it’s bearing many unfortunate decisions from the past as a historical burden. As ES6 doesn’t look bad, overall language impression is still behind enterprise expectations. JavaScript was, is and probably always will be “the ugly” language. People might get use to it, but the existence of all these CaffeScrpts, TypeScripts and also Dart is the best proof that JavaScript is just a necessary evil.</p><p>On the other hand, Dart was nicely designed language since the beginning. So why there is such a low adoption. Let’s try to summarize current state of main advantages JS vs Dart:</p><p>JavaScript pros:</p><ol><li>Native support in browsers</li><li>Native support in browsers</li><li>Native support in browsers</li></ol><p>Dart pros:</p><ol><li>Well-designed language</li><li>Performance</li><li>API</li></ol><p>When I was using Dart, there was a still a living plan and hope to have native language support in major browsers. As my app was subjectively maybe ten times faster in Dartium I was thinking that I’m ready for the future. That’s why I was very surprised that Google decided to leave native support and focus on dart2js.</p><p>I always understood that there is a good chance that MS and Mozilla will never implement Dart VM in their browsers but that never bothered me much. If there is just Google supported browser with native Dart, it would be good enough I said to myself. What a surprise they decided to leave it behind. Many Dart users felt betrayed. Here I must join the crowd — that decision was the worst decision that Dart team ever did!</p><p>Anyway, people do mistakes and people can still re-consider and fix some of them. These can be fixed. I’m not saying I will not use Dart anymore but now I would need to have extremely strong reason for using it now.</p><p>Google doesn’t have the best reputation in terms of maintaining technologies long-term, <strong>still Dart can be widely adopted if these two conditions are fulfilled:</strong></p><ol><li><strong>Strong promise that there WILL BE a supported Google browser with native Dart after all</strong></li><li><strong>A promise that Dart platform will be supported by Google at least next 10 years</strong></li></ol><p>These two promises would bring Dart back into the prime league.</p><p>I believe Google invested and is still investing a lot to develop and promote Dart and to keep it evolving and so I believe (2) is already true and although it would be nice to hear it officially. But still <strong>(1) is a MUST!</strong></p><p>To finish this with a positive note, language popularity seems to be slowly increasing, language is nicely evolving and IDE based on Webstorm/Idea also looks very nice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d91529907e12" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>