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
https://www.codewars.com/kata/plus-minus-plus-plus-dot-dot-dot-count/train/ruby | |
def catch_sign_change(arr) | |
count = 0 | |
if arr == [] | |
return count | |
end | |
if arr[0] >= 0 | |
previous_sign = "positive" |
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 javax.crypto.Cipher; | |
import java.io.InputStream; | |
import java.security.*; | |
import java.util.Base64; | |
import static java.nio.charset.StandardCharsets.UTF_8; | |
public class RsaExample { | |
public static KeyPair generateKeyPair() throws Exception { | |
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); |
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 <iostream> // C++標準入出力 | |
#include <vector> // 動的配列 | |
#include <iterator> // イテレータ | |
#include <functional> // 標準関数オブジェクト | |
// 関数のプロトタイプ宣言 | |
void for_each_plus(std::vector<int> &vec1, std::vector<int> &vec2, std::vector<int> &vec3, std::plus<int> &obj); // vec1の各要素とvec2の各要素に関数オブジェクトobjの処理をさせて結果をvec3に格納していく関数. |
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
# udev | |
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules | |
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d | |
sudo service udev reload | |
# required packages | |
sudo apt-get -yy install pcscd opensc | |
# legacy library | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb |