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 cache = [] | |
| [1,2,3,4].map(function(i){ | |
| return i * 2 | |
| }) | |
| .inspect() // log intermediate value [2,4,6,8] | |
| .store(cache) // store intermediate value [2,4,6,8] in cache variable | |
| .reverse() // [8,6,4,2] | |
| .filter(function(i, k){ | |
| return i >= cache[k] |
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
| function bind_select(first, second, data){ | |
| var change = function(evt){ | |
| var first_elem = $(first)[0]; | |
| var second_elem = $(second); | |
| second_elem.html(""); | |
| second_elem = second_elem[0] | |
| values = data[first_elem.value] | |
| for (var i=0, len = values.length; i < len; i++){ | |
| if (!(values[i] instanceof Array)){ | |
| values[i] = [values[i]] |
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
| function bind_ajax_update(selector, until, interval, get_status, callback){ | |
| var filters = [] | |
| interval = interval || 5000 | |
| for (var i in until){ | |
| filters.push("[status=" + until[i] + "]") | |
| } | |
| var ajax_update = function(elem){ | |
| var $elem = $(elem) | |
| var url = $elem.attr("data-url") | |
| console.log("ajax update") |
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
| // XF_FLT_OMPDlg.cpp : 实现文件 | |
| // | |
| #include "stdafx.h" | |
| #include "XF_FLT_OMP.h" | |
| #include "XF_FLT_OMPDlg.h" | |
| #include "afxdialogex.h" | |
| #ifdef _DEBUG | |
| #define new DEBUG_NEW |
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 math | |
| def generate(id, align = 8): | |
| a = bin(id)[2:] | |
| bin_align = int(math.log(10 ** align, 2)) | |
| fill_a = a.rjust(bin_align, '0') | |
| left = fill_a[: bin_align / 2] | |
| right = fill_a[bin_align / 2:] | |
| temp = [int(right[-1])] | |
| for i in right[::-1][1:]: |