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
| {-# 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
| 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
| #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
| #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
| // ==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
| var Reminders = Application("Reminders"); | |
| function performMailActionWithMessages(messages) | |
| { | |
| messages.forEach(function (message) { | |
| var content = message.content(); | |
| var r = /返却期限日\(Due Date\):(\d+)\/(\d+)\/(\d+)\nタイトル \(Title\):\n(.*)/g; | |
| var m; | |
| while (m = r.exec(content)) { | |
| var year = parseInt(m[1]); |
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 qualified Data.QRCode as Q -- from `haskell-qrencode' package | |
| import qualified Codec.Picture as P -- from `JuicyPixels' package | |
| import qualified Codec.Picture.Png as P | |
| import qualified Data.ByteString.Lazy as B | |
| pixelPerCell = 5 | |
| main :: IO () | |
| main = do l <- getLine | |
| let version = Nothing -- auto |
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 qualified Codec.Binary.QRCode as Q -- from `qrcode' package | |
| import qualified Codec.Picture as P -- from `JuicyPixel' package | |
| import qualified Codec.Picture.Png as P | |
| import qualified Data.ByteString.Lazy as B | |
| import Data.Array (Array,bounds,(!)) | |
| pixelPerCell = 5 | |
| main :: IO () | |
| main = do l <- getLine |
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
| interface Sum<A,B> | |
| { | |
| elim<C>(left: (value: A) => C, right: (value: B) => C): C; | |
| } | |
| function Left<A>(value: A): {elim<C>(left:(value:A)=>C,right:(value:any)=>C):C;} | |
| { | |
| return { | |
| elim: <C>(left: (value: A) => C, right: (value: any) => C) => left(value) | |
| }; | |
| } |