text:
layout: page
date: 'Sat 2012-06-09 15:19:14 +0800'
slug: 'Help'
title: "写作说明"
description: ""
---
{% include JB/setup %}

基于jekyll的东西写起来比较麻烦,得记CLI,是以留档自用。

Jekyll Quick Start

On Markdown

On Liquid

Jekyll Quick Start
==================

http://jekyllbootstrap.com/usage/jekyll-quick-start.html

## Preview

	jekyll --server

## Create a Post

	$ rake post title="Hello World"

## Create a Page

	$ rake page name="about.md"
	$ rake page name="pages/about.md"   # a nested page
	$ rake page name="pages/about"   # a page with a "pretty" path
	# this will create the file: ./pages/about/index.html

* * *

Markdown
========

Markdown Main @ daringfireball.net

Markdown Cheatsheet

Markdown Basics

Markdown Syntax

Dingus @ daringfireball.net

### Movable Type ###

You need to use a special `MTMarkdownOptions` container tag in each
Movable Type template where you want HTML 4-style output:

    <MTMarkdownOptions output='html4'>
        ... put your entry content here ...
    </MTMarkdownOptions>

The easiest way to use MTMarkdownOptions is probably to put the
opening tag right after your `<body>` tag, and the closing tag right
before `</body>`.

To suppress Markdown processing in a particular template, i.e. to
publish the raw Markdown-formatted text without translation into
(X)HTML, set the `output` attribute to 'raw':

    <MTMarkdownOptions output='raw'>
        ... put your entry content here ...
    </MTMarkdownOptions>

* * *

## Syntax Cheatsheet: ##

### Phrase Emphasis ###

	*italic*   **bold**
	_italic_   __bold__

### Links ###

Inline:

	An [example](http://url.com/ "Title")

Reference-style labels (titles are optional):

	An [example][id]. Then, anywhere
	else in the doc, define the link:

	  [id]: http://example.com/  "Title"

### Images ###

Inline (titles are optional):

	![alt text](/path/img.jpg "Title")

Reference-style:

	![alt text][id]

	[id]: /url/to/img.jpg "Title"

### Headers ###

Setext-style:

	Header 1
	========

	Header 2
	--------

atx-style (closing #'s are optional):

	# Header 1 #

	## Header 2 ##

	###### Header 6

### Lists ###

Ordered, without paragraphs:

	1.  Foo
	2.  Bar

Unordered, with paragraphs:

	*   A list item.

		With multiple paragraphs.

	*   Bar

You can nest them:

	*   Abacus
		* answer
	*   Bubbles
		1.  bunk
		2.  bupkis
			* BELITTLER
		3. burper
	*   Cunning

### Blockquotes ###

	> Email-style angle brackets
	> are used for blockquotes.

	> > And, they can be nested.

	> #### Headers in blockquotes
	>
	> * You can quote a list.
	> * Etc.

### Code Spans ###

	`<code>` spans are delimited
	by backticks.

	You can include literal backticks
	like `` `this` ``.

### Preformatted Code Blocks ###

Indent every line of a code block by at least 4 spaces or 1 tab.

	This is a normal paragraph.

	    This is a preformatted
	    code block.

### Horizontal Rules ###

Three or more dashes or asterisks:

	---

	* * *

	- - - -

### Manual Line Breaks ###

End a line with two or more spaces:

	Roses are red,
	Violets are blue.

* * *

Markdown: Basics
================

Getting the Gist of Markdown's Formatting Syntax
------------------------------------------------

This page offers a brief overview of what it's like to use Markdown.
The [syntax page] [s] provides complete, detailed documentation for
every feature, but Markdown should be very easy to pick up simply by
looking at a few examples of it in action. The examples on this page
are written in a before/after style, showing example syntax and the
HTML output produced by Markdown.

It's also helpful to simply try Markdown out; the [Dingus] [d] is a
web application that allows you type your own Markdown-formatted text
and translate it to XHTML.

**Note:** This document is itself written using Markdown; you
can [see the source for it by adding '.text' to the URL] [src].

  [s]: /projects/markdown/syntax  "Markdown Syntax"
  [d]: /projects/markdown/dingus  "Markdown Dingus"
  [src]: http://daringfireball.net/projects/markdown/basics.text

## Paragraphs, Headers, Blockquotes ##

A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like
a blank line -- a line containing nothing but spaces or tabs is
considered blank.) Normal paragraphs should not be indented with
spaces or tabs.

Markdown offers two styles of headers: *Setext* and *atx*.
Setext-style headers for `<h1>` and `<h2>` are created by
"underlining" with equal signs (`=`) and hyphens (`-`), respectively.
To create an atx-style header, you put 1-6 hash marks (`#`) at the
beginning of the line -- the number of hashes equals the resulting
HTML header level.

Blockquotes are indicated using email-style '`>`' angle brackets.

Markdown:

    A First Level Header
    ====================

    A Second Level Header
    ---------------------

    Now is the time for all good men to come to
    the aid of their country. This is just a
    regular paragraph.

    The quick brown fox jumped over the lazy
    dog's back.

    ### Header 3

    > This is a blockquote.
    >
    > This is the second paragraph in the blockquote.
    >
    > ## This is an H2 in a blockquote

Output:

A First Level Header

A Second Level Header

Now is the time for all good men to come to
    the aid of their country. This is just a
    regular paragraph.

The quick brown fox jumped over the lazy
    dog's back.

Header 3

This is a blockquote.

This is the second paragraph in the blockquote.

This is an H2 in a blockquote

### Phrase Emphasis ###

Markdown uses asterisks and underscores to indicate spans of emphasis.

Markdown:

    Some of these words *are emphasized*.
    Some of these words _are emphasized also_.

    Use two asterisks for **strong emphasis**.
    Or, if you prefer, __use two underscores instead__.

Output:

Some of these words are emphasized.
    Some of these words are emphasized also.

Use two asterisks for strong emphasis.
    Or, if you prefer, use two underscores instead.

## Lists ##

Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
`+`, and `-`) as list markers. These three markers are
interchangable; this:

    *   Candy.
    *   Gum.
    *   Booze.

this:

    +   Candy.
    +   Gum.
    +   Booze.

and this:

    -   Candy.
    -   Gum.
    -   Booze.

all produce the same output:

Candy.

Gum.

Booze.

Ordered (numbered) lists use regular numbers, followed by periods, as
list markers:

    1.  Red
    2.  Green
    3.  Blue

Output:

Red

Green

Blue

If you put blank lines between items, you'll get `<p>` tags for the
list item text. You can create multi-paragraph list items by indenting
the paragraphs by 4 spaces or 1 tab:

    *   A list item.

        With multiple paragraphs.

    *   Another item in the list.

Output:

A list item.

With multiple paragraphs.

Another item in the list.

### Links ###

Markdown supports two styles for creating links: *inline* and
*reference*. With both styles, you use square brackets to delimit the
text you want to turn into a link.

