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
function bubblesort() { | |
var numElements = this.dataStore.length; | |
var temp; | |
for (var outer = numElements; outer >= 2; --outer) { | |
for (var inner = 0; inner <= outer - 1; ++inner) { | |
if (this.dataStore[inner] > this.dataStore[inner + 1]) { | |
temp = this.dataStore[inner]; | |
this.dataStore[inner] = this.dataStore[inner + 1]; | |
this.dataStore[inner + 1] = temp; | |
} |
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
//test |
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
function cat() { | |
var head = _.first(arguments); | |
if (existy(head)) | |
return head.concat.apply(head, _.rest(arguments)); | |
else | |
return []; | |
} | |
function construct(head, tail) { | |
return cat([head], _.toArray(tail)); |
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
<h1 class="index_title"> | |
About Me | |
</h1> | |
<br/> | |
<p class="selfy"> | |
Hi there, my name is William He or Weinan He in Chinese. I'm currently living in Hong Kong and working at <a target="_blank" href="https://www.accedo.tv/">Accedo</a> as the Software Developer. | |
<br/> | |
<br/> My current job is to develop cool Web TV applications, which is one type of web application, with the amazing javaScript. I love to explore and learn more about the web technology world and develop some useful applications in my spare time! | |
<br/> |
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
function HashTable() { | |
this.table = new Array(137); | |
this.simpleHash = simpleHash; | |
this.betterHash = betterHash; | |
this.showDistro = showDistro; | |
this.put = put; | |
this.get = get; | |
} | |
/*function put(data) { |
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
function Node(element) { | |
this.element = element; | |
this.next = null; | |
this.previous = null; | |
} | |
function LList() { | |
this.head = new Node("head"); | |
this.find = find; | |
this.insert = insert; |
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
function Stack() { | |
// this._size = 0; | |
// this._storage = {}; | |
this._storage = []; // array could be more performant due to array browser optimize | |
} | |
Stack.prototype.push = function (data) { | |
// var size = ++this._size; | |
var len = this._storage.length; | |
this._storage[len] = data; |
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
var fs = require('fs') | |
var out = fs.readFileSync('src.txt', 'utf8') | |
.trim().split('\n') | |
.reduce(function (acc, cur) { | |
var curArr = cur.split(' '); | |
if (typeof acc[curArr[0]] !== 'object') { | |
acc[curArr[0]] = []; | |
} |
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
(function () { | |
function flip() { | |
var result = flipString(document.f.original.value.toLowerCase()); | |
document.f.flipped.value = result; | |
} | |
function flipString(aString) { | |
var last = aString.length - 1; | |
var result = new Array(aString.length) | |
for (var i = last; i >= 0; --i) { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef unsigned long u64; | |
/* Start here */ | |
typedef void enc_cfg_t; | |
typedef int enc_cfg2_t; | |
typedef __int128_t dcf_t; |