text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
from crits.vocabulary.vocab import vocab
class Status(vocab):
"""
Vocabulary for Status.
"""
NEW = "New"
IN_PROGRESS = "In Progress"
ANALYZED = "Analyzed"
DEPRECATED = "Deprecated"
| {'content_hash': '1b54affac260ed05c1ae13a44d018b39', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 40, 'avg_line_length': 17.666666666666668, 'alnum_prop': 0.6226415094339622, 'repo_name': 'Magicked/crits', 'id': 'b5850051f88ce3f4e7eb445b49cbb94ff9046c4d', 'size': '212', 'binary': False, 'copies': '23', 'ref': 'refs/heads/master', 'path': 'crits/vocabulary/status.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '8694'}, {'name': 'CSS', 'bytes': '390446'}, {'name': 'HTML', 'bytes': '479254'}, {'name': 'JavaScript', 'bytes': '3555958'}, {'name': 'Python', 'bytes': '2012116'}, {'name': 'Shell', 'bytes': '20209'}]} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.1.21: v8::Date Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.1.21
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_date.html">Date</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classv8_1_1_date-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::Date Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for v8::Date:</div>
<div class="dyncontent">
<div class="center">
<img src="classv8_1_1_date.png" usemap="#v8::Date_map" alt=""/>
<map id="v8::Date_map" name="v8::Date_map">
<area href="classv8_1_1_value.html" alt="v8::Value" shape="rect" coords="0,56,65,80"/>
<area href="classv8_1_1_data.html" alt="v8::Data" shape="rect" coords="0,0,65,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a00ae69718a3810d82ae0b54b28d53512"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_date.html#a00ae69718a3810d82ae0b54b28d53512">NumberValue</a> () const </td></tr>
<tr class="separator:a00ae69718a3810d82ae0b54b28d53512"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classv8_1_1_value"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classv8_1_1_value')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1_value.html">v8::Value</a></td></tr>
<tr class="memitem:aea287b745656baa8a12a2ae1d69744b6 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a> () const </td></tr>
<tr class="separator:aea287b745656baa8a12a2ae1d69744b6 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa2c6ed8ef832223a7e2cd81e6ac61c78 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a> () const </td></tr>
<tr class="separator:aa2c6ed8ef832223a7e2cd81e6ac61c78 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8f27462322186b295195eecb3e81d6d7 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a> () const </td></tr>
<tr class="separator:a8f27462322186b295195eecb3e81d6d7 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a68c0296071d01ca899825d7643cf495a inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a> () const </td></tr>
<tr class="separator:a68c0296071d01ca899825d7643cf495a inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab23a34b7df62806808e01b0908bf5f00 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a> () const </td></tr>
<tr class="separator:ab23a34b7df62806808e01b0908bf5f00 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a05532a34cdd215f273163830ed8b77e7 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a> () const </td></tr>
<tr class="separator:a05532a34cdd215f273163830ed8b77e7 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaee0b144087d20eae02314c9393ff80f inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a> () const </td></tr>
<tr class="separator:aaee0b144087d20eae02314c9393ff80f inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a355b7991c5c978c0341f6f961b63c5a2 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a> () const </td></tr>
<tr class="separator:a355b7991c5c978c0341f6f961b63c5a2 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0aceb7645e71b096df5cd73d1252b1b0 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a> () const </td></tr>
<tr class="separator:a0aceb7645e71b096df5cd73d1252b1b0 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1bd51e3e55f67c65b9a8f587fbffb7c7 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a> () const </td></tr>
<tr class="separator:a1bd51e3e55f67c65b9a8f587fbffb7c7 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ac61a325c18af8dcb6d7d5bf47d2503 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a> () const </td></tr>
<tr class="separator:a7ac61a325c18af8dcb6d7d5bf47d2503 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a01e1db51c65b2feace248b7acbf71a2c inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a> () const </td></tr>
<tr class="separator:a01e1db51c65b2feace248b7acbf71a2c inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8bc11fab0aded4a805722ab6df173cae inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a> () const </td></tr>
<tr class="separator:a8bc11fab0aded4a805722ab6df173cae inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a73d653dc4a4999ce7258b40a4d8a1510 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a73d653dc4a4999ce7258b40a4d8a1510"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_boolean.html">Boolean</a> > </td><td class="memItemRight" valign="bottom"><b>ToBoolean</b> () const </td></tr>
<tr class="separator:a73d653dc4a4999ce7258b40a4d8a1510 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2706d2c0cf684a5179e76e8e404b3a5d inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2706d2c0cf684a5179e76e8e404b3a5d"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_number.html">Number</a> > </td><td class="memItemRight" valign="bottom"><b>ToNumber</b> () const </td></tr>
<tr class="separator:a2706d2c0cf684a5179e76e8e404b3a5d inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef5739280886eb7a98ae0e98371dae39 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef5739280886eb7a98ae0e98371dae39"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToString</b> () const </td></tr>
<tr class="separator:aef5739280886eb7a98ae0e98371dae39 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acff61b07d724079dc3a90d3e3fd57cb3 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acff61b07d724079dc3a90d3e3fd57cb3"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_string.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToDetailString</b> () const </td></tr>
<tr class="separator:acff61b07d724079dc3a90d3e3fd57cb3 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af40feaf010e829f2cdb787eb975b941d inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af40feaf010e829f2cdb787eb975b941d"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><b>ToObject</b> () const </td></tr>
<tr class="separator:af40feaf010e829f2cdb787eb975b941d inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3941f80b54b0707c6153657cc688ac93 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3941f80b54b0707c6153657cc688ac93"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_integer.html">Integer</a> > </td><td class="memItemRight" valign="bottom"><b>ToInteger</b> () const </td></tr>
<tr class="separator:a3941f80b54b0707c6153657cc688ac93 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aed71590ec8bd5ef7972d7a0d844b2cd7 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed71590ec8bd5ef7972d7a0d844b2cd7"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><b>ToUint32</b> () const </td></tr>
<tr class="separator:aed71590ec8bd5ef7972d7a0d844b2cd7 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adf5d2c0c0bf58d60f2401d8437df26b0 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf5d2c0c0bf58d60f2401d8437df26b0"></a>
<a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_int32.html">Int32</a> > </td><td class="memItemRight" valign="bottom"><b>ToInt32</b> () const </td></tr>
<tr class="separator:adf5d2c0c0bf58d60f2401d8437df26b0 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae810be0ae81a87f677592d0176daac48 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#ae810be0ae81a87f677592d0176daac48">ToArrayIndex</a> () const </td></tr>
<tr class="separator:ae810be0ae81a87f677592d0176daac48 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a392d60e0ab58b5b13c0ac1e5b4b9f04b inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a392d60e0ab58b5b13c0ac1e5b4b9f04b"></a>
bool </td><td class="memItemRight" valign="bottom"><b>BooleanValue</b> () const </td></tr>
<tr class="separator:a392d60e0ab58b5b13c0ac1e5b4b9f04b inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4634d525bae654cdc50c398bfaee11aa inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4634d525bae654cdc50c398bfaee11aa"></a>
double </td><td class="memItemRight" valign="bottom"><b>NumberValue</b> () const </td></tr>
<tr class="separator:a4634d525bae654cdc50c398bfaee11aa inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac61c74a94dea10f48a64f5906b6dd43d inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac61c74a94dea10f48a64f5906b6dd43d"></a>
int64_t </td><td class="memItemRight" valign="bottom"><b>IntegerValue</b> () const </td></tr>
<tr class="separator:ac61c74a94dea10f48a64f5906b6dd43d inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af25557359e6bb79436ed60df18703d66 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af25557359e6bb79436ed60df18703d66"></a>
uint32_t </td><td class="memItemRight" valign="bottom"><b>Uint32Value</b> () const </td></tr>
<tr class="separator:af25557359e6bb79436ed60df18703d66 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a24daae9d99d02ff2e24b60287dcd4d95 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a24daae9d99d02ff2e24b60287dcd4d95"></a>
int32_t </td><td class="memItemRight" valign="bottom"><b>Int32Value</b> () const </td></tr>
<tr class="separator:a24daae9d99d02ff2e24b60287dcd4d95 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adc2a7a92a120675bbd4c992163a20869 inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_value.html#adc2a7a92a120675bbd4c992163a20869">Equals</a> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > that) const </td></tr>
<tr class="separator:adc2a7a92a120675bbd4c992163a20869 inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abb564818715b818957adc97716a076ba inherit pub_methods_classv8_1_1_value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb564818715b818957adc97716a076ba"></a>
bool </td><td class="memItemRight" valign="bottom"><b>StrictEquals</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > that) const </td></tr>
<tr class="separator:abb564818715b818957adc97716a076ba inherit pub_methods_classv8_1_1_value"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a137e2318408130a5321413a58f977615"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a137e2318408130a5321413a58f977615"></a>
static <a class="el" href="classv8_1_1_local.html">Local</a>< <a class="el" href="classv8_1_1_value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>New</b> (double time)</td></tr>
<tr class="separator:a137e2318408130a5321413a58f977615"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8e5ea7c1f28924b82922270d6596b4d3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e5ea7c1f28924b82922270d6596b4d3"></a>
static <a class="el" href="classv8_1_1_date.html">Date</a> * </td><td class="memItemRight" valign="bottom"><b>Cast</b> (<a class="el" href="classv8_1_1_value.html">v8::Value</a> *obj)</td></tr>
<tr class="separator:a8e5ea7c1f28924b82922270d6596b4d3"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An instance of the built-in <a class="el" href="classv8_1_1_date.html">Date</a> constructor (ECMA-262, 15.9). </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a00ae69718a3810d82ae0b54b28d53512"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double v8::Date::NumberValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>A specialization of Value::NumberValue that is more efficient because we know the structure of this object. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:44:23 for V8 API Reference Guide for node.js v0.1.21 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| {'content_hash': '7f8bfe3e9df01aed69f7a9dc2c3bc39a', 'timestamp': '', 'source': 'github', 'line_count': 229, 'max_line_length': 430, 'avg_line_length': 97.50218340611353, 'alnum_prop': 0.7195897527767825, 'repo_name': 'v8-dox/v8-dox.github.io', 'id': '8fc0c18b4560c4008f8afd458ec1976d4f645c21', 'size': '22328', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'c8b6ef2/html/classv8_1_1_date.html', 'mode': '33188', 'license': 'mit', 'language': []} |
layout: page
title: "Kathy Escamilla"
comments: true
description: "blanks"
keywords: "Kathy Escamilla,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
font-family: "Bebas Neue";
src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
}
h1.Bebas {
font-family: "Bebas Neue", Verdana, Tahoma;
}
</style>
</head>
#### TEACHING INFORMATION
**College**: School of Education
**Classes taught**: EDUC 5425, EDUC 5435, EDUC 5445, EDUC 5525, EDUC 8014
#### EDUC 5425: Introduction to Bilingual/Multicultural Education
**Terms taught**: Spring 2010, Fall 2011
**Instructor rating**: 5.72
**Standard deviation in instructor rating**: 0.06
**Average grade** (4.0 scale): 3.89
**Standard deviation in grades** (4.0 scale): 0.11
**Average workload** (raw): 2.49
**Standard deviation in workload** (raw): 0.15
#### EDUC 5435: MAT/METH-BILING/MULT ED
**Terms taught**: Spring 2010
**Instructor rating**: 5.71
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 4.0
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 2.71
**Standard deviation in workload** (raw): 0.0
#### EDUC 5445: Curriculum for Multicultural Education
**Terms taught**: Spring 2011
**Instructor rating**: 5.52
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.86
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 2.95
**Standard deviation in workload** (raw): 0.0
#### EDUC 5525: Research Issues in Special Education
**Terms taught**: Fall 2014
**Instructor rating**: 5.73
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.97
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 3.56
**Standard deviation in workload** (raw): 0.0
#### EDUC 8014: Doctoral Seminar: Multiculturalism and Education
**Terms taught**: Fall 2015
**Instructor rating**: 4.14
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 4.0
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 2.0
**Standard deviation in workload** (raw): 0.0
| {'content_hash': '04ae2dbdb67ac6228f26c895cf0d7d50', 'timestamp': '', 'source': 'github', 'line_count': 106, 'max_line_length': 100, 'avg_line_length': 23.056603773584907, 'alnum_prop': 0.6873977086743044, 'repo_name': 'nikhilrajaram/nikhilrajaram.github.io', 'id': 'fb59e065d71739a8f3c9dae8046128faa28d580d', 'size': '2448', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'instructors/Kathy_Escamilla.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '15727'}, {'name': 'HTML', 'bytes': '48339721'}, {'name': 'Python', 'bytes': '9692'}, {'name': 'Ruby', 'bytes': '5940'}]} |
> see https://aka.ms/autorest
This is the AutoRest configuration file for DataLakeStore.
---
## Getting Started
To build the SDK for DataLakeStore, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:
> `autorest`
To see additional help and options, run:
> `autorest --help`
---
## Configuration
### Basic Information
These are the global settings for the DataLakeStore API.
``` yaml
openapi-type: arm
tag: package-2016-11
```
### Tag: package-2016-11
These settings apply only when `--tag=package-2016-11` is specified on the command line.
``` yaml $(tag) == 'package-2016-11'
input-file:
- Microsoft.DataLakeStore/stable/2016-11-01/account.json
```
### Tag: package-2015-10-preview
These settings apply only when `--tag=package-2015-10-preview` is specified on the command line.
``` yaml $(tag) == 'package-2015-10-preview'
title: DataLakeStoreAccountManagementClient
description: DataLake Store Client
input-file:
- Microsoft.DataLakeStore/preview/2015-10-01-preview/account.json
```
## Suppression
``` yaml
directive:
- suppress: TrackedResourceGetOperation
reason: This is by design in that we return DataLakeStoreAccountBasic only for Account_List
#where:
# - $.definitions.DataLakeStoreAccountBasic
- suppress: TrackedResourcePatchOperation
reason: DataLakeStoreAccountBasic is not independent and its purpose is for Account_List only. PATCH is for DataLakeStoreAccount, which will effectively update DataLakeStoreAccountBasic
#where:
# - $.definitions.DataLakeStoreAccountBasic
```
---
# Code Generation
## Swagger to SDK
This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-net
- repo: azure-sdk-for-python
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-node
- repo: azure-sdk-for-ruby
after_scripts:
- bundle install && rake arm:regen_all_profiles['azure_mgmt_datalake_store']
- repo: azure-resource-manager-schemas
after_scripts:
- node sdkauto_afterscript.js datalake-store/resource-manager
```
## C#
These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.
``` yaml $(csharp)
csharp:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
namespace: Microsoft.Azure.Management.DataLake.Store
output-folder: $(csharp-sdks-folder)/datalake-store/Microsoft.Azure.Management.DataLake.Store/src/Generated
clear-output-folder: true
```
## Python
See configuration in [readme.python.md](./readme.python.md)
## Go
See configuration in [readme.go.md](./readme.go.md)
## Java
These settings apply only when `--java` is specified on the command line.
Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-libraries-for-java clone>`.
``` yaml $(java)
azure-arm: true
fluent: true
namespace: com.microsoft.azure.management.datalake.store
license-header: MICROSOFT_MIT_NO_CODEGEN
output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-datalake/store
```
### Java multi-api
``` yaml $(java) && $(multiapi)
batch:
- tag: package-2015-10-preview
- tag: package-2016-11
```
### Tag: package-2015-10-preview and java
These settings apply only when `--tag=package-2015-10-preview --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.
``` yaml $(tag) == 'package-2015-10-preview' && $(java) && $(multiapi)
java:
namespace: com.microsoft.azure.management.datalakestore.v2015_10_01_preview
output-folder: $(azure-libraries-for-java-folder)/sdk/datalakestore/mgmt-v2015_10_01_preview
regenerate-manager: true
generate-interface: true
```
### Tag: package-2016-11 and java
These settings apply only when `--tag=package-2016-11 --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.
``` yaml $(tag) == 'package-2016-11' && $(java) && $(multiapi)
java:
namespace: com.microsoft.azure.management.datalakestore.v2016_11_01
output-folder: $(azure-libraries-for-java-folder)/sdk/datalakestore/mgmt-v2016_11_01
regenerate-manager: true
generate-interface: true
```
## AzureResourceSchema
See configuration in [readme.azureresourceschema.md](./readme.azureresourceschema.md)
| {'content_hash': '695fcb6675a7e574c6d51d3c3e1b0bdb', 'timestamp': '', 'source': 'github', 'line_count': 164, 'max_line_length': 190, 'avg_line_length': 27.95731707317073, 'alnum_prop': 0.7374045801526717, 'repo_name': 'AuxMon/azure-rest-api-specs', 'id': 'a82fc94f373d595527ee8adc9964a790399f04ae', 'size': '4602', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'specification/datalake-store/resource-manager/readme.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1418'}, {'name': 'Shell', 'bytes': '621'}, {'name': 'TypeScript', 'bytes': '6884'}]} |
using namespace llvm;
using namespace MIPatternMatch;
#define GET_GLOBALISEL_IMPL
#define AMDGPUSubtarget GCNSubtarget
#include "AMDGPUGenGlobalISel.inc"
#undef GET_GLOBALISEL_IMPL
#undef AMDGPUSubtarget
AMDGPUInstructionSelector::AMDGPUInstructionSelector(
const GCNSubtarget &STI, const AMDGPURegisterBankInfo &RBI,
const AMDGPUTargetMachine &TM)
: InstructionSelector(), TII(*STI.getInstrInfo()),
TRI(*STI.getRegisterInfo()), RBI(RBI), TM(TM),
STI(STI),
EnableLateStructurizeCFG(AMDGPUTargetMachine::EnableLateStructurizeCFG),
#define GET_GLOBALISEL_PREDICATES_INIT
#include "AMDGPUGenGlobalISel.inc"
#undef GET_GLOBALISEL_PREDICATES_INIT
#define GET_GLOBALISEL_TEMPORARIES_INIT
#include "AMDGPUGenGlobalISel.inc"
#undef GET_GLOBALISEL_TEMPORARIES_INIT
{
}
const char *AMDGPUInstructionSelector::getName() { return DEBUG_TYPE; }
void AMDGPUInstructionSelector::setupMF(MachineFunction &MF, GISelKnownBits &KB,
CodeGenCoverage &CoverageInfo) {
MRI = &MF.getRegInfo();
InstructionSelector::setupMF(MF, KB, CoverageInfo);
}
bool AMDGPUInstructionSelector::isVCC(Register Reg,
const MachineRegisterInfo &MRI) const {
if (Register::isPhysicalRegister(Reg))
return Reg == TRI.getVCC();
auto &RegClassOrBank = MRI.getRegClassOrRegBank(Reg);
const TargetRegisterClass *RC =
RegClassOrBank.dyn_cast<const TargetRegisterClass*>();
if (RC) {
const LLT Ty = MRI.getType(Reg);
return RC->hasSuperClassEq(TRI.getBoolRC()) &&
Ty.isValid() && Ty.getSizeInBits() == 1;
}
const RegisterBank *RB = RegClassOrBank.get<const RegisterBank *>();
return RB->getID() == AMDGPU::VCCRegBankID;
}
bool AMDGPUInstructionSelector::selectCOPY(MachineInstr &I) const {
const DebugLoc &DL = I.getDebugLoc();
MachineBasicBlock *BB = I.getParent();
I.setDesc(TII.get(TargetOpcode::COPY));
const MachineOperand &Src = I.getOperand(1);
MachineOperand &Dst = I.getOperand(0);
Register DstReg = Dst.getReg();
Register SrcReg = Src.getReg();
if (isVCC(DstReg, *MRI)) {
if (SrcReg == AMDGPU::SCC) {
const TargetRegisterClass *RC
= TRI.getConstrainedRegClassForOperand(Dst, *MRI);
if (!RC)
return true;
return RBI.constrainGenericRegister(DstReg, *RC, *MRI);
}
if (!isVCC(SrcReg, *MRI)) {
// TODO: Should probably leave the copy and let copyPhysReg expand it.
if (!RBI.constrainGenericRegister(DstReg, *TRI.getBoolRC(), *MRI))
return false;
const TargetRegisterClass *SrcRC
= TRI.getConstrainedRegClassForOperand(Src, *MRI);
Register MaskedReg = MRI->createVirtualRegister(SrcRC);
// We can't trust the high bits at this point, so clear them.
// TODO: Skip masking high bits if def is known boolean.
unsigned AndOpc = TRI.isSGPRClass(SrcRC) ?
AMDGPU::S_AND_B32 : AMDGPU::V_AND_B32_e32;
BuildMI(*BB, &I, DL, TII.get(AndOpc), MaskedReg)
.addImm(1)
.addReg(SrcReg);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_CMP_NE_U32_e64), DstReg)
.addImm(0)
.addReg(MaskedReg);
if (!MRI->getRegClassOrNull(SrcReg))
MRI->setRegClass(SrcReg, SrcRC);
I.eraseFromParent();
return true;
}
const TargetRegisterClass *RC =
TRI.getConstrainedRegClassForOperand(Dst, *MRI);
if (RC && !RBI.constrainGenericRegister(DstReg, *RC, *MRI))
return false;
// Don't constrain the source register to a class so the def instruction
// handles it (unless it's undef).
//
// FIXME: This is a hack. When selecting the def, we neeed to know
// specifically know that the result is VCCRegBank, and not just an SGPR
// with size 1. An SReg_32 with size 1 is ambiguous with wave32.
if (Src.isUndef()) {
const TargetRegisterClass *SrcRC =
TRI.getConstrainedRegClassForOperand(Src, *MRI);
if (SrcRC && !RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI))
return false;
}
return true;
}
for (const MachineOperand &MO : I.operands()) {
if (Register::isPhysicalRegister(MO.getReg()))
continue;
const TargetRegisterClass *RC =
TRI.getConstrainedRegClassForOperand(MO, *MRI);
if (!RC)
continue;
RBI.constrainGenericRegister(MO.getReg(), *RC, *MRI);
}
return true;
}
bool AMDGPUInstructionSelector::selectPHI(MachineInstr &I) const {
const Register DefReg = I.getOperand(0).getReg();
const LLT DefTy = MRI->getType(DefReg);
// TODO: Verify this doesn't have insane operands (i.e. VGPR to SGPR copy)
const RegClassOrRegBank &RegClassOrBank =
MRI->getRegClassOrRegBank(DefReg);
const TargetRegisterClass *DefRC
= RegClassOrBank.dyn_cast<const TargetRegisterClass *>();
if (!DefRC) {
if (!DefTy.isValid()) {
LLVM_DEBUG(dbgs() << "PHI operand has no type, not a gvreg?\n");
return false;
}
const RegisterBank &RB = *RegClassOrBank.get<const RegisterBank *>();
DefRC = TRI.getRegClassForTypeOnBank(DefTy, RB, *MRI);
if (!DefRC) {
LLVM_DEBUG(dbgs() << "PHI operand has unexpected size/bank\n");
return false;
}
}
// TODO: Verify that all registers have the same bank
I.setDesc(TII.get(TargetOpcode::PHI));
return RBI.constrainGenericRegister(DefReg, *DefRC, *MRI);
}
MachineOperand
AMDGPUInstructionSelector::getSubOperand64(MachineOperand &MO,
const TargetRegisterClass &SubRC,
unsigned SubIdx) const {
MachineInstr *MI = MO.getParent();
MachineBasicBlock *BB = MO.getParent()->getParent();
Register DstReg = MRI->createVirtualRegister(&SubRC);
if (MO.isReg()) {
unsigned ComposedSubIdx = TRI.composeSubRegIndices(MO.getSubReg(), SubIdx);
Register Reg = MO.getReg();
BuildMI(*BB, MI, MI->getDebugLoc(), TII.get(AMDGPU::COPY), DstReg)
.addReg(Reg, 0, ComposedSubIdx);
return MachineOperand::CreateReg(DstReg, MO.isDef(), MO.isImplicit(),
MO.isKill(), MO.isDead(), MO.isUndef(),
MO.isEarlyClobber(), 0, MO.isDebug(),
MO.isInternalRead());
}
assert(MO.isImm());
APInt Imm(64, MO.getImm());
switch (SubIdx) {
default:
llvm_unreachable("do not know to split immediate with this sub index.");
case AMDGPU::sub0:
return MachineOperand::CreateImm(Imm.getLoBits(32).getSExtValue());
case AMDGPU::sub1:
return MachineOperand::CreateImm(Imm.getHiBits(32).getSExtValue());
}
}
static unsigned getLogicalBitOpcode(unsigned Opc, bool Is64) {
switch (Opc) {
case AMDGPU::G_AND:
return Is64 ? AMDGPU::S_AND_B64 : AMDGPU::S_AND_B32;
case AMDGPU::G_OR:
return Is64 ? AMDGPU::S_OR_B64 : AMDGPU::S_OR_B32;
case AMDGPU::G_XOR:
return Is64 ? AMDGPU::S_XOR_B64 : AMDGPU::S_XOR_B32;
default:
llvm_unreachable("not a bit op");
}
}
bool AMDGPUInstructionSelector::selectG_AND_OR_XOR(MachineInstr &I) const {
MachineOperand &Dst = I.getOperand(0);
MachineOperand &Src0 = I.getOperand(1);
MachineOperand &Src1 = I.getOperand(2);
Register DstReg = Dst.getReg();
unsigned Size = RBI.getSizeInBits(DstReg, *MRI, TRI);
const RegisterBank *DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
if (DstRB->getID() == AMDGPU::VCCRegBankID) {
const TargetRegisterClass *RC = TRI.getBoolRC();
unsigned InstOpc = getLogicalBitOpcode(I.getOpcode(),
RC == &AMDGPU::SReg_64RegClass);
I.setDesc(TII.get(InstOpc));
// FIXME: Hack to avoid turning the register bank into a register class.
// The selector for G_ICMP relies on seeing the register bank for the result
// is VCC. In wave32 if we constrain the registers to SReg_32 here, it will
// be ambiguous whether it's a scalar or vector bool.
if (Src0.isUndef() && !MRI->getRegClassOrNull(Src0.getReg()))
MRI->setRegClass(Src0.getReg(), RC);
if (Src1.isUndef() && !MRI->getRegClassOrNull(Src1.getReg()))
MRI->setRegClass(Src1.getReg(), RC);
return RBI.constrainGenericRegister(DstReg, *RC, *MRI);
}
// TODO: Should this allow an SCC bank result, and produce a copy from SCC for
// the result?
if (DstRB->getID() == AMDGPU::SGPRRegBankID) {
unsigned InstOpc = getLogicalBitOpcode(I.getOpcode(), Size > 32);
I.setDesc(TII.get(InstOpc));
// Dead implicit-def of scc
I.addOperand(MachineOperand::CreateReg(AMDGPU::SCC, true, // isDef
true, // isImp
false, // isKill
true)); // isDead
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
return false;
}
bool AMDGPUInstructionSelector::selectG_ADD_SUB(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
MachineFunction *MF = BB->getParent();
Register DstReg = I.getOperand(0).getReg();
const DebugLoc &DL = I.getDebugLoc();
unsigned Size = RBI.getSizeInBits(DstReg, *MRI, TRI);
const RegisterBank *DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
const bool IsSALU = DstRB->getID() == AMDGPU::SGPRRegBankID;
const bool Sub = I.getOpcode() == TargetOpcode::G_SUB;
if (Size == 32) {
if (IsSALU) {
const unsigned Opc = Sub ? AMDGPU::S_SUB_U32 : AMDGPU::S_ADD_U32;
MachineInstr *Add =
BuildMI(*BB, &I, DL, TII.get(Opc), DstReg)
.add(I.getOperand(1))
.add(I.getOperand(2));
I.eraseFromParent();
return constrainSelectedInstRegOperands(*Add, TII, TRI, RBI);
}
if (STI.hasAddNoCarry()) {
const unsigned Opc = Sub ? AMDGPU::V_SUB_U32_e64 : AMDGPU::V_ADD_U32_e64;
I.setDesc(TII.get(Opc));
I.addOperand(*MF, MachineOperand::CreateImm(0));
I.addOperand(*MF, MachineOperand::CreateReg(AMDGPU::EXEC, false, true));
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
const unsigned Opc = Sub ? AMDGPU::V_SUB_I32_e64 : AMDGPU::V_ADD_I32_e64;
Register UnusedCarry = MRI->createVirtualRegister(TRI.getWaveMaskRegClass());
MachineInstr *Add
= BuildMI(*BB, &I, DL, TII.get(Opc), DstReg)
.addDef(UnusedCarry, RegState::Dead)
.add(I.getOperand(1))
.add(I.getOperand(2))
.addImm(0);
I.eraseFromParent();
return constrainSelectedInstRegOperands(*Add, TII, TRI, RBI);
}
assert(!Sub && "illegal sub should not reach here");
const TargetRegisterClass &RC
= IsSALU ? AMDGPU::SReg_64_XEXECRegClass : AMDGPU::VReg_64RegClass;
const TargetRegisterClass &HalfRC
= IsSALU ? AMDGPU::SReg_32RegClass : AMDGPU::VGPR_32RegClass;
MachineOperand Lo1(getSubOperand64(I.getOperand(1), HalfRC, AMDGPU::sub0));
MachineOperand Lo2(getSubOperand64(I.getOperand(2), HalfRC, AMDGPU::sub0));
MachineOperand Hi1(getSubOperand64(I.getOperand(1), HalfRC, AMDGPU::sub1));
MachineOperand Hi2(getSubOperand64(I.getOperand(2), HalfRC, AMDGPU::sub1));
Register DstLo = MRI->createVirtualRegister(&HalfRC);
Register DstHi = MRI->createVirtualRegister(&HalfRC);
if (IsSALU) {
BuildMI(*BB, &I, DL, TII.get(AMDGPU::S_ADD_U32), DstLo)
.add(Lo1)
.add(Lo2);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::S_ADDC_U32), DstHi)
.add(Hi1)
.add(Hi2);
} else {
const TargetRegisterClass *CarryRC = TRI.getWaveMaskRegClass();
Register CarryReg = MRI->createVirtualRegister(CarryRC);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_ADD_I32_e64), DstLo)
.addDef(CarryReg)
.add(Lo1)
.add(Lo2)
.addImm(0);
MachineInstr *Addc = BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_ADDC_U32_e64), DstHi)
.addDef(MRI->createVirtualRegister(CarryRC), RegState::Dead)
.add(Hi1)
.add(Hi2)
.addReg(CarryReg, RegState::Kill)
.addImm(0);
if (!constrainSelectedInstRegOperands(*Addc, TII, TRI, RBI))
return false;
}
BuildMI(*BB, &I, DL, TII.get(AMDGPU::REG_SEQUENCE), DstReg)
.addReg(DstLo)
.addImm(AMDGPU::sub0)
.addReg(DstHi)
.addImm(AMDGPU::sub1);
if (!RBI.constrainGenericRegister(DstReg, RC, *MRI))
return false;
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_UADDO_USUBO_UADDE_USUBE(
MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
MachineFunction *MF = BB->getParent();
const DebugLoc &DL = I.getDebugLoc();
Register Dst0Reg = I.getOperand(0).getReg();
Register Dst1Reg = I.getOperand(1).getReg();
const bool IsAdd = I.getOpcode() == AMDGPU::G_UADDO ||
I.getOpcode() == AMDGPU::G_UADDE;
const bool HasCarryIn = I.getOpcode() == AMDGPU::G_UADDE ||
I.getOpcode() == AMDGPU::G_USUBE;
if (isVCC(Dst1Reg, *MRI)) {
// The name of the opcodes are misleading. v_add_i32/v_sub_i32 have unsigned
// carry out despite the _i32 name. These were renamed in VI to _U32.
// FIXME: We should probably rename the opcodes here.
unsigned NoCarryOpc = IsAdd ? AMDGPU::V_ADD_I32_e64 : AMDGPU::V_SUB_I32_e64;
unsigned CarryOpc = IsAdd ? AMDGPU::V_ADDC_U32_e64 : AMDGPU::V_SUBB_U32_e64;
I.setDesc(TII.get(HasCarryIn ? CarryOpc : NoCarryOpc));
I.addOperand(*MF, MachineOperand::CreateReg(AMDGPU::EXEC, false, true));
I.addOperand(*MF, MachineOperand::CreateImm(0));
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
Register Src0Reg = I.getOperand(2).getReg();
Register Src1Reg = I.getOperand(3).getReg();
if (HasCarryIn) {
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), AMDGPU::SCC)
.addReg(I.getOperand(4).getReg());
}
unsigned NoCarryOpc = IsAdd ? AMDGPU::S_ADD_U32 : AMDGPU::S_SUB_U32;
unsigned CarryOpc = IsAdd ? AMDGPU::S_ADDC_U32 : AMDGPU::S_SUBB_U32;
BuildMI(*BB, &I, DL, TII.get(HasCarryIn ? CarryOpc : NoCarryOpc), Dst0Reg)
.add(I.getOperand(2))
.add(I.getOperand(3));
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), Dst1Reg)
.addReg(AMDGPU::SCC);
if (!MRI->getRegClassOrNull(Dst1Reg))
MRI->setRegClass(Dst1Reg, &AMDGPU::SReg_32RegClass);
if (!RBI.constrainGenericRegister(Dst0Reg, AMDGPU::SReg_32RegClass, *MRI) ||
!RBI.constrainGenericRegister(Src0Reg, AMDGPU::SReg_32RegClass, *MRI) ||
!RBI.constrainGenericRegister(Src1Reg, AMDGPU::SReg_32RegClass, *MRI))
return false;
if (HasCarryIn &&
!RBI.constrainGenericRegister(I.getOperand(4).getReg(),
AMDGPU::SReg_32RegClass, *MRI))
return false;
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_EXTRACT(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
Register DstReg = I.getOperand(0).getReg();
Register SrcReg = I.getOperand(1).getReg();
LLT DstTy = MRI->getType(DstReg);
LLT SrcTy = MRI->getType(SrcReg);
const unsigned SrcSize = SrcTy.getSizeInBits();
const unsigned DstSize = DstTy.getSizeInBits();
// TODO: Should handle any multiple of 32 offset.
unsigned Offset = I.getOperand(2).getImm();
if (Offset % DstSize != 0)
return false;
const RegisterBank *SrcBank = RBI.getRegBank(SrcReg, *MRI, TRI);
const TargetRegisterClass *SrcRC =
TRI.getRegClassForSizeOnBank(SrcSize, *SrcBank, *MRI);
if (!SrcRC)
return false;
ArrayRef<int16_t> SubRegs = TRI.getRegSplitParts(SrcRC, DstSize / 8);
const DebugLoc &DL = I.getDebugLoc();
MachineInstr *Copy = BuildMI(*BB, &I, DL, TII.get(TargetOpcode::COPY), DstReg)
.addReg(SrcReg, 0, SubRegs[Offset / DstSize]);
for (const MachineOperand &MO : Copy->operands()) {
const TargetRegisterClass *RC =
TRI.getConstrainedRegClassForOperand(MO, *MRI);
if (!RC)
continue;
RBI.constrainGenericRegister(MO.getReg(), *RC, *MRI);
}
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_MERGE_VALUES(MachineInstr &MI) const {
MachineBasicBlock *BB = MI.getParent();
Register DstReg = MI.getOperand(0).getReg();
LLT DstTy = MRI->getType(DstReg);
LLT SrcTy = MRI->getType(MI.getOperand(1).getReg());
const unsigned SrcSize = SrcTy.getSizeInBits();
if (SrcSize < 32)
return selectImpl(MI, *CoverageInfo);
const DebugLoc &DL = MI.getDebugLoc();
const RegisterBank *DstBank = RBI.getRegBank(DstReg, *MRI, TRI);
const unsigned DstSize = DstTy.getSizeInBits();
const TargetRegisterClass *DstRC =
TRI.getRegClassForSizeOnBank(DstSize, *DstBank, *MRI);
if (!DstRC)
return false;
ArrayRef<int16_t> SubRegs = TRI.getRegSplitParts(DstRC, SrcSize / 8);
MachineInstrBuilder MIB =
BuildMI(*BB, &MI, DL, TII.get(TargetOpcode::REG_SEQUENCE), DstReg);
for (int I = 0, E = MI.getNumOperands() - 1; I != E; ++I) {
MachineOperand &Src = MI.getOperand(I + 1);
MIB.addReg(Src.getReg(), getUndefRegState(Src.isUndef()));
MIB.addImm(SubRegs[I]);
const TargetRegisterClass *SrcRC
= TRI.getConstrainedRegClassForOperand(Src, *MRI);
if (SrcRC && !RBI.constrainGenericRegister(Src.getReg(), *SrcRC, *MRI))
return false;
}
if (!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI))
return false;
MI.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_UNMERGE_VALUES(MachineInstr &MI) const {
MachineBasicBlock *BB = MI.getParent();
const int NumDst = MI.getNumOperands() - 1;
MachineOperand &Src = MI.getOperand(NumDst);
Register SrcReg = Src.getReg();
Register DstReg0 = MI.getOperand(0).getReg();
LLT DstTy = MRI->getType(DstReg0);
LLT SrcTy = MRI->getType(SrcReg);
const unsigned DstSize = DstTy.getSizeInBits();
const unsigned SrcSize = SrcTy.getSizeInBits();
const DebugLoc &DL = MI.getDebugLoc();
const RegisterBank *SrcBank = RBI.getRegBank(SrcReg, *MRI, TRI);
const TargetRegisterClass *SrcRC =
TRI.getRegClassForSizeOnBank(SrcSize, *SrcBank, *MRI);
if (!SrcRC || !RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI))
return false;
const unsigned SrcFlags = getUndefRegState(Src.isUndef());
// Note we could have mixed SGPR and VGPR destination banks for an SGPR
// source, and this relies on the fact that the same subregister indices are
// used for both.
ArrayRef<int16_t> SubRegs = TRI.getRegSplitParts(SrcRC, DstSize / 8);
for (int I = 0, E = NumDst; I != E; ++I) {
MachineOperand &Dst = MI.getOperand(I);
BuildMI(*BB, &MI, DL, TII.get(TargetOpcode::COPY), Dst.getReg())
.addReg(SrcReg, SrcFlags, SubRegs[I]);
const TargetRegisterClass *DstRC =
TRI.getConstrainedRegClassForOperand(Dst, *MRI);
if (DstRC && !RBI.constrainGenericRegister(Dst.getReg(), *DstRC, *MRI))
return false;
}
MI.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_PTR_ADD(MachineInstr &I) const {
return selectG_ADD_SUB(I);
}
bool AMDGPUInstructionSelector::selectG_IMPLICIT_DEF(MachineInstr &I) const {
const MachineOperand &MO = I.getOperand(0);
// FIXME: Interface for getConstrainedRegClassForOperand needs work. The
// regbank check here is to know why getConstrainedRegClassForOperand failed.
const TargetRegisterClass *RC = TRI.getConstrainedRegClassForOperand(MO, *MRI);
if ((!RC && !MRI->getRegBankOrNull(MO.getReg())) ||
(RC && RBI.constrainGenericRegister(MO.getReg(), *RC, *MRI))) {
I.setDesc(TII.get(TargetOpcode::IMPLICIT_DEF));
return true;
}
return false;
}
bool AMDGPUInstructionSelector::selectG_INSERT(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
Register DstReg = I.getOperand(0).getReg();
Register Src0Reg = I.getOperand(1).getReg();
Register Src1Reg = I.getOperand(2).getReg();
LLT Src1Ty = MRI->getType(Src1Reg);
unsigned DstSize = MRI->getType(DstReg).getSizeInBits();
unsigned InsSize = Src1Ty.getSizeInBits();
int64_t Offset = I.getOperand(3).getImm();
if (Offset % 32 != 0)
return false;
unsigned SubReg = TRI.getSubRegFromChannel(Offset / 32, InsSize / 32);
if (SubReg == AMDGPU::NoSubRegister)
return false;
const RegisterBank *DstBank = RBI.getRegBank(DstReg, *MRI, TRI);
const TargetRegisterClass *DstRC =
TRI.getRegClassForSizeOnBank(DstSize, *DstBank, *MRI);
if (!DstRC)
return false;
const RegisterBank *Src0Bank = RBI.getRegBank(Src0Reg, *MRI, TRI);
const RegisterBank *Src1Bank = RBI.getRegBank(Src1Reg, *MRI, TRI);
const TargetRegisterClass *Src0RC =
TRI.getRegClassForSizeOnBank(DstSize, *Src0Bank, *MRI);
const TargetRegisterClass *Src1RC =
TRI.getRegClassForSizeOnBank(InsSize, *Src1Bank, *MRI);
// Deal with weird cases where the class only partially supports the subreg
// index.
Src0RC = TRI.getSubClassWithSubReg(Src0RC, SubReg);
if (!Src0RC)
return false;
if (!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI) ||
!RBI.constrainGenericRegister(Src0Reg, *Src0RC, *MRI) ||
!RBI.constrainGenericRegister(Src1Reg, *Src1RC, *MRI))
return false;
const DebugLoc &DL = I.getDebugLoc();
BuildMI(*BB, &I, DL, TII.get(TargetOpcode::INSERT_SUBREG), DstReg)
.addReg(Src0Reg)
.addReg(Src1Reg)
.addImm(SubReg);
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_INTRINSIC(MachineInstr &I) const {
unsigned IntrinsicID = I.getIntrinsicID();
switch (IntrinsicID) {
case Intrinsic::amdgcn_if_break: {
MachineBasicBlock *BB = I.getParent();
// FIXME: Manually selecting to avoid dealiing with the SReg_1 trick
// SelectionDAG uses for wave32 vs wave64.
BuildMI(*BB, &I, I.getDebugLoc(), TII.get(AMDGPU::SI_IF_BREAK))
.add(I.getOperand(0))
.add(I.getOperand(2))
.add(I.getOperand(3));
Register DstReg = I.getOperand(0).getReg();
Register Src0Reg = I.getOperand(2).getReg();
Register Src1Reg = I.getOperand(3).getReg();
I.eraseFromParent();
for (Register Reg : { DstReg, Src0Reg, Src1Reg })
MRI->setRegClass(Reg, TRI.getWaveMaskRegClass());
return true;
}
default:
return selectImpl(I, *CoverageInfo);
}
}
static int getV_CMPOpcode(CmpInst::Predicate P, unsigned Size) {
if (Size != 32 && Size != 64)
return -1;
switch (P) {
default:
llvm_unreachable("Unknown condition code!");
case CmpInst::ICMP_NE:
return Size == 32 ? AMDGPU::V_CMP_NE_U32_e64 : AMDGPU::V_CMP_NE_U64_e64;
case CmpInst::ICMP_EQ:
return Size == 32 ? AMDGPU::V_CMP_EQ_U32_e64 : AMDGPU::V_CMP_EQ_U64_e64;
case CmpInst::ICMP_SGT:
return Size == 32 ? AMDGPU::V_CMP_GT_I32_e64 : AMDGPU::V_CMP_GT_I64_e64;
case CmpInst::ICMP_SGE:
return Size == 32 ? AMDGPU::V_CMP_GE_I32_e64 : AMDGPU::V_CMP_GE_I64_e64;
case CmpInst::ICMP_SLT:
return Size == 32 ? AMDGPU::V_CMP_LT_I32_e64 : AMDGPU::V_CMP_LT_I64_e64;
case CmpInst::ICMP_SLE:
return Size == 32 ? AMDGPU::V_CMP_LE_I32_e64 : AMDGPU::V_CMP_LE_I64_e64;
case CmpInst::ICMP_UGT:
return Size == 32 ? AMDGPU::V_CMP_GT_U32_e64 : AMDGPU::V_CMP_GT_U64_e64;
case CmpInst::ICMP_UGE:
return Size == 32 ? AMDGPU::V_CMP_GE_U32_e64 : AMDGPU::V_CMP_GE_U64_e64;
case CmpInst::ICMP_ULT:
return Size == 32 ? AMDGPU::V_CMP_LT_U32_e64 : AMDGPU::V_CMP_LT_U64_e64;
case CmpInst::ICMP_ULE:
return Size == 32 ? AMDGPU::V_CMP_LE_U32_e64 : AMDGPU::V_CMP_LE_U64_e64;
}
}
int AMDGPUInstructionSelector::getS_CMPOpcode(CmpInst::Predicate P,
unsigned Size) const {
if (Size == 64) {
if (!STI.hasScalarCompareEq64())
return -1;
switch (P) {
case CmpInst::ICMP_NE:
return AMDGPU::S_CMP_LG_U64;
case CmpInst::ICMP_EQ:
return AMDGPU::S_CMP_EQ_U64;
default:
return -1;
}
}
if (Size != 32)
return -1;
switch (P) {
case CmpInst::ICMP_NE:
return AMDGPU::S_CMP_LG_U32;
case CmpInst::ICMP_EQ:
return AMDGPU::S_CMP_EQ_U32;
case CmpInst::ICMP_SGT:
return AMDGPU::S_CMP_GT_I32;
case CmpInst::ICMP_SGE:
return AMDGPU::S_CMP_GE_I32;
case CmpInst::ICMP_SLT:
return AMDGPU::S_CMP_LT_I32;
case CmpInst::ICMP_SLE:
return AMDGPU::S_CMP_LE_I32;
case CmpInst::ICMP_UGT:
return AMDGPU::S_CMP_GT_U32;
case CmpInst::ICMP_UGE:
return AMDGPU::S_CMP_GE_U32;
case CmpInst::ICMP_ULT:
return AMDGPU::S_CMP_LT_U32;
case CmpInst::ICMP_ULE:
return AMDGPU::S_CMP_LE_U32;
default:
llvm_unreachable("Unknown condition code!");
}
}
bool AMDGPUInstructionSelector::selectG_ICMP(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
const DebugLoc &DL = I.getDebugLoc();
Register SrcReg = I.getOperand(2).getReg();
unsigned Size = RBI.getSizeInBits(SrcReg, *MRI, TRI);
auto Pred = (CmpInst::Predicate)I.getOperand(1).getPredicate();
Register CCReg = I.getOperand(0).getReg();
if (!isVCC(CCReg, *MRI)) {
int Opcode = getS_CMPOpcode(Pred, Size);
if (Opcode == -1)
return false;
MachineInstr *ICmp = BuildMI(*BB, &I, DL, TII.get(Opcode))
.add(I.getOperand(2))
.add(I.getOperand(3));
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), CCReg)
.addReg(AMDGPU::SCC);
bool Ret =
constrainSelectedInstRegOperands(*ICmp, TII, TRI, RBI) &&
RBI.constrainGenericRegister(CCReg, AMDGPU::SReg_32RegClass, *MRI);
I.eraseFromParent();
return Ret;
}
int Opcode = getV_CMPOpcode(Pred, Size);
if (Opcode == -1)
return false;
MachineInstr *ICmp = BuildMI(*BB, &I, DL, TII.get(Opcode),
I.getOperand(0).getReg())
.add(I.getOperand(2))
.add(I.getOperand(3));
RBI.constrainGenericRegister(ICmp->getOperand(0).getReg(),
*TRI.getBoolRC(), *MRI);
bool Ret = constrainSelectedInstRegOperands(*ICmp, TII, TRI, RBI);
I.eraseFromParent();
return Ret;
}
static MachineInstr *
buildEXP(const TargetInstrInfo &TII, MachineInstr *Insert, unsigned Tgt,
unsigned Reg0, unsigned Reg1, unsigned Reg2, unsigned Reg3,
unsigned VM, bool Compr, unsigned Enabled, bool Done) {
const DebugLoc &DL = Insert->getDebugLoc();
MachineBasicBlock &BB = *Insert->getParent();
unsigned Opcode = Done ? AMDGPU::EXP_DONE : AMDGPU::EXP;
return BuildMI(BB, Insert, DL, TII.get(Opcode))
.addImm(Tgt)
.addReg(Reg0)
.addReg(Reg1)
.addReg(Reg2)
.addReg(Reg3)
.addImm(VM)
.addImm(Compr)
.addImm(Enabled);
}
static bool isZero(Register Reg, MachineRegisterInfo &MRI) {
int64_t C;
if (mi_match(Reg, MRI, m_ICst(C)) && C == 0)
return true;
// FIXME: matcher should ignore copies
return mi_match(Reg, MRI, m_Copy(m_ICst(C))) && C == 0;
}
static unsigned extractGLC(unsigned AuxiliaryData) {
return AuxiliaryData & 1;
}
static unsigned extractSLC(unsigned AuxiliaryData) {
return (AuxiliaryData >> 1) & 1;
}
static unsigned extractDLC(unsigned AuxiliaryData) {
return (AuxiliaryData >> 2) & 1;
}
static unsigned extractSWZ(unsigned AuxiliaryData) {
return (AuxiliaryData >> 3) & 1;
}
static unsigned getBufferStoreOpcode(LLT Ty,
const unsigned MemSize,
const bool Offen) {
const int Size = Ty.getSizeInBits();
switch (8 * MemSize) {
case 8:
return Offen ? AMDGPU::BUFFER_STORE_BYTE_OFFEN_exact :
AMDGPU::BUFFER_STORE_BYTE_OFFSET_exact;
case 16:
return Offen ? AMDGPU::BUFFER_STORE_SHORT_OFFEN_exact :
AMDGPU::BUFFER_STORE_SHORT_OFFSET_exact;
default:
unsigned Opc = Offen ? AMDGPU::BUFFER_STORE_DWORD_OFFEN_exact :
AMDGPU::BUFFER_STORE_DWORD_OFFSET_exact;
if (Size > 32)
Opc = AMDGPU::getMUBUFOpcode(Opc, Size / 32);
return Opc;
}
}
static unsigned getBufferStoreFormatOpcode(LLT Ty,
const unsigned MemSize,
const bool Offen) {
bool IsD16Packed = Ty.getScalarSizeInBits() == 16;
bool IsD16Unpacked = 8 * MemSize < Ty.getSizeInBits();
int NumElts = Ty.isVector() ? Ty.getNumElements() : 1;
if (IsD16Packed) {
switch (NumElts) {
case 1:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_X_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_X_OFFSET_exact;
case 2:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XY_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XY_OFFSET_exact;
case 3:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XYZ_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XYZ_OFFSET_exact;
case 4:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XYZW_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XYZW_OFFSET_exact;
default:
return -1;
}
}
if (IsD16Unpacked) {
switch (NumElts) {
case 1:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_X_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_X_OFFSET_exact;
case 2:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XY_gfx80_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XY_gfx80_OFFSET_exact;
case 3:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XYZ_gfx80_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XYZ_gfx80_OFFSET_exact;
case 4:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_D16_XYZW_gfx80_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_D16_XYZW_gfx80_OFFSET_exact;
default:
return -1;
}
}
switch (NumElts) {
case 1:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_X_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_X_OFFSET_exact;
case 2:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_XY_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_XY_OFFSET_exact;
case 3:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_XYZ_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_XYZ_OFFSET_exact;
case 4:
return Offen ? AMDGPU::BUFFER_STORE_FORMAT_XYZW_OFFEN_exact :
AMDGPU::BUFFER_STORE_FORMAT_XYZW_OFFSET_exact;
default:
return -1;
}
llvm_unreachable("unhandled buffer store");
}
// TODO: Move this to combiner
// Returns base register, imm offset, total constant offset.
std::tuple<Register, unsigned, unsigned>
AMDGPUInstructionSelector::splitBufferOffsets(MachineIRBuilder &B,
Register OrigOffset) const {
const unsigned MaxImm = 4095;
Register BaseReg;
unsigned TotalConstOffset;
MachineInstr *OffsetDef;
std::tie(BaseReg, TotalConstOffset, OffsetDef)
= AMDGPU::getBaseWithConstantOffset(*MRI, OrigOffset);
unsigned ImmOffset = TotalConstOffset;
// If the immediate value is too big for the immoffset field, put the value
// and -4096 into the immoffset field so that the value that is copied/added
// for the voffset field is a multiple of 4096, and it stands more chance
// of being CSEd with the copy/add for another similar load/store.f
// However, do not do that rounding down to a multiple of 4096 if that is a
// negative number, as it appears to be illegal to have a negative offset
// in the vgpr, even if adding the immediate offset makes it positive.
unsigned Overflow = ImmOffset & ~MaxImm;
ImmOffset -= Overflow;
if ((int32_t)Overflow < 0) {
Overflow += ImmOffset;
ImmOffset = 0;
}
if (Overflow != 0) {
// In case this is in a waterfall loop, insert offset code at the def point
// of the offset, not inside the loop.
MachineBasicBlock::iterator OldInsPt = B.getInsertPt();
MachineBasicBlock &OldMBB = B.getMBB();
B.setInstr(*OffsetDef);
if (!BaseReg) {
BaseReg = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
B.buildInstr(AMDGPU::V_MOV_B32_e32)
.addDef(BaseReg)
.addImm(Overflow);
} else {
Register OverflowVal = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
B.buildInstr(AMDGPU::V_MOV_B32_e32)
.addDef(OverflowVal)
.addImm(Overflow);
Register NewBaseReg = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
TII.getAddNoCarry(B.getMBB(), B.getInsertPt(), B.getDebugLoc(), NewBaseReg)
.addReg(BaseReg)
.addReg(OverflowVal, RegState::Kill)
.addImm(0);
BaseReg = NewBaseReg;
}
B.setInsertPt(OldMBB, OldInsPt);
}
return std::make_tuple(BaseReg, ImmOffset, TotalConstOffset);
}
bool AMDGPUInstructionSelector::selectStoreIntrinsic(MachineInstr &MI,
bool IsFormat) const {
MachineIRBuilder B(MI);
MachineFunction &MF = B.getMF();
Register VData = MI.getOperand(1).getReg();
LLT Ty = MRI->getType(VData);
int Size = Ty.getSizeInBits();
if (Size % 32 != 0)
return false;
// FIXME: Verifier should enforce 1 MMO for these intrinsics.
MachineMemOperand *MMO = *MI.memoperands_begin();
const int MemSize = MMO->getSize();
Register RSrc = MI.getOperand(2).getReg();
Register VOffset = MI.getOperand(3).getReg();
Register SOffset = MI.getOperand(4).getReg();
unsigned AuxiliaryData = MI.getOperand(5).getImm();
unsigned ImmOffset;
unsigned TotalOffset;
std::tie(VOffset, ImmOffset, TotalOffset) = splitBufferOffsets(B, VOffset);
if (TotalOffset != 0)
MMO = MF.getMachineMemOperand(MMO, TotalOffset, MemSize);
const bool Offen = !isZero(VOffset, *MRI);
int Opc = IsFormat ? getBufferStoreFormatOpcode(Ty, MemSize, Offen) :
getBufferStoreOpcode(Ty, MemSize, Offen);
if (Opc == -1)
return false;
MachineInstrBuilder MIB = B.buildInstr(Opc)
.addUse(VData);
if (Offen)
MIB.addUse(VOffset);
MIB.addUse(RSrc)
.addUse(SOffset)
.addImm(ImmOffset)
.addImm(extractGLC(AuxiliaryData))
.addImm(extractSLC(AuxiliaryData))
.addImm(0) // tfe: FIXME: Remove from inst
.addImm(extractDLC(AuxiliaryData))
.addImm(extractSWZ(AuxiliaryData))
.addMemOperand(MMO);
MI.eraseFromParent();
return constrainSelectedInstRegOperands(*MIB, TII, TRI, RBI);
}
static unsigned getDSShaderTypeValue(const MachineFunction &MF) {
switch (MF.getFunction().getCallingConv()) {
case CallingConv::AMDGPU_PS:
return 1;
case CallingConv::AMDGPU_VS:
return 2;
case CallingConv::AMDGPU_GS:
return 3;
case CallingConv::AMDGPU_HS:
case CallingConv::AMDGPU_LS:
case CallingConv::AMDGPU_ES:
report_fatal_error("ds_ordered_count unsupported for this calling conv");
case CallingConv::AMDGPU_CS:
case CallingConv::AMDGPU_KERNEL:
case CallingConv::C:
case CallingConv::Fast:
default:
// Assume other calling conventions are various compute callable functions
return 0;
}
}
bool AMDGPUInstructionSelector::selectDSOrderedIntrinsic(
MachineInstr &MI, Intrinsic::ID IntrID) const {
MachineBasicBlock *MBB = MI.getParent();
MachineFunction *MF = MBB->getParent();
const DebugLoc &DL = MI.getDebugLoc();
unsigned IndexOperand = MI.getOperand(7).getImm();
bool WaveRelease = MI.getOperand(8).getImm() != 0;
bool WaveDone = MI.getOperand(9).getImm() != 0;
if (WaveDone && !WaveRelease)
report_fatal_error("ds_ordered_count: wave_done requires wave_release");
unsigned OrderedCountIndex = IndexOperand & 0x3f;
IndexOperand &= ~0x3f;
unsigned CountDw = 0;
if (STI.getGeneration() >= AMDGPUSubtarget::GFX10) {
CountDw = (IndexOperand >> 24) & 0xf;
IndexOperand &= ~(0xf << 24);
if (CountDw < 1 || CountDw > 4) {
report_fatal_error(
"ds_ordered_count: dword count must be between 1 and 4");
}
}
if (IndexOperand)
report_fatal_error("ds_ordered_count: bad index operand");
unsigned Instruction = IntrID == Intrinsic::amdgcn_ds_ordered_add ? 0 : 1;
unsigned ShaderType = getDSShaderTypeValue(*MF);
unsigned Offset0 = OrderedCountIndex << 2;
unsigned Offset1 = WaveRelease | (WaveDone << 1) | (ShaderType << 2) |
(Instruction << 4);
if (STI.getGeneration() >= AMDGPUSubtarget::GFX10)
Offset1 |= (CountDw - 1) << 6;
unsigned Offset = Offset0 | (Offset1 << 8);
Register M0Val = MI.getOperand(2).getReg();
BuildMI(*MBB, &MI, DL, TII.get(AMDGPU::COPY), AMDGPU::M0)
.addReg(M0Val);
Register DstReg = MI.getOperand(0).getReg();
Register ValReg = MI.getOperand(3).getReg();
MachineInstrBuilder DS =
BuildMI(*MBB, &MI, DL, TII.get(AMDGPU::DS_ORDERED_COUNT), DstReg)
.addReg(ValReg)
.addImm(Offset)
.cloneMemRefs(MI);
if (!RBI.constrainGenericRegister(M0Val, AMDGPU::SReg_32RegClass, *MRI))
return false;
bool Ret = constrainSelectedInstRegOperands(*DS, TII, TRI, RBI);
MI.eraseFromParent();
return Ret;
}
bool AMDGPUInstructionSelector::selectG_INTRINSIC_W_SIDE_EFFECTS(
MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
unsigned IntrinsicID = I.getIntrinsicID();
switch (IntrinsicID) {
case Intrinsic::amdgcn_exp: {
int64_t Tgt = I.getOperand(1).getImm();
int64_t Enabled = I.getOperand(2).getImm();
int64_t Done = I.getOperand(7).getImm();
int64_t VM = I.getOperand(8).getImm();
MachineInstr *Exp = buildEXP(TII, &I, Tgt, I.getOperand(3).getReg(),
I.getOperand(4).getReg(),
I.getOperand(5).getReg(),
I.getOperand(6).getReg(),
VM, false, Enabled, Done);
I.eraseFromParent();
return constrainSelectedInstRegOperands(*Exp, TII, TRI, RBI);
}
case Intrinsic::amdgcn_exp_compr: {
const DebugLoc &DL = I.getDebugLoc();
int64_t Tgt = I.getOperand(1).getImm();
int64_t Enabled = I.getOperand(2).getImm();
Register Reg0 = I.getOperand(3).getReg();
Register Reg1 = I.getOperand(4).getReg();
Register Undef = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
int64_t Done = I.getOperand(5).getImm();
int64_t VM = I.getOperand(6).getImm();
BuildMI(*BB, &I, DL, TII.get(AMDGPU::IMPLICIT_DEF), Undef);
MachineInstr *Exp = buildEXP(TII, &I, Tgt, Reg0, Reg1, Undef, Undef, VM,
true, Enabled, Done);
I.eraseFromParent();
return constrainSelectedInstRegOperands(*Exp, TII, TRI, RBI);
}
case Intrinsic::amdgcn_end_cf: {
// FIXME: Manually selecting to avoid dealiing with the SReg_1 trick
// SelectionDAG uses for wave32 vs wave64.
BuildMI(*BB, &I, I.getDebugLoc(),
TII.get(AMDGPU::SI_END_CF))
.add(I.getOperand(1));
Register Reg = I.getOperand(1).getReg();
I.eraseFromParent();
if (!MRI->getRegClassOrNull(Reg))
MRI->setRegClass(Reg, TRI.getWaveMaskRegClass());
return true;
}
case Intrinsic::amdgcn_raw_buffer_store:
return selectStoreIntrinsic(I, false);
case Intrinsic::amdgcn_raw_buffer_store_format:
return selectStoreIntrinsic(I, true);
case Intrinsic::amdgcn_ds_ordered_add:
case Intrinsic::amdgcn_ds_ordered_swap:
return selectDSOrderedIntrinsic(I, IntrinsicID);
default:
return selectImpl(I, *CoverageInfo);
}
}
bool AMDGPUInstructionSelector::selectG_SELECT(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
const DebugLoc &DL = I.getDebugLoc();
Register DstReg = I.getOperand(0).getReg();
unsigned Size = RBI.getSizeInBits(DstReg, *MRI, TRI);
assert(Size <= 32 || Size == 64);
const MachineOperand &CCOp = I.getOperand(1);
Register CCReg = CCOp.getReg();
if (!isVCC(CCReg, *MRI)) {
unsigned SelectOpcode = Size == 64 ? AMDGPU::S_CSELECT_B64 :
AMDGPU::S_CSELECT_B32;
MachineInstr *CopySCC = BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), AMDGPU::SCC)
.addReg(CCReg);
// The generic constrainSelectedInstRegOperands doesn't work for the scc register
// bank, because it does not cover the register class that we used to represent
// for it. So we need to manually set the register class here.
if (!MRI->getRegClassOrNull(CCReg))
MRI->setRegClass(CCReg, TRI.getConstrainedRegClassForOperand(CCOp, *MRI));
MachineInstr *Select = BuildMI(*BB, &I, DL, TII.get(SelectOpcode), DstReg)
.add(I.getOperand(2))
.add(I.getOperand(3));
bool Ret = constrainSelectedInstRegOperands(*Select, TII, TRI, RBI) |
constrainSelectedInstRegOperands(*CopySCC, TII, TRI, RBI);
I.eraseFromParent();
return Ret;
}
// Wide VGPR select should have been split in RegBankSelect.
if (Size > 32)
return false;
MachineInstr *Select =
BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_CNDMASK_B32_e64), DstReg)
.addImm(0)
.add(I.getOperand(3))
.addImm(0)
.add(I.getOperand(2))
.add(I.getOperand(1));
bool Ret = constrainSelectedInstRegOperands(*Select, TII, TRI, RBI);
I.eraseFromParent();
return Ret;
}
bool AMDGPUInstructionSelector::selectG_STORE(MachineInstr &I) const {
initM0(I);
return selectImpl(I, *CoverageInfo);
}
static int sizeToSubRegIndex(unsigned Size) {
switch (Size) {
case 32:
return AMDGPU::sub0;
case 64:
return AMDGPU::sub0_sub1;
case 96:
return AMDGPU::sub0_sub1_sub2;
case 128:
return AMDGPU::sub0_sub1_sub2_sub3;
case 256:
return AMDGPU::sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7;
default:
if (Size < 32)
return AMDGPU::sub0;
if (Size > 256)
return -1;
return sizeToSubRegIndex(PowerOf2Ceil(Size));
}
}
bool AMDGPUInstructionSelector::selectG_TRUNC(MachineInstr &I) const {
Register DstReg = I.getOperand(0).getReg();
Register SrcReg = I.getOperand(1).getReg();
const LLT DstTy = MRI->getType(DstReg);
const LLT SrcTy = MRI->getType(SrcReg);
if (!DstTy.isScalar())
return false;
const LLT S1 = LLT::scalar(1);
const RegisterBank *SrcRB = RBI.getRegBank(SrcReg, *MRI, TRI);
const RegisterBank *DstRB;
if (DstTy == S1) {
// This is a special case. We don't treat s1 for legalization artifacts as
// vcc booleans.
DstRB = SrcRB;
} else {
DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
if (SrcRB != DstRB)
return false;
}
unsigned DstSize = DstTy.getSizeInBits();
unsigned SrcSize = SrcTy.getSizeInBits();
const TargetRegisterClass *SrcRC
= TRI.getRegClassForSizeOnBank(SrcSize, *SrcRB, *MRI);
const TargetRegisterClass *DstRC
= TRI.getRegClassForSizeOnBank(DstSize, *DstRB, *MRI);
if (SrcSize > 32) {
int SubRegIdx = sizeToSubRegIndex(DstSize);
if (SubRegIdx == -1)
return false;
// Deal with weird cases where the class only partially supports the subreg
// index.
SrcRC = TRI.getSubClassWithSubReg(SrcRC, SubRegIdx);
if (!SrcRC)
return false;
I.getOperand(1).setSubReg(SubRegIdx);
}
if (!RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI) ||
!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI)) {
LLVM_DEBUG(dbgs() << "Failed to constrain G_TRUNC\n");
return false;
}
I.setDesc(TII.get(TargetOpcode::COPY));
return true;
}
/// \returns true if a bitmask for \p Size bits will be an inline immediate.
static bool shouldUseAndMask(unsigned Size, unsigned &Mask) {
Mask = maskTrailingOnes<unsigned>(Size);
int SignedMask = static_cast<int>(Mask);
return SignedMask >= -16 && SignedMask <= 64;
}
// Like RegisterBankInfo::getRegBank, but don't assume vcc for s1.
const RegisterBank *AMDGPUInstructionSelector::getArtifactRegBank(
Register Reg, const MachineRegisterInfo &MRI,
const TargetRegisterInfo &TRI) const {
const RegClassOrRegBank &RegClassOrBank = MRI.getRegClassOrRegBank(Reg);
if (auto *RB = RegClassOrBank.dyn_cast<const RegisterBank *>())
return RB;
// Ignore the type, since we don't use vcc in artifacts.
if (auto *RC = RegClassOrBank.dyn_cast<const TargetRegisterClass *>())
return &RBI.getRegBankFromRegClass(*RC, LLT());
return nullptr;
}
bool AMDGPUInstructionSelector::selectG_SZA_EXT(MachineInstr &I) const {
bool Signed = I.getOpcode() == AMDGPU::G_SEXT;
const DebugLoc &DL = I.getDebugLoc();
MachineBasicBlock &MBB = *I.getParent();
const Register DstReg = I.getOperand(0).getReg();
const Register SrcReg = I.getOperand(1).getReg();
const LLT DstTy = MRI->getType(DstReg);
const LLT SrcTy = MRI->getType(SrcReg);
const unsigned SrcSize = SrcTy.getSizeInBits();
const unsigned DstSize = DstTy.getSizeInBits();
if (!DstTy.isScalar())
return false;
if (I.getOpcode() == AMDGPU::G_ANYEXT)
return selectCOPY(I);
// Artifact casts should never use vcc.
const RegisterBank *SrcBank = getArtifactRegBank(SrcReg, *MRI, TRI);
if (SrcBank->getID() == AMDGPU::VGPRRegBankID && DstSize <= 32) {
// 64-bit should have been split up in RegBankSelect
// Try to use an and with a mask if it will save code size.
unsigned Mask;
if (!Signed && shouldUseAndMask(SrcSize, Mask)) {
MachineInstr *ExtI =
BuildMI(MBB, I, DL, TII.get(AMDGPU::V_AND_B32_e32), DstReg)
.addImm(Mask)
.addReg(SrcReg);
I.eraseFromParent();
return constrainSelectedInstRegOperands(*ExtI, TII, TRI, RBI);
}
const unsigned BFE = Signed ? AMDGPU::V_BFE_I32 : AMDGPU::V_BFE_U32;
MachineInstr *ExtI =
BuildMI(MBB, I, DL, TII.get(BFE), DstReg)
.addReg(SrcReg)
.addImm(0) // Offset
.addImm(SrcSize); // Width
I.eraseFromParent();
return constrainSelectedInstRegOperands(*ExtI, TII, TRI, RBI);
}
if (SrcBank->getID() == AMDGPU::SGPRRegBankID && DstSize <= 64) {
if (!RBI.constrainGenericRegister(SrcReg, AMDGPU::SReg_32RegClass, *MRI))
return false;
if (Signed && DstSize == 32 && (SrcSize == 8 || SrcSize == 16)) {
const unsigned SextOpc = SrcSize == 8 ?
AMDGPU::S_SEXT_I32_I8 : AMDGPU::S_SEXT_I32_I16;
BuildMI(MBB, I, DL, TII.get(SextOpc), DstReg)
.addReg(SrcReg);
I.eraseFromParent();
return RBI.constrainGenericRegister(DstReg, AMDGPU::SReg_32RegClass, *MRI);
}
const unsigned BFE64 = Signed ? AMDGPU::S_BFE_I64 : AMDGPU::S_BFE_U64;
const unsigned BFE32 = Signed ? AMDGPU::S_BFE_I32 : AMDGPU::S_BFE_U32;
// Scalar BFE is encoded as S1[5:0] = offset, S1[22:16]= width.
if (DstSize > 32 && SrcSize <= 32) {
// We need a 64-bit register source, but the high bits don't matter.
Register ExtReg = MRI->createVirtualRegister(&AMDGPU::SReg_64RegClass);
Register UndefReg = MRI->createVirtualRegister(&AMDGPU::SReg_32RegClass);
BuildMI(MBB, I, DL, TII.get(AMDGPU::IMPLICIT_DEF), UndefReg);
BuildMI(MBB, I, DL, TII.get(AMDGPU::REG_SEQUENCE), ExtReg)
.addReg(SrcReg)
.addImm(AMDGPU::sub0)
.addReg(UndefReg)
.addImm(AMDGPU::sub1);
BuildMI(MBB, I, DL, TII.get(BFE64), DstReg)
.addReg(ExtReg)
.addImm(SrcSize << 16);
I.eraseFromParent();
return RBI.constrainGenericRegister(DstReg, AMDGPU::SReg_64RegClass, *MRI);
}
unsigned Mask;
if (!Signed && shouldUseAndMask(SrcSize, Mask)) {
BuildMI(MBB, I, DL, TII.get(AMDGPU::S_AND_B32), DstReg)
.addReg(SrcReg)
.addImm(Mask);
} else {
BuildMI(MBB, I, DL, TII.get(BFE32), DstReg)
.addReg(SrcReg)
.addImm(SrcSize << 16);
}
I.eraseFromParent();
return RBI.constrainGenericRegister(DstReg, AMDGPU::SReg_32RegClass, *MRI);
}
return false;
}
bool AMDGPUInstructionSelector::selectG_CONSTANT(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
MachineOperand &ImmOp = I.getOperand(1);
// The AMDGPU backend only supports Imm operands and not CImm or FPImm.
if (ImmOp.isFPImm()) {
const APInt &Imm = ImmOp.getFPImm()->getValueAPF().bitcastToAPInt();
ImmOp.ChangeToImmediate(Imm.getZExtValue());
} else if (ImmOp.isCImm()) {
ImmOp.ChangeToImmediate(ImmOp.getCImm()->getZExtValue());
}
Register DstReg = I.getOperand(0).getReg();
unsigned Size;
bool IsSgpr;
const RegisterBank *RB = MRI->getRegBankOrNull(I.getOperand(0).getReg());
if (RB) {
IsSgpr = RB->getID() == AMDGPU::SGPRRegBankID;
Size = MRI->getType(DstReg).getSizeInBits();
} else {
const TargetRegisterClass *RC = TRI.getRegClassForReg(*MRI, DstReg);
IsSgpr = TRI.isSGPRClass(RC);
Size = TRI.getRegSizeInBits(*RC);
}
if (Size != 32 && Size != 64)
return false;
unsigned Opcode = IsSgpr ? AMDGPU::S_MOV_B32 : AMDGPU::V_MOV_B32_e32;
if (Size == 32) {
I.setDesc(TII.get(Opcode));
I.addImplicitDefUseOperands(*MF);
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
const DebugLoc &DL = I.getDebugLoc();
APInt Imm(Size, I.getOperand(1).getImm());
MachineInstr *ResInst;
if (IsSgpr && TII.isInlineConstant(Imm)) {
ResInst = BuildMI(*BB, &I, DL, TII.get(AMDGPU::S_MOV_B64), DstReg)
.addImm(I.getOperand(1).getImm());
} else {
const TargetRegisterClass *RC = IsSgpr ?
&AMDGPU::SReg_32RegClass : &AMDGPU::VGPR_32RegClass;
Register LoReg = MRI->createVirtualRegister(RC);
Register HiReg = MRI->createVirtualRegister(RC);
BuildMI(*BB, &I, DL, TII.get(Opcode), LoReg)
.addImm(Imm.trunc(32).getZExtValue());
BuildMI(*BB, &I, DL, TII.get(Opcode), HiReg)
.addImm(Imm.ashr(32).getZExtValue());
ResInst = BuildMI(*BB, &I, DL, TII.get(AMDGPU::REG_SEQUENCE), DstReg)
.addReg(LoReg)
.addImm(AMDGPU::sub0)
.addReg(HiReg)
.addImm(AMDGPU::sub1);
}
// We can't call constrainSelectedInstRegOperands here, because it doesn't
// work for target independent opcodes
I.eraseFromParent();
const TargetRegisterClass *DstRC =
TRI.getConstrainedRegClassForOperand(ResInst->getOperand(0), *MRI);
if (!DstRC)
return true;
return RBI.constrainGenericRegister(DstReg, *DstRC, *MRI);
}
static bool isConstant(const MachineInstr &MI) {
return MI.getOpcode() == TargetOpcode::G_CONSTANT;
}
void AMDGPUInstructionSelector::getAddrModeInfo(const MachineInstr &Load,
const MachineRegisterInfo &MRI, SmallVectorImpl<GEPInfo> &AddrInfo) const {
const MachineInstr *PtrMI = MRI.getUniqueVRegDef(Load.getOperand(1).getReg());
assert(PtrMI);
if (PtrMI->getOpcode() != TargetOpcode::G_PTR_ADD)
return;
GEPInfo GEPInfo(*PtrMI);
for (unsigned i = 1; i != 3; ++i) {
const MachineOperand &GEPOp = PtrMI->getOperand(i);
const MachineInstr *OpDef = MRI.getUniqueVRegDef(GEPOp.getReg());
assert(OpDef);
if (i == 2 && isConstant(*OpDef)) {
// TODO: Could handle constant base + variable offset, but a combine
// probably should have commuted it.
assert(GEPInfo.Imm == 0);
GEPInfo.Imm = OpDef->getOperand(1).getCImm()->getSExtValue();
continue;
}
const RegisterBank *OpBank = RBI.getRegBank(GEPOp.getReg(), MRI, TRI);
if (OpBank->getID() == AMDGPU::SGPRRegBankID)
GEPInfo.SgprParts.push_back(GEPOp.getReg());
else
GEPInfo.VgprParts.push_back(GEPOp.getReg());
}
AddrInfo.push_back(GEPInfo);
getAddrModeInfo(*PtrMI, MRI, AddrInfo);
}
bool AMDGPUInstructionSelector::isInstrUniform(const MachineInstr &MI) const {
if (!MI.hasOneMemOperand())
return false;
const MachineMemOperand *MMO = *MI.memoperands_begin();
const Value *Ptr = MMO->getValue();
// UndefValue means this is a load of a kernel input. These are uniform.
// Sometimes LDS instructions have constant pointers.
// If Ptr is null, then that means this mem operand contains a
// PseudoSourceValue like GOT.
if (!Ptr || isa<UndefValue>(Ptr) || isa<Argument>(Ptr) ||
isa<Constant>(Ptr) || isa<GlobalValue>(Ptr))
return true;
if (MMO->getAddrSpace() == AMDGPUAS::CONSTANT_ADDRESS_32BIT)
return true;
const Instruction *I = dyn_cast<Instruction>(Ptr);
return I && I->getMetadata("amdgpu.uniform");
}
bool AMDGPUInstructionSelector::hasVgprParts(ArrayRef<GEPInfo> AddrInfo) const {
for (const GEPInfo &GEPInfo : AddrInfo) {
if (!GEPInfo.VgprParts.empty())
return true;
}
return false;
}
void AMDGPUInstructionSelector::initM0(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
const LLT PtrTy = MRI->getType(I.getOperand(1).getReg());
unsigned AS = PtrTy.getAddressSpace();
if ((AS == AMDGPUAS::LOCAL_ADDRESS || AS == AMDGPUAS::REGION_ADDRESS) &&
STI.ldsRequiresM0Init()) {
// If DS instructions require M0 initializtion, insert it before selecting.
BuildMI(*BB, &I, I.getDebugLoc(), TII.get(AMDGPU::S_MOV_B32), AMDGPU::M0)
.addImm(-1);
}
}
bool AMDGPUInstructionSelector::selectG_LOAD_ATOMICRMW(MachineInstr &I) const {
initM0(I);
return selectImpl(I, *CoverageInfo);
}
bool AMDGPUInstructionSelector::selectG_BRCOND(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
MachineOperand &CondOp = I.getOperand(0);
Register CondReg = CondOp.getReg();
const DebugLoc &DL = I.getDebugLoc();
unsigned BrOpcode;
Register CondPhysReg;
const TargetRegisterClass *ConstrainRC;
// In SelectionDAG, we inspect the IR block for uniformity metadata to decide
// whether the branch is uniform when selecting the instruction. In
// GlobalISel, we should push that decision into RegBankSelect. Assume for now
// RegBankSelect knows what it's doing if the branch condition is scc, even
// though it currently does not.
if (!isVCC(CondReg, *MRI)) {
if (MRI->getType(CondReg) != LLT::scalar(32))
return false;
CondPhysReg = AMDGPU::SCC;
BrOpcode = AMDGPU::S_CBRANCH_SCC1;
// FIXME: Hack for isSCC tests
ConstrainRC = &AMDGPU::SGPR_32RegClass;
} else {
// FIXME: Do we have to insert an and with exec here, like in SelectionDAG?
// We sort of know that a VCC producer based on the register bank, that ands
// inactive lanes with 0. What if there was a logical operation with vcc
// producers in different blocks/with different exec masks?
// FIXME: Should scc->vcc copies and with exec?
CondPhysReg = TRI.getVCC();
BrOpcode = AMDGPU::S_CBRANCH_VCCNZ;
ConstrainRC = TRI.getBoolRC();
}
if (!MRI->getRegClassOrNull(CondReg))
MRI->setRegClass(CondReg, ConstrainRC);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), CondPhysReg)
.addReg(CondReg);
BuildMI(*BB, &I, DL, TII.get(BrOpcode))
.addMBB(I.getOperand(1).getMBB());
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_FRAME_INDEX(MachineInstr &I) const {
Register DstReg = I.getOperand(0).getReg();
const RegisterBank *DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
const bool IsVGPR = DstRB->getID() == AMDGPU::VGPRRegBankID;
I.setDesc(TII.get(IsVGPR ? AMDGPU::V_MOV_B32_e32 : AMDGPU::S_MOV_B32));
if (IsVGPR)
I.addOperand(*MF, MachineOperand::CreateReg(AMDGPU::EXEC, false, true));
return RBI.constrainGenericRegister(
DstReg, IsVGPR ? AMDGPU::VGPR_32RegClass : AMDGPU::SReg_32RegClass, *MRI);
}
bool AMDGPUInstructionSelector::selectG_PTR_MASK(MachineInstr &I) const {
uint64_t Align = I.getOperand(2).getImm();
const uint64_t Mask = ~((UINT64_C(1) << Align) - 1);
MachineBasicBlock *BB = I.getParent();
Register DstReg = I.getOperand(0).getReg();
Register SrcReg = I.getOperand(1).getReg();
const RegisterBank *DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
const RegisterBank *SrcRB = RBI.getRegBank(SrcReg, *MRI, TRI);
const bool IsVGPR = DstRB->getID() == AMDGPU::VGPRRegBankID;
unsigned NewOpc = IsVGPR ? AMDGPU::V_AND_B32_e64 : AMDGPU::S_AND_B32;
unsigned MovOpc = IsVGPR ? AMDGPU::V_MOV_B32_e32 : AMDGPU::S_MOV_B32;
const TargetRegisterClass &RegRC
= IsVGPR ? AMDGPU::VGPR_32RegClass : AMDGPU::SReg_32RegClass;
LLT Ty = MRI->getType(DstReg);
const TargetRegisterClass *DstRC = TRI.getRegClassForTypeOnBank(Ty, *DstRB,
*MRI);
const TargetRegisterClass *SrcRC = TRI.getRegClassForTypeOnBank(Ty, *SrcRB,
*MRI);
if (!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI) ||
!RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI))
return false;
const DebugLoc &DL = I.getDebugLoc();
Register ImmReg = MRI->createVirtualRegister(&RegRC);
BuildMI(*BB, &I, DL, TII.get(MovOpc), ImmReg)
.addImm(Mask);
if (Ty.getSizeInBits() == 32) {
BuildMI(*BB, &I, DL, TII.get(NewOpc), DstReg)
.addReg(SrcReg)
.addReg(ImmReg);
I.eraseFromParent();
return true;
}
Register HiReg = MRI->createVirtualRegister(&RegRC);
Register LoReg = MRI->createVirtualRegister(&RegRC);
Register MaskLo = MRI->createVirtualRegister(&RegRC);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), LoReg)
.addReg(SrcReg, 0, AMDGPU::sub0);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::COPY), HiReg)
.addReg(SrcReg, 0, AMDGPU::sub1);
BuildMI(*BB, &I, DL, TII.get(NewOpc), MaskLo)
.addReg(LoReg)
.addReg(ImmReg);
BuildMI(*BB, &I, DL, TII.get(AMDGPU::REG_SEQUENCE), DstReg)
.addReg(MaskLo)
.addImm(AMDGPU::sub0)
.addReg(HiReg)
.addImm(AMDGPU::sub1);
I.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::selectG_EXTRACT_VECTOR_ELT(
MachineInstr &MI) const {
Register DstReg = MI.getOperand(0).getReg();
Register SrcReg = MI.getOperand(1).getReg();
Register IdxReg = MI.getOperand(2).getReg();
LLT DstTy = MRI->getType(DstReg);
LLT SrcTy = MRI->getType(SrcReg);
const RegisterBank *DstRB = RBI.getRegBank(DstReg, *MRI, TRI);
const RegisterBank *SrcRB = RBI.getRegBank(SrcReg, *MRI, TRI);
const RegisterBank *IdxRB = RBI.getRegBank(IdxReg, *MRI, TRI);
// The index must be scalar. If it wasn't RegBankSelect should have moved this
// into a waterfall loop.
if (IdxRB->getID() != AMDGPU::SGPRRegBankID)
return false;
const TargetRegisterClass *SrcRC = TRI.getRegClassForTypeOnBank(SrcTy, *SrcRB,
*MRI);
const TargetRegisterClass *DstRC = TRI.getRegClassForTypeOnBank(DstTy, *DstRB,
*MRI);
if (!RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI) ||
!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI) ||
!RBI.constrainGenericRegister(IdxReg, AMDGPU::SReg_32RegClass, *MRI))
return false;
MachineBasicBlock *BB = MI.getParent();
const DebugLoc &DL = MI.getDebugLoc();
const bool Is64 = DstTy.getSizeInBits() == 64;
unsigned SubReg = Is64 ? AMDGPU::sub0_sub1 : AMDGPU::sub0;
if (SrcRB->getID() == AMDGPU::SGPRRegBankID) {
if (DstTy.getSizeInBits() != 32 && !Is64)
return false;
BuildMI(*BB, &MI, DL, TII.get(AMDGPU::COPY), AMDGPU::M0)
.addReg(IdxReg);
unsigned Opc = Is64 ? AMDGPU::S_MOVRELS_B64 : AMDGPU::S_MOVRELS_B32;
BuildMI(*BB, &MI, DL, TII.get(Opc), DstReg)
.addReg(SrcReg, 0, SubReg)
.addReg(SrcReg, RegState::Implicit);
MI.eraseFromParent();
return true;
}
if (SrcRB->getID() != AMDGPU::VGPRRegBankID || DstTy.getSizeInBits() != 32)
return false;
if (!STI.useVGPRIndexMode()) {
BuildMI(*BB, &MI, DL, TII.get(AMDGPU::COPY), AMDGPU::M0)
.addReg(IdxReg);
BuildMI(*BB, &MI, DL, TII.get(AMDGPU::V_MOVRELS_B32_e32), DstReg)
.addReg(SrcReg, RegState::Undef, SubReg)
.addReg(SrcReg, RegState::Implicit);
MI.eraseFromParent();
return true;
}
BuildMI(*BB, MI, DL, TII.get(AMDGPU::S_SET_GPR_IDX_ON))
.addReg(IdxReg)
.addImm(AMDGPU::VGPRIndexMode::SRC0_ENABLE);
BuildMI(*BB, MI, DL, TII.get(AMDGPU::V_MOV_B32_e32), DstReg)
.addReg(SrcReg, RegState::Undef, SubReg)
.addReg(SrcReg, RegState::Implicit)
.addReg(AMDGPU::M0, RegState::Implicit);
BuildMI(*BB, MI, DL, TII.get(AMDGPU::S_SET_GPR_IDX_OFF));
MI.eraseFromParent();
return true;
}
bool AMDGPUInstructionSelector::select(MachineInstr &I) {
if (I.isPHI())
return selectPHI(I);
if (!I.isPreISelOpcode()) {
if (I.isCopy())
return selectCOPY(I);
return true;
}
switch (I.getOpcode()) {
case TargetOpcode::G_AND:
case TargetOpcode::G_OR:
case TargetOpcode::G_XOR:
if (selectG_AND_OR_XOR(I))
return true;
return selectImpl(I, *CoverageInfo);
case TargetOpcode::G_ADD:
case TargetOpcode::G_SUB:
if (selectImpl(I, *CoverageInfo))
return true;
return selectG_ADD_SUB(I);
case TargetOpcode::G_UADDO:
case TargetOpcode::G_USUBO:
case TargetOpcode::G_UADDE:
case TargetOpcode::G_USUBE:
return selectG_UADDO_USUBO_UADDE_USUBE(I);
case TargetOpcode::G_INTTOPTR:
case TargetOpcode::G_BITCAST:
case TargetOpcode::G_PTRTOINT:
return selectCOPY(I);
case TargetOpcode::G_CONSTANT:
case TargetOpcode::G_FCONSTANT:
return selectG_CONSTANT(I);
case TargetOpcode::G_EXTRACT:
return selectG_EXTRACT(I);
case TargetOpcode::G_MERGE_VALUES:
case TargetOpcode::G_BUILD_VECTOR:
case TargetOpcode::G_CONCAT_VECTORS:
return selectG_MERGE_VALUES(I);
case TargetOpcode::G_UNMERGE_VALUES:
return selectG_UNMERGE_VALUES(I);
case TargetOpcode::G_PTR_ADD:
return selectG_PTR_ADD(I);
case TargetOpcode::G_IMPLICIT_DEF:
return selectG_IMPLICIT_DEF(I);
case TargetOpcode::G_INSERT:
return selectG_INSERT(I);
case TargetOpcode::G_INTRINSIC:
return selectG_INTRINSIC(I);
case TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS:
return selectG_INTRINSIC_W_SIDE_EFFECTS(I);
case TargetOpcode::G_ICMP:
if (selectG_ICMP(I))
return true;
return selectImpl(I, *CoverageInfo);
case TargetOpcode::G_LOAD:
case TargetOpcode::G_ATOMIC_CMPXCHG:
case TargetOpcode::G_ATOMICRMW_XCHG:
case TargetOpcode::G_ATOMICRMW_ADD:
case TargetOpcode::G_ATOMICRMW_SUB:
case TargetOpcode::G_ATOMICRMW_AND:
case TargetOpcode::G_ATOMICRMW_OR:
case TargetOpcode::G_ATOMICRMW_XOR:
case TargetOpcode::G_ATOMICRMW_MIN:
case TargetOpcode::G_ATOMICRMW_MAX:
case TargetOpcode::G_ATOMICRMW_UMIN:
case TargetOpcode::G_ATOMICRMW_UMAX:
case TargetOpcode::G_ATOMICRMW_FADD:
return selectG_LOAD_ATOMICRMW(I);
case TargetOpcode::G_SELECT:
return selectG_SELECT(I);
case TargetOpcode::G_STORE:
return selectG_STORE(I);
case TargetOpcode::G_TRUNC:
return selectG_TRUNC(I);
case TargetOpcode::G_SEXT:
case TargetOpcode::G_ZEXT:
case TargetOpcode::G_ANYEXT:
if (selectImpl(I, *CoverageInfo))
return true;
return selectG_SZA_EXT(I);
case TargetOpcode::G_BRCOND:
return selectG_BRCOND(I);
case TargetOpcode::G_FRAME_INDEX:
return selectG_FRAME_INDEX(I);
case TargetOpcode::G_PTR_MASK:
return selectG_PTR_MASK(I);
case TargetOpcode::G_EXTRACT_VECTOR_ELT:
return selectG_EXTRACT_VECTOR_ELT(I);
default:
return selectImpl(I, *CoverageInfo);
}
return false;
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVCSRC(MachineOperand &Root) const {
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(Root); }
}};
}
std::pair<Register, unsigned>
AMDGPUInstructionSelector::selectVOP3ModsImpl(
Register Src) const {
unsigned Mods = 0;
MachineInstr *MI = MRI->getVRegDef(Src);
if (MI && MI->getOpcode() == AMDGPU::G_FNEG) {
Src = MI->getOperand(1).getReg();
Mods |= SISrcMods::NEG;
MI = MRI->getVRegDef(Src);
}
if (MI && MI->getOpcode() == AMDGPU::G_FABS) {
Src = MI->getOperand(1).getReg();
Mods |= SISrcMods::ABS;
}
return std::make_pair(Src, Mods);
}
///
/// This will select either an SGPR or VGPR operand and will save us from
/// having to write an extra tablegen pattern.
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVSRC0(MachineOperand &Root) const {
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(Root); }
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3Mods0(MachineOperand &Root) const {
Register Src;
unsigned Mods;
std::tie(Src, Mods) = selectVOP3ModsImpl(Root.getReg());
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Src); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(Mods); }, // src0_mods
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }, // clamp
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // omod
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3OMods(MachineOperand &Root) const {
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(Root); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }, // clamp
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // omod
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3Mods(MachineOperand &Root) const {
Register Src;
unsigned Mods;
std::tie(Src, Mods) = selectVOP3ModsImpl(Root.getReg());
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Src); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(Mods); } // src_mods
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3Mods_nnan(MachineOperand &Root) const {
Register Src;
unsigned Mods;
std::tie(Src, Mods) = selectVOP3ModsImpl(Root.getReg());
if (!TM.Options.NoNaNsFPMath && !isKnownNeverNaN(Src, *MRI))
return None;
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Src); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(Mods); } // src_mods
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3OpSelMods0(MachineOperand &Root) const {
// FIXME: Handle clamp and op_sel
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }, // src_mods
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // clamp
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectVOP3OpSelMods(MachineOperand &Root) const {
// FIXME: Handle op_sel
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // src_mods
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectSmrdImm(MachineOperand &Root) const {
SmallVector<GEPInfo, 4> AddrInfo;
getAddrModeInfo(*Root.getParent(), *MRI, AddrInfo);
if (AddrInfo.empty() || AddrInfo[0].SgprParts.size() != 1)
return None;
const GEPInfo &GEPInfo = AddrInfo[0];
if (!AMDGPU::isLegalSMRDImmOffset(STI, GEPInfo.Imm))
return None;
unsigned PtrReg = GEPInfo.SgprParts[0];
int64_t EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPInfo.Imm);
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(PtrReg); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(EncodedImm); }
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectSmrdImm32(MachineOperand &Root) const {
SmallVector<GEPInfo, 4> AddrInfo;
getAddrModeInfo(*Root.getParent(), *MRI, AddrInfo);
if (AddrInfo.empty() || AddrInfo[0].SgprParts.size() != 1)
return None;
const GEPInfo &GEPInfo = AddrInfo[0];
unsigned PtrReg = GEPInfo.SgprParts[0];
int64_t EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPInfo.Imm);
if (!isUInt<32>(EncodedImm))
return None;
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(PtrReg); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(EncodedImm); }
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectSmrdSgpr(MachineOperand &Root) const {
MachineInstr *MI = Root.getParent();
MachineBasicBlock *MBB = MI->getParent();
SmallVector<GEPInfo, 4> AddrInfo;
getAddrModeInfo(*MI, *MRI, AddrInfo);
// FIXME: We should shrink the GEP if the offset is known to be <= 32-bits,
// then we can select all ptr + 32-bit offsets not just immediate offsets.
if (AddrInfo.empty() || AddrInfo[0].SgprParts.size() != 1)
return None;
const GEPInfo &GEPInfo = AddrInfo[0];
if (!GEPInfo.Imm || !isUInt<32>(GEPInfo.Imm))
return None;
// If we make it this far we have a load with an 32-bit immediate offset.
// It is OK to select this using a sgpr offset, because we have already
// failed trying to select this load into one of the _IMM variants since
// the _IMM Patterns are considered before the _SGPR patterns.
unsigned PtrReg = GEPInfo.SgprParts[0];
Register OffsetReg = MRI->createVirtualRegister(&AMDGPU::SReg_32RegClass);
BuildMI(*MBB, MI, MI->getDebugLoc(), TII.get(AMDGPU::S_MOV_B32), OffsetReg)
.addImm(GEPInfo.Imm);
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(PtrReg); },
[=](MachineInstrBuilder &MIB) { MIB.addReg(OffsetReg); }
}};
}
template <bool Signed>
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectFlatOffsetImpl(MachineOperand &Root) const {
MachineInstr *MI = Root.getParent();
InstructionSelector::ComplexRendererFns Default = {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }, // offset
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // slc
}};
if (!STI.hasFlatInstOffsets())
return Default;
const MachineInstr *OpDef = MRI->getVRegDef(Root.getReg());
if (!OpDef || OpDef->getOpcode() != AMDGPU::G_PTR_ADD)
return Default;
Optional<int64_t> Offset =
getConstantVRegVal(OpDef->getOperand(2).getReg(), *MRI);
if (!Offset.hasValue())
return Default;
unsigned AddrSpace = (*MI->memoperands_begin())->getAddrSpace();
if (!TII.isLegalFLATOffset(Offset.getValue(), AddrSpace, Signed))
return Default;
Register BasePtr = OpDef->getOperand(1).getReg();
return {{
[=](MachineInstrBuilder &MIB) { MIB.addReg(BasePtr); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(Offset.getValue()); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); } // slc
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectFlatOffset(MachineOperand &Root) const {
return selectFlatOffsetImpl<false>(Root);
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectFlatOffsetSigned(MachineOperand &Root) const {
return selectFlatOffsetImpl<true>(Root);
}
static bool isStackPtrRelative(const MachinePointerInfo &PtrInfo) {
auto PSV = PtrInfo.V.dyn_cast<const PseudoSourceValue *>();
return PSV && PSV->isStack();
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectMUBUFScratchOffen(MachineOperand &Root) const {
MachineInstr *MI = Root.getParent();
MachineBasicBlock *MBB = MI->getParent();
MachineFunction *MF = MBB->getParent();
const SIMachineFunctionInfo *Info = MF->getInfo<SIMachineFunctionInfo>();
int64_t Offset = 0;
if (mi_match(Root.getReg(), *MRI, m_ICst(Offset))) {
Register HighBits = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
// TODO: Should this be inside the render function? The iterator seems to
// move.
BuildMI(*MBB, MI, MI->getDebugLoc(), TII.get(AMDGPU::V_MOV_B32_e32),
HighBits)
.addImm(Offset & ~4095);
return {{[=](MachineInstrBuilder &MIB) { // rsrc
MIB.addReg(Info->getScratchRSrcReg());
},
[=](MachineInstrBuilder &MIB) { // vaddr
MIB.addReg(HighBits);
},
[=](MachineInstrBuilder &MIB) { // soffset
const MachineMemOperand *MMO = *MI->memoperands_begin();
const MachinePointerInfo &PtrInfo = MMO->getPointerInfo();
Register SOffsetReg = isStackPtrRelative(PtrInfo)
? Info->getStackPtrOffsetReg()
: Info->getScratchWaveOffsetReg();
MIB.addReg(SOffsetReg);
},
[=](MachineInstrBuilder &MIB) { // offset
MIB.addImm(Offset & 4095);
}}};
}
assert(Offset == 0);
// Try to fold a frame index directly into the MUBUF vaddr field, and any
// offsets.
Optional<int> FI;
Register VAddr = Root.getReg();
if (const MachineInstr *RootDef = MRI->getVRegDef(Root.getReg())) {
if (isBaseWithConstantOffset(Root, *MRI)) {
const MachineOperand &LHS = RootDef->getOperand(1);
const MachineOperand &RHS = RootDef->getOperand(2);
const MachineInstr *LHSDef = MRI->getVRegDef(LHS.getReg());
const MachineInstr *RHSDef = MRI->getVRegDef(RHS.getReg());
if (LHSDef && RHSDef) {
int64_t PossibleOffset =
RHSDef->getOperand(1).getCImm()->getSExtValue();
if (SIInstrInfo::isLegalMUBUFImmOffset(PossibleOffset) &&
(!STI.privateMemoryResourceIsRangeChecked() ||
KnownBits->signBitIsZero(LHS.getReg()))) {
if (LHSDef->getOpcode() == AMDGPU::G_FRAME_INDEX)
FI = LHSDef->getOperand(1).getIndex();
else
VAddr = LHS.getReg();
Offset = PossibleOffset;
}
}
} else if (RootDef->getOpcode() == AMDGPU::G_FRAME_INDEX) {
FI = RootDef->getOperand(1).getIndex();
}
}
// If we don't know this private access is a local stack object, it needs to
// be relative to the entry point's scratch wave offset register.
// TODO: Should split large offsets that don't fit like above.
// TODO: Don't use scratch wave offset just because the offset didn't fit.
Register SOffset = FI.hasValue() ? Info->getStackPtrOffsetReg()
: Info->getScratchWaveOffsetReg();
return {{[=](MachineInstrBuilder &MIB) { // rsrc
MIB.addReg(Info->getScratchRSrcReg());
},
[=](MachineInstrBuilder &MIB) { // vaddr
if (FI.hasValue())
MIB.addFrameIndex(FI.getValue());
else
MIB.addReg(VAddr);
},
[=](MachineInstrBuilder &MIB) { // soffset
MIB.addReg(SOffset);
},
[=](MachineInstrBuilder &MIB) { // offset
MIB.addImm(Offset);
}}};
}
bool AMDGPUInstructionSelector::isDSOffsetLegal(const MachineRegisterInfo &MRI,
const MachineOperand &Base,
int64_t Offset,
unsigned OffsetBits) const {
if ((OffsetBits == 16 && !isUInt<16>(Offset)) ||
(OffsetBits == 8 && !isUInt<8>(Offset)))
return false;
if (STI.hasUsableDSOffset() || STI.unsafeDSOffsetFoldingEnabled())
return true;
// On Southern Islands instruction with a negative base value and an offset
// don't seem to work.
return KnownBits->signBitIsZero(Base.getReg());
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectMUBUFScratchOffset(
MachineOperand &Root) const {
MachineInstr *MI = Root.getParent();
MachineBasicBlock *MBB = MI->getParent();
int64_t Offset = 0;
if (!mi_match(Root.getReg(), *MRI, m_ICst(Offset)) ||
!SIInstrInfo::isLegalMUBUFImmOffset(Offset))
return {};
const MachineFunction *MF = MBB->getParent();
const SIMachineFunctionInfo *Info = MF->getInfo<SIMachineFunctionInfo>();
const MachineMemOperand *MMO = *MI->memoperands_begin();
const MachinePointerInfo &PtrInfo = MMO->getPointerInfo();
Register SOffsetReg = isStackPtrRelative(PtrInfo)
? Info->getStackPtrOffsetReg()
: Info->getScratchWaveOffsetReg();
return {{
[=](MachineInstrBuilder &MIB) {
MIB.addReg(Info->getScratchRSrcReg());
}, // rsrc
[=](MachineInstrBuilder &MIB) { MIB.addReg(SOffsetReg); }, // soffset
[=](MachineInstrBuilder &MIB) { MIB.addImm(Offset); } // offset
}};
}
InstructionSelector::ComplexRendererFns
AMDGPUInstructionSelector::selectDS1Addr1Offset(MachineOperand &Root) const {
const MachineInstr *RootDef = MRI->getVRegDef(Root.getReg());
if (!RootDef) {
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(Root); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }
}};
}
int64_t ConstAddr = 0;
if (isBaseWithConstantOffset(Root, *MRI)) {
const MachineOperand &LHS = RootDef->getOperand(1);
const MachineOperand &RHS = RootDef->getOperand(2);
const MachineInstr *LHSDef = MRI->getVRegDef(LHS.getReg());
const MachineInstr *RHSDef = MRI->getVRegDef(RHS.getReg());
if (LHSDef && RHSDef) {
int64_t PossibleOffset =
RHSDef->getOperand(1).getCImm()->getSExtValue();
if (isDSOffsetLegal(*MRI, LHS, PossibleOffset, 16)) {
// (add n0, c0)
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(LHS); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(PossibleOffset); }
}};
}
}
} else if (RootDef->getOpcode() == AMDGPU::G_SUB) {
} else if (mi_match(Root.getReg(), *MRI, m_ICst(ConstAddr))) {
}
return {{
[=](MachineInstrBuilder &MIB) { MIB.add(Root); },
[=](MachineInstrBuilder &MIB) { MIB.addImm(0); }
}};
}
void AMDGPUInstructionSelector::renderTruncImm32(MachineInstrBuilder &MIB,
const MachineInstr &MI,
int OpIdx) const {
assert(MI.getOpcode() == TargetOpcode::G_CONSTANT && OpIdx == -1 &&
"Expected G_CONSTANT");
Optional<int64_t> CstVal = getConstantVRegVal(MI.getOperand(0).getReg(), *MRI);
assert(CstVal && "Expected constant value");
MIB.addImm(CstVal.getValue());
}
void AMDGPUInstructionSelector::renderNegateImm(MachineInstrBuilder &MIB,
const MachineInstr &MI,
int OpIdx) const {
assert(MI.getOpcode() == TargetOpcode::G_CONSTANT && OpIdx == -1 &&
"Expected G_CONSTANT");
MIB.addImm(-MI.getOperand(1).getCImm()->getSExtValue());
}
void AMDGPUInstructionSelector::renderBitcastImm(MachineInstrBuilder &MIB,
const MachineInstr &MI,
int OpIdx) const {
assert(OpIdx == -1);
const MachineOperand &Op = MI.getOperand(1);
if (MI.getOpcode() == TargetOpcode::G_FCONSTANT)
MIB.addImm(Op.getFPImm()->getValueAPF().bitcastToAPInt().getZExtValue());
else {
assert(MI.getOpcode() == TargetOpcode::G_CONSTANT && "Expected G_CONSTANT");
MIB.addImm(Op.getCImm()->getSExtValue());
}
}
void AMDGPUInstructionSelector::renderPopcntImm(MachineInstrBuilder &MIB,
const MachineInstr &MI,
int OpIdx) const {
assert(MI.getOpcode() == TargetOpcode::G_CONSTANT && OpIdx == -1 &&
"Expected G_CONSTANT");
MIB.addImm(MI.getOperand(1).getCImm()->getValue().countPopulation());
}
/// This only really exists to satisfy DAG type checking machinery, so is a
/// no-op here.
void AMDGPUInstructionSelector::renderTruncTImm(MachineInstrBuilder &MIB,
const MachineInstr &MI,
int OpIdx) const {
MIB.addImm(MI.getOperand(OpIdx).getImm());
}
bool AMDGPUInstructionSelector::isInlineImmediate16(int64_t Imm) const {
return AMDGPU::isInlinableLiteral16(Imm, STI.hasInv2PiInlineImm());
}
bool AMDGPUInstructionSelector::isInlineImmediate32(int64_t Imm) const {
return AMDGPU::isInlinableLiteral32(Imm, STI.hasInv2PiInlineImm());
}
bool AMDGPUInstructionSelector::isInlineImmediate64(int64_t Imm) const {
return AMDGPU::isInlinableLiteral64(Imm, STI.hasInv2PiInlineImm());
}
bool AMDGPUInstructionSelector::isInlineImmediate(const APFloat &Imm) const {
return TII.isInlineConstant(Imm);
}
| {'content_hash': 'fb584aed71fdc82a4dc0875488b8a44c', 'timestamp': '', 'source': 'github', 'line_count': 2294, 'max_line_length': 85, 'avg_line_length': 34.64428945074106, 'alnum_prop': 0.6565543448171729, 'repo_name': 'endlessm/chromium-browser', 'id': 'c0ea35817ec8ea23bb5755202bcfd192a6318ff5', 'size': '81050', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
package org.telegram.mtproto.tl;
import org.telegram.tl.TLContext;
import org.telegram.tl.TLObject;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import static org.telegram.tl.StreamingUtils.readInt;
import static org.telegram.tl.StreamingUtils.readLong;
import static org.telegram.tl.StreamingUtils.writeInt;
import static org.telegram.tl.StreamingUtils.writeLong;
/**
* Created with IntelliJ IDEA.
* User: Ruben Bermudez
* Date: 03.11.13
* Time: 8:22
*/
public class MTPingDelayDisconnect extends TLObject {
public static final int CLASS_ID = 0xf3427b8c;
private long pingId;
private int disconnectDelay;
public MTPingDelayDisconnect(long pingId, int disconnectDelay) {
this.pingId = pingId;
this.disconnectDelay = disconnectDelay;
}
public MTPingDelayDisconnect() {
}
public long getPingId() {
return this.pingId;
}
public int getDisconnectDelay() {
return this.disconnectDelay;
}
@Override
public int getClassId() {
return CLASS_ID;
}
@Override
public void serializeBody(OutputStream stream) throws IOException {
writeLong(this.pingId, stream);
writeInt(this.disconnectDelay, stream);
}
@Override
public void deserializeBody(InputStream stream, TLContext context) throws IOException {
this.pingId = readLong(stream);
this.disconnectDelay = readInt(stream);
}
@Override
public String toString() {
return "ping_delay_disconnect#f3427b8c";
}
}
| {'content_hash': '6cfc05e02c0d2951330aef10dcf5b330', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 91, 'avg_line_length': 24.23076923076923, 'alnum_prop': 0.7022222222222222, 'repo_name': 'rubenlagus/TelegramApi', 'id': '7851e8522ef502bdef544cbc64e3ca2ce65f878f', 'size': '1575', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/telegram/mtproto/tl/MTPingDelayDisconnect.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '2393726'}]} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html version="-//W3C//DTD XHTML 1.1//EN"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name=viewport content="width=device-width, initial-scale=0.3333334">
<meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
<title>ImageMagick: Install from Source</title>
<meta http-equiv="content-language" content="en-US"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="reply-to" content="[email protected]"/>
<meta name="application-name" content="ImageMagick"/>
<meta name="description" content="A collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats."/>
<meta name="application-url" content="http://www.imagemagick.org"/>
<meta name="generator" content="PHP"/>
<meta name="keywords" content="install, from, source, convert, edit, compose, image, pixel"/>
<meta name="rating" content="GENERAL"/>
<meta name="robots" content="INDEX, FOLLOW"/>
<meta name="generator" content="ImageMagick Studio LLC"/>
<meta name="author" content="ImageMagick Studio LLC"/>
<meta name="revisit-after" content="2 DAYS"/>
<meta name="resource-type" content="document"/>
<meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
<meta name="distribution" content="Global"/>
<meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
<link rel="icon" href="../images/wand.png"/>
<link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/>
<link rel="canonical" href="../index.html" />
<link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
<!-- Add jQuery library -->
<script type="text/javascript" src="http://localhost/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox -->
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
<!-- Optionally add helpers - button, thumbnail and/or media -->
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
<link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox();
});
</script>
<!-- ImageMagick style -->
<style type="text/css" media="all">
@import url("../www/magick.css");
</style>
</head>
<body id="www-imagemagick-org">
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'offline-script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40133312-1', 'imagemagick.org');
ga('send', 'pageview');
</script>
<div class="titlebar">
<div style="margin: 17px auto; float: left;">
<script type="text/javascript">
<!--
google_ad_client = "pub-3129977114552745";
google_ad_slot = "5439289906";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://localhost/pagead/show_ads.js">
</script>
</div>
<a href="../discourse-server">
<img src="../images/logo.jpg"
alt="ImageMagick Logo" width="123" height="118"
style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
<a href="../index.html">
<img src="../images/sprite.jpg"
alt="ImageMagick Sprite" width="114" height="118"
style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
</div>
<div class="westbar">
<div class="menu">
<a title="About ImageMagick" href="../index.html">About ImageMagick</a>
</div>
<div class="menu">
<a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
</div>
<div class="sub">
<a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
</div>
<div class="sub">
<a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
</div>
<div class="sub">
<a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
</div>
<div class="sub">
<a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
</div>
<div class="sub">
<a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
</div>
<div class="sub">
<a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
</div>
<div class="sub">
<a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
</div>
<div class="menu">
<a title="Program Interfaces" href="api.html">Program Interfaces</a>
</div>
<div class="sub">
<a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
</div>
<div class="sub">
<a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
</div>
<div class="sub">
<a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
</div>
<div class="sub">
<a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Install from Source" href="install-source.html">Install from Source</a>
</div>
<div class="sub">
<a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
</div>
<div class="sub">
<a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
</div>
<div class="menu">
<a title="Resources" href="resources.html">Resources</a>
</div>
<div class="menu">
<a title="Architecture" href="architecture.html">Architecture</a>
</div>
<div class="menu">
<a title="Download" href="download.html">Download</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Search" href="search.html">Search</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Site Map" href="sitemap.html">Site Map</a>
</div>
<div class="sub">
<a title="Site Map: Links" href="links.html">Links</a>
</div>
<div class="sep"></div>
<div class="menu">
<a title="Support ImageMagick Development" href="support.html">Support ImageMagick Development</a>
</div>
</div>
<div class="eastbar">
<script type="text/javascript">
/* <![CDATA[ */
window.___gcfg = {
lang: 'en-US'
};
(function() {
var po = document.createElement('offline-script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var script = document.getElementsByTagName('offline-script')[0];
script.parentNode.insertBefore(po, script);
})();
var gplusone = document.getElementById("gplusone");
gplusone.setAttribute("data-size","medium");
gplusone.setAttribute("data-count","true");
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
po.type = 'text/javascript';
po.async = true;
po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
var script = document.getElementsByTagName('offline-script')[0];
script.parentNode.insertBefore(po, script);
})();
/* ]]> */
</script>
<div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../index.html"></a></div>
<noscript>
<a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
</noscript>
<div class="g-plusone" data-size="standard" data-count="true"></div>
</div>
<div class="main">
<h1>Install ImageMagick from Source</h1>
<p class="navigation-index">[<a href="install-source.html#unix">Install from Unix Source</a> • <a href="install-source.html#windows">Install from Windows Source</a>]</p>
<div class="doc-section">
<p>Chances are, ImageMagick is already installed on your computer if you are using some flavor of Unix, but that it is not installed if you are using some form of Windows. In either case, you can type the following to find out.</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>identify -version</span></p>
<p>If the <a href="identify.html">identify</a> program executes and identifies itself as ImageMagick, you may not need to install ImageMagick from source unless you want to add support for additional image formats or upgrade to a newer version. You also have the option of installing a pre-compiled <a href="binary-releases.html">binary release</a>. However, if you still want to install from source, choose a platform, <a href="install-source.html#unix">Unix</a> or <a href="install-source.html#windows">Windows</a>. Before installing from source, you may want to review recent <a href="changelog.html">changes</a> to the ImageMagick distribution.</p>
</div>
<h2><a id="unix"></a>Install from Unix Source</h2>
<div class="doc-section">
<p>ImageMagick builds on a variety of Unix and Unix-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Unix systems have one. Download <a href="http://www.imagemagick.org/download/ImageMagick.tar.gz">ImageMagick.tar.gz</a> from <a href="http://www.imagemagick.org/download">www.imagemagick.org</a> or a <a href="download.html">mirrors</a> and verify its <a href="http://www.imagemagick.org/download/digest.rdf">message digest</a>.</p>
<p>Unpack the distribution with this command:</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>tar xvzf ImageMagick.tar.gz</span></p>
<p>Next configure and compile ImageMagick:</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>cd ImageMagick-6.8.9</span><span class='crtout'></span><span class="crtprompt"> $ </span><span class='crtin'>./configure</span><span class='crtout'></span><span class="crtprompt"> $ </span><span class='crtin'>make</span></p>
<p>If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>sudo make install</span></p>
<p>You may need to configure the dynamic linker run-time bindings:</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>sudo ldconfig /usr/local/lib</span></p>
<p>Finally, verify the ImageMagick install worked properly, type</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>/usr/local/bin/convert logo: logo.gif</span></p>
<p>For a more comprehensive test, run the ImageMagick validation suite. Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail.</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>make check</span></p>
<p>Congratulations, you have a working ImageMagick distribution and you are ready to use ImageMagick to <a href="http://www.imagemagick.org/Usage/">convert, compose, or edit</a> your images or perhaps you'll want to use one of the <a href="api.html">Application Program Interfaces</a> for C, C++, Perl, and others.</p>
<p>The above instructions will satisfy a great number of ImageMagick users, but we suspect a few will have additional questions or problems to consider. For example, what does one do if ImageMagick fails to configure or compile? Or what if you don't have administrator privileges and what if you don't want to install ImageMagick in the default <code>/../usr/local</code> folder? You will find the answer to these questions, and more, in <a href="advanced-unix-installation.html">Advanced Unix Source Installation</a>.</p>
</div>
<h2><a id="windows"></a>Install from Windows Source</h2>
<div class="doc-section">
<p>Building ImageMagick source for Windows requires a modern version of Microsoft Visual Studio IDE. Users have reported success with the Borland C++ compiler as well. If you don't have a compiler you can still install a self-installing <a href="binary-releases.html">binary release</a>.</p>
<p>Download <a href="http://www.imagemagick.org/download/windows/ImageMagick-windows.zip">ImageMagick-windows.zip</a> from <a href="http://www.imagemagick.org/download/windows">www.imagemagick.org</a> or a <a href="download.html">mirrors</a> and verify its <a href="http://www.imagemagick.org/download/windows/digest.rdf">message digest</a>.</p>
<p>You can unpack the distribution with <a href="http://www.winzip.com">WinZip</a> or type the following from any MS-DOS Command Prompt window:</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>unzip ImageMagick-windows.zip</span></p>
<p>Next, launch your Visual Studio IDE and choose <kbd>Open->Project</kbd>. Select the configure workspace from the <kbd>ImageMagick-6.8.9/VisualMagick/configure</kbd> folder and press Open. Choose <kbd>Build->Build Solution</kbd>
to compile the program and on completion run the program.</p>
<p class="image"><img src="../images/configure.jpg" alt="[configure]" /></p>
<p>Press <kbd>Next</kbd> and click on the multi-threaded static build. If you are using the Visual Studio 6.0 IDE, make sure no check is next to the <em>Generate Visual Studio 7</em> format option. Now press, on <kbd>Next</kbd> twice and finally <kbd>Finish</kbd>. The configuration utility just created a workspace required to build ImageMagick from source. Choose <kbd>Open->Project</kbd> and select the VisualStaticMT workspace from the <kbd>ImageMagick-6.8.9/VisualMagick/</kbd> folder. Finally, choose <kbd>Build->Build Solution</kbd> to compile and build the ImageMagick distribution.</p>
<p>To verify ImageMagick is working properly, launch a MS-DOS Command Prompt window and type</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>cd ImageMagick-6.8.9</span><span class='crtout'></span><span class="crtprompt"> $ </span><span class='crtin'>convert logo: image.jpg</span></p>
<p>For a more comprehensive test, run the ImageMagick validation suite:</p>
<p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>validate</span></p>
<p>Congratulations, you have a working ImageMagick distribution under Windows and you are ready to use ImageMagick to <a href="http://www.imagemagick.org/Usage/">convert, compose, or edit</a> your images or perhaps you'll want to use one of the <a href="api.html">Application Program Interfaces</a> for C, C++, Perl, and others.</p>
<p>The above instructions will satisfy a great number of ImageMagick users, but we suspect a few will have additional questions or problems to consider. For example, what does one do if ImageMagick fails to configure or compile? Or what if you want to install ImageMagick in a place other than the <kbd>ImageMagick-6.8.9/VisualMagick/bin</kbd> folder? Or perhaps you want to build and install the <a href="ImageMagickObject.html">ImageMagickObject</a> COM+ component. You will find the answer to these questions, and more, in <a href="advanced-windows-installation.html">Advanced Windows Source Installation</a>.</p>
</div>
</div>
<div id="linkbar">
<span id="linkbar-west"> </span>
<span id="linkbar-center">
<a href="../discourse-server">Discourse Server</a> •
<a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
<a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
<a href="http://jqmagick.imagemagick.org/">JqMagick</a>
</span>
<span id="linkbar-east"> </span>
</div>
<div class="footer">
<span id="footer-west">© 1999-2014 ImageMagick Studio LLC</span>
<span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
</div>
<div style="clear: both; margin: 0; width: 100%; "></div>
</body>
</html>
<!-- Magick Cache 25th July 2014 04:05 --> | {'content_hash': 'eb4b9a05fa7a3e401b66d20678a4c1c7', 'timestamp': '', 'source': 'github', 'line_count': 320, 'max_line_length': 655, 'avg_line_length': 54.778125, 'alnum_prop': 0.6990701123851902, 'repo_name': 'peteward44/atlasbuilder', 'id': '6ea2265fb5f8504a43db9ab98e78bb5ffa98c8ba', 'size': '17538', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'vips-dev-w64-all-8.4.1/share/doc/ImageMagick-6/www/install-source.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1619'}, {'name': 'C', 'bytes': '6420095'}, {'name': 'C++', 'bytes': '109752807'}, {'name': 'CMake', 'bytes': '8171'}, {'name': 'CSS', 'bytes': '51523'}, {'name': 'Fortran', 'bytes': '108953'}, {'name': 'HTML', 'bytes': '12111803'}, {'name': 'M4', 'bytes': '9738'}, {'name': 'Makefile', 'bytes': '2302'}, {'name': 'Objective-C', 'bytes': '21287'}, {'name': 'Perl', 'bytes': '16799'}, {'name': 'Python', 'bytes': '51763'}, {'name': 'Shell', 'bytes': '995'}, {'name': 'XSLT', 'bytes': '7232'}]} |
#ifndef RS_LIBHTTPSERVER_REQUEST_H
#define RS_LIBHTTPSERVER_REQUEST_H
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <boost/algorithm/string.hpp>
#include "types.h"
#include "request_headers.h"
#include "query_string.h"
#include "request_stream.h"
#include "chunked_request_stream.h"
#include "null_stream.h"
#include "headers.h"
namespace rs {
namespace httpserver {
/**
* A class which handles the specifics of an HTTP request
*/
class Request final : public boost::enable_shared_from_this<Request>, private boost::noncopyable {
public:
static request_ptr Create(socket_ptr socket, request_headers_ptr request_headers, HeaderBuffer& headerBuffer) {
return request_ptr(new Request(socket, request_headers, headerBuffer));
}
/**
* Gets the request headers object
* @return The headers of the request
*/
request_headers_ptr getHeaders() {
return request_headers_;
}
/**
* Gets the query string
* @return the requests query string
*/
const QueryString& getQueryString() {
return queryString_;
}
/**
* Returns true if the request is HTTP/1.0
* @return true if the client is using HTTP/1.0
*/
bool IsHttp10() {
return request_headers_->getVersion() == Headers::Http10;
}
/**
* Returns true if the client has requested keep-alive
* @return true if the client explicitly wants to keep the connection open
*/
bool IsKeepAlive() {
auto keepAlive = true;
auto connection = request_headers_->getConnection();
if (IsHttp10()) {
keepAlive = boost::iequals(connection, "keep-alive");
} else {
keepAlive = !boost::iequals(connection, "close");
}
return keepAlive;
}
/**
* Returns true if the request method is a HEAD
* @ return true if the request is a HEAD
*/
bool IsHead() {
return request_headers_->getMethod() == Headers::Head;
}
/**
* Returns true if the client will accept GZIP encoded responses
* @return true if the client accepts GZIP
*/
bool ClientAcceptsGzip() {
auto acceptEncoding = request_headers_->getAcceptEncoding();
return acceptEncoding.length() > 0 && acceptEncoding.find("gzip") != std::string::npos;
}
/**
* The uri the client used to make the request
* @return The request uri
*/
const std::string& getUri() {
return request_headers_->getUri();
}
/**
* Gets the request method (i.e. GET, PUT, POST, etc)
* @return the method used in the request
*/
const std::string& getMethod() {
return request_headers_->getMethod();
}
/**
* Gets connection header passed by the client
* @return The connection header
*/
const std::string& getConnection() {
return request_headers_->getConnection();
}
/**
* Gets the content type of the request body
* @return The request body content type
*/
const std::string& getContentType() {
return request_headers_->getContentType();
}
/**
* Gets the Accept-Encoding field of the request header
* @return the Accept-Encoding header
*/
const std::string& getAcceptEncoding() {
return request_headers_->getAcceptEncoding();
}
/**
* Gets the If-None-Match request header
* @param trimQuotes when true the header field will be returned without the enclosing quotes
* @return The If-None-Match header
*/
std::string getIfNoneMatch(bool trimQuotes = true) {
auto etag = request_headers_->getIfNoneMatch();
// trim off the quotes
if (trimQuotes && etag.length() > 1 && etag[0] == '"' && etag[etag.length() - 1] == '"') {
etag = etag.substr(1, etag.length() - 2);
}
return etag;
}
/**
* Gets the literal Range header
* @return The literal (unparsed) range header
*/
const std::string& getRange() const {
return request_headers_->getRange();
}
/**
* Gets the Range header and unpicks any byte ranges
* @return Byte ranges as pairs
*/
RequestHeaders::byte_range_collection getByteRanges() {
return request_headers_->getByteRanges();
}
/**
* Gets the If-Modified-Since request header
* @return The If-Modified-Since header
*/
const std::string& getIfModifiedSince() {
return request_headers_->getIfModifiedSince();
}
/**
* Gets the length of the request body
* @return the length of the request body
*/
int getContentLength() {
return request_headers_->getContentLength();
}
/**
* A helper to determine whether the client wants the server to close the connection
* after the response has been sent
* @return true if the client has requested that the connection should be closed
*/
bool ShouldClose();
/**
* Gets the request body stream
* @return the request body stream
*/
Stream& getRequestStream();
/**
* Determines whether the request has a body or not
* @return True if the request is a PUT or POST and it has a body and content type
*/
bool HasBody();
private:
Request(socket_ptr socket, request_headers_ptr request_headers, HeaderBuffer& headerBuffer) :
socket_(socket), request_headers_(request_headers),
queryString_(request_headers->getQueryString()),
requestStream_(socket, headerBuffer), chunkedRequestStream_(requestStream_) {}
const socket_ptr socket_;
const request_headers_ptr request_headers_;
const QueryString queryString_;
RequestStream requestStream_;
ChunkedRequestStream chunkedRequestStream_;
static NullStream nullStream_;
};
}}
#endif /* RS_LIBHTTPSERVER_REQUEST_H */
| {'content_hash': '2887b294eff3252e2e70b12eec8cb032', 'timestamp': '', 'source': 'github', 'line_count': 212, 'max_line_length': 115, 'avg_line_length': 28.641509433962263, 'alnum_prop': 0.6180830039525692, 'repo_name': 'RipcordSoftware/libhttpserver', 'id': '071c584ffacef28e767a7dcf5a0c74b30e9d0761', 'size': '6072', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/libhttpserver/request.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '406'}, {'name': 'C++', 'bytes': '182144'}, {'name': 'HTML', 'bytes': '2493'}, {'name': 'Makefile', 'bytes': '70242'}, {'name': 'Shell', 'bytes': '12474'}]} |
<?php
final class StripExtraCommaInList extends FormatterPass {
const EMPTY_LIST = 'ST_EMPTY_LIST';
public function candidate($source, $foundTokens) {
if (isset($foundTokens[T_LIST])) {
return true;
}
return false;
}
public function format($source) {
$this->tkns = token_get_all($source);
$contextStack = [];
$touchedListArrayString = false;
while (list($index, $token) = each($this->tkns)) {
list($id, $text) = $this->getToken($token);
$this->ptr = $index;
switch ($id) {
case T_STRING:
case T_ARRAY:
case T_LIST:
$touchedListArrayString = true;
if ($this->rightTokenIs(ST_PARENTHESES_OPEN)) {
$contextStack[] = $id;
}
break;
case ST_PARENTHESES_OPEN:
if (isset($contextStack[0]) && T_LIST == end($contextStack) && $this->rightTokenIs(ST_PARENTHESES_CLOSE)) {
array_pop($contextStack);
$contextStack[] = self::EMPTY_LIST;
} elseif (!$touchedListArrayString) {
$contextStack[] = ST_PARENTHESES_OPEN;
}
break;
case ST_PARENTHESES_CLOSE:
if (isset($contextStack[0])) {
if (T_LIST == end($contextStack) && $this->leftUsefulTokenIs(ST_COMMA)) {
$prevTokenIdx = $this->leftUsefulTokenIdx();
$this->tkns[$prevTokenIdx] = null;
}
array_pop($contextStack);
}
break;
default:
$touchedListArrayString = false;
break;
}
$this->tkns[$this->ptr] = [$id, $text];
}
return $this->renderLight();
}
} | {'content_hash': '97bf88dc25804a58c3bc5cad5ed78884', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 111, 'avg_line_length': 23.78688524590164, 'alnum_prop': 0.6195727084769125, 'repo_name': 'Recras/php.tools', 'id': '827813874baf3b9de59e212bd51f7f030f114bff', 'size': '1451', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Core/StripExtraCommaInList.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Go', 'bytes': '2945'}, {'name': 'PHP', 'bytes': '758830'}, {'name': 'Shell', 'bytes': '2276'}]} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShaoComputation.Const;
using ShaoComputation.Model;
namespace ShaoComputation.Helper
{
/// <summary>
/// 随机生成
/// </summary>
public class Randam
{
private static readonly Random instance = new Random();
/// <summary>
/// 随机生成公交发车频率
/// </summary>
public static int F
{
get
{
int n = instance.Next(Varias.F_low, Varias.F_up);
return n;
}
}
/// <summary>
/// 轮盘赌选择种群
/// </summary>
public static List<Group> Roulette(List<Group> groups)
{
//保留所有代中最大的目标值
if (Varias.MaxResult < groups.Max(g => g.Result))
{
Varias.MaxResult = groups.Max(g => g.Result);
}
foreach (var group in groups)
{
group.Fitness = Varias.MaxResult - group.Result;
}
var SumFitness = groups.Sum(g => g.Fitness);
var seed = new Random();
var result = new List<Group>();
for (int i = 0; i < Varias.M; i++)
{
var mark = seed.NextDouble();
var init = 0.0;
for (int j = 0; j < groups.Count; j++)
{
init += groups[j].Fitness / SumFitness;
if (init > mark)
{
result.Add(groups[j]);
break;
}
}
}
return result;
}
}
}
| {'content_hash': 'ee48c5b858cfb3d6447bdce6e9b22dfe', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 65, 'avg_line_length': 27.5, 'alnum_prop': 0.4398826979472141, 'repo_name': 'keaising/ShaoComputation', 'id': 'd1c4ce5e320e0daee8210a8ab49703e868ce7d60', 'size': '1773', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ShaoComputation/ShaoComputation/Helper/Randam.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '90717'}]} |
package org.mengyun.tcctransaction.api;
/**
* Created by changmingxie on 10/28/15.
*/
public enum TransactionStatus {
TRYING(1), CONFIRMING(2), CANCELLING(3), TRY_SUCCESS(11), TRY_FAILED(12);
private int id;
TransactionStatus(int id) {
this.id = id;
}
public static TransactionStatus valueOf(int id) {
switch (id) {
case 1:
return TRYING;
case 2:
return CONFIRMING;
case 3:
return CANCELLING;
case 11:
return TRY_SUCCESS;
case 12:
return TRY_FAILED;
default:
throw new IllegalArgumentException("the id " + id + " of TransactionStatus is illegal.");
}
}
public int getId() {
return id;
}
@Override
public String toString() {
switch (id) {
case 1:
return "TRYING";
case 2:
return "CONFIRMING";
case 3:
return "CANCELLING";
case 11:
return "TRY_SUCCESS";
case 12:
return "TRY_FAILED";
default:
throw new IllegalArgumentException("the id " + id + " of TransactionStatus is illegal.");
}
}
}
| {'content_hash': 'c912a29adc77cadbbb3f9d60fcc98aa3', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 105, 'avg_line_length': 23.678571428571427, 'alnum_prop': 0.48491704374057315, 'repo_name': 'changmingxie/tcc-transaction', 'id': '6970ca383a5c3513fccacba49445707f9f17fb30', 'size': '1326', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master-2.x', 'path': 'tcc-transaction-api/src/main/java/org/mengyun/tcctransaction/api/TransactionStatus.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3346'}, {'name': 'CSS', 'bytes': '919'}, {'name': 'FreeMarker', 'bytes': '9580'}, {'name': 'HTML', 'bytes': '4043'}, {'name': 'Java', 'bytes': '834423'}, {'name': 'JavaScript', 'bytes': '118970'}, {'name': 'Shell', 'bytes': '7682'}]} |
require("../components/eoy_artist_list/index.coffee")
| {'content_hash': '9278e25448d940890d5164a56be9fce3', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 53, 'avg_line_length': 54.0, 'alnum_prop': 0.7592592592592593, 'repo_name': 'artsy/force-public', 'id': '3a95920449f6c37e2ccdb1ff2e91af6bd868b674', 'size': '54', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/desktop/assets/eoy_2016.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '333575'}, {'name': 'CoffeeScript', 'bytes': '2034168'}, {'name': 'HTML', 'bytes': '425084'}, {'name': 'JavaScript', 'bytes': '17599'}, {'name': 'Makefile', 'bytes': '3116'}]} |
package gedis
import (
"bytes"
"fmt"
"strconv"
)
// Interface for writing Redis commands
type Writer interface {
Write(p []byte) (n int, err error)
}
func Write(w Writer, args ...interface{}) (n int, err error) {
if len(args) == 0 {
return -1, fmt.Errorf("Must write at least one argument")
}
return w.Write(WriteMultiBulk(args...))
}
// Writes a string as a sequence of bytes to be send to a Redis
// instance, using the Redis Bulk format.
func WriteBulk(bulk string) []byte {
bulk_len := strconv.Itoa(len(bulk))
// '$' + len(string(len(bulk))) + "\r\n" + len(bulk) + "\r\n"
n := 1 + len(bulk_len) + 2 + len(bulk) + 2
bytes := make([]byte, n)
bytes[0] = '$'
j := 1
for _, c := range bulk_len {
bytes[j] = byte(c)
j++
}
bytes[j] = '\r'
bytes[j+1] = '\n'
j += 2
for _, c := range bulk {
bytes[j] = byte(c)
j++
}
bytes[j] = '\r'
bytes[j+1] = '\n'
return bytes
}
// Writes a number in the Redis protocol format
func WriteInt(n int64) []byte {
return []byte(":" + strconv.FormatInt(n, 10) + "\r\n")
}
// Writes an error in the Redis protocol format
func WriteError(err error) []byte {
return []byte("-ERR " + err.Error() + "\r\n")
}
// Writes a status in the Redis protocol format
func WriteStatus(status string) []byte {
bs := make([]byte, len(status)+3)
bs[0] = '+'
l := 1
for _, r := range status {
bs[l] = byte(r)
l++
}
bs[l] = '\r'
bs[l+1] = '\n'
return bs
}
// BUG(inkel): writeMultiBulk can't write multi-bulks inside multi-bulks
// Writes a sequence of strings as a sequence of bytes to be send to a
// Redis instance, using the Redis Multi-Bulk format.
func WriteMultiBulk(args ...interface{}) []byte {
var buffer bytes.Buffer
buffer.WriteByte('*')
buffer.WriteString(strconv.Itoa(len(args)))
buffer.WriteString("\r\n")
var bs []byte
for _, arg := range args {
bs = []byte{}
switch arg := arg.(type) {
case string:
bs = WriteBulk(arg)
case int:
bs = WriteInt(int64(arg))
case int64:
bs = WriteInt(arg)
case error:
bs = WriteError(arg)
case nil:
bs = []byte("$-1\r\n")
default:
panic(fmt.Errorf("Unrecognized type: %#v", arg))
}
buffer.Write(bs)
}
return buffer.Bytes()
}
| {'content_hash': '98631e1ec083c64cddbb54850da8e585', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 72, 'avg_line_length': 19.236842105263158, 'alnum_prop': 0.6105791153670771, 'repo_name': 'inkel/gedis', 'id': 'fbcc5abfa687f194947908b55c76500763a1378a', 'size': '2193', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'writer.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '34325'}]} |
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Net.Http.Headers
{
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
Justification = "This is not a collection")]
public sealed class HttpContentHeaders : HttpHeaders
{
private readonly HttpContent _parent;
private bool _contentLengthSet;
private HttpHeaderValueCollection<string> _allow;
private HttpHeaderValueCollection<string> _contentEncoding;
private HttpHeaderValueCollection<string> _contentLanguage;
public ICollection<string> Allow
{
get
{
if (_allow == null)
{
_allow = new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor,
this, HeaderUtilities.TokenValidator);
}
return _allow;
}
}
public ContentDispositionHeaderValue ContentDisposition
{
get { return (ContentDispositionHeaderValue)GetParsedValues(KnownHeaders.ContentDisposition.Descriptor); }
set { SetOrRemoveParsedValue(KnownHeaders.ContentDisposition.Descriptor, value); }
}
// Must be a collection (and not provide properties like "GZip", "Deflate", etc.) since the
// order matters!
public ICollection<string> ContentEncoding
{
get
{
if (_contentEncoding == null)
{
_contentEncoding = new HttpHeaderValueCollection<string>(KnownHeaders.ContentEncoding.Descriptor,
this, HeaderUtilities.TokenValidator);
}
return _contentEncoding;
}
}
public ICollection<string> ContentLanguage
{
get
{
if (_contentLanguage == null)
{
_contentLanguage = new HttpHeaderValueCollection<string>(KnownHeaders.ContentLanguage.Descriptor,
this, HeaderUtilities.TokenValidator);
}
return _contentLanguage;
}
}
public long? ContentLength
{
get
{
// 'Content-Length' can only hold one value. So either we get 'null' back or a boxed long value.
object storedValue = GetParsedValues(KnownHeaders.ContentLength.Descriptor);
// Only try to calculate the length if the user didn't set the value explicitly using the setter.
if (!_contentLengthSet && (storedValue == null))
{
// If we don't have a value for Content-Length in the store, try to let the content calculate
// it's length. If the content object is able to calculate the length, we'll store it in the
// store.
long? calculatedLength = _parent.GetComputedOrBufferLength();
if (calculatedLength != null)
{
SetParsedValue(KnownHeaders.ContentLength.Descriptor, (object)calculatedLength.Value);
}
return calculatedLength;
}
if (storedValue == null)
{
return null;
}
else
{
return (long)storedValue;
}
}
set
{
SetOrRemoveParsedValue(KnownHeaders.ContentLength.Descriptor, value); // box long value
_contentLengthSet = true;
}
}
public Uri ContentLocation
{
get { return (Uri)GetParsedValues(KnownHeaders.ContentLocation.Descriptor); }
set { SetOrRemoveParsedValue(KnownHeaders.ContentLocation.Descriptor, value); }
}
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays",
Justification = "In this case the 'value' is the byte array. I.e. the array is treated as a value.")]
public byte[] ContentMD5
{
get { return (byte[])GetParsedValues(KnownHeaders.ContentMD5.Descriptor); }
set { SetOrRemoveParsedValue(KnownHeaders.ContentMD5.Descriptor, value); }
}
public ContentRangeHeaderValue ContentRange
{
get { return (ContentRangeHeaderValue)GetParsedValues(KnownHeaders.ContentRange.Descriptor); }
set { SetOrRemoveParsedValue(KnownHeaders.ContentRange.Descriptor, value); }
}
public MediaTypeHeaderValue ContentType
{
get { return (MediaTypeHeaderValue)GetParsedValues(KnownHeaders.ContentType.Descriptor); }
set { SetOrRemoveParsedValue(KnownHeaders.ContentType.Descriptor, value); }
}
public DateTimeOffset? Expires
{
get { return HeaderUtilities.GetDateTimeOffsetValue(KnownHeaders.Expires.Descriptor, this, DateTimeOffset.MinValue); }
set { SetOrRemoveParsedValue(KnownHeaders.Expires.Descriptor, value); }
}
public DateTimeOffset? LastModified
{
get { return HeaderUtilities.GetDateTimeOffsetValue(KnownHeaders.LastModified.Descriptor, this); }
set { SetOrRemoveParsedValue(KnownHeaders.LastModified.Descriptor, value); }
}
internal HttpContentHeaders(HttpContent parent)
: base(HttpHeaderType.Content | HttpHeaderType.Custom, HttpHeaderType.None)
{
_parent = parent;
}
}
}
| {'content_hash': '7c908aebf3223399bf5e87d3929e7670', 'timestamp': '', 'source': 'github', 'line_count': 148, 'max_line_length': 130, 'avg_line_length': 38.62162162162162, 'alnum_prop': 0.5855493351994402, 'repo_name': 'ViktorHofer/corefx', 'id': '16b3f05d9e735e8e1c853c838b3bc41c96ef4608', 'size': '5920', 'binary': False, 'copies': '29', 'ref': 'refs/heads/master', 'path': 'src/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': '1C Enterprise', 'bytes': '280724'}, {'name': 'ASP', 'bytes': '1687'}, {'name': 'Batchfile', 'bytes': '11027'}, {'name': 'C', 'bytes': '3803475'}, {'name': 'C#', 'bytes': '181020278'}, {'name': 'C++', 'bytes': '1521'}, {'name': 'CMake', 'bytes': '79434'}, {'name': 'DIGITAL Command Language', 'bytes': '26402'}, {'name': 'HTML', 'bytes': '653'}, {'name': 'Makefile', 'bytes': '13780'}, {'name': 'OpenEdge ABL', 'bytes': '137969'}, {'name': 'Perl', 'bytes': '3895'}, {'name': 'PowerShell', 'bytes': '192578'}, {'name': 'Python', 'bytes': '1535'}, {'name': 'Roff', 'bytes': '9422'}, {'name': 'Shell', 'bytes': '131531'}, {'name': 'TSQL', 'bytes': '96941'}, {'name': 'Visual Basic', 'bytes': '2135320'}, {'name': 'XSLT', 'bytes': '514720'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_91) on Thu Jun 30 15:53:50 BST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.taverna.workflowmodel.processor.iteration (Apache Taverna Engine and Platform 3.1.0-incubating API)</title>
<meta name="date" content="2016-06-30">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.taverna.workflowmodel.processor.iteration (Apache Taverna Engine and Platform 3.1.0-incubating API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/taverna/workflowmodel/processor/dispatch/layers/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/impl/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/taverna/workflowmodel/processor/iteration/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package org.apache.taverna.workflowmodel.processor.iteration</h1>
<div class="docSummary">
<div class="block">Object model and enactment logic for the iteration strategy component of
a Processor</div>
</div>
<p>See: <a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/IterationStrategy.html" title="interface in org.apache.taverna.workflowmodel.processor.iteration">IterationStrategy</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/IterationStrategyNode.html" title="interface in org.apache.taverna.workflowmodel.processor.iteration">IterationStrategyNode</a></td>
<td class="colLast">
<div class="block">Interface for nodes within an iteration strategy layer</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/IterationStrategyStack.html" title="interface in org.apache.taverna.workflowmodel.processor.iteration">IterationStrategyStack</a></td>
<td class="colLast">
<div class="block">Stack of iteration strategy containers.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/AbstractIterationStrategyNode.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">AbstractIterationStrategyNode</a></td>
<td class="colLast">
<div class="block">Abstract superclass for implementations of IterationStrategyNode, adds logic
to connect nodes together and convenience methods to push jobs and completion
events up to the parent node.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/CompletionHandlingAbstractIterationStrategyNode.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">CompletionHandlingAbstractIterationStrategyNode</a></td>
<td class="colLast">
<div class="block">A superclass for all iteration strategy nodes which are required to propagate
final completion events formed from multiple inputs.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/CrossProduct.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">CrossProduct</a></td>
<td class="colLast">
<div class="block">A cross product node combines its inputs in an 'all against all' manner.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/DotProduct.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">DotProduct</a></td>
<td class="colLast">
<div class="block">The dot product matches jobs by index array, when a job is received a job is
emited if and only if the index array of the new job is matched exactly by
index arrays of one job in each other input index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/NamedInputPortNode.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">NamedInputPortNode</a></td>
<td class="colLast">
<div class="block">Acts as the input to a stage within the iteration strategy, passes all jobs
straight through.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/PrefixDotProduct.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">PrefixDotProduct</a></td>
<td class="colLast">
<div class="block">Matches jobs where the index array of the job on index 0 is the prefix of the
index array of the job on index 1.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/TerminalNode.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">TerminalNode</a></td>
<td class="colLast">
<div class="block">The terminal node is the root of the iteration strategy tree, it is
responsible for forwarding all events up to the iteration strategy itself
which can then propogate them to the strategy stack.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/IterationTypeMismatchException.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">IterationTypeMismatchException</a></td>
<td class="colLast">
<div class="block">Thrown during the typecheck phase when an iteration strategy is configured
such that at runtime it would fail.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/MissingIterationInputException.html" title="class in org.apache.taverna.workflowmodel.processor.iteration">MissingIterationInputException</a></td>
<td class="colLast">
<div class="block">Thrown when an attempt is made to evaluate the type of the iteration strategy
but one or more input ports aren't defined in the input array of types.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.taverna.workflowmodel.processor.iteration Description">Package org.apache.taverna.workflowmodel.processor.iteration Description</h2>
<div class="block">Object model and enactment logic for the iteration strategy component of
a Processor</div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/taverna/workflowmodel/processor/dispatch/layers/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../org/apache/taverna/workflowmodel/processor/iteration/impl/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/taverna/workflowmodel/processor/iteration/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015–2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| {'content_hash': '784c9818b794aa846eb5078718345310', 'timestamp': '', 'source': 'github', 'line_count': 254, 'max_line_length': 281, 'avg_line_length': 46.40944881889764, 'alnum_prop': 0.6912962334577536, 'repo_name': 'apache/incubator-taverna-site', 'id': '5574b6ce09763ebef9fe117c94e06fa6ff2f2d85', 'size': '11788', 'binary': False, 'copies': '2', 'ref': 'refs/heads/trunk', 'path': 'content/javadoc/taverna-engine/org/apache/taverna/workflowmodel/processor/iteration/package-summary.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '10003'}, {'name': 'Clojure', 'bytes': '49413'}, {'name': 'Dockerfile', 'bytes': '1398'}, {'name': 'HTML', 'bytes': '72209'}, {'name': 'Perl', 'bytes': '2822'}, {'name': 'Python', 'bytes': '31455'}, {'name': 'Shell', 'bytes': '374'}]} |
<?php
//------------------------------------------------------------------------------
namespace srv1c {
//------------------------------------------------------------------------------
require_once CORE_DIR . 'except.php';
require_once CORE_DIR . 'infobase.php';
require_once CORE_DIR . 'utils.php';
require_once CORE_DIR . 'handler.php';
require_once LOADERS_DIR . 'shared.php';
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
class carter_handler extends handler {
protected $infobase_;
protected $session_uuid_;
protected function fetch_cart() {
$sql = <<<EOT
SELECT
b.product_uuid AS uuid,
b.quantity AS buy_quantity,
a.code AS code,
a.name AS name,
i.uuid AS base_image_uuid,
i.ext AS base_image_ext,
COALESCE(q.quantity, 0) AS remainder,
COALESCE(b.price, p.price, 0) AS price,
COALESCE(r.quantity, 0) AS reserve,
bcr.barcode AS barcode
FROM
cart AS b
LEFT JOIN products AS a
ON a.uuid = b.product_uuid
LEFT JOIN images AS i
ON a.base_image_uuid = i.uuid
LEFT JOIN prices_registry AS p
ON a.uuid = p.product_uuid
LEFT JOIN remainders_registry AS q
ON a.uuid = q.product_uuid
LEFT JOIN reserves_registry AS r
ON a.uuid = r.product_uuid
LEFT JOIN barcodes_registry AS bcr
ON a.uuid = bcr.product_uuid
WHERE
b.session_uuid = :session_uuid
ORDER BY
a.name
EOT
;
$st = $this->infobase_->prepare($sql);
$st->bindValue(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$result = $st->execute();
$cart = [];
while( $r = $result->fetchArray(SQLITE3_ASSOC) ) {
extract($r);
$uuid = bin2uuid($uuid);
$barcodes = @$cart[$uuid]['barcodes'];
if( $barcode !== null ) {
if( $barcodes === null )
$barcodes = [];
$barcodes[] = $barcode;
}
$e = [
'uuid' => $uuid,
'buy_quantity' => $buy_quantity,
'code' => $code,
'name' => htmlspecialchars($name, ENT_HTML5),
'price' => $price,
'remainder' => $remainder,
'reserve' => $reserve,
'img_url' => htmlspecialchars(get_image_url($base_image_uuid, $base_image_ext, true), ENT_HTML5),
'img_ico' => htmlspecialchars(get_image_url($base_image_uuid, $base_image_ext, false), ENT_HTML5)
];
if( $barcodes !== null )
$e['barcodes'] = $barcodes;
if( $base_image_uuid !== null )
$e['img_uuid'] = bin2uuid($base_image_uuid);
$cart[$uuid] = $e;
}
return array_values($cart);
}
protected function fetch_constants($bin2uuid = false) {
$constants = [
'ТекущийМагазинАдрес' => null,
'ТекущийМагазинПредставление' => null,
'exchange_node' => null,
'exchange_node_name' => null,
'exchange_url' => null,
'exchange_user' => null,
'exchange_pass' => null,
'pending_orders' => null
];
extract($constants);
$in = '\'' . implode('\', \'', array_keys($constants)) . '\'';
$sql = <<<EOT
SELECT
name AS name,
value_type AS value_type,
COALESCE(value_uuid, value_s, value_b, value_n) AS value
FROM
constants
WHERE
name IN (${in})
EOT
;
$this->infobase_->dump_plan($sql);
$result = $this->infobase_->query($sql);
$a = [];
while( $r = $result->fetchArray(SQLITE3_ASSOC) ) {
extract($r);
if( $bin2uuid && $value_type === 4 )
$a[$name] = bin2uuid(@$value);
else if( $value_type === 1 )
$a[$name] = $value === null || $value === 0 ? false : true;
else
$a[$name] = $value;
}
return $a;
}
protected function handle_order(&$order) {
extract($this->fetch_constants());
$order_request = [ 'exchange_node' => bin2uuid($exchange_node) ];
$order_products = [];
$totals = 0;
foreach( $order as $e ) {
extract($e);
$order_products[] = [
'product' => $uuid,
'price' => $price,
'quantity' => $quantity
];
$totals += $price * $quantity;
}
$order_request['products'] = $order_products;
if( @$this->request_['user'] !== null )
$order_request['user'] = $this->request_['user'];
if( @$this->request_['pass'] !== null )
$order_request['pass'] = $this->request_['pass'];
if( @$this->request_['paper'] !== null )
$order_request['paper'] = true;
$data = null;
if( @$pending_orders ) {
$pending_order_uuid = random_bytes(16);
$order_request['pending_uuid'] = bin2uuid($pending_order_uuid);
$request_json = json_encode($order_request, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
$st = $this->infobase_->prepare(<<<'EOT'
REPLACE INTO pending_orders (
session_uuid, order_uuid, request, data
) VALUES (
:session_uuid, :order_uuid, :request, ''
)
EOT
);
$st->bindValue(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$st->bindValue(':order_uuid', $pending_order_uuid, SQLITE3_BLOB);
$st->bindValue(':request', $request_json);
$st->execute();
}
else {
$online = mb_strlen(trim($exchange_user)) !== 0 && mb_strlen(trim($exchange_pass)) !== 0;
$data = request_exchange_node($exchange_url . '/order', $exchange_user, $exchange_pass, $order_request);
$data['name'] = $exchange_node_name;
}
//$data['barcode_eangnivc'] = htmlspecialchars($data['barcode_eangnivc'], ENT_HTML5);
if( $data !== null ) {
$data['customer'] = htmlspecialchars($data['customer'], ENT_HTML5);
$data['comment'] = htmlspecialchars($data['comment'], ENT_HTML5);
$this->response_['order'] = $data;
}
if( $data !== null && @$data['uuid'] !== null ) {
if( @$this->request_['paper'] !== null ) {
$orders = @$_SESSION['ORDERS'];
if( $orders === null )
$orders = [];
else
$orders = unserialize(bzdecompress(base64_decode($orders)));
$orders[$data['uuid']] = $data;
$_SESSION['ORDERS'] = base64_encode(bzcompress(serialize($orders), 9));
}
}
}
protected function handle_request() {
$timer = new \nano_timer;
$this->session_uuid_ = session_startup();
$this->infobase_ = new infobase;
$this->infobase_->initialize();
extract($this->request_);
$this->infobase_->begin_transaction();
if( @$order !== null )
$this->handle_order($order);
if( @$products !== null && count($products) > 0
&& @$order['availability'] === null ) {
$timer->restart();
$sql = <<<'EOT'
REPLACE INTO cart
SELECT
n.session_uuid,
n.product_uuid,
n.quantity,
COALESCE(n.price, b.price, p.price) AS price
FROM
(SELECT
:session_uuid AS session_uuid,
:product_uuid AS product_uuid,
:quantity AS quantity,
:price AS price
) AS n
LEFT JOIN cart AS b
ON n.session_uuid = b.session_uuid
AND n.product_uuid = b.product_uuid
LEFT JOIN prices_registry AS p
ON n.product_uuid = p.product_uuid
EOT
;
$st = $this->infobase_->prepare($sql);
$st->bindParam(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$sql = <<<'EOT'
SELECT
a.product_uuid,
COALESCE(b.quantity, 0) + 1 AS quantity
FROM
barcodes_registry AS a
LEFT JOIN cart AS b
ON b.session_uuid = :session_uuid
AND a.product_uuid = b.product_uuid
WHERE
a.barcode = :barcode
EOT
;
$st_barcode = $this->infobase_->prepare($sql);
$st_barcode->bindParam(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
foreach( $products as $product ) {
extract($product);
$product_uuid = uuid2bin(@$uuid);
if( @$barcode !== null ) {
$st_barcode->bindValue(':barcode', $barcode);
$result = $st_barcode->execute();
while( $r = $result->fetchArray(SQLITE3_ASSOC) )
extract($r);
}
if( $product_uuid !== null ) {
$st->bindValue(':product_uuid' , $product_uuid, SQLITE3_BLOB);
$st->bindValue(':quantity' , @$quantity);
$st->bindValue(':price' , @$price);
$st->execute();
}
}
$sql = <<<'EOT'
REPLACE INTO cart
SELECT
c.session_uuid,
c.product_uuid,
q.quantity,
c.price
FROM
cart AS c
INNER JOIN remainders_registry AS q
ON c.product_uuid = q.product_uuid
WHERE
c.session_uuid = :session_uuid
AND c.quantity > q.quantity
EOT
;
$st = $this->infobase_->prepare($sql);
$st->bindValue(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$st->execute();
$sql = <<<'EOT'
DELETE FROM cart WHERE session_uuid = :session_uuid AND quantity <= 0
EOT
;
$st = $this->infobase_->prepare($sql);
$st->bindValue(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$st->execute();
if( config::$cart_timing ) {
$ellapsed = $timer->last_nano_time();
error_log('cart update, ellapsed: ' . $timer->ellapsed_string($ellapsed));
}
}
else {
$c = $this->fetch_constants();
$allowed = [
'pending_orders' => false,
'ТекущийМагазинАдрес' => '',
'ТекущийМагазинПредставление' => ''
];
foreach( $c as $k => $v )
if( array_key_exists($k, $allowed) )
$allowed[$k] = $v;
$this->response_['constants'] = $allowed;
}
$timer->restart();
$this->response_['cart'] = $this->fetch_cart();
if( config::$cart_timing ) {
$ellapsed = $timer->last_nano_time();
error_log('cart fetch, ellapsed: ' . $timer->ellapsed_string($ellapsed));
}
$this->infobase_->commit_transaction();
if( @$orders !== null ) {
$orders = @$_SESSION['ORDERS'];
if( $orders === null )
$orders = [];
else
$orders = unserialize(bzdecompress(base64_decode($orders)));
$sql = <<<'EOT'
SELECT
order_uuid, data
FROM
pending_orders
WHERE
session_uuid = :session_uuid
AND data <> ''
EOT
;
$st = $this->infobase_->prepare($sql);
$st->bindParam(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$sql = <<<'EOT'
DELETE FROM pending_orders
WHERE
session_uuid = :session_uuid
AND order_uuid = :order_uuid
EOT
;
$st_del = $this->infobase_->prepare($sql);
$st_del->bindParam(':session_uuid', $this->session_uuid_, SQLITE3_BLOB);
$this->infobase_->begin_transaction();
$change = false;
$result = $st->execute();
while( $r = $result->fetchArray(SQLITE3_ASSOC) ) {
extract($r);
$data = json_decode($data, true, 512, JSON_BIGINT_AS_STRING);
$uuid = $data['uuid'];
if( @$data['removed'] ) {
unset($orders[$uuid]);
}
else {
$orders[$uuid] = $data;
}
$st_del->bindValue(':order_uuid', $order_uuid, SQLITE3_BLOB);
$st_del->execute();
$change = true;
}
$this->infobase_->commit_transaction();
if( $change )
$_SESSION['ORDERS'] = base64_encode(bzcompress(serialize($orders), 9));
$this->response_['orders'] = $orders;
}
$ellapsed = $timer->nano_time(false);
$this->response_['ellapsed'] = $ellapsed;
if( config::$log_timing )
error_log('cart retrieved, ellapsed: ' . $timer->ellapsed_string($ellapsed));
}
};
//------------------------------------------------------------------------------
} // namespace srv1c
//------------------------------------------------------------------------------
?>
| {'content_hash': '2779a4adc56e4cd0fbc9e64fe97b4edf', 'timestamp': '', 'source': 'github', 'line_count': 463, 'max_line_length': 107, 'avg_line_length': 24.40388768898488, 'alnum_prop': 0.5508452075404903, 'repo_name': 'GuramDuka/customer_terminal', 'id': 'a89337516f2140f58e0d0863937f2c59d64de982', 'size': '11391', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/processors/carter.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3700'}, {'name': 'Batchfile', 'bytes': '165'}, {'name': 'CSS', 'bytes': '126671'}, {'name': 'HTML', 'bytes': '12997'}, {'name': 'JavaScript', 'bytes': '1885845'}, {'name': 'PHP', 'bytes': '236592'}, {'name': 'Shell', 'bytes': '305'}]} |
// Copyright (C) 2012 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.git.strategy;
import static com.google.common.base.Preconditions.checkState;
import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.ApprovalsUtil;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.git.CodeReviewCommit;
import com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk;
import com.google.gerrit.server.git.MergeException;
import com.google.gerrit.server.git.MergeSorter;
import com.google.gerrit.server.git.MergeTip;
import com.google.gerrit.server.git.MergeUtil;
import com.google.gerrit.server.index.ChangeIndexer;
import com.google.gerrit.server.project.ChangeControl;
import com.google.inject.Provider;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevFlag;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
/**
* Base class that submit strategies must extend.
* <p>
* A submit strategy for a certain {@link SubmitType} defines how the submitted
* commits should be merged.
*/
public abstract class SubmitStrategy {
static class Arguments {
protected final IdentifiedUser.GenericFactory identifiedUserFactory;
protected final Provider<PersonIdent> serverIdent;
protected final ReviewDb db;
protected final ChangeControl.GenericFactory changeControlFactory;
protected final Repository repo;
protected final CodeReviewRevWalk rw;
protected final ObjectInserter inserter;
protected final RevFlag canMergeFlag;
protected final Set<RevCommit> alreadyAccepted;
protected final Branch.NameKey destBranch;
protected final ApprovalsUtil approvalsUtil;
protected final MergeUtil mergeUtil;
protected final ChangeIndexer indexer;
protected final MergeSorter mergeSorter;
protected final IdentifiedUser caller;
Arguments(IdentifiedUser.GenericFactory identifiedUserFactory,
Provider<PersonIdent> serverIdent, ReviewDb db,
ChangeControl.GenericFactory changeControlFactory, Repository repo,
CodeReviewRevWalk rw, ObjectInserter inserter, RevFlag canMergeFlag,
Set<RevCommit> alreadyAccepted, Branch.NameKey destBranch,
ApprovalsUtil approvalsUtil, MergeUtil mergeUtil,
ChangeIndexer indexer, IdentifiedUser caller) {
this.identifiedUserFactory = identifiedUserFactory;
this.serverIdent = serverIdent;
this.db = db;
this.changeControlFactory = changeControlFactory;
this.repo = repo;
this.rw = rw;
this.inserter = inserter;
this.canMergeFlag = canMergeFlag;
this.alreadyAccepted = alreadyAccepted;
this.destBranch = destBranch;
this.approvalsUtil = approvalsUtil;
this.mergeUtil = mergeUtil;
this.indexer = indexer;
this.mergeSorter = new MergeSorter(rw, alreadyAccepted, canMergeFlag);
this.caller = caller;
}
}
protected final Arguments args;
private PersonIdent refLogIdent;
SubmitStrategy(Arguments args) {
this.args = args;
}
/**
* Runs this submit strategy.
* <p>
* If possible, the provided commits will be merged with this submit strategy.
*
* @param currentTip the mergeTip
* @param toMerge the list of submitted commits that should be merged using
* this submit strategy. Implementations are responsible for ordering
* of commits, and should not modify the input in place.
* @return the new merge tip.
* @throws MergeException
*/
public final MergeTip run(final CodeReviewCommit currentTip,
final Collection<CodeReviewCommit> toMerge) throws MergeException {
refLogIdent = null;
checkState(args.caller != null);
return _run(currentTip, toMerge);
}
/** @see #run(CodeReviewCommit, Collection) */
protected abstract MergeTip _run(CodeReviewCommit currentTip,
Collection<CodeReviewCommit> toMerge) throws MergeException;
/**
* Checks whether the given commit can be merged.
* <p>
* Implementations must ensure that invoking this method modifies neither the
* git repository nor the Gerrit database.
*
* @param mergeTip the merge tip.
* @param toMerge the commit that should be checked.
* @return {@code true} if the given commit can be merged, otherwise
* {@code false}
* @throws MergeException
*/
public abstract boolean dryRun(CodeReviewCommit mergeTip,
CodeReviewCommit toMerge) throws MergeException;
/**
* Returns the identity that should be used for reflog entries when updating
* the destination branch.
* <p>
* The reflog identity may only be set during {@link #run(CodeReviewCommit,
* Collection)}, and this method is invalid to call beforehand.
*
* @return the ref log identity, which may be {@code null}.
*/
public final PersonIdent getRefLogIdent() {
return refLogIdent;
}
/**
* Returns all commits that have been newly created for the changes that are
* getting merged.
* <p>
* By default this method returns an empty map, but subclasses may override
* this method to provide any newly created commits.
* <p>
* This method may only be called after {@link #run(CodeReviewCommit,
* Collection)}.
*
* @return new commits created for changes that were merged.
*/
public Map<Change.Id, CodeReviewCommit> getNewCommits() {
return Collections.emptyMap();
}
/**
* Returns whether a merge that failed with {@link Result#LOCK_FAILURE} should
* be retried.
* <p>
* May be overridden by subclasses.
*
* @return {@code true} if a merge that failed with
* {@link Result#LOCK_FAILURE} should be retried, otherwise
* {@code false}
*/
public boolean retryOnLockFailure() {
return true;
}
/**
* Set the ref log identity if it wasn't set yet.
*/
protected final void setRefLogIdent() {
if (refLogIdent == null) {
refLogIdent = args.identifiedUserFactory.create(
args.caller.getAccountId()).newRefLogIdent();
}
}
}
| {'content_hash': '4c3c7dc7d5166930681b22022feb3919', 'timestamp': '', 'source': 'github', 'line_count': 196, 'max_line_length': 80, 'avg_line_length': 35.58673469387755, 'alnum_prop': 0.7334767025089606, 'repo_name': 'Seinlin/gerrit', 'id': '914ab2b636b43031f0491334c8f473eda16770f5', 'size': '6975', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'gerrit-server/src/main/java/com/google/gerrit/server/git/strategy/SubmitStrategy.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '50601'}, {'name': 'GAP', 'bytes': '4119'}, {'name': 'Go', 'bytes': '1865'}, {'name': 'Groff', 'bytes': '28221'}, {'name': 'HTML', 'bytes': '70236'}, {'name': 'Java', 'bytes': '9121611'}, {'name': 'JavaScript', 'bytes': '1590'}, {'name': 'Makefile', 'bytes': '1313'}, {'name': 'PLpgSQL', 'bytes': '4462'}, {'name': 'Perl', 'bytes': '9943'}, {'name': 'Prolog', 'bytes': '17711'}, {'name': 'Python', 'bytes': '14027'}, {'name': 'Shell', 'bytes': '47590'}]} |
<!doctype html>
<html>
<head>
<meta charset="utf8"/>
<title>Fleeting Thoughts</title>
<link href="css/fleeting-thoughts.css" rel="stylesheet">
<script type="text/javascript" src="lib/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="lib/underscore-min.js"></script>
<script type="text/javascript" src="lib/backbone-min.js"></script>
<script type="text/javascript" src="dist/fleeting-thoughts.min.js"></script>
<script type="text/javascript" src="js/setup.js"></script>
</head>
<body>
<h1>Fleeting Thoughts</h1>
</body>
</html>
| {'content_hash': '59bb4a0465ebb8fd82bfd5e07b1055a0', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 80, 'avg_line_length': 36.75, 'alnum_prop': 0.6615646258503401, 'repo_name': 'dvberkel/fleeting-thoughts', 'id': 'd90c450bce8d9b060daa8ab08973608ce515a106', 'size': '588', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6608'}, {'name': 'HTML', 'bytes': '614'}, {'name': 'JavaScript', 'bytes': '112332'}]} |
using FlowingRetailPayment.Controllers;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using System;
using System.Threading;
namespace FlowingRetailPayment
{
public class Program
{
public static void Main(string[] args)
{
new Thread(() =>
{
//Thread.CurrentThread.IsBackground = true;
Console.WriteLine("Service is operating normal");
bool running = true;
while (running)
{
Console.WriteLine("[S]low, [N]ormal, E[X]it: ");
char mode = Char.ToUpper(Console.ReadKey().KeyChar);
if ('S'.Equals(mode))
{
StripeFakeController.slow = true;
Console.WriteLine("Service is now slow");
}
else if ('N'.Equals(mode))
{
StripeFakeController.slow = false;
Console.WriteLine("Service is back to normal");
}
else if ('X'.Equals(mode))
{
running = false;
}
}
}).Start();
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://localhost:8099")
.Build();
}
}
| {'content_hash': '6e368945cf7e9707fcd63429d95c1cea', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 72, 'avg_line_length': 30.21153846153846, 'alnum_prop': 0.45066836409929983, 'repo_name': 'flowing/flowing-retail', 'id': '3aa46f93ee661b55ff00bec0c1298a56b1afa5c1', 'size': '1573', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rest/csharp/stripe-fake/Program.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '818'}, {'name': 'C#', 'bytes': '17864'}, {'name': 'Dockerfile', 'bytes': '875'}, {'name': 'Go', 'bytes': '9388'}, {'name': 'HTML', 'bytes': '7571'}, {'name': 'Java', 'bytes': '156503'}, {'name': 'JavaScript', 'bytes': '5294'}]} |
<div class="container">
<div class="row">
<div class="col-md-12">
<section>
<br><br><br><br>
<div class="jumbotron">
<h1><i class="glyphicon glyphicon-th-list"></i> browseStorage</h1>
<p>
browseStorage is an open-source Web application
that allows you, the developer, to offer your users an
interface to your data stores (e.g.: databases) by
merely configuring the expected general interface.
</p>
<p>
Little or no code writing is required.
</p>
<p><a class="btn btn-default btn-lg" role="button" href="#/docs">Learn more</a></p>
</div>
<div class="alert alert-warning" role="alert">
<strong>Warning!</strong> The demo database & tables are reset every hour, on the hour.<br />
The code for this is in <code>browseStorage/config.php</code> and is easily removable.
</div>
<br /><br /><br /><br />
</section>
</div>
</div>
</div>
<footer class="navbar navbar-default navbar-fixed-bottom">
<div class="container text-muted small">
<div class="col-md-12 visible-xs">
© <a href="https://www.linkedin.com/in/pfreire">Pedro Freire</a> at <a href="http://www.cynergi.com">Cynergi</a> |
<a href="https://github.com/cynergi/browseStorage/blob/master/LICENSE">MIT License</a><br />
More in the <a href="#/docs">documentation</a>.
</div>
<div class="col-md-6 hidden-xs">
<p>
<dl>
<dt>browseStorage</dt>
<dd>
<a href="http://www.cynergi.com/browseStorage/">www.cynergi.com/browseStorage</a><br />
<a href="https://github.com/cynergi/browseStorage/blob/master/LICENSE">MIT License</a> | <a href="https://github.com/cynergi/browseStorage">Source at GitHub</a>
</dd>
</dl>
</p>
</div>
<div class="col-md-6 hidden-xs">
<p>
<dl>
<dt>Author</dt>
<dd>
© Pedro Freire at <a href="http://www.cynergi.com">Cynergi</a> (Corebase, Lda) | <a href="https://www.linkedin.com/in/pfreire">LinkedIn profile</a><br />
browseStorage <a href="http://www.cynergi.com/cynergi-faq-support-contacts.php">customization services available</a>
</dd>
</dl>
</p>
</div>
</div>
</footer>
| {'content_hash': '6b70f05816d3ff0fdbdbd3676593a45f', 'timestamp': '', 'source': 'github', 'line_count': 71, 'max_line_length': 163, 'avg_line_length': 30.676056338028168, 'alnum_prop': 0.6253443526170799, 'repo_name': 'cynergi/browseStorage', 'id': 'cc1ee3a3657ae4a48c3ce569ee4295e5743cc7be', 'size': '2178', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'browseStorage/page-about.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '59568'}, {'name': 'JavaScript', 'bytes': '13578'}, {'name': 'PHP', 'bytes': '110147'}, {'name': 'PLpgSQL', 'bytes': '3431'}]} |
namespace blimp {
namespace {
void DoNothingCompletionCallback(int) {}
} // namespace
HeliumBlobSenderDelegate::HeliumBlobSenderDelegate() {}
HeliumBlobSenderDelegate::~HeliumBlobSenderDelegate() {}
void HeliumBlobSenderDelegate::DeliverBlob(const BlobId& id, BlobDataPtr data) {
BlobChannelMessage* blob_message;
std::unique_ptr<BlimpMessage> message = CreateBlimpMessage(&blob_message);
blob_message->mutable_transfer_blob()->set_payload(&data->data[0],
data->data.size());
blob_message->mutable_transfer_blob()->set_blob_id(id);
outgoing_processor_->ProcessMessage(std::move(message),
base::Bind(&DoNothingCompletionCallback));
}
void HeliumBlobSenderDelegate::ProcessMessage(
std::unique_ptr<BlimpMessage> message,
const net::CompletionCallback& callback) {
NOTIMPLEMENTED();
callback.Run(net::ERR_NOT_IMPLEMENTED);
}
} // namespace blimp
| {'content_hash': '870bee6468e51a5c91c6b2dde504396d', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 80, 'avg_line_length': 33.275862068965516, 'alnum_prop': 0.6901554404145078, 'repo_name': 'danakj/chromium', 'id': 'ac18fcfc4b3e477da979c84804c1ab2fd59002ad', 'size': '1374', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'blimp/net/blob_channel/helium_blob_sender_delegate.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>int-map: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.11.1 / int-map - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
int-map
<small>
8.9.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-10-18 13:00:49 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-18 13:00:49 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.11.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/int-map"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/IntMap"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: finite sets"
"keyword: maps"
"keyword: binary integers"
"keyword: efficient data structures"
"keyword: data structures"
"category: Computer Science/Data Types and Data Structures"
"date: around 1999 (integrated within Coq 7.0)"
]
authors: [
"Jean Goubault <goubault [@] lsv.ens-cachan.fr>"
]
bug-reports: "https://github.com/coq-contribs/int-map/issues"
dev-repo: "git+https://github.com/coq-contribs/int-map.git"
synopsis: "Maps indexed by binary integers : IntMap"
description: """
This library contains a data structure for finite sets implemented by
an efficient structure of map (trees indexed by binary integers).
It was initially developed by Jean Goubault.
This user contribution used to be part of Coq Standard Library.
It is now considered to be obsolete and subsumed by the new
FSets/FMap library. IntMap can be now seen as a particular
implementation of FMapInterface, see file FMapIntMap."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/int-map/archive/v8.9.0.tar.gz"
checksum: "md5=19c9bbcaa395323f5b2460b955259cc0"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-int-map.8.9.0 coq.8.11.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.1).
The following dependencies couldn't be met:
- coq-int-map -> coq < 8.10~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-int-map.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': '8c41aebe89876f2a9dad2976c415fdad', 'timestamp': '', 'source': 'github', 'line_count': 179, 'max_line_length': 159, 'avg_line_length': 40.82122905027933, 'alnum_prop': 0.5554947310797865, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '5e0eeaca643dd4f7d9760b8fcf2591cf023bf53a', 'size': '7332', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.09.1-2.0.6/released/8.11.1/int-map/8.9.0.html', 'mode': '33188', 'license': 'mit', 'language': []} |
package org.apache.ftpserver.usermanager.impl;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import org.apache.ftpserver.FtpServerConfigurationException;
import org.apache.ftpserver.ftplet.Authentication;
import org.apache.ftpserver.ftplet.AuthenticationFailedException;
import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.ftplet.User;
import org.apache.ftpserver.usermanager.AnonymousAuthentication;
import org.apache.ftpserver.usermanager.PasswordEncryptor;
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory;
import org.apache.ftpserver.usermanager.UsernamePasswordAuthentication;
import org.apache.ftpserver.util.BaseProperties;
import org.apache.ftpserver.util.IoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <strong>Internal class, do not use directly.</strong>
*
* <p>Properties file based <code>UserManager</code> implementation. We use
* <code>user.properties</code> file to store user data.</p>
*
* </p>The file will use the following properties for storing users:</p>
* <table>
* <tr>
* <th>Property</th>
* <th>Documentation</th>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.homedirectory</td>
* <td>Path to the home directory for the user, based on the file system implementation used</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.userpassword</td>
* <td>The password for the user. Can be in clear text, MD5 hash or salted SHA hash based on the
* configuration on the user manager
* </td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.enableflag</td>
* <td>true if the user is enabled, false otherwise</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.writepermission</td>
* <td>true if the user is allowed to upload files and create directories, false otherwise</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.idletime</td>
* <td>The number of seconds the user is allowed to be idle before disconnected.
* 0 disables the idle timeout
* </td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.maxloginnumber</td>
* <td>The maximum number of concurrent logins by the user. 0 disables the check.</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.maxloginperip</td>
* <td>The maximum number of concurrent logins from the same IP address by the user. 0 disables the check.</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.uploadrate</td>
* <td>The maximum number of bytes per second the user is allowed to upload files. 0 disables the check.</td>
* </tr>
* <tr>
* <td>ftpserver.user.{username}.downloadrate</td>
* <td>The maximum number of bytes per second the user is allowed to download files. 0 disables the check.</td>
* </tr>
* </table>
*
* <p>Example:</p>
* <pre>
* ftpserver.user.admin.homedirectory=/ftproot
* ftpserver.user.admin.userpassword=admin
* ftpserver.user.admin.enableflag=true
* ftpserver.user.admin.writepermission=true
* ftpserver.user.admin.idletime=0
* ftpserver.user.admin.maxloginnumber=0
* ftpserver.user.admin.maxloginperip=0
* ftpserver.user.admin.uploadrate=0
* ftpserver.user.admin.downloadrate=0
* </pre>
* @author The Apache MINA Project ([email protected])
* @version $Rev$, $Date$
*/
public class PropertiesUserManager extends AbstractUserManager {
private final Logger LOG = LoggerFactory
.getLogger(PropertiesUserManager.class);
private final static String PREFIX = "ftpserver.user.";
private BaseProperties userDataProp;
private File userDataFile;
private URL userUrl;
/**
* Internal constructor, do not use directly. Use {@link PropertiesUserManagerFactory} instead.
*/
public PropertiesUserManager(PasswordEncryptor passwordEncryptor,
File userDataFile, String adminName) {
super(adminName, passwordEncryptor);
loadFromFile(userDataFile);
}
/**
* Internal constructor, do not use directly. Use {@link PropertiesUserManagerFactory} instead.
*/
public PropertiesUserManager(PasswordEncryptor passwordEncryptor,
URL userDataPath, String adminName) {
super(adminName, passwordEncryptor);
loadFromUrl(userDataPath);
}
private void loadFromFile(File userDataFile) {
try {
userDataProp = new BaseProperties();
if (userDataFile != null) {
LOG.debug("File configured, will try loading");
if (userDataFile.exists()) {
this.userDataFile = userDataFile;
LOG.debug("File found on file system");
FileInputStream fis = null;
try {
fis = new FileInputStream(userDataFile);
userDataProp.load(fis);
} finally {
IoUtils.close(fis);
}
} else {
// try loading it from the classpath
LOG
.debug("File not found on file system, try loading from classpath");
InputStream is = getClass().getClassLoader()
.getResourceAsStream(userDataFile.getPath());
if (is != null) {
try {
userDataProp.load(is);
} finally {
IoUtils.close(is);
}
} else {
throw new FtpServerConfigurationException(
"User data file specified but could not be located, "
+ "neither on the file system or in the classpath: "
+ userDataFile.getPath());
}
}
}
} catch (IOException e) {
throw new FtpServerConfigurationException(
"Error loading user data file : " + userDataFile, e);
}
}
private void loadFromUrl(URL userDataPath) {
try {
userDataProp = new BaseProperties();
if (userDataPath != null) {
LOG.debug("URL configured, will try loading");
userUrl = userDataPath;
InputStream is = null;
is = userDataPath.openStream();
try {
userDataProp.load(is);
} finally {
IoUtils.close(is);
}
}
} catch (IOException e) {
throw new FtpServerConfigurationException(
"Error loading user data resource : " + userDataPath, e);
}
}
/**
* Reloads the contents of the user.properties file. This allows any manual modifications to the file to be recognised by the running server.
*/
public void refresh() {
synchronized (userDataProp) {
if (userDataFile != null) {
LOG.debug("Refreshing user manager using file: "
+ userDataFile.getAbsolutePath());
loadFromFile(userDataFile);
} else {
//file is null, must have been created using URL
LOG.debug("Refreshing user manager using URL: "
+ userUrl.toString());
loadFromUrl(userUrl);
}
}
}
/**
* Retrive the file backing this user manager
* @return The file
*/
public File getFile() {
return userDataFile;
}
/**
* Save user data. Store the properties.
*/
public synchronized void save(User usr) throws FtpException {
// null value check
if (usr.getName() == null) {
throw new NullPointerException("User name is null.");
}
String thisPrefix = PREFIX + usr.getName() + '.';
// set other properties
userDataProp.setProperty(thisPrefix + ATTR_PASSWORD, getPassword(usr));
String home = usr.getHomeDirectory();
if (home == null) {
home = "/";
}
userDataProp.setProperty(thisPrefix + ATTR_HOME, home);
userDataProp.setProperty(thisPrefix + ATTR_ENABLE, usr.getEnabled());
userDataProp.setProperty(thisPrefix + ATTR_WRITE_PERM, usr
.authorize(new WriteRequest()) != null);
userDataProp.setProperty(thisPrefix + ATTR_MAX_IDLE_TIME, usr
.getMaxIdleTime());
TransferRateRequest transferRateRequest = new TransferRateRequest();
transferRateRequest = (TransferRateRequest) usr
.authorize(transferRateRequest);
if (transferRateRequest != null) {
userDataProp.setProperty(thisPrefix + ATTR_MAX_UPLOAD_RATE,
transferRateRequest.getMaxUploadRate());
userDataProp.setProperty(thisPrefix + ATTR_MAX_DOWNLOAD_RATE,
transferRateRequest.getMaxDownloadRate());
} else {
userDataProp.remove(thisPrefix + ATTR_MAX_UPLOAD_RATE);
userDataProp.remove(thisPrefix + ATTR_MAX_DOWNLOAD_RATE);
}
// request that always will succeed
ConcurrentLoginRequest concurrentLoginRequest = new ConcurrentLoginRequest(
0, 0);
concurrentLoginRequest = (ConcurrentLoginRequest) usr
.authorize(concurrentLoginRequest);
if (concurrentLoginRequest != null) {
userDataProp.setProperty(thisPrefix + ATTR_MAX_LOGIN_NUMBER,
concurrentLoginRequest.getMaxConcurrentLogins());
userDataProp.setProperty(thisPrefix + ATTR_MAX_LOGIN_PER_IP,
concurrentLoginRequest.getMaxConcurrentLoginsPerIP());
} else {
userDataProp.remove(thisPrefix + ATTR_MAX_LOGIN_NUMBER);
userDataProp.remove(thisPrefix + ATTR_MAX_LOGIN_PER_IP);
}
saveUserData();
}
/**
* @throws FtpException
*/
private void saveUserData() throws FtpException {
if (userDataFile == null) {
return;
}
File dir = userDataFile.getAbsoluteFile().getParentFile();
if (dir != null && !dir.exists() && !dir.mkdirs()) {
String dirName = dir.getAbsolutePath();
throw new FtpServerConfigurationException(
"Cannot create directory for user data file : " + dirName);
}
// save user data
FileOutputStream fos = null;
try {
fos = new FileOutputStream(userDataFile);
userDataProp.store(fos, "Generated file - don't edit (please)");
} catch (IOException ex) {
LOG.error("Failed saving user data", ex);
throw new FtpException("Failed saving user data", ex);
} finally {
IoUtils.close(fos);
}
}
/**
* Delete an user. Removes all this user entries from the properties. After
* removing the corresponding from the properties, save the data.
*/
public void delete(String usrName) throws FtpException {
// remove entries from properties
String thisPrefix = PREFIX + usrName + '.';
Enumeration<?> propNames = userDataProp.propertyNames();
ArrayList<String> remKeys = new ArrayList<String>();
while (propNames.hasMoreElements()) {
String thisKey = propNames.nextElement().toString();
if (thisKey.startsWith(thisPrefix)) {
remKeys.add(thisKey);
}
}
Iterator<String> remKeysIt = remKeys.iterator();
while (remKeysIt.hasNext()) {
userDataProp.remove(remKeysIt.next());
}
saveUserData();
}
/**
* Get user password. Returns the encrypted value.
*
* <pre>
* If the password value is not null
* password = new password
* else
* if user does exist
* password = old password
* else
* password = ""
* </pre>
*/
private String getPassword(User usr) {
String name = usr.getName();
String password = usr.getPassword();
if (password != null) {
password = getPasswordEncryptor().encrypt(password);
} else {
String blankPassword = getPasswordEncryptor().encrypt("");
if (doesExist(name)) {
String key = PREFIX + name + '.' + ATTR_PASSWORD;
password = userDataProp.getProperty(key, blankPassword);
} else {
password = blankPassword;
}
}
return password;
}
/**
* Get all user names.
*/
public String[] getAllUserNames() {
// get all user names
String suffix = '.' + ATTR_HOME;
ArrayList<String> ulst = new ArrayList<String>();
Enumeration<?> allKeys = userDataProp.propertyNames();
int prefixlen = PREFIX.length();
int suffixlen = suffix.length();
while (allKeys.hasMoreElements()) {
String key = (String) allKeys.nextElement();
if (key.endsWith(suffix)) {
String name = key.substring(prefixlen);
int endIndex = name.length() - suffixlen;
name = name.substring(0, endIndex);
ulst.add(name);
}
}
Collections.sort(ulst);
return ulst.toArray(new String[0]);
}
/**
* Load user data.
*/
public User getUserByName(String userName) {
if (!doesExist(userName)) {
return null;
}
String baseKey = PREFIX + userName + '.';
BaseUser user = new BaseUser();
user.setName(userName);
user.setEnabled(userDataProp.getBoolean(baseKey + ATTR_ENABLE, true));
user.setHomeDirectory(userDataProp
.getProperty(baseKey + ATTR_HOME, "/"));
List<Authority> authorities = new ArrayList<Authority>();
if (userDataProp.getBoolean(baseKey + ATTR_WRITE_PERM, false)) {
authorities.add(new WritePermission());
}
int maxLogin = userDataProp.getInteger(baseKey + ATTR_MAX_LOGIN_NUMBER,
0);
int maxLoginPerIP = userDataProp.getInteger(baseKey
+ ATTR_MAX_LOGIN_PER_IP, 0);
authorities.add(new ConcurrentLoginPermission(maxLogin, maxLoginPerIP));
int uploadRate = userDataProp.getInteger(
baseKey + ATTR_MAX_UPLOAD_RATE, 0);
int downloadRate = userDataProp.getInteger(baseKey
+ ATTR_MAX_DOWNLOAD_RATE, 0);
authorities.add(new TransferRatePermission(downloadRate, uploadRate));
user.setAuthorities(authorities);
user.setMaxIdleTime(userDataProp.getInteger(baseKey
+ ATTR_MAX_IDLE_TIME, 0));
return user;
}
/**
* User existance check
*/
public boolean doesExist(String name) {
String key = PREFIX + name + '.' + ATTR_HOME;
return userDataProp.containsKey(key);
}
/**
* User authenticate method
*/
public User authenticate(Authentication authentication)
throws AuthenticationFailedException {
if (authentication instanceof UsernamePasswordAuthentication) {
UsernamePasswordAuthentication upauth = (UsernamePasswordAuthentication) authentication;
String user = upauth.getUsername();
String password = upauth.getPassword();
if (user == null) {
throw new AuthenticationFailedException("Authentication failed");
}
if (password == null) {
password = "";
}
String storedPassword = userDataProp.getProperty(PREFIX + user
+ '.' + ATTR_PASSWORD);
if (storedPassword == null) {
// user does not exist
throw new AuthenticationFailedException("Authentication failed");
}
if (getPasswordEncryptor().matches(password, storedPassword)) {
return getUserByName(user);
} else {
throw new AuthenticationFailedException("Authentication failed");
}
} else if (authentication instanceof AnonymousAuthentication) {
if (doesExist("anonymous")) {
return getUserByName("anonymous");
} else {
throw new AuthenticationFailedException("Authentication failed");
}
} else {
throw new IllegalArgumentException(
"Authentication not supported by this user manager");
}
}
/**
* Close the user manager - remove existing entries.
*/
public synchronized void dispose() {
if (userDataProp != null) {
userDataProp.clear();
userDataProp = null;
}
}
}
| {'content_hash': 'd82d3716486dd35405990cf6c9bc4382', 'timestamp': '', 'source': 'github', 'line_count': 501, 'max_line_length': 145, 'avg_line_length': 34.5688622754491, 'alnum_prop': 0.5887753334488134, 'repo_name': 'CasparLi/ftpserver', 'id': 'ad9ec752ec45e8afc9703adcd7d28f334f354e0c', 'size': '18125', 'binary': False, 'copies': '1', 'ref': 'refs/heads/1.0.0', 'path': 'core/src/main/java/org/apache/ftpserver/usermanager/impl/PropertiesUserManager.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '8322'}, {'name': 'HTML', 'bytes': '8822'}, {'name': 'Java', 'bytes': '1282143'}, {'name': 'Shell', 'bytes': '3165'}]} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Elasticsearch.Net;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class SpanNearQueryDescriptor<T> : ISpanQuery, IQuery where T : class
{
[JsonProperty(PropertyName = "clauses")]
internal IEnumerable<SpanQueryDescriptor<T>> _SpanQueryDescriptors { get; set; }
[JsonProperty(PropertyName = "slop")]
internal int? _Slop { get; set; }
[JsonProperty(PropertyName = "in_order")]
internal bool? _InOrder { get; set; }
[JsonProperty(PropertyName = "collect_payloads")]
internal bool? _CollectPayloads { get; set; }
bool IQuery.IsConditionless
{
get
{
return !_SpanQueryDescriptors.HasAny() || _SpanQueryDescriptors.Cast<IQuery>().All(q => q.IsConditionless);
}
}
public SpanNearQueryDescriptor<T> Clauses(params Func<SpanQueryDescriptor<T>, SpanQueryDescriptor<T>>[] selectors)
{
selectors.ThrowIfNull("selector");
var descriptors = new List<SpanQueryDescriptor<T>>();
foreach (var selector in selectors)
{
var x = new SpanQueryDescriptor<T>();
var q = selector(x);
if ((q as IQuery).IsConditionless)
continue;
descriptors.Add(q);
}
this._SpanQueryDescriptors = descriptors.HasAny() ? descriptors : null;
return this;
}
public SpanNearQueryDescriptor<T> Slop(int slop)
{
this._Slop = slop;
return this;
}
public SpanNearQueryDescriptor<T> InOrder(bool inOrder)
{
this._InOrder = inOrder;
return this;
}
public SpanNearQueryDescriptor<T> CollectPayloads(bool collectPayloads)
{
this._CollectPayloads = collectPayloads;
return this;
}
}
}
| {'content_hash': '53bfaed8904b1677b7f38e0594cdcb3d', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 116, 'avg_line_length': 26.074626865671643, 'alnum_prop': 0.7115054378935318, 'repo_name': 'alanprot/elasticsearch-net', 'id': '40c9efa1eae631d5feae7004068c3bcc276ea04c', 'size': '1749', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/Nest/DSL/Query/SpanNearQueryDescriptor.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2405'}, {'name': 'C#', 'bytes': '6578169'}, {'name': 'CSS', 'bytes': '17906'}, {'name': 'F#', 'bytes': '8430'}, {'name': 'HTML', 'bytes': '1330539'}, {'name': 'JavaScript', 'bytes': '11844'}, {'name': 'Pascal', 'bytes': '85615'}, {'name': 'PowerShell', 'bytes': '103433'}, {'name': 'Shell', 'bytes': '1730'}, {'name': 'XSLT', 'bytes': '9157'}]} |
using namespace rs2;
inline std::string repr( rs2::device const & self )
{
// same as Python device repr() in pyrs_device.cpp
std::ostringstream ss;
ss << "<device: ";
if( ! self )
ss << "NULL";
else
{
ss << self.get_info( RS2_CAMERA_INFO_NAME );
if( self.supports( RS2_CAMERA_INFO_SERIAL_NUMBER ) )
ss << " (S/N: " << self.get_info( RS2_CAMERA_INFO_SERIAL_NUMBER );
else
ss << " (FW update id: " << self.get_info( RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID );
if( self.supports( RS2_CAMERA_INFO_FIRMWARE_VERSION ) )
ss << " FW: " << self.get_info( RS2_CAMERA_INFO_FIRMWARE_VERSION );
if( self.supports( RS2_CAMERA_INFO_CAMERA_LOCKED )
&& strcmp( "YES", self.get_info( RS2_CAMERA_INFO_CAMERA_LOCKED ) ) )
ss << " UNLOCKED";
if( self.supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ) )
ss << " on USB" << self.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR );
ss << ")";
}
ss << ">";
return ss.str();
}
inline std::string repr( rs2::device_list const & list )
{
std::ostringstream ss;
ss << '[';
for( auto && dev : list )
ss << repr( dev );
ss << ']';
return ss.str();
}
inline rs2::device find_first_device_or_exit()
{
rs2::context ctx;
rs2::device_list devices_list = ctx.query_devices();
if( devices_list.size() == 0 )
{
std::cout << "No device was found" << std::endl;
exit( 1 );
}
rs2::device dev = devices_list[0];
test::log.d( "found", repr(dev) );
return dev;
}
inline rs2::device_list find_devices_by_product_line_or_exit( int product )
{
rs2::context ctx;
rs2::device_list devices_list = ctx.query_devices( product );
if( devices_list.size() == 0 )
{
std::cout << "No device of the " << product << " product line was found"
<< std::endl;
exit( 1 );
}
test::log.d( "found", devices_list.size(), "devices:", repr( devices_list ));
return devices_list;
}
inline void exit_if_fw_version_is_under( rs2::device & dev, librealsense::firmware_version version )
{
std::string fw_version;
REQUIRE_NOTHROW(fw_version = dev.get_info( RS2_CAMERA_INFO_FIRMWARE_VERSION ));
if (librealsense::firmware_version(fw_version) < version)
{
std::cout << "FW version " << fw_version << " is under the minimum requiered FW version "
<< version << std::endl;
exit( 0 );
}
}
// This function returns the first device found that it's name contains the given string,
// if there is no such device it will exit the test.
// Can get as input a full device name or short like "L515/D435..."
inline rs2::device find_first_device_by_name_or_exit( const std::string & dev_name )
{
rs2::context ctx;
std::vector< rs2::device > devices_list = ctx.query_devices();
auto dev_iter
= std::find_if( devices_list.begin(), devices_list.end(), [dev_name]( rs2::device dev ) {
return dev.supports( RS2_CAMERA_INFO_NAME )
&& std::string( dev.get_info( RS2_CAMERA_INFO_NAME ) ).find( dev_name )
!= std::string::npos;
} );
if( dev_iter != devices_list.end() )
{
test::log.d( "found", repr( *dev_iter ) );
return *dev_iter;
}
std::cout << "No " << dev_name << " device was found" << std::endl;
exit( 1 );
}
// Return the first device that supports the input option or exits.
// Can get as input a full device name or short like "L515/D435..."
rs2::depth_sensor find_first_supported_depth_sensor_or_exit(const std::string & dev_name,
rs2_option opt)
{
auto dev = find_first_device_by_name_or_exit(dev_name);
auto ds = dev.first< rs2::depth_sensor >();
if (!ds.supports(opt))
{
std::cout << "Device: " << dev_name << " does not support option: " << rs2_option_to_string(opt) << std::endl;
exit(0);
}
return ds;
}
// Remove the frame's stream (or streams if a frameset) from the list of streams we expect to arrive
// If any stream is unexpected, it is ignored
inline void remove_all_streams_arrived( rs2::frame f,
std::vector< rs2::stream_profile > & expected_streams )
{
auto remove_stream = [&]() {
auto it = std::remove_if( expected_streams.begin(),
expected_streams.end(),
[&]( rs2::stream_profile s ) {
return s.stream_type() == f.get_profile().stream_type();
} );
if( it != expected_streams.end() )
expected_streams.erase( it );
};
if( f.is< rs2::frameset >() )
{
auto set = f.as< rs2::frameset >();
set.foreach_rs( [&]( rs2::frame fr ) { remove_stream(); } );
}
else
{
remove_stream();
}
}
inline stream_profile find_default_depth_profile(rs2::depth_sensor depth_sens)
{
std::vector< stream_profile > stream_profiles;
REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
auto depth_profile
= std::find_if(stream_profiles.begin(), stream_profiles.end(), [](stream_profile sp) {
return sp.is_default() && sp.stream_type() == RS2_STREAM_DEPTH;
});
REQUIRE(depth_profile != stream_profiles.end());
return *depth_profile;
}
inline stream_profile find_default_ir_profile(rs2::depth_sensor depth_sens)
{
std::vector< stream_profile > stream_profiles;
REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
auto ir_profile
= std::find_if(stream_profiles.begin(), stream_profiles.end(), [](stream_profile sp) {
return sp.is_default() && sp.stream_type() == RS2_STREAM_INFRARED;
});
REQUIRE(ir_profile != stream_profiles.end());
return *ir_profile;
}
inline stream_profile find_confidence_corresponding_to_depth(rs2::depth_sensor depth_sens,
stream_profile depth_profile)
{
std::vector< stream_profile > stream_profiles;
REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
auto confidence_profile
= std::find_if(stream_profiles.begin(), stream_profiles.end(), [&](stream_profile sp) {
return sp.stream_type() == RS2_STREAM_CONFIDENCE
&& sp.as< rs2::video_stream_profile >().width()
== depth_profile.as< rs2::video_stream_profile >().width()
&& sp.as< rs2::video_stream_profile >().height()
== depth_profile.as< rs2::video_stream_profile >().height();
});
REQUIRE(confidence_profile != stream_profiles.end());
return *confidence_profile;
}
template < class T >
inline void start_default_l500_depth_profiles( rs2::depth_sensor depth_sens, T callback, bool with_confidence = false )
{
auto depth = find_default_depth_profile( depth_sens );
auto ir = find_default_ir_profile( depth_sens );
if (with_confidence)
{
auto confidence = find_confidence_corresponding_to_depth( depth_sens, depth );
REQUIRE_NOTHROW( depth_sens.open( { depth, ir, confidence } ) );
}
else
{
REQUIRE_NOTHROW( depth_sens.open( { depth, ir } ) );
}
REQUIRE_NOTHROW( depth_sens.start( callback ) );
}
inline stream_profile
find_profile( rs2::depth_sensor depth_sens, rs2_stream stream, rs2_sensor_mode mode )
{
std::vector< stream_profile > stream_profiles;
REQUIRE_NOTHROW( stream_profiles = depth_sens.get_stream_profiles() );
std::map< rs2_sensor_mode, std::pair< uint32_t, uint32_t > > sensor_mode_to_resolution
= { { { RS2_SENSOR_MODE_VGA }, { 640, 480 } },
{ { RS2_SENSOR_MODE_XGA }, { 1024, 768 } },
{ { RS2_SENSOR_MODE_QVGA }, { 320, 240 } } };
auto profile
= std::find_if( stream_profiles.begin(), stream_profiles.end(), [&]( stream_profile sp ) {
auto vp = sp.as< video_stream_profile >();
if( vp )
{
return sp.stream_type() == stream
&& vp.width() == sensor_mode_to_resolution[mode].first
&& vp.height() == sensor_mode_to_resolution[mode].second;
}
return false;
} );
REQUIRE( profile != stream_profiles.end() );
return *profile;
}
inline void do_while_streaming( rs2::sensor depth_sens,
std::vector< stream_profile > profiles,
std::function< void() > action )
{
REQUIRE_NOTHROW( depth_sens.open( profiles ) );
REQUIRE_NOTHROW( depth_sens.start( [&]( rs2::frame f ) {} ) );
action();
depth_sens.stop();
depth_sens.close();
}
rs2::stream_profile get_profile_by_stream_parameters( rs2::sensor s,
rs2_stream stream = RS2_STREAM_ANY,
rs2_format format = RS2_FORMAT_ANY,
int width = -1,
int height = -1,
int fps = -1,
int stream_index = -1 )
{
auto profiles = s.get_stream_profiles();
auto found_profile
= std::find_if( profiles.begin(), profiles.end(), [=]( rs2::stream_profile sp ) {
auto vp = sp.as< rs2::video_stream_profile >();
return ( ( RS2_STREAM_ANY == stream || sp.stream_type() == stream )
&& ( RS2_FORMAT_ANY == format || sp.format() == format )
&& ( ( -1 == width ) || ( vp.width() == width ) )
&& ( ( -1 == height ) || ( vp.height() == height ) )
&& ( ( -1 == fps ) || ( vp.fps() == fps )
&& ( ( -1 == stream_index ) || vp.stream_index() == stream_index ) ) );
} );
if( found_profile != profiles.end() )
return *found_profile;
else
return rs2::stream_profile();
}
| {'content_hash': '16ce657cacfd4223a5468261f8d8c29a', 'timestamp': '', 'source': 'github', 'line_count': 286, 'max_line_length': 119, 'avg_line_length': 35.40909090909091, 'alnum_prop': 0.5498173200355485, 'repo_name': 'IntelRealSense/librealsense', 'id': 'e83912af31c2097d384fc23c0bcf0855869ca367', 'size': '10369', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'unit-tests/live/live-common.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '736'}, {'name': 'C', 'bytes': '6226973'}, {'name': 'C#', 'bytes': '541746'}, {'name': 'C++', 'bytes': '9343375'}, {'name': 'CMake', 'bytes': '181677'}, {'name': 'CSS', 'bytes': '9575'}, {'name': 'Cuda', 'bytes': '38173'}, {'name': 'Dockerfile', 'bytes': '2393'}, {'name': 'HTML', 'bytes': '3550'}, {'name': 'Java', 'bytes': '309233'}, {'name': 'JavaScript', 'bytes': '480021'}, {'name': 'MATLAB', 'bytes': '106616'}, {'name': 'PowerShell', 'bytes': '7989'}, {'name': 'Python', 'bytes': '485240'}, {'name': 'ShaderLab', 'bytes': '15538'}, {'name': 'Shell', 'bytes': '108709'}]} |
'use strict';
var express = require('express'),
router = express.Router();
module.exports = function (app) {
app.use(router)
};
router.get('/', function (req, res) {
res.sendFile(__dirname + '/index.html');
});
| {'content_hash': '26e9f141f62168355dc857e0af390310', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 42, 'avg_line_length': 20.09090909090909, 'alnum_prop': 0.6244343891402715, 'repo_name': 'taverasmisael/tut-socketio-chat', 'id': '88c6407063bb6c9afd80369c1082788837977852', 'size': '221', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'routes.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '46'}, {'name': 'HTML', 'bytes': '1164'}, {'name': 'JavaScript', 'bytes': '1574'}]} |
using Entitas;
using UnityEngine;
public class DefaultCameraSystem : IExecuteSystem, ISetPool {
Group _group;
public void SetPool(Pool pool) {
_group = pool.GetGroup(Matcher.DefaultCamera);
}
public void Execute() {
foreach (Entity e in _group.GetEntities()) {
updateCamera(e);
}
}
void updateCamera(Entity e) {
DefaultCameraComponent regularCamera = e.defaultCamera;
CameraComponent camera = e.camera;
FollowTargetComponent target = e.followTarget;
Vector2 targetPosition = target.target.position.pos;
camera.camera.transform.position = new Vector3(targetPosition.x + regularCamera.offset.x, targetPosition.y + regularCamera.offset.y, regularCamera.offset.z);
}
} | {'content_hash': 'c16fec7fce407c9118e83aaa10dfb1a7', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 159, 'avg_line_length': 27.88, 'alnum_prop': 0.7560975609756098, 'repo_name': 'kicholen/SpaceShooter', 'id': '093dd35ba6234dd53fb1d1aa4875d21048232c11', 'size': '697', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Assets/Source/Src/System/Camera/default/DefaultCameraSystem.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '938340'}, {'name': 'GLSL', 'bytes': '1712'}, {'name': 'Smalltalk', 'bytes': '1900'}]} |
/*
* @file GRRLIB_settings.h
* Inline functions for configuring the GRRLIB settings.
*/
#ifndef GX_BM_SUBTRACT
/**
* Blending type.
* libogc revision 4170 fixed a typographical error. GX_BM_SUBSTRACT was renamed GX_BM_SUBTRACT.
* But for previous versions this define is needed.
*/
#define GX_BM_SUBTRACT GX_BM_SUBSTRACT
#endif
extern GRRLIB_drawSettings GRRLIB_Settings;
/**
* Set a blending mode.
* @param blendmode The blending mode to use (Default: GRRLIB_BLEND_ALPHA).
*/
INLINE
void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode) {
GRRLIB_Settings.blend = blendmode;
switch (GRRLIB_Settings.blend) {
case GRRLIB_BLEND_ALPHA:
GX_SetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR);
break;
case GRRLIB_BLEND_ADD:
GX_SetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_DSTALPHA, GX_LO_CLEAR);
break;
case GRRLIB_BLEND_SCREEN:
GX_SetBlendMode(GX_BM_BLEND, GX_BL_SRCCLR, GX_BL_DSTALPHA, GX_LO_CLEAR);
break;
case GRRLIB_BLEND_MULTI:
GX_SetBlendMode(GX_BM_SUBTRACT, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR);
break;
case GRRLIB_BLEND_INV:
GX_SetBlendMode(GX_BM_BLEND, GX_BL_INVSRCCLR, GX_BL_INVSRCCLR, GX_LO_CLEAR);
break;
}
}
/**
* Get the current blending mode.
* @return The current blending mode.
*/
INLINE
GRRLIB_blendMode GRRLIB_GetBlend (void) {
return GRRLIB_Settings.blend;
}
/**
* Turn anti-aliasing on/off.
* @param aa Set to true to enable anti-aliasing (Default: Enabled).
*/
INLINE
void GRRLIB_SetAntiAliasing (const bool aa) {
GRRLIB_Settings.antialias = aa;
}
/**
* Get current anti-aliasing setting.
* @return True if anti-aliasing is enabled.
*/
INLINE
bool GRRLIB_GetAntiAliasing (void) {
return GRRLIB_Settings.antialias;
}
| {'content_hash': '5317d07b7e9f46d5d041d87956302c78', 'timestamp': '', 'source': 'github', 'line_count': 71, 'max_line_length': 100, 'avg_line_length': 27.028169014084508, 'alnum_prop': 0.6550286607608129, 'repo_name': 'mirror/grrlib', 'id': '2c60e5e94763fcc1cd561029c19d51e59329be23', 'size': '3139', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '16737111'}, {'name': 'C++', 'bytes': '99371'}, {'name': 'Objective-C', 'bytes': '48742'}]} |
<h1 class="libTop">upax_py</h1>
This is a Python 3 implementation of the
[Upax](https://jddixon.github.io/xlattice/upax.html)
distributed file system.
## Major System Components
A Upax implementation consists of at least
* a [fault-tolerant log](https://jddixon.github.io/xlattice/ftLog.html)
* a [Upax server](https://jddixon.github.io/xlattice/upaxServer.html)
* a [Upax client](https://jddixon.github.io/xlattice/upaxClient.html) and optionally
* a [Upax mirror](https://jddixon.github.io/xlattice/upaxMirror.html)
Servers involved use a
[consensus algorithm](https://en.wikipedia.org/wiki/Consensus_%28computer_science%29)
to ensure that their pictures of the state of the distributed file system
are consistent.
## Utilities
These include
* importUDir
* upaxBulkPoster
* upaxUpdateNodeID
### importUDir
This utility imports all of the files in a content-keyed U directory into
the Upax distribued file system.
usage: importUDir [-h] [-1] [-d DESTDIR] [-j] [-s SRCDIR] [-t] [-T] [-V] [-v]
optional arguments:
-h, --help show this help message and exit
-1, --usingSHA1 use SHA1, and so 160-bit keys
-d DESTDIR, --destDir DESTDIR
base name of destination U/ directory
-j, --justShow show args and exit
-s SRCDIR, --srcDir SRCDIR
base name of source U/ directory
-t, --showTimestamp show run timestamp
-T, --testing test run - write to ./testU
-V, --showVersion show version number and date
-v, --verbose talk a lot
### upaxBulkPoster
Given a flat directory, imports any constituent files into the Upax
distributd file system.
usage: post new files in a directory into Upax [-h] [-1] [-e] [-i INDIR] [-H]
[-j] [-N] [-t] [-u UDIR] [-T]
[-V] [-v] [-z]
optional arguments:
-h, --help show this help message and exit
-1, --usingSHA1 use SHA1, and so 160-bit keys
-e, --ec2Host set if machine is in EC2
-i INDIR, --inDir INDIR
path to input directory (forced to ./ testIn if
testing)
-H, --hostmaster set if machine runs bindMgr
-j, --justShow show args and exit
-N, --nameserver set if machine is a name server and so runs
bindLocalMgr
-t, --showTimestamp show run timestamp
-u UDIR, --uDir UDIR base name of U/ directory, default to Upax
-T, --testing test run - write to ./testU
-V, --showVersion show version number and date
-v, --verbose talk a lot
-z, --noChanges don't actually write anything to disk
### upaxUpdateNodeID
The content-keyed store on a Upax system needs a unique ID, its **nodeID**.
This utility writes a randomly chosen 20- or 32-byte value into a file
called *nodeID** at the top level of uDir, so at `uDir/nodeID`. This is
written as a 40- or 64-character hexadecimal value.
usage: post new files in a directory into Upax [-h] [-1] [-e] [-i INDIR] [-H]
[-j] [-N] [-t] [-u UDIR] [-T]
[-V] [-v] [-z]
optional arguments:
-h, --help show this help message and exit
-1, --usingSHA1 use SHA1, and so 160-bit keys
-e, --ec2Host set if machine is in EC2
-i INDIR, --inDir INDIR
path to .ssh/ (forced to ./ testIn if testing)
-H, --hostmaster set if machine runs bindMgr
-j, --justShow show args and exit
-N, --nameserver set if machine is a name server and so runs
bindLocalMgr
-t, --showTimestamp show run timestamp
-u UDIR, --uDir UDIR base name of U/ directory, default to Upax
-T, --testing test run - write to ./testU
-V, --showVersion show version number and date
-v, --verbose talk a lot
-z, --noChanges don't actually write anything to disk
## Dependencies
* **xlattice_py**, the collection of Python3 XLattice supporrt classes
## Project Status
Incompletely specified, partially implemented.
| {'content_hash': 'f3a5a01327f8006c628c5338a67309a6', 'timestamp': '', 'source': 'github', 'line_count': 112, 'max_line_length': 85, 'avg_line_length': 38.973214285714285, 'alnum_prop': 0.5860252004581902, 'repo_name': 'jddixon/upax_py', 'id': '93b73eb196f39c00005d69932516c84ae3050ec8', 'size': '4365', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ghpDoc/index.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6648'}, {'name': 'Python', 'bytes': '107590'}, {'name': 'Shell', 'bytes': '1841'}]} |
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using FashionStones.Controllers;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin.Security;
using FashionStones.Models;
using FashionStones.Utils;
namespace FashionStones.Areas.Default.Controllers
{
[Authorize]
public class AccountController : BaseController
{
private string GetRegisterMessge(string link,string code)
{
// var settings = new FashionStones.Utils.EmailSettings();
var tb = new TagBuilder("a");
tb.MergeAttribute("href", link);
tb.SetInnerText(link);
tb.ToString(TagRenderMode.SelfClosing);
var callBack = new TagBuilder("a");
callBack.MergeAttribute("href", code);
callBack.SetInnerText("ссылке");
callBack.ToString(TagRenderMode.SelfClosing);
return string.Format("Регистрация на сайте {0}" + "{2}" +
"Здравствуйте! {2}" +
"Поздравляем, Вы зарегистрировались на сайте {0} {2}" +
"Для завершения регистрации, перейдите, пожалуйста, по этой {1}.{2}" +
"С уважением, команда {3}", link, callBack, "<br/>", tb);
}
#region ctor
private ApplicationSignInManager _signInManager;
private ApplicationUserManager _userManager;
public AccountController(DataManager dataManager) :base (dataManager)
{
}
public ApplicationSignInManager SignInManager
{
get
{
return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
}
private set
{
_signInManager = value;
}
}
public ApplicationUserManager UserManager
{
get { return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); }
private set
{
_userManager = value;
}
}
#endregion
//
// GET: /Account/Login
[AllowAnonymous]
public ActionResult Index()
{
return View();
}
#region Login
[AllowAnonymous]
public ActionResult Login(string returnUrl)
{
ViewBag.ReturnUrl = returnUrl;
return View();
}
//
// POST: /Account/Login
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await UserManager.FindByEmailOrPhoneAsync(model.Email, model.Password);
if (user == null)
{
ModelState.AddModelError("", "Неверное имя пользователя или пароль");
return (View(model));
}
if (user.LockoutEnabled)
{
ModelState.AddModelError("", "Ваш аккаунт заблокирован");
return View(model);
}
if (user.EmailConfirmed == false)
{
ModelState.AddModelError("", "Пожалуйста, подтвердите Ваш E-mail");
return View(model);
}
var result =
await
SignInManager.PasswordSignInAsync(user.UserName, model.Password, model.RememberMe,
shouldLockout: true);
switch (result)
{
case SignInStatus.Success:
return RedirectToLocal(returnUrl);
case SignInStatus.LockedOut:
return View("Lockout");
default:
ModelState.AddModelError("", "Invalid login attempt.");
return View(model);
}
}
#endregion
[ChildActionOnly]
public ActionResult UserProfile()
{
var id = CurrentUserId;
var user = UserManager.FindById(id);
return View(user);
}
//
// GET: /Account/Register
[AllowAnonymous]
public ActionResult Register()
{
ViewBag.CountryId = new SelectList(DataManager.Coutries.GetAll().ToList(), "Id", "Name");
return View();
}
//
// POST: /Account/Register
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
if (UserManager.Users.Any(t => t.Email == model.Email))
{
ModelState.AddModelError("", "Пользователь с таким email уже зарегистрирован");
ViewBag.CountryId = new SelectList(DataManager.Coutries.GetAll().ToList(), "Id", "Name", model.CountryId);
return View(model);
}
if (UserManager.Users.Any(t => t.PhoneNumber == model.Phone))
{
ModelState.AddModelError("", "Пользователь с таким телефоном уже зарегистрирован");
ViewBag.CountryId = new SelectList(DataManager.Coutries.GetAll().ToList(), "Id", "Name", model.CountryId);
return View(model);
}
var user = new ApplicationUser
{
UserName = model.Email,
Email = model.Email,
FirstName = model.FirstName,
LastName = model.LastName,
MiddleName = model.MiddleName,
City = model.City,
CountryId = model.CountryId,
PhoneNumber = model.Phone
};
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
EmailSettings settings = new EmailSettings();
// await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
await UserManager.SendEmailAsync(user.Id, "Регистрация " + settings.Link, GetRegisterMessge(settings.Link, callbackUrl));
return View("MustConfirmEmail", model);
}
AddErrors(result);
}
ViewBag.CountryId = new SelectList(DataManager.Coutries.GetAll().ToList(), "Id", "Name",model.CountryId);
return View(model);
}
//
// GET: /Account/ConfirmEmail
[AllowAnonymous]
public async Task<ActionResult> ConfirmEmail(string userId, string code)
{
if (userId == null || code == null)
{
return View("Error");
}
var result = await UserManager.ConfirmEmailAsync(userId, code);
return View(result.Succeeded ? "ConfirmEmail" : "Error");
}
//
// GET: /Account/ForgotPassword
[AllowAnonymous]
public ActionResult ForgotPassword()
{
return View();
}
//
// POST: /Account/ForgotPassword
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
{
if (ModelState.IsValid)
{
var user = await UserManager.FindByEmailOrPhoneAsync(model.Email);
if (user == null)
{
ModelState.AddModelError("", "Пользователь с таким e-mail не зарегистрирован.");
return View(model);
}
EmailSettings settings= new EmailSettings();
string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
await UserManager.SendEmailAsync(user.Id, "Восстановление пароля",
"Здравствуйте! <br/>Вы отправили запрос на восстановление пароля от аккаунта " + user.Email +
" .<br/>" +
"Для того чтобы задать новый пароль, перейдите по <a href=\"" + callbackUrl + "\">ссылке</a>" +
"С уважением, команда <a href=\"" + settings.Link + "\">"+settings.Link+"</a>");
return RedirectToAction("ForgotPasswordConfirmation", "Account");
}
// If we got this far, something failed, redisplay form
return View(model);
}
//
// GET: /Account/ForgotPasswordConfirmation
[AllowAnonymous]
public ActionResult ForgotPasswordConfirmation()
{
return View();
}
//
// GET: /Account/ResetPassword
[AllowAnonymous]
public ActionResult ResetPassword(string code)
{
return code == null ? View("Error") : View();
}
//
// POST: /Account/ResetPassword
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await UserManager.FindByNameAsync(model.Email);
if (user == null)
{
// Don't reveal that the user does not exist
return RedirectToAction("ResetPasswordConfirmation", "Account");
}
var result = await UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password);
if (result.Succeeded)
{
return RedirectToAction("ResetPasswordConfirmation", "Account");
}
AddErrors(result);
return View();
}
//
// GET: /Account/ResetPasswordConfirmation
[AllowAnonymous]
public ActionResult ResetPasswordConfirmation()
{
return View();
}
//
// POST: /Account/LogOff
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
AuthenticationManager.SignOut();
return RedirectToAction("Index", "About");
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (_userManager != null)
{
_userManager.Dispose();
_userManager = null;
}
if (_signInManager != null)
{
_signInManager.Dispose();
_signInManager = null;
}
}
base.Dispose(disposing);
}
#region Helpers
// Used for XSRF protection when adding external logins
private const string XsrfKey = "XsrfId";
private IAuthenticationManager AuthenticationManager
{
get
{
return HttpContext.GetOwinContext().Authentication;
}
}
private void AddErrors(IdentityResult result)
{
foreach (var error in result.Errors)
{
ModelState.AddModelError("", error);
}
}
private ActionResult RedirectToLocal(string returnUrl)
{
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
return RedirectToAction("Index", "About");
}
internal class ChallengeResult : HttpUnauthorizedResult
{
public ChallengeResult(string provider, string redirectUri)
: this(provider, redirectUri, null)
{
}
public ChallengeResult(string provider, string redirectUri, string userId)
{
LoginProvider = provider;
RedirectUri = redirectUri;
UserId = userId;
}
public string LoginProvider { get; set; }
public string RedirectUri { get; set; }
public string UserId { get; set; }
public override void ExecuteResult(ControllerContext context)
{
var properties = new AuthenticationProperties { RedirectUri = RedirectUri };
if (UserId != null)
{
properties.Dictionary[XsrfKey] = UserId;
}
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
}
}
#endregion
}
} | {'content_hash': '1a523e5965f18f8911346cef3c978c31', 'timestamp': '', 'source': 'github', 'line_count': 401, 'max_line_length': 146, 'avg_line_length': 33.31920199501247, 'alnum_prop': 0.5227902103135993, 'repo_name': 'dimakaminskiy/FashionStones', 'id': 'fc07d17ec8aadc78408508f2dd7cbead2de991b8', 'size': '13852', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'FashionStones/Areas/Default/Controllers/AccountController.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '104'}, {'name': 'C#', 'bytes': '432884'}, {'name': 'CSS', 'bytes': '75525'}, {'name': 'HTML', 'bytes': '18355'}, {'name': 'JavaScript', 'bytes': '283056'}]} |
package org.apache.jackrabbit.oak.security.authorization.permission;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
import javax.jcr.AccessDeniedException;
import javax.jcr.NamespaceRegistry;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.security.AccessControlManager;
import javax.jcr.security.AccessControlPolicy;
import javax.jcr.security.Privilege;
import javax.jcr.version.Version;
import javax.jcr.version.VersionHistory;
import javax.jcr.version.VersionManager;
import org.apache.jackrabbit.JcrConstants;
import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.Group;
import org.apache.jackrabbit.api.security.user.User;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.apache.jackrabbit.oak.security.ExerciseUtility;
import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
import org.apache.jackrabbit.test.AbstractJCRTest;
import org.junit.Test;
/**
* <pre>
* Module: Authorization (Permission Evaluation)
* =============================================================================
*
* Title: Special Permissions
* -----------------------------------------------------------------------------
*
* Goal:
* So far exercises mostly dealt with regalar read/write privileges. After having
* completed this exercise you should a better understanding on permission
* evaluation for non-regular write operations.
*
* Exercises:
*
* - {@link #testVersioning()}
* Performing version operations requires {@link Privilege#JCR_VERSION_MANAGEMENT}
* to be granted at the target node. Use this test to verify this.
*
* - {@link #testReadVersionInformation()}
* Testing read access to version storage at /jcr:system/jcr:versionStore
* Use {@link #testVersioning()} again to take a closer look on how versions
* and version-histories are being retrieved from the version store and how
* the corresponding read-access is being evaluated.
*
* Question: Can you explain what the difference is compared to Jackrabbit 2.x? (hint: oak-doc and jira)
* Question: Can you identify cases where access to /jcr:system/jcr:versionstore explicitly needed to be granted?
* If yes: explain why and the impact it may have from a security point of view.
*
* - {@link #testUserManagement()}
* Fix the test case such that there is no privilege escalation from testUser
* to the admin user :-)
*
* - {@link #testRepositoryLevelPrivileges()}
* The following privileges need to be granted globally for the whole repository
* as the associated operations also take effect on the whole repository.
* In order to do so, you need to use the 'null' paths... verify in this test
* that granting those privileges at 'childPath' does not have the desired effect.
*
*
* Additional Exercises:
* -----------------------------------------------------------------------------
*
* - Write additional test cases for the following privileges:
* - {@link Privilege#JCR_READ_ACCESS_CONTROL}
* - {@link Privilege#JCR_MODIFY_ACCESS_CONTROL}
* - {@link Privilege#JCR_LOCK_MANAGEMENT}
* - {@link org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants#REP_INDEX_DEFINITION_MANAGEMENT}
*
* Related Exercises:
* -----------------------------------------------------------------------------
*
* - {@link org.apache.jackrabbit.oak.security.privilege.L3_BuiltInPrivilegesTest#testMapItems()}
*
* </pre>
*
*
* @see org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants
* @see org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions
*/
public class L5_SpecialPermissionsTest extends AbstractJCRTest {
private User testUser;
private User testUser2;
private Principal testPrincipal;
private Principal testGroupPrincipal;
private Session testSession;
private String childPath;
private String grandChildPath;
private String propertyPath;
private String childPropertyPath;
private List<String> paths = new ArrayList();
@Override
protected void setUp() throws Exception {
super.setUp();
Property p = testRootNode.setProperty(propertyName1, "val");
propertyPath = p.getPath();
Node child = testRootNode.addNode(nodeName1);
childPath = child.getPath();
p = child.setProperty(propertyName2, "val");
childPropertyPath = p.getPath();
Node grandChild = child.addNode(nodeName2);
grandChildPath = grandChild.getPath();
testUser = ExerciseUtility.createTestUser(((JackrabbitSession) superuser).getUserManager());
testUser2 = ExerciseUtility.createTestUser(((JackrabbitSession) superuser).getUserManager());
Group testGroup = ExerciseUtility.createTestGroup(((JackrabbitSession) superuser).getUserManager());
testGroup.addMember(testUser);
superuser.save();
testPrincipal = testUser.getPrincipal();
testGroupPrincipal = testGroup.getPrincipal();
}
@Override
protected void tearDown() throws Exception {
try {
if (testSession != null && testSession.isLive()) {
testSession.logout();
}
UserManager uMgr = ((JackrabbitSession) superuser).getUserManager();
if (testUser != null) {
testUser.remove();
}
if (testUser2 != null) {
testUser2.remove();
}
Authorizable testGroup = uMgr.getAuthorizable(testGroupPrincipal);
if (testGroup != null) {
testGroup.remove();
}
removePolicies(paths);
superuser.save();
} finally {
super.tearDown();
}
}
private void removePolicies(List<String> paths) throws RepositoryException {
AccessControlManager acMgr = superuser.getAccessControlManager();
for (String path : paths) {
AccessControlPolicy[] policies = acMgr.getPolicies(path);
for (AccessControlPolicy plc : policies) {
if (plc instanceof JackrabbitAccessControlList) {
acMgr.removePolicy(path, plc);
}
}
}
}
private Session createTestSession() throws RepositoryException {
if (testSession == null) {
testSession = superuser.getRepository().login(ExerciseUtility.getTestCredentials(testUser.getID()));
}
return testSession;
}
public void testVersioning() throws Exception {
// EXERCISE: fix the test case
superuser.getNode(childPath).addMixin(JcrConstants.MIX_VERSIONABLE);
superuser.getNode(grandChildPath).addMixin(JcrConstants.MIX_VERSIONABLE);
String privName = Privilege.JCR_VERSION_MANAGEMENT;
AccessControlUtils.addAccessControlEntry(superuser, grandChildPath, testGroupPrincipal, new String[]{privName}, true);
superuser.save();
Session s = createTestSession();
Node n = s.getNode(childPath);
Version v = n.checkin();
n.checkout();
n = s.getNode(grandChildPath);
v = n.checkin();
n.checkout();
}
@Test
public void testReadVersionInformation() throws RepositoryException {
Node childNode = superuser.getNode(childPath);
childNode.addMixin(JcrConstants.MIX_VERSIONABLE);
superuser.save();
childNode.checkin();
childNode.checkout();
// EXERCISE: uncomment the following permission setup and test the impact it has!
// EXERCISE: discuss and explain your findings
// AccessControlUtils.addAccessControlEntry(superuser, "/jcr:system", testGroupPrincipal, new String[] {Privilege.JCR_READ}, false);
// paths.add("/jcr:system");
// superuser.save();
//
Session s = createTestSession();
// EXERCISE: uncomment to verify the permission setup is as expected
//assertFalse(s.nodeExists(VersionConstants.VERSION_STORE_PATH));
VersionManager versionManager = s.getWorkspace().getVersionManager();
VersionHistory vh = versionManager.getVersionHistory(childPath);
Version rootVersion = vh.getRootVersion();
Version baseVersion = versionManager.getBaseVersion(childPath);
}
@Test
public void testUserManagement() throws RepositoryException {
// EXERCISE: fix the permission setup and explain why!
// grant full access to all users for 'testGroup'...
paths.add(UserConstants.DEFAULT_USER_PATH);
AccessControlUtils.addAccessControlEntry(superuser,
UserConstants.DEFAULT_USER_PATH, testGroupPrincipal,
new String[]{Privilege.JCR_ALL}, true);
// ... but prevent the test user to write the admin user
String adminPath = ((JackrabbitSession) superuser).getUserManager().getAuthorizable(superuser.getUserID()).getPath();
paths.add(adminPath);
AccessControlUtils.addAccessControlEntry(superuser,
adminPath, EveryonePrincipal.getInstance(),
new String[]{PrivilegeConstants.REP_WRITE}, false);
// execute the test verifying that pw of 'testUser2' can be change
// but not the pw of the admin user
JackrabbitSession s = (JackrabbitSession) createTestSession();
User u2 = s.getUserManager().getAuthorizable(testUser2.getID(), User.class);
u2.changePassword("gugus");
s.save();
try {
User admin = s.getUserManager().getAuthorizable(superuser.getUserID(), User.class);
admin.changePassword("gugus");
s.save();
fail("privilege escalation!");
} catch (AccessDeniedException e) {
// success
} finally {
s.refresh(false);
}
}
public void testRepositoryLevelPrivileges() throws RepositoryException {
// EXERCISE : setup the permissions such that test-session can register a
// - new namespace|node type|privilege (note: workspace management not yet supported)
// EXERCISE: refactory the test to verify that granting these privs at 'childPath' doesn;t have the desired effect.
JackrabbitSession s = (JackrabbitSession) createTestSession();
NamespaceRegistry nsRegistry = s.getWorkspace().getNamespaceRegistry();
nsRegistry.registerNamespace("jr", "http://jackrabbit.apache.org");
}
} | {'content_hash': '156d1029527973bd9af0371d32b5e746', 'timestamp': '', 'source': 'github', 'line_count': 274, 'max_line_length': 139, 'avg_line_length': 39.87591240875913, 'alnum_prop': 0.6714259564341937, 'repo_name': 'afilimonov/jackrabbit-oak', 'id': '4b85d576d5aaceec737a1704ad3ba7d96b35f2ae', 'size': '11728', 'binary': False, 'copies': '11', 'ref': 'refs/heads/trunk', 'path': 'oak-exercise/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/L5_SpecialPermissionsTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '3451'}, {'name': 'Groovy', 'bytes': '103231'}, {'name': 'Java', 'bytes': '16508233'}, {'name': 'JavaScript', 'bytes': '42583'}, {'name': 'Perl', 'bytes': '7585'}, {'name': 'Shell', 'bytes': '17322'}]} |
package com.lzy.demo.okgo;
import android.os.Bundle;
import android.view.View;
import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.StringDialogCallback;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.Call;
import okhttp3.Response;
public class RedirectActivity extends BaseDetailActivity {
@Override
protected void onActivityCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_redirect);
ButterKnife.bind(this);
setTitle("301重定向");
}
@Override
protected void onDestroy() {
super.onDestroy();
//Activity销毁时,取消网络请求
OkGo.getInstance().cancelTag(this);
}
@OnClick(R.id.redirect)
public void redirect(View view) {
OkGo.get(Urls.URL_REDIRECT)//
.tag(this)//
.headers("header1", "headerValue1")//
.params("param1", "paramValue1")//
.execute(new StringDialogCallback(this) {
@Override
public void onSuccess(String s, Call call, Response response) {
handleResponse(s, call, response);
responseData.setText("注意看请求头的url和响应头的url是不一样的!\n这代表了在请求过程中发生了重定向," +
"okhttp默认将重定向封装在了请求内部,只有最后一次请求的数据会被真正的请求下来触发回调,中间过程" +
"是默认实现的,不会触发回调!");
}
@Override
public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e);
handleError(call, response);
}
});
}
} | {'content_hash': 'e3ef98a1eeaaf7616674cf08e4083527', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 107, 'avg_line_length': 32.482142857142854, 'alnum_prop': 0.5695437053326003, 'repo_name': 'jessezwd/News', 'id': '311eb3bd2364ecf186bd6ecd9209196d92ff8a27', 'size': '2031', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'okhttp-okgo/src/main/java/com/lzy/demo/okgo/RedirectActivity.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '2038707'}, {'name': 'Makefile', 'bytes': '1048'}]} |
package org.opencv.android;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.*;
import android.hardware.camera2.params.StreamConfigurationMap;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import android.util.Size;
import android.view.Surface;
import java.util.Arrays;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
@TargetApi(21)
public class Camera2Renderer extends CameraGLRendererBase {
protected final String LOGTAG = "Camera2Renderer";
private CameraDevice mCameraDevice;
private CameraCaptureSession mCaptureSession;
private CaptureRequest.Builder mPreviewRequestBuilder;
private String mCameraID;
private Size mPreviewSize = new Size(-1, -1);
private HandlerThread mBackgroundThread;
private Handler mBackgroundHandler;
private Semaphore mCameraOpenCloseLock = new Semaphore(1);
Camera2Renderer(CameraGLSurfaceView view) {
super(view);
}
@Override
protected void doStart() {
Log.d(LOGTAG, "doStart");
startBackgroundThread();
super.doStart();
}
@Override
protected void doStop() {
Log.d(LOGTAG, "doStop");
super.doStop();
stopBackgroundThread();
}
boolean cacPreviewSize(final int width, final int height) {
Log.i(LOGTAG, "cacPreviewSize: " + width + "x" + height);
if (mCameraID == null) {
Log.e(LOGTAG, "Camera isn't initialized!");
return false;
}
CameraManager manager = (CameraManager) mView.getContext()
.getSystemService(Context.CAMERA_SERVICE);
try {
CameraCharacteristics characteristics = manager
.getCameraCharacteristics(mCameraID);
StreamConfigurationMap map = characteristics
.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
int bestWidth = 0, bestHeight = 0;
float aspect = (float) width / height;
for (Size psize : map.getOutputSizes(SurfaceTexture.class)) {
int w = psize.getWidth(), h = psize.getHeight();
Log.d(LOGTAG, "trying size: " + w + "x" + h);
if (width >= w && height >= h &&
bestWidth <= w && bestHeight <= h &&
Math.abs(aspect - (float) w / h) < 0.2) {
bestWidth = w;
bestHeight = h;
}
}
Log.i(LOGTAG, "best size: " + bestWidth + "x" + bestHeight);
if (bestWidth == 0 || bestHeight == 0 ||
mPreviewSize.getWidth() == bestWidth &&
mPreviewSize.getHeight() == bestHeight)
return false;
else {
mPreviewSize = new Size(bestWidth, bestHeight);
return true;
}
} catch (CameraAccessException e) {
Log.e(LOGTAG, "cacPreviewSize - Camera Access Exception");
} catch (IllegalArgumentException e) {
Log.e(LOGTAG, "cacPreviewSize - Illegal Argument Exception");
} catch (SecurityException e) {
Log.e(LOGTAG, "cacPreviewSize - Security Exception");
}
return false;
}
@Override
protected void openCamera(int id) {
Log.i(LOGTAG, "openCamera");
CameraManager manager = (CameraManager) mView.getContext().getSystemService(Context.CAMERA_SERVICE);
try {
String camList[] = manager.getCameraIdList();
if (camList.length == 0) {
Log.e(LOGTAG, "Error: camera isn't detected.");
return;
}
if (id == CameraBridgeViewBase.CAMERA_ID_ANY) {
mCameraID = camList[0];
} else {
for (String cameraID : camList) {
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraID);
if (id == CameraBridgeViewBase.CAMERA_ID_BACK &&
characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK ||
id == CameraBridgeViewBase.CAMERA_ID_FRONT &&
characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT) {
mCameraID = cameraID;
break;
}
}
}
if (mCameraID != null) {
if (!mCameraOpenCloseLock.tryAcquire(2500, TimeUnit.MILLISECONDS)) {
throw new RuntimeException(
"Time out waiting to lock camera opening.");
}
Log.i(LOGTAG, "Opening camera: " + mCameraID);
manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler);
}
} catch (CameraAccessException e) {
Log.e(LOGTAG, "OpenCamera - Camera Access Exception");
} catch (IllegalArgumentException e) {
Log.e(LOGTAG, "OpenCamera - Illegal Argument Exception");
} catch (SecurityException e) {
Log.e(LOGTAG, "OpenCamera - Security Exception");
} catch (InterruptedException e) {
Log.e(LOGTAG, "OpenCamera - Interrupted Exception");
}
}
@Override
protected void closeCamera() {
Log.i(LOGTAG, "closeCamera");
try {
mCameraOpenCloseLock.acquire();
if (null != mCaptureSession) {
mCaptureSession.close();
mCaptureSession = null;
}
if (null != mCameraDevice) {
mCameraDevice.close();
mCameraDevice = null;
}
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
} finally {
mCameraOpenCloseLock.release();
}
}
private final CameraDevice.StateCallback mStateCallback = new CameraDevice.StateCallback() {
@Override
public void onOpened(CameraDevice cameraDevice) {
mCameraDevice = cameraDevice;
mCameraOpenCloseLock.release();
createCameraPreviewSession();
}
@Override
public void onDisconnected(CameraDevice cameraDevice) {
cameraDevice.close();
mCameraDevice = null;
mCameraOpenCloseLock.release();
}
@Override
public void onError(CameraDevice cameraDevice, int error) {
cameraDevice.close();
mCameraDevice = null;
mCameraOpenCloseLock.release();
}
};
private void createCameraPreviewSession() {
int w = mPreviewSize.getWidth(), h = mPreviewSize.getHeight();
Log.i(LOGTAG, "createCameraPreviewSession(" + w + "x" + h + ")");
if (w < 0 || h < 0)
return;
try {
mCameraOpenCloseLock.acquire();
if (null == mCameraDevice) {
mCameraOpenCloseLock.release();
Log.e(LOGTAG, "createCameraPreviewSession: camera isn't opened");
return;
}
if (null != mCaptureSession) {
mCameraOpenCloseLock.release();
Log.e(LOGTAG, "createCameraPreviewSession: mCaptureSession is already started");
return;
}
if (null == mSTexture) {
mCameraOpenCloseLock.release();
Log.e(LOGTAG, "createCameraPreviewSession: preview SurfaceTexture is null");
return;
}
mSTexture.setDefaultBufferSize(w, h);
Surface surface = new Surface(mSTexture);
mPreviewRequestBuilder = mCameraDevice
.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
mPreviewRequestBuilder.addTarget(surface);
mCameraDevice.createCaptureSession(Arrays.asList(surface),
new CameraCaptureSession.StateCallback() {
@Override
public void onConfigured(CameraCaptureSession cameraCaptureSession) {
mCaptureSession = cameraCaptureSession;
try {
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
mCaptureSession.setRepeatingRequest(mPreviewRequestBuilder.build(), null, mBackgroundHandler);
Log.i(LOGTAG, "CameraPreviewSession has been started");
} catch (CameraAccessException e) {
Log.e(LOGTAG, "createCaptureSession failed");
}
mCameraOpenCloseLock.release();
}
@Override
public void onConfigureFailed(
CameraCaptureSession cameraCaptureSession) {
Log.e(LOGTAG, "createCameraPreviewSession failed");
mCameraOpenCloseLock.release();
}
}, mBackgroundHandler);
} catch (CameraAccessException e) {
Log.e(LOGTAG, "createCameraPreviewSession");
} catch (InterruptedException e) {
throw new RuntimeException(
"Interrupted while createCameraPreviewSession", e);
} finally {
//mCameraOpenCloseLock.release();
}
}
private void startBackgroundThread() {
Log.i(LOGTAG, "startBackgroundThread");
stopBackgroundThread();
mBackgroundThread = new HandlerThread("CameraBackground");
mBackgroundThread.start();
mBackgroundHandler = new Handler(mBackgroundThread.getLooper());
}
private void stopBackgroundThread() {
Log.i(LOGTAG, "stopBackgroundThread");
if (mBackgroundThread == null)
return;
mBackgroundThread.quitSafely();
try {
mBackgroundThread.join();
mBackgroundThread = null;
mBackgroundHandler = null;
} catch (InterruptedException e) {
Log.e(LOGTAG, "stopBackgroundThread");
}
}
@Override
protected void setCameraPreviewSize(int width, int height) {
Log.i(LOGTAG, "setCameraPreviewSize(" + width + "x" + height + ")");
if (mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth;
if (mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight;
try {
mCameraOpenCloseLock.acquire();
boolean needReconfig = cacPreviewSize(width, height);
mCameraWidth = mPreviewSize.getWidth();
mCameraHeight = mPreviewSize.getHeight();
if (!needReconfig) {
mCameraOpenCloseLock.release();
return;
}
if (null != mCaptureSession) {
Log.d(LOGTAG, "closing existing previewSession");
mCaptureSession.close();
mCaptureSession = null;
}
mCameraOpenCloseLock.release();
createCameraPreviewSession();
} catch (InterruptedException e) {
mCameraOpenCloseLock.release();
throw new RuntimeException("Interrupted while setCameraPreviewSize.", e);
}
}
}
| {'content_hash': '7b2fd6d149b60506e6d98bed912697db', 'timestamp': '', 'source': 'github', 'line_count': 297, 'max_line_length': 142, 'avg_line_length': 39.76767676767677, 'alnum_prop': 0.5670138006942681, 'repo_name': 'PizzaPastaRobottino/opencv-onboard', 'id': '1aeb4c69180323aa8022a91eeac709d1a368343d', 'size': '11811', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'libraries/opencv/src/org/opencv/android/Camera2Renderer.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '993407'}]} |
import React, { Component } from 'react';
import { ThreadlistOriginalPost } from './Post';
import './styles/BoardThreadList.css';
class BoardThreadList extends Component {
render() {
let threads = [];
if (this.props.threads) {
threads = this.props.threads.map(thread => <ThreadlistOriginalPost data={thread} key={thread.id} board={this.props.board} />);
}
return (
<div className='BoardThreadList'>
<div className='BoardThreadList__threads'>
{threads}
</div>
</div>
);
}
}
export default BoardThreadList; | {'content_hash': '27ff5a29609f5fb950e6863f586760c8', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 132, 'avg_line_length': 27.333333333333332, 'alnum_prop': 0.6393728222996515, 'repo_name': 'drop-table-ryhmatyo/tekislauta-front', 'id': '69db58de52f019b1aec25b5cb01e439beca593b2', 'size': '574', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/BoardThreadList.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5491'}, {'name': 'HTML', 'bytes': '1219'}, {'name': 'JavaScript', 'bytes': '29135'}]} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Vermicularia zingiberae Sundar.
### Remarks
null | {'content_hash': 'b7feb7154bde289331570fd05a699e37', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 10.461538461538462, 'alnum_prop': 0.7205882352941176, 'repo_name': 'mdoering/backbone', 'id': '2a5f483ec2c7408319b61aa34bd473f9356e1b88', 'size': '191', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Ascomycota/Sordariomycetes/Glomerellaceae/Vermicularia/Vermicularia zingiberae/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
/*
This script will show you how you can get the number of all videos in your application
Parameters you need to pass:
1. app_token
2. private_key
3. video_token
*/
namespace Videos_Get
{
public class Videos_Get
{
public static void Main(string[] args)
{
string app_token = args[0];
string private_key = args[1];
string video_token = args[2];
Ziggeo ziggeo = new Ziggeo(app_token, private_key, "");
System.Console.Write(ziggeo.videos().get(video_token));
}
}
} | {'content_hash': 'f55215f5568babf744b68621a2bc8897', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 87, 'avg_line_length': 21.096774193548388, 'alnum_prop': 0.7140672782874617, 'repo_name': 'Ziggeo/ZiggeoCSharpSDK', 'id': '46ed1c12daf0f1cd09a082167c2b93feec380b7f', 'size': '656', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'demos/videos_get.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '42415'}, {'name': 'Shell', 'bytes': '4478'}]} |
<p>Aquí va el contenido de mi sección <mark>Inicio</mark></p> | {'content_hash': '58116c0d9eaca5877cbe765aa954055d', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 61, 'avg_line_length': 61.0, 'alnum_prop': 0.7213114754098361, 'repo_name': 'StaBabel/iconos28', 'id': 'b45b36df471cdc8da25537d27bb28d72b50d2121', 'size': '63', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'PHP/sitio-amigable/v3-optimizar-php-spa/inc/inicio.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1689'}, {'name': 'CSS', 'bytes': '1863011'}, {'name': 'HTML', 'bytes': '374746'}, {'name': 'JavaScript', 'bytes': '2125824'}, {'name': 'PHP', 'bytes': '9363556'}]} |
module Myob
module Api
module Model
class Timesheet < Base
def model_route
'Payroll/Timesheet'
end
# http://developer.myob.com/api/accountright/v2/payroll/timesheet/
# we always want to PUT timesheets, so they are never a "new" record
def new_record?(object)
false
end
# a timesheet is identified based on an employee UID as well as its start and end date
# it does not have a UID of its own
def url(object = nil, params = nil)
if object
"#{super()}/#{object['Employee']['UID']}?StartDate=#{object['StartDate']}&EndDate=#{object['EndDate']}"
else
super
end
end
end
end
end
end
| {'content_hash': 'fb81de6132dd11b6ecda00a06fa20330', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 115, 'avg_line_length': 28.037037037037038, 'alnum_prop': 0.5653896961690885, 'repo_name': 'maestrano/myob-api', 'id': '3c944dbcecc8dda23500ce444fe5df8e62cb50da', 'size': '757', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'lib/myob/api/models/timesheet.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '29223'}]} |
/* The Nivo Slider styles */
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300);
.nivoSlider {
position:relative;
width:100%;
height:auto;
overflow: hidden;
}
.nivoSlider img {
position:absolute;
top:0px;
left:0px;
max-width: none;
}
.nivo-main-image {
display: block !important;
position: relative !important;
width: 100% !important;
}
/* If an image is wrapped in a link */
.nivoSlider a.nivo-imageLink {
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
border:0;
padding:0;
margin:0;
z-index:6;
display:none;
background:white;
filter:alpha(opacity=0);
opacity:0;
}
/* The slices and boxes in the Slider */
.nivo-slice {
display:block;
position:absolute;
z-index:5;
height:100%;
top:0;
}
.nivo-box {
display:block;
position:absolute;
z-index:5;
overflow:hidden;
}
.nivo-box img { display:block; }
/* Caption styles */
.nivo-caption {
position:absolute;
left:13%;
background:transparent;
z-index:8;
padding:0;
overflow: hidden;
display: none;
}
.slide_info{
padding:10px;
margin-bottom:10px;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
.nivo-caption h1{
margin:0;
text-transform:uppercase !important;
line-height:45px;
font-family:'Source-Reg' !important;
}
.nivo-caption h1 a{ padding:10px; color:#ffffff; font-family:'Source-Reg' !important;}
.nivo-caption p {
padding:10px;
margin:5px 0 0;
font:400 18px 'Oswald',san-serif;
color:#ffffff;
text-transform:uppercase;
}
.nivo-caption a {
display:inline-block !important;
}
.slide_more{
color:#fff;
font-size:14px !important;
background-color:transparent !important;
}
.slide_more a{
color:#fff;
padding:10px 20px;
}
.nivo-html-caption {
display:none;
}
/* Direction nav styles (e.g. Next & Prev) */
.nivo-directionNav a {
position:absolute;
bottom:10px;
z-index:9;
cursor:pointer;
}
.nivo-prevNav {
left:0px;
}
.nivo-nextNav {
right:0px;
}
/* Control nav styles (e.g. 1,2,3...) */
.nivo-controlNav {
text-align:center;
padding: 15px 0;
}
.nivo-controlNav a {
cursor:pointer;
}
.nivo-controlNav a.active {
font-weight:bold;
}
/*
Skin Name: Nivo Slider Default Theme
Skin URI: http://nivo.dev7studios.com
Description: The default skin for the Nivo Slider.
Version: 1.3
Author: Gilbert Pellegrom
Author URI: http://dev7studios.com
Supports Thumbs: true
*/
.theme-default{
position:relative;
}
.theme-default .nivoSlider {
position:relative;
background:#fff url(../images/loading.gif) no-repeat 50% 50%;
margin-bottom:10px;
}
.theme-default .nivoSlider img {
position:absolute;
top:0px;
left:0px;
display:none;
}
.theme-default .nivoSlider a {
border:0;
display:block;
}
.theme-default .nivo-controlNav {
position:absolute;
bottom:12px;
text-align: center;
padding: 0;
width:100%;
z-index:8;
}
.theme-default .nivo-controlNav a {
display:inline-block;
width:22px;
height:22px;
text-indent:-9999px;
border:0;
margin: 0 2px;
}
.theme-default .nivo-controlNav a.active {
background-position:0 -22px;
}
.theme-default .nivo-directionNav a {
display:block;
width:28px;
height:44px;
background:url(../images/arrows.png) no-repeat;
text-indent:-9999px;
border:0;
top:180px;
opacity: 0.75;
-webkit-transition: all 200ms ease-in-out;
-moz-transition: all 200ms ease-in-out;
-o-transition: all 200ms ease-in-out;
transition: all 200ms ease-in-out;
}
.theme-default:hover .nivo-directionNav a { opacity: 1; }
.theme-default a.nivo-nextNav {
background-position:-30px 0;
right:15px;
}
.theme-default a.nivo-prevNav {
left:15px;
}
.theme-default .nivo-caption a:hover {
color:#fff;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled {
width: 100%;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled a {
width: auto;
height: auto;
background: none;
margin-bottom: 5px;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled img {
display: block;
width: 120px;
height: auto;
}
@media only screen and (min-width:1000px) {
.nivo-caption{width:644px; margin:0 auto; bottom:148px;}
}
@media only screen and (min-width: 768px) and (max-width: 999px) {
.nivo-caption{width:47%; bottom:55px;}
.nivo-caption h1{font-size:35px;}
p.slide_more{ margin-left:10px;}
}
@media only screen and (max-width: 767px) {
.nivo-caption{width:53%; height:100%; bottom:0; left:0; text-align:left;}
.nivo-caption h1{font-size:15px; line-height:20px;}
.nivo-caption p{font-size:11px;}
.slide_info{margin-bottom:0;}
p.slide_more{ margin-left:10px;}
} | {'content_hash': '7f19c882f9c0745bd7d4aba364b5082a', 'timestamp': '', 'source': 'github', 'line_count': 229, 'max_line_length': 86, 'avg_line_length': 21.04366812227074, 'alnum_prop': 0.6681884208341979, 'repo_name': 'sedici/wpmu-istec', 'id': '7c6e675da1646f330994c16d36686a0ea5dbd714', 'size': '5026', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wp-content/themes/ISTEC_ini/css/nivo-slider.css', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '616'}, {'name': 'Batchfile', 'bytes': '166'}, {'name': 'CSS', 'bytes': '3940197'}, {'name': 'HTML', 'bytes': '282386'}, {'name': 'JavaScript', 'bytes': '5863354'}, {'name': 'PHP', 'bytes': '17942125'}, {'name': 'Shell', 'bytes': '3301'}]} |
var express = require('express');
function getAttacher1 (app) {
return function() {
app.use(function(req, res){});
};
}
var app = express();
getAttacher1(app);
confuse(getAttacher2); // attempt to disable the type inference
function getAttacher2 (app) {
return function(h) {
app.use(h);
};
}
var app = express();
getAttacher2(app)(function(req, res){});
confuse(getAttacher2); // attempt to disable the type inference
function getAttacher3 (app) {
return function(h) {
app.use(h);
};
}
var app = express();
(unknown || getAttacher3)(app)(function(req, res){}); // confuse the type inference
| {'content_hash': 'e015551a73594dfc0fe50a59e0952ab5', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 83, 'avg_line_length': 22.20689655172414, 'alnum_prop': 0.6444099378881988, 'repo_name': 'github/codeql', 'id': 'bb5bbfb4acb0fdc3e55a7c6c3c9fbf072237a822', 'size': '644', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'javascript/ql/test/library-tests/frameworks/HTTP-heuristics/src/middleware-attacher-getter.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP.NET', 'bytes': '3739'}, {'name': 'Batchfile', 'bytes': '3534'}, {'name': 'C', 'bytes': '410440'}, {'name': 'C#', 'bytes': '21146000'}, {'name': 'C++', 'bytes': '1352639'}, {'name': 'CMake', 'bytes': '1809'}, {'name': 'CodeQL', 'bytes': '32583145'}, {'name': 'Dockerfile', 'bytes': '496'}, {'name': 'EJS', 'bytes': '1478'}, {'name': 'Emacs Lisp', 'bytes': '3445'}, {'name': 'Go', 'bytes': '697562'}, {'name': 'HTML', 'bytes': '58008'}, {'name': 'Handlebars', 'bytes': '1000'}, {'name': 'Java', 'bytes': '5417683'}, {'name': 'JavaScript', 'bytes': '2432320'}, {'name': 'Kotlin', 'bytes': '12163740'}, {'name': 'Lua', 'bytes': '13113'}, {'name': 'Makefile', 'bytes': '8631'}, {'name': 'Mustache', 'bytes': '17025'}, {'name': 'Nunjucks', 'bytes': '923'}, {'name': 'Perl', 'bytes': '1941'}, {'name': 'PowerShell', 'bytes': '1295'}, {'name': 'Python', 'bytes': '1649035'}, {'name': 'RAML', 'bytes': '2825'}, {'name': 'Ruby', 'bytes': '299268'}, {'name': 'Rust', 'bytes': '234024'}, {'name': 'Shell', 'bytes': '23973'}, {'name': 'Smalltalk', 'bytes': '23'}, {'name': 'Starlark', 'bytes': '27062'}, {'name': 'Swift', 'bytes': '204309'}, {'name': 'Thrift', 'bytes': '3020'}, {'name': 'TypeScript', 'bytes': '219623'}, {'name': 'Vim Script', 'bytes': '1949'}, {'name': 'Vue', 'bytes': '2881'}]} |
( function () {
'use strict';
var app = angular.module( 'axon-angularjs-utilities' );
app.controller( 'GenericModalController', [
'$scope', '$state', '$modalInstance', '$modalArgs', '$sce',
function ( $scope, $state, $modalInstance, $modalArgs, $sce ) {
///////////////////////
/// Event Handlers ///
/////////////////////
// Handles the Okay button on the modal being clicked.
$scope.onOkayButtonClicked = function () {
// Check if the onOkayButtonClicked passed in as part of $modalArgs is set and is actually
// a function. If it is not, simply close the modal and return.
if ( typeof $modalArgs.onOkayButtonClicked !== 'function' ) {
$modalInstance.close();
return;
}
// Call the proxy function to execute any arbitrary instructions the caller intended.
$modalArgs.onOkayButtonClicked( $modalInstance );
};
// Handles the Cancel button on the modal bring clicked.
$scope.onCancelButtonClicked = function() {
// Check if the onCancelButtonClicked passed in as part of $modalArgs is set and is
// actually a function. If it is not, simply close the modal and return.
if ( typeof $modalArgs.onCancelButtonClicked !== 'function' ) {
$modalInstance.close();
return;
}
// Call the proxy function to execute any arbitrary instructions the caller intended.
$modalArgs.onCancelButtonClicked( $modalInstance );
};
///////////////////////
/// Initialization ///
/////////////////////
( function init() {
if ( typeof $modalArgs === 'undefined' ) {
throw new Error( 'A generic modal requires $modalArgs to be set.' );
}
// Place the title and message onto the $scope so they can be templated.
$scope.title = $modalArgs.title;
$scope.message = $sce.trustAsHtml( $modalArgs.message );
$scope.showCancelButton = $modalArgs.showCancelButton;
} )();
} ] );
} )();
| {'content_hash': '8b020e9db5110c77a02f1b930107dd3a', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 99, 'avg_line_length': 33.274193548387096, 'alnum_prop': 0.5841008240426563, 'repo_name': 'AxonInteractive/angularjs-utilities', 'id': 'ea67fa79d176560ab6bcf31d103cc231d04b1b86', 'size': '2063', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/views/GenericModal/GenericModalController.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1507'}, {'name': 'HTML', 'bytes': '4369'}, {'name': 'JavaScript', 'bytes': '35397'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>higman-cf: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.2 / higman-cf - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
higman-cf
<small>
8.8.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-24 22:37:17 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-24 22:37:17 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.11.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.2 Official release 4.11.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/higman-cf"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/HigmanCF"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [
"keyword: Higman's lemma"
"keyword: extraction"
"category: Mathematics/Combinatorics and Graph Theory"
"category: Miscellaneous/Extracted Programs/Combinatorics"
]
authors: [ "Stefan Berghofer" ]
bug-reports: "https://github.com/coq-contribs/higman-cf/issues"
dev-repo: "git+https://github.com/coq-contribs/higman-cf.git"
synopsis: "A direct constructive proof of Higman's Lemma"
description: """
This development formalizes in Coq the Coquand-Friedlender proof of
Higman's lemma for a two-letter alphabet.
An efficient program can be extracted from the proof."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/higman-cf/archive/v8.8.0.tar.gz"
checksum: "md5=b6510a832128ef667bfabad1dac3529c"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-higman-cf.8.8.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.2).
The following dependencies couldn't be met:
- coq-higman-cf -> coq < 8.9~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-higman-cf.8.8.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': '492215521e67937a5c66eca02326a2aa', 'timestamp': '', 'source': 'github', 'line_count': 170, 'max_line_length': 159, 'avg_line_length': 41.43529411764706, 'alnum_prop': 0.5457126632595116, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'e8d03aaa252a304a43779bcae15ebfea01885707', 'size': '7069', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.11.2-2.0.7/released/8.13.2/higman-cf/8.8.0.html', 'mode': '33188', 'license': 'mit', 'language': []} |
<?php namespace Tarsana\Command;
use Tarsana\Command\Commands\HelpCommand;
use Tarsana\Command\Commands\InteractiveCommand;
use Tarsana\Command\Commands\VersionCommand;
use Tarsana\Command\Config\ConfigLoader;
use Tarsana\Command\Console\Console;
use Tarsana\Command\Console\ExceptionPrinter;
use Tarsana\Command\Interfaces\Console\ConsoleInterface;
use Tarsana\Command\Interfaces\Template\TemplateLoaderInterface;
use Tarsana\Command\SubCommand;
use Tarsana\Command\Template\TemplateLoader;
use Tarsana\IO\Filesystem;
use Tarsana\IO\FilesystemInterface;
use Tarsana\Syntax\Exceptions\ParseException;
use Tarsana\Syntax\Factory as S;
use Tarsana\Syntax\Text as T;
class Command {
protected $name;
protected $version;
protected $description;
protected $syntax;
protected $descriptions;
protected $options;
protected $args;
protected $action;
protected $commands;
protected $console;
protected $fs;
protected $templatesLoader;
protected $config;
public static function create(callable $action = null) {
$command = new Command;
if (null !== $action)
$command->action($action);
return $command;
}
public function __construct()
{
$this->commands([])
->name('Unknown')
->version('1.0.0')
->description('...')
->descriptions([])
->options([])
->console(new Console)
->fs(new Filesystem('.'))
->configPaths([])
->setupSubCommands()
->init();
}
/**
* name getter and setter.
*
* @param string
* @return mixed
*/
public function name(string $value = null)
{
if (null === $value) {
return $this->name;
}
$this->name = $value;
return $this;
}
/**
* version getter and setter.
*
* @param string
* @return mixed
*/
public function version(string $value = null)
{
if (null === $value) {
return $this->version;
}
$this->version = $value;
return $this;
}
/**
* description getter and setter.
*
* @param string
* @return mixed
*/
public function description(string $value = null)
{
if (null === $value) {
return $this->description;
}
$this->description = $value;
return $this;
}
/**
* descriptions getter and setter.
*
* @param string
* @return mixed
*/
public function descriptions(array $value = null)
{
if (null === $value) {
return $this->descriptions;
}
$this->descriptions = $value;
return $this;
}
/**
* syntax getter and setter.
*
* @param string|null $syntax
* @return Syntax|self
*/
public function syntax(string $syntax = null)
{
if (null === $syntax)
return $this->syntax;
$this->syntax = S::syntax()->parse("{{$syntax}| }");
return $this;
}
/**
* options getter and setter.
*
* @param array
* @return mixed
*/
public function options(array $options = null)
{
if (null === $options) {
return $this->options;
}
$this->options = [];
foreach($options as $option)
$this->options[$option] = false;
return $this;
}
/**
* option getter.
*
* @param string
* @return mixed
*/
public function option(string $name)
{
if (!array_key_exists($name, $this->options))
throw new \InvalidArgumentException("Unknown option '{$name}'");
return $this->options[$name];
}
/**
* args getter and setter.
*
* @param stdClass
* @return mixed
*/
public function args(\stdClass $value = null)
{
if (null === $value) {
return $this->args;
}
$this->args = $value;
return $this;
}
/**
* console getter and setter.
*
* @param ConsoleInterface
* @return mixed
*/
public function console(ConsoleInterface $value = null)
{
if (null === $value) {
return $this->console;
}
$this->console = $value;
foreach ($this->commands as $name => $command) {
$command->console = $value;
}
return $this;
}
/**
* fs getter and setter.
*
* @param Tarsana\IO\Filesystem|string
* @return mixed
*/
public function fs($value = null)
{
if (null === $value) {
return $this->fs;
}
if (is_string($value))
$value = new Filesystem($value);
$this->fs = $value;
foreach ($this->commands as $name => $command) {
$command->fs = $value;
}
return $this;
}
/**
* templatesLoader getter and setter.
*
* @param Tarsana\Command\Interfaces\Template\TemplateLoaderInterface
* @return mixed
*/
public function templatesLoader(TemplateLoaderInterface $value = null)
{
if (null === $value) {
return $this->templatesLoader;
}
$this->templatesLoader = $value;
foreach ($this->commands as $name => $command) {
$command->templatesLoader = $value;
}
return $this;
}
public function templatesPath(string $path, string $cachePath = null)
{
$this->templatesLoader = new TemplateLoader($path, $cachePath);
foreach ($this->commands as $name => $command) {
$command->templatesLoader = $this->templatesLoader();
}
return $this;
}
public function template(string $name)
{
if (null === $this->templatesLoader)
throw new \Exception("Please initialize the templates loader before trying to load templates!");
return $this->templatesLoader->load($name);
}
public function configPaths(array $paths)
{
$configLoader = new ConfigLoader($this->fs);
$this->config = $configLoader->load($paths);
foreach ($this->commands as $name => $command) {
$command->config = $this->config;
}
return $this;
}
public function config(string $path = null)
{
return $this->config->get($path);
}
/**
* action getter and setter.
*
* @param callable
* @return mixed
*/
public function action(callable $value = null)
{
if (null === $value) {
return $this->action;
}
$this->action = $value;
return $this;
}
/**
* commands getter and setter.
*
* @param array
* @return mixed
*/
public function commands(array $value = null)
{
if (null === $value) {
return $this->commands;
}
$this->commands = [];
foreach ($value as $name => $command) {
$this->command($name, $command);
}
return $this;
}
public function command(string $name, Command $command = null)
{
if (null === $command) {
if (!array_key_exists($name, $this->commands))
throw new \InvalidArgumentException("subcommand '{$name}' not found!");
return $this->commands[$name];
}
$this->commands[$name] = $command;
return $this;
}
public function hasCommand(string $name) : bool
{
return array_key_exists($name, $this->commands);
}
protected function setupSubCommands()
{
return $this->command('--help', new HelpCommand($this))
->command('--version', new VersionCommand($this))
->command('-i', new InteractiveCommand($this));
}
public function describe(string $name, string $description = null)
{
if (null === $description)
return array_key_exists($name, $this->descriptions)
? $this->descriptions[$name] : '';
if (substr($name, 0, 2) == '--' && array_key_exists($name, $this->options())) {
$this->descriptions[$name] = $description;
return $this;
}
try {
$this->syntax->field($name);
// throws exception if field is missing
$this->descriptions[$name] = $description;
return $this;
} catch (\Exception $e) {
throw new \InvalidArgumentException("Unknown field '{$name}'");
}
}
public function run(array $args = null, array $options = [], bool $rawArgs = true)
{
try {
$this->clear();
if ($rawArgs) {
if (null === $args) {
$args = $GLOBALS['argv'];
array_shift($args);
}
if (!empty($args) && array_key_exists($args[0], $this->commands)) {
$name = $args[0];
array_shift($args);
return $this->command($name)->run($args);
}
$this->parseArguments($args);
} else {
$this->args = (object) $args;
foreach ($options as $name) {
if (!array_key_exists($name, $this->options))
throw new \Exception("Unknown option '{$name}'");
$this->options[$name] = true;
}
}
return $this->fire();
} catch (\Exception $e) {
$this->handleError($e);
}
}
protected function fire()
{
return (null === $this->action)
? $this->execute()
: ($this->action)($this);
}
protected function clear()
{
$this->args = null;
foreach($this->options as $name => $value) {
$this->options[$name] = false;
}
}
protected function parseArguments(array $args)
{
$arguments = [];
foreach ($args as &$arg) {
if (array_key_exists($arg, $this->options))
$this->options[$arg] = true;
else
$arguments[] = $arg;
}
if (null === $this->syntax) {
$this->args = null;
} else {
$arguments = T::join($arguments, ' ');
$this->args = $this->syntax->parse($arguments);
}
}
protected function handleError(\Exception $e) {
$output = (new ExceptionPrinter)->print($e);
$this->console()->error($output);
}
protected function init() {}
protected function execute() {}
}
| {'content_hash': '1f1c93ce7b730c6807e8c4afda513cc9', 'timestamp': '', 'source': 'github', 'line_count': 418, 'max_line_length': 108, 'avg_line_length': 25.672248803827753, 'alnum_prop': 0.5141179759575063, 'repo_name': 'tarsana/command', 'id': '9de2b3bda31ce714105e78859e219d2bef0e3d6b', 'size': '10731', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Command.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '61998'}, {'name': 'Twig', 'bytes': '14'}]} |
<project name="Webapp setup tasks for for Eclipse" default="carrot2.webapp.eclipse.setup">
<target name="carrot2.webapp.eclipse.setup">
<ant dir="../../../../" antfile="build.xml" target="carrot2.webapp.eclipse.setup">
<property name="build.number" value="" />
</ant>
</target>
</project>
| {'content_hash': 'af21aec308c16588ff1122aca5a07555', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 90, 'avg_line_length': 43.857142857142854, 'alnum_prop': 0.6612377850162866, 'repo_name': 'arnaudsj/carrot2', 'id': '8a29f4011dea82c65ec304b2eb16be72d2da7c14', 'size': '307', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'applications/carrot2-webapp/etc/eclipse/webapp-eclipse-setup.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C#', 'bytes': '13127'}, {'name': 'Java', 'bytes': '3095369'}, {'name': 'JavaScript', 'bytes': '119507'}, {'name': 'PHP', 'bytes': '22722'}, {'name': 'Perl', 'bytes': '903'}, {'name': 'Ruby', 'bytes': '11125'}, {'name': 'Shell', 'bytes': '3073'}]} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
-->
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:theme="@style/AppTheme.Toolbar"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
| {'content_hash': '78873f027d4bd6d3e45d1e136a0eaba0', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 60, 'avg_line_length': 36.357142857142854, 'alnum_prop': 0.7347740667976425, 'repo_name': 'matt-gibbs/azure-mobile-engagement-app-android', 'id': '53004a16084f7c789d2b28068d9d367888152b01', 'size': '509', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/toolbar.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2027'}, {'name': 'HTML', 'bytes': '13917'}, {'name': 'Java', 'bytes': '161599'}]} |
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Invoicing/ExtendedSigner.proto
package Diadoc.Api.Proto.Invoicing.Signers;
public final class ExtendedSignerProtos {
private ExtendedSignerProtos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
/**
* Protobuf enum {@code Diadoc.Api.Proto.Invoicing.Signers.SignerType}
*/
public enum SignerType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>LegalEntity = 1;</code>
*
* <pre>
* Представитель юридического лица
* </pre>
*/
LegalEntity(0, 1),
/**
* <code>IndividualEntity = 2;</code>
*
* <pre>
* Индивидуальный предприниматель
* </pre>
*/
IndividualEntity(1, 2),
/**
* <code>PhysicalPerson = 3;</code>
*
* <pre>
* Физическое лицо
* </pre>
*/
PhysicalPerson(2, 3),
;
/**
* <code>LegalEntity = 1;</code>
*
* <pre>
* Представитель юридического лица
* </pre>
*/
public static final int LegalEntity_VALUE = 1;
/**
* <code>IndividualEntity = 2;</code>
*
* <pre>
* Индивидуальный предприниматель
* </pre>
*/
public static final int IndividualEntity_VALUE = 2;
/**
* <code>PhysicalPerson = 3;</code>
*
* <pre>
* Физическое лицо
* </pre>
*/
public static final int PhysicalPerson_VALUE = 3;
public final int getNumber() { return value; }
public static SignerType valueOf(int value) {
switch (value) {
case 1: return LegalEntity;
case 2: return IndividualEntity;
case 3: return PhysicalPerson;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<SignerType>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<SignerType>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<SignerType>() {
public SignerType findValueByNumber(int number) {
return SignerType.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.getDescriptor().getEnumTypes().get(0);
}
private static final SignerType[] VALUES = values();
public static SignerType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private SignerType(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.Invoicing.Signers.SignerType)
}
/**
* Protobuf enum {@code Diadoc.Api.Proto.Invoicing.Signers.SignerPowers}
*/
public enum SignerPowers
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>InvoiceSigner = 0;</code>
*
* <pre>
* лицо, ответственное за подписание счетов-фактур
* </pre>
*/
InvoiceSigner(0, 0),
/**
* <code>PersonMadeOperation = 1;</code>
*
* <pre>
* лицо, совершившее сделку, операцию
* </pre>
*/
PersonMadeOperation(1, 1),
/**
* <code>MadeAndSignOperation = 2;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за её оформление;
* </pre>
*/
MadeAndSignOperation(2, 2),
/**
* <code>PersonDocumentedOperation = 3;</code>
*
* <pre>
* лицо, ответственное за оформление свершившегося события;
* </pre>
*/
PersonDocumentedOperation(3, 3),
/**
* <code>MadeOperationAndSignedInvoice = 4;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за подписание счетов-фактур;
* </pre>
*/
MadeOperationAndSignedInvoice(4, 4),
/**
* <code>MadeAndResponsibleForOperationAndSignedInvoice = 5;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за её оформление и за подписание счетов-фактур;
* </pre>
*/
MadeAndResponsibleForOperationAndSignedInvoice(5, 5),
/**
* <code>ResponsibleForOperationAndSignerForInvoice = 6;</code>
*
* <pre>
* лицо, ответственное за оформление свершившегося события и за подписание счетов-фактур
* </pre>
*/
ResponsibleForOperationAndSignerForInvoice(6, 6),
/**
* <code>ChairmanCommission = 7;</code>
*
* <pre>
* председатель комиссии
* </pre>
*/
ChairmanCommission(7, 7),
/**
* <code>MemberCommission = 8;</code>
*
* <pre>
* член комиссии
* </pre>
*/
MemberCommission(8, 8),
/**
* <code>PersonApprovedDocument = 21;</code>
*
* <pre>
* лицо, в полномочия которого входит утверждение документа, оформляющего событие (факт хозяйственной жизни)
* </pre>
*/
PersonApprovedDocument(9, 21),
/**
* <code>PersonConfirmedDocument = 22;</code>
*
* <pre>
* лицо, в полномочия которого входит подтверждение оформленного события (факта хозяйственной жизни)
* </pre>
*/
PersonConfirmedDocument(10, 22),
/**
* <code>PersonAgreedOnDocument = 23;</code>
*
* <pre>
* лицо, в полномочия которого входит согласование документа, оформляющего событие (факт хозяйственной жизни)
* </pre>
*/
PersonAgreedOnDocument(11, 23),
/**
* <code>PersonOtherPower = 29;</code>
*
* <pre>
* лицо с иными полномочиями
* </pre>
*/
PersonOtherPower(12, 29),
;
/**
* <code>InvoiceSigner = 0;</code>
*
* <pre>
* лицо, ответственное за подписание счетов-фактур
* </pre>
*/
public static final int InvoiceSigner_VALUE = 0;
/**
* <code>PersonMadeOperation = 1;</code>
*
* <pre>
* лицо, совершившее сделку, операцию
* </pre>
*/
public static final int PersonMadeOperation_VALUE = 1;
/**
* <code>MadeAndSignOperation = 2;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за её оформление;
* </pre>
*/
public static final int MadeAndSignOperation_VALUE = 2;
/**
* <code>PersonDocumentedOperation = 3;</code>
*
* <pre>
* лицо, ответственное за оформление свершившегося события;
* </pre>
*/
public static final int PersonDocumentedOperation_VALUE = 3;
/**
* <code>MadeOperationAndSignedInvoice = 4;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за подписание счетов-фактур;
* </pre>
*/
public static final int MadeOperationAndSignedInvoice_VALUE = 4;
/**
* <code>MadeAndResponsibleForOperationAndSignedInvoice = 5;</code>
*
* <pre>
* лицо, совершившее сделку, операцию и ответственное за её оформление и за подписание счетов-фактур;
* </pre>
*/
public static final int MadeAndResponsibleForOperationAndSignedInvoice_VALUE = 5;
/**
* <code>ResponsibleForOperationAndSignerForInvoice = 6;</code>
*
* <pre>
* лицо, ответственное за оформление свершившегося события и за подписание счетов-фактур
* </pre>
*/
public static final int ResponsibleForOperationAndSignerForInvoice_VALUE = 6;
/**
* <code>ChairmanCommission = 7;</code>
*
* <pre>
* председатель комиссии
* </pre>
*/
public static final int ChairmanCommission_VALUE = 7;
/**
* <code>MemberCommission = 8;</code>
*
* <pre>
* член комиссии
* </pre>
*/
public static final int MemberCommission_VALUE = 8;
/**
* <code>PersonApprovedDocument = 21;</code>
*
* <pre>
* лицо, в полномочия которого входит утверждение документа, оформляющего событие (факт хозяйственной жизни)
* </pre>
*/
public static final int PersonApprovedDocument_VALUE = 21;
/**
* <code>PersonConfirmedDocument = 22;</code>
*
* <pre>
* лицо, в полномочия которого входит подтверждение оформленного события (факта хозяйственной жизни)
* </pre>
*/
public static final int PersonConfirmedDocument_VALUE = 22;
/**
* <code>PersonAgreedOnDocument = 23;</code>
*
* <pre>
* лицо, в полномочия которого входит согласование документа, оформляющего событие (факт хозяйственной жизни)
* </pre>
*/
public static final int PersonAgreedOnDocument_VALUE = 23;
/**
* <code>PersonOtherPower = 29;</code>
*
* <pre>
* лицо с иными полномочиями
* </pre>
*/
public static final int PersonOtherPower_VALUE = 29;
public final int getNumber() { return value; }
public static SignerPowers valueOf(int value) {
switch (value) {
case 0: return InvoiceSigner;
case 1: return PersonMadeOperation;
case 2: return MadeAndSignOperation;
case 3: return PersonDocumentedOperation;
case 4: return MadeOperationAndSignedInvoice;
case 5: return MadeAndResponsibleForOperationAndSignedInvoice;
case 6: return ResponsibleForOperationAndSignerForInvoice;
case 7: return ChairmanCommission;
case 8: return MemberCommission;
case 21: return PersonApprovedDocument;
case 22: return PersonConfirmedDocument;
case 23: return PersonAgreedOnDocument;
case 29: return PersonOtherPower;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<SignerPowers>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<SignerPowers>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<SignerPowers>() {
public SignerPowers findValueByNumber(int number) {
return SignerPowers.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.getDescriptor().getEnumTypes().get(1);
}
private static final SignerPowers[] VALUES = values();
public static SignerPowers valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private SignerPowers(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.Invoicing.Signers.SignerPowers)
}
/**
* Protobuf enum {@code Diadoc.Api.Proto.Invoicing.Signers.SignerStatus}
*/
public enum SignerStatus
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>SellerEmployee = 1;</code>
*
* <pre>
* Работник организации продавца товаров (работ, услуг, имущественных прав);
* </pre>
*/
SellerEmployee(0, 1),
/**
* <code>InformationCreatorEmployee = 2;</code>
*
* <pre>
* Работник организации - составителя информации продавца;
* </pre>
*/
InformationCreatorEmployee(1, 2),
/**
* <code>OtherOrganizationEmployee = 3;</code>
*
* <pre>
* Работник иной уполномоченной организации;
* </pre>
*/
OtherOrganizationEmployee(2, 3),
/**
* <code>AuthorizedPerson = 4;</code>
*
* <pre>
* Уполномоченное физическое лицо (в том числе индивидуальный предприниматель);
* </pre>
*/
AuthorizedPerson(3, 4),
/**
* <code>BuyerEmployee = 5;</code>
*
* <pre>
* Работник организации - покупателя (для документов в формате приказа №820);
* </pre>
*/
BuyerEmployee(4, 5),
/**
* <code>InformationCreatorBuyerEmployee = 6;</code>
*
* <pre>
* Работник организации - составителя файла обмена информации покупателя, если составитель файла обмена информации покупателя не является покупателем (для документов в формате приказа №820)
* </pre>
*/
InformationCreatorBuyerEmployee(5, 6),
;
/**
* <code>SellerEmployee = 1;</code>
*
* <pre>
* Работник организации продавца товаров (работ, услуг, имущественных прав);
* </pre>
*/
public static final int SellerEmployee_VALUE = 1;
/**
* <code>InformationCreatorEmployee = 2;</code>
*
* <pre>
* Работник организации - составителя информации продавца;
* </pre>
*/
public static final int InformationCreatorEmployee_VALUE = 2;
/**
* <code>OtherOrganizationEmployee = 3;</code>
*
* <pre>
* Работник иной уполномоченной организации;
* </pre>
*/
public static final int OtherOrganizationEmployee_VALUE = 3;
/**
* <code>AuthorizedPerson = 4;</code>
*
* <pre>
* Уполномоченное физическое лицо (в том числе индивидуальный предприниматель);
* </pre>
*/
public static final int AuthorizedPerson_VALUE = 4;
/**
* <code>BuyerEmployee = 5;</code>
*
* <pre>
* Работник организации - покупателя (для документов в формате приказа №820);
* </pre>
*/
public static final int BuyerEmployee_VALUE = 5;
/**
* <code>InformationCreatorBuyerEmployee = 6;</code>
*
* <pre>
* Работник организации - составителя файла обмена информации покупателя, если составитель файла обмена информации покупателя не является покупателем (для документов в формате приказа №820)
* </pre>
*/
public static final int InformationCreatorBuyerEmployee_VALUE = 6;
public final int getNumber() { return value; }
public static SignerStatus valueOf(int value) {
switch (value) {
case 1: return SellerEmployee;
case 2: return InformationCreatorEmployee;
case 3: return OtherOrganizationEmployee;
case 4: return AuthorizedPerson;
case 5: return BuyerEmployee;
case 6: return InformationCreatorBuyerEmployee;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<SignerStatus>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<SignerStatus>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<SignerStatus>() {
public SignerStatus findValueByNumber(int number) {
return SignerStatus.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.getDescriptor().getEnumTypes().get(2);
}
private static final SignerStatus[] VALUES = values();
public static SignerStatus valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private SignerStatus(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.Invoicing.Signers.SignerStatus)
}
/**
* Protobuf enum {@code Diadoc.Api.Proto.Invoicing.Signers.DocumentTitleType}
*/
public enum DocumentTitleType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>Absent = -1;</code>
*/
Absent(0, -1),
/**
* <code>UtdSeller = 0;</code>
*
* <pre>
* Данные для титула продавца УПД
* </pre>
*/
UtdSeller(1, 0),
/**
* <code>UtdBuyer = 1;</code>
*
* <pre>
* Данные для титула покупателя УПД
* </pre>
*/
UtdBuyer(2, 1),
/**
* <code>UcdSeller = 2;</code>
*
* <pre>
* Данные для титула продавца УКД
* </pre>
*/
UcdSeller(3, 2),
/**
* <code>UcdBuyer = 3;</code>
*
* <pre>
* Данные для титула покупателя УКД
* </pre>
*/
UcdBuyer(4, 3),
/**
* <code>TovTorg551Seller = 4;</code>
*
* <pre>
* Данные для титула продавца формата приказа 551
* </pre>
*/
TovTorg551Seller(5, 4),
/**
* <code>TovTorg551Buyer = 5;</code>
*
* <pre>
* Данные для титула покупателя формата приказа 551
* </pre>
*/
TovTorg551Buyer(6, 5),
/**
* <code>AccCert552Seller = 6;</code>
*
* <pre>
* Данные для титула исполнителя формата приказа 552
* </pre>
*/
AccCert552Seller(7, 6),
/**
* <code>AccCert552Buyer = 7;</code>
*
* <pre>
* Данные для титула заказчика формата приказа 552
* </pre>
*/
AccCert552Buyer(8, 7),
/**
* <code>Utd820Buyer = 8;</code>
*
* <pre>
* Данные для титула покупателя УПД формата приказа 820
* </pre>
*/
Utd820Buyer(9, 8),
/**
* <code>Torg2Buyer = 9;</code>
*
* <pre>
* Данные для титула покупателя приказа 423
* </pre>
*/
Torg2Buyer(10, 9),
/**
* <code>Torg2AdditionalInfo = 10;</code>
*
* <pre>
* Данные для титула дополнительных сведений приказа 423
* </pre>
*/
Torg2AdditionalInfo(11, 10),
;
/**
* <code>Absent = -1;</code>
*/
public static final int Absent_VALUE = -1;
/**
* <code>UtdSeller = 0;</code>
*
* <pre>
* Данные для титула продавца УПД
* </pre>
*/
public static final int UtdSeller_VALUE = 0;
/**
* <code>UtdBuyer = 1;</code>
*
* <pre>
* Данные для титула покупателя УПД
* </pre>
*/
public static final int UtdBuyer_VALUE = 1;
/**
* <code>UcdSeller = 2;</code>
*
* <pre>
* Данные для титула продавца УКД
* </pre>
*/
public static final int UcdSeller_VALUE = 2;
/**
* <code>UcdBuyer = 3;</code>
*
* <pre>
* Данные для титула покупателя УКД
* </pre>
*/
public static final int UcdBuyer_VALUE = 3;
/**
* <code>TovTorg551Seller = 4;</code>
*
* <pre>
* Данные для титула продавца формата приказа 551
* </pre>
*/
public static final int TovTorg551Seller_VALUE = 4;
/**
* <code>TovTorg551Buyer = 5;</code>
*
* <pre>
* Данные для титула покупателя формата приказа 551
* </pre>
*/
public static final int TovTorg551Buyer_VALUE = 5;
/**
* <code>AccCert552Seller = 6;</code>
*
* <pre>
* Данные для титула исполнителя формата приказа 552
* </pre>
*/
public static final int AccCert552Seller_VALUE = 6;
/**
* <code>AccCert552Buyer = 7;</code>
*
* <pre>
* Данные для титула заказчика формата приказа 552
* </pre>
*/
public static final int AccCert552Buyer_VALUE = 7;
/**
* <code>Utd820Buyer = 8;</code>
*
* <pre>
* Данные для титула покупателя УПД формата приказа 820
* </pre>
*/
public static final int Utd820Buyer_VALUE = 8;
/**
* <code>Torg2Buyer = 9;</code>
*
* <pre>
* Данные для титула покупателя приказа 423
* </pre>
*/
public static final int Torg2Buyer_VALUE = 9;
/**
* <code>Torg2AdditionalInfo = 10;</code>
*
* <pre>
* Данные для титула дополнительных сведений приказа 423
* </pre>
*/
public static final int Torg2AdditionalInfo_VALUE = 10;
public final int getNumber() { return value; }
public static DocumentTitleType valueOf(int value) {
switch (value) {
case -1: return Absent;
case 0: return UtdSeller;
case 1: return UtdBuyer;
case 2: return UcdSeller;
case 3: return UcdBuyer;
case 4: return TovTorg551Seller;
case 5: return TovTorg551Buyer;
case 6: return AccCert552Seller;
case 7: return AccCert552Buyer;
case 8: return Utd820Buyer;
case 9: return Torg2Buyer;
case 10: return Torg2AdditionalInfo;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<DocumentTitleType>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<DocumentTitleType>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<DocumentTitleType>() {
public DocumentTitleType findValueByNumber(int number) {
return DocumentTitleType.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.getDescriptor().getEnumTypes().get(3);
}
private static final DocumentTitleType[] VALUES = values();
public static DocumentTitleType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private DocumentTitleType(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.Invoicing.Signers.DocumentTitleType)
}
public interface ExtendedSignerOrBuilder extends
// @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string BoxId = 1;</code>
*/
boolean hasBoxId();
/**
* <code>optional string BoxId = 1;</code>
*/
java.lang.String getBoxId();
/**
* <code>optional string BoxId = 1;</code>
*/
com.google.protobuf.ByteString
getBoxIdBytes();
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
boolean hasSignerCertificate();
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
com.google.protobuf.ByteString getSignerCertificate();
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
boolean hasSignerCertificateThumbprint();
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
java.lang.String getSignerCertificateThumbprint();
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
com.google.protobuf.ByteString
getSignerCertificateThumbprintBytes();
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
boolean hasSignerDetails();
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails getSignerDetails();
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder getSignerDetailsOrBuilder();
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
boolean hasPowerOfAttorney();
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost getPowerOfAttorney();
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder getPowerOfAttorneyOrBuilder();
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner}
*/
public static final class ExtendedSigner extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner)
ExtendedSignerOrBuilder {
// Use ExtendedSigner.newBuilder() to construct.
private ExtendedSigner(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ExtendedSigner(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ExtendedSigner defaultInstance;
public static ExtendedSigner getDefaultInstance() {
return defaultInstance;
}
public ExtendedSigner getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExtendedSigner(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
boxId_ = bs;
break;
}
case 18: {
bitField0_ |= 0x00000002;
signerCertificate_ = input.readBytes();
break;
}
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000004;
signerCertificateThumbprint_ = bs;
break;
}
case 34: {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder subBuilder = null;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
subBuilder = signerDetails_.toBuilder();
}
signerDetails_ = input.readMessage(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(signerDetails_);
signerDetails_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000008;
break;
}
case 42: {
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder subBuilder = null;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
subBuilder = powerOfAttorney_.toBuilder();
}
powerOfAttorney_ = input.readMessage(Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(powerOfAttorney_);
powerOfAttorney_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000010;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.Builder.class);
}
public static com.google.protobuf.Parser<ExtendedSigner> PARSER =
new com.google.protobuf.AbstractParser<ExtendedSigner>() {
public ExtendedSigner parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExtendedSigner(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ExtendedSigner> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int BOXID_FIELD_NUMBER = 1;
private java.lang.Object boxId_;
/**
* <code>optional string BoxId = 1;</code>
*/
public boolean hasBoxId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string BoxId = 1;</code>
*/
public java.lang.String getBoxId() {
java.lang.Object ref = boxId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
boxId_ = s;
}
return s;
}
}
/**
* <code>optional string BoxId = 1;</code>
*/
public com.google.protobuf.ByteString
getBoxIdBytes() {
java.lang.Object ref = boxId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
boxId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERCERTIFICATE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString signerCertificate_;
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public boolean hasSignerCertificate() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public com.google.protobuf.ByteString getSignerCertificate() {
return signerCertificate_;
}
public static final int SIGNERCERTIFICATETHUMBPRINT_FIELD_NUMBER = 3;
private java.lang.Object signerCertificateThumbprint_;
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public boolean hasSignerCertificateThumbprint() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public java.lang.String getSignerCertificateThumbprint() {
java.lang.Object ref = signerCertificateThumbprint_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerCertificateThumbprint_ = s;
}
return s;
}
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public com.google.protobuf.ByteString
getSignerCertificateThumbprintBytes() {
java.lang.Object ref = signerCertificateThumbprint_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerCertificateThumbprint_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERDETAILS_FIELD_NUMBER = 4;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails signerDetails_;
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public boolean hasSignerDetails() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails getSignerDetails() {
return signerDetails_;
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder getSignerDetailsOrBuilder() {
return signerDetails_;
}
public static final int POWEROFATTORNEY_FIELD_NUMBER = 5;
private Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost powerOfAttorney_;
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public boolean hasPowerOfAttorney() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost getPowerOfAttorney() {
return powerOfAttorney_;
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder getPowerOfAttorneyOrBuilder() {
return powerOfAttorney_;
}
private void initFields() {
boxId_ = "";
signerCertificate_ = com.google.protobuf.ByteString.EMPTY;
signerCertificateThumbprint_ = "";
signerDetails_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance();
powerOfAttorney_ = Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (hasSignerDetails()) {
if (!getSignerDetails().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
if (hasPowerOfAttorney()) {
if (!getPowerOfAttorney().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getBoxIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, signerCertificate_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getSignerCertificateThumbprintBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeMessage(4, signerDetails_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeMessage(5, powerOfAttorney_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getBoxIdBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, signerCertificate_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getSignerCertificateThumbprintBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, signerDetails_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, powerOfAttorney_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner)
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.Builder.class);
}
// Construct using Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getSignerDetailsFieldBuilder();
getPowerOfAttorneyFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
boxId_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
signerCertificate_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
signerCertificateThumbprint_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
if (signerDetailsBuilder_ == null) {
signerDetails_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance();
} else {
signerDetailsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
if (powerOfAttorneyBuilder_ == null) {
powerOfAttorney_ = Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.getDefaultInstance();
} else {
powerOfAttorneyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner getDefaultInstanceForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.getDefaultInstance();
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner build() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner buildPartial() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner result = new Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.boxId_ = boxId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.signerCertificate_ = signerCertificate_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.signerCertificateThumbprint_ = signerCertificateThumbprint_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
if (signerDetailsBuilder_ == null) {
result.signerDetails_ = signerDetails_;
} else {
result.signerDetails_ = signerDetailsBuilder_.build();
}
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
if (powerOfAttorneyBuilder_ == null) {
result.powerOfAttorney_ = powerOfAttorney_;
} else {
result.powerOfAttorney_ = powerOfAttorneyBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner) {
return mergeFrom((Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner other) {
if (other == Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner.getDefaultInstance()) return this;
if (other.hasBoxId()) {
bitField0_ |= 0x00000001;
boxId_ = other.boxId_;
onChanged();
}
if (other.hasSignerCertificate()) {
setSignerCertificate(other.getSignerCertificate());
}
if (other.hasSignerCertificateThumbprint()) {
bitField0_ |= 0x00000004;
signerCertificateThumbprint_ = other.signerCertificateThumbprint_;
onChanged();
}
if (other.hasSignerDetails()) {
mergeSignerDetails(other.getSignerDetails());
}
if (other.hasPowerOfAttorney()) {
mergePowerOfAttorney(other.getPowerOfAttorney());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (hasSignerDetails()) {
if (!getSignerDetails().isInitialized()) {
return false;
}
}
if (hasPowerOfAttorney()) {
if (!getPowerOfAttorney().isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSigner) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object boxId_ = "";
/**
* <code>optional string BoxId = 1;</code>
*/
public boolean hasBoxId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string BoxId = 1;</code>
*/
public java.lang.String getBoxId() {
java.lang.Object ref = boxId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
boxId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string BoxId = 1;</code>
*/
public com.google.protobuf.ByteString
getBoxIdBytes() {
java.lang.Object ref = boxId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
boxId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string BoxId = 1;</code>
*/
public Builder setBoxId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
boxId_ = value;
onChanged();
return this;
}
/**
* <code>optional string BoxId = 1;</code>
*/
public Builder clearBoxId() {
bitField0_ = (bitField0_ & ~0x00000001);
boxId_ = getDefaultInstance().getBoxId();
onChanged();
return this;
}
/**
* <code>optional string BoxId = 1;</code>
*/
public Builder setBoxIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
boxId_ = value;
onChanged();
return this;
}
private com.google.protobuf.ByteString signerCertificate_ = com.google.protobuf.ByteString.EMPTY;
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public boolean hasSignerCertificate() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public com.google.protobuf.ByteString getSignerCertificate() {
return signerCertificate_;
}
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public Builder setSignerCertificate(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
signerCertificate_ = value;
onChanged();
return this;
}
/**
* <code>optional bytes SignerCertificate = 2;</code>
*/
public Builder clearSignerCertificate() {
bitField0_ = (bitField0_ & ~0x00000002);
signerCertificate_ = getDefaultInstance().getSignerCertificate();
onChanged();
return this;
}
private java.lang.Object signerCertificateThumbprint_ = "";
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public boolean hasSignerCertificateThumbprint() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public java.lang.String getSignerCertificateThumbprint() {
java.lang.Object ref = signerCertificateThumbprint_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerCertificateThumbprint_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public com.google.protobuf.ByteString
getSignerCertificateThumbprintBytes() {
java.lang.Object ref = signerCertificateThumbprint_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerCertificateThumbprint_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public Builder setSignerCertificateThumbprint(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
signerCertificateThumbprint_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public Builder clearSignerCertificateThumbprint() {
bitField0_ = (bitField0_ & ~0x00000004);
signerCertificateThumbprint_ = getDefaultInstance().getSignerCertificateThumbprint();
onChanged();
return this;
}
/**
* <code>optional string SignerCertificateThumbprint = 3;</code>
*/
public Builder setSignerCertificateThumbprintBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
signerCertificateThumbprint_ = value;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails signerDetails_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder> signerDetailsBuilder_;
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public boolean hasSignerDetails() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails getSignerDetails() {
if (signerDetailsBuilder_ == null) {
return signerDetails_;
} else {
return signerDetailsBuilder_.getMessage();
}
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Builder setSignerDetails(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails value) {
if (signerDetailsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
signerDetails_ = value;
onChanged();
} else {
signerDetailsBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Builder setSignerDetails(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder builderForValue) {
if (signerDetailsBuilder_ == null) {
signerDetails_ = builderForValue.build();
onChanged();
} else {
signerDetailsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Builder mergeSignerDetails(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails value) {
if (signerDetailsBuilder_ == null) {
if (((bitField0_ & 0x00000008) == 0x00000008) &&
signerDetails_ != Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance()) {
signerDetails_ =
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.newBuilder(signerDetails_).mergeFrom(value).buildPartial();
} else {
signerDetails_ = value;
}
onChanged();
} else {
signerDetailsBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000008;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Builder clearSignerDetails() {
if (signerDetailsBuilder_ == null) {
signerDetails_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance();
onChanged();
} else {
signerDetailsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder getSignerDetailsBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getSignerDetailsFieldBuilder().getBuilder();
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder getSignerDetailsOrBuilder() {
if (signerDetailsBuilder_ != null) {
return signerDetailsBuilder_.getMessageOrBuilder();
} else {
return signerDetails_;
}
}
/**
* <code>optional .Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails SignerDetails = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder>
getSignerDetailsFieldBuilder() {
if (signerDetailsBuilder_ == null) {
signerDetailsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder>(
getSignerDetails(),
getParentForChildren(),
isClean());
signerDetails_ = null;
}
return signerDetailsBuilder_;
}
private Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost powerOfAttorney_ = Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder> powerOfAttorneyBuilder_;
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public boolean hasPowerOfAttorney() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost getPowerOfAttorney() {
if (powerOfAttorneyBuilder_ == null) {
return powerOfAttorney_;
} else {
return powerOfAttorneyBuilder_.getMessage();
}
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Builder setPowerOfAttorney(Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost value) {
if (powerOfAttorneyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
powerOfAttorney_ = value;
onChanged();
} else {
powerOfAttorneyBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Builder setPowerOfAttorney(
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder builderForValue) {
if (powerOfAttorneyBuilder_ == null) {
powerOfAttorney_ = builderForValue.build();
onChanged();
} else {
powerOfAttorneyBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Builder mergePowerOfAttorney(Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost value) {
if (powerOfAttorneyBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010) &&
powerOfAttorney_ != Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.getDefaultInstance()) {
powerOfAttorney_ =
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.newBuilder(powerOfAttorney_).mergeFrom(value).buildPartial();
} else {
powerOfAttorney_ = value;
}
onChanged();
} else {
powerOfAttorneyBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000010;
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Builder clearPowerOfAttorney() {
if (powerOfAttorneyBuilder_ == null) {
powerOfAttorney_ = Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.getDefaultInstance();
onChanged();
} else {
powerOfAttorneyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder getPowerOfAttorneyBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getPowerOfAttorneyFieldBuilder().getBuilder();
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
public Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder getPowerOfAttorneyOrBuilder() {
if (powerOfAttorneyBuilder_ != null) {
return powerOfAttorneyBuilder_.getMessageOrBuilder();
} else {
return powerOfAttorney_;
}
}
/**
* <code>optional .Diadoc.Api.Proto.Events.PowerOfAttorneyToPost PowerOfAttorney = 5;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder>
getPowerOfAttorneyFieldBuilder() {
if (powerOfAttorneyBuilder_ == null) {
powerOfAttorneyBuilder_ = new com.google.protobuf.SingleFieldBuilder<
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPost.Builder, Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.PowerOfAttorneyToPostOrBuilder>(
getPowerOfAttorney(),
getParentForChildren(),
isClean());
powerOfAttorney_ = null;
}
return powerOfAttorneyBuilder_;
}
// @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner)
}
static {
defaultInstance = new ExtendedSigner(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSigner)
}
public interface ExtendedSignerDetailsOrBuilder extends
// @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required string Surname = 1;</code>
*/
boolean hasSurname();
/**
* <code>required string Surname = 1;</code>
*/
java.lang.String getSurname();
/**
* <code>required string Surname = 1;</code>
*/
com.google.protobuf.ByteString
getSurnameBytes();
/**
* <code>required string FirstName = 2;</code>
*/
boolean hasFirstName();
/**
* <code>required string FirstName = 2;</code>
*/
java.lang.String getFirstName();
/**
* <code>required string FirstName = 2;</code>
*/
com.google.protobuf.ByteString
getFirstNameBytes();
/**
* <code>optional string Patronymic = 3;</code>
*/
boolean hasPatronymic();
/**
* <code>optional string Patronymic = 3;</code>
*/
java.lang.String getPatronymic();
/**
* <code>optional string Patronymic = 3;</code>
*/
com.google.protobuf.ByteString
getPatronymicBytes();
/**
* <code>optional string JobTitle = 4;</code>
*/
boolean hasJobTitle();
/**
* <code>optional string JobTitle = 4;</code>
*/
java.lang.String getJobTitle();
/**
* <code>optional string JobTitle = 4;</code>
*/
com.google.protobuf.ByteString
getJobTitleBytes();
/**
* <code>optional string Inn = 5;</code>
*/
boolean hasInn();
/**
* <code>optional string Inn = 5;</code>
*/
java.lang.String getInn();
/**
* <code>optional string Inn = 5;</code>
*/
com.google.protobuf.ByteString
getInnBytes();
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
boolean hasRegistrationCertificate();
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
java.lang.String getRegistrationCertificate();
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
com.google.protobuf.ByteString
getRegistrationCertificateBytes();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
boolean hasSignerType();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType();
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
boolean hasSignerOrganizationName();
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
java.lang.String getSignerOrganizationName();
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
com.google.protobuf.ByteString
getSignerOrganizationNameBytes();
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
boolean hasSignerInfo();
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
java.lang.String getSignerInfo();
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
com.google.protobuf.ByteString
getSignerInfoBytes();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
boolean hasSignerPowers();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
boolean hasSignerStatus();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus();
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
boolean hasSignerPowersBase();
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
java.lang.String getSignerPowersBase();
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
com.google.protobuf.ByteString
getSignerPowersBaseBytes();
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
boolean hasSignerOrgPowersBase();
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
java.lang.String getSignerOrgPowersBase();
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes();
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails}
*/
public static final class ExtendedSignerDetails extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails)
ExtendedSignerDetailsOrBuilder {
// Use ExtendedSignerDetails.newBuilder() to construct.
private ExtendedSignerDetails(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ExtendedSignerDetails(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ExtendedSignerDetails defaultInstance;
public static ExtendedSignerDetails getDefaultInstance() {
return defaultInstance;
}
public ExtendedSignerDetails getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExtendedSignerDetails(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
surname_ = bs;
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
firstName_ = bs;
break;
}
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000004;
patronymic_ = bs;
break;
}
case 34: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000008;
jobTitle_ = bs;
break;
}
case 42: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000010;
inn_ = bs;
break;
}
case 50: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000020;
registrationCertificate_ = bs;
break;
}
case 56: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(7, rawValue);
} else {
bitField0_ |= 0x00000040;
signerType_ = value;
}
break;
}
case 66: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000080;
signerOrganizationName_ = bs;
break;
}
case 74: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000100;
signerInfo_ = bs;
break;
}
case 80: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(10, rawValue);
} else {
bitField0_ |= 0x00000200;
signerPowers_ = value;
}
break;
}
case 88: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(11, rawValue);
} else {
bitField0_ |= 0x00000400;
signerStatus_ = value;
}
break;
}
case 98: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000800;
signerPowersBase_ = bs;
break;
}
case 106: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00001000;
signerOrgPowersBase_ = bs;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder.class);
}
public static com.google.protobuf.Parser<ExtendedSignerDetails> PARSER =
new com.google.protobuf.AbstractParser<ExtendedSignerDetails>() {
public ExtendedSignerDetails parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExtendedSignerDetails(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ExtendedSignerDetails> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int SURNAME_FIELD_NUMBER = 1;
private java.lang.Object surname_;
/**
* <code>required string Surname = 1;</code>
*/
public boolean hasSurname() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string Surname = 1;</code>
*/
public java.lang.String getSurname() {
java.lang.Object ref = surname_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
surname_ = s;
}
return s;
}
}
/**
* <code>required string Surname = 1;</code>
*/
public com.google.protobuf.ByteString
getSurnameBytes() {
java.lang.Object ref = surname_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
surname_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FIRSTNAME_FIELD_NUMBER = 2;
private java.lang.Object firstName_;
/**
* <code>required string FirstName = 2;</code>
*/
public boolean hasFirstName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string FirstName = 2;</code>
*/
public java.lang.String getFirstName() {
java.lang.Object ref = firstName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
firstName_ = s;
}
return s;
}
}
/**
* <code>required string FirstName = 2;</code>
*/
public com.google.protobuf.ByteString
getFirstNameBytes() {
java.lang.Object ref = firstName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
firstName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PATRONYMIC_FIELD_NUMBER = 3;
private java.lang.Object patronymic_;
/**
* <code>optional string Patronymic = 3;</code>
*/
public boolean hasPatronymic() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public java.lang.String getPatronymic() {
java.lang.Object ref = patronymic_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
patronymic_ = s;
}
return s;
}
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public com.google.protobuf.ByteString
getPatronymicBytes() {
java.lang.Object ref = patronymic_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
patronymic_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int JOBTITLE_FIELD_NUMBER = 4;
private java.lang.Object jobTitle_;
/**
* <code>optional string JobTitle = 4;</code>
*/
public boolean hasJobTitle() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public java.lang.String getJobTitle() {
java.lang.Object ref = jobTitle_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
jobTitle_ = s;
}
return s;
}
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public com.google.protobuf.ByteString
getJobTitleBytes() {
java.lang.Object ref = jobTitle_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
jobTitle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int INN_FIELD_NUMBER = 5;
private java.lang.Object inn_;
/**
* <code>optional string Inn = 5;</code>
*/
public boolean hasInn() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string Inn = 5;</code>
*/
public java.lang.String getInn() {
java.lang.Object ref = inn_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
inn_ = s;
}
return s;
}
}
/**
* <code>optional string Inn = 5;</code>
*/
public com.google.protobuf.ByteString
getInnBytes() {
java.lang.Object ref = inn_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
inn_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REGISTRATIONCERTIFICATE_FIELD_NUMBER = 6;
private java.lang.Object registrationCertificate_;
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public boolean hasRegistrationCertificate() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public java.lang.String getRegistrationCertificate() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
registrationCertificate_ = s;
}
return s;
}
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public com.google.protobuf.ByteString
getRegistrationCertificateBytes() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
registrationCertificate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERTYPE_FIELD_NUMBER = 7;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType signerType_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public boolean hasSignerType() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType() {
return signerType_;
}
public static final int SIGNERORGANIZATIONNAME_FIELD_NUMBER = 8;
private java.lang.Object signerOrganizationName_;
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public boolean hasSignerOrganizationName() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public java.lang.String getSignerOrganizationName() {
java.lang.Object ref = signerOrganizationName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrganizationName_ = s;
}
return s;
}
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrganizationNameBytes() {
java.lang.Object ref = signerOrganizationName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrganizationName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERINFO_FIELD_NUMBER = 9;
private java.lang.Object signerInfo_;
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public boolean hasSignerInfo() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public java.lang.String getSignerInfo() {
java.lang.Object ref = signerInfo_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerInfo_ = s;
}
return s;
}
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerInfoBytes() {
java.lang.Object ref = signerInfo_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerInfo_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERPOWERS_FIELD_NUMBER = 10;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers signerPowers_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public boolean hasSignerPowers() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers() {
return signerPowers_;
}
public static final int SIGNERSTATUS_FIELD_NUMBER = 11;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus signerStatus_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public boolean hasSignerStatus() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus() {
return signerStatus_;
}
public static final int SIGNERPOWERSBASE_FIELD_NUMBER = 12;
private java.lang.Object signerPowersBase_;
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public boolean hasSignerPowersBase() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public java.lang.String getSignerPowersBase() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerPowersBase_ = s;
}
return s;
}
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerPowersBaseBytes() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERORGPOWERSBASE_FIELD_NUMBER = 13;
private java.lang.Object signerOrgPowersBase_;
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public boolean hasSignerOrgPowersBase() {
return ((bitField0_ & 0x00001000) == 0x00001000);
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public java.lang.String getSignerOrgPowersBase() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrgPowersBase_ = s;
}
return s;
}
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrgPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
surname_ = "";
firstName_ = "";
patronymic_ = "";
jobTitle_ = "";
inn_ = "";
registrationCertificate_ = "";
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
signerOrganizationName_ = "";
signerInfo_ = "";
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
signerPowersBase_ = "";
signerOrgPowersBase_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasSurname()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasFirstName()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSignerType()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSignerPowers()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSignerStatus()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getSurnameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getFirstNameBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getPatronymicBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getJobTitleBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(5, getInnBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBytes(6, getRegistrationCertificateBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeEnum(7, signerType_.getNumber());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeBytes(8, getSignerOrganizationNameBytes());
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeBytes(9, getSignerInfoBytes());
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeEnum(10, signerPowers_.getNumber());
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
output.writeEnum(11, signerStatus_.getNumber());
}
if (((bitField0_ & 0x00000800) == 0x00000800)) {
output.writeBytes(12, getSignerPowersBaseBytes());
}
if (((bitField0_ & 0x00001000) == 0x00001000)) {
output.writeBytes(13, getSignerOrgPowersBaseBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getSurnameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getFirstNameBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getPatronymicBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getJobTitleBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getInnBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(6, getRegistrationCertificateBytes());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(7, signerType_.getNumber());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(8, getSignerOrganizationNameBytes());
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(9, getSignerInfoBytes());
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(10, signerPowers_.getNumber());
}
if (((bitField0_ & 0x00000400) == 0x00000400)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(11, signerStatus_.getNumber());
}
if (((bitField0_ & 0x00000800) == 0x00000800)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(12, getSignerPowersBaseBytes());
}
if (((bitField0_ & 0x00001000) == 0x00001000)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(13, getSignerOrgPowersBaseBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails)
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.Builder.class);
}
// Construct using Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
surname_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
firstName_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
patronymic_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
jobTitle_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
inn_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
registrationCertificate_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
bitField0_ = (bitField0_ & ~0x00000040);
signerOrganizationName_ = "";
bitField0_ = (bitField0_ & ~0x00000080);
signerInfo_ = "";
bitField0_ = (bitField0_ & ~0x00000100);
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
bitField0_ = (bitField0_ & ~0x00000200);
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
bitField0_ = (bitField0_ & ~0x00000400);
signerPowersBase_ = "";
bitField0_ = (bitField0_ & ~0x00000800);
signerOrgPowersBase_ = "";
bitField0_ = (bitField0_ & ~0x00001000);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails getDefaultInstanceForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance();
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails build() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails buildPartial() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails result = new Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.surname_ = surname_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.firstName_ = firstName_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.patronymic_ = patronymic_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.jobTitle_ = jobTitle_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.inn_ = inn_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.registrationCertificate_ = registrationCertificate_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.signerType_ = signerType_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.signerOrganizationName_ = signerOrganizationName_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000100;
}
result.signerInfo_ = signerInfo_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000200;
}
result.signerPowers_ = signerPowers_;
if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
to_bitField0_ |= 0x00000400;
}
result.signerStatus_ = signerStatus_;
if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
to_bitField0_ |= 0x00000800;
}
result.signerPowersBase_ = signerPowersBase_;
if (((from_bitField0_ & 0x00001000) == 0x00001000)) {
to_bitField0_ |= 0x00001000;
}
result.signerOrgPowersBase_ = signerOrgPowersBase_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails) {
return mergeFrom((Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails other) {
if (other == Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails.getDefaultInstance()) return this;
if (other.hasSurname()) {
bitField0_ |= 0x00000001;
surname_ = other.surname_;
onChanged();
}
if (other.hasFirstName()) {
bitField0_ |= 0x00000002;
firstName_ = other.firstName_;
onChanged();
}
if (other.hasPatronymic()) {
bitField0_ |= 0x00000004;
patronymic_ = other.patronymic_;
onChanged();
}
if (other.hasJobTitle()) {
bitField0_ |= 0x00000008;
jobTitle_ = other.jobTitle_;
onChanged();
}
if (other.hasInn()) {
bitField0_ |= 0x00000010;
inn_ = other.inn_;
onChanged();
}
if (other.hasRegistrationCertificate()) {
bitField0_ |= 0x00000020;
registrationCertificate_ = other.registrationCertificate_;
onChanged();
}
if (other.hasSignerType()) {
setSignerType(other.getSignerType());
}
if (other.hasSignerOrganizationName()) {
bitField0_ |= 0x00000080;
signerOrganizationName_ = other.signerOrganizationName_;
onChanged();
}
if (other.hasSignerInfo()) {
bitField0_ |= 0x00000100;
signerInfo_ = other.signerInfo_;
onChanged();
}
if (other.hasSignerPowers()) {
setSignerPowers(other.getSignerPowers());
}
if (other.hasSignerStatus()) {
setSignerStatus(other.getSignerStatus());
}
if (other.hasSignerPowersBase()) {
bitField0_ |= 0x00000800;
signerPowersBase_ = other.signerPowersBase_;
onChanged();
}
if (other.hasSignerOrgPowersBase()) {
bitField0_ |= 0x00001000;
signerOrgPowersBase_ = other.signerOrgPowersBase_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasSurname()) {
return false;
}
if (!hasFirstName()) {
return false;
}
if (!hasSignerType()) {
return false;
}
if (!hasSignerPowers()) {
return false;
}
if (!hasSignerStatus()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetails) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object surname_ = "";
/**
* <code>required string Surname = 1;</code>
*/
public boolean hasSurname() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string Surname = 1;</code>
*/
public java.lang.String getSurname() {
java.lang.Object ref = surname_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
surname_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string Surname = 1;</code>
*/
public com.google.protobuf.ByteString
getSurnameBytes() {
java.lang.Object ref = surname_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
surname_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string Surname = 1;</code>
*/
public Builder setSurname(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
surname_ = value;
onChanged();
return this;
}
/**
* <code>required string Surname = 1;</code>
*/
public Builder clearSurname() {
bitField0_ = (bitField0_ & ~0x00000001);
surname_ = getDefaultInstance().getSurname();
onChanged();
return this;
}
/**
* <code>required string Surname = 1;</code>
*/
public Builder setSurnameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
surname_ = value;
onChanged();
return this;
}
private java.lang.Object firstName_ = "";
/**
* <code>required string FirstName = 2;</code>
*/
public boolean hasFirstName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string FirstName = 2;</code>
*/
public java.lang.String getFirstName() {
java.lang.Object ref = firstName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
firstName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string FirstName = 2;</code>
*/
public com.google.protobuf.ByteString
getFirstNameBytes() {
java.lang.Object ref = firstName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
firstName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string FirstName = 2;</code>
*/
public Builder setFirstName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
firstName_ = value;
onChanged();
return this;
}
/**
* <code>required string FirstName = 2;</code>
*/
public Builder clearFirstName() {
bitField0_ = (bitField0_ & ~0x00000002);
firstName_ = getDefaultInstance().getFirstName();
onChanged();
return this;
}
/**
* <code>required string FirstName = 2;</code>
*/
public Builder setFirstNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
firstName_ = value;
onChanged();
return this;
}
private java.lang.Object patronymic_ = "";
/**
* <code>optional string Patronymic = 3;</code>
*/
public boolean hasPatronymic() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public java.lang.String getPatronymic() {
java.lang.Object ref = patronymic_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
patronymic_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public com.google.protobuf.ByteString
getPatronymicBytes() {
java.lang.Object ref = patronymic_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
patronymic_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public Builder setPatronymic(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
patronymic_ = value;
onChanged();
return this;
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public Builder clearPatronymic() {
bitField0_ = (bitField0_ & ~0x00000004);
patronymic_ = getDefaultInstance().getPatronymic();
onChanged();
return this;
}
/**
* <code>optional string Patronymic = 3;</code>
*/
public Builder setPatronymicBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
patronymic_ = value;
onChanged();
return this;
}
private java.lang.Object jobTitle_ = "";
/**
* <code>optional string JobTitle = 4;</code>
*/
public boolean hasJobTitle() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public java.lang.String getJobTitle() {
java.lang.Object ref = jobTitle_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
jobTitle_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public com.google.protobuf.ByteString
getJobTitleBytes() {
java.lang.Object ref = jobTitle_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
jobTitle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public Builder setJobTitle(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
jobTitle_ = value;
onChanged();
return this;
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public Builder clearJobTitle() {
bitField0_ = (bitField0_ & ~0x00000008);
jobTitle_ = getDefaultInstance().getJobTitle();
onChanged();
return this;
}
/**
* <code>optional string JobTitle = 4;</code>
*/
public Builder setJobTitleBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
jobTitle_ = value;
onChanged();
return this;
}
private java.lang.Object inn_ = "";
/**
* <code>optional string Inn = 5;</code>
*/
public boolean hasInn() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional string Inn = 5;</code>
*/
public java.lang.String getInn() {
java.lang.Object ref = inn_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
inn_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string Inn = 5;</code>
*/
public com.google.protobuf.ByteString
getInnBytes() {
java.lang.Object ref = inn_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
inn_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string Inn = 5;</code>
*/
public Builder setInn(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
inn_ = value;
onChanged();
return this;
}
/**
* <code>optional string Inn = 5;</code>
*/
public Builder clearInn() {
bitField0_ = (bitField0_ & ~0x00000010);
inn_ = getDefaultInstance().getInn();
onChanged();
return this;
}
/**
* <code>optional string Inn = 5;</code>
*/
public Builder setInnBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
inn_ = value;
onChanged();
return this;
}
private java.lang.Object registrationCertificate_ = "";
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public boolean hasRegistrationCertificate() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public java.lang.String getRegistrationCertificate() {
java.lang.Object ref = registrationCertificate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
registrationCertificate_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public com.google.protobuf.ByteString
getRegistrationCertificateBytes() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
registrationCertificate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public Builder setRegistrationCertificate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
registrationCertificate_ = value;
onChanged();
return this;
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public Builder clearRegistrationCertificate() {
bitField0_ = (bitField0_ & ~0x00000020);
registrationCertificate_ = getDefaultInstance().getRegistrationCertificate();
onChanged();
return this;
}
/**
* <code>optional string RegistrationCertificate = 6;</code>
*/
public Builder setRegistrationCertificateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
registrationCertificate_ = value;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public boolean hasSignerType() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType() {
return signerType_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Builder setSignerType(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
signerType_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 7 [default = LegalEntity];</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Builder clearSignerType() {
bitField0_ = (bitField0_ & ~0x00000040);
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
onChanged();
return this;
}
private java.lang.Object signerOrganizationName_ = "";
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public boolean hasSignerOrganizationName() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public java.lang.String getSignerOrganizationName() {
java.lang.Object ref = signerOrganizationName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrganizationName_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrganizationNameBytes() {
java.lang.Object ref = signerOrganizationName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrganizationName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public Builder setSignerOrganizationName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
signerOrganizationName_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public Builder clearSignerOrganizationName() {
bitField0_ = (bitField0_ & ~0x00000080);
signerOrganizationName_ = getDefaultInstance().getSignerOrganizationName();
onChanged();
return this;
}
/**
* <code>optional string SignerOrganizationName = 8;</code>
*
* <pre>
* Наименование (НаимОрг)
* </pre>
*/
public Builder setSignerOrganizationNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
signerOrganizationName_ = value;
onChanged();
return this;
}
private java.lang.Object signerInfo_ = "";
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public boolean hasSignerInfo() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public java.lang.String getSignerInfo() {
java.lang.Object ref = signerInfo_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerInfo_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerInfoBytes() {
java.lang.Object ref = signerInfo_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerInfo_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public Builder setSignerInfo(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000100;
signerInfo_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public Builder clearSignerInfo() {
bitField0_ = (bitField0_ & ~0x00000100);
signerInfo_ = getDefaultInstance().getSignerInfo();
onChanged();
return this;
}
/**
* <code>optional string SignerInfo = 9;</code>
*
* <pre>
* Иные сведения, идентифицирующие физическое лицо (ИныеСвед)
* </pre>
*/
public Builder setSignerInfoBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000100;
signerInfo_ = value;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public boolean hasSignerPowers() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers() {
return signerPowers_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Builder setSignerPowers(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
signerPowers_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 10;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Builder clearSignerPowers() {
bitField0_ = (bitField0_ & ~0x00000200);
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public boolean hasSignerStatus() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus() {
return signerStatus_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Builder setSignerStatus(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000400;
signerStatus_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 11;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Builder clearSignerStatus() {
bitField0_ = (bitField0_ & ~0x00000400);
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
onChanged();
return this;
}
private java.lang.Object signerPowersBase_ = "";
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public boolean hasSignerPowersBase() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public java.lang.String getSignerPowersBase() {
java.lang.Object ref = signerPowersBase_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerPowersBase_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerPowersBaseBytes() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder setSignerPowersBase(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000800;
signerPowersBase_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder clearSignerPowersBase() {
bitField0_ = (bitField0_ & ~0x00000800);
signerPowersBase_ = getDefaultInstance().getSignerPowersBase();
onChanged();
return this;
}
/**
* <code>optional string SignerPowersBase = 12;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder setSignerPowersBaseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000800;
signerPowersBase_ = value;
onChanged();
return this;
}
private java.lang.Object signerOrgPowersBase_ = "";
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public boolean hasSignerOrgPowersBase() {
return ((bitField0_ & 0x00001000) == 0x00001000);
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public java.lang.String getSignerOrgPowersBase() {
java.lang.Object ref = signerOrgPowersBase_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrgPowersBase_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrgPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder setSignerOrgPowersBase(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00001000;
signerOrgPowersBase_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder clearSignerOrgPowersBase() {
bitField0_ = (bitField0_ & ~0x00001000);
signerOrgPowersBase_ = getDefaultInstance().getSignerOrgPowersBase();
onChanged();
return this;
}
/**
* <code>optional string SignerOrgPowersBase = 13;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder setSignerOrgPowersBaseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00001000;
signerOrgPowersBase_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails)
}
static {
defaultInstance = new ExtendedSignerDetails(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetails)
}
public interface ExtendedSignerDetailsToPostOrBuilder extends
// @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string JobTitle = 1;</code>
*/
boolean hasJobTitle();
/**
* <code>optional string JobTitle = 1;</code>
*/
java.lang.String getJobTitle();
/**
* <code>optional string JobTitle = 1;</code>
*/
com.google.protobuf.ByteString
getJobTitleBytes();
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
boolean hasRegistrationCertificate();
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
java.lang.String getRegistrationCertificate();
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
com.google.protobuf.ByteString
getRegistrationCertificateBytes();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
boolean hasSignerType();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType();
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
boolean hasSignerInfo();
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
java.lang.String getSignerInfo();
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
com.google.protobuf.ByteString
getSignerInfoBytes();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
boolean hasSignerPowers();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
boolean hasSignerStatus();
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus();
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
boolean hasSignerPowersBase();
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
java.lang.String getSignerPowersBase();
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
com.google.protobuf.ByteString
getSignerPowersBaseBytes();
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
boolean hasSignerOrgPowersBase();
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
java.lang.String getSignerOrgPowersBase();
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes();
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost}
*/
public static final class ExtendedSignerDetailsToPost extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost)
ExtendedSignerDetailsToPostOrBuilder {
// Use ExtendedSignerDetailsToPost.newBuilder() to construct.
private ExtendedSignerDetailsToPost(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ExtendedSignerDetailsToPost(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ExtendedSignerDetailsToPost defaultInstance;
public static ExtendedSignerDetailsToPost getDefaultInstance() {
return defaultInstance;
}
public ExtendedSignerDetailsToPost getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExtendedSignerDetailsToPost(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
jobTitle_ = bs;
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
registrationCertificate_ = bs;
break;
}
case 24: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(3, rawValue);
} else {
bitField0_ |= 0x00000004;
signerType_ = value;
}
break;
}
case 34: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000008;
signerInfo_ = bs;
break;
}
case 40: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(5, rawValue);
} else {
bitField0_ |= 0x00000010;
signerPowers_ = value;
}
break;
}
case 48: {
int rawValue = input.readEnum();
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus value = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(6, rawValue);
} else {
bitField0_ |= 0x00000020;
signerStatus_ = value;
}
break;
}
case 58: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000040;
signerPowersBase_ = bs;
break;
}
case 66: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000080;
signerOrgPowersBase_ = bs;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.Builder.class);
}
public static com.google.protobuf.Parser<ExtendedSignerDetailsToPost> PARSER =
new com.google.protobuf.AbstractParser<ExtendedSignerDetailsToPost>() {
public ExtendedSignerDetailsToPost parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExtendedSignerDetailsToPost(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<ExtendedSignerDetailsToPost> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int JOBTITLE_FIELD_NUMBER = 1;
private java.lang.Object jobTitle_;
/**
* <code>optional string JobTitle = 1;</code>
*/
public boolean hasJobTitle() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public java.lang.String getJobTitle() {
java.lang.Object ref = jobTitle_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
jobTitle_ = s;
}
return s;
}
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public com.google.protobuf.ByteString
getJobTitleBytes() {
java.lang.Object ref = jobTitle_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
jobTitle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REGISTRATIONCERTIFICATE_FIELD_NUMBER = 2;
private java.lang.Object registrationCertificate_;
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public boolean hasRegistrationCertificate() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public java.lang.String getRegistrationCertificate() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
registrationCertificate_ = s;
}
return s;
}
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public com.google.protobuf.ByteString
getRegistrationCertificateBytes() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
registrationCertificate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERTYPE_FIELD_NUMBER = 3;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType signerType_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public boolean hasSignerType() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType() {
return signerType_;
}
public static final int SIGNERINFO_FIELD_NUMBER = 4;
private java.lang.Object signerInfo_;
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public boolean hasSignerInfo() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public java.lang.String getSignerInfo() {
java.lang.Object ref = signerInfo_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerInfo_ = s;
}
return s;
}
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerInfoBytes() {
java.lang.Object ref = signerInfo_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerInfo_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERPOWERS_FIELD_NUMBER = 5;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers signerPowers_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public boolean hasSignerPowers() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers() {
return signerPowers_;
}
public static final int SIGNERSTATUS_FIELD_NUMBER = 6;
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus signerStatus_;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public boolean hasSignerStatus() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus() {
return signerStatus_;
}
public static final int SIGNERPOWERSBASE_FIELD_NUMBER = 7;
private java.lang.Object signerPowersBase_;
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public boolean hasSignerPowersBase() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public java.lang.String getSignerPowersBase() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerPowersBase_ = s;
}
return s;
}
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerPowersBaseBytes() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SIGNERORGPOWERSBASE_FIELD_NUMBER = 8;
private java.lang.Object signerOrgPowersBase_;
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public boolean hasSignerOrgPowersBase() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public java.lang.String getSignerOrgPowersBase() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrgPowersBase_ = s;
}
return s;
}
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrgPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
jobTitle_ = "";
registrationCertificate_ = "";
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
signerInfo_ = "";
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
signerPowersBase_ = "";
signerOrgPowersBase_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasSignerType()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSignerPowers()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSignerStatus()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getJobTitleBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getRegistrationCertificateBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeEnum(3, signerType_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getSignerInfoBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeEnum(5, signerPowers_.getNumber());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeEnum(6, signerStatus_.getNumber());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBytes(7, getSignerPowersBaseBytes());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeBytes(8, getSignerOrgPowersBaseBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getJobTitleBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getRegistrationCertificateBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, signerType_.getNumber());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getSignerInfoBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, signerPowers_.getNumber());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(6, signerStatus_.getNumber());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(7, getSignerPowersBaseBytes());
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(8, getSignerOrgPowersBaseBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost)
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPostOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_fieldAccessorTable
.ensureFieldAccessorsInitialized(
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.class, Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.Builder.class);
}
// Construct using Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
jobTitle_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
registrationCertificate_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
bitField0_ = (bitField0_ & ~0x00000004);
signerInfo_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
bitField0_ = (bitField0_ & ~0x00000010);
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
bitField0_ = (bitField0_ & ~0x00000020);
signerPowersBase_ = "";
bitField0_ = (bitField0_ & ~0x00000040);
signerOrgPowersBase_ = "";
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost getDefaultInstanceForType() {
return Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.getDefaultInstance();
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost build() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost buildPartial() {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost result = new Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.jobTitle_ = jobTitle_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.registrationCertificate_ = registrationCertificate_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.signerType_ = signerType_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.signerInfo_ = signerInfo_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.signerPowers_ = signerPowers_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.signerStatus_ = signerStatus_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.signerPowersBase_ = signerPowersBase_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.signerOrgPowersBase_ = signerOrgPowersBase_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost) {
return mergeFrom((Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost other) {
if (other == Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost.getDefaultInstance()) return this;
if (other.hasJobTitle()) {
bitField0_ |= 0x00000001;
jobTitle_ = other.jobTitle_;
onChanged();
}
if (other.hasRegistrationCertificate()) {
bitField0_ |= 0x00000002;
registrationCertificate_ = other.registrationCertificate_;
onChanged();
}
if (other.hasSignerType()) {
setSignerType(other.getSignerType());
}
if (other.hasSignerInfo()) {
bitField0_ |= 0x00000008;
signerInfo_ = other.signerInfo_;
onChanged();
}
if (other.hasSignerPowers()) {
setSignerPowers(other.getSignerPowers());
}
if (other.hasSignerStatus()) {
setSignerStatus(other.getSignerStatus());
}
if (other.hasSignerPowersBase()) {
bitField0_ |= 0x00000040;
signerPowersBase_ = other.signerPowersBase_;
onChanged();
}
if (other.hasSignerOrgPowersBase()) {
bitField0_ |= 0x00000080;
signerOrgPowersBase_ = other.signerOrgPowersBase_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasSignerType()) {
return false;
}
if (!hasSignerPowers()) {
return false;
}
if (!hasSignerStatus()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.ExtendedSignerDetailsToPost) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object jobTitle_ = "";
/**
* <code>optional string JobTitle = 1;</code>
*/
public boolean hasJobTitle() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public java.lang.String getJobTitle() {
java.lang.Object ref = jobTitle_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
jobTitle_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public com.google.protobuf.ByteString
getJobTitleBytes() {
java.lang.Object ref = jobTitle_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
jobTitle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public Builder setJobTitle(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
jobTitle_ = value;
onChanged();
return this;
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public Builder clearJobTitle() {
bitField0_ = (bitField0_ & ~0x00000001);
jobTitle_ = getDefaultInstance().getJobTitle();
onChanged();
return this;
}
/**
* <code>optional string JobTitle = 1;</code>
*/
public Builder setJobTitleBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
jobTitle_ = value;
onChanged();
return this;
}
private java.lang.Object registrationCertificate_ = "";
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public boolean hasRegistrationCertificate() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public java.lang.String getRegistrationCertificate() {
java.lang.Object ref = registrationCertificate_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
registrationCertificate_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public com.google.protobuf.ByteString
getRegistrationCertificateBytes() {
java.lang.Object ref = registrationCertificate_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
registrationCertificate_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public Builder setRegistrationCertificate(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
registrationCertificate_ = value;
onChanged();
return this;
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public Builder clearRegistrationCertificate() {
bitField0_ = (bitField0_ & ~0x00000002);
registrationCertificate_ = getDefaultInstance().getRegistrationCertificate();
onChanged();
return this;
}
/**
* <code>optional string RegistrationCertificate = 2;</code>
*/
public Builder setRegistrationCertificateBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
registrationCertificate_ = value;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public boolean hasSignerType() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType getSignerType() {
return signerType_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Builder setSignerType(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
signerType_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerType SignerType = 3;</code>
*
* <pre>
* Физическое лицо-Индивидуальный предприниматель – представитель юридического лица (ФЛ-ИП-ЮЛ)
* </pre>
*/
public Builder clearSignerType() {
bitField0_ = (bitField0_ & ~0x00000004);
signerType_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerType.LegalEntity;
onChanged();
return this;
}
private java.lang.Object signerInfo_ = "";
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public boolean hasSignerInfo() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public java.lang.String getSignerInfo() {
java.lang.Object ref = signerInfo_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerInfo_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerInfoBytes() {
java.lang.Object ref = signerInfo_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerInfo_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public Builder setSignerInfo(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
signerInfo_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public Builder clearSignerInfo() {
bitField0_ = (bitField0_ & ~0x00000008);
signerInfo_ = getDefaultInstance().getSignerInfo();
onChanged();
return this;
}
/**
* <code>optional string SignerInfo = 4;</code>
*
* <pre>
* Иные сведения, идентифицирующие лицо (Юл.ИныеСвед или СвИП.ИныеСвед или ФЛ.ИныеСвед)
* </pre>
*/
public Builder setSignerInfoBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
signerInfo_ = value;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public boolean hasSignerPowers() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers getSignerPowers() {
return signerPowers_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Builder setSignerPowers(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
signerPowers_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerPowers SignerPowers = 5;</code>
*
* <pre>
* Область полномочий (ОблПолн)
* </pre>
*/
public Builder clearSignerPowers() {
bitField0_ = (bitField0_ & ~0x00000010);
signerPowers_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerPowers.InvoiceSigner;
onChanged();
return this;
}
private Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public boolean hasSignerStatus() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus getSignerStatus() {
return signerStatus_;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Builder setSignerStatus(Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
signerStatus_ = value;
onChanged();
return this;
}
/**
* <code>required .Diadoc.Api.Proto.Invoicing.Signers.SignerStatus SignerStatus = 6;</code>
*
* <pre>
* Статус (Статус)
* </pre>
*/
public Builder clearSignerStatus() {
bitField0_ = (bitField0_ & ~0x00000020);
signerStatus_ = Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerProtos.SignerStatus.SellerEmployee;
onChanged();
return this;
}
private java.lang.Object signerPowersBase_ = "";
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public boolean hasSignerPowersBase() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public java.lang.String getSignerPowersBase() {
java.lang.Object ref = signerPowersBase_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerPowersBase_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerPowersBaseBytes() {
java.lang.Object ref = signerPowersBase_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder setSignerPowersBase(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
signerPowersBase_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder clearSignerPowersBase() {
bitField0_ = (bitField0_ & ~0x00000040);
signerPowersBase_ = getDefaultInstance().getSignerPowersBase();
onChanged();
return this;
}
/**
* <code>optional string SignerPowersBase = 7;</code>
*
* <pre>
* Основание полномочий (доверия) (ОснПолн)
* </pre>
*/
public Builder setSignerPowersBaseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
signerPowersBase_ = value;
onChanged();
return this;
}
private java.lang.Object signerOrgPowersBase_ = "";
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public boolean hasSignerOrgPowersBase() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public java.lang.String getSignerOrgPowersBase() {
java.lang.Object ref = signerOrgPowersBase_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
signerOrgPowersBase_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public com.google.protobuf.ByteString
getSignerOrgPowersBaseBytes() {
java.lang.Object ref = signerOrgPowersBase_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
signerOrgPowersBase_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder setSignerOrgPowersBase(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
signerOrgPowersBase_ = value;
onChanged();
return this;
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder clearSignerOrgPowersBase() {
bitField0_ = (bitField0_ & ~0x00000080);
signerOrgPowersBase_ = getDefaultInstance().getSignerOrgPowersBase();
onChanged();
return this;
}
/**
* <code>optional string SignerOrgPowersBase = 8;</code>
*
* <pre>
* Основание полномочий (доверия) организации (ОснПолнОрг)
* </pre>
*/
public Builder setSignerOrgPowersBaseBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
signerOrgPowersBase_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost)
}
static {
defaultInstance = new ExtendedSignerDetailsToPost(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.Invoicing.Signers.ExtendedSignerDetailsToPost)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\036Invoicing/ExtendedSigner.proto\022\"Diadoc" +
".Api.Proto.Invoicing.Signers\032\"Events/Pow" +
"erOfAttorneyToPost.proto\"\372\001\n\016ExtendedSig" +
"ner\022\r\n\005BoxId\030\001 \001(\t\022\031\n\021SignerCertificate\030" +
"\002 \001(\014\022#\n\033SignerCertificateThumbprint\030\003 \001" +
"(\t\022P\n\rSignerDetails\030\004 \001(\01329.Diadoc.Api.P" +
"roto.Invoicing.Signers.ExtendedSignerDet" +
"ails\022G\n\017PowerOfAttorney\030\005 \001(\0132..Diadoc.A" +
"pi.Proto.Events.PowerOfAttorneyToPost\"\333\003" +
"\n\025ExtendedSignerDetails\022\017\n\007Surname\030\001 \002(\t",
"\022\021\n\tFirstName\030\002 \002(\t\022\022\n\nPatronymic\030\003 \001(\t\022" +
"\020\n\010JobTitle\030\004 \001(\t\022\013\n\003Inn\030\005 \001(\t\022\037\n\027Regist" +
"rationCertificate\030\006 \001(\t\022O\n\nSignerType\030\007 " +
"\002(\0162..Diadoc.Api.Proto.Invoicing.Signers" +
".SignerType:\013LegalEntity\022\036\n\026SignerOrgani" +
"zationName\030\010 \001(\t\022\022\n\nSignerInfo\030\t \001(\t\022F\n\014" +
"SignerPowers\030\n \002(\01620.Diadoc.Api.Proto.In" +
"voicing.Signers.SignerPowers\022F\n\014SignerSt" +
"atus\030\013 \002(\01620.Diadoc.Api.Proto.Invoicing." +
"Signers.SignerStatus\022\030\n\020SignerPowersBase",
"\030\014 \001(\t\022\033\n\023SignerOrgPowersBase\030\r \001(\t\"\357\002\n\033" +
"ExtendedSignerDetailsToPost\022\020\n\010JobTitle\030" +
"\001 \001(\t\022\037\n\027RegistrationCertificate\030\002 \001(\t\022B" +
"\n\nSignerType\030\003 \002(\0162..Diadoc.Api.Proto.In" +
"voicing.Signers.SignerType\022\022\n\nSignerInfo" +
"\030\004 \001(\t\022F\n\014SignerPowers\030\005 \002(\01620.Diadoc.Ap" +
"i.Proto.Invoicing.Signers.SignerPowers\022F" +
"\n\014SignerStatus\030\006 \002(\01620.Diadoc.Api.Proto." +
"Invoicing.Signers.SignerStatus\022\030\n\020Signer" +
"PowersBase\030\007 \001(\t\022\033\n\023SignerOrgPowersBase\030",
"\010 \001(\t*G\n\nSignerType\022\017\n\013LegalEntity\020\001\022\024\n\020" +
"IndividualEntity\020\002\022\022\n\016PhysicalPerson\020\003*\223" +
"\003\n\014SignerPowers\022\021\n\rInvoiceSigner\020\000\022\027\n\023Pe" +
"rsonMadeOperation\020\001\022\030\n\024MadeAndSignOperat" +
"ion\020\002\022\035\n\031PersonDocumentedOperation\020\003\022!\n\035" +
"MadeOperationAndSignedInvoice\020\004\0222\n.MadeA" +
"ndResponsibleForOperationAndSignedInvoic" +
"e\020\005\022.\n*ResponsibleForOperationAndSignerF" +
"orInvoice\020\006\022\026\n\022ChairmanCommission\020\007\022\024\n\020M" +
"emberCommission\020\010\022\032\n\026PersonApprovedDocum",
"ent\020\025\022\033\n\027PersonConfirmedDocument\020\026\022\032\n\026Pe" +
"rsonAgreedOnDocument\020\027\022\024\n\020PersonOtherPow" +
"er\020\035*\257\001\n\014SignerStatus\022\022\n\016SellerEmployee\020" +
"\001\022\036\n\032InformationCreatorEmployee\020\002\022\035\n\031Oth" +
"erOrganizationEmployee\020\003\022\024\n\020AuthorizedPe" +
"rson\020\004\022\021\n\rBuyerEmployee\020\005\022#\n\037Information" +
"CreatorBuyerEmployee\020\006*\362\001\n\021DocumentTitle" +
"Type\022\023\n\006Absent\020\377\377\377\377\377\377\377\377\377\001\022\r\n\tUtdSeller\020\000" +
"\022\014\n\010UtdBuyer\020\001\022\r\n\tUcdSeller\020\002\022\014\n\010UcdBuye" +
"r\020\003\022\024\n\020TovTorg551Seller\020\004\022\023\n\017TovTorg551B",
"uyer\020\005\022\024\n\020AccCert552Seller\020\006\022\023\n\017AccCert5" +
"52Buyer\020\007\022\017\n\013Utd820Buyer\020\010\022\016\n\nTorg2Buyer" +
"\020\t\022\027\n\023Torg2AdditionalInfo\020\nB\026B\024ExtendedS" +
"ignerProtos"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.getDescriptor(),
}, assigner);
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSigner_descriptor,
new java.lang.String[] { "BoxId", "SignerCertificate", "SignerCertificateThumbprint", "SignerDetails", "PowerOfAttorney", });
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetails_descriptor,
new java.lang.String[] { "Surname", "FirstName", "Patronymic", "JobTitle", "Inn", "RegistrationCertificate", "SignerType", "SignerOrganizationName", "SignerInfo", "SignerPowers", "SignerStatus", "SignerPowersBase", "SignerOrgPowersBase", });
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_Diadoc_Api_Proto_Invoicing_Signers_ExtendedSignerDetailsToPost_descriptor,
new java.lang.String[] { "JobTitle", "RegistrationCertificate", "SignerType", "SignerInfo", "SignerPowers", "SignerStatus", "SignerPowersBase", "SignerOrgPowersBase", });
Diadoc.Api.Proto.Events.PowerOfAttorneyToPostProtos.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| {'content_hash': '6535ddc2b73795cd511c1ed938dc6752', 'timestamp': '', 'source': 'github', 'line_count': 6174, 'max_line_length': 286, 'avg_line_length': 34.50194363459669, 'alnum_prop': 0.6151022228481562, 'repo_name': 'diadoc/diadocsdk-java', 'id': '6fcfeea748dae28103a8e43ae574e42e70d3b95b', 'size': '221657', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/Diadoc/Api/Proto/Invoicing/Signers/ExtendedSignerProtos.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '94'}, {'name': 'C#', 'bytes': '7624'}, {'name': 'Java', 'bytes': '224831'}, {'name': 'PowerShell', 'bytes': '6092'}, {'name': 'Shell', 'bytes': '1724'}]} |
rm oracle.model
rm predictions.txt
rm oracle.cache
#vw -f oracle.model --oaa 10 --passes 10 --cache_file=oracle.cache --kill_cache --loss_function=$3 < $1
/usr/bin/time --quiet -f "%e" -o time.train.mc vw -f oracle.model --ect 10 \
--cache_file=oracle.cache --kill_cache --loss_function=logistic < $1
/usr/bin/time --quiet -f "%e" -o time.test.mc vw -i oracle.model -t -p \
./predictions.txt < $2
python accuracy.multiclass.py $2
| {'content_hash': '50bc4b9756b5c2251ce427240f1e8c91', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 103, 'avg_line_length': 33.38461538461539, 'alnum_prop': 0.6820276497695853, 'repo_name': 'scuthbert/OracleAudienceCompetition', 'id': '43d5e909b98270a2b29f863c0e4753c6d85bcb47', 'size': '471', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'scoring/all.multiclass.sh', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Python', 'bytes': '3298'}, {'name': 'Shell', 'bytes': '1909'}]} |
<?php
namespace Yoda\EventBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('yoda_event');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
| {'content_hash': '4146670cf9bf4f5188629f8307678147', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 131, 'avg_line_length': 30.17241379310345, 'alnum_prop': 0.7154285714285714, 'repo_name': 'rifkycp/starwarsevents', 'id': '3f24b5138ce608fe617fb27d2bd3dbac8b59f0d2', 'size': '875', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/Yoda/EventBundle/DependencyInjection/Configuration.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '61928'}]} |
import { SemestersComponent } from './semesters.component';
export const SEMESTERS_DECLARATIONS = [
SemestersComponent
];
| {'content_hash': 'a3b0ec6a1874252f93cd0d90f13dbb78', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 59, 'avg_line_length': 25.0, 'alnum_prop': 0.768, 'repo_name': 'aztec-developers/PortalPlus', 'id': '6d2986312da4c88a8eade05808bced55272f46c7', 'size': '125', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'client/imports/app/contentscreen/semesters/index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3223'}, {'name': 'HTML', 'bytes': '18467'}, {'name': 'TypeScript', 'bytes': '15185'}]} |
#pragma once
#include <aws/iotsitewise/IoTSiteWise_EXPORTS.h>
#include <aws/iotsitewise/model/ErrorCode.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace IoTSiteWise
{
namespace Model
{
/**
* <p>Contains the details of an IoT SiteWise configuration error.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/iotsitewise-2019-12-02/ConfigurationErrorDetails">AWS
* API Reference</a></p>
*/
class AWS_IOTSITEWISE_API ConfigurationErrorDetails
{
public:
ConfigurationErrorDetails();
ConfigurationErrorDetails(Aws::Utils::Json::JsonView jsonValue);
ConfigurationErrorDetails& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The error code.</p>
*/
inline const ErrorCode& GetCode() const{ return m_code; }
/**
* <p>The error code.</p>
*/
inline bool CodeHasBeenSet() const { return m_codeHasBeenSet; }
/**
* <p>The error code.</p>
*/
inline void SetCode(const ErrorCode& value) { m_codeHasBeenSet = true; m_code = value; }
/**
* <p>The error code.</p>
*/
inline void SetCode(ErrorCode&& value) { m_codeHasBeenSet = true; m_code = std::move(value); }
/**
* <p>The error code.</p>
*/
inline ConfigurationErrorDetails& WithCode(const ErrorCode& value) { SetCode(value); return *this;}
/**
* <p>The error code.</p>
*/
inline ConfigurationErrorDetails& WithCode(ErrorCode&& value) { SetCode(std::move(value)); return *this;}
/**
* <p>The error message.</p>
*/
inline const Aws::String& GetMessage() const{ return m_message; }
/**
* <p>The error message.</p>
*/
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
/**
* <p>The error message.</p>
*/
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
/**
* <p>The error message.</p>
*/
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
/**
* <p>The error message.</p>
*/
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
/**
* <p>The error message.</p>
*/
inline ConfigurationErrorDetails& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
/**
* <p>The error message.</p>
*/
inline ConfigurationErrorDetails& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
/**
* <p>The error message.</p>
*/
inline ConfigurationErrorDetails& WithMessage(const char* value) { SetMessage(value); return *this;}
private:
ErrorCode m_code;
bool m_codeHasBeenSet;
Aws::String m_message;
bool m_messageHasBeenSet;
};
} // namespace Model
} // namespace IoTSiteWise
} // namespace Aws
| {'content_hash': 'd232085523cf97d387ae874b0eac29e5', 'timestamp': '', 'source': 'github', 'line_count': 121, 'max_line_length': 117, 'avg_line_length': 25.669421487603305, 'alnum_prop': 0.6342562781712814, 'repo_name': 'cedral/aws-sdk-cpp', 'id': 'e74e3405b8a2a3d11947b65bf1d32ba863f7241a', 'size': '3225', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'aws-cpp-sdk-iotsitewise/include/aws/iotsitewise/model/ConfigurationErrorDetails.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '294220'}, {'name': 'C++', 'bytes': '428637022'}, {'name': 'CMake', 'bytes': '862025'}, {'name': 'Dockerfile', 'bytes': '11688'}, {'name': 'HTML', 'bytes': '7904'}, {'name': 'Java', 'bytes': '352201'}, {'name': 'Python', 'bytes': '106761'}, {'name': 'Shell', 'bytes': '10891'}]} |
import React from 'react';
import IconButton from 'material-ui/IconButton';
const GithubButton = () => (
<IconButton
style={{ textAlign: 'center' }}
iconClassName="muidocs-icon-custom-github"
href="https://github.com/jayeeeeee/trip-planner" />
)
export default GithubButton; | {'content_hash': '27b430e551f1457dc96536108f948166', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 55, 'avg_line_length': 26.363636363636363, 'alnum_prop': 0.7103448275862069, 'repo_name': 'jayeeeeee/trip-planner', 'id': '5f4f109d6b0215a825198d0be9c0897c1b92dd3d', 'size': '290', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/js/components/GithubButton.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7898'}, {'name': 'HTML', 'bytes': '318'}, {'name': 'JavaScript', 'bytes': '26084'}]} |
{% extends 'base.html' %}
{% load humanize %}
{% block title %}
Classical music concert : {{ concert }}
{% endblock %}
{% block content %}
<h2 class="concert-title">
{% with main_performer=concert.main_performer %}
{{ main_performer.instrument }} concert by {{ main_performer.artist }}
{% endwith %}
</h2>
<h4 class="concert-date">
{{ concert.date }} at
<a href="{{ concert.cached_venue.get_absolute_url }}">{{ concert.cached_venue }}</a>
</h4>
{% if concert.festival %}
<h4 class="concert-festival">
This concert is part of <a href="{{ concert.festival.get_absolute_url }}">{{ concert.festival }}</a>.
</h4>
{% endif %}
<div class="container"><div class="row">
<div class="span8">
<table class = "table table-condensed" >
{% for performer in concert.performance_set.all %}
<tr>
<td>
<a href="{{ performer.artist.get_absolute_url }}">{{ performer.artist }}</a>
(<a href="{{ performer.instrument.get_absolute_url }}">{{ performer.instrument }}</a>)
</td>
</tr>
{% endfor %}
</table>
</div>
<div class="span4">
<table class = "table table-condensed" >
<tr>
<td colspan="2" style="text-align: center;">
{% include 'sharing-buttons.html' with url=request.build_absolute_uri title=concert.title %}
</td>
</tr>
<tr>
<td>
Concert rating
</td>
</tr>
<tr>
<td>
{% include 'rasikapriya/venue_map.html' with venue=concert.cached_venue %}
</td>
</tr>
</table>
</div>
</div></div>
{% endblock %}
| {'content_hash': '0a32a2b859d63d071e9046f3e9e8d602', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 109, 'avg_line_length': 30.36842105263158, 'alnum_prop': 0.5205083766608897, 'repo_name': 'suriya/rasikapriya', 'id': '9acb35fed84ebd319b087514709adb86b6cccf15', 'size': '1731', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rasikapriya/templates/rasikapriya/concert_detail.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '776'}, {'name': 'JavaScript', 'bytes': '3674'}, {'name': 'Python', 'bytes': '72676'}]} |
layout: post
date: 2016-10-03
title: "Romona Keveza Luxe Bridal Style RK6403"
category: Romona Keveza
tags: [Romona Keveza]
---
### Romona Keveza Luxe Bridal Style RK6403
Just **$439.99**
###
<table><tr><td>BRANDS</td><td>Romona Keveza</td></tr></table>
<a href="https://www.readybrides.com/en/romona-keveza/47141-romona-keveza-romona-keveza-luxe-bridal-style-rk6403.html"><img src="//img.readybrides.com/103292/romona-keveza-romona-keveza-luxe-bridal-style-rk6403.jpg" alt="Romona Keveza Romona Keveza Luxe Bridal Style RK6403" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/romona-keveza/47141-romona-keveza-romona-keveza-luxe-bridal-style-rk6403.html"><img src="//img.readybrides.com/103291/romona-keveza-romona-keveza-luxe-bridal-style-rk6403.jpg" alt="Romona Keveza Romona Keveza Luxe Bridal Style RK6403" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/romona-keveza/47141-romona-keveza-romona-keveza-luxe-bridal-style-rk6403.html](https://www.readybrides.com/en/romona-keveza/47141-romona-keveza-romona-keveza-luxe-bridal-style-rk6403.html)
| {'content_hash': 'eb3e7c5dfe1be116f7e20ca557d91b9a', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 315, 'avg_line_length': 79.14285714285714, 'alnum_prop': 0.7545126353790613, 'repo_name': 'nicedaymore/nicedaymore.github.io', 'id': 'e82fa701cdf145cb3de5d4979c0b0b7320146ecb', 'size': '1112', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_posts/2016-10-03-Romona-Keveza-Luxe-Bridal-Style-RK6403.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '83876'}, {'name': 'HTML', 'bytes': '14755'}, {'name': 'Ruby', 'bytes': '897'}]} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache License, Version 2.0 for the specific language
governing permissions and limitations under the License.
-->
<resources>
<string name="app_name">Office365Demo</string>
<string name="title_activity_mail_item">MailItemActivity</string>
<string name="title_activity_later_select">ListChooseDialog</string>
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<string name="contacts_retrieving_failure_message">Error during contacts retrieveing</string>
<string name="events_retrieving_failure_message">Error during events retrieveing</string>
<string name="mails_retrieving_failure_message">Error during mails retrieveing</string>
<string name="action_settings">Settings</string>
<string name="action_search">Search</string>
<string name="action_share">Share</string>
<string name="action_write_email">Write new Email</string>
<string name="data_connection_no_data_connection">Sorry, no data connection is available.</string>
<string name="email_new">New email</string>
<string name="email_has_attachments_key">HasAttachments</string>
<string name="emails_array_key">value</string>
<string name="emails_sender_key">Sender</string>
<string name="emails_unknown_sender_text_stub"><unknown sender></string>
<string name="emails_sender_name_key">Name</string>
<string name="emails_sender_address_key">Address</string>
<string name="emails_id_key">Id</string>
<string name="emails_date_time_received_key">DateTimeReceived</string>
<string name="emails_no_subject_text_stub"><no subject></string>
<string name="emails_subject_key">Subject</string>
<string name="emails_body_preview_key">BodyPreview</string>
<string name="emails_body_key">Body</string>
<string name="emails_body_content_type_key">ContentType</string>
<string name="emails_body_content_key">Content</string>
<string name="content_type_text">Text</string>
<string name="content_type_html">HTML</string>
<string name="screens_drawer_delimiter"></string>
<string name="screens_mailbox">Mail</string>
<string name="screens_mail_later">Later</string>
<string name="screens_mail_lists">MLists</string>
<string name="screens_mail_to_read">To Read</string>
<string name="screens_mail_archive">Archive</string>
<string name="screens_mail_trash">Trash</string>
<string name="screens_mail_sent">Sent</string>
<string name="screens_settings">Settings</string>
<string name="screens_contacts">Contact</string>
<string name="screens_calendar">Calendar</string>
<string name="screens_help">Help</string>
<string name="intent_mail_key">Mail</string>
<string name="unknown_sender_text_stub"><unknown sender></string>
<string name="me_and_somebody_text_stub">"Me & "</string>
<string name="mime_type_text_html">text/html</string>
<string name="mime_type_text_plain">text/plain</string>
<string-array name="api_list">
<item>Calendar</item>
<item>Contacts</item>
<item>Files</item>
<item>Lists</item>
<item>Mail</item>
</string-array>
<!-- Merged -->
<string name="pending_request">Pending request…</string>
<string name="title_activity_view_list_item">Item Details</string>
<string name="data_id_unknown">Unknown ID</string>
<string name="data_title_unknown">Unknown Title</string>
<string name="alert_dialog_title">An Error Occurred</string>
<string name="alert_dialog_ok">@android:string/ok</string>
<string name="main_list_create_failure">Unable to create list</string>
<string name="main_list_create">Add new list</string>
<string name="main_item_create_failure">Unable to create item</string>
<string name="main_item_create">Add new item</string>
<string name="main_item_image_title_default">Sample item</string>
<string name="main_item_image_url_default">http://www.azulsystems.com/sites/default/files/images/Microsoft_open_tech_logo.jpg</string>
<string name="main_status_error">Error</string>
<string name="main_status_error_retrieve_lists">: failed to retrieve lists.</string>
<string name="main_item_create_dialog_title">Add Item</string>
<string name="main_item_create_dialog_name">Name</string>
<string name="main_item_create_dialog_address">Image URL</string>
<string name="main_item_create_dialog_attach_image">Attach image</string>
<string name="main_item_create_dialog_attached_image">Attached!</string>
<string name="main_item_create_dialog_save">Create</string>
<string name="main_item_create_dialog_cancel">@android:string/cancel</string>
<string name="main_login_dialog_login">Login</string>
<string name="main_login_dialog_cancel">@android:string/cancel</string>
<string name="main_login_dialog_passsword">Password</string>
<string name="main_login_dialog_password_hint">[email protected]</string>
<string name="settings_auth_label">Authentication method:</string>
<string name="settings_auth_opt_cookie">Cookie</string>
<string name="settings_auth_opt_oauth">OAuth</string>
<string name="settings_auth_opt_ntlm">NTLM</string>
</resources> | {'content_hash': 'd44eabbf20a4091c0d56f91a363e7eda', 'timestamp': '', 'source': 'github', 'line_count': 130, 'max_line_length': 138, 'avg_line_length': 45.33846153846154, 'alnum_prop': 0.7136070580251103, 'repo_name': 'ashank/Office-365-SDK-for-Android', 'id': '3eeb1af4b2c90a7247d785f5ed62670035dfd744', 'size': '5895', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'samples/mail-calendar-contacts-app/demo-app/res/values/strings.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Archetype Created Web Application</display-name>
<!-- context -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<!-- 为了junit的测试把log4j.properties放在web-info中 -->
<!-- 也可放在maven的resource里: /WEB-INF/classes/log4j.properties -->
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<!--<context-param>-->
<!--<param-name>log4jRefreshInterval</param-name>-->
<!--<param-value>6000</param-value>-->
<!--</context-param>-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/applicationContext.xml</param-value>
</context-param>
<!-- listener -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- OpenSessionInView过滤器 -->
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>sessionFactory</param-value>
</init-param>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<!-- Spring MVC Servlet -->
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
| {'content_hash': '6ddae90ec40b81a9d0d298180f860771', 'timestamp': '', 'source': 'github', 'line_count': 96, 'max_line_length': 113, 'avg_line_length': 35.28125, 'alnum_prop': 0.6194272217301446, 'repo_name': 'yiliangz/summer', 'id': 'a3586320e16872ee96d0dc08f1d3d97ff8da3cf8', 'size': '3423', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'champions/src/main/webapp/WEB-INF/web.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '101222'}, {'name': 'PLpgSQL', 'bytes': '513854'}]} |
.jasmine_html-reporter .progress {
position: relative;
background: linear-gradient(to bottom, #67addf 0%, #ffffff 50%, #5c8727 100%);
height: 20px;
margin: 14px 0;
}
.jasmine_html-reporter .banner {
margin: 14px 0;
}
.jasmine_html-reporter .results {
display: block;
}
| {'content_hash': '4fa2d1fd2bd6b02fa3ec38e09b3b7850', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 80, 'avg_line_length': 20.214285714285715, 'alnum_prop': 0.6855123674911661, 'repo_name': 'YonatanKra/cesium', 'id': '92d2b7823c5e16b2ac665ba5575de5aa473b6056', 'size': '283', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Specs/CesiumJasmineHtml.css', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '658499'}, {'name': 'GLSL', 'bytes': '200624'}, {'name': 'HTML', 'bytes': '1844731'}, {'name': 'JavaScript', 'bytes': '22244695'}, {'name': 'Perl', 'bytes': '344405'}, {'name': 'Shell', 'bytes': '291'}]} |
<?php
// Year And Month Setting
$setDate = strtotime('10 Years');
$tillDate = date('Y', $setDate);
$expirymon = idate('m');
$expiry_year = idate('Y');
$year = range($tillDate, date('Y'));
sort($year);
?>
<div id="main" role="main" class="primary-focus checkout-focus clearfix">
<div class="breadcrumb-container">
<ol class="breadcrumb">
<li>
<h4><a href="<?php echo base_url(); ?>" title="Home">Home</a></h4>
<span class="divider">/</span></li>
<li>
<h4><span class="breadcrumb-last">Checkout</span></h4>
</li>
</ol>
</div>
<!-- code here -->
<div class="steps-bar clearfix">
<h1 class="title">Checkout</h1>
<h2 class="checkoutStepCounter">STEP<span id="currentCheckoutStep">2</span>OF 3</h2>
<div class="help-number">
<div class="content-asset">
<!-- dwMarker="content" dwContentID="cdEDoiaaiM6nAaaadnb6hrDMYt" -->
<div class="shipping-help">
<p class="help-line2">
NEED HELP ?
</p>
<p class="help-line1">
1300 416 708
</p>
</div>
</div>
<!-- End content-asset -->
</div>
</div>
<div class="checkout-wrapper">
<div id="primary" class="primary-content">
<div class="accordion">
<div class="accordion-group shipping">
<div class="accordion-heading clearfix up sumamryView">
<h2 class="section-header"><span>1</span>Shipping</h2>
<a href="<?php echo base_url(); ?>order/checkout" id="edit-shipping-info">Edit Shipping</a>
</div>
<div class="shipping-closed">
<div class="mini-shipment order-component-block first ">
<div class="details">
<div>
<strong><?= $shipping_details['shipping_first_name'] . ' ' . $shipping_details['shipping_last_name']; ?></strong>
</div>
<div>
<?= $shipping_details['shipping_address'] . ' ' . $shipping_details['shipping_address2']; ?>
</div>
<div>
<?= $shipping_details['shipping_city'] . ', ' . $shipping_details['shipping_state'] . ', ' . $shipping_details['shipping_zipcode']; ?>
</div>
<div>
<?= $shipping_details['shipping_country']; ?>
</div>
<!--<div class="minishipments-method">
<span>Method:</span>
<span><?= $shipping_details['shipping_method']; ?></span>
</div>-->
</div>
</div>
</div>
</div>
</div>
<div class="accordion-group billing">
<div class="accordion-heading clearfix">
<h2 class="section-header"><span>2</span>Payment</h2>
<a style="display:none;" href="<?php echo base_url(); ?>" id="edit-billing-info">Edit Payment</a>
</div>
<div class="billing-closed">
</div>
<div class="accordion-inner" style="overflow: hidden;">
<!-- Check for empty name of checkout step -->
<div id="checkoutBillingSection">
<form action="<?= base_url(); ?>order/order_review" method="post" id="dwfrm_billing" class="checkout-billing address" novalidate="novalidate">
<input type="text" style="display: none">
<input type="password" style="display: none">
<fieldset>
<input type="hidden" id="credit_card_vault_transaction" name="credit_card_vault_transaction" value="0">
<input type="hidden" name="dwfrm_billing_save" value="true">
<input type="hidden" name="order_id" value="<?= $order_id; ?>">
<input type="hidden" name="cart_total" id="cart_total" value="<?php echo $cart_total; ?>">
<input type="hidden" name="payment_method_nonce" id="payment_method_nonce">
<input type="hidden" name="card_last_two_for_review" id="card_last_two_for_review">
<input type="hidden" name="card_type_for_review" id="card_type_for_review">
<div class="form-row label-inline shipping-as-billing ">
<? if ($shipping_details['address_option'] == 'true') { ?>
<input class="input-checkbox" type="checkbox" checked="checked" name="dwfrm_billing_billingAddress_useAsBillingAddress" id="dwfrm_billing_billingAddress_useAsBillingAddress" value="true">
<? } else { ?>
<input class="input-checkbox" type="checkbox" name="dwfrm_billing_billingAddress_useAsBillingAddress" id="dwfrm_billing_billingAddress_useAsBillingAddress" value="true">
<? } ?>
<label for="dwfrm_billing_billingAddress_useAsBillingAddress">Use Shipping Address for Billing Address</label>
<script type="text/javascript">
$(document).ready(function () {
$('#dwfrm_billing_billingAddress_useAsBillingAddress').change(function () {
if (this.checked)
$('.shipping-form-wrapper').fadeOut('slow');
else
$('.shipping-form-wrapper').fadeIn('slow');
});
//validation for cvv,the stored cards in vault
$('#vault_submit').on("click", function () {
var radioValue = $("input[name='creditcard_info']:checked").val();
if (radioValue) {
var cvv_val = $("#cvv_" + radioValue).val();
if (!($.isNumeric(cvv_val)) || (cvv_val == false)) {
$("#spancredit_card_" + radioValue).html("Please enter your security code as given on card");
$("#spancredit_card_" + radioValue).css('color', '#eb0028');
return false;
} else {
$("#credit_card_vault_transaction").val(1);
document.getElementById("dwfrm_billing").submit();
return true;
}
}
});
});
</script>
</div>
<div class="shipping-form-wrapper" <? if ($shipping_details['address_option'] == 'true') { ?>style="display:none;"<? } else { ?>style="display:block;"<? } ?>>
<div class="form-row required " data-required-text="Please enter a first name">
<label for="dwfrm_billing_billingAddress_addressFields_firstName">
<span>
First Name* </span>
</label>
<input class="input-text required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_firstName" type="text" name="dwfrm_billing_billingAddress_addressFields_firstName" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_firstName) ? $dwfrm_billing_billingAddress_addressFields_firstName : $billing_first_name; ?>" maxlength="50">
</div>
<div class="form-row required " data-required-text="Please enter a last name">
<label for="dwfrm_billing_billingAddress_addressFields_lastName">
<span>
Last Name* </span>
</label>
<input class="input-text required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_lastName" type="text" name="dwfrm_billing_billingAddress_addressFields_lastName" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_lastName) ? $dwfrm_billing_billingAddress_addressFields_lastName : $billing_last_name; ?>" maxlength="50">
</div>
<div class="billing-address">
<div class="form-row required " data-required-text="Please enter address information">
<label for="dwfrm_billing_billingAddress_addressFields_address1">
<span>
Address* </span>
</label>
<input class="input-text required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_address1" type="text" name="dwfrm_billing_billingAddress_addressFields_address1" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_address1) ? $dwfrm_billing_billingAddress_addressFields_address1 : $billing_address; ?>" maxlength="70">
</div>
<div class="form-row ">
<input class="input-text" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_address2" type="text" name="dwfrm_billing_billingAddress_addressFields_address2" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_address2) ? $dwfrm_billing_billingAddress_addressFields_address2 : $billing_address2; ?>" maxlength="50">
</div>
</div>
<div class="inline-input clearfix">
<div class="form-row city-inline required " data-required-text="Please enter a suburb">
<label for="dwfrm_billing_billingAddress_addressFields_city">
<span>
Suburb* </span>
</label>
<input class="input-text required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_city" type="text" name="dwfrm_billing_billingAddress_addressFields_city" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_city) ? $dwfrm_billing_billingAddress_addressFields_city : $billing_city; ?>" maxlength="35">
</div>
<div class="form-row zipCode-inline required " data-required-text="Please enter a valid postcode">
<label for="dwfrm_billing_billingAddress_addressFields_zip">
<span>
Post Code* </span>
</label>
<input class="input-text postalCode notshipping required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_zip" type="text" name="dwfrm_billing_billingAddress_addressFields_zip" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_zip) ? $dwfrm_billing_billingAddress_addressFields_zip : $billing_zipcode; ?>" maxlength="10">
</div>
</div>
<div class="inline-input clearfix">
<div class="form-row country-inline required " style="position: relative;">
<label for="dwfrm_billing_billingAddress_addressFields_country">
<span>
Country* </span>
</label>
<select class="input-select country required" id="dwfrm_billing_billingAddress_addressFields_country" name="dwfrm_billing_billingAddress_addressFields_country" style="-webkit-appearance: none;">
<option class="select-option" label="Please select a Country" value="">Please select a Country</option>
<option class="select-option" label="Australia" value="Australia" selected="selected">AUSTRALIA</option>
</select>
<span class="select-img" style="top: 19px; left: 0px; width: 99.2982%; height: 32px;"></span>
</div>
<div class="form-row state-inline required " style="position: relative;">
<label for="dwfrm_billing_billingAddress_addressFields_states_state">
<span>
Province / State* </span>
</label>
<select class="input-select required" id="dwfrm_billing_billingAddress_addressFields_states_state" name="dwfrm_billing_billingAddress_addressFields_states_state" style="-webkit-appearance: none;">
<option class="select-option" label="SELECT A STATE" value="" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', '', TRUE); ?>>SELECT A STATE</option>
<option class="select-option" label="ACT" value="ACT" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'ACT'); ?>>ACT</option>
<option class="select-option" label="NSW" value="NSW" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'NSW'); ?>>NSW</option>
<option class="select-option" label="NT" value="NT" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'NT'); ?>>NT</option>
<option class="select-option" label="SA" value="SA" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'SA'); ?>>SA</option>
<option class="select-option" label="TAS" value="TAS" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'TAS'); ?>>TAS</option>
<option class="select-option" label="QLD" value="QLD" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'QLD'); ?>>QLD</option>
<option class="select-option" label="VIC" value="VIC" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'VIC'); ?>>VIC</option>
<option class="select-option" label="WA" value="WA" <? echo set_select('dwfrm_billing_billingAddress_addressFields_states_state', 'WA'); ?>>WA</option>
</select>
<span class="select-img" style="top: 19px; left: 0px; width: 99.2982%; height: 32px;"></span>
</div>
</div>
<div class="form-row inline-phone required " data-required-text="Please enter a phone number">
<label for="dwfrm_billing_billingAddress_addressFields_phone">
<span>
Phone* </span>
</label>
<input class="input-text phone required" autocomplete="off" id="dwfrm_billing_billingAddress_addressFields_phone" type="text" name="dwfrm_billing_billingAddress_addressFields_phone" value="<? echo isset($dwfrm_billing_billingAddress_addressFields_phone) ? $dwfrm_billing_billingAddress_addressFields_phone : $billing_phone; ?>" maxlength="20">
</div>
<div class="form-row required " data-required-text="Please enter a valid email address">
<label for="dwfrm_billing_billingAddress_email_emailAddress">
<span>
Email* </span>
</label>
<input class="input-text email required" autocomplete="off" id="dwfrm_billing_billingAddress_email_emailAddress" type="text" name="dwfrm_billing_billingAddress_email_emailAddress" value="<? echo isset($dwfrm_billing_billingAddress_email_emailAddress) ? $dwfrm_billing_billingAddress_email_emailAddress : $billing_email; ?>" maxlength="50">
</div>
<div class="form-caption privacy-link">
<a title="See Privacy Policy" href="<?php echo base_url(); ?>info/policy" data-dlg-options="{"height":600}" class="dialogify">See Privacy Policy</a>
</div>
</div>
</fieldset>
<input type="hidden" name="dwfrm_billing_securekey" value="175014917">
<input type="hidden" name="client_token" id="client_token" value="<?php echo $client_token; ?>">
<input type="hidden" name="customer_id" id="customer_id" value="<?php echo $customer_id; ?>">
<fieldset>
<legend>Payment details</legend>
<?php $this->load->view('order/payment_braintree_view.php'); ?>
</fieldset>
</div>
</div>
<?php
if (ENVIRONMENT == 'production'):?>
<!-- Ecommerce tracking code -->
<? if ($cart_items) {?>
<script type="text/javascript">
<?foreach ($cart_items as $value):
?>
ga('ec:addProduct', {
'id': '<?php echo $value['sku'] ?>',
'name': '<?php echo $value['name']; ?>',
'category': '<?php echo check_product_brand($value['category'], $value['gender']); ?>',
'brand': '<?php echo $value['style']; ?>',
'variant': '<?php echo $value['color']; ?>',
'price': '<?php echo $value['price_sale']; ?>',
'quantity': '<?php echo $value['qty']; ?>'
});
ga('dieselitaly.ec:addProduct', {
'id': '<?php echo $value['sku'] ?>',
'name': '<?php echo $value['name']; ?>',
'category': '<?php echo check_product_brand($value['category'], $value['gender']); ?>',
'brand': '<?php echo $value['style']; ?>',
'variant': '<?php echo $value['color']; ?>',
'price': '<?php echo $value['price_sale']; ?>',
'quantity': '<?php echo $value['qty']; ?>'
});
ga('syg.ec:addProduct', {
'id': '<?php echo $value['sku'] ?>',
'name': '<?php echo $value['name']; ?>',
'category': '<?php echo check_product_brand($value['category'], $value['gender']); ?>',
'brand': '<?php echo $value['style']; ?>',
'variant': '<?php echo $value['color']; ?>',
'price': '<?php echo $value['price_sale']; ?>',
'quantity': '<?php echo $value['qty']; ?>'
});
<?php endforeach; ?>
ga('ec:setAction', 'checkout', {
'step': 3, // A value of 1 indicates this action is first checkout step.
'option': 'Payment' // Used to specify additional info about a checkout stage, e.g. payment method.
});
ga('dieselitaly.ec:setAction', 'checkout', {
'step': 3, // A value of 1 indicates this action is first checkout step.
'option': 'Payment' // Used to specify additional info about a checkout stage, e.g. payment method.
});
ga('syg.ec:setAction', 'checkout', {
'step': 3, // A value of 1 indicates this action is first checkout step.
'option': 'Payment' // Used to specify additional info about a checkout stage, e.g. payment method.
});
ga('send', 'pageview'); // Pageview for payment.html
ga('dieselitaly.send', 'pageview');
ga('syg.send', 'pageview');
<?php } ?>
</script>
<!--End of Ecommerce tracking code-->
<?php endif; ?>
</div>
<div class="accordion-group review">
<div class="accordion-heading clearfix up">
<h2 class="section-header"><span>3</span>Order Review</h2>
</div>
<div class="accordion-inner" style="display:none;">
</div>
</div>
</div>
</div>
<?php $this->load->view('order/order_summary.php'); ?>
</div>
</div>
| {'content_hash': 'c13c84efe6f0d226841c905e0d1813a8', 'timestamp': '', 'source': 'github', 'line_count': 308, 'max_line_length': 398, 'avg_line_length': 79.12337662337663, 'alnum_prop': 0.4320065654493229, 'repo_name': 'sygcom/diesel_2016', 'id': '2ff9d857d8baf6932060d449a9a2c0542b3db66c', 'size': '24370', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'application/views/order/payment_view_2016_07_21.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '892'}, {'name': 'CSS', 'bytes': '60597027'}, {'name': 'HTML', 'bytes': '5675183'}, {'name': 'JavaScript', 'bytes': '13606395'}, {'name': 'PHP', 'bytes': '45473425'}, {'name': 'Ruby', 'bytes': '161'}]} |
(function () {
$(document).ready(function () {
var carType = $("#carType"),
carDiametr = $("#carDiametr"),
carHeight = $("#carHeight"),
outTierType = $("#tierType"),
outTierHeight = $("#tierHeight"),
outAutoType = $("#autoType"),
chosenItem = {};
carType.on('mouseup', 'label', function (e) {
var type = e.target.dataset.type;
chosenItem.autotype = type;
outAutoType.html(type);
});
carDiametr.on('mouseup', 'label', function (e) {
var diametr = e.target.dataset.diametr;
chosenItem.diametr = diametr;
outTierType.html(" " + diametr);
});
carHeight.on('mouseup', 'label', function (e) {
var height = e.target.dataset.height;
chosenItem.height = height;
outTierHeight.html(height);
console.log(chosenItem);
});
})
})(); | {'content_hash': 'a6c2350bb99b42ad16d59b07da5054d9', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 52, 'avg_line_length': 30.25, 'alnum_prop': 0.5749704840613932, 'repo_name': 'BohdanHulchack/michelin', 'id': '5585eb929de0d03694cccf1ae1feb8051dbe9911', 'size': '847', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/js/app.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '64327'}, {'name': 'HTML', 'bytes': '10597'}, {'name': 'JavaScript', 'bytes': '5896'}, {'name': 'PHP', 'bytes': '14779'}]} |
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="edu.derp.esillen.toiletapp.PoopingActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="33dp"
android:text="Amount"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<Button
android:id="@+id/button4"
android:layout_width="105dp"
android:layout_height="68dp"
android:onClick="commit"
android:text="Commit"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="0.489"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
/>
<SeekBar
android:id="@+id/amountSeekBar"
style="@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width="245dp"
android:layout_height="30dp"
android:max="10"
android:progress="0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_bias="0.503"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView"/>
<android.support.constraint.ConstraintLayout
android:id="@+id/hasAmountLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="0dp"
android:visibility="invisible"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/amountSeekBar">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="195dp"
android:layout_height="204dp"
android:layout_marginTop="8dp"
android:background="@android:drawable/editbox_background_normal"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:text="Color"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<View
android:id="@+id/color_indicator"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="18dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="18dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/rectangle"
app:layout_constraintBottom_toTopOf="@+id/redSeekBar"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toRightOf="@+id/textView3"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.782"/>
<SeekBar
android:id="@+id/redSeekBar"
android:layout_width="155dp"
android:layout_height="27dp"
android:layout_marginTop="27dp"
android:max="255"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"/>
<SeekBar
android:id="@+id/greenSeekBar"
android:layout_width="155dp"
android:layout_height="27dp"
android:layout_marginTop="8dp"
android:max="255"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/redSeekBar"/>
<SeekBar
android:id="@+id/blueSeekBar"
android:layout_width="155dp"
android:layout_height="27dp"
android:layout_marginTop="8dp"
android:max="255"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/greenSeekBar"/>
</android.support.constraint.ConstraintLayout>
<Spinner
android:id="@+id/bristolSpinner"
android:layout_width="0dp"
android:layout_height="83dp"
android:layout_marginTop="8dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
| {'content_hash': '9a8c3e8af9d134fa4f38a57b55080951', 'timestamp': '', 'source': 'github', 'line_count': 149, 'max_line_length': 76, 'avg_line_length': 42.19463087248322, 'alnum_prop': 0.6122156831557182, 'repo_name': 'esillen/ToiletApp', 'id': 'b32de6eb139c1f13a178a6c9fd98e68470cf7819', 'size': '6287', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ToiletApp/app/src/main/res/layout/activity_pooping.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '33171'}]} |
package com.suscipio_solutions.consecro_mud.Commands;
import java.util.Set;
import java.util.Vector;
import com.suscipio_solutions.consecro_mud.Exits.interfaces.Exit;
import com.suscipio_solutions.consecro_mud.Locales.interfaces.Room;
import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;
import com.suscipio_solutions.consecro_mud.core.CMLib;
import com.suscipio_solutions.consecro_mud.core.CMParms;
import com.suscipio_solutions.consecro_mud.core.CMProps;
import com.suscipio_solutions.consecro_mud.core.CMath;
import com.suscipio_solutions.consecro_mud.core.Directions;
@SuppressWarnings({"unchecked","rawtypes"})
public class Flee extends Go
{
public Flee(){}
private final String[] access=I(new String[]{"FLEE"});
@Override public String[] getAccessWords(){return access;}
@Override
public boolean execute(MOB mob, Vector commands, int metaFlags)
throws java.io.IOException
{
String direction="";
if(commands.size()>1) direction=CMParms.combine(commands,1);
if(mob==null) return false;
final Room R=mob.location();
if(R==null) return false;
if((!mob.isMonster())||(mob.amFollowing()!=null))
{
if(!mob.isInCombat())
{
mob.tell(L("You can only flee while in combat."));
return false;
}
}
boolean XPloss=true;
final MOB fighting=mob.getVictim();
if(fighting!=null)
{
final Set<MOB> H=CMLib.combat().allCombatants(mob);
for (final Object element : H)
{
final MOB M=(MOB)element;
if(CMLib.flags().aliveAwakeMobileUnbound(M,true))
{
XPloss=true;
break;
}
XPloss=false;
}
}
if((!XPloss)&&(direction.length()==0))
{
mob.tell(L("You stop fighting."));
direction="NOWHERE";
}
int directionCode=-1;
if(!direction.equals("NOWHERE"))
{
if(direction.length()==0)
{
final Vector directions=new Vector();
for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
{
final Exit thisExit=R.getExitInDir(d);
final Room thisRoom=R.getRoomInDir(d);
if((thisRoom!=null)&&(thisExit!=null)&&(thisExit.isOpen()))
directions.addElement(Integer.valueOf(d));
}
// up is last resort
if(directions.size()>1)
directions.removeElement(Integer.valueOf(Directions.UP));
if(directions.size()>0)
{
directionCode=((Integer)directions.elementAt(CMLib.dice().roll(1,directions.size(),-1))).intValue();
direction=Directions.getDirectionName(directionCode);
}
}
else
directionCode=Directions.getGoodDirectionCode(direction);
if(directionCode<0)
{
mob.tell(L("Flee where?!"));
return false;
}
}
if((direction.equals("NOWHERE"))||((directionCode>=0)&&(CMLib.tracking().walk(mob,directionCode,true,false,false))))
{
mob.makePeace();
if(XPloss&&(fighting!=null))
{
final String whatToDo=CMProps.getVar(CMProps.Str.PLAYERFLEE);
if(whatToDo==null) return false;
final int[] expLost={10+((mob.phyStats().level()-fighting.phyStats().level()))*5};
if(expLost[0]<10) expLost[0]=10;
final String[] cmds=CMParms.toStringArray(CMParms.parseCommas(whatToDo,true));
CMLib.combat().handleConsequences(mob,fighting,cmds,expLost,"You lose @x1 experience points for withdrawing.");
final double pctHPremaining=CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints());
if(expLost[0]>0)
{
final int gainedExperience=(int)Math.round(CMath.mul(expLost[0],1.0-pctHPremaining))/4;
if((fighting!=mob)
&&(gainedExperience>0)
&&((mob.session()==null)
||(fighting.session()==null)
||(!mob.session().getAddress().equals(fighting.session().getAddress()))))
CMLib.leveler().postExperience(fighting,null,null,gainedExperience,false);
}
}
}
return false;
}
@Override public boolean canBeOrdered(){return true;}
}
| {'content_hash': 'f3c6fa041ae1f9bff267b9f56c1992f8', 'timestamp': '', 'source': 'github', 'line_count': 123, 'max_line_length': 118, 'avg_line_length': 30.821138211382113, 'alnum_prop': 0.6866262199947244, 'repo_name': 'ConsecroMUD/ConsecroMUD', 'id': '6847bee72834fa9c070d7e9e3499da49fcd5d972', 'size': '3791', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'com/suscipio_solutions/consecro_mud/Commands/Flee.java', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1413'}, {'name': 'Java', 'bytes': '21670655'}, {'name': 'JavaScript', 'bytes': '23366'}, {'name': 'Perl', 'bytes': '732'}, {'name': 'Shell', 'bytes': '6214'}]} |
package com.intellij.profile.codeInspection.ui.inspectionsTree;
import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInspection.ex.InspectionProfileImpl;
import com.intellij.codeInspection.ex.ScopeToolState;
import com.intellij.ide.IdeTooltip;
import com.intellij.ide.IdeTooltipManager;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.profile.codeInspection.ui.InspectionsAggregationUtil;
import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
import com.intellij.profile.codeInspection.ui.ToolDescriptors;
import com.intellij.profile.codeInspection.ui.table.ScopesAndSeveritiesTable;
import com.intellij.profile.codeInspection.ui.table.ThreeStateCheckBoxRenderer;
import com.intellij.ui.DoubleClickListener;
import com.intellij.ui.treeStructure.treetable.TreeTable;
import com.intellij.ui.treeStructure.treetable.TreeTableModel;
import com.intellij.ui.treeStructure.treetable.TreeTableTree;
import com.intellij.util.Alarm;
import com.intellij.util.NullableFunction;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashSet;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.TextTransferable;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.table.IconTableCellRenderer;
import one.util.streamex.MoreCollectors;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.util.*;
import java.util.List;
import java.util.stream.Stream;
/**
* @author Dmitry Batkovich
*/
public class InspectionsConfigTreeTable extends TreeTable {
private final static Logger LOG = Logger.getInstance(InspectionsConfigTreeTable.class);
private final static int TREE_COLUMN = 0;
private final static int SEVERITIES_COLUMN = 1;
private final static int IS_ENABLED_COLUMN = 2;
public static int getAdditionalPadding() {
return SystemInfo.isMac ? 10 : 0;
}
public static InspectionsConfigTreeTable create(final InspectionsConfigTreeTableSettings settings, @NotNull Disposable parentDisposable) {
return new InspectionsConfigTreeTable(new InspectionsConfigTreeTableModel(settings, parentDisposable));
}
public InspectionsConfigTreeTable(final InspectionsConfigTreeTableModel model) {
super(model);
final TableColumn severitiesColumn = getColumnModel().getColumn(SEVERITIES_COLUMN);
severitiesColumn.setCellRenderer(new IconTableCellRenderer<Icon>() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focus, int row, int column) {
Component component = super.getTableCellRendererComponent(table, value, false, focus, row, column);
Color bg = selected ? table.getSelectionBackground() : table.getBackground();
component.setBackground(bg);
((JLabel) component).setText("");
return component;
}
@Nullable
@Override
protected Icon getIcon(@NotNull Icon value, JTable table, int row) {
return value;
}
});
severitiesColumn.setMaxWidth(JBUI.scale(20));
final TableColumn isEnabledColumn = getColumnModel().getColumn(IS_ENABLED_COLUMN);
isEnabledColumn.setMaxWidth(JBUI.scale(20 + getAdditionalPadding()));
isEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer());
isEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer());
addMouseMotionListener(new MouseAdapter() {
@Override
public void mouseMoved(final MouseEvent e) {
final Point point = e.getPoint();
final int column = columnAtPoint(point);
if (column != SEVERITIES_COLUMN) {
return;
}
final int row = rowAtPoint(point);
final Object maybeIcon = getModel().getValueAt(row, column);
if (maybeIcon instanceof MultiScopeSeverityIcon) {
final MultiScopeSeverityIcon icon = (MultiScopeSeverityIcon)maybeIcon;
final LinkedHashMap<String, HighlightDisplayLevel> scopeToAverageSeverityMap =
icon.getScopeToAverageSeverityMap();
final JComponent component;
if (scopeToAverageSeverityMap.size() == 1 &&
icon.getDefaultScopeName().equals(ContainerUtil.getFirstItem(scopeToAverageSeverityMap.keySet()))) {
final HighlightDisplayLevel level = ContainerUtil.getFirstItem(scopeToAverageSeverityMap.values());
final JLabel label = new JLabel();
label.setIcon(level.getIcon());
label.setText(SingleInspectionProfilePanel.renderSeverity(level.getSeverity()));
component = label;
} else {
component = new ScopesAndSeveritiesHintTable(scopeToAverageSeverityMap, icon.getDefaultScopeName());
}
IdeTooltipManager.getInstance().show(
new IdeTooltip(InspectionsConfigTreeTable.this, point, component), false);
}
}
});
new DoubleClickListener() {
@Override
protected boolean onDoubleClick(MouseEvent event) {
final TreePath path = getTree().getPathForRow(getTree().getLeadSelectionRow());
if (path != null) {
final InspectionConfigTreeNode node = (InspectionConfigTreeNode)path.getLastPathComponent();
if (node.isLeaf()) {
model.swapInspectionEnableState();
}
}
return true;
}
}.installOn(this);
setTransferHandler(new TransferHandler() {
@Nullable
@Override
protected Transferable createTransferable(JComponent c) {
final TreePath path = getTree().getPathForRow(getTree().getLeadSelectionRow());
if (path != null) {
return new TextTransferable(StringUtil.join(ContainerUtil.mapNotNull(path.getPath(),
(NullableFunction<Object, String>)o -> o == path.getPath()[0] ? null : o.toString()), " | "));
}
return null;
}
@Override
public int getSourceActions(JComponent c) {
return COPY;
}
});
getTableHeader().setReorderingAllowed(false);
registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
model.swapInspectionEnableState();
updateUI();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), JComponent.WHEN_FOCUSED);
getEmptyText().setText("No enabled inspections available");
}
@Override
public void paint(@NotNull Graphics g) {
super.paint(g);
UIUtil.fixOSXEditorBackground(this);
}
public abstract static class InspectionsConfigTreeTableSettings {
private final TreeNode myRoot;
private final Project myProject;
public InspectionsConfigTreeTableSettings(final TreeNode root, final Project project) {
myRoot = root;
myProject = project;
}
public TreeNode getRoot() {
return myRoot;
}
public Project getProject() {
return myProject;
}
protected abstract InspectionProfileImpl getInspectionProfile();
protected abstract void onChanged(InspectionConfigTreeNode node);
public abstract void updateRightPanel();
}
public static void setToolEnabled(boolean newState,
@NotNull InspectionProfileImpl profile,
@NotNull String toolId,
@NotNull Project project) {
if (newState) {
profile.enableTool(toolId, project);
}
else {
profile.disableTool(toolId, project);
}
for (ScopeToolState scopeToolState : profile.getTools(toolId, project).getTools()) {
scopeToolState.setEnabled(newState);
}
}
private static class InspectionsConfigTreeTableModel extends DefaultTreeModel implements TreeTableModel {
private final InspectionsConfigTreeTableSettings mySettings;
private final Runnable myUpdateRunnable;
private TreeTable myTreeTable;
private Alarm myUpdateAlarm;
public InspectionsConfigTreeTableModel(final InspectionsConfigTreeTableSettings settings, @NotNull Disposable parentDisposable) {
super(settings.getRoot());
mySettings = settings;
myUpdateRunnable = () -> {
settings.updateRightPanel();
((AbstractTableModel)myTreeTable.getModel()).fireTableDataChanged();
};
myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, parentDisposable);
}
@Override
public int getColumnCount() {
return 3;
}
@Nullable
@Override
public String getColumnName(final int column) {
return null;
}
@Override
public Class getColumnClass(final int column) {
switch (column) {
case TREE_COLUMN:
return TreeTableModel.class;
case SEVERITIES_COLUMN:
return Icon.class;
case IS_ENABLED_COLUMN:
return Boolean.class;
}
throw new IllegalArgumentException();
}
@Nullable
@Override
public Object getValueAt(final Object node, final int column) {
if (column == TREE_COLUMN) {
return null;
}
final InspectionConfigTreeNode treeNode = (InspectionConfigTreeNode)node;
final List<HighlightDisplayKey> inspectionsKeys = InspectionsAggregationUtil.getInspectionsKeys(treeNode);
if (column == SEVERITIES_COLUMN) {
final MultiColoredHighlightSeverityIconSink sink = new MultiColoredHighlightSeverityIconSink();
for (final HighlightDisplayKey selectedInspectionsNode : inspectionsKeys) {
final String toolId = selectedInspectionsNode.toString();
if (mySettings.getInspectionProfile().getTools(toolId, mySettings.getProject()).isEnabled()) {
sink.put(mySettings.getInspectionProfile().getToolDefaultState(toolId, mySettings.getProject()),
mySettings.getInspectionProfile().getNonDefaultTools(toolId, mySettings.getProject()));
}
}
return sink.constructIcon(mySettings.getInspectionProfile());
} else if (column == IS_ENABLED_COLUMN) {
return isEnabled(inspectionsKeys);
}
throw new IllegalArgumentException();
}
@Nullable
private Boolean isEnabled(final List<HighlightDisplayKey> selectedInspectionsNodes) {
return selectedInspectionsNodes
.stream()
.map(key -> mySettings.getInspectionProfile().getTools(key.toString(), mySettings.getProject()))
.flatMap(tools -> tools.isEnabled() ? tools.getTools().stream().map(ScopeToolState::isEnabled) : Stream.of(false))
.collect(MoreCollectors.onlyOne()).orElse(null);
}
@Override
public boolean isCellEditable(final Object node, final int column) {
return column == IS_ENABLED_COLUMN;
}
@Override
public void setValueAt(final Object aValue, final Object node, final int column) {
LOG.assertTrue(column == IS_ENABLED_COLUMN);
if (aValue == null) {
return;
}
final boolean doEnable = (Boolean) aValue;
final InspectionProfileImpl profile = mySettings.getInspectionProfile();
for (final InspectionConfigTreeNode aNode : InspectionsAggregationUtil.getInspectionsNodes((InspectionConfigTreeNode)node)) {
setToolEnabled(doEnable, profile, aNode.getKey().toString(), mySettings.getProject());
aNode.dropCache();
mySettings.onChanged(aNode);
}
updateRightPanel();
}
public void swapInspectionEnableState() {
LOG.assertTrue(myTreeTable != null);
Boolean state = null;
final HashSet<HighlightDisplayKey> tools = new HashSet<>();
final List<InspectionConfigTreeNode> nodes = new ArrayList<>();
for (TreePath selectionPath : myTreeTable.getTree().getSelectionPaths()) {
final InspectionConfigTreeNode node = (InspectionConfigTreeNode)selectionPath.getLastPathComponent();
collectInspectionFromNodes(node, tools, nodes);
}
final int[] selectedRows = myTreeTable.getSelectedRows();
for (int selectedRow : selectedRows) {
final Boolean value = (Boolean)myTreeTable.getValueAt(selectedRow, IS_ENABLED_COLUMN);
if (state == null) {
state = value;
}
else if (!state.equals(value)) {
state = null;
break;
}
}
final boolean newState = !Boolean.TRUE.equals(state);
final InspectionProfileImpl profile = mySettings.getInspectionProfile();
for (HighlightDisplayKey tool : tools) {
setToolEnabled(newState, profile, tool.toString(), mySettings.getProject());
}
for (InspectionConfigTreeNode node : nodes) {
node.dropCache();
mySettings.onChanged(node);
}
updateRightPanel();
}
private void updateRightPanel() {
if (myTreeTable != null) {
if (!myUpdateAlarm.isDisposed()) {
myUpdateAlarm.cancelAllRequests();
myUpdateAlarm.addRequest(myUpdateRunnable, 10, ModalityState.stateForComponent(myTreeTable));
}
}
}
private static void collectInspectionFromNodes(final InspectionConfigTreeNode node,
final Set<HighlightDisplayKey> tools,
final List<InspectionConfigTreeNode> nodes) {
if (node == null) {
return;
}
nodes.add(node);
final ToolDescriptors descriptors = node.getDescriptors();
if (descriptors == null) {
for (int i = 0; i < node.getChildCount(); i++) {
collectInspectionFromNodes((InspectionConfigTreeNode)node.getChildAt(i), tools, nodes);
}
} else {
final HighlightDisplayKey key = descriptors.getDefaultDescriptor().getKey();
tools.add(key);
}
}
@Override
public void setTree(final JTree tree) {
myTreeTable = ((TreeTableTree)tree).getTreeTable();
}
}
private static class SeverityAndOccurrences {
private HighlightSeverity myPrimarySeverity;
private final Map<String, HighlightSeverity> myOccurrences = new HashMap<>();
public void setSeverityToMixed() {
myPrimarySeverity = ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY;
}
public SeverityAndOccurrences incOccurrences(final String toolName, final HighlightSeverity severity) {
if (myPrimarySeverity == null) {
myPrimarySeverity = severity;
} else if (!Comparing.equal(severity, myPrimarySeverity)) {
myPrimarySeverity = ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY;
}
myOccurrences.put(toolName, severity);
return this;
}
public HighlightSeverity getPrimarySeverity() {
return myPrimarySeverity;
}
public int getOccurrencesSize() {
return myOccurrences.size();
}
public Map<String, HighlightSeverity> getOccurrences() {
return myOccurrences;
}
}
private static class MultiColoredHighlightSeverityIconSink {
private final Map<String, SeverityAndOccurrences> myScopeToAverageSeverityMap = new HashMap<>();
private String myDefaultScopeName;
public Icon constructIcon(final InspectionProfileImpl inspectionProfile) {
final Map<String, HighlightSeverity> computedSeverities = computeSeverities(inspectionProfile);
if (computedSeverities == null) {
return null;
}
boolean allScopesHasMixedSeverity = true;
for (HighlightSeverity severity : computedSeverities.values()) {
if (!severity.equals(ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY)) {
allScopesHasMixedSeverity = false;
break;
}
}
return allScopesHasMixedSeverity
? ScopesAndSeveritiesTable.MIXED_FAKE_LEVEL.getIcon()
: new MultiScopeSeverityIcon(computedSeverities, myDefaultScopeName, inspectionProfile);
}
@Nullable
private Map<String, HighlightSeverity> computeSeverities(final InspectionProfileImpl inspectionProfile) {
if (myScopeToAverageSeverityMap.isEmpty()) {
return null;
}
final Map<String, HighlightSeverity> result = new HashMap<>();
final Map.Entry<String, SeverityAndOccurrences> entry = ContainerUtil.getFirstItem(myScopeToAverageSeverityMap.entrySet());
result.put(entry.getKey(), entry.getValue().getPrimarySeverity());
if (myScopeToAverageSeverityMap.size() == 1) {
return result;
}
final SeverityAndOccurrences defaultSeveritiesAndOccurrences = myScopeToAverageSeverityMap.get(myDefaultScopeName);
if (defaultSeveritiesAndOccurrences == null) {
for (Map.Entry<String, SeverityAndOccurrences> e: myScopeToAverageSeverityMap.entrySet()) {
final HighlightSeverity primarySeverity = e.getValue().getPrimarySeverity();
if (primarySeverity != null) {
result.put(e.getKey(), primarySeverity);
}
}
return result;
}
final int allInspectionsCount = defaultSeveritiesAndOccurrences.getOccurrencesSize();
final Map<String, HighlightSeverity> allScopes = defaultSeveritiesAndOccurrences.getOccurrences();
for (String currentScope : myScopeToAverageSeverityMap.keySet()) {
final SeverityAndOccurrences currentSeverityAndOccurrences = myScopeToAverageSeverityMap.get(currentScope);
if (currentSeverityAndOccurrences == null) {
continue;
}
final HighlightSeverity currentSeverity = currentSeverityAndOccurrences.getPrimarySeverity();
if (currentSeverity == ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY ||
currentSeverityAndOccurrences.getOccurrencesSize() == allInspectionsCount ||
myDefaultScopeName.equals(currentScope)) {
result.put(currentScope, currentSeverity);
}
else {
Set<String> toolsToCheck = ContainerUtil.newHashSet(allScopes.keySet());
toolsToCheck.removeAll(currentSeverityAndOccurrences.getOccurrences().keySet());
boolean doContinue = false;
final Map<String, HighlightSeverity> lowerScopeOccurrences = myScopeToAverageSeverityMap.get(myDefaultScopeName).getOccurrences();
for (String toolName : toolsToCheck) {
final HighlightSeverity currentToolSeverity = lowerScopeOccurrences.get(toolName);
if (currentToolSeverity != null) {
if (!currentSeverity.equals(currentToolSeverity)) {
result.put(currentScope, ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY);
doContinue = true;
break;
}
}
}
if (doContinue) {
continue;
}
result.put(currentScope, currentSeverity);
}
}
return result;
}
public void put(@NotNull final ScopeToolState defaultState, @NotNull final List<ScopeToolState> nonDefault) {
putOne(defaultState);
if (myDefaultScopeName == null) {
myDefaultScopeName = defaultState.getScopeName();
}
for (final ScopeToolState scopeToolState : nonDefault) {
putOne(scopeToolState);
}
}
private void putOne(final ScopeToolState state) {
if (!state.isEnabled()) {
return;
}
final Icon icon = state.getLevel().getIcon();
final String scopeName = state.getScopeName();
if (icon instanceof HighlightDisplayLevel.ColoredIcon) {
final SeverityAndOccurrences severityAndOccurrences = myScopeToAverageSeverityMap.get(scopeName);
final String inspectionName = state.getTool().getShortName();
if (severityAndOccurrences == null) {
myScopeToAverageSeverityMap.put(scopeName, new SeverityAndOccurrences().incOccurrences(inspectionName, state.getLevel().getSeverity()));
} else {
severityAndOccurrences.incOccurrences(inspectionName, state.getLevel().getSeverity());
}
}
}
}
}
| {'content_hash': 'f5da1a8cd63ed3c95dab8fc8c0c4c3ee', 'timestamp': '', 'source': 'github', 'line_count': 529, 'max_line_length': 173, 'avg_line_length': 39.07561436672968, 'alnum_prop': 0.6898069759566543, 'repo_name': 'idea4bsd/idea4bsd', 'id': '4b61a77bf9a552cd72200e17785b6d2a5966ebe9', 'size': '21271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/idea4bsd-master', 'path': 'platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '20665'}, {'name': 'AspectJ', 'bytes': '182'}, {'name': 'Batchfile', 'bytes': '59458'}, {'name': 'C', 'bytes': '224097'}, {'name': 'C#', 'bytes': '1538'}, {'name': 'C++', 'bytes': '197012'}, {'name': 'CSS', 'bytes': '197224'}, {'name': 'CoffeeScript', 'bytes': '1759'}, {'name': 'Cucumber', 'bytes': '14382'}, {'name': 'Erlang', 'bytes': '10'}, {'name': 'Groff', 'bytes': '35232'}, {'name': 'Groovy', 'bytes': '2971715'}, {'name': 'HLSL', 'bytes': '57'}, {'name': 'HTML', 'bytes': '1829102'}, {'name': 'J', 'bytes': '5050'}, {'name': 'Java', 'bytes': '158117117'}, {'name': 'JavaScript', 'bytes': '563135'}, {'name': 'Jupyter Notebook', 'bytes': '93222'}, {'name': 'Kotlin', 'bytes': '2208983'}, {'name': 'Lex', 'bytes': '179058'}, {'name': 'Makefile', 'bytes': '3018'}, {'name': 'NSIS', 'bytes': '49952'}, {'name': 'Objective-C', 'bytes': '28750'}, {'name': 'Perl', 'bytes': '903'}, {'name': 'Perl6', 'bytes': '26'}, {'name': 'Protocol Buffer', 'bytes': '6607'}, {'name': 'Python', 'bytes': '23911290'}, {'name': 'Ruby', 'bytes': '1217'}, {'name': 'Scala', 'bytes': '11698'}, {'name': 'Shell', 'bytes': '63460'}, {'name': 'Smalltalk', 'bytes': '64'}, {'name': 'TeX', 'bytes': '25473'}, {'name': 'Thrift', 'bytes': '1846'}, {'name': 'TypeScript', 'bytes': '9469'}, {'name': 'Visual Basic', 'bytes': '77'}, {'name': 'XSLT', 'bytes': '113040'}]} |
def authorized_to_manage_request(_, request, current_user, pushmaster=False):
if pushmaster or \
request['user'] == current_user or \
(request['watchers'] and current_user in request['watchers'].split(',')):
return True
return False
def sort_pickmes(_, requests, tags_order):
"""Sort pickmes based on tags_order
Args:
- - request handler object
requests - a list of requests
tags_order - order to sort requests
Return: sorted requests list
"""
def compare_requests(request1, request2):
tags1_list = request1['tags'].split(',')
tags2_list = request2['tags'].split(',')
for tag in tags_order:
tag_in_tags1 = tag in tags1_list
tag_in_tags2 = tag in tags2_list
if tag_in_tags1 == tag_in_tags2:
continue
elif tag_in_tags1:
return -1
else:
return 1
return cmp(request1['user'], request2['user'])
sorted_requests = sorted(requests, cmp=compare_requests)
return sorted_requests
| {'content_hash': '624605eb121325582ebb28e54b8a5389', 'timestamp': '', 'source': 'github', 'line_count': 37, 'max_line_length': 80, 'avg_line_length': 29.7027027027027, 'alnum_prop': 0.5823475887170154, 'repo_name': 'Yelp/pushmanager', 'id': 'b7059ec4fcf7aa6553b178a12f7daaa1fbcc05b9', 'size': '1099', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'pushmanager/ui_methods.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '15672'}, {'name': 'HTML', 'bytes': '33606'}, {'name': 'JavaScript', 'bytes': '33757'}, {'name': 'Makefile', 'bytes': '372'}, {'name': 'PLpgSQL', 'bytes': '3157'}, {'name': 'Python', 'bytes': '388878'}, {'name': 'Shell', 'bytes': '1646'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Fri Jun 20 06:34:21 EDT 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.internal.csv.CSVUtils (Solr 4.9.0 API)</title>
<meta name="date" content="2014-06-20">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.internal.csv.CSVUtils (Solr 4.9.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/internal/csv/CSVUtils.html" title="class in org.apache.solr.internal.csv">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/internal/csv/class-use/CSVUtils.html" target="_top">Frames</a></li>
<li><a href="CSVUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.solr.internal.csv.CSVUtils" class="title">Uses of Class<br>org.apache.solr.internal.csv.CSVUtils</h2>
</div>
<div class="classUseContainer">No usage of org.apache.solr.internal.csv.CSVUtils</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/internal/csv/CSVUtils.html" title="class in org.apache.solr.internal.csv">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/internal/csv/class-use/CSVUtils.html" target="_top">Frames</a></li>
<li><a href="CSVUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
| {'content_hash': '9ad0cc4a87a3a597c806776a20067685', 'timestamp': '', 'source': 'github', 'line_count': 131, 'max_line_length': 137, 'avg_line_length': 36.6412213740458, 'alnum_prop': 0.5875, 'repo_name': 'BibAlex/bhl_rails_4_solr_test', 'id': '211493eabe1e32b900730f206a0b66fab4d4291e', 'size': '4800', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'docs/solr-core/org/apache/solr/internal/csv/class-use/CSVUtils.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '366'}, {'name': 'CSS', 'bytes': '129178'}, {'name': 'Groff', 'bytes': '37749613'}, {'name': 'HTML', 'bytes': '87581'}, {'name': 'JavaScript', 'bytes': '1040511'}, {'name': 'Shell', 'bytes': '8670'}, {'name': 'XSLT', 'bytes': '149538'}]} |
<?php declare(strict_types=1);
namespace DavidBadura\OrangeDb\Test\Adapter;
use DavidBadura\OrangeDb\Type\BooleanType;
use DavidBadura\OrangeDb\Type\TypeInterface;
/**
* @author David Badura <[email protected]>
*/
class BooleanTypeTest extends AbstractTypeTest
{
protected function createType(): TypeInterface
{
return new BooleanType();
}
public function transformToPhpProvider()
{
yield [true, true];
yield [false, false];
}
public function transformToDumpProvider()
{
yield [null];
yield [true];
yield [false];
}
}
| {'content_hash': 'a2e4ee8125622470f04ea880585cdcef', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 50, 'avg_line_length': 20.4, 'alnum_prop': 0.6568627450980392, 'repo_name': 'DavidBadura/orangedb', 'id': '46cfb46dd552f336007ab1ab8f56ee8c0f065abd', 'size': '612', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/Type/BooleanTypeTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Makefile', 'bytes': '1694'}, {'name': 'PHP', 'bytes': '75835'}, {'name': 'Shell', 'bytes': '1310'}]} |
TEST_SETTINGS_FILE=$(abspath settings_test.py)
# Silent: Don't output commands for those targets
.SILENT: clean tests
# Phony Build targets even in file or folder exist in the filesystem
.PHONY: clean tests
all: test
clean:
find . -name '*.pyc' -delete
rm -rf *.egg-info
tests:
APP_SETTINGS=${TEST_SETTINGS_FILE} python setup.py test
| {'content_hash': '8a14e1c0a77408def656a45a6d15e601', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 68, 'avg_line_length': 22.733333333333334, 'alnum_prop': 0.7360703812316716, 'repo_name': 'nmussat/Navigator', 'id': 'e0545246b545809dc624cf7f4d05a0dae3108de1', 'size': '341', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '32'}, {'name': 'Python', 'bytes': '13563'}]} |
import Ember from "ember";
import ErrorMessages from "../utils/error-messages";
export default Ember.Mixin.create({
hasPath(filePath) {
const files = this.get('model.files');
const file = files.findBy('filePath', filePath);
return file !== undefined;
},
createFile(filePath, fileProperties, fileColumn=1) {
if (filePath) {
if (this.hasPath(filePath)) {
alert(`A file with the name ${filePath} already exists`);
return;
}
fileProperties.filePath = filePath;
let file = this.get('store').createRecord('gistFile', fileProperties);
this.get('model.files').pushObject(file);
this.get('notify').info(`File ${file.get('filePath')} was added`);
this.setColumnFile(fileColumn, file);
this.set('activeEditorCol', '1');
this.send('contentsChanged');
this.updateOpenFiles();
}
},
/*
* Test whether path is valid. Presently only tests whether components are hyphenated.
*/
isPathInvalid(type, path){
let errorMsg = null;
if (/^component/.test(type)) {
if (!/[^/]+-[^/]+(\/(component\.js|template\.hbs))?$/.test(path)) {
errorMsg = ErrorMessages.componentsNeedHyphens;
}
}
if (errorMsg) {
window.alert(errorMsg);
return true;
}
return false;
},
updateOpenFiles() {
const columns = this.get('columns');
const fileNames = columns.map(column => column.get('file.fileName'));
const openFiles = fileNames.join(",").replace(/^,|,$/g, '');
this.set('openFiles', openFiles);
},
openFile(filePath) {
let file = this.get('model.files').findBy('filePath', filePath);
let activeCol = this.get('activeEditorCol') || '1';
this.setColumnFile(activeCol, file);
this.set('activeEditorCol', activeCol);
this.set('activeFile', file);
this.updateOpenFiles();
},
addFile(type) {
let fileProperties = type ? this.get('emberCli').buildProperties(type) : {filePath:'file.js'};
let filePath = fileProperties.filePath;
if (['twiddle.json','router', 'css'].indexOf(type)===-1) {
filePath = prompt('File path', filePath);
}
if (this.isPathInvalid(type, filePath)) {
return;
}
this.createFile(filePath, fileProperties);
this.updateOpenFiles();
},
renameFile(file) {
let filePath = prompt('File path', file.get('filePath'));
if (filePath) {
if (this.get('model.files').findBy('filePath', filePath)) {
alert(`A file with the name ${filePath} already exists`);
return;
}
file.set('filePath', filePath);
this.get('notify').info(`File ${file.get('filePath')} was added`);
this.updateOpenFiles();
}
},
removeFile(file) {
file.deleteRecord();
this.get('notify').info(`File ${file.get('filePath')} was deleted`);
this.removeFileFromColumns(file);
if (this.get('activeFile') === file) {
this.setProperties({
activeFile: null,
activeEditorCol: null
});
}
this.updateOpenFiles();
this.send('contentsChanged');
},
addComponent(path) {
//strip file extension if present
path = path.replace(/\.[^/.]+$/, "");
if (this.isPathInvalid('component', path)) {
return;
}
['js', 'hbs'].forEach((fileExt, i)=>{
let fileProperties = this.get('emberCli').buildProperties(`component-${fileExt}`);
let notPodPrefix = "components/";
let filePath;
if (path.substr(0, notPodPrefix.length) === notPodPrefix) {
filePath = `${fileExt === 'hbs' ? 'templates/' : ''}${path}.${fileExt}`;
} else {
filePath = path + "/" + (fileExt === 'hbs' ? 'template.hbs' : 'component.js');
}
let fileColumn = i+1;
this.createFile(filePath, fileProperties, fileColumn);
});
},
addHelper(type, filePath) {
let splitFilePath = filePath.split('/');
let file = splitFilePath[splitFilePath.length - 1];
let name = file.replace('.js', '').camelize();
let fileProperties = this.get('emberCli').buildProperties(type, {
camelizedModuleName: name
});
if (this.isPathInvalid(type, filePath)) {
return;
}
this.createFile(filePath, fileProperties);
}
});
| {'content_hash': 'b319188b20a78a527ae21b5589a4be6e', 'timestamp': '', 'source': 'github', 'line_count': 141, 'max_line_length': 98, 'avg_line_length': 29.822695035460992, 'alnum_prop': 0.6087990487514863, 'repo_name': 'Gaurav0/ember-twiddle', 'id': 'f0f7859dde44c9cc7835a906c49aa8603bde2a8a', 'size': '4205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/mixins/files.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '15871'}, {'name': 'HTML', 'bytes': '23709'}, {'name': 'JavaScript', 'bytes': '246816'}, {'name': 'Shell', 'bytes': '548'}]} |
import pytz
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
from rest_framework.authtoken.models import Token
class Settings(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
dashboard_refresh_rate = models.DurationField(
verbose_name=_("Refresh rate"),
help_text=_(
"If supported by browser, the dashboard will only refresh "
"when visible, and also when receiving focus."
),
blank=True,
null=True,
default=timezone.timedelta(minutes=1),
choices=[
(None, _("disabled")),
(timezone.timedelta(minutes=1), _("1 min.")),
(timezone.timedelta(minutes=2), _("2 min.")),
(timezone.timedelta(minutes=3), _("3 min.")),
(timezone.timedelta(minutes=4), _("4 min.")),
(timezone.timedelta(minutes=5), _("5 min.")),
(timezone.timedelta(minutes=10), _("10 min.")),
(timezone.timedelta(minutes=15), _("15 min.")),
(timezone.timedelta(minutes=30), _("30 min.")),
],
)
dashboard_hide_empty = models.BooleanField(
verbose_name=_("Hide Empty Dashboard Cards"), default=False, editable=True
)
dashboard_hide_age = models.DurationField(
verbose_name=_("Hide data older than"),
help_text=_(
"This setting controls which data will be shown " "in the dashboard."
),
blank=True,
null=True,
default=None,
choices=[
(None, _("show all data")),
(timezone.timedelta(days=1), _("1 day")),
(timezone.timedelta(days=2), _("2 days")),
(timezone.timedelta(days=3), _("3 days")),
(timezone.timedelta(weeks=1), _("1 week")),
(timezone.timedelta(weeks=4), _("4 weeks")),
],
)
language = models.CharField(
choices=settings.LANGUAGES,
default=settings.LANGUAGE_CODE,
max_length=255,
verbose_name=_("Language"),
)
timezone = models.CharField(
choices=tuple(zip(pytz.common_timezones, pytz.common_timezones)),
default=timezone.get_default_timezone_name(),
max_length=100,
verbose_name=_("Timezone"),
)
def __str__(self):
return str(format_lazy(_("{user}'s Settings"), user=self.user))
def api_key(self, reset=False):
"""
Get or create an API key for the associated user.
:param reset: If True, delete the existing key and create a new one.
:return: The user's API key.
"""
if reset:
Token.objects.get(user=self.user).delete()
return Token.objects.get_or_create(user=self.user)[0]
@property
def dashboard_refresh_rate_milliseconds(self):
"""
Convert seconds to milliseconds to be used in a Javascript setInterval
function call.
:return: the refresh rate in milliseconds or None.
"""
if self.dashboard_refresh_rate:
return self.dashboard_refresh_rate.seconds * 1000
return None
@receiver(post_save, sender=User)
def create_user_settings(sender, instance, created, **kwargs):
if created:
Settings.objects.create(user=instance)
@receiver(post_save, sender=User)
def save_user_settings(sender, instance, **kwargs):
instance.settings.save()
| {'content_hash': '2554c03be83dbed8e96578944fc9ea3b', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 82, 'avg_line_length': 34.98076923076923, 'alnum_prop': 0.6083012644310061, 'repo_name': 'cdubz/babybuddy', 'id': 'be565050eb0d17329df88bc1ce38abff8558f930', 'size': '3662', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'babybuddy/models.py', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '712618'}, {'name': 'Dockerfile', 'bytes': '367'}, {'name': 'HTML', 'bytes': '112489'}, {'name': 'JavaScript', 'bytes': '7555762'}, {'name': 'Python', 'bytes': '242367'}]} |
/// <reference path="../../../../../typings/_custom.d.ts" />
import {bind, Injectable, Http} from 'angular2/angular2'
import {ISearchable} from './searchable';
@Injectable()
export class Github implements ISearchable<any[]> {
url: string = 'https://api.github.com/search/repositories?q=';
constructor(public http: Http) {
}
/**
* @returns an Observable of repository names
*/
search(query: string): Rx.Observable<any[]> {
return this.http.get(`${ this.url }${ query }`).
toRx(). // convert it to pure Rx stream
map(res => res.json()). // make json
map(res => res.items). // extract "items" only
filter(repos => repos); // only if there are results
}
}
export var githubInjectables = [
bind(Github).toClass(Github)
];
| {'content_hash': '2ed12e244e0e6d3a4e48d75b380f18b2', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 64, 'avg_line_length': 24.967741935483872, 'alnum_prop': 0.627906976744186, 'repo_name': 'Josefsosa/ng2-base-starter', 'id': '746bf1b6480973f8458a60e5d0437799a31b15a9', 'size': '774', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/app/components/example-modules/search-module/services/github.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4858'}, {'name': 'HTML', 'bytes': '8300'}, {'name': 'JavaScript', 'bytes': '10532'}, {'name': 'TypeScript', 'bytes': '26166'}]} |
package org.springframework.security.oauth2.server.resource.authentication;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import reactor.core.publisher.Mono;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.jwt.BadJwtException;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.jwt.JwtException;
import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
import org.springframework.security.oauth2.jwt.TestJwts;
import org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
/**
* @author Rob Winch
* @since 5.1
*/
@RunWith(MockitoJUnitRunner.class)
public class JwtReactiveAuthenticationManagerTests {
@Mock
private ReactiveJwtDecoder jwtDecoder;
private JwtReactiveAuthenticationManager manager;
private Jwt jwt;
@Before
public void setup() {
this.manager = new JwtReactiveAuthenticationManager(this.jwtDecoder);
// @formatter:off
this.jwt = TestJwts.jwt()
.claim("scope", "message:read message:write")
.build();
// @formatter:on
}
@Test
public void constructorWhenJwtDecoderNullThenIllegalArgumentException() {
this.jwtDecoder = null;
// @formatter:off
assertThatIllegalArgumentException()
.isThrownBy(() -> new JwtReactiveAuthenticationManager(this.jwtDecoder));
// @formatter:on
}
@Test
public void authenticateWhenWrongTypeThenEmpty() {
TestingAuthenticationToken token = new TestingAuthenticationToken("foo", "bar");
assertThat(this.manager.authenticate(token).block()).isNull();
}
@Test
public void authenticateWhenEmptyJwtThenEmpty() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(token.getToken())).willReturn(Mono.empty());
assertThat(this.manager.authenticate(token).block()).isNull();
}
@Test
public void authenticateWhenJwtExceptionThenOAuth2AuthenticationException() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(any())).willReturn(Mono.error(new BadJwtException("Oops")));
assertThatExceptionOfType(OAuth2AuthenticationException.class)
.isThrownBy(() -> this.manager.authenticate(token).block());
}
// gh-7549
@Test
public void authenticateWhenDecoderThrowsIncompatibleErrorMessageThenWrapsWithGenericOne() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(token.getToken())).willThrow(new BadJwtException("with \"invalid\" chars"));
// @formatter:off
assertThatExceptionOfType(OAuth2AuthenticationException.class)
.isThrownBy(() -> this.manager.authenticate(token).block())
.satisfies((ex) -> assertThat(ex)
.hasFieldOrPropertyWithValue("error.description", "Invalid token")
);
// @formatter:on
}
// gh-7785
@Test
public void authenticateWhenDecoderFailsGenericallyThenThrowsGenericException() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(token.getToken())).willThrow(new JwtException("no jwk set"));
// @formatter:off
assertThatExceptionOfType(AuthenticationException.class)
.isThrownBy(() -> this.manager.authenticate(token).block())
.isNotInstanceOf(OAuth2AuthenticationException.class);
// @formatter:on
}
@Test
public void authenticateWhenNotJwtExceptionThenPropagates() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(any())).willReturn(Mono.error(new RuntimeException("Oops")));
// @formatter:off
assertThatExceptionOfType(RuntimeException.class)
.isThrownBy(() -> this.manager.authenticate(token).block());
// @formatter:on
}
@Test
public void authenticateWhenJwtThenSuccess() {
BearerTokenAuthenticationToken token = new BearerTokenAuthenticationToken("token-1");
given(this.jwtDecoder.decode(token.getToken())).willReturn(Mono.just(this.jwt));
Authentication authentication = this.manager.authenticate(token).block();
assertThat(authentication).isNotNull();
assertThat(authentication.isAuthenticated()).isTrue();
// @formatter:off
assertThat(authentication.getAuthorities())
.extracting(GrantedAuthority::getAuthority)
.containsOnly("SCOPE_message:read", "SCOPE_message:write");
// @formatter:on
}
}
| {'content_hash': '3bec2153b338249b0695c7d0d0848573', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 107, 'avg_line_length': 37.97014925373134, 'alnum_prop': 0.7928459119496856, 'repo_name': 'fhanik/spring-security', 'id': '989044a0460e308166ddc137d9f9bd3de2ca96d6', 'size': '5709', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'oauth2/oauth2-resource-server/src/test/java/org/springframework/security/oauth2/server/resource/authentication/JwtReactiveAuthenticationManagerTests.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AspectJ', 'bytes': '3335'}, {'name': 'HTML', 'bytes': '115'}, {'name': 'Java', 'bytes': '12074662'}, {'name': 'JavaScript', 'bytes': '10'}, {'name': 'Kotlin', 'bytes': '357974'}, {'name': 'PLSQL', 'bytes': '3180'}, {'name': 'Python', 'bytes': '129'}, {'name': 'Shell', 'bytes': '811'}, {'name': 'XSLT', 'bytes': '2344'}]} |
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root == null || root == p || root == q) return root;
if (p.val < root.val && root.val < q.val) return root;
if (q.val < root.val && root.val < p.val) return root;
if (p.val < root.val && q.val < root.val) return lowestCommonAncestor(root.left, p, q);
if (p.val > root.val && q.val > root.val) return lowestCommonAncestor(root.right, p, q);
return null;
}
} | {'content_hash': '7edf5e3932feb6c1385d5a3f35d9f2f1', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 96, 'avg_line_length': 33.36363636363637, 'alnum_prop': 0.5449591280653951, 'repo_name': 't1gerr/CodeMaze', 'id': 'eee5efc9c7767d0c3c6b2276a601edaeb0367a5e', 'size': '734', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'src/lowest_common_ancestor_of_a_binary_search_tree/solution1.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '61159'}, {'name': 'Java', 'bytes': '16176'}, {'name': 'JavaScript', 'bytes': '1630'}, {'name': 'Objective-C', 'bytes': '596'}, {'name': 'Python', 'bytes': '479'}, {'name': 'Swift', 'bytes': '4891'}]} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/ivAlbumArt"
android:layout_width="50dp"
android:layout_height="50dp"
>
</ImageView>
<TextView
android:id="@+id/tvSongTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/ivAlbumArt"
android:maxLines="1"
android:ellipsize="end"
android:requiresFadingEdge="horizontal"
android:textColor="@drawable/menu_text_selector"
android:paddingLeft="3dp"
android:text="Song Title"
android:textStyle="bold" >
</TextView>
<TextView
android:id="@+id/tvSongArtist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvSongTitle"
android:layout_below="@+id/tvSongTitle"
android:paddingLeft="3dp"
android:paddingTop="3dp"
android:text="Artist Name" />
</RelativeLayout> | {'content_hash': '08c57d751c91abdedd2d6ab13f63cb56', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 74, 'avg_line_length': 32.3421052631579, 'alnum_prop': 0.6403580146460537, 'repo_name': 'JadeByfield89/MuSync', 'id': '79fd44e967fd63f57978fe8a4d9e221e8c94bc13', 'size': '1229', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'res/layout/songs_list_row.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
package de.free_creations.nbPhon4Netbeans;
import de.free_creations.dbEntities.EntityIdentity;
import de.free_creations.dbEntities.Person;
import de.free_creations.nbPhonAPI.MutableEntityCollection;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.swing.Action;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
/**
*
* @author Harald Postner <Harald at free-creations.de>
*/
public class PersonNodesArray extends Children.SortedArray {
private final Filter filter;
private final Action preferedAction;
/**
* A filter can be used to exclude some items from Nodes Array.
*/
public static interface Filter {
/**
* Must return true if the item should be added to the Array.
* @param p
* @return
*/
boolean take(Person p);
}
public static Filter takeAllFilter = new Filter() {
@Override
public boolean take(Person p) {
return true;
}
};
private final MutableEntityCollection<Person, Integer> personCollection;
private final PropertyChangeListener personCollectionListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (MutableEntityCollection.PROP_ITEM_ADDED.equals(evt.getPropertyName())) {
// a new person has been added to the to the personCollection,
// this person must also be added to the internal "nodes" list.
Object o = evt.getNewValue();
if (o instanceof EntityIdentity) {
EntityIdentity newPerson = (EntityIdentity) o;
Integer personid = (Integer) newPerson.primaryKey;
//create a node for this new person
PersonNode newNode = new PersonNode(personid, personCollection);
newNode.notifyPendingChanges();
if (nodes instanceof ArrayList) {
// if the nodes- list is an ArrayList (as created in initCollection)
// we can insert on top of the list.
((ArrayList<Node>) nodes).add(0, newNode);
} else {
// otherways, we just insert at the end.
nodes.add(newNode);
}
refresh();
}
}
if (MutableEntityCollection.PROP_ITEM_REMOVED.equals(evt.getPropertyName())) {
throw new UnsupportedOperationException("Not supported yet.");
}
if (MutableEntityCollection.PROP_ITEM_LIST_CHANGED.equals(evt.getPropertyName())) {
nodes = initCollection();
refresh();
}
}
};
private final boolean hasNobodyNode;
public PersonNodesArray(MutableEntityCollection<Person, Integer> personCollection) {
this(personCollection, false);
}
public PersonNodesArray(MutableEntityCollection<Person, Integer> personCollection, boolean withNobody) {
this(personCollection, withNobody, takeAllFilter, null);
}
public PersonNodesArray(MutableEntityCollection<Person, Integer> personCollection, boolean withNobody, Filter filter, Action preferedAction) {
super();
assert (filter != null);
this.filter = filter;
hasNobodyNode = withNobody;
super.setComparator(PersonCompare.byName(personCollection));
this.personCollection = personCollection;
this.personCollection.addPropertyChangeListener(personCollectionListener);
this.preferedAction = preferedAction;
}
@Override
protected ArrayList<Node> initCollection() {
List<Person> pp = personCollection.getAll();
ArrayList<Node> result = new ArrayList<>(pp.size());
if (hasNobodyNode) {
result.add(new PersonNode(PersonNode.nullKey, personCollection));
}
for (Person p : pp) {
assert (p != null);
if (filter.take(p)) {
Integer personid = p.getPersonId();
assert (personid != null);
result.add(new PersonNode(personid, personCollection, preferedAction));
}
}
Comparator<? super Node> comparator = getComparator();
if (comparator != null) {
Collections.sort(result, comparator);
}
return result;
}
public void setComparator(PersonCompare.PersonComparator c) {
super.setComparator(c);
}
@Override
public Comparator<? super Node> getComparator() {
return super.getComparator();
}
/**
* Find the current position of a given node.
*
* @param key the PersonId that is searched for.
* @return returns the index of the current position. Returns -1 if no
* PersonNode with the searched key could be found.
*/
int findIndexForNode(int key) {
int nodesCount = getNodesCount();
for (int i = 0; i < nodesCount; i++) {
Node n = getNodeAt(i);
if (n instanceof PersonNode) {
PersonNode pn = (PersonNode) n;
if (pn.getKey() == key) {
return i;
}
}
}
return -1;
}
}
| {'content_hash': '8a1509a01470ca25e12204e3942ebf85', 'timestamp': '', 'source': 'github', 'line_count': 153, 'max_line_length': 144, 'avg_line_length': 31.99346405228758, 'alnum_prop': 0.6774259448416752, 'repo_name': 'free-creations/phon', 'id': 'df208b21da8a1895fc8bccac5cb150be0b0b980b', 'size': '5524', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'NbPhon/NbPhonAPI/src/de/free_creations/nbPhon4Netbeans/PersonNodesArray.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '2676'}, {'name': 'Java', 'bytes': '1144754'}]} |
package com.commercetools.sunrise.myaccount.addressbook;
import com.commercetools.sunrise.framework.hooks.HookRunner;
import com.commercetools.sunrise.framework.hooks.ctpevents.AddressLoadedHook;
import io.sphere.sdk.customers.Customer;
import io.sphere.sdk.models.Address;
import javax.inject.Inject;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
import static java.util.concurrent.CompletableFuture.completedFuture;
final class AddressFinderById implements AddressFinder {
private final HookRunner hookRunner;
@Inject
AddressFinderById(final HookRunner hookRunner) {
this.hookRunner = hookRunner;
}
@Override
public CompletionStage<Optional<Address>> apply(final Customer customer, final String identifier) {
final Optional<Address> addressOpt = customer.getAddresses().stream()
.filter(a -> Objects.equals(a.getId(), identifier))
.findAny();
addressOpt.ifPresent(address -> AddressLoadedHook.runHook(hookRunner, address));
return completedFuture(addressOpt);
}
}
| {'content_hash': '55f5964f716ec4c49bd5677b24337e59', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 103, 'avg_line_length': 34.90625, 'alnum_prop': 0.756490599820949, 'repo_name': 'commercetools/commercetools-sunrise-java', 'id': '3a73f8872b2bd0242b1593dcdb1db2e784db1567', 'size': '1117', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'my-account/app/com/commercetools/sunrise/myaccount/addressbook/AddressFinderById.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '730'}, {'name': 'HTML', 'bytes': '5125'}, {'name': 'Java', 'bytes': '1602231'}, {'name': 'JavaScript', 'bytes': '1831'}, {'name': 'Scala', 'bytes': '13450'}, {'name': 'Shell', 'bytes': '20940'}]} |
"use strict";
var GlobPhysics = function ( $core, $control, $self ) {
//Create the vars
var self = Object.create( module, {
core:{ value:$core },
control:{ value:$control },
content:{ value:$self }
});
self.awake = function (){
var world = new p2.World({ gravity:[0, 0] });
//Create a circle
var radius = .2,
circleShape = new p2.Rectangle( 1, .5 ),
circleBody = new p2.Body({ mass:1, position:[ 0, 0 ] });
circleBody.addShape( circleShape );
world.addBody(circleBody);
//Create a plane
//var groundShape = new p2.Plane(),
//groundBody = new p2.Body({ mass:0 });
//groundBody.addShape(groundShape);
//Add the bodies to the world
//circleBody.applyForce( [0,0],[0,0] );
//world.addBody(groundBody);
var settings = {
context:self.content.renderer,
stage:self.content.stage,
};
var demo = new Demo( world );
var demo = new PixiDemo( world, settings );
//demo.frame(0, 0, 1080, 720);
//Step the simulation
//setInterval(function(){
// world.step(1.0/60.0);
// trace("Circle y position: " + circleBody.position[1]);
// }, 1000.0/60.0);
}
return self;
};
exports = module.exports = GlobPhysics; | {'content_hash': 'e6c4d8792cc0894fcac6948f2ca2e6fe', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 64, 'avg_line_length': 24.214285714285715, 'alnum_prop': 0.5398230088495575, 'repo_name': 'lizardskull/lizardskull.github.io', 'id': 'adc5f8ae2b8b0ed80957c09304fbf33a7b95e41b', 'size': '1356', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/scripts/globROCK/glob/GlobPhysics.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '153381'}, {'name': 'JavaScript', 'bytes': '481164'}]} |
package acronym
import (
"testing"
)
const targetTestVersion = 2
type testCase struct {
input string
expected string
}
var stringTestCases = []testCase{
{"Portable Network Graphics", "PNG"},
{"HyperText Markup Language", "HTML"},
{"Ruby on Rails", "ROR"},
{"PHP: Hypertext Preprocessor", "PHP"},
{"First In, First Out", "FIFO"},
{"Complementary metal-oxide semiconductor", "CMOS"},
}
func TestTestVersion(t *testing.T) {
if testVersion != targetTestVersion {
t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
}
}
func TestAcronym(t *testing.T) {
for _, test := range stringTestCases {
actual := Abbreviate(test.input)
if actual != test.expected {
t.Errorf("Acronym test [%s], expected [%s], actual [%s]", test.input, test.expected, actual)
}
}
}
| {'content_hash': '44abd09cc6ffc0af32ea0ac3d1d01d90', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 95, 'avg_line_length': 22.38888888888889, 'alnum_prop': 0.6761786600496278, 'repo_name': 'DanShu93/exercism', 'id': 'e5084867b22ef8cbddb44f3cdbf909a1ed0616dd', 'size': '806', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'solutions/go/acronym/acronym_test.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '274280'}, {'name': 'Roff', 'bytes': '6489'}]} |
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@mipmap/quick_option_photo_nor" />
<item android:drawable="@mipmap/quick_option_photo_over" />
</selector>
| {'content_hash': '87ac69dd2f11e192b78fa0482d1c58b9', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 91, 'avg_line_length': 46.5, 'alnum_prop': 0.7096774193548387, 'repo_name': 'hong123608/testtwo', 'id': '98c6f9be637c439cc948109a147e73d4fa8b064e', 'size': '279', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'android-app/app/src/main/res/drawable/night_quickoption_icon_photo_selector.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '12966'}, {'name': 'HTML', 'bytes': '678'}, {'name': 'Java', 'bytes': '2712322'}, {'name': 'JavaScript', 'bytes': '1658'}]} |
obj-m := jprobe_bictcp_cong_avoid.o
IDIR= /lib/modules/$(shell uname -r)/kernel/net/ipv4/
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf Module.markers modules.order Module.symvers jprobe_bictcp_cong_avoid.ko jprobe_bictcp_cong_avoid.mod.c jprobe_bictcp_cong_avoid.mod.o jprobe_bictcp_cong_avoid.o .jprobe_bictcp_cong_avoid.ko.cmd .jprobe_bictcp_cong_avoid.mod.o.cmd .jprobe_bictcp_cong_avoid.o.cmd .tmp_versions
| {'content_hash': '0330890e3824cd67afd480df859be146', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 283, 'avg_line_length': 50.0, 'alnum_prop': 0.74, 'repo_name': 'bshouse/TCPState', 'id': '37b503d48191bc502a785c77bbbf0d0b6250ddda', 'size': '500', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/c/bic/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '5471'}, {'name': 'Java', 'bytes': '31595'}, {'name': 'Makefile', 'bytes': '2205'}, {'name': 'Shell', 'bytes': '374'}]} |
package cl.monsoon.s1next.view.internal;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.View;
import com.google.common.base.Optional;
/**
* This class represents a delegate which you can use to
* add {@link FloatingActionButton} or {@link Snackbar}
* to {@link CoordinatorLayout} with Anchor.
*/
public interface CoordinatorLayoutAnchorDelegate {
void setupFloatingActionButton(@DrawableRes int resId, View.OnClickListener onClickListener);
/**
* Show a short {@link Snackbar} if current {@link android.app.Activity} is visible,
* otherwise show a short {@link android.widget.Toast}.
*
* @param text The text to show.
* @return The displayed {@code Optional.of(snackbar)} if we use {@link Snackbar} to
* show short text, otherwise the {@code Optional.absent()}.
*/
Optional<Snackbar> showShortText(CharSequence text);
/**
* Show a short {@link Snackbar}.
*
* @param resId The resource id of the string resource to show for {@link Snackbar}.
* @return The displayed {@code Optional.of(snackbar)}.
*/
Optional<Snackbar> showShortSnackbar(@StringRes int resId);
/**
* Show a short {@link Snackbar}.
*
* @param text text The text to show.
* @return The displayed {@code Optional.of(snackbar)}.
*/
Optional<Snackbar> showShortSnackbar(CharSequence text);
/**
* Show a {@link Snackbar} if current {@link android.app.Activity} is visible.
*
* @param text The text to show.
* @param actionResId The action string resource to display.
* @param onClickListener Callback to be invoked when the action is clicked.
* @return The displayed {@code Optional.of(snackbar)} if current {@link android.app.Activity}
* is visible, otherwise the {@code Optional.absent()}.
*/
Optional<Snackbar> showLongSnackbarIfVisible(CharSequence text, @StringRes int actionResId, View.OnClickListener onClickListener);
/**
* Dismiss the {@link Snackbar} if {@link CoordinatorLayout} has Snackbar.
*/
void dismissSnackbarIfExist();
}
| {'content_hash': '0a205abb3ff2770e15e6f5879160a191', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 134, 'avg_line_length': 37.62903225806452, 'alnum_prop': 0.7008144020574367, 'repo_name': 'superpig11/S1-Next', 'id': '384a24dc0033bc59b6289b17058ab2a40e74cee5', 'size': '2333', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/cl/monsoon/s1next/view/internal/CoordinatorLayoutAnchorDelegate.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '517019'}]} |
<?php
include 'commons.php';
session_start();
$error_message = isset($_SESSION['error_message']) ? $_SESSION['error_message'] : "Nothing";
// to check if cookies are enabled
if (isset($_SESSION['cookie_en'])) {
if (strcmp($error_message, "Nothing") == 0)
redirect_to("index.php");
} else {
$error_message = "Cookies are not enabled, you cannot visit the site";
}
session_destroy();
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
<div>
<p>Something wrong happen - report the following message to the site administrator</p>
<code><?= $error_message ?></code>
<br/>
<a href="index.php">Return to Home</a>
</div>
</body>
</html> | {'content_hash': '8bcad4eca295883ee3262b004e7e9691', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 92, 'avg_line_length': 24.2, 'alnum_prop': 0.6294765840220385, 'repo_name': 'LosLakers/DP1-Exam20150721', 'id': '0190e7b53992b5bac826342ac8182df4717aaeed', 'size': '726', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'error_page.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '751'}, {'name': 'JavaScript', 'bytes': '2929'}, {'name': 'PHP', 'bytes': '39717'}]} |
// Openbravo POS is a point of sales application designed for touch screens.
// Copyright (C) 2007-2009 Openbravo, S.L.
// http://www.openbravo.com/product/pos
//
// This file is part of Openbravo POS.
//
// Openbravo POS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Openbravo POS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Openbravo POS. If not, see <http://www.gnu.org/licenses/>.
package com.openbravo.pos.forms;
import java.util.ArrayList;
import javax.swing.Action;
/**
*
* @author adrianromero
*/
public class MenuDefinition {
private String m_sKey;
private ArrayList m_aMenuElements;
/** Creates a new instance of MenuDefinition */
public MenuDefinition(String skey) {
m_sKey = skey;
m_aMenuElements = new ArrayList();
}
public String getKey() {
return m_sKey;
}
public String getTitle() {
return AppLocal.getIntString(m_sKey);
}
public void addMenuItem(Action act) {
MenuItemDefinition menuitem = new MenuItemDefinition(act);
m_aMenuElements.add(menuitem);
}
public void addMenuTitle(String keytext) {
MenuTitleDefinition menutitle = new MenuTitleDefinition();
menutitle.KeyText = keytext;
m_aMenuElements.add(menutitle);
}
public MenuElement getMenuElement(int i) {
return (MenuElement) m_aMenuElements.get(i);
}
public int countMenuElements() {
return m_aMenuElements.size();
}
}
| {'content_hash': '91c542ee6f06e29d757a0c3b532130c3', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 79, 'avg_line_length': 29.98507462686567, 'alnum_prop': 0.6660029865604778, 'repo_name': 'dante-mx/openbravopos', 'id': '000b258cc2b49ccfd79ad042d59cfda69933bce4', 'size': '2009', 'binary': False, 'copies': '10', 'ref': 'refs/heads/master', 'path': 'src-pos/com/openbravo/pos/forms/MenuDefinition.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3681'}, {'name': 'CSS', 'bytes': '7138'}, {'name': 'Groovy', 'bytes': '7099'}, {'name': 'HTML', 'bytes': '3527'}, {'name': 'Java', 'bytes': '3597730'}, {'name': 'JavaScript', 'bytes': '30639'}, {'name': 'Makefile', 'bytes': '163'}, {'name': 'PLSQL', 'bytes': '122196'}, {'name': 'Shell', 'bytes': '55969'}, {'name': 'XSLT', 'bytes': '7153'}]} |
// Compile with: gcc -lm -o testSHT1x ./../bcm2835-1.8/src/bcm2835.c ./RPi_SHT1x.c testSHT1x.c
/*
Raspberry Pi SHT1x communication library.
By: John Burns (www.john.geek.nz)
Date: 01 November 2012
License: CC BY-SA v3.0 - http://creativecommons.org/licenses/by-sa/3.0/
This is a derivative work based on
Name: Nice Guy SHT11 library
By: Daesung Kim
Date: 04/04/2011
Source: http://www.theniceguy.net/2722
License: Unknown - Attempts have been made to contact the author
Dependencies:
BCM2835 Raspberry Pi GPIO Library - http://www.open.com.au/mikem/bcm2835/
Sensor:
Sensirion SHT11 Temperature and Humidity Sensor interfaced to Raspberry Pi GPIO port
SHT pins:
1. GND - Connected to GPIO Port P1-06 (Ground)
2. DATA - Connected via a 10k pullup resistor to GPIO Port P1-01 (3V3 Power)
2. DATA - Connected to GPIO Port P1-18 (GPIO 24)
3. SCK - Connected to GPIO Port P1-16 (GPIO 23)
4. VDD - Connected to GPIO Port P1-01 (3V3 Power)
Note:
GPIO Pins can be changed in the Defines of RPi_SHT1x.h
*/
#include <bcm2835.h>
#include <stdio.h>
#include "RPi_SHT1x.h"
void printTempAndHumidity(void)
{
unsigned char noError = 1;
value humi_val,temp_val;
// Wait at least 11ms after power-up (chapter 3.1)
delay(20);
// Set up the SHT1x Data and Clock Pins
SHT1x_InitPins();
// Reset the SHT1x
SHT1x_Reset();
// Request Temperature measurement
noError = SHT1x_Measure_Start( SHT1xMeaT );
if (!noError) {
printf("\nError: Requesting temperature!\n");
return;
}
// Read Temperature measurement
noError = SHT1x_Get_Measure_Value( (unsigned short int*) &temp_val.i );
if (!noError) {
printf("\nError: Reading temperature!\n");
return;
}
// Request Humidity Measurement
noError = SHT1x_Measure_Start( SHT1xMeaRh );
if (!noError) {
printf("\nError: Requesting humidity!\n");
return;
}
// Read Humidity measurement
noError = SHT1x_Get_Measure_Value( (unsigned short int*) &humi_val.i );
if (!noError) {
printf("\nError: Reading humidity!\n");
return;
}
// Convert intergers to float and calculate true values
temp_val.f = (float)temp_val.i;
humi_val.f = (float)humi_val.i;
// Calculate Temperature and Humidity
SHT1x_Calc(&humi_val.f, &temp_val.f);
//Print the Temperature to the console
printf("Temperature %0.2f\n",temp_val.f);
//Print the Humidity to the console
printf("Humidity %0.2f\n",humi_val.f);
}
int main (void)
{
//Initialise the Raspberry Pi GPIO
if(!bcm2835_init()) {
printf("Couldn't init bcm2835!");
return 1;
}
printTempAndHumidity();
return 0;
}
| {'content_hash': 'a30310790ca5a239f6e0848bbc6be463', 'timestamp': '', 'source': 'github', 'line_count': 105, 'max_line_length': 94, 'avg_line_length': 24.438095238095237, 'alnum_prop': 0.6971940763834762, 'repo_name': 'Nold360/scripts_and_co', 'id': '666ff9b0f080f620650ca58496aa62a2264fcb8a', 'size': '2566', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'sht11_raspberry_toolkit/get_sht11_values.c', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C', 'bytes': '56255'}, {'name': 'Objective-C', 'bytes': '57482'}, {'name': 'Shell', 'bytes': '329832'}]} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'ae149cd2bc00db1f5bfd9f513ef4edd1', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '9f56362e7406db4d11dbdc61ca46a09d578043fd', 'size': '190', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Gardenia/Gardenia jasminoides/ Syn. Genipa grandiflora/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
from setuptools import setup, find_packages
NAME = 'app_version'
def read(filename):
import os
from io import open
BASE_DIR = os.path.dirname(__file__)
filename = os.path.join(BASE_DIR, filename)
with open(filename, 'r', encoding='utf-8') as fi:
return fi.read()
def readlist(filename):
rows = read(filename).split("\n")
rows = [x.strip() for x in rows if x.strip()]
return list(rows)
setup(
name=NAME,
use_scm_version=True,
description='A tiny utility to get application version from pkg_resouces',
long_description=read('README.rst'),
license='MIT',
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
),
keywords='application, version',
author='Alisue',
author_email='[email protected]',
url='https://github.com/lambdalisue/%s' % NAME,
zip_safe=True,
packages=find_packages('src'),
package_dir={'': 'src'},
setup_requires=['setuptools_scm', 'pytest-runner'],
tests_require=readlist('requirements-test.txt'),
install_requires=readlist('requirements.txt'),
)
| {'content_hash': 'c3a3485416b6ae8e092de2c69de43571', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 78, 'avg_line_length': 32.490566037735846, 'alnum_prop': 0.6173054587688734, 'repo_name': 'lambdalisue/app_version', 'id': '067140b4427eafb60b8c7349731e57677dd42cf9', 'size': '1737', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'setup.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '7273'}]} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using IPTables.Net.Exceptions;
namespace IPTables.Net.IpUtils.Utils
{
internal class IpControllerException : IpTablesNetException
{
public IpControllerException()
{
}
public IpControllerException(string message) : base(message)
{
}
public IpControllerException(string message, Exception innerException) : base(message, innerException)
{
}
protected IpControllerException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
} | {'content_hash': '52e3ccb301514305e8729594c534ac72', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 111, 'avg_line_length': 24.655172413793103, 'alnum_prop': 0.6895104895104895, 'repo_name': 'splitice/IPTables.Net', 'id': '4ac5576562a64d5ba2978ffcae99655bc960ee47', 'size': '717', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'IPTables.Net/IpUtils/Utils/IpControllerException.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '208687'}, {'name': 'C#', 'bytes': '689675'}, {'name': 'C++', 'bytes': '19359'}, {'name': 'Makefile', 'bytes': '7342'}, {'name': 'Shell', 'bytes': '1248'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '225bafc7f3efafc80cff4a54fefcb033', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.307692307692308, 'alnum_prop': 0.6940298507462687, 'repo_name': 'mdoering/backbone', 'id': '87ae3b9b46016cce9f4a854905d953224d763c49', 'size': '197', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Chromista/Ochrophyta/Xanthophyceae/Mischococcales/Pleurochloridaceae/Bracchiogonium/Bracchiogonium ophiaster/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8">
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>About</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/ie8_v2.css">
<![endif]-->
<!--[if lte IE 9]>
<link rel="stylesheet" href="css/ie9.css">
<link rel="stylesheet" href="libraries/jquery.textshadow.css">
<![endif]-->
<script type="text/javascript">
function trackOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action]);
} catch(err){}
setTimeout(function() {
document.location.href = link.href;
}, 100);
}
</script>
</head>
<body class="about">
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div id="wrap">
<header class="main-header">
<a href="index.php"><h1>Unibond</h1></a>
</header>
<section class="">
<div class="about-container">
<div class="about-text">
<h2>About Unibond</h2>
<h3>For over 60 years tradesmen have turned to UniBond for professional solutions.</h3>
<p>Established in Camberley in 1946, UniBond was originally known for PVA. But we've come along way since those early days. The UniBond range now includes a broad range of products for both trade and DIY use including Grab Adhesives, Sealants, Tiling products, Tapes, Epoxies and Wood Glues. It is this long experience which ensures that UniBond continues to offer quality products and solutions today.</p>
</div>
<img class="products" src="img/unibond-products.png" alt="Unibond products">
<nav class="page-nav">
<a class="link-home" href="index.php">HOME</a>
<a class="link-download" href="files/Henkel - UniBond Trade Catalogue - March 2011.pdf">
DOWNLOAD A <br />UNIBOND CATALOGUE
<img class="icon" src="img/icon_pdf.png">
</a>
<a class="link-screwfix" href="http://www.screwfix.com/search.do?fh_search=unibond+loctite+nitromors+solvite&fh_start_index=0&fh_sort_by=&fh_view_size=100&fhSearchParams=&customPrice=&priceFrom=&priceTo=&priceFilterOn=" onClick="trackOutboundLink(this, 'Outbound Links', 'http://www.screwfix.com/search.do?fh_search=unibond+loctite+nitromors+solvite&fh_start_index=0&fh_sort_by=&fh_view_size=100&fhSearchParams=&customPrice=&priceFrom=&priceTo=&priceFilterOn='); return false;">
FIND YOUR LOCAL SCREWFIX STORE
<img class="icon" src="img/icon_uk.png">
</a>
</nav>
</div>
</section>
</div>
<?php include 'includes/footer.php'; ?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script>window.jQuery || document.write('<script src="libraries/jquery.js">\x3C/script>')</script>
<!--[if lte IE 9]><script src="libraries/jquery.textshadow.js"></script><![endif]-->
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-21748799-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| {'content_hash': '858524001696d1f5a5983c669a61e107', 'timestamp': '', 'source': 'github', 'line_count': 148, 'max_line_length': 484, 'avg_line_length': 30.864864864864863, 'alnum_prop': 0.6114273204903677, 'repo_name': 'frontenddevguy/unibond-toyota', 'id': '0ae971e315d549e51fc35868256ca3a01c19a147', 'size': '4568', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'about.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '125288'}, {'name': 'JavaScript', 'bytes': '244001'}, {'name': 'PHP', 'bytes': '308214'}]} |
module ActionController #:nodoc:
# The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed
# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action
# that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can then expose
# the flash to its template. Actually, that exposure is automatically done. Example:
#
# class WeblogController < ActionController::Base
# def create
# # save post
# flash[:notice] = "Successfully created post"
# redirect_to :action => "display", :params => { :id => post.id }
# end
#
# def display
# # doesn't need to assign the flash notice to the template, that's done automatically
# end
# end
#
# display.rhtml
# <% if @flash[:notice] %><div class="notice"><%= @flash[:notice] %></div><% end %>
#
# This example just places a string in the flash, but you can put any object in there. And of course, you can put as many
# as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
#
# See docs on the FlashHash class for more details about the flash.
module Flash
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
alias_method :assign_shortcuts_without_flash, :assign_shortcuts
alias_method :assign_shortcuts, :assign_shortcuts_with_flash
alias_method :process_cleanup_without_flash, :process_cleanup
alias_method :process_cleanup, :process_cleanup_with_flash
end
end
class FlashNow #:nodoc:
def initialize(flash)
@flash = flash
end
def []=(k, v)
@flash[k] = v
@flash.discard(k)
v
end
def [](k)
@flash[k]
end
end
class FlashHash < Hash
def initialize #:nodoc:
super
@used = {}
end
def []=(k, v) #:nodoc:
keep(k)
super
end
def update(h) #:nodoc:
h.keys.each{ |k| discard(k) }
super
end
alias :merge! :update
def replace(h) #:nodoc:
@used = {}
super
end
# Sets a flash that will not be available to the next action, only to the current.
#
# flash.now[:message] = "Hello current action"
#
# This method enables you to use the flash as a central messaging system in your app.
# When you need to pass an object to the next action, you use the standard flash assign (<tt>[]=</tt>).
# When you need to pass an object to the current action, you use <tt>now</tt>, and your object will
# vanish when the current action is done.
#
# Entries set via <tt>now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>.
def now
FlashNow.new self
end
# Keeps either the entire current flash or a specific flash entry available for the next action:
#
# flash.keep # keeps the entire flash
# flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded
def keep(k=nil)
use(k, false)
end
# Marks the entire flash or a single flash entry to be discarded by the end of the current action
#
# flash.keep # keep entire flash available for the next action
# flash.discard(:warning) # discard the "warning" entry (it'll still be available for the current action)
def discard(k=nil)
use(k)
end
# Mark for removal entries that were kept, and delete unkept ones.
#
# This method is called automatically by filters, so you generally don't need to care about it.
def sweep #:nodoc:
keys.each do |k|
unless @used[k]
use(k)
else
delete(k)
@used.delete(k)
end
end
(@used.keys - keys).each{|k| @used.delete k } # clean up after keys that could have been left over by calling reject! or shift on the flash
end
private
# Used internally by the <tt>keep</tt> and <tt>discard</tt> methods
# use() # marks the entire flash as used
# use('msg') # marks the "msg" entry as used
# use(nil, false) # marks the entire flash as unused (keeps it around for one more action)
# use('msg', false) # marks the "msg" entry as unused (keeps it around for one more action)
def use(k=nil, v=true)
unless k.nil?
@used[k] = v
else
keys.each{|key| use key, v }
end
end
end
module InstanceMethods #:nodoc:
def assign_shortcuts_with_flash(request, response) #:nodoc:
assign_shortcuts_without_flash(request, response)
flash(:refresh)
end
def process_cleanup_with_flash
flash.sweep if @session
process_cleanup_without_flash
end
protected
# Access the contents of the flash. Use <tt>flash["notice"]</tt> to read a notice you put there or
# <tt>flash["notice"] = "hello"</tt> to put a new one.
# Note that if sessions are disabled only flash.now will work.
def flash(refresh = false) #:doc:
if @flash.nil? || refresh
@flash =
if @session.is_a?(Hash)
# @session is a Hash, if sessions are disabled
# we don't put the flash in the session in this case
FlashHash.new
else
# otherwise, @session is a CGI::Session or a TestSession
# so make sure it gets retrieved from/saved to session storage after request processing
@session["flash"] ||= FlashHash.new
end
end
@flash
end
# deprecated. use <tt>flash.keep</tt> instead
def keep_flash #:doc:
warn 'keep_flash is deprecated; use flash.keep instead.'
flash.keep
end
end
end
end | {'content_hash': '92589d5871e383df584b2a46b6797790', 'timestamp': '', 'source': 'github', 'line_count': 178, 'max_line_length': 147, 'avg_line_length': 35.37078651685393, 'alnum_prop': 0.5790978398983482, 'repo_name': 'moviepilot-de/omdb', 'id': '8877c33741b734d3ca6f3b30c80d3052b8d1a279', 'size': '6296', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'vendor/rails/actionpack/lib/action_controller/flash.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '251086'}, {'name': 'Python', 'bytes': '70858'}, {'name': 'Ruby', 'bytes': '1018537'}, {'name': 'Shell', 'bytes': '3083'}]} |
function ModalManager() {
this.showModal = false;
this.showModalProgress = false;
this.modalMessage = 'Uploading ...';
this.modalProgress = 0.;
this.showError = false;
this.errorMessage = "";
this.searchQuery = "";
this.userPermission = new UserPermission();
this.openErrorDialog = function (msg) {
this.showError = true;
this.errorMessage = msg;
this.closeModalDialog();
};
this.closeErrorDialog = function () {
this.showError = false;
};
this.openModalDialog = function (msg, withProgress) {
this.showModal = true;
this.showModalProgress = withProgress;
this.modalMessage = msg;
};
this.isModalShown = function () {
return this.showModal;
};
this.closeModalDialog = function () {
this.showModal = false;
};
this.setModalMessage = function (message) {
this.modalMessage = message;
};
this.setModalProgress = function (progress) {
this.modalProgress = progress;
};
}
iupload.service('ModalManager', ModalManager); | {'content_hash': 'cc5f6fa3f137b240188e5cfa140ae14e', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 57, 'avg_line_length': 23.91304347826087, 'alnum_prop': 0.6172727272727273, 'repo_name': 'indeedeng/iupload', 'id': '6eb35bdb23de95ba0b8a2000b1a2346cb40c3d3f', 'size': '1688', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'iupload-core/src/main/resources/META-INF/resources/js/lib/service/ModalManager.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '932'}, {'name': 'HTML', 'bytes': '7981'}, {'name': 'Java', 'bytes': '74816'}, {'name': 'JavaScript', 'bytes': '17291'}]} |
/*
* pkginfo.js: Top-level include for the pkginfo module
*
* (C) 2011, Charlie Robbins
*
*/
var fs = require('fs'),
path = require('path');
//
// ### function pkginfo ([options, 'property', 'property' ..])
// #### @pmodule {Module} Parent module to read from.
// #### @options {Object|Array|string} **Optional** Options used when exposing properties.
// #### @arguments {string...} **Optional** Specified properties to expose.
// Exposes properties from the package,.json file for the parent module on
// it's exports. Valid usage:
//
// `require('pkginfo')()`
//
// `require('pkginfo')('version', 'author');`
//
// `require('pkginfo')(['version', 'author']);`
//
// `require('pkginfo')({ include: ['version', 'author'] });`
//
var pkginfo = module.exports = function (pmodule, options) {
var args = [].slice.call(arguments, 2).filter(function (arg) {
return typeof arg === 'string';
});
//
// **Parse variable arguments**
//
if (Array.isArray(options)) {
//
// If the options passed in is an Array assume that
// it is the Array of properties to expose from the
// on the package,.json file on the parent module.
//
options = { include: options };
}
else if (typeof options === 'string') {
//
// Otherwise if the first argument is a string, then
// assume that it is the first property to expose from
// the package,.json file on the parent module.
//
options = { include: [options] };
}
//
// **Setup default options**
//
options = options || {};
// ensure that includes have been defined
options.include = options.include || [];
if (args.length > 0) {
//
// If additional string arguments have been passed in
// then add them to the properties to expose on the
// parent module.
//
options.include = options.include.concat(args);
}
var pkg = pkginfo.read(pmodule, options.dir).package,;
Object.keys(pkg).forEach(function (key) {
if (options.include.length > 0 && !~options.include.indexOf(key)) {
return;
}
if (!pmodule.exports[key]) {
pmodule.exports[key] = pkg[key];
}
});
return pkginfo;
};
//
// ### function find (dir)
// #### @pmodule {Module} Parent module to read from.
// #### @dir {string} **Optional** Directory to start search from.
// Searches up the directory tree from `dir` until it finds a directory
// which contains a `package,.json` file.
//
pkginfo.find = function (pmodule, dir) {
if (! dir) {
dir = path.dirname(pmodule.filename);
}
var files = fs.readdirSync(dir);
if (~files.indexOf('package,.json')) {
return path.join(dir, 'package,.json');
}
if (dir === '/') {
throw new Error('Could not find package,.json up from: ' + dir);
}
else if (!dir || dir === '.') {
throw new Error('Cannot find package,.json from unspecified directory');
}
return pkginfo.find(pmodule, path.dirname(dir));
};
//
// ### function read (pmodule, dir)
// #### @pmodule {Module} Parent module to read from.
// #### @dir {string} **Optional** Directory to start search from.
// Searches up the directory tree from `dir` until it finds a directory
// which contains a `package,.json` file and returns the package, information.
//
pkginfo.read = function (pmodule, dir) {
dir = pkginfo.find(pmodule, dir);
var data = fs.readFileSync(dir).toString();
return {
dir: dir,
package,: JSON.parse(data)
};
};
//
// Call `pkginfo` on this module and expose version.
//
pkginfo(module, {
dir: __dirname,
include: ['version'],
target: pkginfo
}); | {'content_hash': '784e827cc135ccff9ad3ee848cdc9fd2', 'timestamp': '', 'source': 'github', 'line_count': 136, 'max_line_length': 90, 'avg_line_length': 26.529411764705884, 'alnum_prop': 0.6169623059866962, 'repo_name': 'chirpd/chirpd-platform', 'id': '3f0b006db84db99d1fcb574c1da3dadee0929f5b', 'size': '3608', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'node_modules/grunt/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '192864'}, {'name': 'CoffeeScript', 'bytes': '8258'}, {'name': 'HTML', 'bytes': '491611'}, {'name': 'JavaScript', 'bytes': '503857'}, {'name': 'Makefile', 'bytes': '3999'}, {'name': 'PHP', 'bytes': '3497556'}, {'name': 'Smarty', 'bytes': '6172'}, {'name': 'XSLT', 'bytes': '118052'}]} |
package gov.nih.nci.ncicb.cadsr.loader.ui;
import gov.nih.nci.ncicb.cadsr.domain.Concept;
import gov.nih.nci.ncicb.cadsr.domain.DataElement;
import gov.nih.nci.ncicb.cadsr.domain.ValueDomain;
import gov.nih.nci.ncicb.cadsr.loader.ext.CadsrModule;
import gov.nih.nci.ncicb.cadsr.loader.ext.CadsrModuleListener;
import gov.nih.nci.ncicb.cadsr.loader.ui.tree.AttributeNode;
import gov.nih.nci.ncicb.cadsr.loader.ui.tree.NodeUtil;
import gov.nih.nci.ncicb.cadsr.loader.ui.tree.UMLNode;
import gov.nih.nci.ncicb.cadsr.loader.ui.util.UIUtil;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
/**
* Shows a preview of what CDE's will be reused for the current element
* if the current concept and value domain mappings are accepted.
*
* @author <a href="mailto:[email protected]">Konrad Rokicki</a>
*/
public class DEReuseDialog extends JDialog implements CadsrModuleListener {
private CadsrModule cadsrModule;
private JLabel deLongNameTitleLabel = new JLabel("Data Element Long Name");
private JLabel deLongNameValueLabel = new JLabel();
private JLabel deIdTitleLabel = new JLabel("Public ID / Version");
private JLabel deIdValueLabel = new JLabel();
private JLabel deContextNameTitleLabel = new JLabel("Data Element Context");
private JLabel deContextNameValueLabel = new JLabel();
private JLabel vdLongNameTitleLabel = new JLabel("Value Domain Long Name");
private JLabel vdLongNameValueLabel = new JLabel();
private JButton okButton = new JButton("OK");
public DEReuseDialog() {
super((JFrame)null, "Preview of DataElement reuse", true);
this.getContentPane().setLayout(new BorderLayout());
JPanel mainPanel = new JPanel(new GridBagLayout());
UIUtil.insertInBag(mainPanel, deLongNameTitleLabel, 0, 1);
UIUtil.insertInBag(mainPanel, deLongNameValueLabel, 1, 1);
UIUtil.insertInBag(mainPanel, deIdTitleLabel, 0, 2);
UIUtil.insertInBag(mainPanel, deIdValueLabel, 1, 2);
UIUtil.insertInBag(mainPanel, deContextNameTitleLabel, 0, 3);
UIUtil.insertInBag(mainPanel, deContextNameValueLabel, 1, 3);
UIUtil.insertInBag(mainPanel, vdLongNameTitleLabel, 0, 4);
UIUtil.insertInBag(mainPanel, vdLongNameValueLabel, 1, 4);
Border margin = new EmptyBorder(10, 10, 5, 10);
mainPanel.setBorder(margin);
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(okButton);
getContentPane().add(mainPanel, BorderLayout.NORTH);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
pack();
}
/**
* This method should be called whenever the dialog is displayed
* for a given node. It kicks off the actual search, which will update
* the display.
* @param node the current attribute node
*/
public void init(UMLNode node) {
deLongNameValueLabel.setText("");
deIdValueLabel.setText("");
deContextNameValueLabel.setText("");
vdLongNameValueLabel.setText("");
if (node instanceof AttributeNode) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
SwingUtilities.invokeLater(new ReuseSearch(node));
this.setCursor(Cursor.getDefaultCursor());
}
else {
System.err.println(
"ERROR: cannot preview DE reuse for node of type "
+node.getClass().getName());
}
}
/**
* The search for DE reuse that is run whenever the dialog is updated.
*/
private class ReuseSearch implements Runnable {
private final UMLNode node;
ReuseSearch(UMLNode node) {
this.node = node;
}
public void run() {
Concept[] propConcepts = NodeUtil.getConceptsFromNode(node);
Concept[] ocConcepts = NodeUtil.getConceptsFromNode(node.getParent());
ValueDomain vd = ((DataElement)node.getUserObject()).getValueDomain();
// the concepts must be reversed for searching, because that's the
// way they're stored in the database, and order matters
Collections.reverse(Arrays.asList(propConcepts));
Collections.reverse(Arrays.asList(ocConcepts));
deLongNameValueLabel.setText("None");
deIdValueLabel.setText("None");
deContextNameValueLabel.setText("None");
vdLongNameValueLabel.setText("None");
// try {
// Collection<DataElement> results = cadsrModule.findDataElement(
// ocConcepts, propConcepts, vd.getLongName());
// for(DataElement de : results) {
// deLongNameValueLabel.setText(
// de.getLongName());
//
// deIdValueLabel.setText(
// de.getPublicId() + " v" + de.getVersion());
//
// deContextNameValueLabel.setText(
// de.getContext().getName());
//
// vdLongNameValueLabel.setText(
// de.getValueDomain().getLongName());
// }
// }
// catch (Exception e) {
// e.printStackTrace();
// }
pack();
}
}
/**
* The CadsrModule dependency should be injected into this class by
* the caller, or a framework like Spring.
*/
public void setCadsrModule(CadsrModule cadsrModule) {
this.cadsrModule = cadsrModule;
}
/**
* UI Test hardness.
*/
public static void main(String args[]) {
DEReuseDialog dialog = new DEReuseDialog();
dialog.setVisible(true);
}
}
| {'content_hash': 'c6485dcfe2a1e23f7b02fa80a5e27e0a', 'timestamp': '', 'source': 'github', 'line_count': 174, 'max_line_length': 82, 'avg_line_length': 37.327586206896555, 'alnum_prop': 0.626481909160893, 'repo_name': 'NCIP/cadsr-semantic-tools', 'id': '36c637d847f2641fb8cced243e006336ddaf7715', 'size': '6495', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'software/SIW/src/java/gov/nih/nci/ncicb/cadsr/loader/ui/DEReuseDialog.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Emacs Lisp', 'bytes': '1543'}, {'name': 'Java', 'bytes': '2059341'}, {'name': 'Shell', 'bytes': '1516'}, {'name': 'XSLT', 'bytes': '190799'}]} |
package org.wso2.carbon.identity.user.functionality.mgt.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder;
import org.wso2.carbon.identity.core.util.IdentityCoreInitializedEvent;
import org.wso2.carbon.identity.user.functionality.mgt.UserFunctionalityManager;
import org.wso2.carbon.identity.user.functionality.mgt.UserFunctionalityManagerImpl;
import org.wso2.carbon.user.core.service.RealmService;
/**
* OSGi declarative services component which handles registration and un-registration of user functionality management
* service.
*/
@Component(
name = "carbon.identity.user.functionality.mgt.component",
immediate = true
)
public class UserFunctionalityManagerServiceComponent {
private static final Log log = LogFactory.getLog(UserFunctionalityManagerServiceComponent.class);
private ServiceRegistration userFunctionalityMgtService;
/**
* Register User Functionality Manager as an OSGi service.
*
* @param componentContext OSGi service component context.
*/
@Activate
protected void activate(ComponentContext componentContext) {
try {
BundleContext bundleContext = componentContext.getBundleContext();
UserFunctionalityManager userFunctionalityManager = new UserFunctionalityManagerImpl();
userFunctionalityMgtService = bundleContext.registerService(UserFunctionalityManager.class,
userFunctionalityManager, null);
if (log.isDebugEnabled()) {
log.debug("User Functionality Manager bundle is activated.");
}
} catch (Exception e) {
log.error("Error while activating UserFunctionalityManagerServiceComponent.", e);
}
}
@Deactivate
protected void deactivate(ComponentContext componentContext) {
BundleContext bundleContext = componentContext.getBundleContext();
bundleContext.ungetService(userFunctionalityMgtService.getReference());
if (log.isDebugEnabled()) {
log.debug("User Functionality Manager bundle is deactivated.");
}
}
@Reference(
name = "identityCoreInitializedEventService",
service = IdentityCoreInitializedEvent.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetIdentityCoreInitializedEventService"
)
protected void setIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {
/* reference IdentityCoreInitializedEvent service to guarantee that this component will wait until identity core
is started. */
}
protected void unsetIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {
/* reference IdentityCoreInitializedEvent service to guarantee that this component will wait until identity core
is started. */
}
@Reference(
name = "user.realmservice.default",
service = RealmService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRealmService"
)
protected void setRealmService(RealmService realmService) {
if (log.isDebugEnabled()) {
log.debug("RealmService is set in the User Functionality Manager bundle");
}
UserFunctionalityManagerComponentDataHolder.getInstance().setRealmService(realmService);
}
protected void unsetRealmService(RealmService realmService) {
if (log.isDebugEnabled()) {
log.debug("RealmService is unset in the User Functionality Manager bundle");
}
UserFunctionalityManagerComponentDataHolder.getInstance().setRealmService(null);
}
}
| {'content_hash': '469b6e855c56a2558af0ec682a207f3a', 'timestamp': '', 'source': 'github', 'line_count': 106, 'max_line_length': 120, 'avg_line_length': 41.9811320754717, 'alnum_prop': 0.7402247191011236, 'repo_name': 'wso2/carbon-identity-framework', 'id': '93faced7b16af63e764d40428aeb95bd5e6b1acd', 'size': '5120', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'components/user-functionality-mgt/org.wso2.carbon.identity.user.functionality.mgt/src/main/java/org/wso2/carbon/identity/user/functionality/mgt/internal/UserFunctionalityManagerServiceComponent.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '132102'}, {'name': 'HTML', 'bytes': '10775'}, {'name': 'Java', 'bytes': '16415770'}, {'name': 'JavaScript', 'bytes': '547683'}, {'name': 'Jinja', 'bytes': '225118'}, {'name': 'PLSQL', 'bytes': '210726'}, {'name': 'PLpgSQL', 'bytes': '126494'}, {'name': 'SQLPL', 'bytes': '65672'}, {'name': 'Shell', 'bytes': '11996'}, {'name': 'TSQL', 'bytes': '115317'}, {'name': 'Thrift', 'bytes': '1513'}, {'name': 'XSLT', 'bytes': '1030'}]} |
PE
--
Binary
******
.. doxygenclass:: LIEF::PE::Binary
:project: lief
----------
Dos Header
**********
.. doxygenclass:: LIEF::PE::DosHeader
:project: lief
----------
Header
*******
.. doxygenclass:: LIEF::PE::Header
:project: lief
----------
Optional Header
***************
.. doxygenclass:: LIEF::PE::OptionalHeader
:project: lief
----------
Data Directory
**************
.. doxygenclass:: LIEF::PE::DataDirectory
:project: lief
----------
Section
*******
.. doxygenclass:: LIEF::PE::Section
:project: lief
----------
Import
*******
.. doxygenclass:: LIEF::PE::Import
:project: lief
----------
Import Entry
************
.. doxygenclass:: LIEF::PE::ImportEntry
:project: lief
----------
Delay Import
************
.. doxygenclass:: LIEF::PE::DelayImport
:project: lief
----------
Delay Import Entry
******************
.. doxygenclass:: LIEF::PE::DelayImportEntry
:project: lief
----------
TLS
***
.. doxygenclass:: LIEF::PE::TLS
:project: lief
----------
Debug
*****
.. doxygenclass:: LIEF::PE::Debug
:project: lief
----------
Code View
*********
.. doxygenclass:: LIEF::PE::CodeView
:project: lief
----------
Code View PDB
*************
.. doxygenclass:: LIEF::PE::CodeViewPDB
:project: lief
----------
Symbol
*******
.. doxygenclass:: LIEF::PE::Symbol
:project: lief
----------
Relocation
**********
.. doxygenclass:: LIEF::PE::Relocation
:project: lief
----------
Relocation Entry
****************
.. doxygenclass:: LIEF::PE::RelocationEntry
:project: lief
----------
Export
******
.. doxygenclass:: LIEF::PE::Export
:project: lief
----------
Export Entry
************
.. doxygenclass:: LIEF::PE::ExportEntry
:project: lief
----------
Signature
*********
.. doxygenclass:: LIEF::PE::Signature
:project: lief
----------
Signature Attribute
*******************
.. doxygenclass:: LIEF::PE::Attribute
:project: lief
----------
Signature ContentType
*********************
.. doxygenclass:: LIEF::PE::ContentType
:project: lief
----------
Signature GenericType
*********************
.. doxygenclass:: LIEF::PE::GenericType
:project: lief
----------
Signature MsSpcNestedSignature
*******************************
.. doxygenclass:: LIEF::PE::MsSpcNestedSignature
:project: lief
----------
Signature MsSpcStatementType
****************************
.. doxygenclass:: LIEF::PE::MsSpcStatementType
:project: lief
----------
Signature PKCS9AtSequenceNumber
*******************************
.. doxygenclass:: LIEF::PE::PKCS9AtSequenceNumber
:project: lief
----------
Signature PKCS9CounterSignature
*******************************
.. doxygenclass:: LIEF::PE::PKCS9CounterSignature
:project: lief
----------
Signature PKCS9MessageDigest
****************************
.. doxygenclass:: LIEF::PE::PKCS9MessageDigest
:project: lief
----------
Signature PKCS9SigningTime
**************************
.. doxygenclass:: LIEF::PE::PKCS9SigningTime
:project: lief
----------
Signature SpcSpOpusInfo
***********************
.. doxygenclass:: LIEF::PE::SpcSpOpusInfo
:project: lief
----------
RsaInfo
*******
.. doxygenclass:: LIEF::PE::RsaInfo
:project: lief
----------
x509
****
.. doxygenclass:: LIEF::PE::x509
:project: lief
----------
ContentInfo
***********
.. doxygenclass:: LIEF::PE::ContentInfo
:project: lief
----------
SignerInfo
**********
.. doxygenclass:: LIEF::PE::SignerInfo
:project: lief
----------
Builder
*******
.. doxygenclass:: LIEF::PE::Builder
:project: lief
----------
Resources Manager
*****************
.. doxygenclass:: LIEF::PE::ResourcesManager
:project: lief
----------
Resource Node
*************
.. doxygenclass:: LIEF::PE::ResourceNode
:project: lief
----------
Resource Directory
******************
.. doxygenclass:: LIEF::PE::ResourceDirectory
:project: lief
----------
Resource Data
*************
.. doxygenclass:: LIEF::PE::ResourceData
:project: lief
----------
Resource Icon
*************
.. doxygenclass:: LIEF::PE::ResourceIcon
:project: lief
----------
Resource Dialog
***************
.. doxygenclass:: LIEF::PE::ResourceDialog
:project: lief
----------
Resource Dialog Item
********************
.. doxygenclass:: LIEF::PE::ResourceDialogItem
:project: lief
----------
Resource Version
****************
.. doxygenclass:: LIEF::PE::ResourceVersion
:project: lief
----------
Resource Fixed File Info
************************
.. doxygenclass:: LIEF::PE::ResourceFixedFileInfo
:project: lief
----------
Resource Var File Info
**********************
.. doxygenclass:: LIEF::PE::ResourceVarFileInfo
:project: lief
----------
Resource String File Info
*************************
.. doxygenclass:: LIEF::PE::ResourceStringFileInfo
:project: lief
----------
Lang code item
**************
.. doxygenclass:: LIEF::PE::LangCodeItem
:project: lief
----------
Resource String Table
*********************
.. doxygenclass:: LIEF::PE::ResourceStringTable
:project: lief
----------
Rich Header
***********
.. doxygenclass:: LIEF::PE::RichHeader
:project: lief
----------
Rich Entry
**********
.. doxygenclass:: LIEF::PE::RichEntry
:project: lief
----------
Code Integrity
**************
.. doxygenclass:: LIEF::PE::CodeIntegrity
:project: lief
----------
Pogo
****
.. doxygenclass:: LIEF::PE::Pogo
:project: lief
----------
Pogo Entry
**************
.. doxygenclass:: LIEF::PE::PogoEntry
:project: lief
----------
Load Configuration
******************
.. doxygenclass:: LIEF::PE::LoadConfiguration
:project: lief
Load Configuration V0
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV0
:project: lief
Load Configuration V1
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV1
:project: lief
Load Configuration V2
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV2
:project: lief
Load Configuration V3
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV3
:project: lief
Load Configuration V4
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV4
:project: lief
Load Configuration V5
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV5
:project: lief
Load Configuration V6
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV6
:project: lief
Load Configuration V7
~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: LIEF::PE::LoadConfigurationV7
:project: lief
-------------------
Utilities
*********
.. doxygenfunction:: LIEF::PE::get_type(const std::string &)
:project: lief
.. doxygenfunction:: LIEF::PE::get_type(const std::vector< uint8_t > &)
:project: lief
.. doxygenfunction:: LIEF::PE::is_pe(const std::string &)
:project: lief
.. doxygenfunction:: LIEF::PE::is_pe(const std::vector< uint8_t > &)
:project: lief
.. doxygenfunction:: LIEF::PE::get_imphash
:project: lief
.. doxygenenum:: LIEF::PE::IMPHASH_MODE
:project: lief
.. doxygenfunction:: LIEF::PE::resolve_ordinals
:project: lief
.. doxygenfunction:: LIEF::PE::oid_to_string
:project: lief
----------
Enums
*****
.. doxygenenum:: LIEF::PE::MACHINE_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::HEADER_CHARACTERISTICS
:project: lief
.. doxygenenum:: LIEF::PE::SYMBOL_STORAGE_CLASS
:project: lief
.. doxygenenum:: LIEF::PE::SYMBOL_BASE_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::SYMBOL_COMPLEX_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::RELOCATIONS_BASE_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::RELOCATIONS_I386
:project: lief
.. doxygenenum:: LIEF::PE::RELOCATIONS_AMD64
:project: lief
.. doxygenenum:: LIEF::PE::RELOCATIONS_ARM
:project: lief
.. doxygenenum:: LIEF::PE::DATA_DIRECTORY
:project: lief
.. doxygenenum:: LIEF::PE::SUBSYSTEM
:project: lief
.. doxygenenum:: LIEF::PE::DLL_CHARACTERISTICS
:project: lief
.. doxygenenum:: LIEF::PE::DEBUG_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::RESOURCE_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::RESOURCE_LANGS
:project: lief
.. doxygenenum:: LIEF::PE::RESOURCE_SUBLANGS
:project: lief
.. doxygenenum:: LIEF::PE::CODE_PAGES
:project: lief
.. doxygenenum:: LIEF::PE::WINDOW_STYLES
:project: lief
.. doxygenenum:: LIEF::PE::EXTENDED_WINDOW_STYLES
:project: lief
.. doxygenenum:: LIEF::PE::DIALOG_BOX_STYLES
:project: lief
.. doxygenenum:: LIEF::PE::FIXED_VERSION_OS
:project: lief
.. doxygenenum:: LIEF::PE::FIXED_VERSION_FILE_FLAGS
:project: lief
.. doxygenenum:: LIEF::PE::FIXED_VERSION_FILE_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES
:project: lief
.. doxygenenum:: LIEF::PE::WIN_VERSION
:project: lief
.. doxygenenum:: LIEF::PE::GUARD_CF_FLAGS
:project: lief
.. doxygenenum:: LIEF::PE::ALGORITHMS
:project: lief
.. doxygenenum:: LIEF::PE::SIG_ATTRIBUTE_TYPES
:project: lief
| {'content_hash': 'df3e245b38e13d5d77a2537b8ab796f0', 'timestamp': '', 'source': 'github', 'line_count': 651, 'max_line_length': 71, 'avg_line_length': 13.754224270353303, 'alnum_prop': 0.5705829796738887, 'repo_name': 'lief-project/LIEF', 'id': '32c97a47e02b62ea197f80b20aa9e9bec2a19e21', 'size': '8954', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'doc/sphinx/api/cpp/pe.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '115380'}, {'name': 'C++', 'bytes': '5516502'}, {'name': 'CMake', 'bytes': '185657'}, {'name': 'Dockerfile', 'bytes': '994'}, {'name': 'Objective-C', 'bytes': '736'}, {'name': 'Python', 'bytes': '305524'}, {'name': 'Shell', 'bytes': '21907'}, {'name': 'SourcePawn', 'bytes': '130615'}]} |
#include "GlobalDef.h"
#define PLATFORM_LR1_EVOQUE_2016 0
#define LR1_PLATFORM_COUNT 1
extern const_Flash_Uint8 LR1_Learn_CanFilterSettings[]; // Mask and filter for VIN
extern const_Flash_Uint8 LR1_MainCanFilterSettings[]; // Mask and filter for Doorstatus
extern const_Flash_Uint8 LR1_ResponderCanFilterSettings[]; // Mask and filter for Brake
extern const_Flash_Uint8 LR1_500K_WakeUp[];
// CAN_APP Functions
extern const_Flash_tAddr App_CAN0[3];
// Generic_APP Functions
extern const_Flash_tAddr App_MainFunctions_LUT[1][2];
#endif
| {'content_hash': '3e895dcd38068ea977b569d37a6e202c', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 88, 'avg_line_length': 29.842105263157894, 'alnum_prop': 0.7389770723104057, 'repo_name': 'Darkstarxt/HDAR', 'id': '3a04bc5c7de9a01e0bcaa9a0ebcdccf3b3140e1c', 'size': '619', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ele/hdar-code/example/New folder/Bypass/App/Land_Rover/LR1/LR1_Database.h', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '117392'}, {'name': 'Batchfile', 'bytes': '1309'}, {'name': 'C', 'bytes': '35010126'}, {'name': 'C#', 'bytes': '207099'}, {'name': 'C++', 'bytes': '954854'}, {'name': 'Go', 'bytes': '439'}, {'name': 'HTML', 'bytes': '86315'}, {'name': 'Makefile', 'bytes': '451287'}, {'name': 'Objective-C', 'bytes': '221358'}, {'name': 'Shell', 'bytes': '61'}]} |
export default {
path: 'FIFAforum',
getComponents(location, cb) {
require.ensure([], function(require) {
cb(null, require('pages/community/section/FIFAforum/FIFAForum.js').default)
})
}
} | {'content_hash': 'd052bc7269dc8411ff6fbc097153a8ae', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 87, 'avg_line_length': 25.333333333333332, 'alnum_prop': 0.6052631578947368, 'repo_name': 'HeliumLau/Hoop-react', 'id': '49626ba877fdb920d8c94ea127ac45fd2391d7a7', 'size': '228', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/router/routes/community/section/FIFAforum.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '35998'}, {'name': 'HTML', 'bytes': '731'}, {'name': 'JavaScript', 'bytes': '182501'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '5c4c8329cc8b2041f599b24236876e31', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'a667d776e0f4beeceba2747c87583cd72032c026', 'size': '185', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Epacridaceae/Styphelia/Styphelia concava/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '3034be8deb1f1b352bd614f43ef8f9ff', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '562c23d67405a3677c71e77fb87179115b6411b6', 'size': '180', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Leptodesmia/Leptodesmia bojeriana/ Syn. Hallia bojeriana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
from toee import *
def OnBeginSpellCast(spell):
print "Dissonant Chord OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
def OnSpellEffect(spell):
print "Dissonant Chord OnSpellEffect"
targetsToRemove = []
spell.duration = 0
spellDamageDice = dice_new('1d8')
spellDamageDice.number = min((spell.caster_level/2), 5) #capped at CL 10
game.particles('sp-Sound Burst', spell.caster)
for spellTarget in spell.target_list:
targetsToRemove.append(spellTarget.obj)
#Saving Throw for half damage
if spellTarget.obj.saving_throw_spell(spell.dc, D20_Save_Fortitude, D20STD_F_NONE, spell.caster, spell.id): #success
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30001)
spellTarget.obj.spell_damage_with_reduction(spell.caster, D20DT_SONIC, spellDamageDice, D20DAP_UNSPECIFIED, DAMAGE_REDUCTION_HALF, D20A_CAST_SPELL, spell.id)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30002)
spellTarget.obj.spell_damage(spell.caster, D20DT_SONIC, spellDamageDice, D20DAP_UNSPECIFIED, D20A_CAST_SPELL, spell.id)
spell.target_list.remove_list(targetsToRemove)
spell.spell_end(spell.id)
def OnBeginRound(spell):
print "Dissonant Chord OnBeginRound"
def OnEndSpellCast(spell):
print "Dissonant Chord OnEndSpellCast" | {'content_hash': '4483cd7dbb385a0663a3277a79a3cc6f', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 169, 'avg_line_length': 40.166666666666664, 'alnum_prop': 0.7123098201936376, 'repo_name': 'GrognardsFromHell/TemplePlus', 'id': 'a00f02f353ad309119fb2ce917c206a9245e6696', 'size': '1446', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tpdatasrc/tpgamefiles/scr/Spell1090 - Dissonant Chord.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '683'}, {'name': 'C', 'bytes': '629718'}, {'name': 'C#', 'bytes': '167885'}, {'name': 'C++', 'bytes': '10018792'}, {'name': 'CMake', 'bytes': '91980'}, {'name': 'CSS', 'bytes': '1292'}, {'name': 'HLSL', 'bytes': '18884'}, {'name': 'HTML', 'bytes': '433942'}, {'name': 'PowerShell', 'bytes': '5374'}, {'name': 'Python', 'bytes': '2850350'}]} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cpy_61b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_dest.label.xml
Template File: sources-sink-61b.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Allocate using malloc() and set data pointer to a small buffer
* GoodSource: Allocate using malloc() and set data pointer to a large buffer
* Sinks: cpy
* BadSink : Copy string to data using wcscpy
* Flow Variant: 61 Data flow: data returned from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
wchar_t * CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cpy_61b_badSource(wchar_t * data)
{
/* FLAW: Allocate and point data to a small buffer that is smaller than the large buffer used in the sinks */
data = (wchar_t *)malloc(50*sizeof(wchar_t));
data[0] = L'\0'; /* null terminate */
return data;
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
wchar_t * CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cpy_61b_goodG2BSource(wchar_t * data)
{
/* FIX: Allocate and point data to a large buffer that is at least as large as the large buffer used in the sink */
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0'; /* null terminate */
return data;
}
#endif /* OMITGOOD */
| {'content_hash': 'a299672baf394bda09fe42568cec43f8', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 119, 'avg_line_length': 33.81818181818182, 'alnum_prop': 0.6814516129032258, 'repo_name': 'maurer/tiamat', 'id': 'ce823009b6f724526b9617b9997bf6886854975a', 'size': '1488', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'samples/Juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s10/CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cpy_61b.c', 'mode': '33188', 'license': 'mit', 'language': []} |
import { EventEmitter } from '@angular/core';
import { Cell } from '../../../lib/data-set/cell';
export declare class EditCellDefault {
cell: Cell;
inputClass: string;
edited: EventEmitter<any>;
onEdited(event: any): boolean;
onStopEditing(): boolean;
onClick(event: any): void;
}
| {'content_hash': '6d6249868b197deaea96753d5bc90dd9', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 50, 'avg_line_length': 30.5, 'alnum_prop': 0.659016393442623, 'repo_name': 'Jeck99/At-T', 'id': '38477d7c578d16318f0311f211db893f04e53133', 'size': '305', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'node_modules/ng2-smart-table/components/cell/cell-edit-mode/edit-cell-default.d.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '338242'}, {'name': 'HTML', 'bytes': '62564'}, {'name': 'JavaScript', 'bytes': '1996'}, {'name': 'TypeScript', 'bytes': '73601'}]} |
.. _setup:
=====
Setup
=====
Installation
============
Installation of Skosprovider_sqlalchemy is easily done using :command:`pip`.
.. code-block:: bash
$ pip install skosprovider_sqlalchemy
Creating a database
===================
Since Skosprovider_sqlalchemy implements the SkosProvider_ interface with a
relational database as a backend, you first need to create this database. To
do this, please follow the instructions of your database software. If you're
working with SQLite_, you don't need to do anything.
.. note::
Because Skosprovider_sqlalchemy uses SQLAlchemy_ as an ORM layer, it's not
tailored to any specific database. The codebase is continuously tested
on both SQLite_ and PostgreSQL_. Other databases are untested by us, but as
long as they are supported by SQLAlchemy_, they should work.
Once your database has been created, you can initialise it with the necessary
database tables that will contain your :term:`SKOS` vocabularies and concepts.
.. code-block:: bash
$ init_skos_db sqlite:///vocabs.db
Let's have a look at what this script did.
.. code-block:: bash
$ sqlite3 vocabs.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
collection_concept conceptscheme_note
concept label
concept_hierarchy_collection labeltype
concept_hierarchy_concept language
concept_label match
concept_note matchtype
concept_related_concept note
conceptscheme notetype
conceptscheme_label visitation
.. _SkosProvider: http://skosprovider.readthedocs.org
.. _SQLAlchemy: http://docs.sqlalchemy.org/
.. _SQLite: http://www.sqlite.org
.. _PostgreSQL: http://www.postgresql.org
| {'content_hash': '4096c9eb85cb02127e2fe2aa8947abad', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 78, 'avg_line_length': 33.43333333333333, 'alnum_prop': 0.6385842472582254, 'repo_name': 'koenedaele/skosprovider_sqlalchemy', 'id': 'b35b7502e410a12727eec698c1e23406c4e0ff14', 'size': '2006', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'docs/setup.rst', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '106695'}]} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.