Category Archives: Coder

Android Exception: UncaughtException detected: java.lang.RuntimeException: Parcelable encountered IOExcepti

Exception information:
uncaughtexception detected: java.lang.runtimeexception: separable accounted IOException writing serializable object

causes

When transferring data between activities, there is a problem in implementing serializable interface

Entity class



public class GoodsBean implements Serializable {

    private String createtime;
    private String images;
    private int clickCount;
    private UniUserBean uniUser;
    private String mobile;
    private String description;
    private int catId;
    private int createid;
    private double price;
    private String name;
    private int id;
    private int status;

Second Activity

    private void exit4Goods(int position) {
        if (mGoodLists != null) {
            GoodsBean goodsBean = mGoodLists.get(position);
            Intent data = new Intent();

            data.putExtra("goodsBean", goodsBean);

            setResult(ConstantValues.ACTIVITY_SELECT_GOODS_SUCCESS_CODE, data);
        }
    }

First Activity

 if (resultCode == ConstantValues.ACTIVITY_SELECT_GOODS_SUCCESS_CODE) {
            if (data != null) {
                GoodsBean goodsBean = (GoodsBean) data.getSerializableExtra("goodsBean");
            }
        }

solutions

The entity class goodsbean refers to the uniuserbean, so we should not only serialize the goodsbean, but also the uniuserbean

[Solved] java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter

Today, I want to write an essay. Recently, I often report java.lang.noclassdeffounderror when using JUnit. Today, I suddenly realized that although JUnit is configured in gradle, I can see JUnit’s jar package in project and external dependencies, and I can find the class org/JUnit/Runner/manipulation/filter in JUnit’s jar package, However, when running as JUnit test, you should report Java. Lang. NoClassDefFoundError: org/JUnit/Runner/manipulation/filter

I think it’s a gradle configuration problem, but testimplementation, implementation and API are not good

Later on, I think that the jar package introduced in gradle (that is, the jar package in project and external dependencies) was not loaded by the JVM during run as JUnit test. That’s why this phenomenon appears. The solution is to add library and JUnit in build path

The loaded class in main is attached below

package proxy;

import java.lang.reflect.Field;
import java.lang.reflect.Proxy;
import java.util.Vector;

import org.junit.Test;


public class TestProxy {

	@Test
	public void test1() {
		
		TestLog testLog = new TestLogImpl();
		TestLogInterceptor testLogInterceptor = new TestLogInterceptor();
		testLogInterceptor.setTarget(testLog);
		TestLog proxy = (TestLog)Proxy.newProxyInstance(testLog.getClass().getClassLoader()
				, testLog.getClass().getInterfaces(), testLogInterceptor);
		proxy.print();
	}
	
