Notebooks are where data scientists process, analyse, and visualise data in an iterative, collaborative environment. They typically run environments for languages like Python, R, and Scala. For years, data science notebooks have served academics and research scientists as a scratchpad for writing code, refining algorithms, and sharing and proving their work. Today, it's a workflow that lends itself well to web developers experimenting with data sets in Node.js.
To that end, pixiedust_node is an add-on for Jupyter notebooks that allows Node.js/JavaScript to run inside notebook cells. To learn more follow the setup steps and explore the getting started notebook or click on the sample image below to preview the output.
When the reader has completed this Code Pattern, they will understand how to:
You can run Node.js code in Watson Studio or your local environment:
To preview an example notebook without going through a setup follow this link.
A runtime environment in Watson Studio (IBM's Data Science platform) is defined by its hardware and software configuration. By default, Node.js is not installed in runtime environments and you therefore need to create a custom runtime environment definition. [Learn more about environments...]
Python 2 with Node.js
.Create
the environment definition.Add the nodejs conda package dependency, as shown below:
# Please add conda channels here
channels:
- defaults
# Please add conda packages here
dependencies:
- nodejs
# Please add pip packages here
# To add pip packages, please comment out the next line
#- pip:
Apply
the customization. It should look as follows:
You can now associate notebooks with this environment definition and run Node.js in the code cells, as illustrated in the getting started notebook.
Note: An environment definition is only available within the project that it was defined in.
The getting started notebook outlines how to
In the project you've created, add a new notebook from URL:
Enter any notebook name.
Specify remote URL https://raw.githubusercontent.com/IBM/nodebook-code-pattern/master/notebooks/nodebook_1.ipynb
as source.
Select the custom runtime environment Python 2 with Node.js.
you've created earlier.
Follow the notebook instructions.
You should be able to run all cells one at a time without making any changes. Do not use run all.
To get started with nodebooks you'll need a local installation of
To access the samples, clone this repository and launch a Jupyter server on your local machine.
$ git clone https://github.com/IBM/nodejs-in-notebooks.git
$ cd nodejs-in-notebooks
$ jupyter notebook notebooks/
Open nodebook_1 to learn more about
You should be able to run all cells one at a time without making any changes. Do not use run all.
Some of the nodebook code pattern examples access a read-only Cloudant database for illustrative purposes. If you prefer you can create your own copy of this database by replicating from remote database URL https://56953ed8-3fba-4f7e-824e-5498c8e1d18e-bluemix.cloudant.com/cities
. [Learn more about database replication...]
Open this link to preview the completed notebook.
This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.
学习了一段时间比较火的NodeJS, 记录一下我的问题和我理解的答案。 1. 为什么一个module中的this 不是global对象 而是 exports ? require是怎么实现的? 我试着用javascript 实现一个自己require 函数, 输入代码字符串,得到一个exports对象 function myRequire(content){ var exp
MySQL 中的 IN 运算符用来判断表达式的值是否位于给出的列表中;如果是,返回值为 1,否则返回值为 0。 NOT IN 的作用和 IN 恰好相反,NOT IN 用来判断表达式的值是否不存在于给出的列表中;如果不是,返回值为 1,否则返回值为 0。 IN 和 NOT IN 的语法格式如下: expr IN ( value1, value2, value3 ... valueN ) expr N
问题内容: 假设我有一个表,该表的列的取值范围是1到10。我需要选择除9和10以外的所有值的列。使用此查询时是否会有区别(在性能方面): 和这个? 问题答案: 当涉及到性能,你应该总是分析代码(即运行查询数千次,并使用某种测量每个回路的性能。样品)。 但是在这里,我强烈建议您使用第一个查询来更好地维护将来。逻辑是您需要除9和10之外的所有记录。如果将值11添加到表中并使用第二个查询,则应用程序的逻
Webstorm作为个javascript的IDE,提供了最天然的NodeJs支持,在Webstorm中,您可以运行、调试、自动提示NodeJs。 Webstorm 对 NodeJs 的支持 随便建个demo工程,建个 test.js,代码如下: var http = require('http'); server = http.createServer(function (req, res) {
Node.js 性能测试模拟器 Why? 性能测试时,可能需要一些系统外的被依赖服务的模拟器,常用性能测试工具如JMeter并没有模拟Server端的能力。如果是另外起个Tomcat,写些简单的模拟器——性能与容量是一个问题,因为被测试服务器集群可能有二十台机器,而跑模拟器的机器可能只有一两台。另一个是如果要快速修改输出内容,Tomcat的打包上传部署流程略显麻烦。 所以看上了Node.js。 另
Node.js 是运行在服务端的 JavaScript。 官网:https://haomo-tech.com 作者:毫末科技 邮箱:hxg@haomo-studio.com 官网:https://nodejs.org/en/ API文档:https://nodejs.org/dist/latest-v4.x/docs/api/ 教程:http://www.w3cschool.cn/nodejs/n
截至2016年2月26日,官方的列表中,并没有提供NodeJS的Http API接口的封装。 - -! 好在我们有Github,在上面搜索到一个: https://github.com/node-influx/node-influx 项目介绍写着的是支持0.9x版本的InfluxDB,我在0.10上试了下,基本可用。 因为是纯Http API接口,如果某些接口有问题的话,可以直接给他 pull r