This file contains 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 digit(p) ('0' <= *(p) && *(p) <= '9') | |
char* a[1000]; | |
int n = 0; | |
void fetch(char* p){ | |
while(*p && !digit(p)) p++; | |
if(*p){ | |
char* start = p; | |
while(*p && digit(p)) p++; | |
a[n] = start; n++; | |
if(*p) *p = 0, fetch(++p); |
This file contains 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 MakeTest(a0, d): | |
var j = 0; | |
return (x) => | |
def r = a0 + d * j; | |
j += 1; | |
return x === r | |
def guess(test): | |
var counter = 0 | |
for var segment in 1..infinity: |
This file contains 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
-- Enumerator comprehension monad | |
var ecSchemata = [yield: fYield, return: fReturn, bind: fBind] | |
where | |
fReturn = Enumerable function(x): | |
if(x != undefined) | |
enumeration.yield! x | |
fYield(x) = x | |
fBind = Enumerable function(list, callback): | |
for(var x in list) | |
for(var y in callback x) |
This file contains 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
def rest(s) = s.slice 1 | |
def mergeSpaces(s) = phase_normal s | |
where phase_normal(s) = piecewise | |
when(not s) s | |
when(s[0] == ' ') s[0] + phase_space rest s | |
otherwise s[0] + phase_normal rest s | |
phase_space(s) = piecewise | |
when(not s) s | |
when(s[0] == ' ') phase_space rest s |
This file contains 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
function F1$_(){ | |
var Tp$_, Tq$_, T11$_, T12$_; | |
var ecSchemata$, item$, mktable$, t$; | |
//MoeMap// var ecSchemata = [yield: fYield, return: fReturn, bind: fBind] | |
//MoeMap// where | |
ecSchemata$ = (function F2$_(){ | |
var fBind$, fReturn$, fYield$; | |
//MoeMap// fReturn = Enumerable function(x): | |
fReturn$ = Enumerable$({build:function(SCHEMATA$_){return function(x$){ | |
var T4$_, T5$_, T6$_, T7$_; |
This file contains 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
<dict> | |
<key>match</key> | |
<string>[$*,£¥·‘“〈《「『【〔〖〝﹗﹙﹛$(.[{£¥]*[ -鿿][!%),.:;>?¢¨°·ˇˉ―‖’”„‟†‡›℃∶、。〃〆〈《「『〕〗〞︵︹︽︿﹃﹘﹚﹜!"%'),.:;?]`|}~ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻]*</string> | |
<key>name</key> | |
<string>meta.cjkword</string> | |
</dict> |
This file contains 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
function bench1(n){ | |
for(var i = 0; i < n; i++) ; | |
} | |
function bench2(n){ | |
for(var i = 0.5; i < n; i++) ; | |
} | |
function bench3(n){ | |
for(var i = Math.random(); i < n; i++) ; | |
} | |
function bench4(n){ |
This file contains 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
function $(C,E,K){if(!(C instanceof Array))return K("string"==typeof C? | |
E[C]:C);switch(C[0]){case"lambda":return K(function(K){return function( | |
){for(var e=Object.create(E),u=0;u<C[1].length;u++)e[C[1][u]]=arguments | |
[u];return $(C[2],e,K)}});case"if":return $(C[1],E,function(e){return e | |
?$(C[2],E,K):$(C[3],E,K)});case"callcc":return $(C[1],E,function(C){var | |
E=function(){return function(C){return K(C)}};return C(E)(E)});case "'" | |
:return K(C[1]);default:return $c(C,E,K)}}function $c(C,E,K){return $(C | |
[0],E,function(e){return $$(C.slice(1),E,function(C){return e(K).apply( | |
null,C)})})}; function $$(C,E,K) {return C.length?$(C[0],E,function(e){ | |
return $$(C.slice(1),E,function(C){return K(C?[e]:[e].concat(C))})}):K( |
This file contains 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
$input = $args[0] | |
$output = $input -replace '.(gif|png|jpg|jpeg)$','.2x.png' | |
echo "$input --> $output" | |
# 通过叠加在黑色和白色背景上来处理半透明的图片 | |
# 因为我又一次真特么要放大透明图 | |
$temp_black = [System.IO.Path]::GetTempFileName() + '.png' | |
$temp_black_2x = [System.IO.Path]::GetTempFileName() + '.png' | |
$temp_white = [System.IO.Path]::GetTempFileName() + '.png' | |
$temp_white_2x = [System.IO.Path]::GetTempFileName() + '.png' | |
# convert 为 imagemagick |
This file contains 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
; Modified by Belleve Invis | |
; In order to support High DPI environment | |
; FocuslessScroll by Scoox | |
; Source: http://www.autohotkey.com/board/topic/6292-send-mouse-scrolls-to-window-under-mouse/?p=398492 | |
; Modifications by Geoff Stokes | |
;Directives | |
#NoEnv | |
#SingleInstance Force |