	public static void main(String[] args) {
		TestLog testLog = new TestLogImpl();
		TestLogInterceptor testLogInterceptor = new TestLogInterceptor();
		testLogInterceptor.setTarget(testLog);
		TestLog proxy = (TestLog)Proxy.newProxyInstance(testLog.getClass().getClassLoader()
				, testLog.getClass().getInterfaces(), testLogInterceptor);
		proxy.print();
		try {
			new TestProxy().printClass();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void printClass() throws Exception {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Class cla = classLoader.getClass();
        while (cla != ClassLoader.class)
            cla = cla.getSuperclass();
        Field field = cla.getDeclaredField("classes");
        field.setAccessible(true);
        Vector v = (Vector) field.get(classLoader);
        for (int i = 0; i < v.size(); i++) {
            System.out.print(((Class)v.get(i)).getName()+",");
            if(i%10 == 0)System.out.println("");
        }
	}
}

C #. Net core: How to use Jsonconvert replace JavaScriptSerializer

There are no system. Runtime. Serialization. JSON and system. Web. Script. Serialization in. Net core, so there is no JavaScript serializer. Therefore, jsonconvert in newtonsoft. JSON can be used to replace jsonconvert when porting projects

Code:

//.net framework
//JavaScriptSerializer serializer = new JavaScriptSerializer();
//var res = serializer.Serialize(YourObject);

//.net core Newtonsoft.Json
var res = JsonConvert.SerializeObject(YourObject);

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory [Solved]

 

note: cuda9.1 and cudnn7.0.5 are finally installed on Ubuntu 18.04, but import TensorFlow as TF reports this error

I searched the Internet for information. It turns out that the current cuda9.1 does not support TensorFlow, so if you install CUDA version 9.1, you have to reinstall cuda9.0

the corresponding relationship between TensorFlow and CUDA is as follows. If you install TensorFlow without such a corresponding relationship with CUDA and cudnn, there will be this error libcublas. So. 9.0: cannot open. I asked a doctor of Huake to find out. Thank you very much.

Eclipse CDT launch failed.Binary not found [How to Solve]

 

Recently in the research of artificial intelligence, identity recognition system related aspects, using C + +, but as a PHPer origin, obviously can’t be smooth sailing, will encounter all kinds of pit, since encountered, can’t avoid, then break it

Here are some recollections of my way to start C + +, which are for my study only. At the same time, I would like to share with many friends who have stepped into C + +

1. Eclipse cdtlaunchfailed. Binarynotfound solution

After the configuration is completed, the project test is established. It is found that the test can be run after the project of Hello World C + + project type is established, and the test class cannot be run by directly creating an empty project. The prompt is “ launchfailed. Binarynotfound

Causes: in CDT, after each new project is completed, the system will build the first time by default, that is, automatically generate executable files. But in fact, we have not even a source code file in the newly built project, so of course we will not generate executable files

When we create a new source code file, click the execute button, and the prompt “launch failed. Binarynotfound ” will pop up
solution: right click the project folder on the left side of the window and select build configurations — > Build–> Select, select debug or release to build

When using bootstrap modal box, uncaught typeerror: $(…). Modal is not a function

When using bootstrap modal box, uncaught typeerror: $(…). Modal is not a function

Look at the official website code, found no error, and video source comparison also found no error

//Click the add button to pop up the add page
        $("#emp_add_modal_btn").click(function(){
            //clear form data
            
            //send ajax request to query department information and display it in the list

            // pop up the add page
            $("#empAddModal").modal({
                backdrop:false
            });
        });

It turns out that the introduction of jQuery is behind the bootstrap. Just put the JS introduction of jQuery behind the bootstrap

<script type="text/javascript" src="${APP_PATH}/static/js/jquery-1.12.4.min.js"></script>
 <link href="${APP_PATH}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
 <script type="text/javascript" src="${APP_PATH}/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

How to Allow Apps from Anywhere in MacOS Gatekeeper (Mojave, Sierra, High Sierra)

Gatekeeper in MacOS is now stricter than ever, defaulting to only allow options for apps downloaded from either the App Store or the App Store and identified developers. Advanced Mac users may wish to allow a third option, which is the ability to open and allow apps downloaded from anywhere in macOS Sierra, macOS High Sierra, and MacOS Mojave.

To be clear, the “Allow applications downloaded from anywhere” option is hidden by default in Gatekeeper for macOS from Sierra onward. You can see this by going to the Security & Privacy preference panel, and under the “General” section you will not find such an option for Gatekeeper app allow settings. Despite that, with a little command line intervention you can reveal the third option and regain the ability to open apps that come from anywhere.

This is not recommended for most Mac users, only advanced Mac users and developers who have the ability to accurately gauge app validity should use this method, which involves disabling Gatekeeper from the command line, thereby removing the standard Gatekeeper security mechanisms in Mac OS.

How to Allow Apps from Anywhere in Gatekeeper for macOS Mojave, MacOS Sierra

Quit out of System Preferences

Open the Terminal app from the /Applications/Utilities/ folder and then enter the following command syntax:

	sudo spctl --master-disable

Hit return and authenticate with an admin password

Relaunch System Preferences and go to “Security & Privacy” and the “General” tab

You will now see the “Anywhere” option under ‘Allow apps downloaded from:’ Gatekeeper options

You’ll now be able to open and launch apps from anywhere under macOS Mojave, High Sierra, and Sierra, but be forewarned this turns off Gatekeeper and is not recommended for the vast majority of Mac users.

Allowing apps from anywhere including unidentified developers can potentially leave a Mac vulnerable to certain malware and junkware and should be avoided by all Mac users with the exception of those with genuinely advanced abilities.

Another approach is to manually add Gatekeeper exceptions via the command line, a solution which may be more appropriate than simply allowing everything to skirt past Gatekeeper.

Returning to Default Gatekeeper Security in macOS Mojave, High Sierra, Sierra

You can also reverse this and go back to the default strict Gatekeeper settings of only allowing apps from the Mac App Store and identified developers by issuing the following command string:

sudo spctl --master-enable

Hitting return and re-authenticating will return macOS Gatekeeper back to its strict default state of disallowing random apps from launching.

Nearly every Mac user should leave this feature enabled in the default state. If you do not have the ability to easily discern which apps are legitimate or not, you should absolutely not change this option. The “app can’t be opened because it is from an unidentified developer” message is there to offer protection to the vast majority of Mac users and should not be ignored.

nfs:server 172.168.1.22 not responding,still trying arm Client Configuration

nfs:server 172.168.1.22 Not responding, still trying problem solving platform is realarm 210 platform

nfs:server 172.168.1.22 The platform is realarm 210

The problem here is encountered when using NFS to mount the file system, so here is only the solution to this problem when mounting the file system. Please see the following figure for the situation of problems:

Search on the Internet can find solutions, but they are basically the same, or do not understand, leading to the card I did not solve for a long time. The solutions on the Internet are as follows. Maybe some people’s problems can be solved, but my problems are not

After installing the NFS file system on the host on the mini2440 development board, the following prompt will appear:
NFS: server is not responding, still trying
cause of the problem:
mandag 27 November2006 20:12 skrev Verner kjrsgaard:
> Mandag 27 november 2006 19:33 skrev John P. New:
> > Verner,
> >
> > This is a problem with NFS and 2.6 kernels, fast server NICs and
> > comparatively slower client NICs. This will show up when the server has
> > a 1000Mb card and the client a 100Mb, or when the server has a 100Mb
> > card and the client a 10Mb.
> >
> > Essentially, you have to pass some options to the kernel on terminal
> > boot, and this varies depending on whether you are using etherboot or
> > PXE.
> >
> > See
> > http://wiki.ltsp.org/twiki/bin/view/Ltsp/NFS#NFS_ Server_ not_ responding
> > For a deep explanation of the problem and the cure.

the main idea is that there is a mismatch between the NFS host network card with a higher transfer rate and the target network card with a lower transfer rate. To solve this problem, additional parameters need to be added when mounting the file system<

solution:
1 when the target machine has entered the Linux system after startup, use the following mount command:
mount – t, NFS – O, intr, nolock, rsize = 1024, wsize = 1024 59.70.245.216]/home/Lizhao/rootfs/MNT/NFS
(that is, add the parameter of INR rsize = 1024, wsize = 1024, wsize = 1024 59.70.245.216), When the target machine is in the boot phase and passes command line parameters to the kernel, the following parameters are used:
console = ttysac0 root =/dev/NFS nfsroot = 59.70.245.216]/home/Lizhao/rootfs, flags = intr, rsize = 1024, wsize=1024ip=59.70.245.222:59.70.245.216:59.70.245.216:255.255.255.0: leao:eth0 : off

parameter explanation:
intr — when the server is down or unable to reach, it is allowed to interrupt the NFS request. Nolock — Disable file lock. Rsize = 8192 and wsize = 8192 — increase the speed of NFS reading and writing by setting large simultaneous data block size (bytes). Be careful when changing these values. Some old Linux kernels and network cards don’t work properly in large block sizes

Later, I saw a post saying whether the IP configuration of the system was carried out when loading the file system, which led to such an error (as shown in the figure below). After checking the RCS file, I found that there was a configuration. I’m so excited. Let’s revise it

Since this is shared under Linux (I use Ubuntu version 10.04) system, the modification of files is done directly in Ubuntu. As shown in the figure below:

Look at the diagram circle. Here is a script file loaded. In the same folder as RCS, ifconfig-eth0 is the configuration of IP. OK, let’s take a look at the ifconfig-eth0 script, as shown in the following figure:

There is an if conditional sentence in it. Here, the if conditional sentence is true, and the file is in the/etc directory, as shown in the following figure:

Then the execution here is the source/etc/eth0 setting part in the ifconfig-eth0 script file, which is the box part in the figure below. Without this file, the execution is the else part in the if statement (that is, the ellipse part in the figure below)

It can be seen that the IP configuration file is eth0 setting. Open it and see the following figure:

Because my IP gateway is 172.168.1.1, the IP configuration is not good. In u-boot, the IP gateway is 172.168.1.1, but it is modified to the IP shown in the figure above when mounting the file system. Because of this, the IP is no longer in the same network segment, and the communication fails, so there is no response error. Modify this file as shown in the figure below. Mine is the IP shown in the figure below. Please modify it to your own IP

After modification, save and restart. So it’s completely normal

For other development boards, the RCS script either loads the ifconfig-eth0 script to configure IP or does not have the following sentence:

But there may be the following sentence to configure

Then, modify the IP shown in the figure above

In addition, the environment parameter settings of my u-boot are attached

In the attached settings command:

setenv bootcmd “tftp C0008000 zImage; bootm C0008000 40800000”

setenv bootargs noinitrd root=/dev/nfs console=ttySAC2 init=/linuxrc nfsroot=172.168.1.22:/nfsboot/210system_ new/system ip=172.168.1.21:172.168.1.22:172.168.1.1:255.255.255.0::eth0:on

IP and file system directory can be modified to their own

[Solved] javax.net.ssl.SSLException: Received fatal alert: protocol_version

javax.net.ssl.SSLException: Received fatal alert: protocol_ version

Questions

Using JDK1.8 development environment and deploying to jdk1.7 server, the following problems appear:

