构建器¶
These are the built-in Sphinx builders. More builders can be added by extensions.
The builder’s “name” must be given to the -b command-line option of sphinx-build to select a builder.
-
class
sphinx.builders.html.
StandaloneHTMLBuilder
[源代码]¶ This is the standard HTML builder. Its output is a directory with HTML files, complete with style sheets and optionally the reST sources. There are quite a few configuration values that customize the output of this builder, see the chapter HTML输出选项 for details.
-
name
= 'html'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
-
-
class
sphinx.builders.dirhtml.
DirectoryHTMLBuilder
[源代码]¶ This is a subclass of the standard HTML builder. Its output is a directory with HTML files, where each file is called
index.html
and placed in a subdirectory named like its page name. For example, the documentmarkup/rest.rst
will not result in an output filemarkup/rest.html
, butmarkup/rest/index.html
. When generating links between pages, theindex.html
is omitted, so that the URL would look likemarkup/rest/
.-
name
= 'dirhtml'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
0.6 新版功能.
-
-
class
sphinx.builders.singlehtml.
SingleFileHTMLBuilder
[源代码]¶ This is an HTML builder that combines the whole project in one output file. (Obviously this only works with smaller projects.) The file is named like the master document. No indices will be generated.
-
name
= 'singlehtml'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
1.0 新版功能.
-
-
class
sphinx.builders.htmlhelp.
HTMLHelpBuilder
[源代码]¶ This builder produces the same output as the standalone HTML builder, but also generates HTML Help support files that allow the Microsoft HTML Help Workshop to compile them into a CHM file.
-
name
= 'htmlhelp'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/png', 'image/gif', 'image/jpeg']¶
-
-
class
sphinxcontrib.qthelp.
QtHelpBuilder
[源代码]¶ This builder produces the same output as the standalone HTML builder, but also generates Qt help collection support files that allow the Qt collection generator to compile them.
在 2.0 版更改: Moved to sphinxcontrib.qthelp from sphinx.builders package.
-
name
= 'qthelp'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
-
-
class
sphinxcontrib.applehelp.
AppleHelpBuilder
[源代码]¶ This builder produces an Apple Help Book based on the same output as the standalone HTML builder.
If the source directory contains any
.lproj
folders, the one corresponding to the selected language will have its contents merged with the generated output. These folders will be ignored by all other documentation types.In order to generate a valid help book, this builder requires the command line tool hiutil, which is only available on Mac OS X 10.6 and above. You can disable the indexing step by setting
applehelp_disable_external_tools
toTrue
, in which case the output will not be valid until hiutil has been run on all of the.lproj
folders within the bundle.-
name
= 'applehelp'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/png', 'image/gif', 'image/jpeg', 'image/tiff', 'image/jp2', 'image/svg+xml']¶
1.3 新版功能.
在 2.0 版更改: Moved to sphinxcontrib.applehelp from sphinx.builders package.
-
-
class
sphinxcontrib.devhelp.
DevhelpBuilder
[源代码]¶ This builder produces the same output as the standalone HTML builder, but also generates GNOME Devhelp support file that allows the GNOME Devhelp reader to view them.
-
name
= 'devhelp'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/png', 'image/gif', 'image/jpeg']¶
在 2.0 版更改: Moved to sphinxcontrib.devhelp from sphinx.builders package.
-
-
class
sphinx.builders.epub3.
Epub3Builder
[源代码]¶ This builder produces the same output as the standalone HTML builder, but also generates an epub file for ebook readers. See Epub 信息 for details about it. For definition of the epub format, have a look at http://idpf.org/epub or https://en.wikipedia.org/wiki/EPUB. The builder creates EPUB 3 files.
-
name
= 'epub'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
1.4 新版功能.
在 1.5 版更改: Since Sphinx-1.5, the epub3 builder is used for the default builder of epub.
-
-
class
sphinx.builders.latex.
LaTeXBuilder
[源代码]¶ This builder produces a bunch of LaTeX files in the output directory. You have to specify which documents are to be included in which LaTeX files via the
latex_documents
configuration value. There are a few configuration values that customize the output of this builder, see the chapter LaTeX输出的选项 for details.The produced LaTeX file uses several LaTeX packages that may not be present in a “minimal” TeX distribution installation.
On Ubuntu xenial, the following packages need to be installed for successful PDF builds:
texlive-latex-recommended
texlive-fonts-recommended
texlive-latex-extra
latexmk
(this is a Sphinx requirement on GNU/Linux and MacOS X for functioning ofmake latexpdf
)
Additional packages are needed in some circumstances (see the discussion of the
'fontpkg'
key oflatex_elements
for more information):to support occasional Cyrillic letters or words, and a fortiori if
language
is set to a Cyrillic language, the packagetexlive-lang-cyrillic
is required, and, with unmodified'fontpkg'
, alsocm-super
orcm-super-minimal
,to support occasional Greek letters or words (in text, not in
math
directive contents),texlive-lang-greek
is required, and, with unmodified'fontpkg'
, alsocm-super
orcm-super-minimal
,for
'xelatex'
or'lualatex'
(seelatex_engine
),texlive-xetex
resp.texlive-luatex
, and, if leaving unchanged'fontpkg'
,fonts-freefont-otf
.
The testing of Sphinx LaTeX is done on Ubuntu xenial whose TeX distribution is based on a TeXLive 2015 snapshot dated March 2016.
在 1.6 版更改: Formerly, testing had been done on Ubuntu precise (TeXLive 2009).
在 2.0 版更改: Formerly, testing had been done on Ubuntu trusty (TeXLive 2013).
注解
Since 1.6,
make latexpdf
useslatexmk
(not on Windows). This makes sure the needed number of runs is automatically executed to get the cross-references, bookmarks, indices, and tables of contents right.One can pass to
latexmk
options via theLATEXMKOPTS
Makefile variable. For example:make latexpdf LATEXMKOPTS="-silent"
reduces console output to a minimum.
Also, if
latexmk
is at version 4.52b or higher (January 2017)LATEXMKOPTS="-xelatex"
speeds up PDF builds via XeLateX in case of numerous graphics inclusions.To pass options directly to the
(pdf|xe|lua)latex
binary, use variableLATEXOPTS
, for example:make latexpdf LATEXOPTS="--halt-on-error"
-
name
= 'latex'¶
-
format
= 'latex'¶
-
supported_image_types
= ['application/pdf', 'image/png', 'image/jpeg']¶
Note that a direct PDF builder is being provided by rinohtype. The builder’s
name is rinoh
. Refer to the rinohtype manual for details.
-
class
sphinx.builders.text.
TextBuilder
[源代码]¶ This builder produces a text file for each reST file – this is almost the same as the reST source, but with much of the markup stripped for better readability.
-
name
= 'text'¶
-
format
= 'text'¶
-
supported_image_types
= []¶
0.4 新版功能.
-
-
class
sphinx.builders.manpage.
ManualPageBuilder
[源代码]¶ This builder produces manual pages in the groff format. You have to specify which documents are to be included in which manual pages via the
man_pages
configuration value.-
name
= 'man'¶
-
format
= 'man'¶
-
supported_image_types
= []¶
1.0 新版功能.
-
-
class
sphinx.builders.texinfo.
TexinfoBuilder
[源代码]¶ This builder produces Texinfo files that can be processed into Info files by the makeinfo program. You have to specify which documents are to be included in which Texinfo files via the
texinfo_documents
configuration value.The Info format is the basis of the on-line help system used by GNU Emacs and the terminal-based program info. See Texinfo 信息 for more details. The Texinfo format is the official documentation system used by the GNU project. More information on Texinfo can be found at https://www.gnu.org/software/texinfo/.
-
name
= 'texinfo'¶
-
format
= 'texinfo'¶
-
supported_image_types
= ['image/png', 'image/jpeg', 'image/gif']¶
1.1 新版功能.
-
-
class
sphinxcontrib.serializinghtml.
SerializingHTMLBuilder
[源代码]¶ This builder uses a module that implements the Python serialization API (pickle, simplejson, phpserialize, and others) to dump the generated HTML documentation. The pickle builder is a subclass of it.
A concrete subclass of this builder serializing to the PHP serialization format could look like this:
import phpserialize class PHPSerializedBuilder(SerializingHTMLBuilder): name = 'phpserialized' implementation = phpserialize out_suffix = '.file.phpdump' globalcontext_filename = 'globalcontext.phpdump' searchindex_filename = 'searchindex.phpdump'
-
implementation
¶ A module that implements dump(), load(), dumps() and loads() functions that conform to the functions with the same names from the pickle module. Known modules implementing this interface are simplejson, phpserialize, plistlib, and others.
-
out_suffix
¶ The suffix for all regular files.
-
globalcontext_filename
¶ The filename for the file that contains the “global context”. This is a dict with some general configuration values such as the name of the project.
-
searchindex_filename
¶ The filename for the search index Sphinx generates.
See 序列化构建器详细信息 for details about the output format.
0.5 新版功能.
-
-
class
sphinxcontrib.serializinghtml.
PickleHTMLBuilder
[源代码]¶ This builder produces a directory with pickle files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn’t use the standard HTML templates.
See 序列化构建器详细信息 for details about the output format.
-
name
= 'pickle'¶ The old name
web
still works as well.
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
The file suffix is
.fpickle
. The global context is calledglobalcontext.pickle
, the search indexsearchindex.pickle
.-
-
class
sphinxcontrib.serializinghtml.
JSONHTMLBuilder
[源代码]¶ This builder produces a directory with JSON files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn’t use the standard HTML templates.
See 序列化构建器详细信息 for details about the output format.
-
name
= 'json'¶
-
format
= 'html'¶
-
supported_image_types
= ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']¶
The file suffix is
.fjson
. The global context is calledglobalcontext.json
, the search indexsearchindex.json
.0.5 新版功能.
-
-
class
sphinx.builders.gettext.
MessageCatalogBuilder
[源代码]¶ This builder produces gettext-style message catalogs. Each top-level file or subdirectory grows a single
.pot
catalog template.See the documentation on 国际化 for further reference.
-
name
= 'gettext'¶
-
format
= ''¶
-
supported_image_types
= []¶
1.1 新版功能.
-
-
class
sphinx.builders.changes.
ChangesBuilder
[源代码]¶ This builder produces an HTML overview of all
versionadded
,versionchanged
anddeprecated
directives for the currentversion
. This is useful to generate a ChangeLog file, for example.-
name
= 'changes'¶
-
format
= ''¶
-
supported_image_types
= []¶
-
-
class
sphinx.builders.dummy.
DummyBuilder
[源代码]¶ This builder produces no output. The input is only parsed and checked for consistency. This is useful for linting purposes.
-
name
= 'dummy'¶
-
supported_image_types
= []¶
1.4 新版功能.
-
-
class
sphinx.builders.linkcheck.
CheckExternalLinksBuilder
[源代码]¶ This builder scans all documents for external links, tries to open them with
requests
, and writes an overview which ones are broken and redirected to standard output and tooutput.txt
in the output directory.-
name
= 'linkcheck'¶
-
format
= ''¶
-
supported_image_types
= []¶
在 1.5 版更改: Since Sphinx-1.5, the linkcheck builder comes to use requests module.
-
-
class
sphinx.builders.xml.
XMLBuilder
[源代码]¶ This builder produces Docutils-native XML files. The output can be transformed with standard XML tools such as XSLT processors into arbitrary final forms.
-
name
= 'xml'¶
-
format
= 'xml'¶
-
supported_image_types
= []¶
1.2 新版功能.
-
-
class
sphinx.builders.xml.
PseudoXMLBuilder
[源代码]¶ This builder is used for debugging the Sphinx/Docutils “Reader to Transform to Writer” pipeline. It produces compact pretty-printed “pseudo-XML”, files where nesting is indicated by indentation (no end-tags). External attributes for all elements are output, and internal attributes for any leftover “pending” elements are also given.
-
name
= 'pseudoxml'¶
-
format
= 'pseudoxml'¶
-
supported_image_types
= []¶
1.2 新版功能.
-
Built-in Sphinx extensions that offer more builders are:
序列化构建器详细信息¶
All serialization builders outputs one file per source file and a few special
files. They also copy the reST source files in the directory _sources
under the output directory.
The PickleHTMLBuilder
is a builtin subclass that implements the pickle
serialization interface.
The files per source file have the extensions of
out_suffix
, and are arranged in directories
just as the source files are. They unserialize to a dictionary (or dictionary
like structure) with these keys:
body
The HTML “body” (that is, the HTML rendering of the source file), as rendered by the HTML translator.
title
The title of the document, as HTML (may contain markup).
toc
The table of contents for the file, rendered as an HTML
<ul>
.display_toc
A boolean that is
True
if thetoc
contains more than one entry.current_page_name
The document name of the current file.
parents
,prev
andnext
Information about related chapters in the TOC tree. Each relation is a dictionary with the keys
link
(HREF for the relation) andtitle
(title of the related document, as HTML).parents
is a list of relations, whileprev
andnext
are a single relation.sourcename
The name of the source file under
_sources
.
The special files are located in the root output directory. They are:
SerializingHTMLBuilder.globalcontext_filename
A pickled dict with these keys:
project
,copyright
,release
,version
The same values as given in the configuration file.
style
last_updated
Date of last build.
builder
Name of the used builder, in the case of pickles this is always
'pickle'
.titles
A dictionary of all documents’ titles, as HTML strings.
SerializingHTMLBuilder.searchindex_filename
An index that can be used for searching the documentation. It is a pickled list with these entries:
A list of indexed docnames.
A list of document titles, as HTML strings, in the same order as the first list.
A dict mapping word roots (processed by an English-language stemmer) to a list of integers, which are indices into the first list.
environment.pickle
The build environment. This is always a pickle file, independent of the builder and a copy of the environment that was used when the builder was started.
待处理
Document common members.
Unlike the other pickle files this pickle file requires that the
sphinx
package is available on unpickling.


