<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://tech.saigonist.com/taxonomy/term/26/all" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>javascript</title>
    <link>http://tech.saigonist.com/taxonomy/term/26/all</link>
    <description></description>
    <language>en</language>
          <item>
    <title>JavaScript Namespaces and Closures instead of Global Variables</title>
    <link>http://tech.saigonist.com/b/code/javascript-namespaces-and-closures-instead-global-variables</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;July 12, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/closure&quot;&gt;closure&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/namespace&quot;&gt;namespace&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Have you heard? Global variables are bad, mmkay? So what should we do if we want to create a variable in our script and be able to refer to it elsewhere, globally?&lt;/p&gt;

&lt;h2&gt;What&#039;s in a Namespace?&lt;/h2&gt;

&lt;p&gt;A JavaScript namespace is just an idea or practice rather than an explicit feature of JavaScript. That is, you don&#039;t create a &quot;namespace object&quot; or declare a namespace. Instead, you would implement a namespace by creating and using an object which would contain sub-variables within it, so that those variables didn&#039;t pollute the namespace of the global scope (i.e. everything under the...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 12 Jul 2016 07:07:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">92 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Cross-platform node scripts: better-npm-run to the rescue</title>
    <link>http://tech.saigonist.com/b/code/cross-platform-node-scripts-better-npm-run-rescue</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;June 6, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;We know that Node.js is awesome and JavaScript is the ultimate cross-platform language. Node has support for Windows despite the node command being a command line program. Windows users can use the command line shell for node. But the Windows shell environment isn&#039;t completely compatible with what Unix/Linux/Mac users are used to (i.e. Bash). The npm package Better-npm-run helps deal with running tasks with node across platforms including Windows.&lt;/p&gt;

&lt;p&gt;Get it here: &lt;a href=&quot;https://www.npmjs.com/package/better-npm-run&quot;&gt;https://www.npmjs.com/package/better-npm-run&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 06 Jun 2016 04:47:55 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">91 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Embed a YouTube video player and control it via JavaScript</title>
    <link>http://tech.saigonist.com/b/code/embed-youtube-video-player-and-control-it-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;May 14, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/youtube&quot;&gt;youtube&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/mobile&quot;&gt;mobile&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/safari&quot;&gt;safari&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;YouTube has long made it easy to share and embed videos into websites by giving you the HTML code to just copy and paste wherever you like. Over the years, different technologies have been used to play videos on the web, from Flash &lt;code&gt;object&lt;/code&gt; elements to pure HTML5. YouTube&#039;s newest API for adding videos to web pages takes care of the technology, automatically choosing the best delivery method on a user by user basis.&lt;/p&gt;

&lt;p&gt;YT did have something called the &quot;YouTube JavaScript Player API&quot; but this is out of date so don&#039;t use it. Instead use the new...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 13 May 2016 21:32:09 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">89 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>How to detect a swipe touch event on mobile browsers with JavaScript</title>
    <link>http://tech.saigonist.com/b/code/how-detect-swipe-touch-event-mobile-browsers-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;May 14, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/mobile&quot;&gt;mobile&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/swipe&quot;&gt;swipe&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Browsers have supported various mouse-based events like clicks, down to the detection of when the mouse button is down and when it&#039;s released. You can know the coordinates of the mouse cursor, all in JavaScript. Mobile interfaces have brought some new gestures beyond what desktops provided. One big set of such UI events is from the smartphone&#039;s screen allowing touch and even multi-touch. Multitouch allows more types of UI events.&lt;/p&gt;

&lt;p&gt;Many mobile apps support swiping, not just as a way to move a visible object around thescreen but applied for the whole screen. Tinder uses left swipe and...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 13 May 2016 17:19:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">88 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Move a div element to another div using jQuery</title>
    <link>http://tech.saigonist.com/b/code/move-div-element-another-div-using-jquery</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 21, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/jquery&quot;&gt;jquery&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/dom&quot;&gt;dom&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;jQuery is good for many things related to the DOM - both querying and manipulating. Yes, we can move elements from one position to another with the help of jQuery, or add completely new elements (as in literal HTML text strings) anywhere in the DOM just by having a selector, and if a selector applies to multiple DOM nodes then adding into multiple places can be done with one call.&lt;/p&gt;

