<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nhân Quách</title>
    <description>The latest articles on DEV Community by Nhân Quách (@nhanquach).</description>
    <link>https://dev.to/nhanquach</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F109899%2Ff0c6b54a-c262-4758-aa11-bc3c3eae0d16.jpeg</url>
      <title>DEV Community: Nhân Quách</title>
      <link>https://dev.to/nhanquach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nhanquach"/>
    <language>en</language>
    <item>
      <title>Open edX - Part 1: Quick start</title>
      <dc:creator>Nhân Quách</dc:creator>
      <pubDate>Wed, 18 Mar 2020 03:43:43 +0000</pubDate>
      <link>https://dev.to/nhanquach/part-1-quick-start-507m</link>
      <guid>https://dev.to/nhanquach/part-1-quick-start-507m</guid>
      <description>&lt;p&gt;Hi everyone,&lt;br&gt;
Long story short, I need to setup an Open edX LMS for my side project, this is my journal.&lt;/p&gt;


&lt;h4&gt;
  
  
  Some notes
&lt;/h4&gt;

&lt;p&gt;This is my research, not the fully working tutorial.&lt;br&gt;
Hope you find it useful, somehow...&lt;/p&gt;

&lt;p&gt;This post also contains many questions, if you know how to do it, please leave it in the comment - thank you so much for helping me 🍾🍾🍾&lt;/p&gt;


&lt;h1&gt;
  
  
  Quick view
&lt;/h1&gt;

&lt;p&gt;In general Open edX is a lms platform which allows people to teach and to learn (sort of Udemy or Udacity), but you can set it up by yourself (&lt;strong&gt;Open edX&lt;/strong&gt; stands for Opensource Educational Platform &lt;em&gt;which is supposed to be really awesome - the X&lt;/em&gt; 😏)&lt;/p&gt;

&lt;p&gt;Check out the home page of &lt;a href="https://open.edx.org" rel="noopener noreferrer"&gt;Open edX&lt;/a&gt; for more info.&lt;/p&gt;
&lt;h3&gt;
  
  
  In this post
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Setting up a Virtual environment so I don't freak up the real system&lt;/li&gt;
&lt;li&gt;Install Open edX&lt;/li&gt;
&lt;li&gt;Access the Open edX from the real devices&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1.Setting up a virtual env
&lt;/h4&gt;

&lt;p&gt;I am a simple man, I saw virtual env, I think of Virtual Box. Yes, Virtual Box.&lt;br&gt;
Download it here &lt;a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener noreferrer"&gt;Virtual Box download page&lt;/a&gt;&lt;br&gt;
You will also need &lt;strong&gt;Ubuntu 16.04 amd64&lt;/strong&gt;, so here is the &lt;a href="http://releases.ubuntu.com/xenial/" rel="noopener noreferrer"&gt;download link&lt;/a&gt;, you can choose either the Desktop image (with GUI) or Server image.&lt;br&gt;
Install Ubuntu in a Virtual Machine, please take a look at the requirements for a Open edX server.&lt;br&gt;
Requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ubuntu 16.04 amd64 (oraclejdk required). It may seem like other versions of Ubuntu will be fine, but they are not.  Only 16.04 is known to work.&lt;/li&gt;
&lt;li&gt;Minimum 8GB of memory&lt;/li&gt;
&lt;li&gt;At least one 2.00GHz CPU or EC2 compute unit&lt;/li&gt;
&lt;li&gt;Minimum 25GB of free disk, 50GB recommended for production servers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your Ubuntu is up and running, great 👏👏👏! Let's move to the next step.&lt;/p&gt;
&lt;h4&gt;
  
  
  2.Install Open edX
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Make sure your virtual Ubuntu machine's Network is attached to Bridge NAT&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhjo6hfw6ce3tkxpx6yot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhjo6hfw6ce3tkxpx6yot.png" alt="Network is attached to Bridge NAT"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Power on your Ubuntu instance and login as root user&lt;br&gt;
Run the commands&lt;/p&gt;
&lt;h4&gt;
  
  
  1.Make sure we have the latest packages from apt
&lt;/h4&gt;



&lt;p&gt;&lt;code&gt;sudo apt-get update -y&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo apt-get upgrade -y&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  2.Reboot the machine
&lt;/h4&gt;



&lt;p&gt;&lt;code&gt;sudo reboot&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  3.After reboot, it's time to install Open edX
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Choose a version, check out all the versions &lt;a href="https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/named_releases.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;. For this tutorial I will choose the latest Ironwood release (tag name: open-release/ironwood.master). Define it to a variable:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;export OPENEDX_RELEASE=open-release/ironwood.master&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;: The command above will need to be re-run after reboot because it is not a permanent variable&lt;/p&gt;

&lt;h4&gt;
  
  
  4.Create config.yml file
&lt;/h4&gt;



&lt;p&gt;&lt;code&gt;cd &amp;lt;path/to/store/config.yml&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;vim config.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Insert:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;EDXAPP_LMS_BASE: "online.myeducation.org"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;EDXAPP_CMS_BASE: "studio.online.myeducation.org"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Save it&lt;/p&gt;

&lt;h4&gt;
  
  
  5.Short cut: Run all scripts
&lt;/h4&gt;