Jie Li is a Ph.D. candidate in Computer Science at Texas Tech University, where he is a member of the Data-Intensive Scalable Computing Laboratory (DISCL) under the guidance of Dr. Yong Chen. Jie’s research interests lie in the areas of High-Performance Computing, Advanced Computer Architecture, and Parallel and Distributed Computing. Jie completed his Master of Science degree in Computer Science from Texas Tech University in 2019. Prior to that, he earned a bachelor’s degree in architecture.
Responsibilities include:
Responsibilities include:
Responsibilities include:
Responsibilities include:


Flight Tracker for Scholars has four intended audiences (which may overlap):
Agents from these four groups are meant to interface with the software and should be added to the REDCap project so that they can gain access to the software.
Notably missing in this list are the scholars themselves. They comprise the subjects of our common studies. Through surveys and verification of their accomplishments, they provide important data about themselves so that we can understand our practices better. However, this software is about providing a supporting environment so that they can succeed better. As such, individual scholars do not need access to the population’s data. We have streamlined workflows so as to cause minimal intrusion upon their important work.


RESET
CLOSE
ABOUT
DEBUG
SETTINGS
GENERATE
ABORT
1. Setting marker:
Active Marker
{% for i in range(3) %}
{{i+1}}
{% endfor %}
Delay (s)
Pulse Width (s)
Source
{% for i in range(10) %}
{{i+1}}
{% endfor %}
2. Preparing AWG:
Predistortion
Enabled
Disabled
Output Mode
Arbitrary
Sequence
Advanced Sequence
Sample Rate
1250000000
625000000
312500000
3a. Designing Square-Wave:
Voltage Level
Points #
Voltage Level
Points #
4.


Summary
We need to have a Facebook App ID to make API calls to Facebook.
Steps
http://developers.facebook.com
and click "Add a New App" under "My Apps"
First you need to first add the product, Facebook Login, under the "PRODUCTS".
After that you can modify the Valid OAuth redirect URIs in order to build the trust between your website and Facebook. Thus, Facebook can redirect the user back to your website.
To setup the JavaScript SDK, you simply need to copy the following script and place it directly after the opening <body> tag on pages where you want to load the JavaScript SDK:
This code will load and initialize the JavaScript SDK. You must replace the value in appId with the ID of your own Facebook App. You can find your appId on the top of the app dashboard page.
FB.init
is to initialize the Facebook SDK. It contains your appID to identify your application, the xfbml is to enable the embed Facebook script to parse through the whole page and place the social plugins, and the version refers to the current graph api verison used.
function(d,s,id)
is to insert the script with the element ID facebook-jssdk, connecting to the Facebook, to include the SDK if it has not existed yet.
Once setup successfully, we will be able to leverage the power of Facebook API to make interesting applications.
This is an example of using Facebook API. API, Application Programming Interface, provides different modules for developers to build up a whole program without requiring to know how it works inside. In other words, API can simplify the process of programming by abstracting the implementation and leaving the objects that is needed for the developers.
The following code is to ask for users' permission to log in onto their Facebook account and authorize this page to get and use some of their information.
In the HTML, you can first create a button to prompt for the permissions dialog with the fb:login-button tag. You need to add the permissions list in the scope
attribute. The onlogin="checkLoginState()"
will call the checkLoginState function when the users log in successfully.
After initializing the Facebook SDK, the page will check the login status by calling the FB.getLoginStatus()
, then it passes the status response to the statusChangeCallback(response)
to check the current login status. If the status is "connected", which means the users has logged into their account at the moment, the testAPI()
will be called. If the status from the response is stated as "not_authorized", it implies that the users have not authorized your application to log in with their Facebook account. Other situations will show the notice for asking the users to log into their Facebook.
When the users try to log into their Facebook account, a login dialogue will pop up and ask for the users' permission to access their personal information. When the users authorize you to do so, Facebook Server will send the access token to your application. Your application will store the access token for sending back to Facebook server whenever it needs to make the API call. That said, you will not aware of this access token processing as this will be done within the SDK. This authorization mechanism is called OAuth, widely used for providing personal information with the advantage of disclosing their usernames and passwords
In order to understand what responses that are actually sent back, you can insert the console.log(response)
under the statusChangeCallback()
and testAPI()
. The image above shows the two responses. The upper response object with the current status "connected". The bottom response object with the user's id and the profile name of the user.
To access the response, you can simply type [object.name].[attribute]
that is response.name for this given example.
If you want to publish a new post on behalf of your users, you can also ask for your users' permission by adding publish_actions
in the scope.
To make it clear, here I create a button for demonstration to publish a new post. When it is clicked, the publishPost()
will be called.
Inside this function, you need to call FB.api
. /me/feed
refers to the current user feed; POST
refers to the HTTP POST method. {"message": "We are Oregon State University buddies."}
is the field name of the main body published. There are more fields that can be used such as "link", "place", "tags", and so on.


Stefan Wolffbrandt Blog
Copenhagen, Danmark
IT-Security
- https://www.schneier.com/
- http://www.thoughtcrime.org/blog/
- https://mikko.hypponen.com/speaking/
Finding the IT-security bussiness I have a few blogs i'd like to share.
Bruce Schneier, the man behind blowfish. I've seen him live, can recommend
Moxie Marlinspike the open-source encryption guy.
Mikko Hypponnen the Anti-virus guy known for his Ted talks.


Use the Hotkey Set tabs to view all available hotkeys in that set.
To change a hotkey, select a Command, click the Hotkey field, and then type the new keys.


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vitae tempus nisi. Nullam posuere tristique fermentum. Vivamus tempor finibus dolor et fermentum. In eget tortor placerat, fermentum orci ut, auctor ex. Sed et ante rutrum, lobortis arcu eget, varius nulla. Nulla non metus felis. Proin nec nisi cursus ex ultrices porttitor. Nullam id ligula vel lectus scelerisque pretium et facilisis sapien. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus lobortis dapibus nunc ut viverra. Vivamus aliquet quam eget lorem pretium, a tincidunt ex fermentum. Cras eu pulvinar leo.
Pan-Cancer Analysis aims to examine the similarities and differences among the genomic and cellular alterations found across diverse tumor types.[1][2] The Cancer Genome Atlas (TCGA) Research Network has developed an integrated picture of commonalities, differences and emergent themes across tumor types. A dozen papers about Pan-Cancer have been published in peer-review journals, such as Nature, Cell and Nature Genetics. Nature created a focus on TCGA Pan-Cancer Analysis
Cancers are classified in two ways: by the type of tissue in which the cancer originates (histological type) and by primary site, or the location in the body where the cancer first developed. This section introduces you to the first method: cancer classification based on histological type. The international standard for the classification and nomenclature of histologies is the International Classification of Diseases for Oncology, Third Edition (ICD-O-3).
Sarcoma refers to cancer that originates in supportive and connective tissues such as bones, tendons, cartilage, muscle, and fat. Generally occurring in young adults, the most common sarcoma often develops as a painful mass on the bone. Sarcoma tumors usually resemble the tissue in which they grow.


{{>header}} {{>nav}}
Here are some common recipes and advice for constructing polyfill requests. This isn't a substitute for the full API reference, and is not intended to show all possible permutations.
The simplest use: consider default polyfills, bundle, minify and and return those which are required by the current browser:
This example is minified by including .min
in the URL. All the other examples on this page are not minified, so you can see the metadata included at the top of the response, but any response can be minified by adding .min
in the same way as shown above.
Consider only the Array.prototype.map
and modernizr:es5array
polyfills, the first only if needed by the browser, the second regardless of the user-agent. No .min
here so the result is not minified.
If you don't specify any features
, 'default' is assumed, but you can also specify default explicitly if you want to combine it with something else. This example uses the default set plus fetch:
Use the es6
alias to include all features that are part of ECMAScript 6 (for which we currently have polyfills):
Consider default polyfills, but for an IE7 user-agent:
It's often a good idea to use the gated
flag to wrap polyfills in a feature-detect. Some people prefer not to do this and instead just trust the browser targeting, but to guard against mistargeting, incorrect user agent interpretation, and conflicts with other polyfills that may be on the same page, you can apply feature-detect gating to all features in the bundle at once:
Use the always
flag to force a polyfill to be returned regardless of whether the user-agent requires it:
This example uses a useragent override of chrome/37 to demonstrate one of the problems of using always
: in Chrome, there is no polyfill for Document that makes sense, because even in those browsers that do need the polyfill, no two browsers use the same one. As a result, even if you specify always
on this feature, you'll get no polyfill in chrome.
With both gated
and always
, you can apply them either at the feature-level using the pipe delimiter or to the whole request using the flags
parameter. This example applies both flags to one feature but neither to the other:
And this example applies both flags to the whole request:
To help out the project with collecting compatibility data, please consider enabling the `rum` option:
There are many ways you can incorporate the polyfill service into your site's resource loading strategy, to suit different standards and rules.
We recommend the use of the async
and defer
attributes on <script>
tags that load from the polyfill service, but loading from us in a non-blocking way means you can't know for certain whether your own code will execute before or after the polyfills are done loading.
To make sure the polyfills are present before you try to run your own code, you can attach an onload
handler to the {{host}} script tag, use a more sophisticated script loader or simply use our callback
argument to evaluate a global callback when the polyfills are loaded:
<script src="{{host}}/v{{apiversion}}/polyfill.min.js?callback=polyfillsAreLoaded" defer async></script>
<script>
function polyfillsAreLoaded() {
console.log('Now to do the cool stuff...');
}
</script>
The polyfill service uses (and advocates) server side feature detection based on User-Agent
identification, but you can also use the service with feature detection in the browser if you like. Just run the tests you want and construct a {{host}} URL, with an always
flag to disable our user-agent feature-detection, and a ua
identifier set to a supported browser:
// Create a list of the features this browser needs.
// Beware of overly simplistic detects!
var features = [];
('Promise' in window) || features.push('Promise');
('IntersectionObserver' in window) || features.push('IntersectionObserver');
('after' in Element.prototype) || features.push('Element.prototype.after');
// If any features need to be polyfilled, construct
// a script tag to load the polyfills and append it
// to the document
if (features.length) {
var s = document.createElement('script');
// Include a `ua` argument set to a supported browser to skip UA identification
// (improves response time) and avoid being treated as unknown UA (which would
// otherwise result in no polyfills, even with `always`, if UA is unknown)
s.src = '{{host}}/v{{apiversion}}/polyfill.min.js?features='+features.join(',')+'&flags=gated,always&ua=chrome/50&callback=main';
s.async = true;
document.head.appendChild(s);
} else {
// If no polyfills are required, invoke the app
// without delay
main();
}
function main() {
console.log('Now to do the cool stuff...');
}
You can view the above example in a JSBin demo. Doing live feature detection in the browser is one of our oldest feature requests, and we hope to support this out of the box at some point. Follow issue 84 for updates.


