di" delete inside quote
di( delete inside parenthen
d0 delete to begining
# create a file and (name your wish) , then add this content to the file. | |
# OR | |
# sudo vim /etc/systemd/system/jupyter-lab.service | |
# paste code below | |
# Esc , shift z z | |
[Unit] | |
Description=Start Jupyter Lab Server at Boot | |
[Service] |
To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.
For example;
docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
import * as tf from "@tensorflow/tfjs" | |
import "@tensorflow/tfjs-node" | |
import iris from "./iris.json" | |
import irisTesting from "./iris-testing.json" | |
// convert/setup our data | |
const trainingData = tf.tensor2d(iris.map(item => [ | |
item.sepal_length, item.sepal_width, item.petal_length, item.petal_width, | |
])) | |
const outputData = tf.tensor2d(iris.map(item => [ |
library(caret) | |
library(tm) | |
# Training data. | |
data <- c('Cats like to chase mice.', 'Dogs like to eat big bones.') | |
corpus <- VCorpus(VectorSource(data)) | |
# Create a document term matrix. | |
tdm <- DocumentTermMatrix(corpus, list(removePunctuation = TRUE, stopwords = TRUE, stemming = TRUE, removeNumbers = TRUE)) |
[{"id":"d3a698fb.007c88","type":"inject","z":"fa9050d8.3686","name":"Start","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":130,"y":80,"wires":[["47e40795.d58228"]]},{"id":"47e40795.d58228","type":"function","z":"fa9050d8.3686","name":"LoadCV","func":"var require = global.get('require');\n// try for global install\nvar cv = null\ntry{\n cv = require.main.require('opencv');\n} catch(e){\n cv = require('opencv');\n}\nif (cv === null){\n node.warn('node-opencv not found');\n return;\n}\n\nvar cvdesc = Object.keys(cv);\nnode.send([null, {payload:cvdesc}]);\nflow.set('cv', cv);\n\nnode.send({payload:1});\nnode.send({payload:'next'});\n","outputs":"2","noerr":0,"x":260,"y":80,"wires":[["46d283a6.ce321c"],[]]},{"id":"46d283a6.ce321c","type":"function","z":"fa9050d8.3686","name":"GetImage","func":"\n\nif (msg.payload === 0){\n var vid = flow.get('cvvid');\n if (vid){\n node.warn(util.inspect(vid));\n vid.release();\n flow.set('cvvid', null) |
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
/** | |
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
* | |
* @param string url | |
* @param object callback | |
* @param mixed data | |
* @param null x | |
*/ | |
function ajax(url, callback, data, x) { | |
try { |