I hereby claim:
- I am pezy on github.
- I am pezy (https://keybase.io/pezy) on keybase.
- I have a public key ASAfWEh-NpE3eSibFcY6oB7HpwJJQs72TBmHb0J8Hvb_dwo
To claim this, I am signing this object:
youtube-dl --proxy socks5://127.0.0.1:1080 |
I hereby claim:
To claim this, I am signing this object:
{ | |
"workbench.colorTheme": "Visual Studio Light", | |
"editor.formatOnType": true, | |
"editor.fontSize": 15, | |
// python | |
"python.linting.pylintEnabled": false, | |
"python.linting.pep8Enabled": true, | |
"python.formatting.provider": "yapf", | |
"python.autoComplete.addBrackets": true |
var chapter_list = document.getElementsByClassName('chapter'); | |
var result = []; | |
for (var i = 0; i < chapter_list.length; ++i) | |
result.push(chapter_list[i].getElementsByTagName('h3')[0].innerText); | |
for (var i = 0; i < result.length; ++i) | |
document.write('- [ ] '+ result[i] + '<br>'); |
#include <iostream> | |
#include <string> | |
class Sales_data { | |
public: | |
friend std::istream& read(std::istream&, Sales_data&); | |
Sales_data(std::istream &is = std::cin) { read(is, *this); } | |
std::string bookNo; |
#include <vector> | |
#include <iostream> | |
int main() | |
{ | |
std::vector<int*> vec(10, new int); | |
for (auto p : vec) | |
std::cout << static_cast<void*>(p) << std::endl; | |
} |
#define CATCH_CONFIG_MAIN | |
#include <string> | |
#include <iostream> | |
#include "catch.hpp" | |
std::string trimToString(double dValue) | |
{ | |
std::string strRst = std::to_string(dValue); | |
while (strRst.back() == '0') strRst.pop_back(); | |
if (strRst.back() == '.') strRst.pop_back(); |
Here is a solution that is more efficient than the sieve of Eratosthenes. It is derived from similar algorithms for counting primes. The advantage is that there is no need to find all the primes to find their sum. | |
The main idea is as follows: Let S(v,m) be the sum of integers in the range 2..v that remain after sieving with all primes smaller or equal than m. That is S(v,m) is the sum of integers up to v that are either prime or the product of primes larger than m. | |
S(v, p) is equal to S(v, p-1) if p is not prime or v is smaller than p*p. Otherwise (p prime, p*p<=v) S(v,p) can be computed from S(v,p-1) by finding the sum of integers that are removed while sieving with p. An integer is removed in this step if it is the product of p with another integer that has no divisor smaller than p. This can be expressed as | |
S(v,p)=S(v,p−1)−p(S(v/p,p−1)−S(p−1,p−1)). | |
Dynamic programming can be used to implement this. It is sufficient to compute S(v,p) for all positive integers v that are representable as floor(n/k) for |
always: | |
try { | |
your best and; | |
do { | |
what you need to do; | |
} while (you still have the time); | |
for (opportunity; comes; only once) { | |
so grap the chance; | |
} |
// given 3 points on plane (x1,y1,z1), (x2,y2,z2), (x3,y3,z3) | |
// get distance to (x,y,z) | |
double plane_exp_point_dist_3d ( double x1, double y1, double z1, double x2, | |
double y2, double z2, double x3, double y3, double z3, double x, double y, double z ) | |
{ | |
double a; | |
double b; | |
double c; | |
double d; | |
double dist; |