The program below can take one or more plain text files as input. It works with python2 and python3.
Let's say we have two files that may contain email addresses:
- file_a.txt
foo bar
ok [email protected] sup
[email protected],wyd
hello world!
| # Based on http://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c | |
| import binascii | |
| import numpy as np | |
| np.seterr(over='ignore') | |
| def rotl32(v, c): | |
| assert isinstance(v, np.uint32) | |
| assert isinstance(c, np.uint32) |
The program below can take one or more plain text files as input. It works with python2 and python3.
Let's say we have two files that may contain email addresses:
foo bar
ok [email protected] sup
[email protected],wyd
hello world!
| from pylab import * | |
| def cface(ax, x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18): | |
| # x1 = height of upper face | |
| # x2 = overlap of lower face | |
| # x3 = half of vertical size of face | |
| # x4 = width of upper face | |
| # x5 = width of lower face | |
| # x6 = length of nose | |
| # x7 = vertical position of mouth |
| # ============= | |
| # Introduction | |
| # ============= | |
| # I've been doing some data mining lately and specially looking into `Gradient | |
| # Boosting Trees <http://en.wikipedia.org/wiki/Gradient_boosting>`_ since it is | |
| # claimed that this is one of the techniques with best performance out of the | |
| # box. In order to have a better understanding of the technique I've reproduced | |
| # the example of section *10.14.1 California Housing* in the book `The Elements of Statistical Learning <http://www-stat.stanford.edu/~tibs/ElemStatLearn/>`_. | |
| # Each point of this dataset represents the house value of a property with some | |
| # attributes of that house. You can get the data and the description of those |
| # -*- coding: utf-8 -*- | |
| """ | |
| Minimalistic implementation of l1 minimization via coordinate descent. | |
| Reference: www.jstatsoft.org/v33/i01/paper | |
| Author: Fabian Pedregosa <[email protected]> | |
| """ | |
| import numpy as np |
(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)
Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺
Locally, I'm at this commit:
$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date: Sun Apr 15 16:35:03 2012 +0200
Inspired by this article. Neat tricks for speeding up integer computations.
Note: cin.sync_with_stdio(false); disables synchronous IO and gives you a performance boost.
If used, you should only use cin for reading input
(don't use both cin and scanf when sync is disabled, for example)
or you will get unexpected results.
x = x << 1; // x = x * 2
| import numpy as np | |
| import warnings | |
| from itertools import cycle, izip | |
| from sklearn.utils import gen_even_slices | |
| from sklearn.utils import shuffle | |
| from sklearn.base import BaseEstimator | |
| from sklearn.base import ClassifierMixin | |
| from sklearn.preprocessing import LabelBinarizer |