{{ define "main" }} Recent Post “There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.” Jeff Atwood 点击阅读全文 “There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.” Jeff Atwood Hero title Hero subtitle {{ .Content }} {{ end }}
“There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.”
Jeff Atwood


# Documenting Lint Checks
Lint ships with a tool to generate documentation pages for lint
checks, both built-in ones as well as third party checks.
You can access the documentation driver directly via a
`java -jar` command, but it's also accessible indirectly via
the “lint” binary, which may be more convenient.
Here's the basic usage:
```shell
Usage: lint-issue-docs-generator [flags] --output ]
Flags:
--help This message.
--output Sets the path to write the documentation to.
Normally a directory, unless --single-doc is
also specified
--single-doc Instead of writing one page per issue into a
directory, write a single page containing
all the issues
--md Write to plain Markdown (.md) files instead
of Markdeep (.md.html)
--builtins Generate documentation for the built-in
issues. This is implied if --lint-jars is
not specified
--gmaven Generate documentation for the lint checks
found on maven.google.com.
--maven-central Generate documentation for a few well known
lint libraries distributed on Maven Central.
--lint-jars Read the lint issues from the specific path
(separated by : of custom jar files
--issues [issues] Limits the issues documented to the specific
(comma-separated) list of issue id's
--source-url Searches for the detector source code under
the given source folder or folders separated
by semicolons, and if found, prefixes the
path with the given URL prefix and includes
this source link in the issue
documentation.
--test-url Like --source-url, but for detector unit
tests instead. These must be named the same
as the detector class, plus `Test` as a
suffix.
--no-index Do not include index files
--no-suppress-info Do not include suppression information
--no-examples Do not include examples pulled from unit
tests, if found
--no-links Do not include hyperlinks to detector source
code
--no-severity Do not include the red, orange or green
informational boxes showing the severity of
each issue
```
(If you get “`-generate-docs does not exist`” you need to use a newer
version of lint.)
## Built-in Checks
Here's a sample invocation, where `$STUDIO` points to the root of the
Android Studio source tree (so `$STUDIO/tools/base/lint/ is the root of
the lint source code).
```shell
$ export LINT_URI_PREFIX=https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/
$ lint \
--generate-docs \
--output /tmp/lint-docs/ \
--builtins \
--source-url $LINT_URI_PREFIX $STUDIO/tools/base/lint \
--test-url $LINT_URI_PREFIX $STUDIO/tools/base/lint
```
Here, we use `--source-url` and `--test-url` to not only point the tool
to the right URLs to link to for access to the source code, but also
source locations to search to find the source files, which are then
mined for things like sample unit tests to include as examples in the
documentation.
## Custom Checks
You can generate documentation for third-party checks. To do this, use
the `lint-jars` flag to specify one or more jar file to scan for lint
checks. If your lint check are packaged as an AAR file, you can unzip
this file to find `lint.jar` inside.
## Special Conventions
If you include a test URL search path (and note that the URI prefix is
itself optional (though must be specified as an empty string), so you
could in the built-in example above only have specified `--testurl “”
lint/libs/lint-tests/src/test/java`), lint will search for the
corresponding unit tests. If found, it will try to extract “examples”
to include in the documentation.
This requires that
* The detector tests are located in a class named *Detector*`Test`,
such as `AlarmDetectorTest` for an issue whose implementation points
to `AlarmDetector`.
* This class is located in the folder predicted by the package of the
detector (even though Kotlin lets you place classes wherever you
want).
* The tests are using lint's test DSL, e.g.
`lint(files(...)).run().expect(...)`.
* Lint will then try to extract an example from the unit tests. It does
this by looking at the `expect` output, and if it finds an error with
the right id, it will then include this error output as well as the
source file mentioned in the error message as an example (along with
a message explaining that this test case was automatically
generated). Lint will only include a single source file (the one
pointed to by the error message) because we want to keep the example
straight and to the point, and many unit tests provide a lot of
“noise” to help make the test complete. For example, for the
RecyclerView tests, there are stub implementations of the API. There
are often manifest files and gradle files in tests too which are not
particularly interesting to the test scenario.
* However, in some cases you really do need to show multiple files to
illustrate the problem. For example, for the StringFormatDetector,
which points out an inconsistency between the parameters specified in
an XML formatting string and the usage from a String.format call in a
separate Kotlin file, the example really needs to include both.
Therefore, the documentation tool has support for a “curated”
example. If you name your unit test `testExample` or `example` or
`testDocumentationExample`, the tool will include this example, and
in this case `*all*` the source files and all the error output.
* Note that if you have a detector which reports multiple issues, you
can actually suffix the issue id to this name to scope it to the
specific example, e.g. for “SdCardPath”, the test name could be
`testDocumentationExampleSdCardPath`.
* Note also that you can include source files which are omitted from
the example if the source contains the string
`HIDE-FROM-DOCUMENTATION` somewhere, typically in a comment. This
is typically only needed for things like stubs and R classes to
make the test symbols resolve.
* By convention, the test class in the example uses the issue id as
its name when there isn't another obvious choice.
* To keep examples as short as possible, consider just using the
default package and even using fully qualified names in some places
to shorten the import list (as long as it doesn't hinder
readability for the relevant part of the example.)
* Consider also adding in some highlighting comment to point out the
problem. Many lint tests put `// ERROR` as a line suffix for
statements that produce an error, as well as `// OK` for statements
that should not (to verify no false positives, though this isn't
typical useful in an example.)
* Don't use the manifest DSL for constructing manifest files when
creating documentation samples; create an explicit manifest XML
file instead (using `manifest(...)`).
* Similarly, if you have a unit test for suppressing the error, you can
get this included as an example by naming the test exactly
`testSuppressExample` or `suppressExample`. Note that this is usually
not necessary; lint will include generic information about how to
suppress an element using the applicable mechanisms. But there may be
cases where the suppression mechanism has some special cases, and in
that scenario you might want to include an example.
!!! Tip
If you are developing a new lint check and want to review the
documentation that will be generated, you can also use the `--issues
` flag to limit the document generation to just a single check
(or a comma separated list of checks).


President Obama Explains Why The "Israel Wants War" Charge Makes No Sense
05 Aug 2015Ever since Prime Minister Netanyahu made his opposition to the Iran Deal clear, the Obama Administration has sought to portray any and all critics of the deal as warmongers. Worse, many have focused in on the Israeli opposition and tried to make it seem like Israel was trying to force America to wage a war on its behalf.
It isn’t just anonymous anti-Semites on Twitter who have been accusing Israel of preferring war over a good deal. Officials from the Obama White House have said that Israel and Netanyahu would never accept any deal, no matter how robust.
Today, President Obama has himself explained why such hysterical accusations are completely unfounded:
[Iran] will fight this asymmetrically [if war comes]. That means more support for terrorism, more Hezbollah rockets falling on Tel Aviv. I can assure that Israel will bear the brunt of the asymmetrical response that Iran will have to a military strike on its nuclear facilities.”
Since Iran is still developing its ICMBs that could reach the US (something that will continue unencumbered under this deal) the US will not be the main target of Iranian retaliation (though it would most definitely have American assets in the Middle East and Europe attacked, if not on the mainland, by terrorists).
Israel would bare the brunt of any Iranian response. Far from Americans dying for Israel, Israelis would be dying for America. Israelis would be living in bomb shelters as Hezbollah fires rockets from the north and Hamas and Islamic Jihad fire rockets from the south. Israel’s economy will grind to a halt as tourism dries up and half the country is called up to the reserves to deal with the threat.
This is not a situation any country would welcome and anyone telling you that Israel prefers this scenario to a deal that would prevent it and a nuclear Iran is lying to you. However since President Obama has invested so much energy in this deal and the idea that all opponents want war, even though he recognizes that this characterization is not just faulty but upside-down, he will not change his tune.
Israel has never wanted war, but that doesn’t mean it will commit suicide to avoid one.


480,000 people a year die from smoking-related deaths. Plus, if you live in the northern states standing outside in the cold miserable. Also you'll walk around smelling like an ashtray all day. Instead, Pick up a drug habit, less people die from doing hard drugs, Rockstars are known for hard drug use and they're pretty cool.  Try picking up drinking. First of all it's not illegal unless you decide to drive after, but that can be fun too!  But we get it, people need livers. You should try huffing paint, barely anyone dies from huffing paint, so have at it! Plus you can pick up a new art and craft while you're at Hobby Lobby.
125 people die a year from inhaling paint, plus it's a waste of good paint. Explore your social side, try having lots of unprotected sex! Birth control is for squares, and the south is pretty flexible on most things.
You should, STD's are gross, but totally worth it. You should try binge eating. Some studies show that some people like to eat more than they like to have sex, probably. Think of all the great food you've eaten, the dollar scoop chinese buffet, taco bell three times in a row, you know, the good stuff.
610,000 people die a year from heart disease. Plus, no one likes being out of breath walking to the fridge. You should pick up smoking, it cuts down cravings, it has zero calories, and it's a great way to meet people. Plus, have you ever seen Mad Men?  Don Draper is the man.


{% extends 'base.html' %} {% load bootstrap3 %} {% block content %}
Applying the AutoSchedule will schedule Events in EventSlots to match the result of the AutoScheduler calculation. Any existing autoscheduled Events will be unscheduled.


Demo of Reverse engineering of MS Patches
SABRE Security
An interesting demo of a MS patch being reversed engineered to make creation of an exploit simple.
This shows an good reason for installing any security patches as soon as possible.....
SABRE Security
An interesting demo of a MS patch being reversed engineered to make creation of an exploit simple.
This shows an good reason for installing any security patches as soon as possible.....
E-commerce now a turn-off - official | The Register
well not really, just growing more slowly.... But it's an interesting story all the same. It seems that, surprise surprise, Internet users are getting tired of all the phishing and spyware and viruses, and some are stopping useing the 'net for shopping and banking.
I actually think that this could become and accellerating trend. I don't see any magic bullets to make things easier for ordinary, non-technical, Internet users and without some sort of change more and more people will give up on using the 'net for e-commerce no matter how convenient it is.
The annoying thing is that this will hit all the banks and many retailers in the pocket, but because it's no one companies problem, none of them seem to be stepping up to take a lead in trying to combat this...
Network and IT Security Management Blog: Correlation Central - Network Security Blog: MasterCard PCI / SDP Framework
An interesting posting about the credit card industry's PCI security standard, and some commentary on it.
Interview with Marcus Ranum
There's a great interview with Marcus Ranum over at Securityfocus. It's obvious from the responses that he's been around in network security for a while and knows what's what..
Also there's a couple of great quotes...
in response to "If a standard protocol is broken or insecure, what is the best solution? Maybe supporting only some features or adding a crypto layer?"
If it's broken, adding crypto just makes it broken and hidden. is a classic...
also there's some interesting thoughts on de-perimeterisation and advocacy of data-level protection as the solution to all evils
Open Information Systems Security Group - Information Systems Security Assessment Framework (ISSAF) Draft 0.1
Link to a Pen Testing framework, looks interesting, but a little daunting to read at 1054 pages !!
Security breach may have exposed 40M credit cards | InfoWorld | News | 2005-06-17 | By Tom Krazit, IDG News Service
Another to add to this years seemingly endless stories of large companies sufferering losses of customer information, in this case CC info...
What I'm very interested to see is what actual penalties/negative consequences affect the companies responsible for these breaches, as I think it will shape some of the internal debate in companies that handle this kind of data about appropriate levels of security.
One thing that does seem to have happened is a loss of share price for choicepoint... looking at their stock graph their trading down about 20% from around the point when their breach was publisised....
Actually maybe that's worth looking at (getting a list of the breaches from privacyrights and comparing stock prices before/after)
SysWear :: Programming t-shirts
Cool looking line of geek t-shirts... I particularly like this one
Schneier on Security: Attack on the Bluetooth Pairing Process
Here's a note from Bruce Schneier on an interesting new attack on the bluetooth protocol (or more accurately common implementations of the protocol)...
Following this, if there are tools released which implement the attack, it'll really reduce where bluetooth should be used in corporate settings... all those lovely bluetooth headsets that people in the UK have bought...
CyMotion Linux Cherry Keyboard
Link to instructions to get the cool cherry linux keyboard working without using the supplied software (which appears to be Suse only).
Nice keyboard as well as having cute penguins on in :o)
GaryKessler.net Home Page
Excellent list of security Articles/URL's


