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
-- redis-priority-queue | |
-- Author: Ensky Lin | |
-- Version: 1.0.0 | |
-- (can only be used in 3.2+) | |
-- Get mandatory vars | |
local action = ARGV[1]; | |
local key = ARGV[2]; | |
local count = ARGV[3]; |
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
check 1: | 7, 3 | 8, 5 | | 1, 9 | | |
check 2: | 6,12 | 3,10 | 5, 7 | 4, 2 | | |
check 3: | 11, 4 | 7, 6 | 3, 9 | | | 2, 8 | |
check 4: | | 4, 1 | 2, 6 | 7, 8 | 3,12 | 5,11 | 10, 9 | |
check 5: | | | 12,11 | | 8,10 | 1, 2 | 7, 4 | |
check 6: | 1, 8 | 12, 9 | | 11,10 | 2, 7 | 3, 4 | 6, 5 | |
check 7: | 10, 5 | 11, 2 | 4, 8 | 3, 6 | | 9, 7 | 12, 1 | |
check 8: | 9, 2 | | 10, 1 | 5,12 | | 6, 8 | 3,11 | |
Run Times: 19239411 | |
Memory: 0 MB |
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
// 中文字會算長度2,英文字算長度1 | |
String.prototype.Blength = function() { | |
var arr = this.match(/[^\x00-\xff]/ig); | |
return arr == null ? this.length : this.length + arr.length; | |
}; |