Skip to content

Instantly share code, notes, and snippets.

View Mine02C4's full-sized avatar
💣

NIWA Naoya Mine02C4

💣
View GitHub Profile
@Mine02C4
Mine02C4 / snippet.js
Created December 19, 2024 02:24
Download slides and videos from the EDAS program
/* Run the following script in the developer console and execute the resulting PowerShell script. */
(async () => {
function getVideoUrlFromPageUrl(url) {
return new Promise((resolve, reject) => {
const w = window.open(url, '_blank');
w.addEventListener('DOMContentLoaded', () => {
const videoElement = w.document.getElementsByTagName('video')[0];
const sourceElement = videoElement.getElementsByTagName('source')[0];
const videoUrl = sourceElement.src;
@Mine02C4
Mine02C4 / rename_cps.py
Last active December 17, 2024 11:11 — forked from tkojima0107/rename_cps.py
A file rename script for IEEE CPS proceeding
import json
import re
import sys
import os
from argparse import ArgumentParser,SUPPRESS
from pathvalidate import sanitize_filename
import shutil
START_STR = "var webpub = {data: "
@Mine02C4
Mine02C4 / sim.c
Created December 17, 2015 23:02
理工学基礎実験 熱の移動 学籍番号 61414050
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define LENGTH_COPPER 0.15
#define RADIUS_COPPER 0.015
// The number of divisions in the vertical direction
@Mine02C4
Mine02C4 / Makefile
Last active October 9, 2015 21:50
プログラミング第3同演習向けMakefile 直下にある .c をまとめて1つの実行ファイルにコンパイル。多分後半で使う。多分
CC = gcc
CFLAGS = -O0
OUTPUT := elf
objects := $(patsubst %.c,%.o,$(wildcard *.c))
$(OUTPUT) : $(objects)
$(CC) $(objects) -o $@
.PHONY : clean
@Mine02C4
Mine02C4 / Makefile
Last active October 9, 2015 21:48
プログラミング第3同演習向けMakefile 直下にある .c ファイルをそれぞれ .out の名前の実行ファイルにコンパイル(まぁ単純だしどこでも使えるよね)
CC = gcc
CFLAGS = -O0
OUTPUTS := $(patsubst %.c,%.out,$(wildcard *.c))
.PHONY : all clean
all : $(OUTPUTS)
clean :
@Mine02C4
Mine02C4 / prefix_to_infix.hs
Created October 4, 2015 22:37
情報論理学 10月5日 提出レポート
isBinaryOperator = flip elem ['*','+','>','=']
isUnaryOperator = flip elem ['-']
prefixToInfix str
| isBinaryOperator token =
let left = prefixToInfix $ tail str
right = prefixToInfix $ snd left
in ("(" ++ fst left ++ [token] ++ fst right ++ ")", snd right)
| isUnaryOperator token =
let sub = prefixToInfix $ tail str
@Mine02C4
Mine02C4 / LightsOutAVX2.cpp
Last active September 30, 2016 18:02
情報数学概論: Intel AVX2のSIMD命令を使ったLIGHTS OUTの全探索プログラム
#include <iostream>
#include <vector>
#include <algorithm>
#include <mutex>
#define SIMD // AVX2を利用する。
//#define S64 // テーブルを64bitにする。SIZEを6以上にするために必要
#ifdef S64
typedef int64_t table;
@Mine02C4
Mine02C4 / LightsOut.cpp
Last active October 9, 2015 20:14
情報数学概論だったり?
#include <iostream>
#include <vector>
#include <algorithm>
#include <mutex>
typedef int64_t table;
const int SIZE = 5;
const table BASE = 1;
const table N_BASE = -1;
const table NUMBER_OF_PATTERN = BASE << (SIZE * SIZE);
@Mine02C4
Mine02C4 / LightsOut.cpp
Created July 16, 2015 18:38
Information Mathematics Introduction Report 2
#include <iostream>
#include <vector>
const int SIZE = 5;
const int NUMBER_OF_PATTERN = 1 << (SIZE * SIZE);
const int TABLE_MASK = ~(-1 << (SIZE * SIZE));
int RIGHT_MASK = 0;
int LEFT_MASK = 0;
int TOP_MASK = 0;
int BOTTOM_MASK = 0;
@Mine02C4
Mine02C4 / Get-SMARTInformation.ps1
Last active December 21, 2015 03:29
Get S.M.A.R.T.(Self-Monitoring, Analysis and Reporting Technology) information by PowerShell. For Windows 7 and Server 2008 R2
$smart = gwmi -Namespace root\WMI -Class MSStorageDriver_FailurePredictData
if ($smart.VendorSpecific.Length -gt 0) {
$smart = @($smart)
}
for ($n = 0; $n -lt $smart.Length; $n++) {
$result = @()
for ($i = 2; $i -lt $smart[$n].VendorSpecific.Length; $i += 12) {
$result += [pscustomobject] @{
AttrID = $smart[$n].VendorSpecific[$i];
StatusFlag1 = $smart[$n].VendorSpecific[$i+1];