- Assisted in overseeing development of a proof-of-concept service used for granting guest users access to HBO Go, internally titled Blackforest.
- Gathered and evaluated Blackforest's requirements with respect to those of the existing service it was intended to supersede.
- Successfully presented the green-light proposal for Blackforest to an audience of approx. 15 colleagues.
- Directly implemented a large portion of Blackforest’s frontend, using JavaScript and Node.js.
- Developed a web-based tool to conveniently retrieve and display the version information for approx. 430 servers used by HBO Go.


Alex Salmond court case: The charges in full
by Chris McCallAlex Salmond appeared in court today to face 14 sexual and indecent assault charges dating from his time as First Minister of Scotland.
The former SNP leader denies all allegations, which are said to have taken place between 2008 and 2014.

The charges span a period between 2008 and 2014, with one sexual assault said to have taken place in the month of the historic referendum.

Both incidents were said to have taken place between the date of the Edinburgh Agreement in 2012 and the day of the independence vote in September 2014.
Meanwhile, the first of the charges involved incidents where Salmond allegedly indecently assaulted a woman by kissing her mouth and groping her on various occasions around Glasgow in 2008
It is also alleged he sexually assaulted a woman on various occasions between 2011 and 2013 at the Scottish Parliament, Bute House and elsewhere by touching her bottom and stroking other parts of her body.
Salmond - who was Scotland's first minister from 2007 to 2014 - is also accused of taking off a woman's shoe and trying to kiss her foot in 2013.

Several charges involved the accused allegedly groping women, including one incident at the Ubiquitous Chip restaurant in Glasgow in 2012.


