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 get(uri) { | |
| return http(uri,'GET'); | |
| } | |
| function post(uri,data) { | |
| if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) { | |
| var params = []; | |
| for(var p in data) { | |
| if(data[p] instanceof Array) { | |
| for(var i = 0; i < data[p].length; i++) { | |
| params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][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
| <a class="question_link" target="_blank" href="/question/30746665/answer/49332475">会写 Parser、Tokenizer 是什么水平?</a><br/><br/>大多数编译原理书前100页的内容,说明大学听了一半左右的编译原理课,通俗地说,写了这个只能证明你不是个棒槌。<br><br><br>所以其实你更应该关心不会tokenizer和parser是什么水平。 | |
| <span class="answer-date-link-wrap"> | |
| <a class="answer-date-link last_updated meta-item" data-tip="s$t$发布于 2015-05-29" target="_blank" href="/question/30746665/answer/49332475">编辑于 2015-05-29</a> | |
| </span> | |
| <hr/><a class="question_link" target="_blank" href="/question/30703519/answer/49150834">王垠到底对 winter 做了什么?</a><br/><br/>你可以理解为是路边看到一坨**,忍不住想去一脚踩爆它的心态。(虽然我知道这么做无聊而且会沾一脚)<br><br>想了想,可能还有一点觉得他的粉丝很可怜的,想让他们停止吃**的心态吧,虽然我知道"然而没卵用"。<br><br>回到题主的问题,要问做了什么,那就是“他是**,还碰巧被我看到了”,这样的事情,简直无法被饶恕。 | |
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
| class BinaryHashTree { | |
| constructor() { | |
| this.root = null; | |
| this.depth = 0; // 记录树的当前深度 | |
| } | |
| // 将数字转换为二进制字符串 | |
| toBinaryString(num) { | |
| return (num >>> 0).toString(2); | |
| } |
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 StartTagToken(){ | |
| } | |
| function EndTagToken(){ | |
| } | |
| function Attribute(){ | |
| } |
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
| const fib = n => n === 0 ? [0, 1] : | |
| n % 2 ? (([a, b]) => [b, a + b])(fib(n - 1)) : | |
| (([a, b]) => [a * b + a * (b - a), a * a + b * b])(fib(n / 2)); | |
| Array(10).fill(0).map((v, n) => fib(n)[0]) |
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
| ' svg.vba released 11.08.2002 | |
| Private Function get_export_scaling_factor() As Single | |
| '' point to pixel conversion factor | |
| get_export_scaling_factor = (4 / 3) | |
| End Function |
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
| [ | |
| { | |
| name:"HTML5", | |
| uri:"http://www.w3.org/TR/html5/single-page.html", | |
| category:"markup" | |
| }, | |
| { | |
| name:"HTML 5.1", | |
| uri:"http://www.w3.org/TR/html51/single-page.html", | |
| category:"markup" |
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
| <div> | |
| <a href="{{protocol}}//{{host}}{{pathname}}">{{protocol}}//{{host}}{{pathname}}</a> | |
| </div> | |
| <script> | |
| function Template(node) { | |
| var prototype = document.createDocumentFragment(); | |
| prototype.appendChild(node); |
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* primes(){ | |
| let primes = []; | |
| let i = 1; | |
| outer:while(true) { | |
| ++ i; | |
| for(let p of primes) | |
| if(p % i === 0) | |
| continue outer; | |
| primes.push(i); | |
| yield 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
| // 2018.5.11更新: 减少了swap | |
| function qSort(compare) { | |
| var swap = (p1, p2) => { | |
| var tmp = this[p1]; | |
| this[p1] = this[p2]; | |
| this[p2] = tmp; | |
| } | |
| var sortRange = (start, end) => { | |
| var midValue = this[start]; | |
| var p1 = start + 1, p2 = end - 1; |
NewerOlder