text:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.2">
<title>Packfile transfer protocols</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
/* Remove the comments around the @import statement below when using this as a custom stylesheet */
/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body{margin:0}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
h1{font-size:2em;margin:.67em 0}
abbr[title]{border-bottom:1px dotted}
b,strong{font-weight:bold}
dfn{font-style:italic}
hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
mark{background:#ff0;color:#000}
code,kbd,pre,samp{font-family:monospace;font-size:1em}
pre{white-space:pre-wrap}
q{quotes:"\201C" "\201D" "\2018" "\2019"}
small{font-size:80%}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-.5em}
sub{bottom:-.25em}
img{border:0}
svg:not(:root){overflow:hidden}
figure{margin:0}
fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0}
button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
button,input{line-height:normal}
button,select{text-transform:none}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
#map_canvas img,#map_canvas embed,#map_canvas object,.map_canvas img,.map_canvas embed,.map_canvas object{max-width:none!important}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
.text-right{text-align:right!important}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
.antialiased,body{-webkit-font-smoothing:antialiased}
img{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
a{color:#2156a5;text-decoration:underline;line-height:inherit}
a:hover,a:focus{color:#1d4b8f}
a img{border:none}
p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
p aside{font-size:.875em;line-height:1.35;font-style:italic}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
h1{font-size:2.125em}
h2{font-size:1.6875em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
h4,h5{font-size:1.125em}
h6{font-size:1em}
hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
em,i{font-style:italic;line-height:inherit}
strong,b{font-weight:bold;line-height:inherit}
small{font-size:60%;line-height:inherit}
code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
ul,ol,ul.no-bullet,ol.no-bullet{margin-left:1.5em}
ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
ul.square{list-style-type:square}
ul.circle{list-style-type:circle}
ul.disc{list-style-type:disc}
ul.no-bullet{list-style:none}
ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
dl dt{margin-bottom:.3125em;font-weight:bold}
dl dd{margin-bottom:1.25em}
abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
abbr{text-transform:none}
blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
blockquote cite:before{content:"\2014 \0020"}
blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
h4{font-size:1.4375em}}table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7;font-weight:bold}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
.clearfix:after,.float-group:after{clear:both}
*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
.keyseq{color:rgba(51,51,51,.8)}
kbd{display:inline-block;color:rgba(0,0,0,.8);font-size:.75em;line-height:1.4;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:-.15em .15em 0 .15em;padding:.2em .6em .2em .5em;vertical-align:middle;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menu{color:rgba(0,0,0,.8)}
b.button:before,b.button:after{position:relative;top:-1px;font-weight:400}
b.button:before{content:"[";padding:0 3px 0 2px}
b.button:after{content:"]";padding:0 2px 0 3px}
p a>code:hover{color:rgba(0,0,0,.9)}
#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table}
#header:after,#content:after,#footnotes:after,#footer:after{clear:both}
#content{margin-top:1.25em}
#content:before{content:none}
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}
#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
#header .details span:first-child{margin-left:-.125em}
#header .details span.email a{color:rgba(0,0,0,.85)}
#header .details br{display:none}
#header .details br+span:before{content:"\00a0\2013\00a0"}
#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
#header .details br+span#revremark:before{content:"\00a0|\00a0"}
#header #revnumber{text-transform:capitalize}
#header #revnumber:after{content:"\00a0"}
#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}
#toc>ul{margin-left:.125em}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
#toc.toc2 #toctitle{margin-top:0;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
body.toc2.toc-right{padding-left:0;padding-right:20em}}#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
.sect1{padding-bottom:.625em}
@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0}
.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)}
table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;width:80px}
.admonitionblock>table td.icon img{max-width:none}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
.listingblock>.content{position:relative}
.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
.listingblock:hover code[data-lang]:before{display:block}
.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
.quoteblock blockquote{margin:0;padding:0;border:0}
.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}
.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}
.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}
.quoteblock .quoteblock blockquote:before{display:none}
.verseblock{margin:0 1em 1.25em 1em}
.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
.verseblock pre strong{font-weight:400}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.05em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
table.spread{width:100%}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all th.tableblock,table.grid-all td.tableblock{border-width:0 1px 1px 0}
table.grid-all tfoot>tr>th.tableblock,table.grid-all tfoot>tr>td.tableblock{border-width:1px 1px 0 0}
table.grid-cols th.tableblock,table.grid-cols td.tableblock{border-width:0 1px 0 0}
table.grid-all *>tr>.tableblock:last-child,table.grid-cols *>tr>.tableblock:last-child{border-right-width:0}
table.grid-rows th.tableblock,table.grid-rows td.tableblock{border-width:0 0 1px 0}
table.grid-all tbody>tr:last-child>th.tableblock,table.grid-all tbody>tr:last-child>td.tableblock,table.grid-all thead:last-child>tr>th.tableblock,table.grid-rows tbody>tr:last-child>th.tableblock,table.grid-rows tbody>tr:last-child>td.tableblock,table.grid-rows thead:last-child>tr>th.tableblock{border-bottom-width:0}
table.grid-rows tfoot>tr>th.tableblock,table.grid-rows tfoot>tr>td.tableblock{border-width:1px 0 0 0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
table.frame-topbot{border-width:1px 0}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
th.valign-top,td.valign-top{vertical-align:top}
th.valign-bottom,td.valign-bottom{vertical-align:bottom}
th.valign-middle,td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
p.tableblock>code:only-child{background:none;padding:0}
p.tableblock{font-size:1em}
td>div.verse{white-space:pre}
ol{margin-left:1.75em}
ul li ol{margin-left:1.5em}
dl dd{margin-left:1.125em}
dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
ul.unstyled,ol.unnumbered,ul.checklist,ul.none{list-style-type:none}
ul.unstyled,ol.unnumbered,ul.checklist{margin-left:.625em}
ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1em;font-size:.85em}
ul.checklist li>p:first-child>input[type="checkbox"]:first-child{width:1em;position:relative;top:1px}
ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden}
ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block}
ul.inline>li>*{display:block}
.unstyled dl dt{font-weight:400;font-style:normal}
ol.arabic{list-style-type:decimal}
ol.decimal{list-style-type:decimal-leading-zero}
ol.loweralpha{list-style-type:lower-alpha}
ol.upperalpha{list-style-type:upper-alpha}
ol.lowerroman{list-style-type:lower-roman}
ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
td.hdlist1{padding-right:.75em;font-weight:bold}
td.hdlist1,td.hdlist2{vertical-align:top}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist>table tr>td:first-of-type{padding:0 .75em;line-height:1}
.colist>table tr>td:last-of-type{padding:.25em 0}
.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0}
.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em}
.imageblock>.title{margin-bottom:0}
.imageblock.thumb,.imageblock.th{border-width:6px}
.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
a.image{text-decoration:none}
span.footnote,span.footnoteref{vertical-align:super;font-size:.875em}
span.footnote a,span.footnoteref a{text-decoration:none}
span.footnote a:active,span.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
#footnotes .footnote{padding:0 .375em;line-height:1.3;font-size:.875em;margin-left:1.2em;text-indent:-1.2em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
.gist .file-data>table td.line-data{width:99%}
div.unbreakable{page-break-inside:avoid}
.big{font-size:larger}
.small{font-size:smaller}
.underline{text-decoration:underline}
.overline{text-decoration:overline}
.line-through{text-decoration:line-through}
.aqua{color:#00bfbf}
.aqua-background{background-color:#00fafa}
.black{color:#000}
.black-background{background-color:#000}
.blue{color:#0000bf}
.blue-background{background-color:#0000fa}
.fuchsia{color:#bf00bf}
.fuchsia-background{background-color:#fa00fa}
.gray{color:#606060}
.gray-background{background-color:#7d7d7d}
.green{color:#006000}
.green-background{background-color:#007d00}
.lime{color:#00bf00}
.lime-background{background-color:#00fa00}
.maroon{color:#600000}
.maroon-background{background-color:#7d0000}
.navy{color:#000060}
.navy-background{background-color:#00007d}
.olive{color:#606000}
.olive-background{background-color:#7d7d00}
.purple{color:#600060}
.purple-background{background-color:#7d007d}
.red{color:#bf0000}
.red-background{background-color:#fa0000}
.silver{color:#909090}
.silver-background{background-color:#bcbcbc}
.teal{color:#006060}
.teal-background{background-color:#007d7d}
.white{color:#bfbfbf}
.white-background{background-color:#fafafa}
.yellow{color:#bfbf00}
.yellow-background{background-color:#fafa00}
span.icon>.fa{cursor:default}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c}
.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900}
.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400}
.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000}
.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
.conum[data-value]+b{display:none}
.conum[data-value]:after{content:attr(data-value)}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
h1,h2{letter-spacing:-.01em}
dt,th.tableblock,td.content{text-rendering:optimizeLegibility}
p,td.content{letter-spacing:-.01em}
p strong,td.content strong{letter-spacing:-.005em}
p,blockquote,dt,td.content{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
.print-only{display:none!important}
@media print{@page{margin:1.25cm .75cm}
*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]:after{content:" (" attr(title) ")"}
pre,blockquote,tr,img{page-break-inside:avoid}
thead{display:table-header-group}
img{max-width:100%!important}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}
.sect1{padding-bottom:0!important}
.sect1+.sect1{border:0!important}
#header>h1:first-child{margin-top:1.25rem}
body.book #header{text-align:center}
body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0}
body.book #header .details{border:0!important;display:block;padding:0!important}
body.book #header .details span:first-child{margin-left:0!important}
body.book #header .details br{display:block}
body.book #header .details br+span:before{content:none!important}
body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
.listingblock code[data-lang]:before{display:block}
#footer{background:none!important;padding:0 .9375em}
#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em}
.hide-on-print{display:none!important}
.print-only{display:block!important}
.hide-for-print{display:none!important}
.show-for-print{display:inherit!important}}
</style>
</head>
<body class="article">
<div id="header">
<h1>Packfile transfer protocols</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Git supports transferring data in packfiles over the ssh://, git://, http:// and
file:// transports.  There exist two sets of protocols, one for pushing
data from a client to a server and another for fetching data from a
server to a client.  The three transports (ssh, git, file) use the same
protocol to transfer data. http is documented in http-protocol.txt.</p>
</div>
<div class="paragraph">
<p>The processes invoked in the canonical Git implementation are <em>upload-pack</em>
on the server side and <em>fetch-pack</em> on the client side for fetching data;
then <em>receive-pack</em> on the server and <em>send-pack</em> on the client for pushing
data.  The protocol functions to have a server tell a client what is
currently on the server, then for the two to negotiate the smallest amount
of data to send in order to fully update one or the other.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_transports">Transports</h2>
<div class="sectionbody">
<div class="paragraph">
<p>There are three transports over which the packfile protocol is
initiated.  The Git transport is a simple, unauthenticated server that
takes the command (almost always <em>upload-pack</em>, though Git
servers can be configured to be globally writable, in which <em>receive-
pack</em> initiation is also allowed) with which the client wishes to
communicate and executes it and connects it to the requesting
process.</p>
</div>
<div class="paragraph">
<p>In the SSH transport, the client just runs the <em>upload-pack</em>
or <em>receive-pack</em> process on the server over the SSH protocol and then
communicates with that invoked process over the SSH connection.</p>
</div>
<div class="paragraph">
<p>The file:// transport runs the <em>upload-pack</em> or <em>receive-pack</em>
process locally and communicates with it over a pipe.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_git_transport">Git Transport</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Git transport starts off by sending the command and repository
on the wire using the pkt-line format, followed by a NUL byte and a
hostname parameter, terminated by a NUL byte.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>0032git-upload-pack /project.git\0host=myserver.com\0</pre>
</div>
</div>
<div class="openblock">
<div class="content">
<div class="literalblock">
<div class="content">
<pre>git-proto-request = request-command SP pathname NUL [ host-parameter NUL ]
request-command   = "git-upload-pack" / "git-receive-pack" /
            "git-upload-archive"   ; case sensitive
pathname          = *( %x01-ff ) ; exclude NUL
host-parameter    = "host=" hostname [ ":" port ]</pre>
</div>
</div>
</div>
</div>
<div class="paragraph">
<p>Only host-parameter is allowed in the git-proto-request. Clients
MUST NOT attempt to send additional parameters. It is used for the
git-daemon name based virtual hosting.  See --interpolated-path
option to git daemon, with the %H/%CH format characters.</p>
</div>
<div class="paragraph">
<p>Basically what the Git client is doing to connect to an <em>upload-pack</em>
process on the server side over the Git protocol is this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>$ echo -e -n \
  "0039git-upload-pack /schacon/gitbook.git\0host=example.com\0" |
  nc -v example.com 9418</pre>
</div>
</div>
<div class="paragraph">
<p>If the server refuses the request for some reasons, it could abort
gracefully with an error message.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  error-line     =  PKT-LINE("ERR" SP explanation-text)</pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_ssh_transport">SSH Transport</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Initiating the upload-pack or receive-pack processes over SSH is
executing the binary on the server via SSH remote execution.
It is basically equivalent to running this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>$ ssh git.example.com "git-upload-pack '/project.git'"</pre>
</div>
</div>
<div class="paragraph">
<p>For a server to support Git pushing and pulling for a given user over
SSH, that user needs to be able to execute one or both of those
commands via the SSH shell that they are provided on login.  On some
systems, that shell access is limited to only being able to run those
two commands, or even just one of them.</p>
</div>
<div class="paragraph">
<p>In an ssh:// format URI, it’s absolute in the URI, so the <em>/</em> after
the host name (or port number) is sent as an argument, which is then
read by the remote git-upload-pack exactly as is, so it’s effectively
an absolute path in the remote filesystem.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>   git clone ssh://user@example.com/project.git
        |
        v
ssh user@example.com "git-upload-pack '/project.git'"</pre>
</div>
</div>
<div class="paragraph">
<p>In a "user@host:path" format URI, its relative to the user’s home
directory, because the Git client will run:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>   git clone user@example.com:project.git
          |
          v
ssh user@example.com "git-upload-pack 'project.git'"</pre>
</div>
</div>
<div class="paragraph">
<p>The exception is if a <em>~</em> is used, in which case
we execute it without the leading <em>/</em>.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>   ssh://user@example.com/~alice/project.git,
          |
          v
ssh user@example.com "git-upload-pack '~alice/project.git'"</pre>
</div>
</div>
<div class="paragraph">
<p>A few things to remember here:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The "command name" is spelled with dash (e.g. git-upload-pack), but
this can be overridden by the client;</p>
</li>
<li>
<p>The repository path is always quoted with single quotes.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_fetching_data_from_a_server">Fetching Data From a Server</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When one Git repository wants to get data that a second repository
has, the first can <em>fetch</em> from the second.  This operation determines
what data the server has that the client does not then streams that
data down to the client in packfile format.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_reference_discovery">Reference Discovery</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When the client initially connects the server will immediately respond
with a listing of each reference it has (all branches and tags) along
with the object name that each reference currently points to.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>$ echo -e -n "0039git-upload-pack /schacon/gitbook.git\0host=example.com\0" |
   nc -v example.com 9418
00887217a7c7e582c46cec22a130adf4b9d7d950fba0 HEAD\0multi_ack thin-pack
     side-band side-band-64k ofs-delta shallow no-progress include-tag
00441d3fcd5ced445d1abc402225c0b8a1299641f497 refs/heads/integration
003f7217a7c7e582c46cec22a130adf4b9d7d950fba0 refs/heads/master
003cb88d2441cac0977faf98efc80305012112238d9d refs/tags/v0.9
003c525128480b96c89e6418b1e40909bf6c5b2d580f refs/tags/v1.0
003fe92df48743b7bc7d26bcaabfddde0a1e20cae47c refs/tags/v1.0^{}
0000</pre>
</div>
</div>
<div class="paragraph">
<p>Server SHOULD terminate each non-flush line using LF ("\n") terminator;
client MUST NOT complain if there is no terminator.</p>
</div>
<div class="paragraph">
<p>The returned response is a pkt-line stream describing each ref and
its current value.  The stream MUST be sorted by name according to
the C locale ordering.</p>
</div>
<div class="paragraph">
<p>If HEAD is a valid ref, HEAD MUST appear as the first advertised
ref.  If HEAD is not a valid ref, HEAD MUST NOT appear in the
advertisement list at all, but other refs may still appear.</p>
</div>
<div class="paragraph">
<p>The stream MUST include capability declarations behind a NUL on the
first ref. The peeled value of a ref (that is "ref^{}") MUST be
immediately after the ref itself, if presented. A conforming server
MUST peel the ref if it’s an annotated tag.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  advertised-refs  =  (no-refs / list-of-refs)
		      *shallow
		      flush-pkt

  no-refs          =  PKT-LINE(zero-id SP "capabilities^{}"
		      NUL capability-list LF)

  list-of-refs     =  first-ref *other-ref
  first-ref        =  PKT-LINE(obj-id SP refname
		      NUL capability-list LF)

  other-ref        =  PKT-LINE(other-tip / other-peeled)
  other-tip        =  obj-id SP refname LF
  other-peeled     =  obj-id SP refname "^{}" LF

  shallow          =  PKT-LINE("shallow" SP obj-id)

  capability-list  =  capability *(SP capability)
  capability       =  1*(LC_ALPHA / DIGIT / "-" / "_")
  LC_ALPHA         =  %x61-7A</pre>
</div>
</div>
<div class="paragraph">
<p>Server and client MUST use lowercase for obj-id, both MUST treat obj-id
as case-insensitive.</p>
</div>
<div class="paragraph">
<p>See protocol-capabilities.txt for a list of allowed server capabilities
and descriptions.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_packfile_negotiation">Packfile Negotiation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>After reference and capabilities discovery, the client can decide to
terminate the connection by sending a flush-pkt, telling the server it can
now gracefully terminate, and disconnect, when it does not need any pack
data. This can happen with the ls-remote command, and also can happen when
the client already is up-to-date.</p>
</div>
<div class="paragraph">
<p>Otherwise, it enters the negotiation phase, where the client and
server determine what the minimal packfile necessary for transport is,
by telling the server what objects it wants, its shallow objects
(if any), and the maximum commit depth it wants (if any).  The client
will also send a list of the capabilities it wants to be in effect,
out of what the server said it could do with the first <em>want</em> line.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  upload-request    =  want-list
		       *shallow-line
		       *1depth-request
		       flush-pkt

  want-list         =  first-want
		       *additional-want

  shallow-line      =  PKT-LINE("shallow" SP obj-id)

  depth-request     =  PKT-LINE("deepen" SP depth)

  first-want        =  PKT-LINE("want" SP obj-id SP capability-list LF)
  additional-want   =  PKT-LINE("want" SP obj-id LF)

  depth             =  1*DIGIT</pre>
</div>
</div>
<div class="paragraph">
<p>Clients MUST send all the obj-ids it wants from the reference
discovery phase as <em>want</em> lines. Clients MUST send at least one
<em>want</em> command in the request body. Clients MUST NOT mention an
obj-id in a <em>want</em> command which did not appear in the response
obtained through ref discovery.</p>
</div>
<div class="paragraph">
<p>The client MUST write all obj-ids which it only has shallow copies
of (meaning that it does not have the parents of a commit) as
<em>shallow</em> lines so that the server is aware of the limitations of
the client’s history.</p>
</div>
<div class="paragraph">
<p>The client now sends the maximum commit history depth it wants for
this transaction, which is the number of commits it wants from the
tip of the history, if any, as a <em>deepen</em> line.  A depth of 0 is the
same as not making a depth request. The client does not want to receive
any commits beyond this depth, nor does it want objects needed only to
complete those commits. Commits whose parents are not received as a
result are defined as shallow and marked as such in the server. This
information is sent back to the client in the next step.</p>
</div>
<div class="paragraph">
<p>Once all the <em>want’s and 'shallow’s (and optional 'deepen</em>) are
transferred, clients MUST send a flush-pkt, to tell the server side
that it is done sending the list.</p>
</div>
<div class="paragraph">
<p>Otherwise, if the client sent a positive depth request, the server
will determine which commits will and will not be shallow and
send this information to the client. If the client did not request
a positive depth, this step is skipped.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  shallow-update   =  *shallow-line
		      *unshallow-line
		      flush-pkt

  shallow-line     =  PKT-LINE("shallow" SP obj-id)

  unshallow-line   =  PKT-LINE("unshallow" SP obj-id)</pre>
</div>
</div>
<div class="paragraph">
<p>If the client has requested a positive depth, the server will compute
the set of commits which are no deeper than the desired depth. The set
of commits start at the client’s wants.</p>
</div>
<div class="paragraph">
<p>The server writes <em>shallow</em> lines for each
commit whose parents will not be sent as a result. The server writes
an <em>unshallow</em> line for each commit which the client has indicated is
shallow, but is no longer shallow at the currently requested depth
(that is, its parents will now be sent). The server MUST NOT mark
as unshallow anything which the client has not indicated was shallow.</p>
</div>
<div class="paragraph">
<p>Now the client will send a list of the obj-ids it has using <em>have</em>
lines, so the server can make a packfile that only contains the objects
that the client needs. In multi_ack mode, the canonical implementation
will send up to 32 of these at a time, then will send a flush-pkt. The
canonical implementation will skip ahead and send the next 32 immediately,
so that there is always a block of 32 "in-flight on the wire" at a time.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  upload-haves      =  have-list
		       compute-end

  have-list         =  *have-line
  have-line         =  PKT-LINE("have" SP obj-id LF)
  compute-end       =  flush-pkt / PKT-LINE("done")</pre>
</div>
</div>
<div class="paragraph">
<p>If the server reads <em>have</em> lines, it then will respond by ACKing any
of the obj-ids the client said it had that the server also has. The
server will ACK obj-ids differently depending on which ack mode is
chosen by the client.</p>
</div>
<div class="paragraph">
<p>In multi_ack mode:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the server will respond with <em>ACK obj-id continue</em> for any common
commits.</p>
</li>
<li>
<p>once the server has found an acceptable common base commit and is
ready to make a packfile, it will blindly ACK all <em>have</em> obj-ids
back to the client.</p>
</li>
<li>
<p>the server will then send a <em>NACK</em> and then wait for another response
from the client - either a <em>done</em> or another list of <em>have</em> lines.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In multi_ack_detailed mode:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the server will differentiate the ACKs where it is signaling
that it is ready to send data with <em>ACK obj-id ready</em> lines, and
signals the identified common commits with <em>ACK obj-id common</em> lines.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Without either multi_ack or multi_ack_detailed:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>upload-pack sends "ACK obj-id" on the first common object it finds.
After that it says nothing until the client gives it a "done".</p>
</li>
<li>
<p>upload-pack sends "NAK" on a flush-pkt if no common object
has been found yet.  If one has been found, and thus an ACK
was already sent, it’s silent on the flush-pkt.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>After the client has gotten enough ACK responses that it can determine
that the server has enough information to send an efficient packfile
(in the canonical implementation, this is determined when it has received
enough ACKs that it can color everything left in the --date-order queue
as common with the server, or the --date-order queue is empty), or the
client determines that it wants to give up (in the canonical implementation,
this is determined when the client sends 256 <em>have</em> lines without getting
any of them ACKed by the server - meaning there is nothing in common and
the server should just send all of its objects), then the client will send
a <em>done</em> command.  The <em>done</em> command signals to the server that the client
is ready to receive its packfile data.</p>
</div>
<div class="paragraph">
<p>However, the 256 limit <strong>only</strong> turns on in the canonical client
implementation if we have received at least one "ACK %s continue"
during a prior round.  This helps to ensure that at least one common
ancestor is found before we give up entirely.</p>
</div>
<div class="paragraph">
<p>Once the <em>done</em> line is read from the client, the server will either
send a final <em>ACK obj-id</em> or it will send a <em>NAK</em>. <em>obj-id</em> is the object
name of the last commit determined to be common. The server only sends
ACK after <em>done</em> if there is at least one common base and multi_ack or
multi_ack_detailed is enabled. The server always sends NAK after <em>done</em>
if there is no common base found.</p>
</div>
<div class="paragraph">
<p>Then the server will start sending its packfile data.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  server-response = *ack_multi ack / nak
  ack_multi       = PKT-LINE("ACK" SP obj-id ack_status LF)
  ack_status      = "continue" / "common" / "ready"
  ack             = PKT-LINE("ACK SP obj-id LF)
  nak             = PKT-LINE("NAK" LF)</pre>
</div>
</div>
<div class="paragraph">
<p>A simple clone may look like this (with no <em>have</em> lines):</p>
</div>
<div class="listingblock">
<div class="content">
<pre>   C: 0054want 74730d410fcb6603ace96f1dc55ea6196122532d multi_ack \
     side-band-64k ofs-delta\n
   C: 0032want 7d1665144a3a975c05f1f43902ddaf084e784dbe\n
   C: 0032want 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a\n
   C: 0032want 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01\n
   C: 0032want 74730d410fcb6603ace96f1dc55ea6196122532d\n
   C: 0000
   C: 0009done\n

   S: 0008NAK\n
   S: [PACKFILE]</pre>
</div>
</div>
<div class="paragraph">
<p>An incremental update (fetch) response might look like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>   C: 0054want 74730d410fcb6603ace96f1dc55ea6196122532d multi_ack \
     side-band-64k ofs-delta\n
   C: 0032want 7d1665144a3a975c05f1f43902ddaf084e784dbe\n
   C: 0032want 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a\n
   C: 0000
   C: 0032have 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01\n
   C: [30 more have lines]
   C: 0032have 74730d410fcb6603ace96f1dc55ea6196122532d\n
   C: 0000

   S: 003aACK 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01 continue\n
   S: 003aACK 74730d410fcb6603ace96f1dc55ea6196122532d continue\n
   S: 0008NAK\n

   C: 0009done\n

   S: 0031ACK 74730d410fcb6603ace96f1dc55ea6196122532d\n
   S: [PACKFILE]</pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_packfile_data">Packfile Data</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Now that the client and server have finished negotiation about what
the minimal amount of data that needs to be sent to the client is, the server
will construct and send the required data in packfile format.</p>
</div>
<div class="paragraph">
<p>See pack-format.txt for what the packfile itself actually looks like.</p>
</div>
<div class="paragraph">
<p>If <em>side-band</em> or <em>side-band-64k</em> capabilities have been specified by
the client, the server will send the packfile data multiplexed.</p>
</div>
<div class="paragraph">
<p>Each packet starting with the packet-line length of the amount of data
that follows, followed by a single byte specifying the sideband the
following data is coming in on.</p>
</div>
<div class="paragraph">
<p>In <em>side-band</em> mode, it will send up to 999 data bytes plus 1 control
code, for a total of up to 1000 bytes in a pkt-line.  In <em>side-band-64k</em>
mode it will send up to 65519 data bytes plus 1 control code, for a
total of up to 65520 bytes in a pkt-line.</p>
</div>
<div class="paragraph">
<p>The sideband byte will be a <em>1</em>, <em>2</em> or a <em>3</em>. Sideband <em>1</em> will contain
packfile data, sideband <em>2</em> will be used for progress information that the
client will generally print to stderr and sideband <em>3</em> is used for error
information.</p>
</div>
<div class="paragraph">
<p>If no <em>side-band</em> capability was specified, the server will stream the
entire packfile without multiplexing.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pushing_data_to_a_server">Pushing Data To a Server</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Pushing data to a server will invoke the <em>receive-pack</em> process on the
server, which will allow the client to tell it which references it should
update and then send all the data the server will need for those new
references to be complete.  Once all the data is received and validated,
the server will then update its references to what the client specified.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_authentication">Authentication</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The protocol itself contains no authentication mechanisms.  That is to be
handled by the transport, such as SSH, before the <em>receive-pack</em> process is
invoked.  If <em>receive-pack</em> is configured over the Git transport, those
repositories will be writable by anyone who can access that port (9418) as
that transport is unauthenticated.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_reference_discovery_2">Reference Discovery</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The reference discovery phase is done nearly the same way as it is in the
fetching protocol. Each reference obj-id and name on the server is sent
in packet-line format to the client, followed by a flush-pkt.  The only
real difference is that the capability listing is different - the only
possible values are <em>report-status</em>, <em>delete-refs</em> and <em>ofs-delta</em>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_reference_update_request_and_packfile_transfer">Reference Update Request and Packfile Transfer</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once the client knows what references the server is at, it can send a
list of reference update requests.  For each reference on the server
that it wants to update, it sends a line listing the obj-id currently on
the server, the obj-id the client would like to update it to and the name
of the reference.</p>
</div>
<div class="paragraph">
<p>This list is followed by a flush-pkt and then the packfile that should
contain all the objects that the server will need to complete the new
references.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  update-request    =  *shallow ( command-list | push-cert ) [packfile]

  shallow           =  PKT-LINE("shallow" SP obj-id LF)

  command-list      =  PKT-LINE(command NUL capability-list LF)
		       *PKT-LINE(command LF)
		       flush-pkt

  command           =  create / delete / update
  create            =  zero-id SP new-id  SP name
  delete            =  old-id  SP zero-id SP name
  update            =  old-id  SP new-id  SP name

  old-id            =  obj-id
  new-id            =  obj-id

  push-cert         = PKT-LINE("push-cert" NUL capability-list LF)
		      PKT-LINE("certificate version 0.1" LF)
		      PKT-LINE("pusher" SP ident LF)
		      PKT-LINE("pushee" SP url LF)
		      PKT-LINE("nonce" SP nonce LF)
		      PKT-LINE(LF)
		      *PKT-LINE(command LF)
		      *PKT-LINE(gpg-signature-lines LF)
		      PKT-LINE("push-cert-end" LF)

  packfile          = "PACK" 28*(OCTET)</pre>
</div>
</div>
<div class="paragraph">
<p>If the receiving end does not support delete-refs, the sending end MUST
NOT ask for delete command.</p>
</div>
<div class="paragraph">
<p>If the receiving end does not support push-cert, the sending end
MUST NOT send a push-cert command.  When a push-cert command is
sent, command-list MUST NOT be sent; the commands recorded in the
push certificate is used instead.</p>
</div>
<div class="paragraph">
<p>The packfile MUST NOT be sent if the only command used is <em>delete</em>.</p>
</div>
<div class="paragraph">
<p>A packfile MUST be sent if either create or update command is used,
even if the server already has all the necessary objects.  In this
case the client MUST send an empty packfile.   The only time this
is likely to happen is if the client is creating
a new branch or a tag that points to an existing obj-id.</p>
</div>
<div class="paragraph">
<p>The server will receive the packfile, unpack it, then validate each
reference that is being updated that it hasn’t changed while the request
was being processed (the obj-id is still the same as the old-id), and
it will run any update hooks to make sure that the update is acceptable.
If all of that is fine, the server will then update the references.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_push_certificate">Push Certificate</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A push certificate begins with a set of header lines.  After the
header and an empty line, the protocol commands follow, one per
line.</p>
</div>
<div class="paragraph">
<p>Currently, the following header fields are defined:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>pusher</code> ident</dt>
<dd>
<p>Identify the GPG key in "Human Readable Name <email@address>"
format.</p>
</dd>
<dt class="hdlist1"><code>pushee</code> url</dt>
<dd>
<p>The repository URL (anonymized, if the URL contains
authentication material) the user who ran <code>git push</code>
intended to push into.</p>
</dd>
<dt class="hdlist1"><code>nonce</code> nonce</dt>
<dd>
<p>The <em>nonce</em> string the receiving repository asked the
pushing user to include in the certificate, to prevent
replay attacks.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>The GPG signature lines are a detached signature for the contents
recorded in the push certificate before the signature block begins.
The detached signature is used to certify that the commands were
given by the pusher, who must be the signer.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_report_status">Report Status</h2>
<div class="sectionbody">
<div class="paragraph">
<p>After receiving the pack data from the sender, the receiver sends a
report if <em>report-status</em> capability is in effect.
It is a short listing of what happened in that update.  It will first
list the status of the packfile unpacking as either <em>unpack ok</em> or
<em>unpack [error]</em>.  Then it will list the status for each of the references
that it tried to update.  Each line is either <em>ok [refname]</em> if the
update was successful, or <em>ng [refname] [error]</em> if the update was not.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>  report-status     = unpack-status
		      1*(command-status)
		      flush-pkt

  unpack-status     = PKT-LINE("unpack" SP unpack-result LF)
  unpack-result     = "ok" / error-msg

  command-status    = command-ok / command-fail
  command-ok        = PKT-LINE("ok" SP refname LF)
  command-fail      = PKT-LINE("ng" SP refname SP error-msg LF)

  error-msg         = 1*(OCTECT) ; where not "ok"</pre>
</div>
</div>
<div class="paragraph">
<p>Updates can be unsuccessful for a number of reasons.  The reference can have
changed since the reference discovery phase was originally sent, meaning
someone pushed in the meantime.  The reference being pushed could be a
non-fast-forward reference and the update hooks or configuration could be
set to not allow that, etc.  Also, some references can be updated while others
can be rejected.</p>
</div>
<div class="paragraph">
<p>An example client/server communication might look like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>   S: 007c74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/local\0report-status delete-refs ofs-delta\n
   S: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe refs/heads/debug\n
   S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/master\n
   S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/team\n
   S: 0000

   C: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe 74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/debug\n
   C: 003e74730d410fcb6603ace96f1dc55ea6196122532d 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a refs/heads/master\n
   C: 0000
   C: [PACKDATA]

   S: 000eunpack ok\n
   S: 0018ok refs/heads/debug\n
   S: 002ang refs/heads/master non-fast-forward\n</pre>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2015-08-30 17:24:33 Coordinated Universal Time
</div>
</div>
</body>
</html>


text:
"""Data models."""

from cryptacular.bcrypt import BCRYPTPasswordManager

from sqlalchemy import create_engine
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Unicode
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import mapper
from sqlalchemy.orm import relationship
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker

from zope.sqlalchemy import ZopeTransactionExtension

DBSession = scoped_session(
    sessionmaker(extension=ZopeTransactionExtension()))
metadata = MetaData()

class User(object):
    def __init__(self, login, fullname, password):
        self.login = login
        self.fullname = fullname
        pwd_manager = BCRYPTPasswordManager()
        self.password = pwd_manager.encode(password)

    def validate_password(self, password):
        pwd_manager = BCRYPTPasswordManager()
        return pwd_manager.check(self.password, password)

users_table = Table(
    'users',
    metadata,
    Column('id', Integer, primary_key=True),
    Column('login', Unicode(30), unique=True, nullable=False),
    Column('password', String(60), nullable=False),
    Column('fullname', Unicode(50), nullable=False),
    )

mapper(User, users_table)

class Gallery(object):
    def __init__(self, name, title):
        self.name = name
        self.title = title

galleries_table = Table(
    'galleries',
    metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(30), nullable=False, unique=True),
    Column('title', Unicode(255), nullable=False),
    )

class Album(object):
    def __init__(self, name, title):
        self.name = name
        self.title = title

albums_table = Table(
    'albums',
    metadata,
    Column('id', Integer, primary_key=True),
    Column('gallery_id', Integer, ForeignKey('galleries.id',
                                             ondelete='CASCADE')),
    Column('name', String(30), nullable=False),
    UniqueConstraint('gallery_id', 'name'),
    Column('title', Unicode(255), nullable=False),
    )

class Picture(object):
    def __init__(self, path, date, caption=u'', location=u''):
        self.path = path
        self.date = date
        self.caption = caption
        self.location = location

    @property
    def get_info(self):
        info = filter(None, (self.caption,
                             self.location,
                             self.date.strftime('%d %b %Y %H:%M:%S')))
        return u' - '.join(info)

pictures_table = Table(
    'pictures',
    metadata,
    Column('id', Integer, primary_key=True),
    Column('album_id', Integer, ForeignKey('albums.id', ondelete='CASCADE')),
    Column('caption', Unicode(255)),
    Column('location', Unicode(100)),
    Column('path', Unicode(255), nullable=False, unique=True),
    Column('date', DateTime, nullable=False),
    )

mapper(Gallery, galleries_table,
       properties={
        'albums': relationship(Album,
                               cascade='all, delete')})
mapper(Album, albums_table,
       properties={
        'pictures': relationship(Picture,
                                 cascade='all, delete-orphan')})
mapper(Picture, pictures_table)

class GalleryAdministrator(object):
    def __init__(self, gallery_id, user_id):
        self.gallery_id = gallery_id
        self.user_id = user_id

gallery_administrators_table = Table(
    'gallery_administrators',
    metadata,
    Column('gallery_id', Integer, ForeignKey('galleries.id',
                                             ondelete='CASCADE')),
    Column('user_id', Integer, ForeignKey('users.id',
                                          ondelete='CASCADE'), nullable=False),
    UniqueConstraint('gallery_id', 'user_id'),
    )

mapper(GalleryAdministrator, gallery_administrators_table,
       primary_key=(gallery_administrators_table.c.gallery_id,
                    gallery_administrators_table.c.user_id))

class AlbumViewer(object):
    def __init__(self, album_id, user_id):
        self.album_id = album_id
        self.user_id = user_id

album_viewers_table = Table(
    'album_viewers',
    metadata,
    Column('album_id', Integer, ForeignKey('albums.id',
                                           ondelete='CASCADE')),
    Column('user_id', Integer, ForeignKey('users.id',
                                          ondelete='CASCADE'), nullable=False),
    UniqueConstraint('album_id', 'user_id'),
    )

mapper(AlbumViewer, album_viewers_table,
       primary_key=(album_viewers_table.c.album_id,
                    album_viewers_table.c.user_id))

def initialize_sql(db_string, echo=False):
    engine = create_engine(db_string, echo=echo)
    DBSession.configure(bind=engine)
    metadata.bind = engine
    metadata.create_all(engine)
    return engine

redpajama_set_name: RedPajamaGithub


text:
Architects

Practiced in Queensland

Other

      <button class="btn btn-default btn-xs" ui-sref="architect.summary.edit({architectId:null})">
         New Architect
      </button>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">FFTrajectoryMapper</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>
    <string name="defaultClient">192.168.</string>
    <string name="mapWidth">400</string>
    <string name="mapHeight">400</string>
    <string name="playerX">200</string>
    <string name="playerY">200</string>
    <string name="originX">0</string>
    <string name="originY">0</string>

</resources>


text:
package com.azure.digitaltwins.core.implementation.converters;

import com.azure.digitaltwins.core.models.DigitalTwinsModelData;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * A converter between {@link com.azure.digitaltwins.core.implementation.models.DigitalTwinsModelData} and
 * {@link DigitalTwinsModelData}.
 */
public final class DigitalTwinsModelDataConverter {

    /**
     * Maps from {@link com.azure.digitaltwins.core.implementation.models.DigitalTwinsModelData} to
     * {@link DigitalTwinsModelData}. If the input is null, then the output will be null as well.
     */
    public static DigitalTwinsModelData map(com.azure.digitaltwins.core.implementation.models.DigitalTwinsModelData input) {
        if (input == null) {
            return null;
        }

        String modelStringValue = null;

        if (input.getModel() != null){
            try {
                modelStringValue = new ObjectMapper().writeValueAsString(input.getModel());
            } catch (JsonProcessingException e) {
                throw new IllegalArgumentException("ModelData does not have a valid model definition.", e);
            }
        }

        return new DigitalTwinsModelData()
            .setId(input.getId())
            .setUploadTime(input.getUploadTime())
            .setDisplayName(input.getDisplayName())
            .setDescription(input.getDescription())
            .setDecommissioned(input.isDecommissioned())
            .setModel(modelStringValue);
    }

    private DigitalTwinsModelDataConverter() {}
}


text:
namespace blink {

class AbortSignal;
class BodyStreamBuffer;
class ExceptionState;
class RequestInit;

using RequestInfo = RequestOrUSVString;

class CORE_EXPORT Request final : public ScriptWrappable,
                                  public ActiveScriptWrappable<Request>,
                                  public Body {
  DEFINE_WRAPPERTYPEINFO();
  USING_GARBAGE_COLLECTED_MIXIN(Request);

 public:
  using ForServiceWorkerFetchEvent =
      FetchRequestData::ForServiceWorkerFetchEvent;

  // These "create" function must be called with entering an appropriate
  // V8 context.
  // From Request.idl:
  static Request* Create(ScriptState*,
                         const RequestInfo&,
                         const RequestInit*,
                         ExceptionState&);

  static Request* Create(ScriptState*, const String&, ExceptionState&);
  static Request* Create(ScriptState*,
                         const String&,
                         const RequestInit*,
                         ExceptionState&);
  static Request* Create(ScriptState*, Request*, ExceptionState&);
  static Request* Create(ScriptState*,
                         Request*,
                         const RequestInit*,
                         ExceptionState&);
  static Request* Create(ScriptState*, FetchRequestData*);
  static Request* Create(ScriptState*,
                         const mojom::blink::FetchAPIRequest&,
                         ForServiceWorkerFetchEvent);

  Request(ScriptState*, FetchRequestData*, Headers*, AbortSignal*);
  Request(ScriptState*, FetchRequestData*);

  static base::Optional<network::mojom::CredentialsMode> ParseCredentialsMode(
      const String& credentials_mode);

  // From Request.idl:
  String method() const;
  const KURL& url() const;
  Headers* getHeaders() const { return headers_; }
  String destination() const;
  String referrer() const;
  String getReferrerPolicy() const;
  String mode() const;
  String credentials() const;
  String cache() const;
  String redirect() const;
  String integrity() const;
  bool keepalive() const;
  bool isHistoryNavigation() const;
  AbortSignal* signal() const { return signal_; }

  // From Request.idl:
  // This function must be called with entering an appropriate V8 context.
  Request* clone(ScriptState*, ExceptionState&);

  // ScriptWrappable override
  bool HasPendingActivity() const override {
    return Body::HasPendingActivity();
  }

  FetchRequestData* PassRequestData(ScriptState*, ExceptionState&);
  mojom::blink::FetchAPIRequestPtr CreateFetchAPIRequest() const;
  bool HasBody() const;
  BodyStreamBuffer* BodyBuffer() override { return request_->Buffer(); }
  const BodyStreamBuffer* BodyBuffer() const override {
    return request_->Buffer();
  }
  mojom::RequestContextType GetRequestContextType() const;
  network::mojom::RequestDestination GetRequestDestination() const;

  void Trace(Visitor*) override;

 private:
  const FetchRequestData* GetRequest() const { return request_; }
  static Request* CreateRequestWithRequestOrString(ScriptState*,
                                                   Request*,
                                                   const String&,
                                                   const RequestInit*,
                                                   ExceptionState&);

  String ContentType() const override;
  String MimeType() const override;

  const Member<FetchRequestData> request_;
  const Member<Headers> headers_;
  const Member<AbortSignal> signal_;
  DISALLOW_COPY_AND_ASSIGN(Request);
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_REQUEST_H_


text:
import React = require("react/addons");
import TypedReact = require("typed-react");
import TalkStore = require("./talk.store");
import QuestStore = require("./quest.store");

interface IDetailProps {
    talk: TalkStore;
    quest: QuestStore;
    children: any;
};

class Spec extends TypedReact.Component<IDetailProps, any> {
    componentDidMount() {
        this.props.talk.addChangeListener(this._onChange);
        this.props.quest.addChangeListener(this._onChange);
    }
    componentWillUnmount() {
        this.props.talk.removeAllListeners();
        this.props.quest.removeAllListeners();
    }

    //
    // render
    //
    render() {
        var cx = React.addons.classSet({
            "detail": true,
            "ofTalk": (this.props.talk.hide == false),
            "ofQuest": (this.props.quest.hide == false)
        });
        return React.createElement("div", { className: cx },
            this.props.children
            );
    }

    //
    // Private methods
    //
    private _onChange() {
        this.forceUpdate();
    }
}

var component = TypedReact.createClass(Spec);
export = component;


text:
#include "exofs.h"

static inline int exofs_add_nondir(struct dentry *dentry, struct inode *inode)
{
	int err = exofs_add_link(dentry, inode);
	if (!err) {
		d_instantiate(dentry, inode);
		return 0;
	}
	inode_dec_link_count(inode);
	iput(inode);
	return err;
}

static struct dentry *exofs_lookup(struct inode *dir, struct dentry *dentry,
				   unsigned int flags)
{
	struct inode *inode;
	ino_t ino;

	if (dentry->d_name.len > EXOFS_NAME_LEN)
		return ERR_PTR(-ENAMETOOLONG);

	ino = exofs_inode_by_name(dir, dentry);
	inode = ino ? exofs_iget(dir->i_sb, ino) : NULL;
	return d_splice_alias(inode, dentry);
}

static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
			 bool excl)
{
	struct inode *inode = exofs_new_inode(dir, mode);
	int err = PTR_ERR(inode);
	if (!IS_ERR(inode)) {
		inode->i_op = &exofs_file_inode_operations;
		inode->i_fop = &exofs_file_operations;
		inode->i_mapping->a_ops = &exofs_aops;
		mark_inode_dirty(inode);
		err = exofs_add_nondir(dentry, inode);
	}
	return err;
}

static int exofs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
		       dev_t rdev)
{
	struct inode *inode;
	int err;

	if (!new_valid_dev(rdev))
		return -EINVAL;

	inode = exofs_new_inode(dir, mode);
	err = PTR_ERR(inode);
	if (!IS_ERR(inode)) {
		init_special_inode(inode, inode->i_mode, rdev);
		mark_inode_dirty(inode);
		err = exofs_add_nondir(dentry, inode);
	}
	return err;
}

static int exofs_symlink(struct inode *dir, struct dentry *dentry,
			  const char *symname)
{
	struct super_block *sb = dir->i_sb;
	int err = -ENAMETOOLONG;
	unsigned l = strlen(symname)+1;
	struct inode *inode;
	struct exofs_i_info *oi;

	if (l > sb->s_blocksize)
		goto out;

	inode = exofs_new_inode(dir, S_IFLNK | S_IRWXUGO);
	err = PTR_ERR(inode);
	if (IS_ERR(inode))
		goto out;

	oi = exofs_i(inode);
	if (l > sizeof(oi->i_data)) {
		/* slow symlink */
		inode->i_op = &page_symlink_inode_operations;
		inode->i_mapping->a_ops = &exofs_aops;
		memset(oi->i_data, 0, sizeof(oi->i_data));

		err = page_symlink(inode, symname, l);
		if (err)
			goto out_fail;
	} else {
		/* fast symlink */
		inode->i_op = &simple_symlink_inode_operations;
		inode->i_link = (char *)oi->i_data;
		memcpy(oi->i_data, symname, l);
		inode->i_size = l-1;
	}
	mark_inode_dirty(inode);

	err = exofs_add_nondir(dentry, inode);
out:
	return err;

out_fail:
	inode_dec_link_count(inode);
	iput(inode);
	goto out;
}

static int exofs_link(struct dentry *old_dentry, struct inode *dir,
		struct dentry *dentry)
{
	struct inode *inode = d_inode(old_dentry);

	inode->i_ctime = CURRENT_TIME;
	inode_inc_link_count(inode);
	ihold(inode);

	return exofs_add_nondir(dentry, inode);
}

static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
{
	struct inode *inode;
	int err;

	inode_inc_link_count(dir);

	inode = exofs_new_inode(dir, S_IFDIR | mode);
	err = PTR_ERR(inode);
	if (IS_ERR(inode))
		goto out_dir;

	inode->i_op = &exofs_dir_inode_operations;
	inode->i_fop = &exofs_dir_operations;
	inode->i_mapping->a_ops = &exofs_aops;

	inode_inc_link_count(inode);

	err = exofs_make_empty(inode, dir);
	if (err)
		goto out_fail;

	err = exofs_add_link(dentry, inode);
	if (err)
		goto out_fail;

	d_instantiate(dentry, inode);
out:
	return err;

out_fail:
	inode_dec_link_count(inode);
	inode_dec_link_count(inode);
	iput(inode);
out_dir:
	inode_dec_link_count(dir);
	goto out;
}

static int exofs_unlink(struct inode *dir, struct dentry *dentry)
{
	struct inode *inode = d_inode(dentry);
	struct exofs_dir_entry *de;
	struct page *page;
	int err = -ENOENT;

	de = exofs_find_entry(dir, dentry, &page);
	if (!de)
		goto out;

	err = exofs_delete_entry(de, page);
	if (err)
		goto out;

	inode->i_ctime = dir->i_ctime;
	inode_dec_link_count(inode);
	err = 0;
out:
	return err;
}

static int exofs_rmdir(struct inode *dir, struct dentry *dentry)
{
	struct inode *inode = d_inode(dentry);
	int err = -ENOTEMPTY;

	if (exofs_empty_dir(inode)) {
		err = exofs_unlink(dir, dentry);
		if (!err) {
			inode->i_size = 0;
			inode_dec_link_count(inode);
			inode_dec_link_count(dir);
		}
	}
	return err;
}

static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,
		struct inode *new_dir, struct dentry *new_dentry)
{
	struct inode *old_inode = d_inode(old_dentry);
	struct inode *new_inode = d_inode(new_dentry);
	struct page *dir_page = NULL;
	struct exofs_dir_entry *dir_de = NULL;
	struct page *old_page;
	struct exofs_dir_entry *old_de;
	int err = -ENOENT;

	old_de = exofs_find_entry(old_dir, old_dentry, &old_page);
	if (!old_de)
		goto out;

	if (S_ISDIR(old_inode->i_mode)) {
		err = -EIO;
		dir_de = exofs_dotdot(old_inode, &dir_page);
		if (!dir_de)
			goto out_old;
	}

	if (new_inode) {
		struct page *new_page;
		struct exofs_dir_entry *new_de;

		err = -ENOTEMPTY;
		if (dir_de && !exofs_empty_dir(new_inode))
			goto out_dir;

		err = -ENOENT;
		new_de = exofs_find_entry(new_dir, new_dentry, &new_page);
		if (!new_de)
			goto out_dir;
		err = exofs_set_link(new_dir, new_de, new_page, old_inode);
		new_inode->i_ctime = CURRENT_TIME;
		if (dir_de)
			drop_nlink(new_inode);
		inode_dec_link_count(new_inode);
		if (err)
			goto out_dir;
	} else {
		err = exofs_add_link(new_dentry, old_inode);
		if (err)
			goto out_dir;
		if (dir_de)
			inode_inc_link_count(new_dir);
	}

	old_inode->i_ctime = CURRENT_TIME;

	exofs_delete_entry(old_de, old_page);
	mark_inode_dirty(old_inode);

	if (dir_de) {
		err = exofs_set_link(old_inode, dir_de, dir_page, new_dir);
		inode_dec_link_count(old_dir);
		if (err)
			goto out_dir;
	}
	return 0;

out_dir:
	if (dir_de) {
		kunmap(dir_page);
		page_cache_release(dir_page);
	}
out_old:
	kunmap(old_page);
	page_cache_release(old_page);
out:
	return err;
}

const struct inode_operations exofs_dir_inode_operations = {
	.create 	= exofs_create,
	.lookup 	= exofs_lookup,
	.link   	= exofs_link,
	.unlink 	= exofs_unlink,
	.symlink	= exofs_symlink,
	.mkdir  	= exofs_mkdir,
	.rmdir  	= exofs_rmdir,
	.mknod  	= exofs_mknod,
	.rename 	= exofs_rename,
	.setattr	= exofs_setattr,
};

const struct inode_operations exofs_special_inode_operations = {
	.setattr	= exofs_setattr,
};


text:
using System;
using System.Collections.Generic;
using XenAPI;

namespace XenAdmin.Actions
{
    public class CreateCdDriveAction : AsyncAction
    {
        private readonly bool InstallingTools;
        private Action _showMustRebootBoxCD;
        private Action _showVBDWarningBox;

        public CreateCdDriveAction(VM vm, bool installingTools, Action showMustRebootBoxCD, Action showVBDWarningBox)
            : base(vm.Connection, string.Format(Messages.NEW_DVD_DRIVE_CREATE_TITLE, vm.Name))
        {
            _showMustRebootBoxCD = showMustRebootBoxCD;
            _showVBDWarningBox = showVBDWarningBox;
            VM = vm;
            InstallingTools = installingTools;

            #region RBAC Dependencies
            ApiMethodsToRoleCheck.Add("vm.assert_agile");
            ApiMethodsToRoleCheck.AddRange(XenAPI.Role.CommonSessionApiList);
            #endregion
        }

        protected override void Run()
        {
            VBD cdrom = VM.FindVMCDROM();
            if (cdrom == null)
            {
                Description = Messages.NEW_DVD_DRIVE_CREATING;
                // could not find a cd, try and make one

                if (VM.VBDs.Count >= VM.MaxVBDsAllowed)
                {
                    throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS);
                }

                List<String> allowedDevices = new List<String>(XenAPI.VM.get_allowed_VBD_devices(Session, VM.opaque_ref));

                if (allowedDevices == null || allowedDevices.Count == 0)
                {
                    throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS);
                }

                XenAPI.VBD cdDrive = new XenAPI.VBD();
                cdDrive.VM = new XenAPI.XenRef<XenAPI.VM>(VM.opaque_ref);
                cdDrive.VDI = null;
                cdDrive.bootable = false;
                cdDrive.device = "";
                cdDrive.userdevice = allowedDevices.Contains("3") ? "3" : allowedDevices[0];
                cdDrive.empty = true;
                cdDrive.type = XenAPI.vbd_type.CD;
                cdDrive.mode = XenAPI.vbd_mode.RO;

                VbdSaveAndPlugAction cdCreate = new VbdSaveAndPlugAction(VM, cdDrive, Messages.DVD_DRIVE, Session, InstallingTools, true,_showMustRebootBoxCD,_showVBDWarningBox);
                cdCreate.RunExternal(Session);
                Description = Messages.NEW_DVD_DRIVE_DONE;
            }
        }
    }
}


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

<title>Gamepad</title>
<meta name="date" content="2016-05-25">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

net.alexanderdev.lightdrive.input.gamepad

Class Gamepad

java.lang.Object

net.alexanderdev.lightdrive.input.gamepad.Gamepad

All Implemented Interfaces:

java.lang.Runnable

public class Gamepad
extends java.lang.Object
implements java.lang.Runnable

A class which encapsulates a Controller of type
 Controller.Type#GAMEPAD, and polls all appropriate Components
 on its own thread.

Since:

Apr 29, 2015, 9:11:58 PM

Author:

Christian Bryce Alexander

Constructor Summary

Constructors

Constructor and Description

Gamepad(net.java.games.input.Controller controller,
       int number)

Creates a Gamepad with an associated Controller and
 number.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
anySwitchHeld()

boolean
anySwitchPressed()

boolean
anySwitchReleased()

float
getDeadZone()

float
getLeftStickDeltaX()

float
getLeftStickDeltaY()

VectorF
getLeftStickVector()

float
getLeftStickX()

float
getLeftStickY()

float
getLeftTrigger()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

float
getLeftTriggerDelta()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

int
getNumber()

float
getRightStickDeltaX()

float
getRightStickDeltaY()

VectorF
getRightStickVector()

float
getRightStickX()

float
getRightStickY()

float
getRightTrigger()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

float
getRightTriggerDelta()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

void
run()

void
setDeadZone(float deadZone)

Sets the dead zone for this Gamepad's sticks and triggers.

void
start()

void
stop()

boolean
switchHeld(Switch zwitch)

boolean
switchPressed(Switch zwitch)

boolean
switchReleased(Switch zwitch)

void
update()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Gamepad

public Gamepad(net.java.games.input.Controller controller,
               int number)

Creates a Gamepad with an associated Controller and
 number.

Parameters:

controller - The Controller to associate with this Gamepad

number - The number to associate with this Gamepad

Method Detail

getNumber

public int getNumber()

Returns:

The number associated with this Gamepad

getDeadZone

public float getDeadZone()

Returns:

The dead zone of this Gamepad

setDeadZone

public void setDeadZone(float deadZone)

Sets the dead zone for this Gamepad's sticks and triggers.

Parameters:

deadZone - The dead zone to set

switchPressed

public boolean switchPressed(Switch zwitch)

Parameters:

zwitch - The game pad switch to check

Returns:

true if the switch associated with the specified
         Switch 's ordinal has been pressed, false
         otherwise

anySwitchPressed

public boolean anySwitchPressed()

Returns:

true if any switch has been pressed, false
         otherwise

switchHeld

public boolean switchHeld(Switch zwitch)

Parameters:

zwitch - The game pad switch to check

Returns:

true if the switch associated with the specified
         Switch 's ordinal is being held, false otherwise

anySwitchHeld

public boolean anySwitchHeld()

Returns:

true if any switch is being held, false otherwise

switchReleased

public boolean switchReleased(Switch zwitch)

Parameters:

zwitch - The game pad switch to check

Returns:

true if the switch associated with the specified
         Switch 's ordinal has been released, false
         otherwise

anySwitchReleased

public boolean anySwitchReleased()

Returns:

true if any key has been released, false
         otherwise

getLeftStickX

public float getLeftStickX()

Returns:

The horizontal position of the left stick as a value between -1f
         and 1f

getLeftStickDeltaX

public float getLeftStickDeltaX()

Returns:

The change in horizontal position of the left stick as a value
         between -1f and 1f

getLeftStickY

public float getLeftStickY()

Returns:

The vertical position of the left stick as a value between -1f
         and 1f

getLeftStickDeltaY

public float getLeftStickDeltaY()

Returns:

The change in vertical position of the left stick as a value
         between -1f and 1f

getLeftStickVector

public VectorF getLeftStickVector()

Returns:

The positions of the left stick as a VectorF

getRightStickX

public float getRightStickX()

Returns:

The horizontal position of the right stick as a value between -1f
         and 1f

getRightStickDeltaX

public float getRightStickDeltaX()

Returns:

The change in horizontal position of the right stick as a value
         between -1f and 1f

getRightStickY

public float getRightStickY()

Returns:

The vertical position of the right stick as a value between -1f
         and 1f

getRightStickDeltaY

public float getRightStickDeltaY()

Returns:

The change in vertical position of the right stick as a value
         between -1f and 1f

getRightStickVector

public VectorF getRightStickVector()

Returns:

The positions of the right stick as a VectorF

getLeftTrigger

public float getLeftTrigger()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

Returns:

The magnitude of the left trigger as a value between 0f and 1f

getLeftTriggerDelta

public float getLeftTriggerDelta()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

Returns:

The change in the magnitude of the left trigger as a value
         between 0f and 1f

getRightTrigger

public float getRightTrigger()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

Returns:

The magnitude of the right trigger as a value between 0f and 1f

getRightTriggerDelta

public float getRightTriggerDelta()

NOTE: With the Controller class, the triggers are considered
 as one axis, and therefore, cannot register magnitudes separately.

Returns:

The change in the magnitude of the right trigger as a value
         between 0f and 1f

start

public void start()

stop

public void stop()

update

public void update()

run

public void run()

Specified by:

run in interface java.lang.Runnable

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
import pandas as pd

train = pd.read_csv("all_features_training.csv")
valid = pd.read_csv("all_features_validation.csv")

if train.columns[[7307]] != 'nspdk1':
  raise Exception('The input file doesn not seem to contain the error. Maybe it has already been fixed?')

# delete the permuted nspdk columns
train=train.drop(train.columns[list(range(7307,9744))], axis=1)
valid=valid.drop(valid.columns[list(range(7307,9744))], axis=1)

# add correct nspdk columns
# (Note that these are NPSDK kernel values, i.e. similarities with other molecules, not NPSDK features.)
nc = pd.read_csv("nspdk_gram_cid.csv.tmp")
train = train.merge(nc, on='CID')
valid = valid.merge(nc, on='CID')

train.to_csv("all_features_training_fixed.csv", index=False)
valid.to_csv("all_features_validation_fixed.csv", index=False)


text:
<?php

namespace Lexik\Bundle\MailerBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use Symfony\Component\Validator\Constraints as Assert;

use Lexik\Bundle\MailerBundle\Exception\NoTranslationException;
use Lexik\Bundle\MailerBundle\Model\LayoutInterface;

/**
 * @ORM\Entity
 * @ORM\Table(name="lexik_layout")
 * @DoctrineAssert\UniqueEntity("reference")
 *
 * @author Laurent Heurtault <l.heurtault@lexik.fr>
 * @author Cédric Girard <c.girard@lexik.fr>
 */
class Layout implements LayoutInterface
{
    /**
     * @var integer
     *
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(type="string", unique=true)
     * @Assert\NotBlank()
     */
    protected $reference;

    /**
     * @var string
     *
     * @ORM\Column(type="string", nullable=true)
     */
    protected $description;

    /**
     * @var ArrayCollection
     *
     * @ORM\OneToMany(targetEntity="LayoutTranslation", mappedBy="layout", cascade={"all"})
     */
    protected $translations;

    /**
     * The locale to use to get the right layout content.
     *
     * @var string
     */
    private $locale;

    /**
     * Translation object for the current $this->locale value.
     *
     * @var \Lexik\Bundle\MailerBundle\Entity\LayoutTranslation
     */
    private $currentTranslation;

    /**
     * __construct
     */
    public function __construct()
    {
        $this->translations = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Get reference
     *
     * @return string
     */
    public function getReference()
    {
        return $this->reference;
    }

    /**
     * Set reference
     *
     * @param string $reference
     */
    public function setReference($reference)
    {
        $this->reference = $reference;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set description
     *
     * @param string $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

    /**
     * Get translations
     *
     * @return ArrayCollection
     */
    public function getTranslations()
    {
        return $this->translations;
    }

    /**
     * Add a translation
     *
     * @param LayoutTranslation $translation
     */
    public function addTranslation(LayoutTranslation $translation)
    {
        $this->translations->add($translation);
        $translation->setLayout($this);
    }

    /**
     * Remove a translation
     *
     * @param LayoutTranslation $translation
     */
    public function removeTranslation(LayoutTranslation $translation)
    {
        $this->translations->removeElement($translation);
        $translation->setLayout(null);
    }

    /**
     * Get LayoutTranslation for a given lang, if not exist it will be created
     *
     * @param string $lang
     *
     * @throws \InvalidArgumentException
     * @return \Lexik\Bundle\MailerBundle\Entity\LayoutTranslation
     */
    public function getTranslation($lang)
    {
        // Check if locale given
        if (strpos($lang, '_')) {
            $parts = explode('_', $lang);
            $lang = array_shift($parts);
        }

        if (strlen($lang) != 2) {
            throw new \InvalidArgumentException(sprintf('$lang is not valid : "%s" given', $lang));
        }

        foreach ($this->getTranslations() as $translation) {
            if ($translation->getLang() === $lang) {
                return $translation;
            }
        }

        $translation = new LayoutTranslation($lang);
        $translation->setLayout($this);

        return $translation;
    }

    /**
     * __toString
     *
     * @return string
     */
    public function __toString()
    {
        return $this->reference;
    }

    /**
     * Set the current translation.
     *
     * @throws NoTranslationException
     */
    protected function setCurrentTranslation()
    {
        if (!($this->currentTranslation instanceof LayoutTranslation) || $this->currentTranslation->getLang() != $this->locale) {
            $i = 0;
            $end = count($this->translations);
            $found = false;

            while ($i<$end && !$found) {
                $found = ($this->translations[$i]->getLang() == $this->locale);
                $i++;
            }

            if ($found) {
                $this->currentTranslation = $this->translations[$i-1];
            } else {
                throw new NoTranslationException($this->locale, sprintf('No "%s" translation for layout "%s".', $this->locale, $this->reference));
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    public function setLocale($locale)
    {
        $this->locale = $locale;

        $this->setCurrentTranslation();
    }

    /**
     * {@inheritdoc}
     */
    public function getBody()
    {
        return $this->currentTranslation->getBody();
    }

    /**
     * {@inheritdoc}
     */
    public function getLastModifiedTimestamp()
    {
        $date = $this->currentTranslation->getUpdatedAt();

        if ( ! $date instanceof \DateTime ) {
            $date = new \DateTime('now');
        }

        return $date->format('U');
    }

    /**
     * {@inheritdoc}
     */
    public function getChecksum()
    {
        return md5(sprintf('%s_%s', $this->locale, $this->getReference()));
    }
}


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

<title>nl.esciencecenter.octopus.util</title>
<meta name="date" content="2013-04-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

nl.esciencecenter.octopus.util

Interfaces

FileVisitor

Classes

FileUtils

Enums

FileVisitResult


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>FavoredNodesForRegion xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />

View Javadoc

1
19  package org.apache.hadoop.hbase.regionserver;
20
21  import java.net.InetSocketAddress;
22  import java.util.List;
23
24  import org.apache.hadoop.classification.InterfaceAudience;
25  import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName;
26
27  /**
28   * Abstraction that allows different modules in RegionServer to update/get
29   * the favored nodes information for regions.
30   */
31  @InterfaceAudience.Private
32  interface FavoredNodesForRegion {
33    /**
34     * Used to update the favored nodes mapping when required.
35     * @param encodedRegionName
36     * @param favoredNodes
37     */
38    void updateRegionFavoredNodesMapping(String encodedRegionName, List<ServerName> favoredNodes);
39
40    /**
41     * Get the favored nodes mapping for this region. Used when the HDFS create API
42     * is invoked to pass in favored nodes hints for new region files.
43     * @param encodedRegionName
44     * @return array containing the favored nodes' InetSocketAddresses
45     */
46    InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName);
47  }

This page was automatically generated by Maven


text:
// This file is automatically generated.

package adila.db;

/*
 * Google Pixel
 *
 * DEVICE: sailfish
 * MODEL: Pixel
 */
final class sailfish {
    public static final String DATA = "Google|Pixel|";
}


text:
namespace Nancy.Diagnostics
{
    using System;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Text;

    public class EmbeddedFileResponse : Response
    {
        private static readonly byte[] ErrorText;

        static EmbeddedFileResponse()
        {
            ErrorText = Encoding.UTF8.GetBytes("NOT FOUND");
        }

        public EmbeddedFileResponse(Assembly assembly, string resourcePath, string name)
        {
            this.ContentType = MimeTypes.GetMimeType(name);
            this.StatusCode = HttpStatusCode.OK;

            this.Contents = stream =>
            {
                var content =
                    GetResourceContent(assembly, resourcePath, name);

                if (content != null)
                {
                    content.CopyTo(stream);
                }
                else
                {
                    stream.Write(ErrorText, 0, ErrorText.Length);
                }
            };
        }

        private Stream GetResourceContent(Assembly assembly, string resourcePath, string name)
        {
            var resourceName = assembly
                .GetManifestResourceNames()
                .Where(x => GetFileNameFromResourceName(resourcePath, x).Equals(name, StringComparison.OrdinalIgnoreCase))
                .Select(x => GetFileNameFromResourceName(resourcePath, x))
                .FirstOrDefault();

            resourceName =
                string.Concat(resourcePath, ".", resourceName);

            return this.GetType().Assembly.GetManifestResourceStream(resourceName);
        }

        private static string GetFileNameFromResourceName(string resourcePath, string resourceName)
        {
            return resourceName.Replace(resourcePath, string.Empty).Substring(1);
        }
    }
}