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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ClientDemo |
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
<script src="https://cdn.bootcss.com/mathjax/2.7.4/MathJax.js?config=default"> | |
MathJax.Hub.Config({ | |
tex2jax: { | |
inlineMath: [['$','$'],["\\(","\\)"]], | |
displayMath: [['\\[','\\]'], ['$$','$$']], | |
}, | |
}); | |
</script> |
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
// Generated by gfwlist2pac | |
// https://github.com/clowwindy/gfwlist2pac | |
var domains = { | |
"stackoverflow.com": 1, | |
"w3schools.com": 1, | |
"codeforces.com": 1, | |
"disqus.com": 1, | |
"onedrive.live.com": 1, | |
"quora.com": 1, |
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
int findKthSmallest(int vec1[], int n1, int vec2[], int n2, int k) | |
{ | |
if (n1 == 0) | |
return vec2[k - 1]; | |
else if (n2 == 0) | |
return vec1[k - 1]; | |
if (k == 1) | |
return vec1[0] < vec2[0] ? vec1[0] : vec2[0]; | |
int idx1 = n1 * 1.0 / (n1 + n2) * (k - 1); |
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
/** | |
* @author pwxcoo | |
* @email pwxcoo@gmail.com | |
* @create date 2018-09-11 10:30:47 | |
* @modify date 2018-09-11 13:28:17 | |
* @desc LRU cache implemented by c++ | |
*/ | |
#ifndef _LRUCACHE_INCLUDED_ | |
#define _LRUCACHE_INCLUDED_ |
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
def newtonSqrt(n, eps=1e-8): | |
""" | |
- ASSUME | |
f(x) = x^2 - n | |
when f(x)=0, x will be the root of n. | |
- DEDUCE BY Taylor Series Formula | |
f(x) = f(x0) + (x - x0)f'(x0) | |
- WHEN f(x)=0 | |
x = x0 - f(x0)/f'(x0) | |
x will be closer to the root than x0 |
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
vector<int> inorderTraversal(TreeNode* root) { | |
stack<TreeNode*> st; | |
vector<int> res; | |
auto now = root; | |
while(!st.empty() || now) | |
{ | |
while(now) | |
{ | |
st.push(now); |
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 <cstdio> | |
#include <cstring> | |
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <stack> | |
#include <bitset> | |
#include <cstdlib> | |
#include <cmath> |
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
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
OlderNewer