密钥库密码背后的意义究竟是什么,例如在JKS/BKS密钥库上?
这显然不是为了安全,因为我可以用编辑器打开文件,并将所有条目复制到新文件中而不用passwordcheck.密码保护的密钥库中的数据未加密!
这个密码保护什么?它似乎只是为了烦人的开发者...
关于Grails 2(.3,.4)之前已经提出了类似的问题.我觉得很奇怪,我找不到办法做到这一点,因为它似乎是我的标准用例.
当我运行grails run-app时,我只想提供html页面,包括链接的.css和.js(angular和jquery内容).
我想检查我的http-calls是否在双方都正确处理 - 无需部署.war和配置数据库.
afaik grails run-app只是启动了一个jetty/tomcat - 这两个显然可以提供.html页面.我需要做些什么来使grails开发工具部署我的文件?
我需要发出http请求,所以使用不同的服务器会违反JS-SOP,而部署.war会大大减慢开发过程
到目前为止,我只发现了笨重的jsonp,代理,.war部署解决方案或grails 2.x的解决方案
我试图在项目的结构将文件放入几乎无处不在(/src/main,/src/main/resources,/src/main/public,资产文件夹及其子文件夹,在每一个子目录中创建web应用程序的目录中,init,域的conf目录-你的名字)
我已经阅读了Postgres发布的docs/wiki中的功能索引和仅索引扫描.
我现在有一个查询:
SELECT(xpath('/document/uuid/text()', xmldata))[1]::text,
(xpath('/document/title/text()', xmldata))[1]::text
FROM xmltable
WHERE(xpath('/document/uuid/text()', xmldata))[1]::text = 'some-uuid-xxxx-xxxx'
Run Code Online (Sandbox Code Playgroud)
和索引:
CREATE INDEX idx_covering_index on xmltable using btree (
((xpath('/document/uuid/text()', xmldata))[1]::text),
((xpath('/document/title/text()', xmldata))[1]::text)
)
Run Code Online (Sandbox Code Playgroud)
从逻辑上看,这个索引是覆盖索引,应该启用仅索引扫描,因为所有查询的值都包含在索引中(uuid和title)
我现在碰巧知道,如果函数调用中使用的列也包含在内,Postgres只识别覆盖函数索引的索引
例如.:
SELECT to_upper(column1) from table where id >10
Run Code Online (Sandbox Code Playgroud)
1)此索引不能涵盖:
CREATE INDEX idx_covering_index on xmltable using btree (id, to_upper(column1));
Run Code Online (Sandbox Code Playgroud)
2)但可以涵盖这一个:
CREATE INDEX idx_covering_index on xmltable using btree (column1, id, to_upper(column1));
Run Code Online (Sandbox Code Playgroud)
从而导致仅索引扫描.
如果我现在尝试使用我的xml设置:
CREATE INDEX idx_covering_index on xmltable using btree (xmldata,
((xpath('/document/uuid/text()', xmldata))[1]::text),
((xpath('/document/title/text()', xmldata))[1]::text)
)
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
数据类型xml没有访问方法"btree"的默认运算符类
很公平,不幸的是通常使用"text_ops"或"text_pattern_ops"不接受"xml"作为输入 - …
这个问题有点哲学。鉴于我有一个这样的方法:
public List<String> getStuffByName(@NotNull String name) throws SomeException {
return someDependency.createQuery().byName(name).list().stream()
.map(execution -> execution.getProcessInstanceId())
.collect(Collectors.toList());
}
Run Code Online (Sandbox Code Playgroud)
基本上它所做的就是调用一个依赖项方法,然后使用流 api 处理它。
单元测试 - 严格理解(?) - 只测试一个孤立的单元。所以我会模拟依赖项,因为我认为它们本身也是经过测试的单元。
如果我这样做,我最终会得到一个只包含在其他地方测试过的东西的方法。
例如,我的 JMockit 测试看起来像这样:
public void test_get_processes_for_bkey_2(@Mocked ExecutionQuery query,
@Mocked List<String> processes,
@Mocked List<Execution> executions,
@Mocked Stream<Execution> e_stream,
@Mocked Stream<String> pid_stream,
@Mocked Stream<String> pdef_stream
) {
new Expectations() {
{
someDependency.createQuery(); result = query;
query.byName("somefilter"); result = query;
query.list(); result = executions;
executions.stream(); result = e_stream;
e_stream.map((Function) any); result = fin_stream;
fin_stream.collect((Collector) any); result = processes; …Run Code Online (Sandbox Code Playgroud) 我是R的新手,并从网上提取了一些关于csv国家的测试数据.我目前正在策划与绘图的关系,并在创建世界失业的饼图时遇到了错误.
我发布了以下内容:
>values <- read.csv("D:\\test\\countrydata.csv")
>names(values)
[1] "name" "size" "pop" "unemployed" ...
>typeof(values$unemployed)
"integer"
>pie(values$pop)
Error in pie(values$unemployed) :
'x' values must be positive
>pie(values$pop, na.rm=TRUE)
Error in pie(values$unemployed, na.rm=TRUE) :
'x' values must be positive
Run Code Online (Sandbox Code Playgroud)
我想要绘制的数据集是一组整数,所有这些都是正数,0(感谢kim)或NA.
绘制整数时,0不是问题,我试过
>pie(as.integer(c(0,1,2,3))
Run Code Online (Sandbox Code Playgroud)
它工作得很好.
我在这里失踪了什么?
感谢致敬,
BillDoor
一个很简单的问题,但是我找不到解决方案:
我将gradle项目从eclipse导入netbeans,它可以无缝运行,即使我不得不与eclipse战斗,以至于几乎无法在eclipse上构建它。
剩下的唯一问题是,我希望能够将生成的.ear部署到wildfly-applicationserver并能够调试应用程序,这使我无法继续使用netbeans。
由于netbeans确实将该项目视为gradle项目,因此它没有在上下文菜单中为我提供可以部署到已配置的wildfly的选项,因此我已经可以运行和停止netbeans了。
在eclipse中,我可以在调试模式下将耳朵部署到本地wildfly,并将源附加在所有子项目(ejb.jar,...)上,以供Eclipse在调试时查找。
我该如何配置Netbeans来做到这一点?
我正在使用 resteasy 在一些安静的网络服务之间发送键/值对。
要发布这些对的列表,我使用此代码段
List<Pair> pairs = new ArrayList<>();
pairs.add(new Pair("name", "Arnold"));
pairs.add(new Pair("age", "20"));
ResteasyClient resteasyClient = getClient();
ResteasyWebTarget target = resteasyClient.target(targetURI);
Invocation.Builder request = target.request();
request.post(Entity.entity(entity, MediaType.APPLICATION_JSON_TYPE));
Run Code Online (Sandbox Code Playgroud)
Pair 只是一个未注释的类
public String key,
public String value
default constructor
(key,value) constructor
Run Code Online (Sandbox Code Playgroud)
目标资源通过以下方式接收:
@POST
@Path("/metadata")
@Consumes(MediaType.APPLICATION_JSON)
public Response postMetadata(List<Pair> properties) {...
Run Code Online (Sandbox Code Playgroud)
jax-rs 资源可以正确读取列表。
现在另一种方式是问题:
检索资源定义为:
@GET
@Path("/getUrl.../{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response getMetadata(@PathParam("id") String id) {
data_from_hibernate = em.find(id);
...
List<Pair> properties = new ArrayList<>();
//fill List from data
return Response.ok().entity(properties).build();
Run Code Online (Sandbox Code Playgroud)
客户端是:
Response …Run Code Online (Sandbox Code Playgroud) 我有一个相当简单的问题,但无法弄清楚我做错了什么 - 我在网上找到的解决方案似乎都不适合我:
在打开我的应用程序的某个部分时,会分派一个操作以从后端加载当前的 item-Id 列表。
检索到此列表后 - 我需要加载我刚刚获得 id 的所有项目。
( GET /api/items -> [1,2] -> GET /api/items/1, GET /api/items/2)
Run Code Online (Sandbox Code Playgroud)
我试图用这样的效果来解决这个问题:
我选择了 mergeMap,因为我想发出一系列动作,但不关心它们的顺序。
这样做
@Effect() loadList$: Observable<LoadAction[]> = this.actions$.pipe(
ofType<LoadListAction>(LOAD_LIST_ACTION),
mergeMap( _ =>
this.backendService.getItemIds().pipe(
filter( it => it.items.length > 0),
map(response => response.items.map(it => new LoadAction(it.id));
)
)
)
);
Run Code Online (Sandbox Code Playgroud)
给我这个错误:
"invalid action was dispatched" [{"type":"[ITEMS][INIT] load item", "payload":"1"}, {"type":"[ITEMS][INIT] load item", "payload":"2"}],
TypeError: Actions must have a type property
Run Code Online (Sandbox Code Playgroud)
这是有道理的,因为 observable 现在直接发出数组,所以我切换到了两次 mergeMap:
@Effect() loadList$: Observable<LoadAction[]> = this.actions$.pipe( …Run Code Online (Sandbox Code Playgroud) 因此,我的应用由一个简单的Web服务器提供服务,位于“ https:// localhost:8443 / app ”下,而同一个Web服务器在例如处返回json响应。“ https:// localhost:8443 / api / login ”。
TLS现已使用自签名证书设置。
当我请求该应用程序时,我收到证书警告,该警告将被跳过,然后我看到我的登录页面。
单击登录按钮后,Angular应用程序将执行
http.post<LoginResponse>('/api/login', body)
Run Code Online (Sandbox Code Playgroud)
它作为对“ http:// localhost:8443 / api / login ” 的发布请求显示在我的浏览器网络跟踪中。
我找不到任何有关此的信息,只有有关在使用angular-cli运行应用程序时如何处理tls的信息。
为什么该应用程序默认为http,我在哪里告诉它使用https?
我在查询的以下部分遇到问题:
IF EXISTS (SELECT * FROM sys.sequences seq JOIN sys.schemas sch ON seq.schema_id=sch.schema_id WHERE seq.name=N'LID' AND sch.name=N'dbo' )
DROP SEQUENCE [dbo].[LID]
GO
Run Code Online (Sandbox Code Playgroud)
它一直告诉我,这sys.sequences是一个未知的对象名称,seq.schema_id无法解决.
我运行SQL Server Express 2008 R2.
我该如何解决?