src post: https://programming.dev/post/5896373
type Wtf = Option<Option<Option<Option<Option<Option<Option<Option<()>>>>>>>>;
let two = Some(Some(Some(Some(Some(Some(None))))));
let three = Some(Some(Some(Some(Some(None)))));
let six = Some(Some(None));
unsafe {
assert_eq!(
std::mem::transmute::<Wtf, u8>(two) * std::mem::transmute::<Wtf, u8>(three),
std::mem::transmute::<Wtf, u8>(six)
);
}
testing solarized themes
src sample from ref img from
c
ref dark ref light
#define UNICODE #include int main(int argc, char **argv) { int speed = 0, speed1 = 0, speed2 = 0; // 1-20 printf("Set Mouse Speed by Maverick\n"); SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); printf("Current speed: %2d\n", speed); if (argc == 1) return 0; if (argc >= 2) sscanf(argv[1], "%d", &speed1); if (argc >= 3) sscanf(argv[2], "%d", &speed2); if (argc == 2) // set speed to first value speed = speed1; else if (speed == speed1 || speed == speed2) // alternate speed = speed1 + speed2 - speed; else speed = speed1; // start with first value SystemParametersInfo(SPI_SETMOUSESPEED, 0, speed, 0); SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); printf("New speed: %2d\n", speed); return 0; }
js
ref dark ref light
/** sample javascript from xui */ var undefined, xui, window = this, string = new String('string'), document = window.document, simpleExpr = /^#?([\w-]+)$/, idExpr = /^#/, tagExpr = /<([\w:]+)/, slice = function (e) { return [].slice.call(e, 0); }; try { var a = slice(document.documentElement.childNodes)[0].nodeType; } catch(e){ slice = function (e) { var ret=[]; for (var i=0; e[i]; i++) ret.push(e[i]); return ret; }; } window.x$ = window.xui = xui = function(q, context) { return new xui.fn.find(q, context); };