我创建了一个名为 simpleWeb 的 node.js 项目。该项目包含 package.json 和 index.js。
索引.js
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('How are you doing');
});
app.listen(8080, () => {
console.log('Listening on port 8080');
});
Run Code Online (Sandbox Code Playgroud)
包.json
{
"dependencies": {
"express": "*"
},
"scripts": {
"start": "node index.js"
}
}
Run Code Online (Sandbox Code Playgroud)
我还创建了一个 Dockerfile 来为我的 node.js 项目创建 docker 镜像。
文件
# Specify a base image
FROM node:alpine
# Install some dependencies
COPY ./ ./
RUN npm install
# Default command
CMD ["npm", …Run Code Online (Sandbox Code Playgroud) 我正在使用此代码上传文件。我想显示文件的内容,但我得到的只是 [目标文件] 而没有其他内容。有没有办法以 svelte 显示文件内容?
文件text2.txt:
1 2 3 4 5 6
7 8 9 10 11 1
Run Code Online (Sandbox Code Playgroud)
测试.svelte:
<script>
import { onMount } from "svelte"
// d3.csv(' http://127.0.0.1:8081/test.csv').then(function(data) {
// console.log(data[0])})
let files;
$: if (files) {
console.log(files);
for (const file of files) {
console.log(`${file.name}: ${file.size} bytes`);
}
}
</script>
<p>...from test</p>
<input type='file' bind:files>
{#if files}
<h2>Selected files:</h2>
{#each Array.from(files) as file,i}
<p>{file.name} ({file.size} bytes)</p>
<p>e: {file} i: {i}</p>
{/each}
<p>files length: {files.length}</p>
{/if}
Run Code Online (Sandbox Code Playgroud)
要重现此内容,只需将其粘贴到 svelte REPL 中即可。
我想画一个函数的泰勒展开式,例如:sin
from sympy import *
from sympy.plotting import *
m, x = symbols("m x")
plot(*Array([2, 4, 6]).applyfunc(lambda m: sin(x).series(x0=0, n=m)), (x, -pi/2, pi/2))
Run Code Online (Sandbox Code Playgroud)
但是,既然Array([2, 4, 6]).applyfunc(lambda m: sin(x).series(x0=0, n=m)给出了
sympy 无法绘制它们。
所以我想知道有没有办法删除O(x^n)?在 Mathematica 中,我可以用来Normal做到这一点。