在四月2021(最新更新到JDK 11.0.11+9-0ubuntu2~18.04),用于支持TLSv1和TLSv1.1被放弃了,可能是因为2021年3月份以来的版本不再支持。从java.security文件中的差异可以看出这一点:
前:
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \
EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
Run Code Online (Sandbox Code Playgroud)
后:
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
Run Code Online (Sandbox Code Playgroud)
这也在这篇 SO 帖子中进行了讨论:SSLHandShakeException No Appropriate Protocol。在该线程中,自更新的 JDK 版本以来的最后几天还出现了更多答案。
这次更新JDK后,我们收到错误
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
Run Code Online (Sandbox Code Playgroud)
与c3p0.
切换到后,hikari …
我用 fastapi 和 uvicorn 进行了一项实验,但我不明白其结果。
关于代码
@app.get('/loadtest')
def root():
time.sleep(1)
return {'message': 'hello'}
Run Code Online (Sandbox Code Playgroud)
在 docker 中运行
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
Run Code Online (Sandbox Code Playgroud)
我进行了以下测试:
ab -c 100 -n 1000 localhost/loadtest
Run Code Online (Sandbox Code Playgroud)
这给了我结果:
bersling-2:cas bersling$ ab -c 100 -n 1000 localhost/loadtest
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed …Run Code Online (Sandbox Code Playgroud) 点击iframe后,当我嵌入这个gdrive iframe时,我的页面会跳到顶部:
<iframe height="400px" frameborder="0" width="600px" src="https://docs.google.com/document/d/1u9NFjTPBd-9mucQUPvkqLP84iV6uaEcJNF5vQdHmYh8/edit?usp=sharing&rm=embedded"></iframe>
Run Code Online (Sandbox Code Playgroud)
JSFiddle:https://jsfiddle.net/0qpe53os/
问题:为什么会这样做?如何防止它这样做?
我试着preventDefault没有任何运气.非常感谢您的帮助.
有没有办法复制包含对象版本的S3存储桶?
我读到一种复制存储桶的方法是使用命令行工具
aws s3 sync s3://<source> s3://<dest>
Run Code Online (Sandbox Code Playgroud)
但是,在源桶中,我有:
在同步桶中我有:
如您所见,版本ID为"null".有没有办法制作100%完全相同的副本,包括版本ID?这对我们的备份/开发服务器很重要,因为我们的应用程序依赖于版本ID.编辑:如果我在同步之前打开版本控制我得到的版本ID与null不同.但是版本ID与原始版本中的版本不同,目标是保留版本ID.我也尝试了cp命令,它产生了相同的结果.上述结果也记录在这里:
如果在目标存储桶上启用版本控制,Amazon S3会为要复制的对象生成唯一的版本ID.此版本ID与源对象的版本ID不同.Amazon S3在响应中的x-amz-version-id响应标头中返回复制对象的版本ID.
如果您未在目标存储桶上启用版本控制或挂起,则Amazon S3生成的版本ID始终为null.
所以看起来aws没有提供保存版本ID的方法?如果是这样,是否有解决方法或第三方软件?
使用 Angular,您有两个选项来加载脚本(js 和 css):
index.html:<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">angular.json:"styles": ["node_modules/font-awesome/css/font-awesome.css"]每个选项的优势是什么?据我了解,其中的内容angular.json捆绑在一起,而链接的脚本index.html则是动态加载的。所以它归结为讨论是使用预捆绑脚本还是从 CDN 加载它们更好?或者将脚本放入angular.json例如组织性质中是否还有其他好处?出于某种原因它“更干净”吗?
我真的很喜欢 Kotlin 中的这个功能:
在 Kotlin 中,if 是一个表达式,即它返回一个值。
Run Code Online (Sandbox Code Playgroud)// As expression val max = if (a > b) a else b
(来自https://kotlinlang.org/docs/reference/control-flow.html)
这也计划用于打字稿/JavaScript 吗?
更新:
在回复三元运算符的建议时,我当然也指带有 else if 的情况:
val bla = if ( 5 == 6) {
7
} else if (5 == 7) {
8
} else {
9
}
println(bla) // prints 9
Run Code Online (Sandbox Code Playgroud) 我已经使用typeorm(https://github.com/typeorm/typeorm)和NEST(https://github.com/nestjs/nest)设置了系统,但是TypeORM并未创建表或列。我的设置是这样的:
import {UserPassword} from '../user/user-password.entity';
import {User} from '../user/user.entity';
createConnection({
type: 'mysql',
host: 'typeorm2.cn32tstd6wqk.eu-central-1.rds.amazonaws.com',
port: 1234,
username: 'username',
password: 'password',
database: 'dbname',
entities: [
// __dirname + '/../**/*.entity{.ts,.js}'
UserPassword,
User
]
})
Run Code Online (Sandbox Code Playgroud)
实体是:
import {Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn} from 'typeorm';
@Entity()
export class UserPassword {
@PrimaryGeneratedColumn()
id: number;
@Column()
hash: string;
@Column()
algorithm: string;
}
Run Code Online (Sandbox Code Playgroud)
和
import {Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn} from 'typeorm';
import {UserPassword} from './user-password.entity';
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: …Run Code Online (Sandbox Code Playgroud) 目前我正在使用
htmlToText(html: string) {
const tmp = document.createElement('DIV');
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || '';
}
Run Code Online (Sandbox Code Playgroud)
为了任务。Angular 的做法是什么?或者这样做完全没问题吗?像这样直接访问会document导致问题吗,例如使用移动应用程序?
注意:有一个AngularJS 相关问题,但我正在寻找 Angular2+ 答案。另外,我不确定接受的答案中的正则表达式是否是正确的方法?
MDN 中有关如何设置 cookie 的示例如下Set-Cookie:
Set-Cookie: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure; HttpOnly
Run Code Online (Sandbox Code Playgroud)
在我见过的大多数地方,末尾都没有分号。我想知道,尾随分号可以吗?像这样的东西:
Set-Cookie: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure; HttpOnly;
Run Code Online (Sandbox Code Playgroud)
我只是好奇,RFC 说了些什么,不同的浏览器如何处理它,它们都接受它吗?
I found the following very simple way to automatically adjust a textarea to the text height in this jsfiddle http://jsfiddle.net/tovic/gLhCk/:
function expandTextarea(id) {
document.getElementById(id).addEventListener('keyup', function() {
this.style.overflow = 'hidden';
this.style.height = 0;
this.style.height = this.scrollHeight + 'px';
}, false);
}
expandTextarea('txtarea');Run Code Online (Sandbox Code Playgroud)
body {
padding:50px;
}
textarea {
margin:0px 0px;
padding:5px;
height:16px;
line-height:16px;
width:96%;
display:block;
margin:0px auto;
}Run Code Online (Sandbox Code Playgroud)
<textarea id="txtarea" spellcheck="false" placeholder="Statusku..."></textarea>Run Code Online (Sandbox Code Playgroud)
However, I'm using bootstrap in my project and this introduces problems.