小编Mat*_*922的帖子

为什么SVG笔划宽度:1使线条透明?

我正在使用svg创建股票图表,当我将路径元素的笔触宽度设置为1时,我遇到了问题.而不是使线条更窄,它只是使它与笔划宽度相同:2但略透明.我不能发布它的图像,因为我没有足够的声誉点...

我的svg标签看起来像这样:

<div style="height:300px; width:400px; overflow:hidden">
<svg style="position:relative" height="10000" width="10000" version="1.1" xmlns="http://www.w3.org/2000/svg">
</svg>
</div>
Run Code Online (Sandbox Code Playgroud)

我正在使用javascript/jquery动态添加路径元素:

var shape = document.createElementNS("http://www.w3.org/2000/svg", "path");
$(shape).attr({"d":"...",
               "fill":"none",
               "stroke":color,
               "stroke-width":"1"});
$("svg").append(shape);
Run Code Online (Sandbox Code Playgroud)

我省略了路径d属性的值,因为它有点长.此外,color是一个字符串变量,它在前面确定为"绿色","红色"或"黑色".

我的代码中是否存在导致此问题的错误或是否是另一个问题?

svg transparent width stroke

29
推荐指数
3
解决办法
2万
查看次数

抛出NoSuchAlgorithException的Java SSL代码

我正在开发一个我想要添加SSL的项目,所以我创建了一个简单的客户端/服务器测试实现,看看它是否有效,我得到一个NoSuchAlgorithmException.以下是我抛出异常的服务器代码:

import java.io.*;
import java.net.*;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;

import javax.net.ssl.*;

public class SslServer
{
    private static final int PORT = 5555;

    public static void main(String[] args)
    {
        SecureRandom sr = new SecureRandom();
        sr.nextInt();

        try {
            //client.public is the keystore file that holds the client's public key (created with keytool)
            KeyStore clientKeyStore = KeyStore.getInstance("JKS");
            clientKeyStore.load(new FileInputStream("client.public"), "clientpublicpw".toCharArray());

            //server.private is the key pair for the server (created with keytool)
            KeyStore serverKeyStore …
Run Code Online (Sandbox Code Playgroud)

java ssl

7
推荐指数
1
解决办法
3万
查看次数

GAE Channel API是否安全?什么是底层实施?

我正在使用GAE + Python创建一个需要向客户端发送敏感数据实时更新的应用程序,我想知道App Engine Channel API是否安全.使用HTTPS是否足够或渠道是否需要自己的安全协议?

此外,App Engine Channel API的底层实现是什么?Websockets,SSE?看起来它实际上只提供从服务器到客户端通过通道的单向通信,然后客户端使用标准HTTP请求与服务器通信.

python security https google-app-engine channel-api

2
推荐指数
1
解决办法
397
查看次数