Skip to content

Instantly share code, notes, and snippets.

View xryuseix's full-sized avatar
🐣
🐥 🐥 🐥

Ryusei Ishikawa xryuseix

🐣
🐥 🐥 🐥
View GitHub Profile
#include <array>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
class Point : public std::array<double, 2> {
public:
static const int DIM = 2;
@xryuseix
xryuseix / 確定申告.md
Created April 27, 2020 19:48
簡単な調査の結果.結構間違っているかもしれない.

確定申告に関するまとめ

確定申告とは

  • 税金を納める制度
  • 個人事業主は全員やる
  • 会社員はやらなくていい(参考:年末調整)

支払う税金

@xryuseix
xryuseix / ヒープソート.cpp
Created May 6, 2020 07:25
ヒープソート
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
using namespace std;
typedef vector<int> vi;
const int INF = INT_MAX;
const int SIZE = 13;
@xryuseix
xryuseix / dfs.cpp
Created May 6, 2020 07:28
通りがけ順DFSで縦に二分木を出力
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
using namespace std;
typedef vector<int> vi;
const int INF = INT_MAX;
int arr_size = 10;
int v[] = {-1,88,2,4,6,8,10,11,24,54};
function storageGet() {
var res;
chrome.storage.local.get(res = callbackFunc(items));
console.log(res);
return res;
}
function callbackFunc(items) {
console.log(items);
callback(items);
@xryuseix
xryuseix / list.cpp
Last active August 5, 2021 02:29
Cで線型Listを作ります
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct __physcheck
{
char name[20];
int height;
double vision;
struct __physcheck *next;
} PhysCheck;
@xryuseix
xryuseix / stack.cpp
Last active August 5, 2021 02:29
Cでstackを作ります
#include <stdio.h>
#include <stdlib.h>
struct CharStack {
char* data;
int top; // 半開区間で終端を管理する
int max;
} typedef stack;
void push(char* data, char c, int* top) {
@xryuseix
xryuseix / 暗号利用モードの調査.md
Last active April 24, 2021 09:20
暗号利用モードの調査

-----------暗号利用モードの調査--------------

ECB:Electronic CodeBook mode (電子符号表モード)

ECBでの暗号化手順 ECBでの暗号化結果

  • 平文ブロックと暗号文ブロックは一対一の関係
  • ECBモード(単純なブロック暗号の利用法)では、ある鍵で同一の平文ブロックを暗号化すると、同一の暗号文ブロックになる。→同じブロックかつ同じ鍵は同じ暗号文ブロック
  • 同じ暗号文ブロックがあれば「平文が繰り返されていること」はわかる
@xryuseix
xryuseix / cos_sim.rs
Created June 8, 2021 01:25
コサイン類似度の計算
fn cos_sim(q: &Vec<i32>, d: &Vec<i32>) -> f32 {
assert_eq!(q.len(), d.len());
// 分母
let mut dot = 0.0;
for i in 0..q.len() {
dot += (q[i] * d[i]) as f32;
}
// 分子左
let mut left = 0.0;
@xryuseix
xryuseix / VSCode-LaTex-tempate.json
Last active June 16, 2021 11:47
VSCode の LaTeX スニペット
{
"sample": {
"prefix": "sample",
"body": [
"\\documentclass{jsarticle}",
"\\usepackage{url} % URL",
"\\usepackage{color} % 色付け",
"\\usepackage{amsmath} % align環境",
"\\usepackage{ascmac} % 枠付き文章",
"\\usepackage{listings,jlisting} % ソースコード",