Simple and reorganized version of http://www.w3.org/2014/07/mobile-web-app-state/
Community
- System Applications Working Group
http://www.w3.org/2012/05/sysapps-wg-charter.html
- Device APIs Working Group
/* | |
检测 两组任意(不限个数 不限花色) 的扑克牌, 混到一起后能否构成任意长度(大于1 小于15)的顺子. | |
A可表示1或14,小王可表示1--5,大王可表示1--14 | |
说明: | |
1 我微博里说 小王代表 1到9有误, 我这边实际遇到的场景是 小王代表 1--5 (当然 这个无所谓) | |
2 牌是可以有重复的 : 例如 可以 4个小王 9个大王 等等, 可以理解为是从无数副扑克牌当中随意抽取出两组 | |
3 组成的顺子 可以不是5张 , 其实严格说 就是 等差为1的等差数列 | |
4 能且只能组成一组顺子, 组成顺子后, 牌没有剩余 |
// ==UserScript== | |
// @author iParanoid | |
// @name V2EX_User_Script | |
// @namespace https://zone-huangxc.rhcloud.com | |
// @description Position fixed the navigation , Scroll to top when double click navigation bar or Page Footer | |
// @include * | |
// @updateURL https://gist.github.com/paranoidxc/5065236/raw/10bc3ee7501b86f2e579657ef64348e642cc2a70/V2EX.user.js | |
// ==/UserScript== | |
function iparanoid_wrapper() { |
function quicksort(input) { | |
if(input.length === 0) return input; | |
var head = input[0], | |
tail = input.slice(1); | |
var less = tail.filter(function(i) { | |
return i < head ? true : false; | |
}); |
// ==UserScript== | |
// @name v2ex 绝对时间 | |
// @namespace http://phpz.org/ | |
// @version 0.1.5 | |
// @description 显示 v2ex 中的绝对时间 | |
// @author Seven Yu | |
// @match *.v2ex.com/* | |
// @run-at document-end | |
// @grant none | |
// @updateURL https://gist.github.com/dofy/38c8d67405a5597f4e7e/raw |
function randomColor(){ | |
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
} | |
function showBoxes(window) { | |
var rects = []; | |
function getRects(node){ | |
var range = window.document.createRange(); | |
range.setStartBefore(node); | |
range.setEndAfter(node); |
var count = 0; | |
var memoizer = function(memo, formula) { | |
var recur = function(n) { | |
var result = memo[n]; | |
if (typeof result !== "number") { | |
result = formula(n); | |
memo[n] = result; | |
} | |
return result; |
Simple and reorganized version of http://www.w3.org/2014/07/mobile-web-app-state/
Community
- System Applications Working Group
http://www.w3.org/2012/05/sysapps-wg-charter.html
function StartTagToken(){ | |
} | |
function EndTagToken(){ | |
} | |
function Attribute(){ | |
} | |
/* | |
* memoize.js | |
* by @philogb and @addyosmani | |
* further optimizations by @mathias | |
* Released under an MIT license. | |
*/ | |
function memoize( fn ) { | |
return function () { | |
var args = Array.prototype.slice.call(arguments), | |
hash = "", |
var npm = require('npm') | |
, pack = require('./package.json') | |
, modules = {} | |
; | |
if(pack.dependencies) build(pack.dependencies); | |
if(pack.optionalDependencies) build(pack.optionalDependencies); | |
if(pack.devDependencies) build(pack.devDependencies); | |
function build(dependancies) { |