&lt;p&gt;&lt;code&gt;wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/ansible-bootstrap.sh -O - | sudo bash &amp;amp;&amp;amp;  wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/generate-passwords.sh -O - | bash &amp;amp;&amp;amp; wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/native.sh -O - | bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;5.1 For a more detail view:&lt;br&gt;
&lt;strong&gt;Notes&lt;/strong&gt;: All the scripts is available at &lt;a href="https://github.com/edx/configuration/tree/open-release/ironwood.master/util/install" rel="noopener noreferrer"&gt;https://github.com/edx/configuration/tree/open-release/ironwood.master/util/install&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5.1.1: Bootstrap to ansible&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/ansible-bootstrap.sh -O - | sudo bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;5.1.2: Generate passwords for demo users/accounts&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/generate-passwords.sh -O - | bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;5.1.3: Install and start Open edX to local machine&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/native.sh -O - | bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After all of that, your Open edX is available to access via your VM Ubuntu IP&lt;/p&gt;

&lt;h4&gt;
  
  
  3.Access the Open edX from the real devices
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Get the IP using

&lt;code&gt;ifconfig&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2iru77e6kqc4oxbtuk7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2iru77e6kqc4oxbtuk7i.png" alt="IP Address"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Now open your browser on the main machine and access it&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqhun027ew1v2hlo0tqo9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqhun027ew1v2hlo0tqo9.png" alt="Access via browser"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to other page:&lt;br&gt;
LMS Page: &lt;code&gt;&amp;lt;IP address&amp;gt;&lt;/code&gt;&lt;br&gt;
CMS Page: &lt;code&gt;&amp;lt;IP address&amp;gt;:18010&lt;/code&gt;&lt;br&gt;
Admin Page: &lt;code&gt;&amp;lt;IP address&amp;gt;/admin/&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Demo accounts:&lt;br&gt;
You can find the list of the default accounts here:&lt;br&gt;
&lt;a href="https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/installation/start_devstack.html#default-accounts" rel="noopener noreferrer"&gt;https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/installation/start_devstack.html#default-accounts&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You have done it! 🎉🎉🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Next part: Customize the look of Open edX
&lt;/h3&gt;

</description>
      <category>openedx</category>
      <category>lms</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>Does any one knows the Magic behind the Query languages?</title>
      <dc:creator>Nhân Quách</dc:creator>
      <pubDate>Mon, 08 Jul 2019 16:12:27 +0000</pubDate>
      <link>https://dev.to/nhanquach/does-any-one-knows-the-magic-behind-the-query-languages-5hbc</link>
      <guid>https://dev.to/nhanquach/does-any-one-knows-the-magic-behind-the-query-languages-5hbc</guid>
      <description>&lt;p&gt;Hi guys/girls,&lt;br&gt;
Recently I have been assigned a task which I need to translate 2, 3 rules of mapping logic from Speaking language into JavaScript expression and conditions.&lt;br&gt;
The way I managed to make it works is defining a bunch of possible answers then write many &lt;code&gt;ifs&lt;/code&gt; statements. But this seem to be quite hard for both the clients who want to change the mapping logic later on and me who need to maintain and explain to other members of the team.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;answer1&lt;/th&gt;
&lt;th&gt;answer2&lt;/th&gt;
&lt;th&gt;result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;mapping json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Yes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"No"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"No"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Yes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// FE will send to BE an array of answers and BE needs to return the result&lt;/span&gt;

&lt;span class="c1"&gt;// This is terrible for scaling or dynamic mapping logic &lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;answer1&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;answer2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;answer1&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;answer2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This really get me thinking about the magic behind of the SQL/non-SQL query languages, I really admire them.&lt;/p&gt;

&lt;p&gt;What if the &lt;code&gt;result&lt;/code&gt; is not just a number, may be it is another rule? How can we define a rule in json format (e.g: if the result is 1, I want to get all the odd numbers that is greater than 10) then read and execute it in JavaScript?&lt;/p&gt;

&lt;p&gt;I wonder if anyone in the community can give me a hint/a solution for this?&lt;/p&gt;

&lt;p&gt;Thank you so much.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>help</category>
    </item>
    <item>
      <title>How do you Think in Angular?</title>
      <dc:creator>Nhân Quách</dc:creator>
      <pubDate>Wed, 20 Feb 2019 03:51:54 +0000</pubDate>
      <link>https://dev.to/nhanquach/how-do-you-think-in-angular-nlp</link>
      <guid>https://dev.to/nhanquach/how-do-you-think-in-angular-nlp</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;I am new to Angular, I had used AngularJS before but since they released the Angular 2+, I had been lost and dropped out of the Angular world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/12rTjvF0ANQJsk/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/12rTjvF0ANQJsk/giphy.gif" alt="I do not want to be left out of the Angular world"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I really want make a comeback.&lt;/p&gt;

&lt;p&gt;I have scanned the official documentation (which I feel too overwhelming), I have watched tutorial, ... But I still can not really think in Angular.&lt;/p&gt;

&lt;p&gt;I have been a ReactJS developer for a while and I think that the ReactJS team has done an amazing job documenting their product with short but enough information without the feeling of too much.&lt;/p&gt;

&lt;p&gt;I would love to know your opinion about this. If you can share with me how can you think in Angular that would be awesome.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