Inline-style links use parentheses immediately after the link text.
For example:

    This is an [example link](http://example.com/).

Output:

This is an
    example link.

Optionally, you may include a title attribute in the parentheses:

    This is an [example link](http://example.com/ "With a Title").

Output:

This is an
    example link.

Reference-style links allow you to refer to your links by names, which
you define elsewhere in your document:

    I get 10 times more traffic from [Google][1] than from
    [Yahoo][2] or [MSN][3].

    [1]: http://google.com/        "Google"
    [2]: http://search.yahoo.com/  "Yahoo Search"
    [3]: http://search.msn.com/    "MSN Search"

Output:

I get 10 times more traffic from Google than from Yahoo or MSN.

The title attribute is optional. Link names may contain letters,
numbers and spaces, but are *not* case sensitive:

    I start my morning with a cup of coffee and
    [The New York Times][NY Times].

    [ny times]: http://www.nytimes.com/

Output:

I start my morning with a cup of coffee and
    The New York Times.

### Images ###

Image syntax is very much like link syntax.

Inline (titles are optional):

    ![alt text](/path/to/img.jpg "Title")

Reference-style:

    ![alt text][id]

    [id]: /path/to/img.jpg "Title"

Both of the above examples produce the same output:

### Code ###

In a regular paragraph, you can create code span by wrapping text in
backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
`>`) will automatically be translated into HTML entities. This makes
it easy to use Markdown to write about HTML example code:

    I strongly recommend against using any `<blink>` tags.

    I wish SmartyPants used named entities like `—`
    instead of decimal-encoded entites like `—`.

Output:

I strongly recommend against using any
    <blink> tags.

I wish SmartyPants used named entities like
    &mdash; instead of decimal-encoded
    entites like &#8212;.

To specify an entire block of pre-formatted code, indent every line of
the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`,
and `>` characters will be escaped automatically.

Markdown:

    If you want your page to validate under XHTML 1.0 Strict,
    you've got to put paragraph tags in your blockquotes:

For example.

Output:

If you want your page to validate under XHTML 1.0 Strict,
    you've got to put paragraph tags in your blockquotes:

<blockquote>
        <p>For example.</p>
    </blockquote>

* * *

Markdown: Syntax
================

*   [Overview](#overview)
    *   [Philosophy](#philosophy)
    *   [Inline HTML](#html)
    *   [Automatic Escaping for Special Characters](#autoescape)
*   [Block Elements](#block)
    *   [Paragraphs and Line Breaks](#p)
    *   [Headers](#header)
    *   [Blockquotes](#blockquote)
    *   [Lists](#list)
    *   [Code Blocks](#precode)
    *   [Horizontal Rules](#hr)
*   [Span Elements](#span)
    *   [Links](#link)
    *   [Emphasis](#em)
    *   [Code](#code)
    *   [Images](#img)
*   [Miscellaneous](#misc)
    *   [Backslash Escapes](#backslash)
    *   [Automatic Links](#autolink)

**Note:** This document is itself written using Markdown; you
can [see the source for it by adding '.text' to the URL][src].

  [src]: /projects/markdown/syntax.text

* * *

Overview

Philosophy

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

Readability, however, is emphasized above all else. A Markdown-formatted
document should be publishable as-is, as plain text, without looking
like it's been marked up with tags or formatting instructions. While
Markdown's syntax has been influenced by several existing text-to-HTML
filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],
[Grutatext] [5], and [EtText] [6] -- the single biggest source of
inspiration for Markdown's syntax is the format of plain text email.

  [1]: http://docutils.sourceforge.net/mirror/setext.html
  [2]: http://www.aaronsw.com/2002/atx/
  [3]: http://textism.com/tools/textile/
  [4]: http://docutils.sourceforge.net/rst.html
  [5]: http://www.triptico.com/software/grutatxt.html
  [6]: http://ettext.taint.org/doc/

To this end, Markdown's syntax is comprised entirely of punctuation
characters, which punctuation characters have been carefully chosen so
as to look like what they mean. E.g., asterisks around a word actually
look like \*emphasis\*. Markdown lists look like, well, lists. Even
blockquotes look like quoted passages of text, assuming you've ever
used email.

Inline HTML

Markdown's syntax is intended for one purpose: to be used as a
format for *writing* for the web.

Markdown is not a replacement for HTML, or even close to it. Its
syntax is very small, corresponding only to a very small subset of
HTML tags. The idea is *not* to create a syntax that makes it easier
to insert HTML tags. In my opinion, HTML tags are already easy to
insert. The idea for Markdown is to make it easy to read, write, and
edit prose. HTML is a *publishing* format; Markdown is a *writing*
format. Thus, Markdown's formatting syntax only addresses issues that
can be conveyed in plain text.

For any markup that is not covered by Markdown's syntax, you simply
use HTML itself. There's no need to preface it or delimit it to
indicate that you're switching from Markdown to HTML; you just use
the tags.

The only restrictions are that block-level HTML elements -- e.g. `<div>`,
`<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding
content by blank lines, and the start and end tags of the block should
not be indented with tabs or spaces. Markdown is smart enough not
to add extra (unwanted) `<p>` tags around HTML block-level tags.

For example, to add an HTML table to a Markdown article:

    This is a regular paragraph.

            Foo

    This is another regular paragraph.

Note that Markdown formatting syntax is not processed within block-level
HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an
HTML block.

Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be
used anywhere in a Markdown paragraph, list item, or header. If you
want, you can even use HTML tags instead of Markdown formatting; e.g. if
you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's
link or image syntax, go right ahead.

Unlike block-level HTML tags, Markdown syntax *is* processed within
span-level tags.

Automatic Escaping for Special Characters

In HTML, there are two characters that demand special treatment: `<`
and `&`. Left angle brackets are used to start tags; ampersands are
used to denote HTML entities. If you want to use them as literal
characters, you must escape them as entities, e.g. `<`, and
`&`.

Ampersands in particular are bedeviling for web writers. If you want to
write about 'AT&T', you need to write '`AT&T`'. You even need to
escape ampersands within URLs. Thus, if you want to link to:

    http://images.google.com/images?num=30&q=larry+bird

you need to encode the URL as:

    http://images.google.com/images?num=30&q=larry+bird

in your anchor tag `href` attribute. Needless to say, this is easy to
forget, and is probably the single most common source of HTML validation
errors in otherwise well-marked-up web sites.

Markdown allows you to use these characters naturally, taking care of
all the necessary escaping for you. If you use an ampersand as part of
an HTML entity, it remains unchanged; otherwise it will be translated
into `&`.

So, if you want to include a copyright symbol in your article, you can write:

    ©

and Markdown will leave it alone. But if you write:

    AT&T

Markdown will translate it to:

    AT&T

Similarly, because Markdown supports [inline HTML](#html), if you use
angle brackets as delimiters for HTML tags, Markdown will treat them as
such. But if you write:

    4 < 5

Markdown will translate it to:

    4 < 5

However, inside Markdown code spans and blocks, angle brackets and
ampersands are *always* encoded automatically. This makes it easy to use
Markdown to write about HTML code. (As opposed to raw HTML, which is a
terrible format for writing about HTML syntax, because every single `<`
and `&` in your example code needs to be escaped.)

* * *

Block Elements

Paragraphs and Line Breaks

A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line -- a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is
that Markdown supports "hard-wrapped" text paragraphs. This differs
significantly from most other text-to-HTML formatters (including Movable
Type's "Convert Line Breaks" option) which translate every line break
character in a paragraph into a `<br />` tag.

When you *do* want to insert a `<br />` break tag using Markdown, you
end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a `<br />`, but a simplistic
"every line break is a `<br />`" rule wouldn't work for Markdown.
Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l]
work best -- and look better -- when you format them with hard breaks.

  [bq]: #blockquote
  [l]:  #list

Headers

Markdown supports two styles of headers, [Setext] [1] and [atx] [2].

Setext-style headers are "underlined" using equal signs (for first-level
headers) and dashes (for second-level headers). For example:

    This is an H1
    =============

    This is an H2
    -------------

Any number of underlining `=`'s or `-`'s will work.

Atx-style headers use 1-6 hash characters at the start of the line,
corresponding to header levels 1-6. For example:

    # This is an H1

    ## This is an H2

    ###### This is an H6

Optionally, you may "close" atx-style headers. This is purely
cosmetic -- you can use this if you think it looks better. The
closing hashes don't even need to match the number of hashes
used to open the header. (The number of opening hashes
determines the header level.) :

    # This is an H1 #

    ## This is an H2 ##

    ### This is an H3 ######

Blockquotes

Markdown uses email-style `>` characters for blockquoting. If you're
familiar with quoting passages of text in an email message, then you
know how to create a blockquote in Markdown. It looks best if you hard
wrap the text and put a `>` before every line:

    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    >
    > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    > id sem consectetuer libero luctus adipiscing.

Markdown allows you to be lazy and only put the `>` before the first
line of a hard-wrapped paragraph:

    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

    > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    id sem consectetuer libero luctus adipiscing.

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
adding additional levels of `>`:

    > This is the first level of quoting.
    >
    > > This is nested blockquote.
    >
    > Back to the first level.

Blockquotes can contain other Markdown elements, including headers, lists,
and code blocks:

	> ## This is a header.
	>
	> 1.   This is the first list item.
	> 2.   This is the second list item.
	>
	> Here's some example code:
	>
	>     return shell_exec("echo $input | $markdown_script");

Any decent text editor should make email-style quoting easy. For
example, with BBEdit, you can make a selection and choose Increase
Quote Level from the Text menu.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks, pluses, and hyphens -- interchangably
-- as list markers:

    *   Red
    *   Green
    *   Blue

is equivalent to:

    +   Red
    +   Green
    +   Blue

and:

    -   Red
    -   Green
    -   Blue

Ordered lists use numbers followed by periods:

    1.  Bird
    2.  McHale
    3.  Parish

It's important to note that the actual numbers you use to mark the
list have no effect on the HTML output Markdown produces. The HTML
Markdown produces from the above list is:

Bird

McHale

Parish

If you instead wrote the list in Markdown like this:

    1.  Bird
    1.  McHale
    1.  Parish

or even:

    3. Bird
    1. McHale
    8. Parish

you'd get the exact same HTML output. The point is, if you want to,
you can use ordinal numbers in your ordered Markdown lists, so that
the numbers in your source match the numbers in your published HTML.
But if you want to be lazy, you don't have to.

If you do use lazy list numbering, however, you should still start the
list with the number 1. At some point in the future, Markdown may support
starting ordered lists at an arbitrary number.

List markers typically start at the left margin, but may be indented by
up to three spaces. List markers must be followed by one or more spaces
or a tab.

To make lists look nice, you can wrap items with hanging indents:

    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
        Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
        viverra nec, fringilla in, laoreet vitae, risus.
    *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
        Suspendisse id sem consectetuer libero luctus adipiscing.

But if you want to be lazy, you don't have to:

    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    viverra nec, fringilla in, laoreet vitae, risus.
    *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    Suspendisse id sem consectetuer libero luctus adipiscing.

If list items are separated by blank lines, Markdown will wrap the
items in `<p>` tags in the HTML output. For example, this input:

    *   Bird
    *   Magic

will turn into:

Bird

Magic

But this:

    *   Bird

    *   Magic

will turn into:

Bird

Magic

List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab:

    1.  This is a list item with two paragraphs. Lorem ipsum dolor
        sit amet, consectetuer adipiscing elit. Aliquam hendrerit
        mi posuere lectus.

        Vestibulum enim wisi, viverra nec, fringilla in, laoreet
        vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
        sit amet velit.

    2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent
paragraphs, but here again, Markdown will allow you to be
lazy:

    *   This is a list item with two paragraphs.

        This is the second paragraph in the list item. You're
    only required to indent the first line. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit.

    *   Another item in the same list.

To put a blockquote within a list item, the blockquote's `>`
delimiters need to be indented:

    *   A list item with a blockquote:

        > This is a blockquote
        > inside a list item.

To put a code block within a list item, the code block needs
to be indented *twice* -- 8 spaces or two tabs:

    *   A list item with a code block:

It's worth noting that it's possible to trigger an ordered list by
accident, by writing something like this:

    1986. What a great season.

In other words, a *number-period-space* sequence at the beginning of a
line. To avoid this, you can backslash-escape the period:

    1986\. What a great season.

Code Blocks

Pre-formatted code blocks are used for writing about programming or
markup source code. Rather than forming normal paragraphs, the lines
of a code block are interpreted literally. Markdown wraps a code block
in both `<pre>` and `<code>` tags.

To produce a code block in Markdown, simply indent every line of the
block by at least 4 spaces or 1 tab. For example, given this input:

    This is a normal paragraph:

        This is a code block.

Markdown will generate:

This is a normal paragraph:

This is a code block.

One level of indentation -- 4 spaces or 1 tab -- is removed from each
line of the code block. For example, this:

    Here is an example of AppleScript:

        tell application "Foo"
            beep
        end tell

will turn into:

Here is an example of AppleScript:

tell application "Foo"
        beep
    end tell

A code block continues until it reaches a line that is not indented
(or the end of the article).

Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
are automatically converted into HTML entities. This makes it very
easy to include example HTML source code using Markdown -- just paste
it and indent it, and Markdown will handle the hassle of encoding the
ampersands and angle brackets. For example, this:

            © 2004 Foo Corporation

will turn into:

<div class="footer">
        &copy; 2004 Foo Corporation
    </div>

Regular Markdown syntax is not processed within code blocks. E.g.,
asterisks are just literal asterisks within a code block. This means
it's also easy to use Markdown to write about Markdown's own syntax.

Horizontal Rules

You can produce a horizontal rule tag (`<hr />`) by placing three or
more hyphens, asterisks, or underscores on a line by themselves. If you
wish, you may use spaces between the hyphens or asterisks. Each of the
following lines will produce a horizontal rule:

    * * *

    ***

    *****

    - - -

    ---------------------------------------

* * *

Span Elements

Links

Markdown supports two style of links: *inline* and *reference*.

In both styles, the link text is delimited by \[square brackets\].

To create an inline link, use a set of regular parentheses immediately
after the link text's closing square bracket. Inside the parentheses,
put the URL where you want the link to point, along with an *optional*
title for the link, surrounded in quotes. For example:

    This is [an example](http://example.com/ "Title") inline link.

    [This link](http://example.net/) has no title attribute.

Will produce:

This is
    an example inline link.

This link has no
    title attribute.

If you're referring to a local resource on the same server, you can
use relative paths:

    See my [About](/about/) page for details.

Reference-style links use a second set of square brackets, inside
which you place a label of your choosing to identify the link:

    This is [an example][id] reference-style link.

You can optionally use a space to separate the sets of brackets:

    This is [an example] [id] reference-style link.

Then, anywhere in the document, you define your link label like this,
on a line by itself:

    [id]: http://example.com/  "Optional Title Here"

That is:

*   Square brackets containing the link identifier (optionally
    indented from the left margin using up to three spaces);
*   followed by a colon;
*   followed by one or more spaces (or tabs);
*   followed by the URL for the link;
*   optionally followed by a title attribute for the link, enclosed
    in double or single quotes, or enclosed in parentheses.

The following three link definitions are equivalent:

	[foo]: http://example.com/  "Optional Title Here"
	[foo]: http://example.com/  'Optional Title Here'
	[foo]: http://example.com/  (Optional Title Here)

**Note:** There is a known bug in Markdown.pl 1.0.1 which prevents
single quotes from being used to delimit link titles.

The link URL may, optionally, be surrounded by angle brackets:

    [id]: <http://example.com/>  "Optional Title Here"

You can put the title attribute on the next line and use extra spaces
or tabs for padding, which tends to look better with longer URLs:

    [id]: http://example.com/longish/path/to/resource/here
        "Optional Title Here"

Link definitions are only used for creating links during Markdown
processing, and are stripped from your document in the HTML output.

Link definition names may consist of letters, numbers, spaces, and
punctuation -- but they are *not* case sensitive. E.g. these two
links:

	[link text][a]
	[link text][A]

are equivalent.

The *implicit link name* shortcut allows you to omit the name of the
link, in which case the link text itself is used as the name.
Just use an empty set of square brackets -- e.g., to link the word
"Google" to the google.com web site, you could simply write:

	[Google][]

And then define the link:

	[Google]: http://google.com/

Because link names may contain spaces, this shortcut even works for
multiple words in the link text:

	Visit [Daring Fireball][] for more information.

And then define the link:

	[Daring Fireball]: http://daringfireball.net/

Link definitions can be placed anywhere in your Markdown document. I
tend to put them immediately after each paragraph in which they're
used, but if you want, you can put them all at the end of your
document, sort of like footnotes.

Here's an example of reference links in action:

    I get 10 times more traffic from [Google] [1] than from
    [Yahoo] [2] or [MSN] [3].

      [1]: http://google.com/        "Google"
      [2]: http://search.yahoo.com/  "Yahoo Search"
      [3]: http://search.msn.com/    "MSN Search"

Using the implicit link name shortcut, you could instead write:

    I get 10 times more traffic from [Google][] than from
    [Yahoo][] or [MSN][].

      [google]: http://google.com/        "Google"
      [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
      [msn]:    http://search.msn.com/    "MSN Search"

Both of the above examples will produce the following HTML output:

I get 10 times more traffic from Google than from
    Yahoo
    or MSN.

For comparison, here is the same paragraph written using
Markdown's inline link style:

    I get 10 times more traffic from [Google](http://google.com/ "Google")
    than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
    [MSN](http://search.msn.com/ "MSN Search").

The point of reference-style links is not that they're easier to
write. The point is that with reference-style links, your document
source is vastly more readable. Compare the above examples: using
reference-style links, the paragraph itself is only 81 characters
long; with inline-style links, it's 176 characters; and as raw HTML,
it's 234 characters. In the raw HTML, there's more markup than there
is text.

With Markdown's reference-style links, a source document much more
closely resembles the final output, as rendered in a browser. By
allowing you to move the markup-related metadata out of the paragraph,
you can add links without interrupting the narrative flow of your
prose.

Emphasis

Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
emphasis. Text wrapped with one `*` or `_` will be wrapped with an
HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
`<strong>` tag. E.g., this input:

    *single asterisks*

    _single underscores_

    **double asterisks**

    __double underscores__

will produce:

    single asterisks

    single underscores

    double asterisks

    double underscores

You can use whichever style you prefer; the lone restriction is that
the same character must be used to open and close an emphasis span.

Emphasis can be used in the middle of a word:

    un*frigging*believable

But if you surround an `*` or `_` with spaces, it'll be treated as a
literal asterisk or underscore.

To produce a literal asterisk or underscore at a position where it
would otherwise be used as an emphasis delimiter, you can backslash
escape it:

    \*this text is surrounded by literal asterisks\*

Code

To indicate a span of code, wrap it with backtick quotes (`` ` ``).
Unlike a pre-formatted code block, a code span indicates code within a
normal paragraph. For example:

    Use the `printf()` function.

will produce:

Use the printf() function.

To include a literal backtick character within a code span, you can use
multiple backticks as the opening and closing delimiters:

    ``There is a literal backtick (`) here.``

which will produce this:

There is a literal backtick (`) here.

The backtick delimiters surrounding a code span may include spaces --
one after the opening, one before the closing. This allows you to place
literal backtick characters at the beginning or end of a code span:

	A single backtick in a code span: `` ` ``

	A backtick-delimited string in a code span: `` `foo` ``

will produce:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

With a code span, ampersands and angle brackets are encoded as HTML
entities automatically, which makes it easy to include example HTML
tags. Markdown will turn this:

    Please don't use any `<blink>` tags.

into:

Please don't use any <blink> tags.

You can write this:

    `—` is the decimal-encoded equivalent of `—`.

to produce:

&#8212; is the decimal-encoded
    equivalent of &mdash;.

Images

Admittedly, it's fairly difficult to devise a "natural" syntax for
placing images into a plain text document format.

Markdown uses an image syntax that is intended to resemble the syntax
for links, allowing for two styles: *inline* and *reference*.

Inline image syntax looks like this:

    ![Alt text](/path/to/img.jpg)

    ![Alt text](/path/to/img.jpg "Optional title")

That is:

*   An exclamation mark: `!`;
*   followed by a set of square brackets, containing the `alt`
    attribute text for the image;
*   followed by a set of parentheses, containing the URL or path to
    the image, and an optional `title` attribute enclosed in double
    or single quotes.

Reference-style image syntax looks like this:

    ![Alt text][id]

Where "id" is the name of a defined image reference. Image references
are defined using syntax identical to link references:

    [id]: url/to/image  "Optional title attribute"

As of this writing, Markdown has no syntax for specifying the
dimensions of an image; if this is important to you, you can simply
use regular HTML `<img>` tags.

* * *

Miscellaneous

Automatic Links

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

    <http://example.com/>

Markdown will turn this into:

    http://example.com/

Automatic links for email addresses work similarly, except that
Markdown will also perform a bit of randomized decimal and hex
entity-encoding to help obscure your address from address-harvesting
spambots. For example, Markdown will turn this:

    <address@example.com>

into something like this:

    address@exa
    mple.com

which will render in a browser as a clickable link to "address@example.com".

(This sort of entity-encoding trick will indeed fool many, if not
most, address-harvesting bots, but it definitely won't fool all of
them. It's better than nothing, but an address published in this way
will probably eventually start receiving spam.)

Backslash Escapes

Markdown allows you to use backslash escapes to generate literal
characters which would otherwise have special meaning in Markdown's
formatting syntax. For example, if you wanted to surround a word
with literal asterisks (instead of an HTML `<em>` tag), you can use
backslashes before the asterisks, like this:

    \*literal asterisks\*

Markdown provides backslash escapes for the following characters:

    \   backslash
    `   backtick
    *   asterisk
    _   underscore
    {}  curly braces
    []  square brackets
    ()  parentheses
    #   hash mark
	+	plus sign
	-	minus sign (hyphen)
    .   dot
    !   exclamation mark


text:
({
    block : 'page',
    doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
    title : 'Пример произвольного doctype',
    content : 'Произвольный doctype'
})

redpajama_set_name: RedPajamaGithub


text:
package org.apache.activemq.artemis.tests.compatibility;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.tests.compatibility.base.ClasspathBase;
import org.apache.qpid.jms.JmsConnectionFactory;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.SNAPSHOT;
import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.TWO_EIGHTEEN_ZERO;
import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.TWO_SEVENTEEN_ZERO;
import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.TWO_TWENTYTWO_ZERO;

@RunWith(Parameterized.class)
public class MultiVersionReplicaTest extends ClasspathBase {

   private static final String QUEUE_NAME = "MultiVersionReplicaTestQueue";

   private final String main;
   private final ClassLoader mainClassloader;

   private final String backup;
   private final ClassLoader backupClassLoader;

   @Parameterized.Parameters(name = "main={0}, backup={1}")
   public static Collection getParameters() {
      List<Object[]> combinations = new ArrayList<>();
      combinations.add(new Object[]{TWO_TWENTYTWO_ZERO, SNAPSHOT});
      combinations.add(new Object[]{SNAPSHOT, TWO_TWENTYTWO_ZERO});
      combinations.add(new Object[]{TWO_SEVENTEEN_ZERO, SNAPSHOT});
      combinations.add(new Object[]{SNAPSHOT, TWO_SEVENTEEN_ZERO});
      combinations.add(new Object[]{TWO_EIGHTEEN_ZERO, SNAPSHOT});
      combinations.add(new Object[]{SNAPSHOT, TWO_EIGHTEEN_ZERO});
      // The SNAPSHOT/SNAPSHOT is here as a test validation only, like in other cases where SNAPSHOT/SNAPSHOT is used.
      combinations.add(new Object[]{SNAPSHOT, SNAPSHOT});
      return combinations;
   }

   public MultiVersionReplicaTest(String main, String backup) throws Exception {
      this.main = main;
      this.mainClassloader = getClasspath(main);

      this.backup = backup;
      this.backupClassLoader = getClasspath(backup);
   }

   @After
   public void cleanupServers() {
      try {
         evaluate(mainClassloader, "multiVersionReplica/mainServerStop.groovy");
      } catch (Exception ignored) {
      }
      try {
         evaluate(backupClassLoader, "multiVersionReplica/backupServerStop.groovy");
      } catch (Exception ignored) {
      }
   }

   @Test
   public void testReplica() throws Throwable {
      System.out.println("Starting live");
      evaluate(mainClassloader, "multiVersionReplica/mainServer.groovy", serverFolder.getRoot().getAbsolutePath(), "1", "61000", "61001");
      System.out.println("Starting backup");
      evaluate(backupClassLoader, "multiVersionReplica/backupServer.groovy", serverFolder.getRoot().getAbsolutePath(), "2", "61001", "61000");

      evaluate(mainClassloader, "multiVersionReplica/mainServerIsReplicated.groovy");

      send(new ActiveMQConnectionFactory("tcp://localhost:61000"), 2000, 10);
      send(new JmsConnectionFactory("amqp://localhost:61000"), 2000, 10);

      evaluate(mainClassloader, "multiVersionReplica/mainServerStop.groovy");
      evaluate(backupClassLoader, "multiVersionReplica/backupServerIsActive.groovy");

      receive(new ActiveMQConnectionFactory("tcp://localhost:61001"), 2010);
      receive(new JmsConnectionFactory("amqp://localhost:61001"), 2010);

      evaluate(backupClassLoader, "multiVersionReplica/backupServerStop.groovy");
   }

   private void send(ConnectionFactory factory, int numberOfMessagesTx, int numberOfMessagesNonTx) throws Throwable {
      try (Connection connection = factory.createConnection()) {
         Queue queue;

         {
            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
            queue = session.createQueue(QUEUE_NAME);
            MessageProducer producer = session.createProducer(queue);
            boolean pending = false;
            for (int i = 0; i < numberOfMessagesTx; i++) {
               producer.send(session.createTextMessage("Hello world!!!!!"));
               pending = true;
               if (i > 0 && i % 100 == 0) {
                  session.commit();
                  pending = false;
               }
            }
            if (pending) {
               session.commit();
            }
            session.close();
         }

         {
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer producer = session.createProducer(queue);
            for (int i = 0; i < numberOfMessagesNonTx; i++) {
               producer.send(session.createTextMessage("Hello world!!!!!"));
            }
         }
      }
   }

   private void receive(ConnectionFactory factory, int numberOfMessages) throws Throwable {
      try (Connection connection = factory.createConnection()) {
         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
         Queue queue = session.createQueue(QUEUE_NAME);
         connection.start();
         MessageConsumer consumer = session.createConsumer(queue);
         boolean pending = false;
         for (int i = 0; i < numberOfMessages; i++) {
            TextMessage message = (TextMessage) consumer.receive(1000);
            Assert.assertNotNull(message);
            pending = true;
            if (i > 0 && i % 100 == 0) {
               session.commit();
               pending = false;
            }
         }
         if (pending) {
            session.commit();
         }
      }
   }

}


text:
//---------------------------------------------------------------------
// <copyright file="KeyAsSegmentTest.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.OData.Tests.Client.KeyAsSegmentTests
{
    using System;
    using Microsoft.OData.Client;
    using Microsoft.Test.OData.Framework;
    using Microsoft.Test.OData.Framework.Client;
    using Microsoft.Test.OData.Services.TestServices;
    using Microsoft.Test.OData.Services.TestServices.KeyAsSegmentServiceReference;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    public class KeyAsSegmentTest : EndToEndTestBase
    {
        public KeyAsSegmentTest()
            : base(ServiceDescriptors.KeyAsSegmentService)
        {
        }

        protected static void VerifyUriDoesNotContainParentheses(Uri uri)
        {
            Assert.IsFalse(uri.OriginalString.Contains("("), "Uri contains left parentheses");
            Assert.IsFalse(uri.OriginalString.Contains(")"), "Uri contains right parentheses");
        }

        protected DataServiceContextWrapper<DefaultContainer> CreateWrappedContext()
        {
            var wrappedContext = base.CreateWrappedContext<DefaultContainer>();
            wrappedContext.UrlConventions = DataServiceUrlConventions.KeyAsSegment;
            return wrappedContext;
        }
    }
}


text:
module.exports = {
  description: "",
  ns: "react-material-ui",
  type: "ReactNode",
  dependencies: {
    npm: {
      "material-ui/svg-icons/action/build": require('material-ui/svg-icons/action/build')
    }
  },
  name: "ActionBuild",
  ports: {
    input: {},
    output: {
      component: {
        title: "ActionBuild",
        type: "Component"
      }
    }
  }
}


text:
namespace WebServer.ByTheCakeApp.ViewModels.User
{
    public class RegisterUserViewModel
    {
        public string UserName { get; set; }

        public string Password { get; set; }

        public string ConfirmPassword { get; set; }
    }
}


text:
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */

// Start Outer IIFE
(function(exports) {
'use strict';

// helper function, bound to manifest and property name in constructor
function ManifestHelper_get(prop) {
  var manifest = this;
  var value = manifest[prop];

  var lang = navigator.mozL10n.language.code || '';

  if (lang in navigator.mozL10n.qps &&
      (prop === 'name' || prop === 'description')) {
    value = navigator.mozL10n.qps[navigator.language].translate(value);
  } else if (manifest.locales) {
    // try to replace values from the locales object using the best language
    // match.  stop when a replacement is found
    [lang, lang.substr(0, lang.indexOf('-'))].some(function tryLanguage(lang) {
      // this === manifest.locales
      if (this[lang] && this[lang][prop]) {
        value = this[lang][prop];
        // aborts [].some
        return true;
      }
    }, manifest.locales);
  }

  // return a new ManifestHelper for any object children
  if (typeof value === 'object' && !(value instanceof Array)) {
    value = new ManifestHelper(value);
  }
  return value;
}

/**
 * Helper object to access manifest information with locale support.
 *
 * @constructor
 * @param {Object} manifest The app manifest.
 */
function ManifestHelper(manifest) {
  // Bind getters for the localized property values.
  for (var prop in manifest) {
    Object.defineProperty(this, prop, {
      get: ManifestHelper_get.bind(manifest, prop),
      enumerable: true
    });
  }
}

exports.ManifestHelper = ManifestHelper;

// End outer IIFE
}(window));


text:
package com.albedinsky.android.ui.examples.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

import com.albedinsky.android.support.examples.ExNavigationActivity;
import com.albedinsky.android.support.fragment.ActionBarFragment;

/**
 * @author Martin Albedinsky
 */
public abstract class BaseExamplesFragment extends ActionBarFragment
		implements
		View.OnClickListener {

	@SuppressWarnings("unused")
	private static final String TAG = "BaseExamplesFragment";

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		final Activity activity = getActivity();
		if (activity instanceof ExNavigationActivity) {
			((ExNavigationActivity) activity).setNavigationAccessible(false);
		}
	}

	@Override
	public void onClick(View view) {
		dispatchViewClick(view);
	}
}


text:
import React, { Component } from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {fetchWeather} from '../actions/index';

class SearchBar extends Component {
  constructor(props){
    super(props);

    this.state = {term: ''}
  }

  onInputChange(e){
    this.setState({term: e.target.value});
  }
  onFormSubmit(e){
    e.preventDefault();

    this.props.fetchWeather(this.state.term);
    this.setState({ term: '' })
  }

  render(){
    return(
      <form className="input-group" onSubmit={this.onFormSubmit.bind(this)}>
        <input placeholder="Get forecast"
          className="form-control"
          value={this.state.term}
          onChange={this.onInputChange.bind(this)}/>
        <span className="input-group-btn">
          <button className="btn btn-primary" type="submit">Submit</button>
        </span>
      </form>
    );
  }
}

function mapDispatchToProps(dispatch){
  return bindActionCreators({fetchWeather}, dispatch);
}

export default connect(null, mapDispatchToProps)(SearchBar);


text:
/// <reference path='fourslash.ts' />

/////// This is simple /// comments
////function simple() {
////}
////
////sim/*1q*/ple( /*1*/);
////
/////// multiLine /// Comments
/////// This is example of multiline /// comments
/////// Another multiLine
////function multiLine() {
////}
////mul/*2q*/tiLine( /*2*/);
////
/////** this is eg of single line jsdoc style comment */
////function jsDocSingleLine() {
////}
////jsDoc/*3q*/SingleLine(/*3*/);
////
////
/////** this is multiple line jsdoc stule comment
////*New line1
////*New Line2*/
////function jsDocMultiLine() {
////}
////jsDocM/*4q*/ultiLine(/*4*/);
////
/////** this is multiple line jsdoc stule comment
////*New line1
////*New Line2*/
/////** Shoul mege this line as well
////* and this too*/ /** Another this one too*/
////function jsDocMultiLineMerge() {
////}
////jsDocMu/*5q*/ltiLineMerge(/*5*/);
////
////
/////// Triple slash comment
/////** jsdoc comment */
////function jsDocMixedComments1() {
////}
////jsDocMix/*6q*/edComments1(/*6*/);
////
/////// Triple slash comment
/////** jsdoc comment */ /** another jsDocComment*/
////function jsDocMixedComments2() {
////}
////jsDocMi/*7q*/xedComments2(/*7*/);
////
/////** jsdoc comment */ /*** malformed jsDocComment*/
/////// Triple slash comment
////function jsDocMixedComments3() {
////}
////jsDocMixe/*8q*/dComments3(/*8*/);
////
/////** jsdoc comment */ /** another jsDocComment*/
/////// Triple slash comment
/////// Triple slash comment 2
////function jsDocMixedComments4() {
////}
////jsDocMixed/*9q*/Comments4(/*9*/);
////
/////// Triple slash comment 1
/////** jsdoc comment */ /** another jsDocComment*/
/////// Triple slash comment
/////// Triple slash comment 2
////function jsDocMixedComments5() {
////}
////jsDocM/*10q*/ixedComments5(/*10*/);
////
/////** another jsDocComment*/
/////// Triple slash comment 1
/////// Triple slash comment
/////// Triple slash comment 2
/////** jsdoc comment */
////function jsDocMixedComments6() {
////}
////jsDocMix/*11q*/edComments6(/*11*/);
////
////// This shoulnot be help comment
////function noHelpComment1() {
////}
////noHel/*12q*/pComment1(/*12*/);
////
/////* This shoulnot be help comment */
////function noHelpComment2() {
////}
////noHelpC/*13q*/omment2(/*13*/);
////
////function noHelpComment3() {
////}
////noHelpC/*14q*/omment3(/*14*/);
/////** Adds two integers and returns the result
////  * @param {number} a first number
////  * @param b second number
////  */
////function sum(/*16aq*/a: number, /*17aq*/b: number) {
////    return /*18*/a + b;
////}
/////*15*/s/*16q*/um(/*16*/10, /*17*/20);
/////** This is multiplication function*/
/////** @param */
/////** @param a first number*/
/////** @param b */
/////** @param c {
//// @param d @anotherTag*/
/////** @param e LastParam @anotherTag*/
////function multiply(/*19aq*/a: number, /*20aq*/b: number, /*21aq*/c?: number, /*22aq*/d?, /*23aq*/e?) {
////}
////mult/*19q*/iply(/*19*/10,/*20*/ 20,/*21*/ 30, /*22*/40, /*23*/50);
/////** fn f1 with number
////* @param { string} b about b
////*/
////function f1(/*25aq*/a: number);
////function f1(/*26aq*/b: string);
/////**@param opt optional parameter*/
////function f1(aOrb, opt?) {
////    return /*24*/aOrb;
////}
////f/*25q*/1(/*25*/10);
////f/*26q*/1(/*26*/"hello");
/////*27*/
/////** This is subtract function
////@param { a
////*@param { number | } b this is about b
////@param { { () => string; } } c this is optional param c
////@param { { () => string; } d this is optional param d
////@param { { () => string; } } e this is optional param e
////@param { { { () => string; } } f this is optional param f
////*/
////function subtract(/*28aq*/a: number, /*29aq*/b: number, /*30aq*/c?: () => string, /*31aq*/d?: () => string, /*32aq*/e?: () => string, /*33aq*/f?: () => string) {
////}
////subt/*28q*/ract(/*28*/10, /*29*/ 20, /*30*/ null, /*31*/ null, /*32*/ null, /*33*/null);
/////** this is square function
////@paramTag { number } a this is input number of paramTag
////@param { number } a this is input number
////@returnType { number } it is return type
////*/
////function square(/*34aq*/a: number) {
////    return a * a;
////}
////squ/*34q*/are(/*34*/10);
/////** this is divide function
////@param { number} a this is a
////@paramTag { number } g this is optional param g
////@param { number} b this is b
////*/
////function divide(/*35aq*/a: number, /*36aq*/b: number) {
////}
////div/*35q*/ide(/*35*/10, /*36*/20);
/////**
////Function returns string concat of foo and bar
////@param			{string}		foo		is string
////@param		    {string}		bar		is second string
////*/
////function fooBar(/*37aq*/foo: string, /*38aq*/bar: string) {
////    return foo + bar;
////}
////fo/*37q*/oBar(/*37*/"foo",/*38*/"bar");
/////** This is a comment */
////var x;
/////**
////  * This is a comment
////  */
////var y;
/////** this is jsdoc style function with param tag as well as inline parameter help
////*@param a it is first parameter
////*@param c it is third parameter
////*/
////function jsDocParamTest(/** this is inline comment for a *//*40aq*/a: number, /** this is inline comment for b*/ /*41aq*/b: number, /*42aq*/c: number, /*43aq*/d: number) {
////    return /*39*/a + b + c + d;
////}
/////*44*/jsD/*40q*/ocParamTest(/*40*/30, /*41*/40, /*42*/50, /*43*/60);
/////** This is function comment
////  * And properly aligned comment
////  */
////function jsDocCommentAlignmentTest1() {
////}
////jsDocCom/*45q*/mentAlignmentTest1(/*45*/);
/////** This is function comment
////  *     And aligned with 4 space char margin
////  */
////function jsDocCommentAlignmentTest2() {
////}
////jsDocComme/*46q*/ntAlignmentTest2(/*46*/);
/////** This is function comment
////  *     And aligned with 4 space char margin
////  * @param {string} a this is info about a
////  *                   spanning on two lines and aligned perfectly
////  * @param b          this is info about b
////  *                   spanning on two lines and aligned perfectly
////  *                   spanning one more line alined perfectly
////  *                       spanning another line with more margin
////  * @param c          this is info about b
////  *  not aligned text about parameter will eat only one space
////  */
////function jsDocCommentAlignmentTest3(/*47aq*/a: string, /*48aq*/b, /*49aq*/c) {
////}
////jsDocComme/*47q*/ntAlignmentTest3(/*47*/"hello",/*48*/1, /*49*/2);
/////**/
////class NoQuic/*50*/kInfoClass {
////}

goTo.marker('1');
verify.currentSignatureHelpDocCommentIs("");
verify.quickInfoAt("1q", "function simple(): void");

goTo.marker('2');
verify.currentSignatureHelpDocCommentIs("");
verify.quickInfoAt("2q", "function multiLine(): void");

goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("this is eg of single line jsdoc style comment ");
verify.quickInfoAt("3q", "function jsDocSingleLine(): void", "this is eg of single line jsdoc style comment ");

goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("this is multiple line jsdoc stule comment\nNew line1\nNew Line2");
verify.quickInfoAt("4q", "function jsDocMultiLine(): void", "this is multiple line jsdoc stule comment\nNew line1\nNew Line2");

goTo.marker('5');
verify.currentSignatureHelpDocCommentIs("this is multiple line jsdoc stule comment\nNew line1\nNew Line2\nShoul mege this line as well\nand this too\nAnother this one too");
verify.quickInfoAt("5q", "function jsDocMultiLineMerge(): void", "this is multiple line jsdoc stule comment\nNew line1\nNew Line2\nShoul mege this line as well\nand this too\nAnother this one too");

goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("jsdoc comment ");
verify.quickInfoAt("6q", "function jsDocMixedComments1(): void", "jsdoc comment ");

goTo.marker('7');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.quickInfoAt("7q", "function jsDocMixedComments2(): void", "jsdoc comment \nanother jsDocComment");

goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("jsdoc comment ");
verify.quickInfoAt("8q", "function jsDocMixedComments3(): void", "jsdoc comment ");

goTo.marker('9');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.quickInfoAt("9q", "function jsDocMixedComments4(): void", "jsdoc comment \nanother jsDocComment");

goTo.marker('10');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.quickInfoAt("10q", "function jsDocMixedComments5(): void", "jsdoc comment \nanother jsDocComment");

goTo.marker('11');
verify.currentSignatureHelpDocCommentIs("another jsDocComment\njsdoc comment ");
verify.quickInfoAt("11q", "function jsDocMixedComments6(): void", "another jsDocComment\njsdoc comment ");

goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("");
verify.quickInfoAt("12q", "function noHelpComment1(): void");

goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("");
verify.quickInfoAt("13q", "function noHelpComment2(): void");

goTo.marker('14');
verify.currentSignatureHelpDocCommentIs("");
verify.quickInfoAt("14q", "function noHelpComment3(): void");

goTo.marker('15');
verify.completionListContains("sum", "function sum(a: number, b: number): number", "Adds two integers and returns the result");

goTo.marker('16');
verify.currentSignatureHelpDocCommentIs("Adds two integers and returns the result");
verify.currentParameterHelpArgumentDocCommentIs("first number");
verify.quickInfos({
    "16q": ["function sum(a: number, b: number): number", "Adds two integers and returns the result"],
    "16aq": ["(parameter) a: number", "first number"]
});

goTo.marker('17');
verify.currentSignatureHelpDocCommentIs("Adds two integers and returns the result");
verify.currentParameterHelpArgumentDocCommentIs("second number");
verify.quickInfoAt("17aq", "(parameter) b: number", "second number");

goTo.marker('18');
verify.quickInfoIs("(parameter) a: number", "first number");
verify.completionListContains("a", "(parameter) a: number", "first number");
verify.completionListContains("b", "(parameter) b: number", "second number");

goTo.marker('19');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("first number");
verify.quickInfos({
    "19q": [
        "function multiply(a: number, b: number, c?: number, d?: any, e?: any): void",
        "This is multiplication function"
    ],
    "19aq": ["(parameter) a: number", "first number"]
});

goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("20aq", "(parameter) b: number");

goTo.marker('21');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("21aq", "(parameter) c: number");

goTo.marker('22');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("22aq", "(parameter) d: any");

goTo.marker('23');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("LastParam ");
verify.quickInfoAt("23aq", "(parameter) e: any", "LastParam ");

goTo.marker('24');
verify.completionListContains("aOrb", "(parameter) aOrb: any", "");
verify.completionListContains("opt", "(parameter) opt: any", "optional parameter");

goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("fn f1 with number");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfos({
    "25q": ["function f1(a: number): any (+1 overload)", "fn f1 with number"],
    "25aq": "(parameter) a: number"
});

goTo.marker('26');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfos({
    "26q": "function f1(b: string): any (+1 overload)",
    "26aq": "(parameter) b: string"
});

goTo.marker('27');
verify.completionListContains("multiply", "function multiply(a: number, b: number, c?: number, d?: any, e?: any): void", "This is multiplication function");
verify.completionListContains("f1", "function f1(a: number): any (+1 overload)", "fn f1 with number");

const subtractDoc = "This is subtract function";
goTo.marker('28');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfos({
    "28q": [
        "function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void",
        subtractDoc,
    ],
    "28aq": "(parameter) a: number"
});

goTo.marker('29');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is about b");
verify.quickInfoAt("29aq", "(parameter) b: number", "this is about b");

goTo.marker('30');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param c");
verify.quickInfoAt("30aq", "(parameter) c: () => string", "this is optional param c");

goTo.marker('31');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param d");
verify.quickInfoAt("31aq", "(parameter) d: () => string", "this is optional param d");

goTo.marker('32');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param e");
verify.quickInfoAt("32aq", "(parameter) e: () => string", "this is optional param e");

goTo.marker('33');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("33aq", "(parameter) f: () => string");

goTo.marker('34');
verify.currentSignatureHelpDocCommentIs("this is square function");
verify.currentParameterHelpArgumentDocCommentIs("this is input number");
verify.quickInfos({
    "34q": [
        "function square(a: number): number",
        "this is square function"
    ],
    "34aq": [
        "(parameter) a: number",
        "this is input number"
    ]
});

goTo.marker('35');
verify.currentSignatureHelpDocCommentIs("this is divide function");
verify.currentParameterHelpArgumentDocCommentIs("this is a");
verify.quickInfos({
    "35q": [
        "function divide(a: number, b: number): void",
        "this is divide function"
    ],
    "35aq": [
        "(parameter) a: number",
        "this is a"
    ]
});

goTo.marker('36');
verify.currentSignatureHelpDocCommentIs("this is divide function");
verify.currentParameterHelpArgumentDocCommentIs("this is b");
verify.quickInfoAt("36aq", "(parameter) b: number", "this is b");

goTo.marker('37');
verify.currentSignatureHelpDocCommentIs("Function returns string concat of foo and bar");
verify.currentParameterHelpArgumentDocCommentIs("is string");
verify.quickInfos({
    "37q": ["function fooBar(foo: string, bar: string): string", "Function returns string concat of foo and bar"],
    "37aq": ["(parameter) foo: string", "is string"]
});

goTo.marker('38');
verify.currentSignatureHelpDocCommentIs("Function returns string concat of foo and bar");
verify.currentParameterHelpArgumentDocCommentIs("is second string");
verify.quickInfoAt("38aq", "(parameter) bar: string", "is second string");

goTo.marker('39');
verify.completionListContains("a", "(parameter) a: number", "it is first parameter\nthis is inline comment for a ");
verify.completionListContains("b", "(parameter) b: number", "this is inline comment for b");
verify.completionListContains("c", "(parameter) c: number", "it is third parameter");
verify.completionListContains("d", "(parameter) d: number", "");

goTo.marker('40');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("it is first parameter\nthis is inline comment for a ");
verify.quickInfos({
    "40q": [
        "function jsDocParamTest(a: number, b: number, c: number, d: number): number",
        "this is jsdoc style function with param tag as well as inline parameter help"
    ],
    "40aq": [
        "(parameter) a: number",
        "it is first parameter\nthis is inline comment for a "
    ]
});

goTo.marker('41');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("this is inline comment for b");
verify.quickInfoAt("41aq", "(parameter) b: number", "this is inline comment for b");

goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("it is third parameter");
verify.quickInfoAt("42aq", "(parameter) c: number", "it is third parameter");

goTo.marker('43');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("43aq", "(parameter) d: number");

goTo.marker('44');
verify.completionListContains("jsDocParamTest", "function jsDocParamTest(a: number, b: number, c: number, d: number): number", "this is jsdoc style function with param tag as well as inline parameter help");
verify.completionListContains("x", "var x: any", "This is a comment ");
verify.completionListContains("y", "var y: any", "This is a comment");

goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("This is function comment\nAnd properly aligned comment");
verify.quickInfoAt("45q", "function jsDocCommentAlignmentTest1(): void", "This is function comment\nAnd properly aligned comment");

goTo.marker('46');
verify.currentSignatureHelpDocCommentIs("This is function comment\n    And aligned with 4 space char margin");
verify.quickInfoAt("46q", "function jsDocCommentAlignmentTest2(): void", "This is function comment\n    And aligned with 4 space char margin");

goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("This is function comment\n    And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about a\nspanning on two lines and aligned perfectly");
verify.quickInfos({
    "47q": [
        "function jsDocCommentAlignmentTest3(a: string, b: any, c: any): void",
        "This is function comment\n    And aligned with 4 space char margin"
    ],
    "47aq": [
        "(parameter) a: string",
        "this is info about a\nspanning on two lines and aligned perfectly"
    ]
});

goTo.marker('48');
verify.currentSignatureHelpDocCommentIs("This is function comment\n    And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n    spanning another line with more margin");
verify.quickInfoAt("48aq", "(parameter) b: any", "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n    spanning another line with more margin");

goTo.marker('49');
verify.currentSignatureHelpDocCommentIs("This is function comment\n    And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about b\nnot aligned text about parameter will eat only one space");
verify.quickInfos({
    "49aq": [
        "(parameter) c: any",
        "this is info about b\nnot aligned text about parameter will eat only one space"
    ],
    50: "class NoQuickInfoClass"
});


text:
'use strict';

module.exports = {
  default: {
    testConf: 1,
  },
  validator: config => {
    if (typeof config.testConf !== 'number') {
      throw new Error('testConfig has to be a number');
    }
  },
};


text:
Order pages

Drag to order pages and then click 'Save'

		<input type="button" id="save" value="Save" class="btn btn-primary" />


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.log4j.or.jms (Apache Log4j 1.2.17 API)</title>
<meta name="date" content="2015-08-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.apache.log4j.or.jms

类

MessageRenderer


text:
from django import forms

from .models import Topic, Post
from .settings import COMMENT_PLACEHOLDER

class AddTopicForm(forms.ModelForm):
    """
    Form for adding a new topic.
    """
    text  = forms.CharField(widget=forms.Textarea(attrs={'tabindex': '2', 'placeholder': COMMENT_PLACEHOLDER}))
    image = forms.CharField(widget=forms.FileInput(), required=False)

    class Meta:
        model = Topic
        fields = ['forum', 'name', 'image', 'text']
        widgets = {
            'forum': forms.HiddenInput(),
        }

    def __init__(self, *args, **kwargs):
        super(AddTopicForm, self).__init__(*args, **kwargs)
        self.fields['name'].widget.attrs = {'tabindex': '1'}

class PostForm(forms.ModelForm):
    """
    Form for adding or editing a post.
    """
    class Meta:
        model = Post
        fields = ['image', 'text']
        widgets = {
            'text': forms.Textarea(attrs={'tabindex': '1', 'placeholder': COMMENT_PLACEHOLDER}),
            'topic': forms.HiddenInput(),
            'user': forms.HiddenInput(),
        }

    def __init__(self, *args, **kwargs):
        super(PostForm, self).__init__(*args, **kwargs)
        self.fields['text'].label = ""


text:
import { IEventSystem } from "../../ts-common/events";
import { View } from "../../ts-common/view";
import { Layout } from "../../ts-layout";
import { TimepickerEvents, ITimepickerConfig, ITimepicker, ITimeObject, ITimepickerHandlersMap } from "./types";
export declare class Timepicker extends View implements ITimepicker {
    config: ITimepickerConfig;
    events: IEventSystem<TimepickerEvents, ITimepickerHandlersMap>;
    layout: Layout;
    private _hoursSlider;
    private _minutesSlider;
    private _inputsView;
    private _time;
    private _handlers;
    private _outerHandlers;
    constructor(container: HTMLElement | string, config?: ITimepickerConfig);
    getValue<T extends boolean = false>(asOBject?: T): T extends true ? ITimeObject : string;
    setValue(value: Date | number | string | any[] | ITimeObject): void;
    clear(): void;
    destructor(): void;
    getRootView(): any;
    private _setValue;
    private _initUI;
    private _initHandlers;
    private _initEvents;
    private _draw;
}


text:
Broadcast Giphy images to listeners using Socket.IO. This is just a prototype written during morning coffee to demonstrate
playing with Socket.IO and the Giphy API.

This is useful at the office if you have a television mounted on the wall and would like different people to be able
to remotely trigger changes of the Giphy displayed on the tv in realtime, without having to access the keyboard connected
to the television.

This is using Express.js as the web framework with EJS for templating. Data is persisted with mongodb.

# To install:
1. Clone the repo
2. npm install
3. Install mongodb
4. cp .sample_env .env (and adjust HTTP_PORT and MONGO_URL if necessary)
5. node index.js

By default, the app listens on port 3000. Change if you'd like.
You can use something like 'forever' if you'd like to keep it running.

# Example install on Ubuntu 20.04
```
sudo apt-get update

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get install -y mongodb-org

sudo systemctl start mongod

sudo systemctl status mongod

cd /home

mkdir picroost

cd picroost

git clone https://github.com/mmccaff/giphy-battle.git .

sudo apt install nodejs

sudo apt install npm

sudo npm install -g forever

cp .sample_env .env

vi .env

npm install

forever start index.js
```

# How to use:
There are a few routes:
* /
* /?tag=cats
* /?url=http://www.url.to/giphy.gif
* /battle
* /favorites

The above operates on a 'main' or 'general' room (channel) but ad hoc, private rooms can emerge by preceding with a room name. For example,
/mycompany, /mycompany/battle, /mycompany/favorites to have a room that is only for 'mycompany' and not seen by other rooms.

When the / route is loaded it initially displays a random image from Giphy and sizes it to take up the entire window. If
a tag parameter is provided, it will display a random image that has that tag. The page reloads every ten minutes with a
new random image from the set of all or the specified tag. If a url parameter is specified, that url will be loaded as the
image src.

The /battle route will accept user input of a tag value. On receiving a broadcast message via
Socket.IO, anyone viewing '/' will reload the window for the specified tag, thereby receiving
a different random image. To test this, you can load http://localhost:3000/ and http://localhost:3000/battle and use the battle
route to immediately change the image seen in the / route. You can also send a url to an image instead of a tag, and that will be
loaded as the img src via the url param. Hitting ENTER will reload the current tag. A /s command will show you the current img src.
Rudimentary voting is implemented with /up and /down commands which increase or decrease the # of total votes show on the bottom right of the image.
A score < -2 within a 10 minute period will reload a random image at /. Images can be favorited with /favorite and meme text can be overlaid with
/say meme text.

# Future features, bugs, etc:
* Have been moved to [Issues](https://github.com/mmccaff/giphy-battle/issues) and [Project](https://github.com/mmccaff/giphy-battle/projects) in Github


text:
module BrInvoicesPdf
  module Cfe
    module Parser
      module Cpf
        extend Util::XmlLocate

        module_function

        def execute(xml)
          locate_element(xml, 'infCFe/dest/CPF')
        end
      end
    end
  end
end


text:
namespace content {

namespace {

const char kIdParam[] = "id";
const char kMethodParam[] = "method";
const char kParamsParam[] = "params";

}

class DevToolsProtocolTest : public ContentBrowserTest,
                             public DevToolsAgentHostClient {
 protected:
  void SendCommand(const std::string& method,
                   scoped_ptr<base::DictionaryValue> params) {
    base::DictionaryValue command;
    command.SetInteger(kIdParam, 1);
    command.SetString(kMethodParam, method);
    if (params)
      command.Set(kParamsParam, params.release());

    std::string json_command;
    base::JSONWriter::Write(&command, &json_command);
    agent_host_->DispatchProtocolMessage(json_command);
    base::MessageLoop::current()->Run();
  }

  bool HasValue(const std::string& path) {
    base::Value* value = 0;
    return result_->Get(path, &value);
  }

  bool HasListItem(const std::string& path_to_list,
                   const std::string& name,
                   const std::string& value) {
    base::ListValue* list;
    if (!result_->GetList(path_to_list, &list))
      return false;

    for (size_t i = 0; i != list->GetSize(); i++) {
      base::DictionaryValue* item;
      if (!list->GetDictionary(i, &item))
        return false;
      std::string id;
      if (!item->GetString(name, &id))
        return false;
      if (id == value)
        return true;
    }
    return false;
  }

  void SetUpOnMainThread() override {
    agent_host_ = DevToolsAgentHost::GetOrCreateFor(shell()->web_contents());
    agent_host_->AttachClient(this);
  }

  void TearDownOnMainThread() override {
    agent_host_->DetachClient();
    agent_host_ = NULL;
  }

  scoped_ptr<base::DictionaryValue> result_;
  scoped_refptr<DevToolsAgentHost> agent_host_;

 private:
  void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
                               const std::string& message) override {
    scoped_ptr<base::DictionaryValue> root(
        static_cast<base::DictionaryValue*>(base::JSONReader::Read(message)));
    base::DictionaryValue* result;
    EXPECT_TRUE(root->GetDictionary("result", &result));
    result_.reset(result->DeepCopy());
    base::MessageLoop::current()->QuitNow();
  }

  void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override {
    EXPECT_TRUE(false);
  }
};

class CaptureScreenshotTest : public DevToolsProtocolTest {
 private:
#if !defined(OS_ANDROID)
  void SetUpCommandLine(base::CommandLine* command_line) override {
    command_line->AppendSwitch(switches::kEnablePixelOutputInTests);
  }
#endif
};

// Does not link on Android
#if defined(OS_ANDROID)
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot
#elif defined(OS_MACOSX)  // Fails on 10.9. http://crbug.com/430620
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot
#elif defined(MEMORY_SANITIZER)
// Also fails under MSAN. http://crbug.com/423583
#define MAYBE_CaptureScreenshot DISABLED_CaptureScreenshot
#else
#define MAYBE_CaptureScreenshot CaptureScreenshot
#endif
IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, MAYBE_CaptureScreenshot) {
  shell()->LoadURL(GURL("about:blank"));
  EXPECT_TRUE(content::ExecuteScript(
      shell()->web_contents()->GetRenderViewHost(),
      "document.body.style.background = '#123456'"));
  SendCommand("Page.captureScreenshot", nullptr);
  std::string base64;
  EXPECT_TRUE(result_->GetString("data", &base64));
  std::string png;
  EXPECT_TRUE(base::Base64Decode(base64, &png));
  SkBitmap bitmap;
  gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>(png.data()),
                        png.size(), &bitmap);
  SkColor color(bitmap.getColor(0, 0));
  EXPECT_TRUE(std::abs(0x12-(int)SkColorGetR(color)) <= 1);
  EXPECT_TRUE(std::abs(0x34-(int)SkColorGetG(color)) <= 1);
  EXPECT_TRUE(std::abs(0x56-(int)SkColorGetB(color)) <= 1);
}

class SyntheticGestureTest : public DevToolsProtocolTest {
#if !defined(OS_ANDROID)
 protected:
  void SetUpOnMainThread() override {
    DevToolsProtocolTest::SetUpOnMainThread();

    scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
    params->SetInteger("width", 384);
    params->SetInteger("height", 640);
    params->SetDouble("deviceScaleFactor", 2.0);
    params->SetBoolean("mobile", true);
    params->SetBoolean("fitWindow", false);
    params->SetBoolean("textAutosizing", true);
    SendCommand("Page.setDeviceMetricsOverride", params.Pass());

    params.reset(new base::DictionaryValue());
    params->SetBoolean("enabled", true);
    params->SetString("configuration", "mobile");
    SendCommand("Page.setTouchEmulationEnabled", params.Pass());
  }
#endif
};

#if defined(OS_ANDROID)
// crbug.com/469947
#define MAYBE_SynthesizePinchGesture DISABLED_SynthesizePinchGesture
#else
// crbug.com/460128
#define MAYBE_SynthesizePinchGesture DISABLED_SynthesizePinchGesture
#endif
IN_PROC_BROWSER_TEST_F(SyntheticGestureTest, MAYBE_SynthesizePinchGesture) {
  GURL test_url = GetTestUrl("devtools", "synthetic_gesture_tests.html");
  NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1);

  int old_width;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(window.innerWidth)", &old_width));

  int old_height;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(window.innerHeight)", &old_height));

  scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
  params->SetInteger("x", old_width / 2);
  params->SetInteger("y", old_height / 2);
  params->SetDouble("scaleFactor", 2.0);
  SendCommand("Input.synthesizePinchGesture", params.Pass());

  int new_width;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(window.innerWidth)", &new_width));
  ASSERT_DOUBLE_EQ(2.0, static_cast<double>(old_width) / new_width);

  int new_height;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(window.innerHeight)", &new_height));
  ASSERT_DOUBLE_EQ(2.0, static_cast<double>(old_height) / new_height);
}

#if defined(OS_ANDROID)
#define MAYBE_SynthesizeScrollGesture SynthesizeScrollGesture
#else
// crbug.com/460128
#define MAYBE_SynthesizeScrollGesture DISABLED_SynthesizeScrollGesture
#endif
IN_PROC_BROWSER_TEST_F(SyntheticGestureTest, MAYBE_SynthesizeScrollGesture) {
  GURL test_url = GetTestUrl("devtools", "synthetic_gesture_tests.html");
  NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1);

  int scroll_top;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(document.body.scrollTop)", &scroll_top));
  ASSERT_EQ(0, scroll_top);

  scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
  params->SetInteger("x", 0);
  params->SetInteger("y", 0);
  params->SetInteger("xDistance", 0);
  params->SetInteger("yDistance", -100);
  SendCommand("Input.synthesizeScrollGesture", params.Pass());

  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(document.body.scrollTop)", &scroll_top));
  ASSERT_EQ(100, scroll_top);
}

#if defined(OS_ANDROID)
#define MAYBE_SynthesizeTapGesture SynthesizeTapGesture
#else
// crbug.com/460128
#define MAYBE_SynthesizeTapGesture DISABLED_SynthesizeTapGesture
#endif
IN_PROC_BROWSER_TEST_F(SyntheticGestureTest, MAYBE_SynthesizeTapGesture) {
  GURL test_url = GetTestUrl("devtools", "synthetic_gesture_tests.html");
  NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1);

  int scroll_top;
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(document.body.scrollTop)", &scroll_top));
  ASSERT_EQ(0, scroll_top);

  scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
  params->SetInteger("x", 16);
  params->SetInteger("y", 16);
  params->SetString("gestureSourceType", "touch");
  SendCommand("Input.synthesizeTapGesture", params.Pass());

  // The link that we just tapped should take us to the bottom of the page. The
  // new value of |document.body.scrollTop| will depend on the screen dimensions
  // of the device that we're testing on, but in any case it should be greater
  // than 0.
  ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
      shell()->web_contents(),
      "domAutomationController.send(document.body.scrollTop)", &scroll_top));
  ASSERT_GT(scroll_top, 0);
}

}  // namespace content


text:
import {Component, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';

import {Zippy} from './app/zippy';

@Component({
  selector: 'zippy-app',
  template: `
    <zippy (open)="pushLog('open')" (close)="pushLog('close')" title="Details">
      This is some content.
    </zippy>

{{log}}

  `
})
class ZippyApp {
  logs: string[] = [];

  pushLog(log: string) { this.logs.push(log); }
}

@NgModule({declarations: [ZippyApp, Zippy], bootstrap: [ZippyApp], imports: [BrowserModule]})
class ExampleModule {
}

export function main() {
  platformBrowserDynamic().bootstrapModule(ExampleModule);
}


text:
#if DEBUG
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevExtreme.AspNet.Data {

    class EnumerableOnce<T> : IEnumerable<T> {
        IEnumerable<T> _source;
        bool _enumerated;

        public EnumerableOnce(IEnumerable<T> source) {
            _source = source;
        }

        IEnumerator<T> IEnumerable<T>.GetEnumerator() {
            return GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return GetEnumerator();
        }

        IEnumerator<T> GetEnumerator() {
            if(_enumerated)
                throw new InvalidOperationException("Sequence already enumerated");

            _enumerated = true;
            return _source.GetEnumerator();
        }
    }

}
#endif


text:
using System.Data;

namespace StructureMap.DataAccess.Tools.Mocks
{
    public class ReaderExpectation
    {
        private readonly ParameterList _parameters;
        private readonly IDataReader _result;

        public ReaderExpectation(IDataReader result)
        {
            _result = result;
            _parameters = new ParameterList();
        }

        public ReaderExpectation(ParameterList parameters, IDataReader result)
        {
            _parameters = parameters;
            _result = result;
        }

        public ParameterList Parameters
        {
            get { return _parameters; }
        }

        public IDataReader VerifyAndGetReader(ParameterList actualParameters)
        {
            _parameters.Verify(actualParameters);

            return _result;
        }
    }
}


text:
(function (phantomas) {
  window.addEventListener("load", () => {
    try {
      var entries = Object.keys(window.localStorage);

      phantomas.setMetric("localStorageEntries", entries.length);

      entries.forEach(function (entry) {
        phantomas.addOffender("localStorageEntries", entry);
      });
    } catch (ex) {
      phantomas.log("localStorageEntries: not set because " + ex + "!");
    }
  });
})(window.__phantomas);


text:
We would be glad if you contribute to our source code and help us to improve Cloudstack UI even more! We propose you to follow these guidelines:

Submitting a Pull request
Documentation fixes

 - [Question or problem?](#question)
 - [Submitting an issue](#issue)
 - [Documentation fixes](#doc)
 - [Commit Message Guidelines](#commit)

##  Question or problem
If you have any question about how to use Cloudstack UI, please contact us at info@bw-sw.com

##  Submitting an issue
You can help us by submitting an issue to our GitHub Repository in case you find a bug in the source code, a mistake in the documentation or a proposal. A Pull Request with a fix would be even better.
Before you submit an issue, search the archive, maybe your question was already answered.

Here are the submission guidelines we would like you to follow:

* **Detailed overview of the Issue** - if an error is being thrown a non-minified stack trace helps
* **A type of the issue (labels)**
* **Related issues** - has a similar issue been reported before?
* **Browsers and Operating System** - is this a problem with all browsers?
* **Reproduce the Error** - A set of steps to reproduce the error (in case of a bug)
* **Screenshots** - Screenshots can help the team triage issues far more quickly than a text description.
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
    causing the problem (line of code or commit)

##  Documentation fixes
If you have any ideas how to help us to improve the documentation, please let others know what you're working on by creating a new issue or comment on a related existing one (please, follow the guidelines contained in Submitting an issue).

##  Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted.  This leads to **more
readable messages** that are easy to follow when looking through the **project history**.  But also,
we use the git commit messages to **generate the change log**.

### Commit Message Format
Each commit message consists of a **header** and a **body**.  The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of
the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is
the SHA of the commit being reverted.

### Type
Must be one of the following:

* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
  semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the build system, CI configuration or external dependencies
            (example scopes: gulp, broccoli, npm)
* **chore**: Other changes that don't modify `src` or `test` files

### Scope
The scope could be anything specifying place of the commit change. For example
`vm`, `volume`, etc.

### Subject
The subject contains succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.


text:
<?xml version="1.0" encoding="US-ASCII"?>
<test>
  <basic>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
  </basic>
  <empty>
    <configuration>
    </configuration>
  </empty>
  <invalidst>
    <configuration>
      <source>1.6</source>
      <target>1.2</target>
    </configuration>
  </invalidst>
  <invalidnd>
    <configuration>
      <source>1.0</source>
      <target>1.0</target>
    </configuration>
  </invalidnd>
</test>


text:
package mcjty.rftools.api.teleportation;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

/**
 * Get a reference to an implementation of this interface by calling:
 *         FMLInterModComms.sendFunctionMessage("rftools", "getTeleportationManager", "<whatever>.YourClass$GetDimensionManager");
 */
public interface ITeleportationManager {

    /**
     * Return the name of the receiver if there is a valid receiver at the given position and dimension.
     * If not this will return null. Note that a receiver without name will return an empty string ("")
     * and not null.
     */
    String getReceiverName(World world, BlockPos pos);

    /**
     * Create a receiver at a position. Returns false if this fails for whatever reason.
     * If power == -1 the receiver will be powered completely. Otherwise it will get
     * the specified power (capped at the maximum possible power).
     */
    boolean createReceiver(World world, BlockPos pos, String name, int power);

    /**
     * Teleport a player to a dimension at the given spot.
     */
    void teleportPlayer(EntityPlayer player, int dimension, BlockPos location);

    /**
     * Remove all destinations in a dimension.
     */
    void removeReceiverDestinations(World world, int dim);
}


text:
@echo off
SET ROOT=%~dp0..
rmdir /Q /S %ROOT%\Artifacts

call %ROOT%\Build\nuget-restore.bat
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

call %ROOT%\Build\build-src-release.bat
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

call %ROOT%\Build\run-tests.bat
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

call %ROOT%\Build\nuget-pack.bat
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

call %ROOT%\Build\zip-artifacts.bat
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%


text:
JS13K-Dreaming-of-Fire
======================

Game entry for the [JS13K Game challenge](http://js13kgames.com/)

# Dreaming of Fire #
Dreaming of Fire is a game in which the player's objective is to burn down the city, wipe out the population and cause as much destruction as possible.
This is done by upgrading the sentient flame's influence over his followers.

The theme was the elements (earth, fire, air and water) and we decided to focus on fire.

# Controls #
The game is played with the mouse. Keyboard controls include:
* Esc: Return to the main menu.

# Notes #
Notes here

# Credits #
* Jeremy de Reuck - Programming & Art
* Janke van Jaarsveld - Game Design

#Screenshots#
![Dreaming of Fire Menu](http://gaming.pixelreactor.co.za/dreaming_of_fire/screenshots/menu.jpg "Dreaming of Fire Menu")

![Dreaming of Fire New Game](http://gaming.pixelreactor.co.za/dreaming_of_fire/screenshots/newGame.jpg "Dreaming of Fire New Game")

![Dreaming of Fire Burning Down](http://gaming.pixelreactor.co.za/dreaming_of_fire/screenshots/onFire_02.jpg "Dreaming of Fire Burning Down")

![Dreaming of Fire End Screen](http://gaming.pixelreactor.co.za/dreaming_of_fire/screenshots/victoryScreen.jpg "Dreaming of Fire End Screen")


text:
package com.hp.mwtests.ts.arjuna.abstractrecords;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.arjuna.ats.arjuna.ObjectType;
import com.arjuna.ats.arjuna.coordinator.RecordType;
import com.arjuna.ats.arjuna.coordinator.TwoPhaseOutcome;
import com.arjuna.ats.arjuna.state.InputObjectState;
import com.arjuna.ats.arjuna.state.OutputObjectState;
import com.arjuna.ats.internal.arjuna.abstractrecords.RecoveryRecord;
import com.hp.mwtests.ts.arjuna.resources.ExtendedObject;

public class RecoveryRecordUnitTest
{
    @Test
    public void test ()
    {
        RecoveryRecord cr = new RecoveryRecord(new OutputObjectState(), new ExtendedObject());

        assertFalse(cr.propagateOnAbort());
        assertTrue(cr.propagateOnCommit());
        assertEquals(cr.typeIs(), RecordType.RECOVERY);

        assertTrue(cr.type() != null);
        assertEquals(cr.doSave(), false);
        assertTrue(cr.value() != null);

        cr.setValue(new OutputObjectState());

        assertEquals(cr.nestedPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
        assertEquals(cr.nestedAbort(), TwoPhaseOutcome.FINISH_ERROR);

        cr = new RecoveryRecord(new OutputObjectState(), new ExtendedObject());

        assertEquals(cr.nestedPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
        assertEquals(cr.nestedCommit(), TwoPhaseOutcome.FINISH_OK);

        cr = new RecoveryRecord(new OutputObjectState(), new ExtendedObject());

        assertEquals(cr.topLevelPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
        assertEquals(cr.topLevelAbort(), TwoPhaseOutcome.FINISH_ERROR);

        cr = new RecoveryRecord(new OutputObjectState(), new ExtendedObject());

        assertEquals(cr.topLevelPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
        assertEquals(cr.topLevelCommit(), TwoPhaseOutcome.FINISH_OK);

        cr = new RecoveryRecord();

        cr.merge(new RecoveryRecord());
        cr.alter(new RecoveryRecord());

        assertTrue(cr.save_state(new OutputObjectState(), ObjectType.ANDPERSISTENT));
        assertFalse(cr.restore_state(new InputObjectState(), ObjectType.ANDPERSISTENT));
    }
}


text:
title: App Lab Docs
embedded_layout: simple_embedded
---

[name]

## setImageURL(id, url)

[/name]

[category]

Category: UI Controls

[/category]

[description]

[short_description]

Sets the URL for the specified image element id.

[/short_description]

The images in apps are not always static, they sometimes change based on user or other events. setImage() can be used to update the image displayed for an image element ID. There are two ways to fill in the url string for the second parameter.

**1. Copy the URL of an image on the web.**
In most browsers you can simply *right-click (ctrl+click on a Mac)* on an image and you'll see a menu with a few option. One will be to copy the URL of the image. You could also choose to view the image in its own window and just copy the URL from there.

**2. Upload your own image to App Lab.**
You can upload images saved on your computer to your app in App Lab.

- Click the pulldown arrow in the image URL field and then click "Choose..."![](https://images.code.org/0f9a64a62b14f4f5ea9ca082f5529c2e-image-1451139713710.jpg)
- Then click the "Upload File" button the in the window.
![](https://images.code.org/4e33ebc4011b5eb6590f573ada3ed1da-image-1444241056243.04.04%20PM.png)
- Then choose the file from your computer by navigating to it
- Once its uploaded click "Choose" next to it.  This will insert the name of the file into the URL field.  Because you have uploaded it, it doesn't need to be an HTTP reference.

[/description]

### Examples
____________________________________________________

[example]

```
// Change the image element from the Code.org logo to the dog character.
image("image", "http://code.org/images/logo.png");
setImageURL("image", "http://studio.code.org/blockly/media/skins/applab/static_avatar.png");
```

[/example]

____________________________________________________

[example]

**Example: Image Swap** Click the button to change the character image from the dog to the bee and back again.

```
// Click the button to change the character image from the dog to the bee and back again.
var imageId = "character";
var dogImageURL = "http://studio.code.org/blockly/media/skins/applab/static_avatar.png";
var beeImageURL = "http://studio.code.org/blockly/media/skins/bee/static_avatar.png";
image(imageId, dogImageURL);
var currentImage="dog";
button("changeButton", "Change Character");
onEvent("changeButton", "click", function(event) {
  if (currentImage == "dog") {
    setImageURL(imageId, beeImageURL);
    currentImage="bee";
  } else {
    setImageURL(imageId, dogImageURL);
    currentImage="dog";
  }
});
```

[/example]

____________________________________________________

[syntax]

### Syntax

```
setImageURL(id, url);
```

[/syntax]

[parameters]

### Parameters

| Name  | Type | Required? | Description |
|-----------------|------|-----------|-------------|
| id | string | Yes | The unique identifier for the screen element. Must begin with a letter, contain no spaces, and may contain letters, digits, - and _. |
| url | string | Yes | The source URL of the image to be displayed on screen. |

[/parameters]

[returns]

### Returns
Modifies screen and returns boolean true if the URL assignment was successful, else returns boolean false.

[/returns]

[tips]

### Tips

- Image URL requires the full http:// prefix.
- Use [hideElement()](/applab/docs/hideElement) to hide an image on the screen.

[/tips]

[bug]

Found a bug in the documentation? Let us know at documentation@code.org

[/bug]

<%= view :applab_docs_common %>


text:
from twisted.internet.defer import inlineCallbacks

from autobahn.twisted.wamp import ApplicationSession

class MyComponent(ApplicationSession):

    @inlineCallbacks
    def onJoin(self, details):

        def test1(msg):
             print("test1() called with {}".format(msg))
             return len(msg)

        def test2(msg):
             print("test2() called with {}".format(msg))
             return len(msg)

        try:
             yield self.register(test1, 'com.example.test1')
             yield self.register(test2, 'com.example.test2')
             print("procedures registered")
        except Exception as e:
             print("failed to register procedures: {}".format(e))


text:
/*
 *
 * TourDescription reducer
 *
 */

import { fromJS } from 'immutable';
import {
  LOAD_TOUR, LOAD_TOUR_SUCCESS, LOAD_TOUR_FAILED,
} from './constants';

const initialState = fromJS({
  loading: true,
  error: false,
  tour: {},
});

function tourDescriptionReducer(state = initialState, action) {
  switch (action.type) {
    case LOAD_TOUR:
      return state
        .set('error', false)
        .set('loading', true)
        .set('tour', {});
    case LOAD_TOUR_SUCCESS:
      return state
        .set('loading', false)
        .set('tour', action.tour);
    case LOAD_TOUR_FAILED:
      return state
        .set('loading', false)
        .set('error', action.error);
    default:
      return state;
  }
}

export default tourDescriptionReducer;