小编pla*_*irt的帖子

Docker如何运行不同内核的发行版?

如何在Debian主机上运行docker可能是容器中的OpenSUSE?它使用不同的内核,具有独立的模块.旧的Debian版本也使用了较旧的内核,那么如何在内核版本3.10+上运行呢?较旧的内核只有较旧的内置函数,旧的发行版如何管理新功能?什么是"诀窍"呢?

linux-kernel linux-distro docker

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

curl - OpenSSL 错误 error:0308010C:数字信封例程::不支持

我尝试在Windows 上使用curl 来发布时间戳请求。需要认证,所以我使用p12文件。我收到错误消息,但 p12 文件的密码是正确的。

命令:

curl --insecure --cert-type P12 --cert my.p12:mypassword -X POST -d @mytest.req <myTSURL>
Run Code Online (Sandbox Code Playgroud)

错误信息:

curl: (58) 无法解析 PKCS12 文件,检查密码,OpenSSL 错误 error:0308010C:数字信封例程::不支持

卷曲-V

curl 7.83.1 (x86_64-pc-win32) libcurl/7.83.1 OpenSSL/3.0.2 (Schannel) zlib/1.2.12 brotli/1.0.9 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.47.0 ngtcp2/0.5.0 nghttp3/0.4.1 libgsasl/1.10.0
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile …
Run Code Online (Sandbox Code Playgroud)

windows curl openssl pkcs#12

42
推荐指数
2
解决办法
8万
查看次数

拍照并转换为Base64

我用下面的代码用相机拍照.而不是保存我想编码它,Base64然后将其作为输入传递给另一个API.我看不到方法,如何修改代码来Base64代替常规文件拍照.

public class CameraDemoActivity extends Activity {
    int TAKE_PHOTO_CODE = 0;
    public static int count = 0;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final String dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/picFolder/";
        File newdir = new File(dir);
        newdir.mkdirs();

        Button capture = (Button) findViewById(R.id.btnCapture);
        capture.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                count++;
                String file = dir+count+".jpg";
                File newfile = new File(file);
                try {
                    newfile.createNewFile();
                }
                catch (IOException e)
                {
                }

                Uri outputFileUri = Uri.fromFile(newfile);

                Intent cameraIntent …
Run Code Online (Sandbox Code Playgroud)

base64 android bitmap android-camera

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

SOAP消息到webservice - HTTP响应代码:403用于URL

我尝试将文件中的SOAP消息发送XML到Web服务,然后获取二进制输出并对其进行解码.端点使用HTTPS协议,所以我TrustManager在我的代码中使用以避免PKIX问题.你可以在这里看到我的代码:

import javax.net.ssl.*;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.security.cert.X509Certificate;

public class Main{
    public static void sendSoapRequest() throws Exception {
        String SOAPUrl = "URL HERE";
        String xmlFile2Send = ".\\src\\request.xml";
        String responseFileName = ".\\src\\response.xml";
        String inputLine;

        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
            public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; }
            public void checkClientTrusted(X509Certificate[] certs, String authType) { }
            public void checkServerTrusted(X509Certificate[] certs, String authType) { } …
Run Code Online (Sandbox Code Playgroud)

java xml soap web-services trusted-timestamp

14
推荐指数
1
解决办法
6343
查看次数

使用Selenium Server Standalone处理文件上载

我尝试使用的远程主机上执行testsuite Selenium Standalone Server.它应该上传一个文件.我使用下面的代码来处理文件上传:

FileBrowserDialogHandler fileBrowserDialogHandler = new FileBrowserDialogHandler();
fileBrowserDialogHandler.fileUploadDialog(fileSource);
Run Code Online (Sandbox Code Playgroud)

当我远程执行它时它不起作用,因为它无法打开文件选择器窗口.输入字段在网页上如下所示:

<input type ="text"id ="file-path">

我用当前的解决方案替换了当前的解决方案,WebElement以避免图形窗口,但它不起作用.

WebElement fileInput = driver.findElement(By.id("filepathelement"));
fileInput.sendKeys(filepath);
Run Code Online (Sandbox Code Playgroud)

输入类型不是文件,因此下面的代码不起作用:

driver.findElement(By.id("myUploadElement")).sendKeys("<absolutePathToMyFile>");
Run Code Online (Sandbox Code Playgroud)

java selenium-server selenium-webdriver

12
推荐指数
2
解决办法
826
查看次数

使用依赖项和测试在Maven中生成jar文件

我在pom.xml中使用此代码来创建jar文件.

