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
// ==UserScript== | |
// @name Better MyOPAC | |
// @namespace http://d-poppo.nazo.cc/ | |
// @description MyOPACのログインフォーム等を改善する | |
// @include https://opac.dl.itc.u-tokyo.ac.jp/myopac/ | |
// @include https://opac.dl.itc.u-tokyo.ac.jp/myopac/index.php* | |
// @include https://opac.dl.itc.u-tokyo.ac.jp/opac/opac_list.cgi | |
// @include https://opac.dl.itc.u-tokyo.ac.jp/optsrv/opac_list.php* | |
// @version 5 | |
// @grant none |
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 <stdio.h> | |
#include <math.h> | |
#define CHOOSE(a) CHOOSE2 a | |
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x | |
#define fmax_N(...) CHOOSE((__VA_ARGS__,fmax_5,fmax_4,fmax_3,fmax,fmax_1,~))(__VA_ARGS__) | |
double fmax_1(double a0) { | |
return a0; |
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 CONCAT2(x,y) x ## y | |
#define CONCAT(x,y) CONCAT2(x,y) | |
#define VAL_END 0) | |
#define VAL0_END 0) >> 1 | |
#define VAL1_END 0) >> 2 | |
#define VAL2_END 0) >> 3 | |
#define VAL3_END 0) >> 4 | |
#define VAL4_END 0) >> 5 | |
#define VAL5_END 0) >> 6 | |
#define VAL6_END 0) >> 7 |
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
local chars = (([[ | |
あいうえお | |
かきくけこ | |
さしすせそ | |
たちつてと | |
なにぬねの | |
はひふへほ | |
まみむめも | |
やゆよ | |
らりるれろ |
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
{-# LANGUAGE DataKinds, KindSignatures #-} | |
module FiniteField where | |
import GHC.TypeLits | |
data FiniteField (p :: Nat) = MkFF Integer deriving (Eq) | |
characteristic :: KnownNat p => FiniteField p -> Integer | |
characteristic = natVal | |
mkFF :: KnownNat p => Integer -> FiniteField p |
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 <stdio.h> | |
#include <wchar.h> | |
#include <locale.h> | |
#include <string.h> | |
#include <io.h> | |
#include <fcntl.h> | |
#if defined(_MSC_VER) | |
void handler(const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t reserved) | |
{ |
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 <stdio.h> | |
#include <locale.h> | |
#include <io.h> | |
#include <fcntl.h> | |
#include <windows.h> | |
BOOL is_stream_console(FILE *stream) | |
{ | |
DWORD mode; | |
// GetConsoleMode requires GENERIC_READ access on the handle |
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 <stdio.h> | |
#include <math.h> | |
#include <complex.h> | |
#if !defined(CMPLX) | |
# if defined(__clang__) | |
# define CMPLX(x,y) ((double _Complex){(x), (y)}) | |
# elif defined(__GNUC__) | |
# define CMPLX(x,y) __builtin_complex((double)(x), (double)(y)) | |
# endif |
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 <string> | |
#include <vector> | |
#include <iostream> | |
#include <cstdlib> | |
#define __CL_ENABLE_EXCEPTIONS | |
#include <CL/cl.hpp> | |
int main(int argc, char *argv[]) | |
{ |
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
let m = str.match(/(a)(b)?/); | |
if (m) { | |
let a: string = m[1]; | |
let b: string = m[2]; // 本当は string | undefined | |
} |