&lt;p&gt;jQuery provides many functions for moving or adding elements/content: &lt;code&gt;after&lt;/code&gt;, &lt;code&gt;append&lt;/code&gt;, &lt;code&gt;appendTo&lt;/code&gt;, &lt;code&gt;before&lt;/code&gt;, &lt;code&gt;insertAfter&lt;/code&gt;, &lt;code&gt;insertBefore&lt;/code&gt;...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 20 Mar 2016 18:26:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">84 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>What is Package.json</title>
    <link>http://tech.saigonist.com/b/code/what-packagejson</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 18, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/npm&quot;&gt;npm&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/json&quot;&gt;json&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;If you&#039;re looking at some JavaScript code you got from elsewhere, probably Node.js packages, you&#039;ll notice each has a file called &#039;package.json&#039;. This will be in the module&#039;s base or root directory. This file is a sort of manifest file for the module, most likely an &lt;em&gt;npm&lt;/em&gt; module/package. Any package listed at npmjs.com needs a package.json, and the absolute minimum the file should contain is the package&#039;s name and version. The name and version make up a unique key for the package within npmjs.&lt;/p&gt;

&lt;p&gt;The file usually contains much more than name and version. You can guess by the...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 18 Mar 2016 09:09:24 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">80 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Stack traces, backtraces, call stacks explained in JavaScript, Python, PHP</title>
    <link>http://tech.saigonist.com/b/code/stack-traces-backtraces-call-stacks-explained-javascript-python-php</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 12, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/stack&quot;&gt;stack&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/call-stack&quot;&gt;call stack&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/stack-trace&quot;&gt;stack trace&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/php&quot;&gt;php&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/python&quot;&gt;python&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/bash&quot;&gt;bash&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;People are rarely happy to see a stack trace. A stack trace often appears when software encounters an exception, an unexpected error which can&#039;t be handled gracefully and therefore most stop execution of the program. What the stack trace shows is what was happening in the moments leading up to the bug. The stack is called a stack because each item (each function call) is stacked on top of the previous one in a special part of computer memory called the stack. Most computers and programming languages work with a stack. In programs written in programming languages without side effects, a...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 11 Mar 2016 19:37:27 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">64 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Scala vs Javascript (ES6, TypeScript, Node.js)</title>
    <link>http://tech.saigonist.com/b/code/scala-vs-javascript-es6-typescript-nodejs</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 5, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/scala&quot;&gt;scala&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/typescript&quot;&gt;typescript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Now with Scala.js allowing isomorphic Scala code to run on both browser and server. Scala contends with JavaScript in the web domain. But assuming we are talking about web, how do the two languages compare?&lt;/p&gt;

&lt;p&gt;First, JavaScript comes in a few flavors. There&#039;s ES5 which is currently running in all browsers. There&#039;s Node.js, which is the same Google V8 JavaScript engine but running outside the browser and thus without browser/web apis included, but which can run ES6 (EcmaScript 6). And then there are the many languages that compile or transpile down to plain old ES5 JavaScript,...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sat, 05 Mar 2016 06:22:01 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">57 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Random number generation in JavaScript</title>
    <link>http://tech.saigonist.com/b/code/random-number-generation-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 4, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/random&quot;&gt;random&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/crypto&quot;&gt;crypto&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Generating a random number in JavaScript is simple if you don&#039;t care about quality, more complicated if you do. When I say &quot;in JavaScript&quot; I mean both of the JavaScript runtimes - the browsers with their DOM/window, and Node.js without those things - and without all the modern browser APIs.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;The default, old-fashioned way to get a random number in JavaScript is by using Math.random(). However, the numbers produced from Math.random() are not secure for crypto applications as they are known to contain predictable patterns. The reason for this non-randomness isn&#039;t simply&lt;/p&gt;&lt;/li&gt;...&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 04 Mar 2016 16:35:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">38 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Python-like List Comprehensions in JavaScript</title>
    <link>http://tech.saigonist.com/b/code/python-list-comprehensions-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 4, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/python&quot;&gt;python&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/functional&quot;&gt;functional&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/lambda&quot;&gt;lambda&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Python has a neat syntactic feature where you can take a literal list constructor&#039;s bracket notation (e.g. &lt;code&gt;[2, 4, 6, 8, 10]&lt;/code&gt;) but have code statements generate the list&#039;s contents. So instead of writing out the 5 even numbers in the example, one could write &lt;code&gt;[(x+1)*2 for x in range(5)]&lt;/code&gt; which turns out to be more characters but you can imagine the savings if the series in the list was longer. Instead of &lt;code&gt;range()&lt;/code&gt; we could have a literal list &lt;code&gt;[0, 1, 2, 3, 4]&lt;/code&gt; or even a generator function, anything which is iterable.&lt;/p&gt;