   <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
            <excludes>
                <exclude>**/log4j.properties</exclude>
            </excludes>
            <archive>
                <manifest>
                    <mainClass>test.LeanFTest</mainClass>
                </manifest>
            </archive>
        </configuration>
    </plugin>
Run Code Online (Sandbox Code Playgroud)

我收到错误消息:

部署失败:未在POM内部分发中指定存储库元素

更新:

我在pom.xml中添加了另一个插件.

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>test.LeanFTest</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

它生成一个jar文件,但似乎没有依赖项.

线程"main"中的异常java.lang.NoClassDefFoundError:org/apache/log4j/Logger

项目结构:

C:.
????.idea
?   ????libraries
????META-INF
????out
?   ????artifacts
?       ????Test_LeanFT_jar
????resources
?   ????leanftjar
?   ????META-INF
????RunResults
?   ????Resources
?       ????Snapshots
?       ????User
????src
?   ????main
?   ?   ????java
?   ?   ?   ????com
?   ?   ?   ?   ????myproj
?   ?   ?   ????jar
?   ?   ?   ? …
Run Code Online (Sandbox Code Playgroud)

java jar pom.xml maven

10
推荐指数
1
解决办法
4993
查看次数

使用TravisCI上传APK到Github

成功构建后,有一个bash脚本可以将APK文件上传到GitHub存储库TravisCI.

  mkdir $HOME/buildApk/
  mkdir $HOME/android/

  cp -R app/build/outputs/apk/app-debug.apk $HOME/android/
  cd $HOME
  git config --global user.email "myemail@myemail.com"
  git config --global user.name "Akos Kovacs" 

  git clone --quiet --branch=master  https://plaidshirtakos:$GITHUB_API_KEY@github.com/plaidshirtakos/Trivia-test  master > /dev/null
  cd master cp -Rf $HOME/android/* .

  git add -f .
  git remote rm origin
  git remote add origin https://plaidshirtakos:$GITHUB_API_KEY@github.com/plaidshirtakos/Trivia-test.git
  git add -f .
  git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed"
  git push -fq origin master > /dev/null
  echo "Done"
Run Code Online (Sandbox Code Playgroud)

我在日志中看到以下行.

在分支大师没什么可提交的,工作树干净完成

bash android github apk

9
推荐指数
1
解决办法
497
查看次数

libGDX警报对话框

我使用过以下代码:

 AlertDialog.Builder bld;

 if (android.os.Build.VERSION.SDK_INT <= 10) {
     //With default theme looks perfect:
     bld = new AlertDialog.Builder(AndroidLauncher.this);
 } else {
     //With Holo theme appears the double Dialog:
     bld = new AlertDialog.Builder(AndroidLauncher.this, android.R.style.Theme_Holo_Dialog_MinWidth);
 }

 bld.setIcon(R.drawable.ic_launcher);
 bld.setTitle("Exit");
 bld.setMessage("Are you sure you want to exit?");
 bld.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
     @Override
     public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); }
 });
 bld.setPositiveButton("Exit", new DialogInterface.OnClickListener() {
     @Override
     public void onClick(DialogInterface dialog, int which) { finish(); }
 });
 bld.setCancelable(false);
 bld.create().show();
Run Code Online (Sandbox Code Playgroud)

看起来很好,但它说"导入android.app.AlertDialog无法解决".它是Android Studio中的标准libGDX项目.

android libgdx android-alertdialog

8
推荐指数
2
解决办法
8926
查看次数

在多线程上执行SoapUI测试

我有一个SoapUI测试,它使用输入文件读取行作为请求的输入.所以有一个循环读取数据并执行请求并将输出写入文件.响应时间太长,因此应该异步完成此文件的处理,但我不确定,如何SoapUI处理这个问题.SOAP请求中有文件附件,当前版本不处理JMeter.

multithreading soapui

8
推荐指数
1
解决办法
1896
查看次数

执行期间检查WebDriver测试中的加载时间

Selenium WebDriver 3.14Chrome浏览器中使用和测试.我需要在执行时间内测量页面的响应时间,以检查它是否在预定义的值下.如果它大于此值,则应执行一些其他操作.所以我需要不同的解决方案System.currentTimeMillis(),因为这个值的检查应该在后台自动完成.它是一个类似于AJAX的窗口,因此当加载时间过长时,应该通过脚本关闭它.窗口示例:

示例窗口

java selenium selenium-webdriver

8
推荐指数
1
解决办法
236
查看次数