This file contains hidden or 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
/* 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; |
This file contains hidden or 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 json | |
import re | |
import sys | |
import os | |
from argparse import ArgumentParser,SUPPRESS | |
from pathvalidate import sanitize_filename | |
import shutil | |
START_STR = "var webpub = {data: " |
This file contains hidden or 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
#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 |
This file contains hidden or 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
CC = gcc | |
CFLAGS = -O0 | |
OUTPUT := elf | |
objects := $(patsubst %.c,%.o,$(wildcard *.c)) | |
$(OUTPUT) : $(objects) | |
$(CC) $(objects) -o $@ | |
.PHONY : clean |
This file contains hidden or 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
CC = gcc | |
CFLAGS = -O0 | |
OUTPUTS := $(patsubst %.c,%.out,$(wildcard *.c)) | |
.PHONY : all clean | |
all : $(OUTPUTS) | |
clean : |
This file contains hidden or 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
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 |
This file contains hidden or 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> | |
#include <vector> | |
#include <algorithm> | |
#include <mutex> | |
#define SIMD // AVX2を利用する。 | |
//#define S64 // テーブルを64bitにする。SIZEを6以上にするために必要 | |
#ifdef S64 | |
typedef int64_t table; |
This file contains hidden or 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> | |
#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); |
This file contains hidden or 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> | |
#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; |
This file contains hidden or 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
$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]; |
NewerOlder