rst 感知器比较表
感知器比较表
comp.rst
.. list-table:: :shade:`DNN Benchmarks Comparison`
:widths: 50 24 24 24 24
:header-rows: 1
* - Properties
- Perceptron
- Cleverhans
- Foolbox
- IBM ART
* - Multi-platform support
- :math:`\checkmark`
- :math:`\checkmark`
- :math:`\checkmark`
- :math:`\checkmark`
* - Consistent API design
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Custom adversarial criteria
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Multiple perceptual tasks
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\cdot`
- :math:`\cdot`
* - Standardized metrics
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\checkmark`
- :math:`\cdot`
* - Verifiable robustness bounds
- :math:`\checkmark`
- :math:`\cdot`
- :math:`\cdot`
- :math:`\cdot`
Explanation of compared properties:
- :blue:`Multi-platform support`: supports at least the
three deep learning frameworks, :code:`Tensoflow`,
:code:`PyTorch`, and :code:`Keras`.
- :blue:`Consistent API design`: implementations of evaluation methods
are platform-agnostic. More specifically, the same piece of code for
an evaluation method (e.g., a :code:`C&W` attack) can run against
models across all platforms (e.g., :code:`Tensorflow`,
:code:`PyTorch`, and :code:`cloud API`).
- :blue:`Custom adversarial criterion`: a criterion defines under what
circumstances an :code:`(input, label)` pair is considered an adversary.
Customized adversarial criteria other than :code:`misclassification`
should be supported.
- :blue:`Multiple perceptual tasks`: supports computer vision tasks other
than :code:`classification`, e.g., :code:`object detection` and
:code:`face recognition`.
- :blue:`Standardized metrics`: enables DNN models' robustness to be
comparable on all **security** and **safety** properties.
- :blue:`Verifiable robustness bounds`: supports verification of certain
safety properties. Returns either a verifiable bound, indicating that the
model is robust against perturbations within that bound, or return
counter-examples.
rst [学习] c ++流类
[学习] c ++流类
README.rst
c++ stream usage
================
reference
^^^^^^^^^
http://www.cplusplus.com/reference/iolibrary/
fig. class
^^^^^^^^^^
.. image:: https://user-images.githubusercontent.com/11242468/51447433-74325680-1d61-11e9-96fe-d7bcfb57fed3.gif
classes
^^^^^^^
:ifstream: input file stream
:ofstream: output file stream
rst コンパイラ·DSL关连ことはじめ
コンパイラ·DSL关连ことはじめ
about-compiler-dsl.rst
====
コンパイラ・DSL関連ことはじめ
====
:ver: 18.09.1
主に構文解析を行いたく、コンパイラや外部DSL関連のメモを記述する。
コンパイラの処理の流れ
==================
1. 字句解析 (Lexical Analyzer)
2. 構文解析 (Syntax Analyzer)
3. 意味解析
ツール
=====
字句解析系
--------
字句解析を行うプログラム(Lexical Analizer)を自動生成する
- Lex
- Flex
構文解析系
---------
構文解析を行うプログラム(Parser)を自動生成する
- yacc
- GNU bison
単語
====
BNF <Backus‚AiNaur form>
description
AST <Abstract Syntax Tree> (抽象構文木)
description
DSL <Domain Specific Language>
description
字句解析器(Lexer)
description
構文解析器(Parser)
description
構文解析手法
----------
- SLR法
- LL
- LR
- LALR(Lookahead LR)法 (SLRより多くの文脈自由文法を扱える)
- GLR
- PEG
20世紀
``````
- YACC
- LL
21世紀
``````
- PEG (+ Packrat Parser)
データに着目
==========
| ソースコード(UTF-8 など)
| トークン列
| 解析木または抽象構文木
| 中間言語(WebAssembly など)
| アセンブリ
| オブジェクト・ファイル(PE, ELF など)
| コード署名が付加されたオブジェクト・ファイル(PE など)
参考
====
| `何となく勉強した気分になれるパーサ入門 <https://www.slideshare.net/takahashim/what-is-parser>`_
| `LR(1)パーサジェネレータを自作して構文解析をする 第1回:かんたん構文解析入門 <http://tatamo.81.la/blog/2016/12/22/lr-parser-generator-implementation>`_
| `文脈自由文法とその構文解析法 <https://kimiyuki.net/blog/2016/08/03/context-free-grammar>`_
rst 如何在OSX上与docker容器共享文件夹
如何在OSX上与docker容器共享文件夹
docker-osx-shared-folders.rst
====================================================
How to share a folder with a docker container on OSX
====================================================
Mounting shared folders between OSX and the docker container is tricky due to
the intermediate boot2docker VM. You can't use the usual ``docker -v`` option as
the docker server knows nothing about the OSX filesystem - it can only mount
folders from the boot2docker filesystem. Fortunately, you can work around this
using SSHFS.
Install sshfs on the boot2docker machine::
$ boot2docker ssh
docker@boot2docker:~$ tce-load -wi sshfs-fuse
and create a folder to mount to::
docker@boot2docker:~$ mkdir ~/osx
Ensure that 'Remote Login' is enabled in 'System Preferences > Sharing' and make
a note of your host IP address.
Now run sshfs on the boot2docker VM to mount a folder from your host machine::
docker@boot2docker:~$ sudo sshfs $username@$ipaddress:/Users/$username/ /home/docker/osx/
replacing ``$username`` and ``$ipaddress`` as appropriate. You'll have to enter
your password.
Now you can run a docker container (using the docker client on your host machine) and mount a local folder (using the path
to it on the boot2docker VM),
eg::
$ docker run -it -v /home/docker/osx/somefolder:/opt/somefolder ubuntu bash
and any updates made within your local folder will be immediately visible within
the container.
Largely taken from the comments here:
https://github.com/boot2docker/boot2docker/issues/188
rst ReStructuredText示例
ReStructuredText示例
RJ - Primer.rst
<details>
<summary>Primer</summary>
A ReStructuredText Primer
=========================
:Author: Richard Jones
:Version: $Revision: 5801 $
:Copyright: This document has been placed in the public domain.
.. contents::
The text below contains links that look like "(quickref__)". These
are relative links that point to the `Quick reStructuredText`_ user
reference. If these links don't work, please refer to the `master
quick reference`_ document.
__
.. _Quick reStructuredText: quickref.html
.. _master quick reference:
http://docutils.sourceforge.net/docs/user/rst/quickref.html
.. Note:: This document is an informal introduction to
reStructuredText. The `What Next?`_ section below has links to
further resources, including a formal reference.
Structure
---------
From the outset, let me say that "Structured Text" is probably a bit
of a misnomer. It's more like "Relaxed Text" that uses certain
consistent patterns. These patterns are interpreted by a HTML
converter to produce "Very Structured Text" that can be used by a web
browser.
The most basic pattern recognised is a **paragraph** (quickref__).
That's a chunk of text that is separated by blank lines (one is
enough). Paragraphs must have the same indentation -- that is, line
up at their left edge. Paragraphs that start indented will result in
indented quote paragraphs. For example::
This is a paragraph. It's quite
short.
This paragraph will result in an indented block of
text, typically used for quoting other text.
This is another one.
Results in:
This is a paragraph. It's quite
short.
This paragraph will result in an indented block of
text, typically used for quoting other text.
This is another one.
__ quickref.html#paragraphs
Text styles
-----------
(quickref__)
__ quickref.html#inline-markup
Inside paragraphs and other bodies of text, you may additionally mark
text for *italics* with "``*italics*``" or **bold** with
"``**bold**``". This is called "inline markup".
If you want something to appear as a fixed-space literal, use
"````double back-quotes````". Note that no further fiddling is done
inside the double back-quotes -- so asterisks "``*``" etc. are left
alone.
If you find that you want to use one of the "special" characters in
text, it will generally be OK -- reStructuredText is pretty smart.
For example, this lone asterisk * is handled just fine, as is the
asterisk in this equation: 5*6=30. If you actually
want text \*surrounded by asterisks* to **not** be italicised, then
you need to indicate that the asterisk is not special. You do this by
placing a backslash just before it, like so "``\*``" (quickref__), or
by enclosing it in double back-quotes (inline literals), like this::
``*``
__ quickref.html#escaping
.. Tip:: Think of inline markup as a form of (parentheses) and use it
the same way: immediately before and after the text being marked
up. Inline markup by itself (surrounded by whitespace) or in the
middle of a word won't be recognized. See the `markup spec`__ for
full details.
__ ../../ref/rst/restructuredtext.html#inline-markup
Lists
-----
Lists of items come in three main flavours: **enumerated**,
**bulleted** and **definitions**. In all list cases, you may have as
many paragraphs, sublists, etc. as you want, as long as the left-hand
side of the paragraph or whatever aligns with the first line of text
in the list item.
Lists must always start a new paragraph -- that is, they must appear
after a blank line.
**enumerated** lists (numbers, letters or roman numerals; quickref__)
__ quickref.html#enumerated-lists
Start a line off with a number or letter followed by a period ".",
right bracket ")" or surrounded by brackets "( )" -- whatever you're
comfortable with. All of the following forms are recognised::
1. numbers
A. upper-case letters
and it goes over many lines
with two paragraphs and all!
a. lower-case letters
3. with a sub-list starting at a different number
4. make sure the numbers are in the correct sequence though!
I. upper-case roman numerals
i. lower-case roman numerals
(1) numbers again
1) and again
Results in (note: the different enumerated list styles are not
always supported by every web browser, so you may not get the full
effect here):
1. numbers
A. upper-case letters
and it goes over many lines
with two paragraphs and all!
a. lower-case letters
3. with a sub-list starting at a different number
4. make sure the numbers are in the correct sequence though!
I. upper-case roman numerals
i. lower-case roman numerals
(1) numbers again
1) and again
**bulleted** lists (quickref__)
__ quickref.html#bullet-lists
Just like enumerated lists, start the line off with a bullet point
character - either "-", "+" or "*"::
* a bullet point using "*"
- a sub-list using "-"
+ yet another sub-list
- another item
Results in:
* a bullet point using "*"
- a sub-list using "-"
+ yet another sub-list
- another item
**definition** lists (quickref__)
__ quickref.html#definition-lists
Unlike the other two, the definition lists consist of a term, and
the definition of that term. The format of a definition list is::
what
Definition lists associate a term with a definition.
*how*
The term is a one-line phrase, and the definition is one or more
paragraphs or body elements, indented relative to the term.
Blank lines are not allowed between term and definition.
Results in:
what
Definition lists associate a term with a definition.
*how*
The term is a one-line phrase, and the definition is one or more
paragraphs or body elements, indented relative to the term.
Blank lines are not allowed between term and definition.
Preformatting (code samples)
----------------------------
(quickref__)
__ quickref.html#literal-blocks
To just include a chunk of preformatted, never-to-be-fiddled-with
text, finish the prior paragraph with "``::``". The preformatted
block is finished when the text falls back to the same indentation
level as a paragraph prior to the preformatted block. For example::
An example::
Whitespace, newlines, blank lines, and all kinds of markup
(like *this* or \this) is preserved by literal blocks.
Lookie here, I've dropped an indentation level
(but not far enough)
no more example
Results in:
An example::
Whitespace, newlines, blank lines, and all kinds of markup
(like *this* or \this) is preserved by literal blocks.
Lookie here, I've dropped an indentation level
(but not far enough)
no more example
Note that if a paragraph consists only of "``::``", then it's removed
from the output::
::
This is preformatted text, and the
last "::" paragraph is removed
Results in:
::
This is preformatted text, and the
last "::" paragraph is removed
Sections
--------
(quickref__)
__ quickref.html#section-structure
To break longer text up into sections, you use **section headers**.
These are a single line of text (one or more words) with adornment: an
underline alone, or an underline and an overline together, in dashes
"``-----``", equals "``======``", tildes "``~~~~~~``" or any of the
non-alphanumeric characters ``= - ` : ' " ~ ^ _ * + # < >`` that you
feel comfortable with. An underline-only adornment is distinct from
an overline-and-underline adornment using the same character. The
underline/overline must be at least as long as the title text. Be
consistent, since all sections marked with the same adornment style
are deemed to be at the same level::
Chapter 1 Title
===============
Section 1.1 Title
-----------------
Subsection 1.1.1 Title
~~~~~~~~~~~~~~~~~~~~~~
Section 1.2 Title
-----------------
Chapter 2 Title
===============
This results in the following structure, illustrated by simplified
pseudo-XML::
<section>
<title>
Chapter 1 Title
<section>
<title>
Section 1.1 Title
<section>
<title>
Subsection 1.1.1 Title
<section>
<title>
Section 1.2 Title
<section>
<title>
Chapter 2 Title
(Pseudo-XML uses indentation for nesting and has no end-tags. It's
not possible to show actual processed output, as in the other
examples, because sections cannot exist inside block quotes. For a
concrete example, compare the section structure of this document's
source text and processed output.)
Note that section headers are available as link targets, just using
their name. To link to the Lists_ heading, I write "``Lists_``". If
the heading has a space in it like `text styles`_, we need to quote
the heading "```text styles`_``".
Document Title / Subtitle
`````````````````````````
The title of the whole document is distinct from section titles and
may be formatted somewhat differently (e.g. the HTML writer by default
shows it as a centered heading).
To indicate the document title in reStructuredText, use a unique adornment
style at the beginning of the document. To indicate the document subtitle,
use another unique adornment style immediately after the document title. For
example::
================
Document Title
================
----------
Subtitle
----------
Section Title
=============
...
Note that "Document Title" and "Section Title" above both use equals
signs, but are distict and unrelated styles. The text of
overline-and-underlined titles (but not underlined-only) may be inset
for aesthetics.
Images
------
(quickref__)
__ quickref.html#directives
To include an image in your document, you use the the ``image`` directive__.
For example::
.. image:: images/biohazard.png
results in:
.. image:: images/biohazard.png
The ``images/biohazard.png`` part indicates the filename of the image
you wish to appear in the document. There's no restriction placed on
the image (format, size etc). If the image is to appear in HTML and
you wish to supply additional information, you may::
.. image:: images/biohazard.png
:height: 100
:width: 200
:scale: 50
:alt: alternate text
See the full `image directive documentation`__ for more info.
__ ../../ref/rst/directives.html
__ ../../ref/rst/directives.html#images
What Next?
----------
This primer introduces the most common features of reStructuredText,
but there are a lot more to explore. The `Quick reStructuredText`_
user reference is a good place to go next. For complete details, the
`reStructuredText Markup Specification`_ is the place to go [#]_.
Users who have questions or need assistance with Docutils or
reStructuredText should post a message to the Docutils-users_ mailing
list.
.. [#] If that relative link doesn't work, try the master document:
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html.
.. _reStructuredText Markup Specification:
../../ref/rst/restructuredtext.html
.. _Docutils-users: ../mailing-lists.html#docutils-users
.. _Docutils project web site: http://docutils.sourceforge.net/
</details>
RJ - Cheatsheet.rst
=====================================================
The reStructuredText_ Cheat Sheet: Syntax Reminders
=====================================================
:Info: See <http://docutils.sf.net/rst.html> for introductory docs.
:Author: David Goodger <goodger@python.org>
:Date: $Date: 2013-02-20 02:10:53 +0100 (Mi, 20. Feb 2013) $
:Revision: $Revision: 7612 $
:Description: This is a "docinfo block", or bibliographic field list
.. NOTE:: If you are reading this as HTML, please read
`<cheatsheet.txt>`_ instead to see the input syntax examples!
Section Structure
=================
Section titles are underlined or overlined & underlined.
Body Elements
=============
Grid table:
+--------------------------------+-----------------------------------+
| Paragraphs are flush-left, | Literal block, preceded by "::":: |
| separated by blank lines. | |
| | Indented |
| Block quotes are indented. | |
+--------------------------------+ or:: |
| >>> print 'Doctest block' | |
| Doctest block | > Quoted |
+--------------------------------+-----------------------------------+
| | Line blocks preserve line breaks & indents. [new in 0.3.6] |
| | Useful for addresses, verse, and adornment-free lists; long |
| lines can be wrapped with continuation lines. |
+--------------------------------------------------------------------+
Simple tables:
================ ============================================================
List Type Examples (syntax in the `text source <cheatsheet.txt>`_)
================ ============================================================
Bullet list * items begin with "-", "+", or "*"
Enumerated list 1. items use any variation of "1.", "A)", and "(i)"
#. also auto-enumerated
Definition list Term is flush-left : optional classifier
Definition is indented, no blank line between
Field list :field name: field body
Option list -o at least 2 spaces between option & description
================ ============================================================
================ ============================================================
Explicit Markup Examples (visible in the `text source`_)
================ ============================================================
Footnote .. [1] Manually numbered or [#] auto-numbered
(even [#labelled]) or [*] auto-symbol
Citation .. [CIT2002] A citation.
Hyperlink Target .. _reStructuredText: http://docutils.sf.net/rst.html
.. _indirect target: reStructuredText_
.. _internal target:
Anonymous Target __ http://docutils.sf.net/docs/ref/rst/restructuredtext.html
Directive ("::") .. image:: images/biohazard.png
Substitution Def .. |substitution| replace:: like an inline directive
Comment .. is anything else
Empty Comment (".." on a line by itself, with blank lines before & after,
used to separate indentation contexts)
================ ============================================================
Inline Markup
=============
*emphasis*; **strong emphasis**; `interpreted text`; `interpreted text
with role`:emphasis:; ``inline literal text``; standalone hyperlink,
http://docutils.sourceforge.net; named reference, reStructuredText_;
`anonymous reference`__; footnote reference, [1]_; citation reference,
[CIT2002]_; |substitution|; _`inline internal target`.
Directive Quick Reference
=========================
See <http://docutils.sf.net/docs/ref/rst/directives.html> for full info.
================ ============================================================
Directive Name Description (Docutils version added to, in [brackets])
================ ============================================================
attention Specific admonition; also "caution", "danger",
"error", "hint", "important", "note", "tip", "warning"
admonition Generic titled admonition: ``.. admonition:: By The Way``
image ``.. image:: picture.png``; many options possible
figure Like "image", but with optional caption and legend
topic ``.. topic:: Title``; like a mini section
sidebar ``.. sidebar:: Title``; like a mini parallel document
parsed-literal A literal block with parsed inline markup
rubric ``.. rubric:: Informal Heading``
epigraph Block quote with class="epigraph"
highlights Block quote with class="highlights"
pull-quote Block quote with class="pull-quote"
compound Compound paragraphs [0.3.6]
container Generic block-level container element [0.3.10]
table Create a titled table [0.3.1]
list-table Create a table from a uniform two-level bullet list [0.3.8]
csv-table Create a table from CSV data [0.3.4]
contents Generate a table of contents
sectnum Automatically number sections, subsections, etc.
header, footer Create document decorations [0.3.8]
target-notes Create an explicit footnote for each external target
math Mathematical notation (input in LaTeX format)
meta HTML-specific metadata
include Read an external reST file as if it were inline
raw Non-reST data passed untouched to the Writer
replace Replacement text for substitution definitions
unicode Unicode character code conversion for substitution defs
date Generates today's date; for substitution defs
class Set a "class" attribute on the next element
role Create a custom interpreted text role [0.3.2]
default-role Set the default interpreted text role [0.3.10]
title Set the metadata document title [0.3.10]
================ ============================================================
Interpreted Text Role Quick Reference
=====================================
See <http://docutils.sf.net/docs/ref/rst/roles.html> for full info.
================ ============================================================
Role Name Description
================ ============================================================
emphasis Equivalent to *emphasis*
literal Equivalent to ``literal`` but processes backslash escapes
math Mathematical notation (input in LaTeX format)
PEP Reference to a numbered Python Enhancement Proposal
RFC Reference to a numbered Internet Request For Comments
raw For non-reST data; cannot be used directly (see docs) [0.3.6]
strong Equivalent to **strong**
sub Subscript
sup Superscript
title Title reference (book, etc.); standard default role
================ ============================================================
GH - Markup - RST.rst
Header 1
========
--------
Subtitle
--------
Example text.
.. contents:: Table of Contents
Header 2
--------
1. Blah blah ``code`` blah
2. More ``code``, hooray
3. Somé UTF-8°
The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.
.. csv-table:: Things that are Awesome (on a scale of 1-11)
:quote: ”
Thing,Awesomeness
Icecream, 7
Honey Badgers, 10.5
Nickelback, -2
Iron Man, 10
Iron Man 2, 3
Tabular Data, 5
Made up ratings, 11
.. code::
A block of code
.. code:: python
python.code('hooray')
.. code:: javascript
export function ƒ(ɑ, β) {}
.. doctest:: ignored
>>> some_function()
'result'
>>> some_function()
'result'
============== ==========================================================
Travis http://travis-ci.org/tony/pullv
Docs http://pullv.rtfd.org
API http://pullv.readthedocs.org/en/latest/api.html
Issues https://github.com/tony/pullv/issues
Source https://github.com/tony/pullv
============== ==========================================================
.. image:: https://scan.coverity.com/projects/621/badge.svg
:target: https://scan.coverity.com/projects/621
:alt: Coverity Scan Build Status
.. image:: https://scan.coverity.com/projects/621/badge.svg
:alt: Coverity Scan Build Status
Field list
----------
:123456789 123456789 123456789 123456789 123456789 1: Uh-oh! This name is too long!
:123456789 123456789 123456789 123456789 1234567890: this is a long name,
but no problem!
:123456789 12345: this is not so long, but long enough for the default!
:123456789 1234: this should work even with the default :)
someone@somewhere.org
Press :kbd:`Ctrl+C` to quit
.. raw:: html
<p><strong>RAW HTML!</strong></p><style> p {color:blue;} </style>
rst 使用Nginx安装Comodo PositiveSSL证书的步骤。
使用Nginx安装Comodo PositiveSSL证书的步骤。
install-comodo-ssl-cert-for-nginx.rst
Setting up a SSL Cert from Comodo
=================================
I use `Namecheap.com <http://www.namecheap.com/?aff=83780>`_ as a registrar, and they resale
SSL Certs from a number of other companies, including `Comodo <http://www.comodo.com/>`_.
These are the steps I went through to set up an SSL cert.
Purchase the cert
-----------------
Prior to purchasing a cert, you need to generate a private key, and a CSR file
(Certificate Signing Request). You'll be asked for the content of the CSR file
when ordering the certificate.
::
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
This gives you two files:
* ``example_com.key`` -- your Private key. You'll need this later to configure ngxinx.
* ``example_com.csr`` -- Your CSR file.
Now, purchase the certificate [1]_, follow the steps on their site, and you should soon get an
email with your *PositiveSSL Certificate*. It contains a zip file with the following:
* Root CA Certificate - `AddTrustExternalCARoot.crt`
* Intermediate CA Certificate - `COMODORSAAddTrustCA.crt`
* Intermediate CA Certificate - `COMODORSADomainValidationSecureServerCA.crt`
* Your PositiveSSL Certificate - `www_example_com.crt` (or the subdomain you gave them)
Install the Commodo SSL cert
----------------------------
Combine everything for nginx [2]_:
1. Combine the above crt files into a bundle (the order matters, here)::
cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
2. Store the bundle wherever nginx expects to find it::
mkdir -p /etc/nginx/ssl/example_com/
mv ssl-bundle.crt /etc/nginx/ssl/example_com/
3. Ensure your private key is somewhere nginx can read it, as well.::
mv example_com.key /etc/nginx/ssl/example_com/
4. Make sure your nginx config points to the right cert file and to the private
key you generated earlier::
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/example_com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example_com/example_com.key;
# side note: only use TLS since SSLv2 and SSLv3 have had recent vulnerabilities
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ...
}
6. Restart nginx.
.. [1] I purchased mine through Namecheap.com.
.. [2] Based on these instructions: http://goo.gl/4zJc8
rst 使用Nginx安装Comodo PositiveSSL证书的步骤。
使用Nginx安装Comodo PositiveSSL证书的步骤。
install-comodo-ssl-cert-for-nginx.rst
Setting up a SSL Cert from Comodo
=================================
I use `Namecheap.com <http://www.namecheap.com/?aff=83780>`_ as a registrar, and they resale
SSL Certs from a number of other companies, including `Comodo <http://www.comodo.com/>`_.
These are the steps I went through to set up an SSL cert.
Purchase the cert
-----------------
Prior to purchasing a cert, you need to generate a private key, and a CSR file
(Certificate Signing Request). You'll be asked for the content of the CSR file
when ordering the certificate.
::
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
This gives you two files:
* ``example_com.key`` -- your Private key. You'll need this later to configure ngxinx.
* ``example_com.csr`` -- Your CSR file.
Now, purchase the certificate [1]_, follow the steps on their site, and you should soon get an
email with your *PositiveSSL Certificate*. It contains a zip file with the following:
* Root CA Certificate - `AddTrustExternalCARoot.crt`
* Intermediate CA Certificate - `COMODORSAAddTrustCA.crt`
* Intermediate CA Certificate - `COMODORSADomainValidationSecureServerCA.crt`
* Your PositiveSSL Certificate - `www_example_com.crt` (or the subdomain you gave them)
Install the Commodo SSL cert
----------------------------
Combine everything for nginx [2]_:
1. Combine the above crt files into a bundle (the order matters, here)::
cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
2. Store the bundle wherever nginx expects to find it::
mkdir -p /etc/nginx/ssl/example_com/
mv ssl-bundle.crt /etc/nginx/ssl/example_com/
3. Ensure your private key is somewhere nginx can read it, as well.::
mv example_com.key /etc/nginx/ssl/example_com/
4. Make sure your nginx config points to the right cert file and to the private
key you generated earlier::
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/example_com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example_com/example_com.key;
# side note: only use TLS since SSLv2 and SSLv3 have had recent vulnerabilities
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ...
}
6. Restart nginx.
.. [1] I purchased mine through Namecheap.com.
.. [2] Based on these instructions: http://goo.gl/4zJc8
rst 令人敬畏的机器学习文章
令人敬畏的机器学习文章
Awesome Machine Learning Article.rst
.. contents::
Feature Engineering
-------------------------------------------------------------------------------
- 使用sklearn做单机特征工程: http://www.cnblogs.com/jasonfreak/p/5448385.html
- Discover Feature Engineering, How to Engineer Features and How to Get Good at It: https://machinelearningmastery.com/discover-feature-engineering-how-to-engineer-features-and-how-to-get-good-at-it/
Kaggle Competetions
-------------------------------------------------------------------------------
Outbrain Click Prediction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- HomePage: https://www.kaggle.com/c/outbrain-click-prediction
- 一文读懂FM算法优势,并用python实现!(附代码): https://cloud.tencent.com/developer/article/1031222
rst 使用Nginx安装Comodo PositiveSSL证书的步骤。
使用Nginx安装Comodo PositiveSSL证书的步骤。
install-comodo-ssl-cert-for-nginx.rst
Setting up a SSL Cert from Comodo
=================================
I use `Namecheap.com <http://www.namecheap.com/?aff=83780>`_ as a registrar, and they resale
SSL Certs from a number of other companies, including `Comodo <http://www.comodo.com/>`_.
These are the steps I went through to set up an SSL cert.
Purchase the cert
-----------------
Prior to purchasing a cert, you need to generate a private key, and a CSR file
(Certificate Signing Request). You'll be asked for the content of the CSR file
when ordering the certificate.
::
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
This gives you two files:
* ``example_com.key`` -- your Private key. You'll need this later to configure ngxinx.
* ``example_com.csr`` -- Your CSR file.
Now, purchase the certificate [1]_, follow the steps on their site, and you should soon get an
email with your *PositiveSSL Certificate*. It contains a zip file with the following:
* Root CA Certificate - `AddTrustExternalCARoot.crt`
* Intermediate CA Certificate - `COMODORSAAddTrustCA.crt`
* Intermediate CA Certificate - `COMODORSADomainValidationSecureServerCA.crt`
* Your PositiveSSL Certificate - `www_example_com.crt` (or the subdomain you gave them)
Install the Commodo SSL cert
----------------------------
Combine everything for nginx [2]_:
1. Combine the above crt files into a bundle (the order matters, here)::
cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
2. Store the bundle wherever nginx expects to find it::
mkdir -p /etc/nginx/ssl/example_com/
mv ssl-bundle.crt /etc/nginx/ssl/example_com/
3. Ensure your private key is somewhere nginx can read it, as well.::
mv example_com.key /etc/nginx/ssl/example_com/
4. Make sure your nginx config points to the right cert file and to the private
key you generated earlier::
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/example_com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example_com/example_com.key;
# side note: only use TLS since SSLv2 and SSLv3 have had recent vulnerabilities
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ...
}
6. Restart nginx.
.. [1] I purchased mine through Namecheap.com.
.. [2] Based on these instructions: http://goo.gl/4zJc8
rst Python中英文教程及其他进阶资源
Python中英文教程及其他进阶资源
python_tutorials.rst
Python Tutorials
================
中文教程
-------
- 简明 Python 教程: http://woodpecker.org.cn/abyteofpython_cn/chinese/
一开始通读一遍这个很不错,是最简单明确的 Python 教程,最适合快速了解。
- 笨办法学 Python: http://sebug.net/paper/books/LearnPythonTheHardWay/
非常有名的 Learn xxx The Hard Way 的 Python 版,相比「A Byte of Python」有更多的实际例子,是边学边做的教程。
(`PDF 版 <http://liam0205.me/attachment/Python/PyHardWay/Learn_Python_The_Hard_Way_zh-cn.pdf>`_)
- Python 官方教程: http://www.pythondoc.com/pythontutorial27/index.html
官方的当然是经典的,在我学习 Python 的几年里它的
`原文 <https://docs.python.org/2.7/tutorial/index.html>`_
已经不知被我点了多少遍了。
- Learn X in Y minutes: http://learnxinyminutes.com/docs/zh-cn/python-cn/
很早以前收藏的一个系列,也是属于快速上手的一类教程。
实体 & 电子书
------------
- Python学习手册(第4版): http://item.jd.com/10599758.html
不管使用电子资料如何学习,这本实体书还是要买的,在学习的初期需要一本在手边随时可查阅的参考手册。
- Python free books:
* http://pythonbooks.revolunet.com/
* http://resrc.io/list/10/list-of-free-programming-books/#python
书控表示一本满足 ( ̄▽ ̄)
英文资源
-------
- The Hitchhiker’s Guide to Python: http://docs.python-guide.org/en/latest/
最好的 Python 指南,没有之一。无论是初学还是进阶还是迈向专家之路,这本指南都要读不止一遍。
- Intermediate Python: http://book.pythontips.com/en/latest/
- Codecademy: http://www.codecademy.com/tracks/python
最好的在线学习编程的网站,其 Python 课程。
- Python Module of the Week: http://pymotw.com/2/
每周对 Python 的一个基础模块做讲解和示例,比官方文档更适合学习基础模块的地方。
- Pycoder's Weekly: http://pycoders.com/
最好的 Python 周报,没有之一。每周必须花至少半个小时来阅读。
- Python Koans: https://github.com/gregmalcolm/python_koans
用 TDD 的方式学习 Python 的交互式教程。`TDD <http://en.wikipedia.org/wiki/Test-driven_development>`_
其实也是 Python 开发最适合的方式之一。
Style Guide
-----------
样式指南请参考另一文档: `python_style_guide.rst <https://gist.github.com/reorx/9a66db7bf7b90f351b43>`_