<?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 Tien on Medium]]></title>
        <description><![CDATA[Stories by Tien on Medium]]></description>
        <link>https://medium.com/@tiptopcoder?source=rss-597f5155eebc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*tL_woqI5xCwDVOok-3F2rw.jpeg</url>
            <title>Stories by Tien on Medium</title>
            <link>https://medium.com/@tiptopcoder?source=rss-597f5155eebc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 05:07:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tiptopcoder/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[Set Up Next.js with a Custom Express Server + Typescript]]></title>
            <link>https://levelup.gitconnected.com/set-up-next-js-with-a-custom-express-server-typescript-9096d819da1c?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9096d819da1c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 02:40:38 GMT</pubDate>
            <atom:updated>2020-02-16T02:50:23.454Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*acnd9JbjI1OX_KKu" /><figcaption>Photo by <a href="https://unsplash.com/@adigold1?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Adi Goldstein</a> on <a href="https://unsplash.com/s/photos/coding?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In this post, I will walk you through how to make a Next.js application handled by a custom Express server with Typescript.</p><p>You can see the full code published on <a href="https://github.com/tiptopcoder/simple-next-express-typescript">GitHub</a>.</p><h3>Setting up a Next.js project</h3><p>First create a project folder:</p><pre>mkdir -p next-express-typescript<br>cd ./next-express-typescript</pre><p>Initialize a package.json file and install dependencies:</p><pre>npm init -y<br>npm install react react-dom next</pre><p>Add the following scripts to package.json:</p><pre>&quot;scripts&quot;: {<br>  &quot;dev&quot;: &quot;next&quot;,<br>  &quot;build&quot;: &quot;next build&quot;,<br>  &quot;start&quot;: &quot;next start&quot;<br>}</pre><p>Create your first page:</p><pre>mkdir -p src/pages<br>touch src/pages/index.js</pre><p>Populate ./src/pages/index.js with some dummy content:</p><pre>function IndexPage() {<br>  return &lt;div&gt;Hello World Next - Typescript - Express&lt;/div&gt;;<br>}<br><br>export default IndexPage;</pre><p>Then run npm run dev and visit http://localhost:3000 to view the created page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*AlNJjJXPf_-33EDxP1C-Sg.png" /></figure><h3>Configure Typescript</h3><p>Basically, Next.js provides us a quick way to config Typescript. To get started, create an empty tsconfig.json :</p><pre>touch tsconfig.json</pre><p>Then execute npm run dev again, you should see a guide from Next.js telling you to install required packages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LvQtUIIPl_gHnGiLg_xtpA.png" /></figure><p>So, let’s install and finish the Typescript setup:</p><pre>npm install --save-dev typescript <a href="http://twitter.com/types/react">@types/react</a> <a href="http://twitter.com/types/node">@types/node</a><br>mv src/pages/index.js src/pages/index.tsx</pre><p>Then run dev server again and everything should work properly now.</p><h3>Set up Express</h3><p>When you run npm run dev, basically Next.js starts its own server but it’s possible to handle it programmatically with your own Express server.</p><p>We need to install express and its Typescript definitions:</p><pre>npm install express<br>npm install --save-dev @types/express ts-node</pre><p>Create a server folder and a server entry point:</p><pre>mkdir -p server<br>touch server/index.ts</pre><p>Populate index.ts with this code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5f700c757729d55dd4c8ce28fb8d6eb/href">https://medium.com/media/f5f700c757729d55dd4c8ce28fb8d6eb/href</a></iframe><p>Let’s edit the dev script in package.json:</p><pre>&quot;scripts&quot;: {<br>   &quot;dev&quot;: &quot;ts-node server/index.ts&quot;,<br>   ...<br>}</pre><blockquote>ts-node is a TypeScript execution and REPL for node.js, with source map support. (<a href="https://www.npmjs.com/package/ts-node">source</a>)</blockquote><p>Now run npm run dev. But oops, we got an error:</p><pre>import express from &quot;express&quot;;<br>       ^^^^^^^</pre><p>The problem comes from tsconfig.json, there is a line &quot;module&quot;: &quot;esnext&quot;. Typically, Next.js <strong>forces </strong>TS compiling with the ESNext pattern but express was built on the commonjs pattern. If you change the value from esnext to commonjs, <strong>Next.js will automatically revert it back.</strong></p><p>To come over this issue, let’s create another config file:</p><pre>touch tsconfig.server.json</pre><p>And extend it from tsconfig.json:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e14692d040321078a6dd11a29df483a6/href">https://medium.com/media/e14692d040321078a6dd11a29df483a6/href</a></iframe><p>To breakdown:</p><ul><li>&quot;extends&quot;: &quot;./tsconfig.json&quot;: Gets all options from tsconfig.json</li><li>&quot;compilerOptions.module&quot;: &quot;commonjs&quot;: Use commonjs as the module pattern in order to make both express and next work together.</li><li>&quot;compilerOptions.outDir&quot;: &quot;dist&quot;: This option is used for production. It will compile all .ts files in the server directory to .js and send to the dist directory.</li><li>&quot;compilerOptions.noEmit&quot;: true: This option is used for production. Next.js basically uses babel to compile Typescript so TS compiler won’t output .js . We will override this value to tell TS compiler compile and output our server files.</li><li>&quot;include&quot;: [&quot;server&quot;]: This option is also used for production. It lets the TS Compiler know only compiling .ts files in the server/ directory.</li></ul><p>We’re gonna use this config for local development. Now we need to edit the dev script again:</p><pre>&quot;dev&quot;: &quot;ts-node --project tsconfig.server.json server/index.ts&quot;</pre><p>And execute npm run dev then visit http//localhost:3000… it works!</p><h4>Fix Error page not found</h4><p>Some of you may experience RangeError: Invalid array length popping in console when running custom server.</p><p>Additionally, when you visit an unknown page say http://localhost:3000/no-exist-page, you will get Internal Server Error instead of a message like 404 not found. This because Next.js no longer handles errors when integrating with a custom server.</p><p>The solution is to create<a href="https://nextjs.org/docs/advanced-features/custom-error-page"> a custom error page</a>:</p><pre>touch src/pages/_error.tsx</pre><p>Then populate it with the below code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7289fbe01a8ad6453bf17c6fc4fee0f/href">https://medium.com/media/e7289fbe01a8ad6453bf17c6fc4fee0f/href</a></iframe><p>Now visit <a href="http://localhost:3000/no-exist-page">http://localhost:3000/no-exist-page</a> again, you should see our error message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*SmibIyu3EVC-f60yXn7Osw.png" /></figure><p>The error in the console is also gone away!</p><h3>Let’s go production</h3><p>Before spinning up the server in production mode, we need to compile both Next.js and server code to .js. Now, modify scripts in package.json:</p><pre>&quot;scripts&quot;: {<br>    &quot;build:server&quot;: &quot;tsc --project tsconfig.server.json&quot;,<br>    &quot;build:next&quot;: &quot;next build&quot;,<br>    &quot;build&quot;: &quot;npm run build:next &amp;&amp; npm run build:server&quot;,<br>    &quot;start&quot;: &quot;NODE_ENV=production node dist/index.js&quot;<br>}</pre><p>Breakdown:</p><ul><li>build:server: Build server code to dist directory</li><li>build:next: Build the Next.js application</li><li>build: Run both build:server and build:next</li><li>start: Run the server. It runs node dist/index.js instead of next start because now we let experss handle the server.</li></ul><p>Let’s build all the stuff by running npm run build and you should see the result like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMuUGGGWP3UsOyvMRgKoww.png" /></figure><p>Now run npm start and let’s see our application working in production:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*l6lNVy3Z1i2VTVz_vhrqoQ.png" /><figcaption>Console message telling it’s working on production env…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*gYetKDM-5gx3qiiBmCwk-Q.png" /><figcaption>… and on browser, our Next.js application works!</figcaption></figure><h3>Wrap Up</h3><p>You now have a boilerplate to start your Next.js project with Express server and Typescript! There are still some advanced configurations such as make <a href="https://levelup.gitconnected.com/get-rid-of-relative-import-path-hell-in-your-typescript-project-9952adec2e84">Path Alias</a> working with VSCode, TS-Jest for Next and Express testing… that hopefully I can write about in the near future.</p><h3>References</h3><p><a href="https://nextjs.org/docs/advanced-features/custom-server">Advanced Features: Custom Server | Next.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9096d819da1c" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/set-up-next-js-with-a-custom-express-server-typescript-9096d819da1c">Set Up Next.js with a Custom Express Server + Typescript</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Guide To Multi-environment Application]]></title>
            <link>https://medium.com/@tiptopcoder/a-guide-to-multi-environment-application-750276aa09dd?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/750276aa09dd</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Thu, 16 Jan 2020 14:55:52 GMT</pubDate>
            <atom:updated>2020-01-16T14:55:52.650Z</atom:updated>
            <content:encoded><![CDATA[<h4>BEGINNER’S GUIDE</h4><h4>If you are new to software development or did not have chance working with multi-versioned applications.</h4><h4>Overview</h4><p>Multi-environment application is a popular technique used by major organizations. This technique is widely used when we want to add new features, test, debug without worrying about affecting current live product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*yRZbU7f3pw5Qw4kf.png" /></figure><h3>The definition of environment</h3><p>In short, environment is a set of hardware + software + data + system configurations that let a program operates properly.</p><p>For example, I want to make an e-commerce website using PHP, and run on <a href="https://medium.com/@tiptopcoder/an-explanation-for-technical-stack-and-how-to-choose-the-right-one-5e9793c2ac01">LAMP stack</a>. In that case, the environment look like following:</p><ul><li><strong>Hardware:</strong> A web server containing application source code. A database server for storing persistent data.</li><li><strong>Software:</strong> Linux OS, Apache, PHP installed on web server. MySQL installed on database server. Software may also include PHP extensions and MySQL extensions.</li><li><strong>Application source code</strong></li><li><strong>Configuration:</strong> IP filter, Basic authentication credentials, Cookie expiration time, …</li></ul><p>Most of developers when doing school assignments or in early days working, we often stored configuration into source code, including sensitive information like encryption key, DB credentials, … It may be fine if you don’t share your source code with others but in collaborative team, it will take more time to set up and let everyone work with same source code in the right way.</p><blockquote>I would also stress that, even you are using private repository, there is still a small chance of leaking sensitive information. So, never store credentials or secure keys into source code.</blockquote><h3>How environments are set up?</h3><p>Most technical teams use 3–4 environments:</p><h4>Local environment</h4><p>This environment is specific for every single developer. Entire database and source code stay in your own machine and you can get your hand dirty as much as you want. It usually takes a day to set up project when you start working at new company.</p><h4>Staging/Testing/QA environment</h4><p>This is collaborative environment that all team members have access at a certain level of permission. When your commit are merged to main branch, often master branch, it will be deployed to this environment.</p><ul><li>Staging environment is usually used for integration testing.</li><li>Developers, PMs and Tester should have access to test and confirm whether it works as expected.</li><li>If the feature/fix works on Staging, we will deploy to Production.</li></ul><h4>Production environment</h4><p>This is the scariest environment, used by real users, containing real data. Therefore, any changes must be examined carefully before deploying to this environment.</p><p>The access control level is also highly restricted. In practice, only Database Analyst (DBA), SysAdmin, CTO and some experienced developers are granted the access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Ddqpo1cmS0tXD9V.png" /></figure><p>Most of the time, we only work on Local and Staging:</p><ul><li>We change and test on Local, make sure there is no bugs.</li><li>We merge changes and deploy to Staging, keep testing, hand over task to tester and wait for their confirmation.</li></ul><p>In some cases, there are a few differences between Production vs Local/Staging in terms of configuration or data. Therefore when a bug is reported on Production, we cannot reproduce the issue on Local/Staging or vice versa.</p><h3>Set up environments the right way</h3><p>CTO/Technical Leader/SysAdmin are often the ones responsible for managing multi-environment infrastructure. Developers only need to follow the instruction to set up and start working.</p><p>Actually, the best practice depends on many factors, but in my opinion, there would be some standards:</p><h4>Quick and easy</h4><p>The installation should be simple enough, I would prefer running one script or one click. It used to take me whole day at a company to install Gearman, Nginx, MySQL, PHP-FPM, import database, … while in another company, it only took me 1 hour running script.</p><h4>Synchronization</h4><ul><li><strong>Software synchronization:</strong> the version of softwares on Staging must be the same as on Production.</li><li><strong>Hardware synchronization:</strong> the system resources of Staging and Production must be the same. This is difficult to happen because Production environments have more servers, and the servers are more powerful to deliver the best performance.</li><li><strong>Data synchronization: </strong>Data should be entirely or a portion same, however, sensitive information (email, password, phone number, …) <strong><em>must be modified</em></strong> before syncing to Staging/Local.</li></ul><h4>Same code, different configuration</h4><p>Configuration such as database credentials, database host, 3rd party API key should be stored in separated files (.env, .json, .config) and such files must be ignored by version control system.</p><h4>Access Control Level</h4><p>Access to Production environment must be highly secured. Only authorized members are granted permission at certain level. There are countless stories about junior developers accidentally swipe out production database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*iNaKu9i1K_QEaYd1.jpg" /></figure><h3>Conclusion</h3><p>The most important point is, creating multi-environments project must be considered based on technology, level of teams and the nature of project. It is helpful for performing thorough tests before push to live but also a nightmare when come to maintenance if not setting up properly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=750276aa09dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get rid of relative import path hell by adding absolute imports to your Typescript project]]></title>
            <link>https://levelup.gitconnected.com/get-rid-of-relative-import-path-hell-in-your-typescript-project-9952adec2e84?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9952adec2e84</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Wed, 15 Jan 2020 17:19:51 GMT</pubDate>
            <atom:updated>2020-01-15T17:21:28.719Z</atom:updated>
            <content:encoded><![CDATA[<h4>Typing long and error-prone paths to your Typescript modules can be a frustrating task</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/0*AalU2Ujaef8Quipp.png" /></figure><blockquote>If you don’t know how to set up a TypeScript project, check out <a href="https://levelup.gitconnected.com/how-to-set-up-a-typescript-node-js-app-in-5-minutes-93ffee3b1768?source=friends_link&amp;sk=0cab30a2d36473d0ddbb0b83f4670538">this article</a>.</blockquote><p>Have you ever seen an import statement like this?</p><pre>import { formatName }  from &#39;../../helpers/format-name&#39;</pre><p>These inconsistent relative paths look ugly and make code maintenance a nightmare!</p><p>Imagine one day you have to update the directory structure meaning part of or all of the relative paths must be changed. While most of IDEs can try their best to update the references, it doesn’t always do it correctly…</p><p>Don’t worry, this guide comes to the rescue.</p><h3>Overview</h3><p>We would like to shorten this kind of code:</p><pre>import { formatName }  from &#39;../../helpers/format-name&#39;</pre><p>to this:</p><pre>import { formatName }  from &#39;~/helpers/format-name&#39;</pre><p>Where the ~ denotes the src directory.</p><h3>Step 1</h3><p>Let’s create a dummy User model class and a formatName function. At the root of project:</p><pre>touch src/app/models/User.ts src/helpers/format-name.ts</pre><p>Add the following code in src/app/models/User.ts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2cf0ffdff247d54c7b07c5cf3586b29/href">https://medium.com/media/e2cf0ffdff247d54c7b07c5cf3586b29/href</a></iframe><p>And following in src/helpers/format-name.ts :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe8482574ce5cf9aad6a052ed1322e92/href">https://medium.com/media/fe8482574ce5cf9aad6a052ed1322e92/href</a></iframe><p>In src/handlers.ts, import the User model:</p><pre>import { User } from &quot;./app/models/user&quot;;</pre><p>And modify rootHandler function as follow:</p><pre>export const rootHandler = (_req: Request, res: Response) =&gt; {</pre><pre>  const user = new User();</pre><pre>  return res.send(`Hi ${user.fullName}, API is working 🤓`);</pre><pre>};</pre><p>Now run yarn dev, you should see this error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Mfk3ni6CpMTP1QXaMEczA.png" /></figure><p>The TS compiler doesn’t understand what the heck ~ stands for so we have to let it know in the next step.</p><h3>Step 2</h3><p>We’re gonna make a minor change in tsconfig.json. Under the paths property, add another path definition indicate src folder:</p><pre>...<br>    &quot;paths&quot;: {</pre><pre>       ...</pre><pre>       &quot;~/*&quot;: [&quot;src/*&quot;]</pre><pre>    },</pre><pre>...</pre><p>Execute yarn dev, and it works! Keep going, run yarn build &amp;&amp; yarn start for production. But oops, an error is thrown again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*cucPu3M2lGUDQ_YzJso0yA.png" /></figure><p>The explanation is that you only let the TS compiler know the ~ symbol, but node runner still doesn’t understand what it is. Once again, we will let this guy know.</p><h3>Step 3</h3><p>To make it work in production, we will need help of link-module-alias package:</p><pre>yarn add link-module-alias</pre><p>Add this property into package.json:</p><pre>...<br>  &quot;_moduleAliases&quot;: {</pre><pre>    &quot;~&quot;: &quot;dist&quot;</pre><pre>  }</pre><pre>...</pre><p>Basically the idea here is that we use link-module-alias for initializing a symlink to dist directory.</p><p>In the start script, execute link-module-alias command:</p><pre>&quot;start&quot;: &quot;link-module-alias &amp;&amp; node dist/index.js&quot;,</pre><p>Now run yarn dev again, and it should work. Run yarn build &amp;&amp; yarn start, and the console should not throw any errors too. Let’s see whether it works in the browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*_kJD2XhbZuzTpXhyEJ0HYw.png" /></figure><p>If you are using VS Code (as I also highly recommend when working with TS), the aliases will appear in the autocomplete dropdown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*wpPeES4VWU-PyVDzr51puw.png" /></figure><h3>Conclusion</h3><p>Module alias will save you time and the frustration of dealing with ../ splattered everywhere. Another big advantage of using this package is that it doesn’t need runtime hooks to your app’s entry point like most solutions. Runtime hooks may modify the default import behavior, add a level of unnecessary computation and complexity to the application, and should be used cautiously.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9952adec2e84" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/get-rid-of-relative-import-path-hell-in-your-typescript-project-9952adec2e84">Get rid of relative import path hell by adding absolute imports to your Typescript project</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The IT Revelation Series: The “codeology” grand master]]></title>
            <link>https://levelup.gitconnected.com/the-it-revelation-series-the-codeology-grand-master-e6b99483c8dd?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6b99483c8dd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[developer-experience]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Tue, 14 Jan 2020 08:51:26 GMT</pubDate>
            <atom:updated>2020-01-14T08:51:26.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FHHamQ_23ygI1ON9.jpg" /></figure><h4>The IT Revelation</h4><h3>The IT Revelation Series: The “Codelogy” Grand Master</h3><h3>Once upon a time</h3><ul><li>Coding used to be difficult and boring jobs.</li><li>Developers used to work with every single byte or bit.</li><li>Code used to be written on paper, punched into card and insert into machines.</li><li>It used to take years to create user interface, manage memory, write a simple program.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*eGwNp9pofxIzj-et.png" /><figcaption>An old age FORTRAN punched card. So scary, scarier than COBOL form 😰</figcaption></figure><h3>The present, the gift</h3><p>The manual coding days has ended. Inheritance is the key point in IT industry. New languages, new frameworks are born and improved based on the previous ones. They let the coding job today is an easy breath.</p><p>I recalled the early days I worked on creating landing pages, wrote HTML/CSS/PHP using Dreamweaver, with limit code hinting, manual indentation and then transferred files to server via FTP, that was tough time.</p><p>And nowadays, you have one-click install Wordpress/Wix/Drupal, it may take 1 more day to make it more beautiful (or just because scrolling through tons of themes) and boom, you have a fancy site in a blink. Even more, we, software developers, are witnessing the wars of technologies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AaurqkzUhCEtKJcD.png" /><figcaption><a href="https://github.com/mraible/history-of-web-frameworks-timeline">Source: GitHub</a></figcaption></figure><p>However, life is always fair. There are pros and cons when working with those modern technologies. Although they make life easier, they create some barriers on the way achieving the top level of “codism”. They may help us to build applications rapidly, but also make us lazier and more stupid.</p><h3>Useful and Harmful</h3><p>In recent years, developers are mostly working with frameworks due to its convenience. The appearance of such frameworks creates a new generation of lazy developers (including me): call APIs all the time. They learn how to use the frameworks fast and think they are proficient at the frameworks or corresponding languages. Sadly, life is not such that simple.</p><p>A kid grown in a wealthy family, served every single meal, he/she may not know how tough to win the bread. Similar to developers, they often focus on just having the code run but didn’t really know what’s under the hood.</p><p>I saw some of my colleagues working with Request in Laravel controller but have no ideas about what Inversion of Control is and why using it. I also works with people implementing Listener to a JFX button but didn’t know what lambda expression is, completely no ideas why implementing abstract functions.</p><p>If you don’t really understand the mechanism of the language or a framework, you will never reach the peak of “codism”, forever be a code monkey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*l05kPI5Jl3CAqtJY.jpg" /></figure><p>The basic principles like syntax, method invocation, … can be learnt easily. However, advanced knowledge like: profiling, debugging, async, files/directories structure, … you cannot learn after a night but have to gather during a long process.</p><p>Let’s take a look at this Javascript code, it only takes you 10–15s to debug and fix if you are in the shoes of JS:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a2d0fc1b25fa51bfb1cd4e9544bc345/href">https://medium.com/media/4a2d0fc1b25fa51bfb1cd4e9544bc345/href</a></iframe><h3>The path to be a “Codeology” Grand Master</h3><p>Keep in mind, insisting on coding is the most foolish way to deal with a problem. It may not because of your own code, it may be from caching server or framework bugs. In order to recognize such issues, we need a solid foundation of the languages/frameworks we are working on, which we can only learn after years working with.</p><blockquote>There is no road of flowers leading to glory.</blockquote><blockquote>— Jean de La Fontained —</blockquote><p>You can forcefully inject knowledge from books, from videos, from audios, from speech into your mind. However, it probably a challenge when making use of them skillfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WOYsG42uwxgqzr5o19LJw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jareddrice?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jared Rice</a> on <a href="https://unsplash.com/s/photos/yoga?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Final words</h3><p>Libraries or frameworks help us to work fast and more efficiently. Using them is not a big deal but to be proficient at, you have to put more effort in researching the mechanism, the architecture, the best practice, …</p><p>Be modest, be curious, be patient at anything you are working on.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6b99483c8dd" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/the-it-revelation-series-the-codeology-grand-master-e6b99483c8dd">The IT Revelation Series: The “codeology” grand master</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Thought About Deep Learning and Artificial Intelligence]]></title>
            <link>https://medium.com/swlh/my-thought-about-deep-learning-and-artificial-intelligence-5a58c1b551aa?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a58c1b551aa</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[conspiracy-theories]]></category>
            <category><![CDATA[unemployment]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 14:01:02 GMT</pubDate>
            <atom:updated>2020-01-14T08:37:10.387Z</atom:updated>
            <content:encoded><![CDATA[<h4>The deep learning trend</h4><blockquote><a href="https://levelup.gitconnected.com/ai-machine-learning-deep-learning-what-are-the-differences-3c2c13c0388e">If you are new to data science or confused about the definitions of Artificial Intelligence, Machine Learning, Deep Learning, you can read here.</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jb8FjOX-Jn0nQE5H3DByg.png" /><figcaption>Deep learning trends in the past 5 years. Stats on Google Trends. (<a href="https://trends.google.com/trends/explore?date=today%205-y&amp;q=deep%20learning">Source</a>)</figcaption></figure><p>The reason why people are crazily focusing on DL, because of its efficiency in mining images data or digital signal, which is up to 95% accurate. Moreover, that is a way to raise funds, when it’s a hot trend, investors tend to play gamble on those DL companies. Besides that, to apply DL, there are a lot of tasks to be done like data preprocessing, finding an optimal number of nodes, layers, designing CNN, RNN, LSTM model, using various kinds of activating functions to compare efficiency, … Throughout the process, it results in enormous numbers of DL models and can be used for solving different problems.</p><h3>But there are disadvantages</h3><p>It does not mean DL is the key to unlock all issues. In some performance experiments, DL cannot beat some common algorithms like Random forest, SVM or Monte Carlo estimation. We also face an issue when using DL with categorized data or text data.</p><p>In Fintech, credit scoring, in particular, DL doesn’t explain how it “thinks” because it’s a black-box method, we only know the input and output, nothing else. Let’s imagine a customer credit card application is rejected, we don’t know why the heck the computer made that decision and the bank clerks will have a hard time to explain to the clients. On another hand, training DL needs a huge amount of specific data, but for credit scoring, besides basic information like name, address, … there is no more information to let the DL model understand the context. The reason for the shortage of data is, only some staff in specific roles are allowed to access credit check data, and in this case, we have to hand over it to engineers which may result in privacy violation.</p><h3>And Skynet conspiracy</h3><p>I laughed, it reminds me about the 2012, an apocalypse movie…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vC-IFBSHny0lojrp.jpg" /></figure><p>Countless people suppose that AI, at some level of training, it will take control of human being like in Terminator, i-Robot, … Or recently, <a href="https://www.forbes.com/sites/cognitiveworld/2018/08/07/job-loss-from-ai-theres-more-to-fear/#7dfa715c23eb">the fear of job loss from AI</a>. In my opinion, it is absolutely impossible:</p><ul><li>Machines perform more efficiently than human, but not smart. They only work under human command, by that way, keep us free from boring repetitive tasks. The job demand categories will shift, don’t worry.</li><li>The decisions given by machines are not 100% precise. And humans always do the last steps, testing, then making final decisions.</li><li>Machines help humans in creative works but they cannot do such works. Some typical applications are: Deep Dream by Google, Brain Storming by Adobe, some mobile app generators, Wix web generators, … Those are Deep Learning products, they need large, diverse input but the output is still in the limit of human knowledge.</li><li>They need more flexible mathematical system or language to more precisely simulate human thoughts, perception or actions. It is not different to create a new human species, which costs billion years.</li><li>We, humans, always think about back up plans for everything. There are manual ways in any cases. <a href="https://www.nytimes.com/2012/10/07/magazine/who-made-that-escape-key.html?mtrref=www.google.com&amp;gwh=CF560F464D0F5D6C5DBE1BE28CED8998&amp;gwt=pay&amp;assetType=REGIWALL">That’s why the Esc button was born.</a></li></ul><p>And, this may not be related, but I still want to say: instead of worrying about AI domination, we should worry about our privacy has been used every day. There are no robots that control humans but some humans control other humans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/0*ZqhjOuyZaQpiMZJA.jpg" /></figure><p>In Big Hero 6, a famous cartoon about a robot named Baymax, he can chat with us, scan the body and tell about our illness, then he gathers new knowledge to perform the treatment. He can distinguish right-wrong or dangerous actions and help humans avoid injury. What I would like to say here is, Baymax, although just a fictional character, but he is a helpful AI product which we should target to, instead of imagining about the apocalypse made by those robots. Actually, past catastrophes mostly were created by humans, no robots involved in those events.</p><p>AI is our friend, not potential enemy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a58c1b551aa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/my-thought-about-deep-learning-and-artificial-intelligence-5a58c1b551aa">My Thought About Deep Learning and Artificial Intelligence</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An explanation for Technical Stack and how to choose the right one]]></title>
            <link>https://medium.com/@tiptopcoder/an-explanation-for-technical-stack-and-how-to-choose-the-right-one-5e9793c2ac01?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e9793c2ac01</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 13:43:43 GMT</pubDate>
            <atom:updated>2020-01-13T13:43:43.657Z</atom:updated>
            <content:encoded><![CDATA[<h4>BEGINNER GUIDE</h4><h4>Technical Stack appears in all platform and is mentioned by all developers.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WFHldCvcnLV8lKAXNd5FjQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@madebyvadim?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Vadim Sherbakov</a> on <a href="https://unsplash.com/s/photos/assembly?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Let’s do a search or join a conference about software development or DevOps, we get many results with phrases: LAMP stack, MEAN stack, MERN stack, … During the early stage of building products, people also mention the importance of picking the right technical stack. So what does it mean, and why is it important?</p><h3>What is Stack?</h3><p>I recalled the early days working for a company, it was so exciting when setting up the first project, the first time I heard about tons of new terms: Vagrant, Symfony, Nginx, Load Balancing, CI Runners, … “Exciting, so many things in a single project!!”, I was thrilled. I had never heard about them before since I am a self-learner, neither came to schools nor had friends in my network. After working for a while, I realized the combination of what I listed, it’s called<strong> </strong>technical stack. A completely runnable system doesn’t only contain codes, but also operating system and required software like web server, database, … We assemble those parts, like playing Lego, into a stack.</p><blockquote>Technical Stack or Solution Stack, is a set of different hardware and software interacting with each other, making a complete platform.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*JWQ2zIjS6rpJGWrm7t8-7g.png" /><figcaption>Anatomy of technical stack.</figcaption></figure><h3>How a stack look like?</h3><p>There are common components in a stack and each component plays a specific role:</p><ul><li>Operating system</li><li>HTTP server</li><li>Database server</li><li>Server-side language</li></ul><p>For example, a LAMP stack includes:</p><ul><li><strong>L</strong>inux</li><li><strong>A</strong>pache</li><li><strong>M</strong>ySQL or <strong>M</strong>ariaDB</li><li><strong>P</strong>HP or <strong>P</strong>ython</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*Uwvc5g_4hnx8YBPs.png" /></figure><p>The above image explains a simple web app operation. Say a LAMP stack, the server runs Linux OS, Apache plays as an HTTP server. When the user sends a request, the HTTP server validates and hands over the request to App server, in this case, it’s PHP. The app may fetch data from database, MySQL, and return the response in JSON/XML/HTML format.</p><p>Most of hosting providers (AWS, GCP, Digital Ocean, …) nowadays provide quick links helping us set up common stacks in seconds. In case you want to understand how it works in practice, you can purchase a clean Linux instance and try installing components by yourself, it’s worth the time.</p><h3>How to choose the right stack?</h3><p>It usually depends on the level, familiarity of the team. If your teammates get used to developing PHP, LAMP stack is the best choice. If they are proficient at ASP.NET, you probably want the Microsoft ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*iEn3HudYfYf62NbXdz2ogA.png" /><figcaption>Slack is also using LAMP. <a href="https://qr.ae/TJFoTs">(Source)</a></figcaption></figure><p>Sometimes, a stack is chosen based on the growth of companies. Twitter is a good example, the company used Ruby on Rails at the beginning but <a href="https://www.infoq.com/articles/twitter-java-use/">announced rewriting in Java/Scala in 2010 to handle larger traffic.</a></p><p>I stress the importance of picking a technical stack in the early stage of product development. It’s helpful on overseeing how the system architecture, predicting the cost of operation and scalability.</p><h3>The popular stacks</h3><h4>LAMP stack</h4><p>The most popular stack used by most of websites. It contains: Linux, Apache, MySQL, PHP/Python/Perl. Well-known CMS like Wordpress, Drupal are run on the foundation of this stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*rfMZXY00DfvIy3KaYrQPtA.png" /><figcaption>Picture from DigitalOcean.</figcaption></figure><p>The great thing when using LAMP is all of its components are open sources, easily get help from large community, and Linux server is affordable.</p><p>There are some variants of this stack:</p><ul><li>MAMP — MacOS</li><li>WAMP — Windows</li><li>XAMPP — Cross-platform</li><li>LEMP — Replace Apache with Nginx</li></ul><h4>MEAN stack</h4><p>One of the most well-known stacks in recent years, includes: MongoDB, Express, Angular, NodeJS. Another variant is MERN, by replacing Angular with React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/0*B_4uF9LLqzOVJmQJ.jpg" /></figure><p>In my opinion, this is not really a stack because there is no OS. The NodeJS is not only used for server-side code but also acts as web server. In practice, we should use Nginx as proxy server and put NodeJS process behind to handle traffic better.</p><p>Similar to LAMP stack, all parts of this stack are free, the most exciting thing is, you can built the entire application by using only Javascript, for both back-end and front-end, it saves your time and budget.</p><h4>WISA stack</h4><p>This stack contains: Windows, IIS, SQL Server, ASP.NET. All hail Microsoft!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*QsykpY7Z_Ss7guHP.jpg" /></figure><p>WISA is mostly used by large enterprise, due to expensive license fee (Visual Studio, Windows, SQL Server, …). The pros are the speedy growth and maintainability. C# is quite a solid language, ASP.NET is a good partner with SQL Server and Microsoft gives us lots of helpful tools. It’s just like you are premium game player.</p><p>However, C# now becomes open source language. There is Visual Studio for Mac, .NET Core was born, SQL Server was released for Linux and in future, we may be able to running a Microsoft stack on Linux?</p><h3>My last words</h3><p>Each of developer has their own favorite technical stack. There is no right or wrong, it depends on many factors: budget, familiarity, market, context, deadline, … There is also no restriction about the components in a stack, like you can replace MySQL in LAMP with PostgreSQL. Thus, my advice is, pick the one you and your team feel comfortable with and make great application.</p><h3>References</h3><ul><li><a href="https://www.upwork.com/hiring/development/choosing-the-right-software-stack-for-your-website/">Choosing the right software stack for your website</a></li><li><a href="https://en.wikipedia.org/wiki/Solution_stack">Solution stack — Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e9793c2ac01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI, Machine Learning, Deep Learning — What are the differences?]]></title>
            <link>https://levelup.gitconnected.com/ai-machine-learning-deep-learning-what-are-the-differences-3c2c13c0388e?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c2c13c0388e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cognitive-science]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 13:07:48 GMT</pubDate>
            <atom:updated>2020-01-13T13:07:48.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RstvyzyqEQPXY-5gUtgshQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@franckinjapan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Franck V.</a> on <a href="https://unsplash.com/s/photos/artificial-intelligence?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>BEGINNER’S GUIDE</h4><h3>AI, Machine Learning, Deep Learning — What are the differences?</h3><h4>If you are new to data science or confused about the definitions of Artificial Intelligence, Machine Learning, Deep Learning.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdHyRQfjt9__LKGgJsC2Kg.png" /></figure><h3>Artificial Intelligence</h3><p>AI is the abbreviation for Artificial Intelligence. Throughout the history of AI, researchers have divided into 4 distinct approaches:</p><ul><li>Acting humanly</li><li>Thinking humanly</li><li>Thinking rationally</li><li>Acting rationally</li></ul><p>The most challenging task in this study is programming computers to effectively mimic human behaviors, in both actions and thoughts. AI researchers also try to instill the following features:</p><ul><li><strong>Reasoning:</strong> The ability to solve problems in a logical way.</li><li><strong>Knowledge:</strong> The ability to digest information in a context (like analyzing how many objects, events, obvious situations in real-world and classifying based on the characteristics of corresponding objects).</li><li><strong>Planning:</strong> The ability to create and pursue a goal based on the knowledge.</li><li><strong>Communication:</strong> The ability to understand human written and verbal communication.</li><li><strong>Perception:</strong> The ability to understand the context from images, audio, and other kinds of input.</li></ul><h4>Turing Test — Acting Humanly</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2wctX78rm7BeYlLH.jpg" /><figcaption>Picture by <a href="https://searchenterpriseai.techtarget.com/definition/Turing-test">SearchEnterpriseAI</a>.</figcaption></figure><p>In 1950, a famous mathematician named Alan Turing proposed an approach to determine if AI acts like a human. The proposal was known as the <a href="https://plato.stanford.edu/entries/turing-test/">“Turing Test”</a>.</p><p>According to Turing, the purpose was to examine how smart the system acted. The tests were performed in discussion-like way: one person asks a question, another person answers the question and the computer is expected to respond to the question. During the discussion, if the questioner cannot differentiate whether the answers come from human or machine, the machine can be considered “smart”.</p><p>This approach has been bringing remarkable achievements:</p><ul><li>Natural Language Processing: A computer is able to understand text or human voice and respond back.</li><li>Knowledge Representation: The ability to memorize knowledge via vision, audio, or document.</li><li>Automated Reasoning: The machine is capable of using its knowledge to answer a question or make a decision.</li><li><strong>Machine Learning:</strong> The computer is able to adapt to a context, then conclude new principles from acquired knowledge and use it for decision making purposes.</li><li>Computer Vision: The capability of observing and determining objects.</li><li>Robotics: The machine is able to interact with nearby objects as well as moving in an area.</li></ul><h4>Cognitive Science — Thinking Humanly</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/0*l3Y-US-OU6YX4NT9.jpg" /></figure><p><strong>Thinking</strong> like a human is another approach. Researchers will need a mega library to work on this field. If we want a computer to think like a human, we first need to understand how humans think.</p><p>There are 3 ways to examine:</p><ul><li>Observe the thinking process</li><li>Observe a person’s actions</li><li>Observe the brain activities</li></ul><p>If we give the computer a human similar input and receive a human similar output, we may consider it is thinking like humans at some point. There is a belief that if we are able to combine the results from the Turing test and cognitive science, we can achieve the AI goal faster.</p><h4>Logic — Thinking Rationally</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*WTeX60BuYmvyhMBZ" /></figure><p>However, it is a broad and challenging task to say we want a computer to think like a human, so we narrow down the problem to: thinking rationally is enough.</p><p>In the 19th century, the logicians invented mathematical notations to describe a statement or relationship among objects in the world, which were useful in training computers later on. However, this approach was a rough path. The inventors faced 2 challenges:</p><ul><li>First, the computer is incapable of digesting <strong>informal</strong> knowledge and expressing it in <strong>formal</strong> terms, especially the knowledge was not assured of 100% certainty.</li><li>Second, there is a big difference between solving a problem in theory and solving it in the real world. We need a large dataset for the input, which can exhaust the resources of any computers, even if the input is a problem with few hundred facts.</li></ul><h4>Agent — Acting Rationally</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*C4E5uOvQrM40PCHq.jpg" /></figure><p>Obviously, computer programs must do something, but computer agents are expected to satisfy more requirements. They must operate autonomously, collect information from the surrounding environment, survive for a long time period, adapt to any changes, make plans, and try to achieve them.</p><p>A typical example is the NASA robots which were launched to planets with unpleasant conditions and received few or no commands from human. How can they collect the soil, survive in the stormy, windy climate, make its own plan for charging the solar battery in order to continue the mission?</p><h3>Machine Learning (ML) and Deep Learning (DL)</h3><p>ML is just a part of the “thinking like a human” approach, and this approach is just one of 4 ways to research AI.</p><p>To reach the ML goal, researchers have been inventing algorithms as well as different ways to deal with problems:</p><ul><li>Supervised learning: decision tree, k-NN, Naive-Bayes, SVM, neural network, <strong>deep learning</strong>, etc.</li><li>Unsupervised learning: k-means, hierarchical clustering</li><li>Reinforcement learning: passive/active/generalization</li></ul><p>Once again, we can see deep learning is only one of the methodologies to solve problems using supervised learning. So why is deep learning such an important topic in our industry?</p><h4>Deep Learning:</h4><p><strong>Strength:</strong> Deep learning is a technique to implement machine learning to achieve state-of-the-art results of computer vision or speech recognition. Deep neural networks work effectively with images, audio, and text data, capable of updating the model with new data through batch propagation. The architecture of the model (quantity and structure of layers) can be applied to different problems, particularly, the hidden layers play a role in reducing the cost of feature engineering.</p><p><strong>Weakness</strong>: Deep learning is not a Swiss army knife, it needs a large dataset of a certain area to be trained. Actually, deep learning can be defeated by <a href="https://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205">tree ensemble method</a> in some basic machine learning tasks. In addition, training a deep learning model is expensive. It requires powerful resources as well as high-quality specialists to perform tuning hyperparameters (number of layers, number of nodes per layer, learning rate).</p><h3>Conclusion</h3><p>I hope my readers have a clear picture of the definition of AI, ML, and DL. If you want to step into the AI world for your career, ask yourself which approach you aim at (thinking or actions) and the level of human-like (just enough or near-human). Those AI systems require a lot of effort to complete but also a high risk of failure. However, if they are successful in the mission of serving humankind, you will change the world. <strong>AI is the future!</strong></p><h3>References</h3><ul><li><a href="https://www.amazon.ca/Artificial-Intelligence-Modern-Approach-3rd/dp/0136042597/ref=sr_1_1?crid=2E613PQTBQM&amp;keywords=artificial+intelligence+a+modern+approach&amp;qid=1578715981&amp;sprefix=artificial+in%2Caps%2C168&amp;sr=8-1">Russell, S. J., &amp; Norvig, P. <em>Artificial intelligence: a modern approach</em>. (2016).</a></li><li><a href="https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/">Copeland, M. <em>The Difference Between AI, Machine Learning, and Deep Learning?: NVIDIA Blog.</em> (2019).</a></li><li><a href="https://sebastianraschka.com/faq/docs/difference-deep-and-normal-learning.html">Sebastian, R. <em>What is the relationship between deep learning and regular machine learning on a conceptual level?</em> (2020).</a></li><li><a href="https://plato.stanford.edu/entries/turing-test/">Oppy, G., &amp; Dowe, D. <em>The Turing Test.</em> (2016).</a></li><li><a href="https://www.americanbar.org/groups/business_law/publications/committee_newsletters/banking/2019/201904/fa_4/">Brody, M., Mitzenmacher, E. T., &amp; Tsai, J. <em>Controlling Skynet: Regulatory Risks in Artificial Intelligence and Big Data. </em>(2019).</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c2c13c0388e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/ai-machine-learning-deep-learning-what-are-the-differences-3c2c13c0388e">AI, Machine Learning, Deep Learning — What are the differences?</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The fatal lines of code — About developers ethic]]></title>
            <link>https://medium.com/swlh/the-fatal-lines-of-code-about-developers-ethic-4720f6ab09c6?source=rss-597f5155eebc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4720f6ab09c6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[work-ethic]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Tien]]></dc:creator>
            <pubDate>Fri, 10 Jan 2020 14:21:56 GMT</pubDate>
            <atom:updated>2020-01-11T07:55:35.030Z</atom:updated>
            <content:encoded><![CDATA[<h3>The fatal lines of code — About developers ethic</h3><p>Most of us used to be taught or heard about the words: “Work Ethic”. A very common words used in schools or workplaces. In general, that’s said: “Do not directly or indirectly join any activity with purpose of scamming or fraudulent, causing harm to employer or clients”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43rRF-sb1WLl_BOku1UaKQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@moraisr?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rita Morais</a> on <a href="https://unsplash.com/s/photos/crash?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>After all, ethics is extremely important in any industries, especially related to human life such as medicine, that’s why we always hear about medical ethics or <a href="https://www.medicinenet.com/script/main/art.asp?articlekey=20909">the <em>Hippocratic Oath</em></a>. Now let’s think, is morality in programming important?</p><p>Before getting the answer, let’s review some accidents caused by software bugs in the past.</p><h3>From the lines of code that murders</h3><p>In my humble opinion, most of developers, including me, are nice, hard-working, sitting in front of the screen 8 hours/day (maybe more), so, “Murder” is quite a strange definition with developers and most of people too.</p><blockquote>“Murder” refers to kill or slaughter inhumanly or barbarously.</blockquote><blockquote>— Dictionary.com —</blockquote><p>Sounds scary… Obviously, developers cannot, but the lines of code written by them can. And we will see some typical fatal cases caused by developers’ code:</p><p><strong>1985–1987 — Therac-25 radiation therapy machine. </strong>The software, which was written in assembly language, played a role in controlling the degree of radiation emitted by the machine. Due to lack of attention in designing and testing, the machine has given the patients radiation overexposure, <a href="https://web.stanford.edu/class/cs240/old/sp2014/readings/therac-25.pdf">resulting in at least 6 accidents, 3 patients were reported dead.</a></p><p><strong>1994 — Scotland Chinook helicopter crashed.</strong> 29 people has been killed in the accident. <a href="https://publications.parliament.uk/pa/cm199900/cmselect/cmpubacc/975/97502.htm">A publication by </a><a href="https://publications.parliament.uk/pa/cm/cmpubacc.htm"><em>Public Accounts Committee</em></a> concluded that the tragedy has caused by repeated faults in the new Full Authority Digital Engine Control (FADEC).</p><p><strong>2018–2019 — Boeing 737 Max airplane crashes.</strong> The most recent and well-known disasters in airlines history. 2 accidents happened, killed 346 people. Boeing has admitted about the issue in a new integrated software called MCAS, which control the angle of attack sensor (AoA). The airliner has been grounded around the world after the accidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*Q0qXsDxgFmAQfgiWSz0nLg.jpeg" /><figcaption>A quick explanation about the issue on Boeing 737 MAX airliner.</figcaption></figure><h3><strong>… To burnt out million dollars</strong></h3><p><strong>July 28, 1962 — Mariner 1 space probe.</strong> The spacecraft cost $18.5 millions in 1962. A bug in the flight software caused the rocket to divert from the intended path shortly after taken off. A destructive command has been sent 294.5 seconds after launch. NASA concluded the faulty application of the guidance equations was taking the vehicle far off course in <a href="https://history.nasa.gov/SP-59.pdf">the report in 1965.</a></p><p><strong>1993 — Intel Pentium floating point divide.</strong> Intel has been charged $475 millions because of this issue. This is one of the most common problems related to computing arithmetic, most of developers have a sense of float or double containing larger data than long or integer primitive type. It’s the truth but they are misused. Both float and double are highly recommended not using in monetary calculation due to <a href="https://en.wikipedia.org/wiki/Floating-point_arithmetic">floating point problem</a>, and it caused the processor return incorrect results when dividing a number. In 1994, Intel had to recall the defective processors.</p><p><strong>May 2017 — WannaCry ransomware attack.</strong> The attack has been widespread around the globe by the cryptoworm, damaged from hundreds of millions to billions of dollars. The worm targeted machines running Microsoft Windows by encrypting data and blackmailed the victims into paying Bitcoin. Although Microsoft has released the patches, most of the affected machines were running older Windows systems that reached end-of-life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pV0hR-TsKg-jijiJtisuvA.png" /><figcaption>The most frustrated screen recently.</figcaption></figure><h3>Who is responsible for?</h3><p>In the events mentioned above, there must be countless people who were taking charge, and developer is one of the roles being accountable for the most.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FecIWPzGEbFc%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DecIWPzGEbFc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FecIWPzGEbFc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad7ec14d6f2fa216bf2d55e0ab3268b1/href">https://medium.com/media/ad7ec14d6f2fa216bf2d55e0ab3268b1/href</a></iframe><p>In a talk by “Uncle” Bob in 2016 with the topic: “The Future of Programming”, there are 2 quotes that I always keep in mind:</p><blockquote>We did not get in the business of software to kill people; but we are killing people.</blockquote><p>and</p><blockquote>No government can act without software. <strong>We rule the world.</strong></blockquote><p>Yes, the developers rule the world.</p><p>I couldn’t find a source about percentage of web developers but I believe at least 80% of developers are working with web application. In this field, most of bugs may not be deadly. However, embedded developers or who create conventional software for medical machines, electrical infrastructure, nuclear plants,… a little mistake may result in catastrophe.</p><p>We are not perfect, and as developers, we are going to make mistakes. Sometimes, we even make a joke when facing an issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*mKWdZhHh-fWqOxStDc6tzA.jpeg" /><figcaption>Don’t worry, you can tell them it’s a feature.</figcaption></figure><p>Yes, it is funny but it should have been a lot better if we would do it more careful. Please think about the moment people start using what we wrote. Put yourself into their shoes, where the situations look like above.</p><p>A tiny bug may send people to another world or throw millions of dollars out of the window. Are you still smiling while hearing the news about death of people who had been using your software, or companies declare bankruptcy because of “the missing feature”?</p><h3>Final words</h3><p>I only want to emphasize, as developers, who may create programs targeting to billion users, respect yourself, respect your job! <strong>Code responsibly.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*zXdyseZPo_zvQI6VyWI6AA.jpeg" /></figure><h3><strong>References</strong></h3><ul><li><a href="https://web.stanford.edu/class/cs240/old/sp2014/readings/therac-25.pdf">https://web.stanford.edu/class/cs240/old/sp2014/readings/therac-25.pdf</a></li><li><a href="https://en.wikipedia.org/wiki/1994_Scotland_RAF_Chinook_crash">https://en.wikipedia.org/wiki/1994_Scotland_RAF_Chinook_crash</a></li><li><a href="https://jeremiahflaga.github.io/2017/04/23/the-future-of-programming-by-uncle-bob-martin/">https://jeremiahflaga.github.io/2017/04/23/the-future-of-programming-by-uncle-bob-martin/</a></li><li><a href="https://www.ntsb.gov/investigations/AccidentReports/Reports/ASR1901.pdf">https://www.ntsb.gov/investigations/AccidentReports/Reports/ASR1901.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4720f6ab09c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/the-fatal-lines-of-code-about-developers-ethic-4720f6ab09c6">The fatal lines of code — About developers ethic</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>