Angular is a development platform for building mobile and desktop
applications. Angular lets you extend HTML's syntax to express your application's components clearly
and
succinctly. Angular's binding and dependency injection eliminate much of the code you would otherwise
have to write.
Given an HTML file
Let's create an Angular app which replaces <hello-world> element with the application contents.
This can be done with 3 simple steps.
Creating angular app
Create an angular component
Create an angular module
Bootstrap the module
Step 1: Create component
Angular component is just a class. Properties and behavior can be added inside.
Component Anatomy - Inline Template
The class is adorned with a @Component decorator providing additional metadata to let the Angular know how
to
use it.
Decorators are a new feature of TypeScript. It comes from Python.
Component Anatomy - Inline Template
Selector defines the location of the component. When Angular renders this component, it'll find a <hello-world>
HTML element in the document and will render the component on top of it.
Component Anatomy - Inline Template
Template defines the HTML code that the component generates.
If the amount of HTML grows out of hand, it's possible to use templateUrl instead and
provide a path to a HTML file.
Exercise
In the next slide you'll create your first Angular component! We'll do all the wiring for you and the
result will look like this:
Hello World!
Create first Angular component!
Now our component is ready to go!
We need to put it in an NgModule
NgModules help organize an application into cohesive blocks of functionality.
Module Anatomy
Like a component, module is just a class.
Module Anatomy test
Like a component, module is adorned with a decorator providing metadata.
Module Anatomy
For a browser web app, you need to import BrowserModule.
Angular is not just for web apps anymore, it allows to create native phone apps and even VR
scenes.
Module Anatomy
In the declarations array, you tell Angular which components belong to the AppModule.
Module Anatomy
Component passed into the bootstrap section will be created and displayed in your index.html file.
Exercise
In the next slide you'll create your first Angular module! We'll use the component from the previous
exercises and will do all the wiring for you and the
result will look like this:
Hello World!
Now we got the component, we need to pass it to a NgModule.
Step 3
This is the last step. We have everything ready, just need to bootstrap our app!
Module Bootstrapping
The bootstrapping process sets up the execution environment, digs the root AppComponent out of the module's
bootstrap array, creates an instance of the component and inserts it within the element tag identified by the
component's selector.
Exercise
All set! In the next page you'll bootstrap your first Angular app!
Hello World!
Now we got both NgModule and component ready, let's bootstrap the app!
There's no simple way to test it, make sure your app displays: 'Hello CatTube!'
`
Result
Amazing! We just bootstraped our first component and learned about Angular on the way.
Let's take a look at the whole picture one more time.
Overview
index.html
main.ts
app.module.ts
app.component.ts
End of Bootstrap Section
Please leave your thoughts using the feedback button below!


[Name] aims to improve reading skills in early elementary school students.
[Name] generates reading comprehension questions based on inputted text.
Next, students' answers are graded according to (our ?) algorithms.
They receive immediate feedback via [Title],
and are prompted to refer back to highlighted sections of the text that they may need to work on.
This also allows gives students the opportunity to work independently while still receiving personalized feedback.
With [Name], parents, teachers, and students can work together to facilitate children's learning both in and out of the classroom.


[gecode-users] Disjunctions in gecode
Mikael Zayenz Lagerkvist
zayenz at gmail.com
Fri Sep 15 06:58:03 CEST 2006
For an example, see the file packing.cc, line 104-105.
http://www.gecode.org/gecode-doc-latest/packing_8cc-source.html#l00104
Cheers,
Mikael
On 9/15/06, Dhananjay Thiruvady <drthi1 at student.monash.edu> wrote:
> Hi All,
>
> I have a question about how I could implement a disjunction constraint in gecode. For example, if I have a interger variable x[0...20] and I want to post a constraint x<=5 || x>=6, how would I do this? I have seen the operator||() command which works with boolean variables, can the disjunction be achieved by extending this?
>
> Regards,
>
> Dhananjay
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
--
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
More information about the gecode-users
mailing list


In these early years, kids start experiencing what being a Jewish child is about, through games, crafts, storytelling, dance, and drama, with children their same age. They learn about the Jewish holiday cycle and biblical characters, and simple prayers and blessings. Lots of singing, lots of activities, lots of fun.
First grade is about making new friends and learning about the major Jewish holidays.
Second graders explore nature and ways of taking care of the earth and associated Jewish holidays and practices.
Third grade focuses on holiday traditions. By then, children will be able to discuss the meaning of courage as it applies to the story of the Maccabees and to their own sense of Jewish identity.
Grades 1–3 meet on Sunday morning at a public school in Winchester, a five-minute drive from the Temple.
Parent Community Organization
While children are in the classroom, parents can have a cup of coffee and relax at the Parent Café, organized by the Parent Community Organization (PCO), a confederation of parents involved in planning activities that connect parents with other parents in grades 1–3.


Social events
{% if social %}
{% for event in social %}
{{ event.date }}
{{ event.name }}
{{ event.strap_line }}
More info & tickets
{% if event.tickets %}You have {{ event.tickets }} ticket{% if event.tickets > 1 %}s{% endif %}{% endif %}
{% endfor %}
{% else %}
There are no social events at this time.
{% endif %}
Tournaments
{% if tournaments %}
{% for tour in tournaments %}
{% endfor %}
{% else %}
There are no tournaments at this time.
{% endif %}
{% endblock %}


On Tue, 2011-03-01 at 18:02 +0530, Abhishek Kona wrote:> Hi folks
>
> What is the best way to clear a Riak bucket of all key, values after
> running a test?
> I am currently using the Java HTTP API.
You can list the keys for the bucket and call delete for each. Or if you put the keys (and kept track of them in your test) you can delete them one at a time (without incurring the cost of calling list first.)
Something like:
String bucket = "my_bucket"; BucketResponse bucketResponse = riakClient.listBucket(bucket); RiakBucketInfo bucketInfo = bucketResponse.getBucketInfo(); for(String key : bucketInfo.getKeys()) { riakClient.delete(bucket, key); }
would do it.
See also
http://wiki.basho.com/REST-API.html#Bucket-operations
which says
"At the moment there is no straightforward way to delete an entire
Bucket. There is, however, an open ticket for the feature. To delete all
the keys in a bucket, you’ll need to delete them all individually."
>
> -Abhishek Kona
>
>
> _______________________________________________
> riak-users mailing list
><EMAIL_ADDRESS>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Delicious
THE BEST FOOD BLOG ON THE WEB
POSTED ON 15 DEC 2013/DESSERTS
For the fig swirl: Melt butter over medium heat in a saucepan. Add brown sugar and stir to dissolve. Halve all of the figs and toss in the saucepan with water and lemon juice. Cook over medium heat, stirring frequently, until you have a chunky-jammy mixture. Add salt with one or two stirs, set aside and let cool completely.
Ice Cream: In a small pot over medium heat, combine milk, and granulated sugar until sugar is completely dissolved and the milk is just barely lukewarm. Whisk in the egg yolks. Set mixture in the fridge and wait until the fig mixture is cooled.
Using an ice cream machine, pour liquids into the frozen basin and process according to manufacturer instructions, i.e., let spin and thicken for 20 minutes before adding mascarpone, fig jam mixture, and the nuts. Continue to process for +/- 10 minutes. Pour semi-frozen mixture into a pyrex dish or glass tupperware. freeze for at least two hours before serving.
Food enthusiast, photography fan. Add a pinch of raw foodism and that's pretty much who I am.


Fundamentals of
Data Analytics and
Predictions
Statistical Learning 2
Xi (Rossi) LUO
Department of Biostatistics and Data Science
School of Public Health
The University of Texas Health Science Center at Houston
Outline
- Inference vs. Prediction
- How to estimate $f$
- Assessing Model Accuracy
Prediction vs. Inference
- We often want to estimate the target function $f(X)$ either for prediction of $y$ or for
inference
- Prediction: predicting (future) $y$ for new $X$
- Inference: understand relationships between $X$ and $y$
- Examples: major risk factors for COVID death
Prediction
- When the inputs $X$ are available but the output $Y$ is hard to obtain (or will happen
sometime
in the future): $\hat Y=\hat f(X)$, where $\hat f$ represents our estimate for $f$, and
$\hat Y$ is the prediction for $Y$
- Note: The goal is to estimate $f$, given that there will be some error that will exist that
we cannot
reduce (e.g., some important variables that predict $Y$ are not measured at all or measured
imperfectly)
Prediction Examples
- $X_1, ..., X_p$ are characteristics of a patient when they come into the ICU after a traumatic
brain
injury; $Y$ is whether the patient will survive at discharge. Having a prediction of whether the
patient will survive can change the management of those patients.
- Have data of patient's blood sample that can be easily measured in a lab, $Y$ is a variable
encoding
the patient's risk for a severe adverse reaction to a particular drug. Can avoid giving the drug
in
question to patients who are at high risk of an adverse reaction.
Inference
- Interested in understanding the way that $Y$ is affected as $X_1, ..., X_p$ change
- Which predictors are associated with the response?
- What is the relationship between the response and each predictor?
- Can the relationship between $Y$ and each predictor be adequately summarized
using a linear equation, or is the relationship more complicated?
Inference Examples
- In a hypertension study, demographic and clinical characteristics are collected and we may
study whether blood pressure will increase or decrease at a follow-up date.
- Which demographic variables contribute to blood pressure increase?
- Is there a difference by race or gender?
- In the branding of a product that a customer might purchase based on variables such as
price, store location, discount levels, competition price, etc., the store might be
interested in how an individual variable (price of product) has on the sales.
Prediction vs. Inference
- Different methods for estimating $f$ may be more appropriate for each goal
- For inference, linear models allow for relatively simple and
interpretable inference, but may not be as accurate for predictions
- For prediction, non-linear models often give more accurate
predictions, but at the expense of a less interpretable model
How to estimate $f$
- Assume we have data on $n$ data points:
- $x_{ij}$ for the $i^{th}$ observation and $j^{th}$ predictor, where $i=1, ..., n$
and $j=1, ..., p$;
- $y_i$ represents the response variable for the $i^{th}$ observation
- Often refer to this data as the training data
- Goal: apply a statistical learning method to the training data to estimate the unknown
function $f$. These methods can be characterized as parametric or
nonparametric.
Notations
$$
X = \begin{pmatrix}
x_{11} & x_{12} & ... & x_{1p}\\
x_{21} & x_{22} & ... & x_{2p}\\
& & \vdots \\
x_{n1} & x_{n2} & ... & x_{np}\\
\end{pmatrix}
$$
- Rows: observations. Cols: variables
- Row vector $x_i$ for the $i$th obs, $(x_i, y_i)$ for both input and output data from obs $i$
- Random variable $X_j$ for the $j$th variable
Parametric Methods
- Assume the functional form of $f$ is linear. For example, linear in $X$:
$f(X)=\beta_0+\beta_1X_1+\beta_2X_2+...+\beta_pX_p$
- Using the training data, have to fit the model
- e.g. in linear regression, can use ordinary least squares or other methods to estimate the
coefficients
- Advantage:
- Simplifies the problem and interpretation
- Disadvantage:
- May oversimplify the problem where the model doesn't match the true unknown form of $f
\rightarrow$ poor estimate
Non-parametric Methods
- Do not make explicit assumptions about the functional form of f. Instead, find a function that
gets as close to the
data points as possible without being too rough or wiggly.
- Advantage:
- Have the potential to accurately fit a wider range of possible shapes for $f$.
- Disadvantage:
- A very large number of observations is required in order to obtain an accurate estimate for
$f$.
- Not easily interpretable as the parametric methods
Example
- Can fit a thin-plate spline to go through all of the data points exactly, but at the expense
of being a rougher
surface of the $X$ space. However, we can vary the amount of smoothness.
- ISL Figure 2.4 vs 2.5 vs 2.6
Trade-off between Prediction Accuracy and Model Interpretability
Assessing Model Accuracy
- Not one method dominates all others over all possible data sets. Therefore, important to have a
set of tools and be
able to assess which works best on a particular dataset
- The assessment of model accuracy is different for the regression setting versus
for the classification setting
Measuring the Quality of Fit: Regression Setting
- Most commonly-used measure is the mean squared error (MSE), given by
$MSE=\frac{1}{n}\sum_{i=1}^{n}(y_i-\hat{f}(x_i))^2$
- If the predicted responses are very close to the true responses, the MSE will be small
- Note: We are most interested in MSE for future patients, not for the training data
- Typical data-generating model: $y = f(x) + \epsilon$
Training vs Testing
- Training data: a subset of observations used for fitting the model parameters
- Testing data: a different subset not used for fitting the model
Measuring the Quality of Fit: Regression Setting
- What if have 10 different models and have the MSE on the training set. Would you
choose the one
that has the lowest MSE as your best model?
Training MSE (gray), testing (red), underlying relationship
non-lineear, orange square-linear reg, blue/green-splines, cf Fig 2.10
Bias and Var Trade-off
- On testing data point $x_0$
$$
\begin{multline*}
E (y_0 - \hat{f}(x_0))^2 = \mbox{Var}(\hat{f}(x_0) ) \\ + [\mbox{Bias}(\hat{f}(x_0))]^2 +
\mbox{Var}(\epsilon)
\end{multline*}
$$
- Ideally, expect $\hat{f}$ not varying too much across different training
- $\mbox{Var}(\epsilon)$ cannot be reduced, irreducible error
- Goal to reduce the sum of the first two
$$
\mbox{Var}(\hat{f}(x_0) ) + [\mbox{Bias}(\hat{f}(x_0))]^2
$$
Intuition
- Bias: difference between your model $\hat{f}$ and true $f$
- Variance: changes due to training data change
- In general, more flexible, more variance, less bias
Measuring the Quality of Fit: Regression Setting
- We will discuss different ways to choose models in future lectures. They include:
- Having a test set
- cross-validation
Measuring the Quality of Fit: Classification Setting
- In classification, $y_i$ is categorical (qualitative)
$$
\mbox{Training error rate} = \frac{1}{n}\sum_{i=1}^{n}I(y_i\not=\hat{y}_i)
$$
- Compute the fraction of incorrect classifications in training data. More interested in test
error rate
Measuring the Quality of Fit: Classification Setting
$$
\mbox{Test error rate}=Ave(I(y_0\not=\hat{y}_0))
$$
Average over a reasonable size of testing data while the model is fixed
Example
| Predicted |
Actual |
| L |
L |
| M |
H |
| M |
M |
| H |
H |
| L |
M |
| H |
M |
| M |
M |
Respond at PollEv.com/rossiluo765
or text ROSSILUO765 to 37607
Bayes Classifier
- The minimum test error rate is given by Bayes classifier:
Assign a test observation with predictor vector $x_0$ to the class $j$ for which $Pr(Y=j|X=x_0)$
is largest
- If have a simulated data set, can compute the minimum error using the Bayes error rate. However,
for real data we do not know the conditional distribution of $Y$ given $X$, so cannot
compute the Bayes classifier (theoretical minimum).
- However, many methods try to emulate this process by estimating $Pr(Y=j|X=x_0)$ and then
classifying the observation to the class with highest probability.
Nearest Neighbor
- Memory-based (no model is fit)
- Use points closest in the predictor space $X$ to obtain an estimate of $Y$.
- K Nearest Neighbor method (KNN): $Pr(Y=j|X=x_0)=\frac{1}{K}\sum_{i\in N_k(x)}{}I(y_i=j)$
- Where $N_k(x)$ is a neighborhood containing the k-nearest points to $x$.
- Majority class rules.
Nearest Neighbor
- Typically standardize the variables to have mean 0, variance 1.
- $\hat{f}(x)=Ave(y_i|x_i\in N_k(x))$ estimates the regression function $E(Y|X=x)$
- Can use Euclidean distance in the feature space to define the distance from some point $x_0$ to
all other points in the training set:
$d_{(i)}=\lVert x_{(i)}-x_0 \rVert=\sqrt{(x_{(i)}-x_0)^2}$
- Other distance measures appropriate for qualitative and ordinal data
Nearest Neighbor Example
Nearest Neighbor Example
Nearest Neighbor Example
Nearest Neighbor Example
How do we choose k?
- Smaller k
- Give more flexible estimates
- Too much flexibility can result in over-fitting
- More variance of estimates
- Larger k
- More stable estimates
- Not as flexible (biased)
- Smallest choice is 1-nearest neighbor
- Largest choice is N-nearest neighbor
Neighborhood in High Dimensions
- Imagine we have equally spaced data and that each covariate is in $[0,1]$.
- If want to use an algorithm like kNN, focusing on the points that are local to where we want to
predict, could use the $10\%$ of the data that is local.
- If we have $p$ covariate and are forming $p$-dimensional cubes, then each side of the cube must
have size $l$ determined by $l\times l\times ...\times l=l^p=0.10$.
Effects of Increasing Dimensionality
- 2 covariates, $l^2=0.10$, so $l=0.316$.
- If have 3 covariates: $l = 0.46$
Effects of Increasing Dimensionality
- If have 10 covariates, $l=0.1^\frac{1}{10}=0.8$.
- If we use only 1% of the data that is local:
- If have 10 covariates, $l=0.1^\frac{1}{10}=0.63$
- If have 50 covariates, $l=0.1^\frac{1}{50}=0.91$
- Curse of Dimensionality!
- Almost all points on the boundary
- How about large $n$? Should we use kNN?
Summary
- Choosing the amount of flexibility is critical to the success of any statistical learning
method.
- As flexibility (model complexity) increases, the test set error decreases, but then starts to
increase. Finding the “sweet spot” will be a main task in this course.
- Test MSE/error vs flexibility usually U-shaped


Marius Hoggenmueller, Alexander Wiethoff and Martin Tomitsch. „Sketching-in-Light: Enabling Hybrid Prototyping of Low-Resolution Lighting Displays“ In Proceedings of the Eleventh International Conference on Tangible, Embedded, and Embodied Interaction. 2017.


You should know that the following sensor(s) are indicating that there is a problem that needs your attention
{}
Please correct these issues by logging into your
Your Website
and making the necessary adjustments


4. Using CluBCpG with PReLIM¶
4.1. Introduction¶
PReLIM exists as its own stand-alone package, but for simplicity and compatibility, a version of PReLIM comes bundled with CluBCpG.
Imputation with PReLIM is taken care of behind the scenes and CluBCpG includes three command line scripts to perform analysis with imputation.
Usage is almost identical to standard CluBCpG pipeline, but includes one extra step and requires the use of a couple extra command line flags.
The documentation included in this section mostly highlights the differences and additional steps needed to run CluBCpG with PReLIM imputation.
Note
It is highly recommended that you have read Using CluBCpG first.
The command-tools provided are clubcpg-impute-coverage
, clubcpg-impute-train
, and clubcpg-impute-cluster
4.2. Typical imputation workflow¶
4.2.1. Calculate bin coverage¶
Use clubcpg-coverage
to calculate bin coverage as performed in the standard workflow. (Typical workflow)
4.2.2. Filter outputs¶
Filter these csv outputs for >= 1 reads and >= 2 CpGs. The following one-liner will filter it correctly:
cat CompleteBins.yourfilename.chr19.csv | awk -F "," '$2>=1 && $3>=2' > CompleteBins.yourfilename.chr19.filtered.csv
But as before, you can filter this with any other method you like.
Note
PReLIM requires at least 1 read fully covering all CpGs in a bin
Note
Differing from the typical workflow, if you intend to analyze two BAM files with imputation, you will want to perform this process on both BAM files. This is because you will train an imputation model using both BAM files separately. This improves the accuracy of the imputations.
4.2.3. Train a PReLIM model¶
Now clubcpg-impute-train
can be used to automatically train multiple imputation models using PReLIM. For each BAM file, a random set of bins
will be selected from the filtered coverage file provided.
The number of randomly sampled bins can be set using the -l
flag.
Warning
Increasing the number of bins will drastically increase the run-time of this process and can consume a lot of memory, potentially crashing PReLIM. When testing we found there was no improvement in accuracy above 10,000 bins.
Models bins containing 2-5 CpGs will be automatically trained and saved in the folder designated by -o
. Do NOT rename them.
4.2.4. Compute coverage gains¶
Now with the trained models saved, the post-imputation coverage can be calculated using clubcpg-impute-coverage
. This
functions almost identically to clubcpg-coverage
except:
you need to provide the folder containing the saved models using the
-m
flag.You also need to provide the coverage file filtered for >= 1 reads with the
-c
flag.This accelerates the process by skipping bins which cannot be imputed upon do to lack of coverage.
This will create an output file identical to clubcpg-coverage
, except the values represent the number of reads post-imputation
4.2.5. Filter imputed coverage output¶
Filter this csv output however you wish. Again, we recommend 10 reads and 2 cpgs. See Filter output for more details.
4.2.6. Perform clustering with imputation¶
Using clubcpg-impute-cluster
you can now perform read clustering. This also functions almost identically to the standard method.
However, you must also point it to the folder containing the models.
Here you use the --models_A
and --models_B
flags to point the tool to PReLIM models for input -a
and -b
respectively. Imputation on each file
is performed independent of the other.
4.3. Command line tools¶
These options can also be viewed by running --help
after each tool on the command line.
4.3.1. clubcpg-impute-train¶
usage: clubcpg-impute-train [-h] [-a INPUT_BAM_FILE] [-c COVERAGE] [-o OUTPUT]
[-n N] [-l LIMIT_SAMPLES] [--read1_5 READ1_5]
[--read1_3 READ1_3] [--read2_5 READ2_5]
[--read2_3 READ2_3]
-
-h
,
--help
¶
show this help message and exit
-
-a
<input_bam_file>
,
--input_bam_file
<input_bam_file>
¶ Input bam file, coordinate sorted with index present
-
-c
<coverage>
,
--coverage
<coverage>
¶ output file from clubcpg-coverage, filtered for at least 1 read and 2 cpgs
-
-o
<output>
,
--output
<output>
¶ folder to save generated model files
-
-n
<n>
¶ number of cpu cores to use
-
-l
<limit_samples>
,
--limit_samples
<limit_samples>
¶ Limit the number of samples used to train the model, this will speed up training. default=10000
-
--read1_5
<read1_5>
¶ integer, read1 5’ m-bias ignore bp, default=0
-
--read1_3
<read1_3>
¶ integer, read1 3’ m-bias ignore bp, default=0
-
--read2_5
<read2_5>
¶ integer, read2 5’ m-bias ignore bp, default=0
-
--read2_3
<read2_3>
¶ integer, read2 3’ m-bias ignore bp, default=0
4.3.2. clugcpg-impute-coverage¶
usage: clugcpg-impute-coverage [-h] [-a INPUT_BAM_FILE] [-c COVERAGE]
[-m MODELS] [-o OUTPUT] [-n N]
[-chr CHROMOSOME] [--read1_5 READ1_5]
[--read1_3 READ1_3] [--read2_5 READ2_5]
[--read2_3 READ2_3]
-
-h
,
--help
¶
show this help message and exit
-
-a
<input_bam_file>
,
--input_bam_file
<input_bam_file>
¶ Input bam file, coordinate sorted with index present
-
-c
<coverage>
,
--coverage
<coverage>
¶ output file from clubcpg-coverage, filtered for at least 1 read and 2 cpgs
-
-m
<models>
,
--models
<models>
¶ Path to folder containing saved models
-
-o
<output>
,
--output
<output>
¶ folder to save imputed coverage data
-
-n
<n>
¶ number of cpu cores to use
-
-chr
<chromosome>
,
--chromosome
<chromosome>
¶ Optional, perform only on one chromosome. Default=all chromosomes provided in -c. Example: ‘chr7’
-
--read1_5
<read1_5>
¶ integer, read1 5’ m-bias ignore bp, default=0
-
--read1_3
<read1_3>
¶ integer, read1 3’ m-bias ignore bp, default=0
-
--read2_5
<read2_5>
¶ integer, read2 5’ m-bias ignore bp, default=0
-
--read2_3
<read2_3>
¶ integer, read2 3’ m-bias ignore bp, default=0
4.3.3. clubcpg-impute-cluster¶
usage: clubcpg-impute-cluster [-h] [-a INPUT_BAM_A] [-b INPUT_BAM_B]
[--bins BINS] [-o OUTPUT_DIR]
[--bin_size BIN_SIZE]
[-m CLUSTER_MEMBER_MINIMUM] [-r READ_DEPTH]
[-n NUM_PROCESSORS] [--read1_5 READ1_5]
[--read1_3 READ1_3] [--read2_5 READ2_5]
[--read2_3 READ2_3] [--no_overlap [NO_OVERLAP]]
[--remove_noise [REMOVE_NOISE]]
[--suffix SUFFIX] [--models_A MODELS_A]
[--models_B MODELS_B] [--chunksize CHUNKSIZE]
-
-h
,
--help
¶
show this help message and exit
-
-a
<input_bam_a>
,
--input_bam_A
<input_bam_a>
¶ First Input bam file, coordinate sorted with index present, REQUIRED
-
-b
<input_bam_b>
,
--input_bam_B
<input_bam_b>
¶ Second Input bam file, coordinate sorted with index present, OPTIONAL
-
--bins
<bins>
¶ File with each line being one bin to extract and analyze, generated by clubcpg-coverage, REQUIRED
-
-o
<output_dir>
,
--output_dir
<output_dir>
¶ Output directory to save figures, defaults to bam file location
-
--bin_size
<bin_size>
¶ Size of bins to extract and analyze, default=100
-
-m
<cluster_member_minimum>
,
--cluster_member_minimum
<cluster_member_minimum>
¶ Minimum number of members a cluster should have for it to be considered, default=4
-
-r
<read_depth>
,
--read_depth
<read_depth>
¶ Minium number of reads covering all CpGs that the bins should have to analyze, default=10
-
-n
<num_processors>
,
--num_processors
<num_processors>
¶ Number of processors to use for analysis, default=1
-
--read1_5
<read1_5>
¶ integer, read1 5’ m-bias ignore bp, default=0
-
--read1_3
<read1_3>
¶ integer, read1 3’ m-bias ignore bp, default=0
-
--read2_5
<read2_5>
¶ integer, read2 5’ m-bias ignore bp, default=0
-
--read2_3
<read2_3>
¶ integer, read2 3’ m-bias ignore bp, default=0
-
--no_overlap
<no_overlap>
¶ bool, remove any overlap between paired reads and stitch reads together when possible, default=True
-
--remove_noise
<remove_noise>
¶ bool, Discard the cluster containing noise points (-1) after clustering, default=True
-
--suffix
<suffix>
¶ Any additional info to include in the output file name, chromosome for example
-
--models_A
<models_a>
¶ Models to impute for input_bam_A, OPTIONAL
-
--models_B
<models_b>
¶ Models to impute for imput_bam_B, OPTIONAL
-
--chunksize
<chunksize>
¶ How large of chunks to split bins into during imputation. Higher will go faster, but uses more memory