<?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 Naomi Lai Culaclii on Medium]]></title>
        <description><![CDATA[Stories by Naomi Lai Culaclii on Medium]]></description>
        <link>https://medium.com/@eveafeline?source=rss-148ece7a1909------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dFN57G6_4a2L7Ww6.</url>
            <title>Stories by Naomi Lai Culaclii on Medium</title>
            <link>https://medium.com/@eveafeline?source=rss-148ece7a1909------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:55:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eveafeline/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[Jupyter without Jupyter: Running Python Scripts in my JavaScript Application]]></title>
            <link>https://medium.com/@eveafeline/jupyter-without-jupyter-a0f0c43c79be?source=rss-148ece7a1909------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0f0c43c79be</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Naomi Lai Culaclii]]></dc:creator>
            <pubDate>Fri, 12 May 2017 00:30:28 GMT</pubDate>
            <atom:updated>2017-05-12T00:34:18.910Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to do data processing as a JavaScript engineer, you’ll quickly learn the mathematical limitations of JavaScript. For data, we turn to Python, a long favorite of many scientists.</p><p>As a JavaScript engineer, I’ve learned to love the easy of web development with JavaScript. Having recently discovered Electron, it’s opening up new worlds in the world of JS for me. From online to offline, JS seems to be key to dominating app creations of the future.</p><p>So, how do you get these two major technologies to work together? How can I quick prototype an offline app with JavaScript and have it run Python codes?</p><p>A quick search on the Internet will lead most people to Jupyter Notebook. Jupyter Notebook was once called iPython Notebook, and from that second name we can easily decipher the core of what Jupyter does. In a snippet, Jupyter Notebook uses the iPython kernel (and other kernels for other languages) to create a coding environment where users can input code and see immediate results of their code output. It’s kind of like a Python playground on steroids.</p><p>However, I wanted something that’s even more customizable than Jupyter Notebook, and as something I can integrate into my current application as a JavaScript component. Basically, I wanted to create a Jupyter Notebook without the Jupyter.</p><p>Here’s a brief walk-through of how I went about it.</p><p>Since I am running on Electron, I needed to first embed an express server inside of Electron’s main process:</p><pre>var server = require(‘./app’);</pre><p>Then I create the app.js in the directory where I put all my usual express server codes wrapped in an iife:</p><pre>(function() { <br>    var express = require(&#39;express&#39;);<br>    var app = express();<br>    ...<br>}());</pre><p>The key to linking your Python script with your JavaScript application is the magic that is <a href="https://github.com/extrabacon/python-shell">python-shell</a>, an npm package that can be easily required into your express server and run your Python scripts from your JavaScript applications.</p><p>After you npm install python-shell, you need to require it into your app.js file:</p><pre>var PythonShell = require(&#39;python-shell&#39;);</pre><p>After the package is required, you can now send information to your Python script, run your Python script and get returned values from your Python script.</p><p>To with with any information to/from your Python script, first you want to set up the path to your .py file:</p><pre>var pyshell = new PythonShell(&#39;py/main.py&#39;, { scriptPath: publicPath } );</pre><p>In my case, I called it main. The option (after py/main.py) here includes scriptPath, which I set as my publicPath, leading to the folder where I am keeping all of my application related files. Then you can send and receive information from your Python files using the .send and .on methods:</p><pre>pyshell.send(req.body.url);<br>pyshell.on(&#39;message&#39;, function (message) {<br>    console.log(message)<br>});<br>pyshell.end(function (err) {<br>    if (err) throw err;<br>    console.log(&#39;finished&#39;);<br>});</pre><p>Just remember to end your process and to use ‘print’ in your Python script to return the values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0f0c43c79be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vue Listing: Starting a List App in Vue.js]]></title>
            <link>https://medium.com/@eveafeline/displaying-a-list-in-vue-js-7fe1fe6de80?source=rss-148ece7a1909------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fe1fe6de80</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Naomi Lai Culaclii]]></dc:creator>
            <pubDate>Fri, 07 Apr 2017 00:33:08 GMT</pubDate>
            <atom:updated>2017-04-07T00:35:01.775Z</atom:updated>
            <content:encoded><![CDATA[<p>Vue.js is a light-weight front-end framework designed created by Evan You after he worked for Google on Angular.js. You wanted to create something that encapsulated everything he liked about Angular, but is light weight enough to out-perform React. Here is a quick performance comparison between Vue and React. At its fasted, Vue is nearly <strong>3 times</strong> <strong>faster</strong> than React. At its slowest, it’s still approximately <strong>25%</strong> <strong>faster</strong>.</p><p>Today we’ll work on a basic list app written in Vue.js to demonstrate its ease of operation.</p><p>First you need to install Vue to your directory.</p><pre>$ npm install vue --save</pre><p>Then you would create two files, an index.html file to put your display in and a app.js file where you will be writing your Vue.js codes.</p><p>Let’s start by creating a Vue instance.</p><pre>const list = new Vue ({...});</pre><p>Inside of your new Vue instance, declare where your elements will be sitting.</p><pre>const list = new Vue({<br>  el: &#39;#messages&#39;,...</pre><p>Let’s put some basic data in there to display on opening the page.</p><pre>...<br>data: {<br>    title: &quot;Transcript&quot;,<br>    messages: [<br>      {<br>        username: &#39;littleToy&#39;,<br>        createdAt: new Date(Date.now()),<br>        message: &quot;how ya&#39;ll doing?&quot;<br>      },<br>      {<br>        username: &#39;kbbqiu&#39;,<br>        createdAt: new Date(Date.now()),<br>        message: &quot;what? CSS sucks&quot;<br>      },<br>      {<br>        username: &#39;Naomi&#39;,<br>        createdAt: new Date(Date.now()),<br>        message: &quot;testing Vue. I&#39;m boring, I know&quot;<br>      }<br>    ]<br>  },<br>...</pre><p>In your index.html page, add the following to display the list.</p><pre>&lt;div id=&quot;messages&quot;&gt;<br>  &lt;ul&gt;<br>    &lt;li v-for=&quot;(msg, index) in messages&quot;&gt;<br>      {{ msg.username }} || <br>      {{ msg.createdAt }} || <br>      {{ msg.message }}<br>    &lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/div&gt;</pre><p>If you open your index.html page in your browser, you should see the below display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*gs056iphjjX0PbskGwEHgQ.png" /></figure><p>Next post we’ll work on making it interactive by adding some methods to the Vue instance.</p><p>Sources:<br><a href="https://vuejs.org/">https://vuejs.org<br></a><a href="https://vuejs.org/v2/guide/comparison.html">https://vuejs.org/v2/guide/comparison.html</a><br><a href="https://en.wikipedia.org/wiki/Vue.js">https://en.wikipedia.org/wiki/Vue.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fe1fe6de80" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>