这可能听起来很愚蠢,但为什么我需要在我的@Entitys中定义一个空构造函数?
我看到的每个教程都说:每个实体都需要一个空的构造函数.
但Java总是给你一个默认的不可见的空构造函数(如果你不重新定义一个).
谢谢.
我认为存在语义问题.我对"需要"所理解的是写作.
含义:始终在实体中编写一个空构造函数.
例:
@Entity
public class MyEntity implements Serializable {
@Id
private String str;
public MyEntity(){}
//here getter and setter
}
Run Code Online (Sandbox Code Playgroud)
但是当你不重新定义它时,Java总是给你这个空的构造函数(用参数写另一个).
在这种情况下,编写这个空构造函数似乎没用.
所以我有这个弹性搜索安装,在插入数据与logstash,用kibana可视化它们.
conf文件中的所有内容都被注释,因此它使用的是与弹性搜索文件夹相关的默认文件夹.
1/ I store data with logstash
2/ I look at them with kibana
3/ I close the instance of elastic seach, kibana and logstash
4/ I DELETE their folders
5/ I re-extract everything and reconfigure them
6/ I go into kibana and the data are still there
Run Code Online (Sandbox Code Playgroud)
这怎么可能?
但是,此命令将删除数据: curl -XDELETE 'http://127.0.0.1:9200/_all'
谢谢.
ps:忘了说我在窗户上
我在过去的2个小时里一直在努力.我正在使用xp-dev作为git存储库提供程序(因为我已经付费并且我在那里有svn repo)我已经给了xp-dev我的公钥.
但克隆我的回购时,我被拒绝了.
"C:\Program Files (x86)\Git\bin\git.exe" clone -v --recurse-submodules --progress "ssh://xp-dev.com/repogit" "c:/ProjetPerso/repogit"
Cloning into 'c:/ProjetPerso/repogit'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Done
Run Code Online (Sandbox Code Playgroud)
根据我从各种博客的理解,git扩展应该让我加载我的私钥,除非它没有.
我尝试启动putty authentification客户端(即使我选择openSSH)并在里面加载我的私钥,但它什么都没改变.
有任何想法吗?
谢谢.
我正在制作显微镜滤镜生成器,首先绘制svg图像,然后将它们转换为3D以进行3D打印.
我用'svgwrite'
然而,这个librayry生成svg与形状(线,圆等),当时我不知道,但每个3D转换librayry /软件需要svg包含路径.
是否有一个librayry生成带路径的svg文件(但允许我在脚本中轻松绘制圆圈,线等?)
或者有没有办法将这些svg形状转换为svg路径?
我当前svg的形状示例:
<?xml version="1.0" encoding="utf-8" ?>
<svg baseProfile="tiny" height="100%" version="1.2" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs />
<circle cx="270" cy="270" fill="white" r="135.0" stroke="black" stroke-width="10" />
<circle cx="270" cy="270" r="25.0" />
<line stroke="black" stroke-width="10" x1="270" x2="270" y1="270" y2="135.0" />
<line stroke="black" stroke-width="10" x1="270" x2="405.0" y1="270" y2="347.9423" />
<line stroke="black" stroke-width="10" x1="270" x2="135.0" y1="270" y2="347.9423" />
</svg>
Run Code Online (Sandbox Code Playgroud)
谢谢.
PS:请注意我必须这样做,因为我打算生成很多过滤器.
有没有办法从函数本身内部获取 Lambda\xe2\x80\x99s 日志流的名称(如 Lambda 控制台的 \xe2\x80\x9cmonitor\xe2\x80\x9d 选项卡中显示的那样)?我有数百万个使用 Python 运行的 AWS Lambda 函数,我希望将每个日志流\xe2\x80\x99s 名称输出到我们的结果文件中,以便更轻松地查找日志。
\n日志流名称如下所示:
\nYYYY/MM/DD/[$latest]45ea5df5ec5a4f15e1f5af8a5f12e8\nRun Code Online (Sandbox Code Playgroud)\n 所以我从sqlExtractor获取数据,我无法触及sqlExtractor.问题是sqlExtractor给我一个元组列表(我想列出一个列表)
所以我想到了这个:
myNewList = []
for tuple in myList:
myNewList.append(list(tuple))
Run Code Online (Sandbox Code Playgroud)
问题是,我的数据充满了"u",这是什么意思?他们并没有真正打扰我,但因为myNewList [i] [j]将返回没有"u"的值.但我想明白.
那么,他们是什么?
谢谢.
示例 - 转换前后的元组:
(u'Pado', u'Seba*', u'B31', u'27/02/2011', u'SINA', u'2', u'5', u'Paris', u'Zone bleu', u'211')
[u'Pado', u'Seba*', u'B31', u'27/02/2011', u'SINA', u'2', u'5', u'Paris', u'Zone bleu', u'211']
Run Code Online (Sandbox Code Playgroud) 我正在使用 Flask 和 pygal 制作一个网站。
为了绘制图表,我将其放入我的网页中:
<div class="graph-area">
<div align="center">
<embed type="image/svg+xml" src={{graph_data|safe}} />
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
.graph-area{
margin-left:255px;
height:500px;
margin-bottom: 5px;
border-radius: 10px;
}
Run Code Online (Sandbox Code Playgroud)
@app.route("/test")
def test():
custom_style = Style(
background='transparent',
plot_background='transparent',
foreground='#53E89B',
foreground_strong='#53A0E8',
foreground_subtle='#630C0D',
opacity='.6',
opacity_hover='.9',
transition='400ms ease-in')
graph = pygal.Line(width=500, height=400, style=custom_style)
graph.title = 'Food intake'
graph.x_labels = ['lundi','mardi','mercredi','jeudi','vendredi','samedi']
graph.add('Proteins', [15, 16, 17, 15, 10, 15])
graph.add('Lipids', [40, 45, 40, 42, 45, 42])
graph.add('Carbs', [21, 22, 22, 20, 18, 16])
graph.add('Net carbs', [12, 11, 11, 11, 10, 13]) …Run Code Online (Sandbox Code Playgroud) 我制作了这个脚本,它删除了每个尾随的空白字符,并用正确的字符替换了所有坏的法语字符。
删除尾随的空白字符有效,但不是替换法语字符的部分。
要读/写的文件以 UTF-8 编码,因此我在脚本上方添加了 utf-8 声明,但最后每个坏字符(如 \u00e9)都被小方块替换。
知道为什么吗?
脚本 :
# --*-- encoding: utf-8 --*--
import fileinput
import sys
CRLF = "\r\n"
ACCENT_AIGU = "\\u00e9"
ACCENT_GRAVE = "\\u00e8"
C_CEDILLE = "\\u00e7"
A_ACCENTUE = "\\u00e0"
E_CIRCONFLEXE = "\\u00ea"
CURRENT_ENCODING = "utf-8"
#Getting filepath
print "Veuillez entrer le chemin du fichier (utiliser des \\ ou /, c'est pareil) :"
path = str(raw_input())
path.replace("\\", "/")
#removing trailing whitespace characters
for line in fileinput.FileInput(path, inplace=1):
if line != CRLF:
line = line.rstrip()
print …Run Code Online (Sandbox Code Playgroud) 我有引用一个层的 lambda,该层由其他人维护,当发布新版本时,我必须更新我的 terraform 代码以将最新版本放入 arn(此处为 19)。
有没有办法在 terraform 脚本中获取最新版本并使用它?
module "lambda_function" {
source = "terraform-aws-modules/lambda/aws"
function_name = "my-lambda1"
description = "My awesome lambda function"
handler = "index.lambda_handler"
runtime = "python3.8"
source_path = "../src/lambda-function1"
tags = {
Name = "my-lambda1"
}
layers = [
"arn:aws:lambda:eu-central-1:587522145896:layer:my-layer-name:19"
]
}
Run Code Online (Sandbox Code Playgroud)
谢谢。
ps:这意味着该图层的 terraform 脚本不在我的脚本中,它是我无权访问的其他脚本。