This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package etcd; | |
import io.etcd.jetcd.*; | |
import io.etcd.jetcd.kv.GetResponse; | |
import io.etcd.jetcd.kv.PutResponse; | |
import io.etcd.jetcd.lease.LeaseGrantResponse; | |
import io.etcd.jetcd.lease.LeaseRevokeResponse; | |
import io.etcd.jetcd.lock.LockResponse; | |
import io.etcd.jetcd.lock.UnlockResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
自己署名証明書の作成 | |
# Make key.pem and cert.pem | |
openssl req -new -days 365 -x509 -nodes -keyout key.pem -out cert.pem | |
証明書の内容の表示 | |
# Show cert.pem | |
openssl x509 -text -noout < cert.pem | |
署名ファイルの作成 | |
# Make signature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Test extends App { | |
val list = List(10, 20, 30, 40, 50) | |
println(list) | |
val ls2 = calc(list) | |
println(ls2) | |
if (list.length != ls2.length) { | |
println("Unable to process it successfully") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pagero.services.emailapi | |
import spray.json._ | |
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport | |
import spray.json.DefaultJsonProtocol | |
case class Customer (id :Option[Int],name: Option[String]) | |
object Test extends App with DefaultJsonProtocol with SprayJsonSupport{ | |
implicit val CompanyFormat = jsonFormat2(Customer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script src="hello.js"></script> | |
<script> | |
var fibProxy = Module.cwrap("fib", "number", ["number"]); | |
function calcFib(){ | |
var input = document.getElementById("fibInput").value; | |
var result = fibProxy(input); | |
alert(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <emscripten.h> | |
int EMSCRIPTEN_KEEPALIVE fib(int n){ | |
if(n == 0 || n == 1) | |
return 1; | |
else | |
return fib(n - 1) + fib(n - 2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jaxb; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBException; | |
import javax.xml.bind.Marshaller; | |
import javax.xml.bind.annotation.XmlElement; | |
import javax.xml.bind.annotation.XmlElementWrapper; | |
import javax.xml.bind.annotation.XmlRootElement; | |
import javax.xml.bind.annotation.XmlValue; | |
import java.io.ByteArrayOutputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @author kanishka | |
*/ | |
public class RetrofitTest { | |
public static void main(String[] args) throws IOException { | |
OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); | |
Retrofit retrofit = new Retrofit.Builder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.pagero.services.protocol.as2outbound.core.util.IOUtil; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.Socket; | |
public class TestSocket { | |
public static void main(String[] args) { | |
int SERVER_PORT = 31481; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto" | |
_ "crypto/md5" // for crypto.MD5 | |
_ "crypto/sha1" // for crypto.SHA1 | |
_ "crypto/sha512" // for crypto.SHA384 & 512 | |
"crypto/x509" | |
"encoding/asn1" |
NewerOlder