Skip to content

Instantly share code, notes, and snippets.

View Loliver1224's full-sized avatar
🌸
今日も一日がんばるぞい!

FURUKAWA Daichi Loliver1224

🌸
今日も一日がんばるぞい!
View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct{
int id;
char name[20];
} dict;
int intcmp(const void *a, const void *b){
@Loliver1224
Loliver1224 / check_envp.c
Last active June 30, 2019 04:34
実はC言語のmain関数には第3の引数が存在するというわけで
#include <stdio.h>
int main(int argc, char *argv[], char *envp[]){
/* check argc */
printf("argc = %d\n", argc);
/* check argv */
printf("argv = [");
for(int i=0; i<argc; i++)
printf("\'%s\' ", argv[i]);
@Loliver1224
Loliver1224 / helloworld.c
Last active June 30, 2019 04:35
C言語でも1行でHello worldできるんやで
main(){puts("Hello, world!");}
@Loliver1224
Loliver1224 / Julialang.sty
Last active November 5, 2020 06:27
Julia-lang style definition for LaTeX Listings.
%% Julia definition (c) 2020 Daichi Furukawa
%%
\lstdefinelanguage{Julia}{%
morekeywords={abstract, ans, baremodule, begin, break, const, continue, do,%
elseif, else, end, export, finally, for, function, global, if, import,%
let, local, macro, module, mutable, primitive, quote, return, struct, try,%
type, using, var, where, while},%
% Types
morekeywords=[2]{Any, Array, Bool, BigInt, BigFloat, Char, DataType, Enum,%
Expr, Float16, Float32, Float64, Function, Inf, Inf16, Inf32, Int8, Int16,%
alias l='exa -alhF --git'
alias p='bat'
alias 2='cd ~/2nd'
alias 3='cd ~/3rd'
alias 4='cd ~/4th'
alias web='cd ~/public_html/webexer/CSS'
alias oop='cd ~/4th/oop'
alias os='cd ~/4th/os'
alias net='cd ~/4th/net'
@Loliver1224
Loliver1224 / MyPrint.java
Created March 11, 2021 14:11
Javaにおけるprintlnの簡潔化
public class MyPrint {
public static void main(String[] args) {
println("Hello, world!");
}
void print(Object line) {
System.out.print(line);
}
void println(Object line) {
System.out.println(line);
# ==================== Emojis ====================
# 🎉 :tada: Initial commit
# 🎨 :art: デザイン
# 🐛 :bug: バグ修正
# ♻️ :recycle: リファクタリング
# 💄 :lipstick: コード整形
# ✏️ :pencil2: typo
# 📚 :books: ドキュメント
# 🔖 :bookmark: ブクマ
@Loliver1224
Loliver1224 / pkl2jld.jl
Created March 19, 2021 12:11
pickle to jld converter
using PyCall, JLD
py"""
import pickle
with open("filename.pkl", 'rb') as f:
data = pickle.load(f)
"""
data = py"data"
save("file.jld", data)
@Loliver1224
Loliver1224 / numCardPermutation.py
Created April 4, 2021 08:03
SPIの順列問題用に作ったけど出番なかった
# 順列(数字並べて倍数つくるやつ)
card = [0,1,2,3,4,5]
visited = [False] * len(card)
perm = []
def dfs(arr, pos, n):
if pos == n:
perm.append(arr)
@Loliver1224
Loliver1224 / template_own.cpp
Created March 28, 2021 06:35
競プロ用テンプレートをmainの下に置いとける書き方
#if !__INCLUDE_LEVEL__
#include __FILE__
int main() {
rep(i, 3) printf("%2d", i);
cout << endl << "ok." << endl;
}
#else