我想制作一个满足以下条件的布局:
1)它顶部有一个块height
,其内容符合其内容
2)它下面有一个code-mirror
和一个块,它完全填写页面的其余部分height
.
我在这里做过一个傻瓜.问题是它运作良好Chrome 57.0.2987.133
,但它不能很好地工作Safari 10.1
:height
它code-mirror
是不够的; 它只显示76
代码行而不是正确的80
行.
有谁知道如何解决这一问题?
<style>
.rb {
display: flex;
flex-direction: column;
height: 100%;
}
.rb .container {
flex: 1;
display: flex;
width: 100%;
height: 100% /* new */
}
.rb .first-row {
border: 1px solid black;
/*flex: 0 0 60px;*/
}
.rb .CodeMirror {
flex: 1;
height: auto;
}
.rb .flex-preview {
flex: 1; …
Run Code Online (Sandbox Code Playgroud) 我想在我的 Windows 中运行一个 React 项目(作为我的 Mac 的虚拟机)。
在命令提示符下,运行后yarn
安装依赖项。我做到了yarn start
。它给了我'HTTPS' is not recognized as an internal or external command
错误。
> yarn start
yarn run v1.13.0
$ HTTPS=true CERT=cert/localhost.crt KEY=cert/localhost.key umi dev
'HTTPS' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这一问题?
编辑1:
我将节点升级到v12.16.1
(yarn
到1.13.0
,npm 到6.13.4
),并执行了yarn …
由于:: : 'a -> 'a list -> 'a list
用于向列表的开头添加元素,有人可以告诉我是否有一个函数将元素添加到列表的末尾?如果没有,我想这List.rev (element::(List.rev list))
是最简单的方法吗?
谢谢!
以前,我曾经$sce.trustAsHtml(aString)
在<html>...</html>
模板中注入一个字符串(例如),<div ng-bind-html="content"></div>
以便在加载生成的URL时显示图形:
.state('urls', {
url: '/urls/{id}',
template: '<div ng-bind-html="content"></div>',
controller: 'UrlCtrl',
resolve: {
url: ['$stateParams', 'urls', function ($stateParams, urls) {
return urls.get($stateParams.id);
}]
}
})
app.controller('UrlCtrl', ['$sce', '$scope', 'url', function($sce, $scope, url) {
$scope.content = $sce.trustAsHtml(url.content);
}]);
Run Code Online (Sandbox Code Playgroud)
现在,生成图形的html包含对其他文件的引用,例如<script src="script.js"></script>
.所以,我需要的文件的文件夹(.html
,.css
,.js
)绘制的图表.我可以将整个文件夹放在我的服务器中,但问题是如何将这些文件注入模板.
我试过templateUrl: 'http://localhost:3000/tmp/ZPBSytN5GpOwQN51AAAD/index.html'
,localhost:3000/#/urls/58b8c55b5d18ed6163324fb4
在浏览器中加载确实加载了html页面.但是,script.js
未加载,Failed to load resource: the server responded with a status of 404 (Not Found) …
我有一个文件Tools.ml
,其中包含我自己编写的一些常用实用程序函数.在.../Code/
我有几个文件夹,每个文件夹包含一个项目.我的问题是我应该放置这个Tools.ml
,以便所有文件夹和文件.../Code/
可以共享此模块Open Tools
.
希望我的问题很清楚......有没有人有一个好的解决方案?
编辑1:关注 @ gasche的回答,我写tools.ml
了如下:
module Tools =
struct
let a_function = ...
...
end
Run Code Online (Sandbox Code Playgroud)
然后我编译了它,并ocamlfind install tools META tools.cmo tools.cmx tools.ml
按照建议完成,看起来很顺利.然后我写test.ml
了如下:
open Tools
let f = Tools.a_function
Run Code Online (Sandbox Code Playgroud)
然后我编译了它ocamlc test.ml -o test
,然后我得到一个错误:
File "test.ml", line 1, characters 0-1:
Error: Error while linking test.cmo:
Reference to undefined global `Tools'
Run Code Online (Sandbox Code Playgroud)
谁能告诉我发生了什么?
我有许多用OCaml编写的程序,其中一些使用仿函数.现在,我正在考虑用F#编写和重写代码的一部分(以获得OCaml没有的一些优势).我害怕的一件事是在F#中编写代码,用于函数在OCaml中的功能.
type comparison = Less | Equal | Greater
module type ORDERED_TYPE = sig
type t
val compare: t -> t -> comparison
end
module Set =
functor (Elt: ORDERED_TYPE) -> struct
type element = Elt.t
type set = element list
let empty = []
let rec add x s =
match s with
[] -> [x]
| hd::tl ->
match Elt.compare x hd with
Equal -> s (* x is already in …
Run Code Online (Sandbox Code Playgroud) 我想将 Monaco Editor 版本升级到 v0.31.1。我这样做了npm install monaco-editor@0.31.1
,重新编译sudo PORT=8000 HTTPS=true ./node_modules/.bin/react-app-rewired start
给了我以下错误:
Failed to compile.\n\n./node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js 154:11\nModule parse failed: Unexpected token (154:11)\nFile was processed with these loaders:\n * ./node_modules/babel-loader/lib/index.js\nYou may need an additional loader to handle the result of these loaders.\n| dispose() {\n| onLanguageListener.dispose();\n> mode?.dispose();\n| mode = void 0;\n| }\n
Run Code Online (Sandbox Code Playgroud)\n有人可以帮忙吗?
\n编辑1:package.json
升级前\n :
Failed to compile.\n\n./node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js 154:11\nModule parse failed: Unexpected token (154:11)\nFile was processed with these loaders:\n * ./node_modules/babel-loader/lib/index.js\nYou may need an …
Run Code Online (Sandbox Code Playgroud) webpack babeljs monaco-editor babel-loader react-app-rewired
我正在尝试 OpenAI。
\n我已经准备好了训练数据,并使用了fine_tunes.create
. 几分钟后,显示Stream interrupted (client disconnected)
。
$ openai api fine_tunes.create -t data_prepared.jsonl\nUpload progress: 100%|\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 47.2k/47.2k [00:00<00:00, 44.3Mit/s]\nUploaded file from data_prepared.jsonl: file-r6dbTH7rVsp6jJMgbX0L0bZx\nCreated fine-tune: ft-JRGzkYfXm7wnScUxRSBA2M2h\nStreaming events until fine-tuning is complete...\n\n(Ctrl-C will interrupt the stream, but not cancel the fine-tune)\n[2022-12-02 11:10:08] Created fine-tune: ft-JRGzkYfXm7wnScUxRSBA2M2h\n[2022-12-02 11:10:23] Fine-tune costs $0.06\n[2022-12-02 11:10:24] Fine-tune enqueued. Queue number: 11\n\nStream interrupted (client disconnected).\nTo resume the stream, run:\n\n openai api fine_tunes.follow -i ft-JRGzkYfXm7wnScUxRSBA2M2h\n
Run Code Online (Sandbox Code Playgroud)\n我尝试了fine_tunes.follow
,几分钟后,仍然失败:
$ openai api fine_tunes.follow -i …
Run Code Online (Sandbox Code Playgroud) 在我的项目(使用git
)中,我需要使用一个仍在进行中的库.我决定为该库创建一个子模块,因为我想不时更新它的最新版本(我不打算在那里进行自己的更改).
我做了:
git submodule add https://github.com/mb21/JSONedit.git
git commit -am 'added JSNedit submodule'
git push -u origin master
git pull origin master
Run Code Online (Sandbox Code Playgroud)
然后,我确实在我的本地文件夹中看到了JSONedit文件夹,并在我的git文件夹中看到了一个链接.但是当我这样做时git submodule update --remote JSONedit/
,我得到了以下错误:
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'JSONedit'
Run Code Online (Sandbox Code Playgroud)
有谁知道这里有什么问题吗?
我正在使用Docusaurus 2构建一个网站。
我的网站将包含文档和博客。我想知道是否可以让访客在文章下面发表评论?
我想,如果我们支持评论,我们也需要网站的身份验证系统。
如果原生 Docusaurus 不支持此功能,是否有任何插件可以做到这一点?
ocaml ×3
angularjs ×1
babel-loader ×1
babeljs ×1
canvas ×1
codemirror ×1
css ×1
docusaurus ×1
f# ×1
flexbox ×1
functor ×1
git ×1
gpt-3 ×1
height ×1
javascript ×1
list ×1
module ×1
npm ×1
openai-api ×1
umijs ×1
webpack ×1
windows-10 ×1
yarnpkg ×1