  javax.net.ssl.SSLException: Received fatal alert: protocol_version
	at sun.security.ssl.Alerts.getSSLException(Unknown Source)
	at sun.security.ssl.Alerts.getSSLException(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
	at sun.security.ssl.AppOutputStream.write(Unknown Source)
	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
	at java.io.BufferedOutputStream.flush(Unknown Source)
	at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
	at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
	at com.base.util.MySSLProtocolSocketFactory.main(MySSLProtocolSocketFactory.java:115)

Why

On Java 1.8, the default TLS protocol is v1.2. On Java 1.6 and 1.7, tls1.0 is abandoned by default

Solutions

Upgrade JDK version, the most direct. However, due to some project reasons, we can not upgrade the JDK version, we can only solve this problem

1. Set the tlsv1.2 protocol before initiating the request

	System.setProperty("https.protocols", "TLSv1.2");
或  System.setProperty("jdk.tls.client.protocols", "TLSv1.2");
或  java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
.....

Did not solve my problem, use system. Setproperty ("javax. Net. Debug", "all") print log, protocol version or tlsv1

2. Specify it as a command line parameter

-Dhttps.protocols=TLSv1.2

The protocol version is still tlsv1 tlsv1

3. Modify Tomcat/bin/Catalina. Bat , and add command parameters

JAVA_OPTS =%JAVA_OPTS%-Dhttps.protocols = TLSv1.2 -Djdk.tls.client.protocols = TLSv1.2

The protocol version is still tlsv1 tlsv1

Modify spring configuration file

<bean
	class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
	<property name="targetObject" value="#{@systemProperties}" />
	<property name="targetMethod" value="putAll" />
	<property name="arguments">
		<props>
			<prop key="https.protocols">TLSv1.2</prop>
		</props>
	</property>
</bean>

The protocol version is still tlsv1 tlsv1

Reference: javax.net.ssl.ssl exception: received fatal Alert: Protocol_ version

My solution:

Using the third party Library: bouncy castle provider

1. Build a tlssocketconnectionfactory

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.security.Principal;
import java.security.SecureRandom;
import java.security.Security;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateFactory;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;

import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSessionContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.security.cert.X509Certificate;

import org.bouncycastle.crypto.tls.*;
import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class TLSSocketConnectionFactory extends SSLSocketFactory {

	static {
		if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
			Security.addProvider(new BouncyCastleProvider());
		}
	}

	@SuppressWarnings("resource")
	[@Override](https://my.oschina.net/u/1162528)
	public Socket createSocket(Socket socket, final String host, int port,
			boolean arg3) throws IOException {
		if (socket == null) {
			socket = new Socket();
		}
		if (!socket.isConnected()) {
			socket.connect(new InetSocketAddress(host, port));
		}

		final TlsClientProtocol tlsClientProtocol = new TlsClientProtocol(
				socket.getInputStream(), socket.getOutputStream(),
				new SecureRandom());

		return _createSSLSocket(host, tlsClientProtocol);
	}

	[@Override](https://my.oschina.net/u/1162528)
	public String[] getDefaultCipherSuites() {
		return null;
	}

	[@Override](https://my.oschina.net/u/1162528)
	public String[] getSupportedCipherSuites() {
		return null;
	}

	@Override
	public Socket createSocket(String host, int port) throws IOException,
			UnknownHostException {
		throw new UnsupportedOperationException();
	}

	@Override
	public Socket createSocket(InetAddress host, int port) throws IOException {
		throw new UnsupportedOperationException();
	}

	@Override
	public Socket createSocket(String host, int port, InetAddress localHost,
			int localPort) throws IOException, UnknownHostException {
		return null;
	}

	@Override
	public Socket createSocket(InetAddress address, int port,
			InetAddress localAddress, int localPort) throws IOException {
		throw new UnsupportedOperationException();
	}

	private SSLSocket _createSSLSocket(final String host,
			final TlsClientProtocol tlsClientProtocol) {
		return new SSLSocket() {
			private java.security.cert.Certificate[] peertCerts;

			@Override
			public InputStream getInputStream() throws IOException {
				return tlsClientProtocol.getInputStream();
			}

			@Override
			public OutputStream getOutputStream() throws IOException {
				return tlsClientProtocol.getOutputStream();
			}

			@Override
			public synchronized void close() throws IOException {
				tlsClientProtocol.close();
			}

			@Override
			public void addHandshakeCompletedListener(
					HandshakeCompletedListener arg0) {
			}

			@Override
			public boolean getEnableSessionCreation() {
				return false;
			}

			@Override
			public String[] getEnabledCipherSuites() {
				return null;
			}

			@Override
			public String[] getEnabledProtocols() {
				return null;
			}

			@Override
			public boolean getNeedClientAuth() {
				return false;
			}

			@Override
			public SSLSession getSession() {
				return new SSLSession() {

					@Override
					public int getApplicationBufferSize() {
						return 0;
					}

					@Override
					public String getCipherSuite() {
						throw new UnsupportedOperationException();
					}

					@Override
					public long getCreationTime() {
						throw new UnsupportedOperationException();
					}

					@Override
					public byte[] getId() {
						throw new UnsupportedOperationException();
					}

					@Override
					public long getLastAccessedTime() {
						throw new UnsupportedOperationException();
					}

					@Override
					public java.security.cert.Certificate[] getLocalCertificates() {
						throw new UnsupportedOperationException();
					}

					@Override
					public Principal getLocalPrincipal() {
						throw new UnsupportedOperationException();
					}

					@Override
					public int getPacketBufferSize() {
						throw new UnsupportedOperationException();
					}

					@Override
					public X509Certificate[] getPeerCertificateChain()
							throws SSLPeerUnverifiedException {
						return null;
					}

					@Override
					public java.security.cert.Certificate[] getPeerCertificates()
							throws SSLPeerUnverifiedException {
						return peertCerts;
					}

					@Override
					public String getPeerHost() {
						throw new UnsupportedOperationException();
					}

					@Override
					public int getPeerPort() {
						return 0;
					}

					@Override
					public Principal getPeerPrincipal()
							throws SSLPeerUnverifiedException {
						return null;
					}

					@Override
					public String getProtocol() {
						throw new UnsupportedOperationException();
					}

					@Override
					public SSLSessionContext getSessionContext() {
						throw new UnsupportedOperationException();
					}

					@Override
					public Object getValue(String arg0) {
						throw new UnsupportedOperationException();
					}

					@Override
					public String[] getValueNames() {
						throw new UnsupportedOperationException();
					}

					@Override
					public void invalidate() {
						throw new UnsupportedOperationException();
					}

					@Override
					public boolean isValid() {
						throw new UnsupportedOperationException();
					}

					@Override
					public void putValue(String arg0, Object arg1) {
						throw new UnsupportedOperationException();
					}

					@Override
					public void removeValue(String arg0) {
						throw new UnsupportedOperationException();
					}
				};
			}

			@Override
			public String[] getSupportedProtocols() {
				return null;
			}

			@Override
			public boolean getUseClientMode() {
				return false;
			}

			@Override
			public boolean getWantClientAuth() {
				return false;
			}

			@Override
			public void removeHandshakeCompletedListener(
					HandshakeCompletedListener arg0) {
			}

			@Override
			public void setEnableSessionCreation(boolean arg0) {
			}

			@Override
			public void setEnabledCipherSuites(String[] arg0) {
			}

			@Override
			public void setEnabledProtocols(String[] arg0) {
			}

			@Override
			public void setNeedClientAuth(boolean arg0) {
			}

			@Override
			public void setUseClientMode(boolean arg0) {
			}

			@Override
			public void setWantClientAuth(boolean arg0) {
			}

			@Override
			public String[] getSupportedCipherSuites() {
				return null;
			}

			@Override
			public void startHandshake() throws IOException {
				tlsClientProtocol.connect(new DefaultTlsClient() {

					@SuppressWarnings("unchecked")
					@Override
					public Hashtable<Integer, byte[]> getClientExtensions()
							throws IOException {
						Hashtable<Integer, byte[]> clientExtensions = super
								.getClientExtensions();
						if (clientExtensions == null) {
							clientExtensions = new Hashtable<Integer, byte[]>();
						}

						// Add host_name
						byte[] host_name = host.getBytes();

						final ByteArrayOutputStream baos = new ByteArrayOutputStream();
						final DataOutputStream dos = new DataOutputStream(baos);
						dos.writeShort(host_name.length + 3);
						dos.writeByte(0);
						dos.writeShort(host_name.length);
						dos.write(host_name);
						dos.close();
						clientExtensions.put(ExtensionType.server_name,
								baos.toByteArray());
						return clientExtensions;
					}

					@Override
					public TlsAuthentication getAuthentication()
							throws IOException {
						return new TlsAuthentication() {
							@Override
							public void notifyServerCertificate(
									Certificate serverCertificate)
									throws IOException {
								try {
									KeyStore ks = _loadKeyStore();

									CertificateFactory cf = CertificateFactory
											.getInstance("X.509");
									List<java.security.cert.Certificate> certs = new LinkedList<java.security.cert.Certificate>();
									boolean trustedCertificate = false;
									for (org.bouncycastle.asn1.x509.Certificate c : ((org.bouncycastle.crypto.tls.Certificate) serverCertificate)
											.getCertificateList()) {
										java.security.cert.Certificate cert = cf
												.generateCertificate(new ByteArrayInputStream(
														c.getEncoded()));
										certs.add(cert);

										String alias = ks
												.getCertificateAlias(cert);
										if (alias != null) {
											if (cert instanceof java.security.cert.X509Certificate) {
												try {
													((java.security.cert.X509Certificate) cert)
															.checkValidity();
													trustedCertificate = true;
												} catch (CertificateExpiredException cee) {
													// Accept all the certs!
												}
											}
										} else {
											// Accept all the certs!
										}

									}
									if (!trustedCertificate) {
										// Accept all the certs!
									}
									peertCerts = certs
											.toArray(new java.security.cert.Certificate[0]);
								} catch (Exception ex) {
									ex.printStackTrace();
									throw new IOException(ex);
								}
							}

							@Override
							public TlsCredentials getClientCredentials(
									CertificateRequest certificateRequest)
									throws IOException {
								return null;
							}

							private KeyStore _loadKeyStore() throws Exception {
								FileInputStream trustStoreFis = null;
								try {
									KeyStore localKeyStore = null;

									String trustStoreType = System
											.getProperty("javax.net.ssl.trustStoreType") != null ?System
											.getProperty("javax.net.ssl.trustStoreType")
											: KeyStore.getDefaultType();
									String trustStoreProvider = System
											.getProperty("javax.net.ssl.trustStoreProvider") != null ?System
											.getProperty("javax.net.ssl.trustStoreProvider")
											: "";

									if (trustStoreType.length() != 0) {
										if (trustStoreProvider.length() == 0) {
											localKeyStore = KeyStore
													.getInstance(trustStoreType);
										} else {
											localKeyStore = KeyStore
													.getInstance(
															trustStoreType,
															trustStoreProvider);
										}

										char[] keyStorePass = null;
										String str5 = System
												.getProperty("javax.net.ssl.trustStorePassword") != null ?System
												.getProperty("javax.net.ssl.trustStorePassword")
												: "";

										if (str5.length() != 0) {
											keyStorePass = str5.toCharArray();
										}

										localKeyStore.load(trustStoreFis,
												keyStorePass);

										if (keyStorePass != null) {
											for (int i = 0; i < keyStorePass.length; i++) {
												keyStorePass[i] = 0;
											}
										}
									}
									return localKeyStore;
								} finally {
									if (trustStoreFis != null) {
										trustStoreFis.close();
									}
								}
							}

						};
					}

				});
			}
		};
	}
}

2. Send get request demo

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;

import javax.net.ssl.HttpsURLConnection;

import com.base.util.TLSSocketConnectionFactory;


public class HttpsGetDemo {

	public HttpURLConnection createConnection(URI uri) throws IOException {
		URL url = uri.toURL();
		URLConnection connection = url.openConnection();
		HttpsURLConnection httpsURLConnection = (HttpsURLConnection) connection;
		httpsURLConnection.setSSLSocketFactory(new TLSSocketConnectionFactory());
		return httpsURLConnection;
	}

	public static void main(String[] args) throws IOException, URISyntaxException {
		HttpsGetDemo httpsGetDemo = new HttpsGetDemo();
		String loginUrl = "https://192.168.1.100/async/device/status/";
	   // String a = "https://192.168.1.100/async/sysscan/add/?target=192.168.1.200&user=admin&pwd=admin";
		HttpURLConnection connection;
		connection = httpsGetDemo.createConnection(new URI(loginUrl));

		if(200 == connection.getResponseCode()){
			//得到输入流
			InputStream is =connection.getInputStream();
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			byte[] buffer = new byte[1024];
			int len = 0;
			while(-1 != (len = is.read(buffer))){
				baos.write(buffer,0,len);
				baos.flush();
			}
			System.out.println(baos.toString("utf-8"));
			connection.disconnect();
			is.close();
			baos.close();
		} else {
			System.out.println("connection.getResponseCode():"+connection.getResponseCode());
		}
	}
}

Inkscape – rounding corners of shapes

http://superuser.com/questions/640954/inkscape-rounding-corners-of-shapes

Select the rectangle or square

Select the nodes option

On the right hand corner, you will see a round node instead of a square node. Drag down the node until you get the rounded corner you want.

The nodes option:

Round widget you need to drag to get rounded corners:

What happens when you drag the round widget:

As others have noted this only works on rectangles (but that is a common use case that will land people on this page).