&lt;p&gt;How could we do this...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Thu, 03 Mar 2016 17:19:43 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">51 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>The Difference between JavaScript and Java</title>
    <link>http://tech.saigonist.com/b/code/difference-between-javascript-and-java</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 1, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/java&quot;&gt;java&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/nodejs&quot;&gt;node.js&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Many non-programmers and young programmers are confused by the names Java and JavaScript. In fact, JavaScript was renamed to JavaScript as an afterthought and a co-marketing campaign together with Sun (the creator of Java). But there are succinct jokes for this naming coincidence: Java and JavaScript are the same like car and carpet, or ham and hamster.&lt;/p&gt;

&lt;p&gt;First, the similarities. On a cursory look, some of the syntax of Java and JavaScript code look alike. This is because they&#039;re somewhat descended from C (putting them in the Algol family but they are both more similar to C than...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Tue, 01 Mar 2016 06:14:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">36 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Isomorphic JavaScript myth</title>
    <link>http://tech.saigonist.com/b/code/isomorphic-javascript-myth</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;February 26, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/isomorphic&quot;&gt;isomorphic&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Isomorphic JavaScript is the idea of writing JavaScript that can run on the server just as well as in the browser, thus your otherwise frontend-only single page app (SPA), which only makes HTML appear after some post-load requests and execution, can also render the same HTML server-side (which is how things used to work) and give something to search engines to understand. AngularJS required hacks using PhantomJS to achieve this, by running a headless browser on your server.&lt;/p&gt;

&lt;p&gt;In theory, a full stack web developer then only needs to know one language - JavaScript. In practice, knowing...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Fri, 26 Feb 2016 05:58:47 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">35 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Creating forms with callbacks in React+Redux</title>
    <link>http://tech.saigonist.com/b/code/creating-forms-callbacks-reactredux</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;February 21, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/react&quot;&gt;react&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/redux&quot;&gt;redux&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;In React, you have some simple/dumb components which are just html and other components and maybe render some values which are passed in. It becomes a little trickier when you want to add some functionality to the component, such as form elements - inputs and buttons and submit actions. What I mean by &quot;forms with callbacks&quot; is that you want to execute some JavaScript and also change state in your React app, but do so without giving direct access to state to the component. Instead here&#039;s one way to do it.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Draw out the HTML (don&#039;t worry about using React components yet) in JSX&lt;/li&gt;...&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sat, 20 Feb 2016 18:06:33 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">34 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title> Quick explanation of JavaScript Promises</title>
    <link>http://tech.saigonist.com/b/code/quick-explanation-javascript-promises</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;February 14, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/promises&quot;&gt;promises&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;h2&gt;&quot;JavaScript Promises: reason about async events, serially chain them, reduce them. General replacement for XHR&quot;&lt;/h2&gt;

&lt;p&gt;What is a promise? Conceptually and outside the context of code, a promise is either a willful intention of achieving a result or a promise is considered the actual result itself. EcmaScript 6 (ES6) introduces the Promises API which is currently implemented by most browsers (and Edge but not IE according to &lt;a href=&quot;http://caniuse.com/#feat=promises&quot;&gt;caniuse.com&lt;/a&gt; - but there&#039;s a polyfill for that). So a JavaScript Promise is simply an object of some callback...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Sun, 14 Feb 2016 16:27:08 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">33 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>Assembly language vs Bytecode vs WebAssembly vs Asm.js</title>
    <link>http://tech.saigonist.com/b/code/assembly-language-vs-bytecode-vs-webassembly-vs-asmjs</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;January 18, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/asmjs&quot;&gt;asm.js&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/assembly&quot;&gt;assembly&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/bytecode&quot;&gt;bytecode&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/java&quot;&gt;java&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/jvm&quot;&gt;jvm&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/webassembly&quot;&gt;webassembly&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;h1&gt;Assembly&lt;/h1&gt;

&lt;p&gt;In the beginning there was a CPU. And the CPU could be loaded with data which were numbers and these magical numbers would cause the CPU to process those numbers and produce new numbers. This data which the CPU was running, the numbers fed into the computer, was machine code. And all programming of computers that&#039;s still done today ultimately ends up turning into machine code for the CPU, binary machine code being the only thing a computer can understand.&lt;/p&gt;

&lt;p&gt;But long series of numbers, where each 256 or more unique numbers has special meaning which changes depending...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Mon, 18 Jan 2016 08:20:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">32 at http://tech.saigonist.com</guid>
  </item>
  </channel>
</rss>
