code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
<!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 io.js v2.0.1 - v2.3.0: Member List</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 io.js v2.0.1 - v2.3.0
</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="headertitle">
<div class="title">v8::Date Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1_date.html">v8::Date</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#afeb999e9225dad0ca8605ed3015b268b">CallAsConstructor</a>(int argc, Handle< Value > argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ac8dea845a715de7ad43fcb073dc8c3d9">CallAsFunction</a>(Handle< Value > recv, int argc, Handle< Value > argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Cast</b>(v8::Value *obj) (defined in <a class="el" href="classv8_1_1_date.html">v8::Date</a>)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Cast</b>(T *value) (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a5018c9d085aa71f65530cf1e073a04ad">Clone</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#af6966283a7d7e20779961eed434db04d">CreationContext</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_date.html#adb084ec0683d3d195ad0f78af5f6f72b">DateTimeConfigurationChangeNotification</a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Delete</b>(Handle< Value > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Delete</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>DeleteHiddenValue</b>(Handle< String > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>DeletePrivate</b>(Handle< Private > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#adc2a7a92a120675bbd4c992163a20869">Equals</a>(Handle< Value > that) const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#ab2c5f7369abf08ae8f44dc84f5aa335a">FindInstanceInPrototypeChain</a>(Handle< FunctionTemplate > tmpl)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ForceSet</b>(Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Get</b>(Handle< Value > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Get</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a435f68bb7ef0f64dd522c5c910682448">GetAlignedPointerFromInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a65b5a3dc93c0774594f8b0f2ab5481c8">GetAlignedPointerFromInternalField</a>(const PersistentBase< Object > &object, int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a7bbe987794658f20a3ec1b68326305e6">GetConstructorName</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetHiddenValue</b>(Handle< String > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#ac1ece41e81a499920ec3a2a3471653bc">GetIdentityHash</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesExternalArrayData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetIndexedPropertiesExternalArrayDataLength</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesExternalArrayDataType</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetIndexedPropertiesPixelData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesPixelDataLength</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#aa3324fdf652d8ac3b2f27faa0559231d">GetInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ab991b53d50ab3ce53179e927e52b24f5">GetIsolate</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#aece53e208f3a25b3d5d47cfc134db49a">GetOwnPropertyDescriptor</a>(Local< String > key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#aeb48075bdfb7b2b49fe08361a6c4d2a8">GetOwnPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetPrivate</b>(Handle< Private > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a45506d0a9192b023284b0211e9bf545b">GetPropertyAttributes</a>(Handle< Value > key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a9f45786246c6e6027b32f685d900a41f">GetPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ae8d3fed7d6dbd667c29cabb3039fe7af">GetPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a0eeeb35c6dc002a8359ebc445a49e964">GetRealNamedProperty</a>(Handle< String > key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a36273f157697ff5e8e776a1461755182">GetRealNamedPropertyInPrototypeChain</a>(Handle< String > key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Has</b>(Handle< Value > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Has</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a278913bcd203434870ce5184a538a9af">HasIndexedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasIndexedPropertiesInExternalArrayData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasIndexedPropertiesInPixelData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a1e96fcb9ee17101c0299ec68f2cf8610">HasNamedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasOwnProperty</b>(Handle< String > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a5b6c320c5a31e2a3ddbd464835c8e9a7">HasPrivate</a>(Handle< Private > key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealIndexedProperty</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasRealNamedCallbackProperty</b>(Handle< String > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealNamedProperty</b>(Handle< String > key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#aaec28576353eebe6fee113bce2718ecc">InternalFieldCount</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a324a71142f621a32bfe5738648718370">InternalFieldCount</a>(const PersistentBase< Object > &object)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ad06a4b1f7215d852c367df390491ac84">IsArgumentsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a65f9dad740f2468b44dc16349611c351">IsArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#ad54475d15b7e6b6e17fc80fb4570cdf2">IsArrayBufferView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#abe7bc06283e5e66013f2f056a943168b">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a23c2c1f23b50fab4a02e2f819641b865">IsCallable</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#afd20ab51e79658acc405c12dad2260ab">IsDataView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a4effc7ca1a221dd8c1e23c0f28145ef0">IsFloat32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a293f140b81b0219d1497e937ed948b1e">IsFloat64Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a1cbbebde8c256d051c4606a7300870c6">IsGeneratorFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a72982768acdadd82d1df02a452251d14">IsGeneratorObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a928c586639dd75ae4efdaa66b1fc4d50">IsInt16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a48eac78a49c8b42d9f8cf05c514b3750">IsInt32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a10a88a2794271dfcd9c3abd565e8f28a">IsInt8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a71ef50f22d6bb4a093cc931b3d981c08">IsMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#af9c52a0668fa3260a0d12a2cdf895b4e">IsMapIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a8829b16b442a6231499c89fd5a6f8049">IsName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a579fb52e893cdc24f8b77e5acc77d06d">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a5f4aa9504a6d8fc3af9489330179fe14">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a93d6a0817b15a1d28050ba16e131e6b4">IsPromise</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#aae41e43486937d6122c297a0d43ac0b8">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a220bd4056471ee1dda8ab9565517edd7">IsSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#addbae0104e07b990ee1af0bd7927824b">IsSetIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a3e0f2727455fd01a39a60b92f77e28e0">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#af3e6081c22d09a7bbc0a2aff59ed60a5">IsSymbol</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a867baa94cb8f1069452359e6cef6751e">IsSymbolObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#ac2f2f6c39f14a39fbb5b43577125dfe4">IsTypedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a4a45fabf58b241f5de3086a3dd0a09ae">IsUint16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a783c89631bac4ef3c4b909f40cc2b8d8">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a5e39229dc74d534835cf4ceba10676f4">IsUint32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#acbe2cd9c9cce96ee498677ba37c8466d">IsUint8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ad3cb464ab5ef0215bd2cbdd4eb2b7e3d">IsUint8ClampedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#aab0297b39ed8e2a71b5dca7950228a36">IsWeakMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a6f5a238206cbd95f98e2da92cab72e80">IsWeakSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(Isolate *isolate, double time) (defined in <a class="el" href="classv8_1_1_date.html">v8::Date</a>)</td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>New</b>(Isolate *isolate) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>NumberValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#aeb2f524c806075e5f9032a24afd86869">ObjectProtoToString</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SameValue</b>(Handle< Value > that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Handle< Value > key, Handle< Value > value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Set</b>(uint32_t index, Handle< Value > value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessor</b>(Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetAccessor</b>(Handle< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessorProperty</b>(Local< Name > name, Local< Function > getter, Handle< Function > setter=Handle< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a0ccba69581f0b5e4e672bab90f26879b">SetAlignedPointerInInternalField</a>(int index, void *value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a2200482b09feb914dc91d8256671f7f0">SetHiddenValue</a>(Handle< String > key, Handle< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a530f661dec20ce1a0a1b15a45195418c">SetIndexedPropertiesToExternalArrayData</a>(void *data, ExternalArrayType array_type, int number_of_elements)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a6c552c4817b9a0eff1fb12b7ef089026">SetIndexedPropertiesToPixelData</a>(uint8_t *data, int length)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a361b1781e7db29b17b063ef31315989e">SetInternalField</a>(int index, Handle< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetPrivate</b>(Handle< Private > key, Handle< Value > value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ab54bbd70d60e62d8bc22a8c8a6be593e">SetPrototype</a>(Handle< Value > prototype)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>StrictEquals</b>(Handle< Value > that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ae810be0ae81a87f677592d0176daac48">ToArrayIndex</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToBoolean</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToBoolean</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToDetailString</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToDetailString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToInt32</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInt32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToInteger</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInteger</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToNumber</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToNumber</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToObject</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToObject</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToString</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToUint32</b>(Isolate *isolate) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToUint32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a6e9fe342c0f77995defa6b479d01a3bd">TurnOnAccessCheck</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Uint32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_date.html#a06800409271fe5fa74202e0fd1ec8e87">ValueOf</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_date.html">v8::Date</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:49:54 for V8 API Reference Guide for io.js v2.0.1 - v2.3.0 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>
| v8-dox/v8-dox.github.io | b16d9c2/html/classv8_1_1_date-members.html | HTML | mit | 41,550 |
<!--
Copyright 2005-2008 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!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" lang="en" xml:lang="en">
<head>
<TITLE>Adobe Software Technology Lab: auto_ptr< X, Traits > Class Template Reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
<LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body>
<div id='content'>
<table><tr>
<td colspan='5'>
<div id='opensource_banner'>
<table style='width: 100%; padding: 5px;'><tr>
<td align='left'>
<a href='index.html' style='border: none'><img src='stlab2007.jpg' alt="stlab.adobe.com"/></a>
</td>
<td align='right'>
<a href='http://www.adobe.com' style='border: none'><img src='adobe_hlogo.gif' alt="Adobe Systems Incorporated"/></a>
</td>
</tr></table>
</div>
</td></tr><tr>
<td valign="top">
<div id='navtable' height='100%'>
<div style='margin: 5px'>
<h4>Documentation</h4>
<a href="group__asl__overview.html">Overview</a><br/>
<a href="asl_readme.html">Building ASL</a><br/>
<a href="asl_toc.html">Documentation</a><br/>
<a href="http://stlab.adobe.com/wiki/index.php/Supplementary_ASL_Documentation">Library Wiki Docs</a><br/>
<a href="asl_indices.html">Indices</a><br/>
<a href="http://stlab.adobe.com/perforce/">Browse Perforce</a><br/>
<h4>More Info</h4>
<a href="asl_release_notes.html">Release Notes</a><br/>
<a href="http://stlab.adobe.com/wiki/">Wiki</a><br/>
<a href="asl_search.html">Site Search</a><br/>
<a href="licenses.html">License</a><br/>
<a href="success_stories.html">Success Stories</a><br/>
<a href="asl_contributors.html">Contributors</a><br/>
<h4>Media</h4>
<a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a><br/>
<a href="asl_download_perforce.html">Perforce Depots</a><br/>
<h4>Support</h4>
<a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a><br/>
<a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a><br/>
<a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a><br/>
<a href="asl_contributing.html">Contribute to ASL</a><br/>
<h4>RSS</h4>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a><br/>
<h4>Other Adobe Projects</h4>
<a href="http://sourceforge.net/adobe/">Open @ Adobe</a><br/>
<a href="http://opensource.adobe.com/">Adobe Open Source</a><br/>
<a href="http://labs.adobe.com/">Adobe Labs</a><br/>
<a href="http://stlab.adobe.com/amg/">Adobe Media Gallery</a><br/>
<a href="http://stlab.adobe.com/performance/">C++ Benchmarks</a><br/>
<h4>Other Resources</h4>
<a href="http://boost.org">Boost</a><br/>
<a href="http://www.riaforge.com/">RIAForge</a><br/>
<a href="http://www.sgi.com/tech/stl">SGI STL</a><br/>
</div>
</div>
</td>
<td id='maintable' width="100%" valign="top">
<!-- End Header -->
<!-- Generated by Doxygen 1.7.2 -->
<div class="navpath">
<ul>
<li><a class="el" href="namespaceadobe.html">adobe</a> </li>
<li><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </li>
</ul>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<h1>auto_ptr< X, Traits > Class Template Reference<br/>
<small>
[<a class="el" href="group__memory.html">Memory</a>]</small>
</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="adobe::auto_ptr" --><!-- doxytag: inherits="auto_resource< X *, Traits >" -->
<p>The <code><a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">adobe::auto_ptr</a><></code> template adds a number of extensions to <code>std::auto_ptr<></code>.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="memory_8hpp_source.html">memory.hpp</a>></code></p>
<p><a href="classadobe_1_1auto__ptr-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><b>clear_type</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><b>error_on_const_auto_type< auto_ptr< Y, typename traits_type::template rebind< Y * >::other > const ></b></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef traits_type::element_type </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef traits_type::pointer_type </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef Traits </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#aada8c38edc7a4968494c4838ecfd99ce">traits_type</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a4775e8d2ba24664807347605c261789a">auto_ptr</a> (<a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a> p=0) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#ab0de1504f237180789f36df75ae4677e">auto_ptr</a> (<a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> &) throw ()</td></tr>
<tr><td class="memTemplParams" colspan="2">template<typename Y > </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a2847d37d05c107bf8d268f6370dd1b42">auto_ptr</a> (std::auto_ptr< Y > r) throw ()</td></tr>
<tr><td class="memTemplParams" colspan="2">template<typename Y > </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#ad6eb012788de2cc68c19446b54880577">auto_ptr</a> (const <a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< Y, typename traits_type::template rebind< Y * >::other > &) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#ae5281bab050c2d379ef73fc26e5b1553">auto_ptr</a> (std::auto_ptr< X > r) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#ad06e392b201745b8985deb5f590c10e8">operator std::auto_ptr< X ></a> () throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#abfbf061d8025ca8b9c5cf9cd8ef82b88">operator*</a> () const throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#aa02aff17e8ad44033e0f937c86b00dc6">operator-></a> () const throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a8f5b742b9a6ccb3abc0da2dabab363ff">operator=</a> (const clear_type *) throw ()</td></tr>
<tr><td class="memTemplParams" colspan="2">template<typename Y > </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a1236d88f4331aa55bbbd341701ae351c">operator=</a> (<a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< Y, typename traits_type::template rebind< Y * >::other >) throw ()</td></tr>
<tr><td class="memTemplParams" colspan="2">template<typename Y > </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a30ba978cd74937b547d341631a625bb1">operator=</a> (std::auto_ptr< Y >) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#ac860dee02600e57ea658195f26e6b209">operator=</a> (<a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> &) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a24996f62ff720a8c91c75f65ce27fa26">operator=</a> (std::auto_ptr< X >) throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classadobe_1_1auto__ptr.html#a7f0b260d22255dca9ff15e8951538d2e">operator[]</a> (std::size_t index) const throw ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<typename X, class Traits = ptr_traits<X*>><br/>
class adobe::auto_ptr< X, Traits ></h3>
<p>Although <code>std::auto_ptr<></code> is a non-regular type, it has proven to be valueable especially when converting C or non-exception aware C++ to exception aware C++ code. It is also useful when dealing with C libraries (such as OS libraries) that by necisity return pointers.</p>
<p>However, <code>std::auto_ptr<></code> has a number of limitations that make use error prone, limit when it can be used, and make it's use more combursome than necessary.</p>
<p>The <code><a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">auto_ptr</a><></code> includes the following not present in <code>std::auto_ptr<></code>:</p>
<ul>
<li>The inclusion of ptr_traits to support alternative delete functions.</li>
<li>Proper support for array types.</li>
<li>Support for assignment from function results.</li>
<li>Safe bool casts.</li>
<li>Assignment and construction from NULL.</li>
</ul>
<p>Also, <code><a class="el" href="classadobe_1_1auto__resource.html" title="The template class auto_resource< X, Traits > provides similar functionality to auto_ptr for re...">auto_resource</a><></code> is provided for non-pointer and opaque pointer references.</p>
<p><b>Rationals:</b></p>
<p>Rational for not going with boost: scoped_ptr interface: The interface to boost:scoped_ptr is a constrained subset of <a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">auto_ptr</a> with out any improvements. I'm not a fan of providing a whole new interface to prevent the user from performing some operations.</p>
<p>Rational for traits instead of policies:</p>
<ul>
<li>Advantages of policies<ul>
<li>allows for per-instance state.</li>
<li>would allow for use with boost::function.</li>
</ul>
</li>
<li>Disadvanteages<ul>
<li>no real world examples to demonstrate the advantages.</li>
<li>complicates implementation to properly handle exceptions from throwing when assigning policies.</li>
<li>prohibits use of no-throw in declarations (may not be an actual disadvantage).</li>
<li>would require more complex interface for constructors.</li>
<li>would require swap be added to the interface to achieve a non-throwing swap and it is unclear how swap could be generally implemented.</li>
</ul>
</li>
</ul>
<p>In total I thought the advantages didn't warrant the effort. If someone come demonstrate a concrete instance where there would be a strong advantage I'd reconsider.</p>
<p>Differences between photoshop linear types and adobe:: types:</p>
<ul>
<li>traits_type replaces deallocator and provides custom null checks</li>
<li>Safe bool casts.</li>
<li>Assignment and construction from NULL.</li>
<li>template based constructor, assignment, and conversion</li>
</ul>
<ul>
<li>linear_resource -> <a class="el" href="classadobe_1_1auto__resource.html" title="The template class auto_resource< X, Traits > provides similar functionality to auto_ptr for re...">adobe::auto_resource</a></li>
<li>linear_base_ptr -> <a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">adobe::auto_ptr</a></li>
<li>linear_array<T> -> <a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">adobe::auto_ptr</a><T[]></li>
<li>linear_ptr -> <a class="el" href="classadobe_1_1auto__ptr.html" title="The adobe::auto_ptr<> template adds a number of extensions to std::auto_ptr<>.">adobe::auto_ptr</a> </li>
</ul>
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00398">398</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
<hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="a02574fcd6538ed96656939b0a9054092"></a><!-- doxytag: member="adobe::auto_ptr::element_type" ref="a02574fcd6538ed96656939b0a9054092" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef traits_type::element_type <a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reimplemented from <a class="el" href="classadobe_1_1auto__resource.html#a02574fcd6538ed96656939b0a9054092">auto_resource< X *, Traits ></a>.</p>
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00405">405</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a733dfdff2b2b0c1cfa60513deeabc5d6"></a><!-- doxytag: member="adobe::auto_ptr::pointer_type" ref="a733dfdff2b2b0c1cfa60513deeabc5d6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef traits_type::pointer_type <a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reimplemented from <a class="el" href="classadobe_1_1auto__resource.html#a733dfdff2b2b0c1cfa60513deeabc5d6">auto_resource< X *, Traits ></a>.</p>
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00406">406</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="aada8c38edc7a4968494c4838ecfd99ce"></a><!-- doxytag: member="adobe::auto_ptr::traits_type" ref="aada8c38edc7a4968494c4838ecfd99ce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef Traits <a class="el" href="classadobe_1_1auto__ptr.html#aada8c38edc7a4968494c4838ecfd99ce">traits_type</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reimplemented from <a class="el" href="classadobe_1_1auto__resource.html#aada8c38edc7a4968494c4838ecfd99ce">auto_resource< X *, Traits ></a>.</p>
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00404">404</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="a4775e8d2ba24664807347605c261789a"></a><!-- doxytag: member="adobe::auto_ptr::auto_ptr" ref="a4775e8d2ba24664807347605c261789a" args="(pointer_type p=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a> </td>
<td class="paramname"> <em>p</em> = <code>0</code> )</td>
<td> throw ()<code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00529">529</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab0de1504f237180789f36df75ae4677e"></a><!-- doxytag: member="adobe::auto_ptr::auto_ptr" ref="ab0de1504f237180789f36df75ae4677e" args="(auto_ptr &)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00534">534</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad6eb012788de2cc68c19446b54880577"></a><!-- doxytag: member="adobe::auto_ptr::auto_ptr" ref="ad6eb012788de2cc68c19446b54880577" args="(const auto_ptr< Y, typename traits_type::template rebind< Y * >::other > &)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< Y, typename traits_type::template rebind< Y * >::other > & </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00540">540</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae5281bab050c2d379ef73fc26e5b1553"></a><!-- doxytag: member="adobe::auto_ptr::auto_ptr" ref="ae5281bab050c2d379ef73fc26e5b1553" args="(std::auto_ptr< X > r)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </td>
<td>(</td>
<td class="paramtype">std::auto_ptr< X > </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00572">572</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a2847d37d05c107bf8d268f6370dd1b42"></a><!-- doxytag: member="adobe::auto_ptr::auto_ptr" ref="a2847d37d05c107bf8d268f6370dd1b42" args="(std::auto_ptr< Y > r)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a> </td>
<td>(</td>
<td class="paramtype">std::auto_ptr< Y > </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00578">578</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad06e392b201745b8985deb5f590c10e8"></a><!-- doxytag: member="adobe::auto_ptr::operator std::auto_ptr< X >" ref="ad06e392b201745b8985deb5f590c10e8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">operator std::auto_ptr< X > </td>
<td>(</td>
<td class="paramname"> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00426">426</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="abfbf061d8025ca8b9c5cf9cd8ef82b88"></a><!-- doxytag: member="adobe::auto_ptr::operator*" ref="abfbf061d8025ca8b9c5cf9cd8ef82b88" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits >::<a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a> & operator* </td>
<td>(</td>
<td class="paramname"> )</td>
<td> const throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00601">601</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa02aff17e8ad44033e0f937c86b00dc6"></a><!-- doxytag: member="adobe::auto_ptr::operator->" ref="aa02aff17e8ad44033e0f937c86b00dc6" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits >::<a class="el" href="classadobe_1_1auto__ptr.html#a733dfdff2b2b0c1cfa60513deeabc5d6">pointer_type</a> operator-> </td>
<td>(</td>
<td class="paramname"> )</td>
<td> const throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00608">608</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac860dee02600e57ea658195f26e6b209"></a><!-- doxytag: member="adobe::auto_ptr::operator=" ref="ac860dee02600e57ea658195f26e6b209" args="(auto_ptr &)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00545">545</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a24996f62ff720a8c91c75f65ce27fa26"></a><!-- doxytag: member="adobe::auto_ptr::operator=" ref="a24996f62ff720a8c91c75f65ce27fa26" args="(std::auto_ptr< X >)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & operator= </td>
<td>(</td>
<td class="paramtype">std::auto_ptr< X > </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00583">583</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a30ba978cd74937b547d341631a625bb1"></a><!-- doxytag: member="adobe::auto_ptr::operator=" ref="a30ba978cd74937b547d341631a625bb1" args="(std::auto_ptr< Y >)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & operator= </td>
<td>(</td>
<td class="paramtype">std::auto_ptr< Y > </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00591">591</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1236d88f4331aa55bbbd341701ae351c"></a><!-- doxytag: member="adobe::auto_ptr::operator=" ref="a1236d88f4331aa55bbbd341701ae351c" args="(auto_ptr< Y, typename traits_type::template rebind< Y * >::other >)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< Y, typename traits_type::template rebind< Y * >::other > </td>
<td class="paramname"> <em>r</em> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00553">553</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8f5b742b9a6ccb3abc0da2dabab363ff"></a><!-- doxytag: member="adobe::auto_ptr::operator=" ref="a8f5b742b9a6ccb3abc0da2dabab363ff" args="(const clear_type *)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits > & operator= </td>
<td>(</td>
<td class="paramtype">const clear_type * </td>
<td class="paramname"> )</td>
<td> throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00563">563</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7f0b260d22255dca9ff15e8951538d2e"></a><!-- doxytag: member="adobe::auto_ptr::operator[]" ref="a7f0b260d22255dca9ff15e8951538d2e" args="(std::size_t index) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classadobe_1_1auto__ptr.html">auto_ptr</a>< X, Traits >::<a class="el" href="classadobe_1_1auto__ptr.html#a02574fcd6538ed96656939b0a9054092">element_type</a> & operator[] </td>
<td>(</td>
<td class="paramtype">std::size_t </td>
<td class="paramname"> <em>index</em> )</td>
<td> const throw ()</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="memory_8hpp_source.html#l00615">615</a> of file <a class="el" href="memory_8hpp_source.html">memory.hpp</a>.</p>
</div>
</div>
</div>
<!-- Begin Footer -->
</td></tr>
</table>
</div> <!-- content -->
<div class='footerdiv'>
<div id='footersub'>
<ul>
<li><a href="http://www.adobe.com/go/gftray_foot_aboutadobe">Company</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_contact_adobe">Contact Us</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_accessibility">Accessibility</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_report_piracy">Report Piracy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_permissions_trademarks">Permissions & Trademarks</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_product_license_agreements">Product License Agreements</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_feedback">Send Feedback</a></li>
</ul>
<div>
<p>Copyright © 2006-2007 Adobe Systems Incorporated.</p>
<p>Use of this website signifies your agreement to the <a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> and <a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>.</p>
<p>Search powered by <a href="http://www.google.com/" target="new">Google</a></p>
</div>
</div>
</div>
<script type="text/javascript">
_uacct = "UA-396569-1";
urchinTracker();
</script>
</body>
</html>
| brycelelbach/asl | documentation/html/classadobe_1_1auto__ptr.html | HTML | mit | 31,963 |
require_relative '../user'
RSpec.describe 'Tapjoy::LDAP::API::User' do
include_context 'user'
describe '#create' do
let(:ldap_attr) {{
uid: "test.user",
cn: "Test User",
objectclass: %w(
top
posixAccount
shadowAccount
inetOrgPerson
organizationalPerson
person
ldapPublicKey),
sn: "User",
givenname: "Test",
homedirectory: "/home/test.user",
loginshell: "/bin/bash",
mail: "[email protected]",
uidnumber: 10001,
gidnumber: 19000,
userpassword: '{SSHA}testpass'
}}
it 'creates a user' do
ARGV << %w(create -n test user -g users); ARGV.flatten!
allow(Tapjoy::LDAP::API::User).to receive(:create_password).and_return('testpass')
expect(fake_ldap).to receive(:add).with(distinguished_name, ldap_attr)
Tapjoy::LDAP::CLI::User.commands
end
end
describe '#delete' do
it 'deletes a user' do
ARGV << %w(delete -u test.user -f); ARGV.flatten!
# Tapjoy::LDAP::API::User.create(fname, lname,
# opts[:type], opts[:group])
allow(Tapjoy::LDAP::API::User).to receive(:create_password).and_return('testpass')
expect(fake_ldap).to receive(:delete).with(distinguished_name)
Tapjoy::LDAP::CLI::User.commands
end
end
end
| Tapjoy/ldap_tools | spec/tapjoy/ldap/api/user_spec.rb | Ruby | mit | 1,353 |
import React from 'react';
import $ from 'jquery';
import _ from 'lodash';
import Block from './Block';
export default class BlockGrid extends React.Component {
constructor() {
super();
this.setDefaults();
this.setContainerWidth = this.setContainerWidth.bind(this);
this.handleWindowResize = this.handleWindowResize.bind(this);
this.resizeTimer = null;
// throttle call to this func whenever an image is loaded
this.throttledSetContainerWidth = _.throttle(this.setContainerWidth, 500);
}
setDefaults(){
this.blockWidth = 260; // initial desired block width
this.borderWidth = 5;
this.wrapperWidth = 0;
this.colCount = 0;
this.blocks = [];
this.blockCount = 0;
}
handleWindowResize(){
clearTimeout(this.resizeTimer);
const _this = this;
this.resizeTimer = setTimeout(function() {
$('.block-container').css('width', '100%');
_this.setDefaults();
_this.setContainerWidth();
// above code computes false height of blocks
// so as a lose patch re-position blocks after 500 ms
setTimeout(_this.setContainerWidth, 700);
}, 200);
}
componentDidMount(){
this.setContainerWidth();
/*
height of each block is measured with an error the first time so there are some
space between blocks specially the top values of the grid.
Only solution seems like re calculating positions of the block after few seconds
*/
// _.delay(this.setContainerWidth, 3000);
// reset all blocks when window resized
$(window).resize(this.handleWindowResize);
}
componentWillReceiveProps(nextProps){
// after clicking Load More there will be newProps here
// Re calculate block positions so no error occurs when there are
// all image less blocks
// _.delay(this.setContainerWidth, 2000);
}
componentDidUpdate(prevProps, prevState){
if(this.blockCount != this.props.data.length){
this.setDefaults();
this.setContainerWidth();
}
}
componentWillUnmount(){
$(window).off("resize", this.handleWindowResize);
}
setContainerWidth(){
// setContainerWidth only first time we recieve BlockList data
if(this.wrapperWidth == 0){
this.wrapperWidth = $('.block-container').outerWidth();
this.colCount = Math.round(this.wrapperWidth/this.blockWidth);
$('.block').css('width', this.blockWidth);
this.blockCount = document.getElementsByClassName('block').length;
if(this.blockCount < this.colCount){
this.wrapperWidth = (this.blockWidth*this.blockCount) - ( (this.blockCount - 1) * this.borderWidth);
this.colCount = this.blockCount;
} else {
this.wrapperWidth = (this.blockWidth*this.colCount) - ( (this.colCount - 1) * this.borderWidth);
}
$('.block-container').css('width', this.wrapperWidth);
}
// if wrapperWidth is already calculated than just reset block positions
for( var i = 0; i < this.colCount; i++ )
this.blocks[i] = 0;
this.setBlocks();
}
setBlocks() {
const component = this;
$('.block').each(function(){
var min = Math.min.apply(Math, component.blocks);
var index = $.inArray(min, component.blocks);
var left = index * (component.blockWidth - component.borderWidth) - component.borderWidth;
// for the first blocks that needs to overlap container border
if(left == 0)
left = - component.borderWidth;
// start with overlap on top container border
var top = min + 10 - component.borderWidth;
$(this).css({
'top' : top + 'px',
'left' : left + 'px'
});
component.blocks[index] = top + this.offsetHeight;
});
// set wrapper height
var wrapperHeight = Math.max.apply(Math, this.blocks);
wrapperHeight += this.borderWidth; // block borders
$(".block-container").css("height",wrapperHeight + 'px');
}
renderBlocks() {
const { data } = this.props;
return data.map((pin) => {
return <Block {...pin} key={pin._id} loadHandler={this.throttledSetContainerWidth}/>;
});
}
render() {
return(
<div class="row">
<div class="col-sm-offset-2 col-sm-8 col-xs-offset-1 col-xs-10">
<div class="block-container">
{ this.renderBlocks() }
</div>
</div>
</div>
);
}
}
| Dishant15/TechIntrest | frontend/react/components/BlockGrid.js | JavaScript | mit | 4,139 |
<?php
namespace Eni\MainBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Eni\MainBundle\Entity\Question;
use Eni\MainBundle\Entity\ReponseProposee;
class LoadReponseProposeeData extends AbstractFixture implements OrderedFixtureInterface {
public function getOrder() {
return 6;
}
public function load(ObjectManager $oManager) {
//
//Question1
//
$oQuestion1 = $this->getReference('question1');
/* @var $oQuestion1 Question */
$tReponsesProposees = [
['enonce' => 'Dim', 'valide' => true],
['enonce' => 'Public', 'valide' => false],
['enonce' => 'Aucun mot-clé', 'valide' => false],
];
foreach ($tReponsesProposees as $tReponseProposee) {
$oReponseProposee = new ReponseProposee();
$oReponseProposee
->setQuestion($oQuestion1)
->setEnonce($tReponseProposee['enonce'])
->setValide($tReponseProposee['valide']);
$oQuestion1->addReponsesProposee($oReponseProposee);
$oManager->persist($oReponseProposee);
}
//
//Question2
//
$oQuestion2 = $this->getReference('question2');
/* @var $oQuestion2 Question */
$tReponsesProposees2 = [
['enonce' => 'VS refusera de compiler la dernière ligne de code', 'valide' => false],
['enonce' => ' La valeur de Res restera à True', 'valide' => false],
['enonce' => 'La valeur de Res sera False', 'valide' => true],
['enonce' => 'Res = 4', 'valide' => false],
];
foreach ($tReponsesProposees2 as $tReponseProposee) {
$oReponseProposee = new ReponseProposee();
$oReponseProposee
->setQuestion($oQuestion2)
->setEnonce($tReponseProposee['enonce'])
->setValide($tReponseProposee['valide']);
$oQuestion2->addReponsesProposee($oReponseProposee);
$oManager->persist($oReponseProposee);
}
//
//Question3
//
$oQuestion3 = $this->getReference('question3');
/* @var $oQuestion3 Question */
$tReponsesProposees3 = [
['enonce' => 'Un', 'valide' => false],
['enonce' => 'Deux', 'valide' => true],
['enonce' => 'Trois', 'valide' => false],
];
foreach ($tReponsesProposees3 as $tReponseProposee) {
$oReponseProposee = new ReponseProposee();
$oReponseProposee
->setQuestion($oQuestion3)
->setEnonce($tReponseProposee['enonce'])
->setValide($tReponseProposee['valide']);
$oQuestion3->addReponsesProposee($oReponseProposee);
$oManager->persist($oReponseProposee);
}
//
//Question4
//
$oQuestion4 = $this->getReference('question4');
/* @var $oQuestion4 Question */
$tReponsesProposees4 = [
['enonce' => 'Vrai', 'valide' => true],
['enonce' => 'Faux', 'valide' => false],
];
foreach ($tReponsesProposees4 as $tReponseProposee) {
$oReponseProposee = new ReponseProposee();
$oReponseProposee
->setQuestion($oQuestion4)
->setEnonce($tReponseProposee['enonce'])
->setValide($tReponseProposee['valide']);
$oQuestion4->addReponsesProposee($oReponseProposee);
$oManager->persist($oReponseProposee);
}
$oManager->flush();
}
}
| mneute/qcm-eni | src/Eni/MainBundle/DataFixtures/ORM/LoadReponseProposeeData.php | PHP | mit | 3,106 |
{% extends "layout.html" %}
{% block page_title %} Add medication {% endblock %}
{% block head %}
{% include "includes/head.html" %}
{% include "includes/scripts.html" %}
{% endblock %}
{% block after_header %}
{{ banner.input() }}
{% endblock %}
{% block content %}
<main id="content" role="main" tabindex="-1">
<div class="grid-row" id="FEP8">
<div class="column-two-thirds">
<h1 class="heading-large">Your <span class="currentCondition"></span> medication</h1>
<p>Tell us about your current <span class="currentCondition"></span> medication, as well as medication that you have now stopped taking</p>
<div class="form-group medication">
<div id="medication" class="medication">
</div>
</div>
<div class="form-group">
<a class="bold-small" id="add" href="javascript:goInvisible('/epilepsy/medication/add')">Add more medication</a>
</div>
<div class="form-group" id="question">
<input id="continue" name="continue" class="button" type="button" value="I have finished providing medication" onclick="validate()">
</div>
</div>
{% include "includes/widgets/need-help.html" %}
</div>
</main>
{% endblock %}
{% block body_end %}
<script type="text/javascript">
$('.currentCondition').html(getCurrentConditionName());
// If no medication added yet, show different messages
var medicationList = [];
var orderedMedicationList = [];
var medicationTable = "";
generateMedicationTable();
function validate() {
var question = "Provide details of your " + getCurrentConditionName() + " medication";
var medicationPlayback = "<div class='medication'><div class='grid-row'><p>Medication</p></div>";
var currentMedicationTotal = 0;
orderedMedicationList.forEach(function(medication, index, array) {
medicationPlayback += "<div class='grid-row'>";
medicationPlayback += "<div class='column-half'><p><strong>" + medication.name + "</strong></p></div>";
medicationPlayback += "<div class='column-half'><p>" + moment(medication.start).format("DD/MM/YYYY") + " – " + (medication.end !== undefined ? moment(medication.end).format('DD/MM/YYYY') : "Current") + "</p></div>";
medicationPlayback += "</div>";
if (medication.end === undefined) {
++currentMedicationTotal;
}
});
medicationPlayback += "</div>";
addResponse("FEP", "8", question, orderedMedicationList, medicationPlayback, '/epilepsy/medication/your-medication');
if (currentMedicationTotal > 0) {
go('/epilepsy/confused-drowsy');
} else {
go('/epilepsy/regular-check-ups');
}
}
function generateMedicationTable() {
medicationTable = "";
try {
medicationList = responses["FEP"]["8"].response;
orderedMedicationList = _(medicationList).chain().sortBy(function(medication) { return medication.start; }).sortBy(function(medication) { return medication.end; }).reverse().value();
orderedMedicationList.forEach(function(medication, index) {
medicationTable += '<div class="grid-row"><div class="column-third"><p class="bold-xsmall">' + medication.name + '</p></div><div class="column-third"><p class="font-xsmall">' + moment(medication.start).format('DD/MM/YYYY') + ' – ' + (medication.end !== undefined ? moment(medication.end).format('DD/MM/YYYY') : "Current") + '</p></div><div class="column-third"><p class="bold-xsmall"><a href="javascript:change(' + index + ')">Change <a href="javascript:remove(' + index + ')">Remove</a></p></div></div>'
});
$('#medication').html(medicationTable);
if (orderedMedicationList.length === 0) {
$('#add').html('Add medication');
$('#continue').val('I have never taken ' + getCurrentConditionName() + ' medication');
}
} catch (err) {
$('#add').html('Add medication');
$('#continue').val('I have never taken ' + getCurrentConditionName() + ' medication');
}
}
function remove(index) {
if (confirm('Are you sure want to remove this medication?')) {
orderedMedicationList.splice(index, 1);
addResponse("FEP", "8", question, orderedMedicationList, "List", '/epilepsy/medication/your-medication'); // Make sure ordering changes are saved
generateMedicationTable();
}
}
function change(index) {
addResponse("FEP", "8", question, orderedMedicationList, "List", '/epilepsy/medication/your-medication'); // Make sure ordering changes are saved for correct index
goInvisible('/epilepsy/medication/edit?change=' + index);
}
</script>
{% endblock %} | wayneddgu/fit2drive-ux | app/views/epilepsy/medication/your-medication.html | HTML | mit | 5,267 |
package com.exasol.adapter.dialects.bigquery;
import java.sql.Connection;
import java.sql.Types;
import com.exasol.adapter.AdapterProperties;
import com.exasol.adapter.dialects.IdentifierConverter;
import com.exasol.adapter.jdbc.BaseColumnMetadataReader;
import com.exasol.adapter.jdbc.JdbcTypeDescription;
import com.exasol.adapter.metadata.DataType;
/**
* This class implements BigQuery-specific reading of column metadata.
*/
public class BigQueryColumnMetadataReader extends BaseColumnMetadataReader {
/**
* Create a new instance of the {@link BigQueryColumnMetadataReader}.
*
* @param connection connection to the remote data source
* @param properties user-defined adapter properties
* @param identifierConverter converter between source and Exasol identifiers
*/
public BigQueryColumnMetadataReader(final Connection connection, final AdapterProperties properties,
final IdentifierConverter identifierConverter) {
super(connection, properties, identifierConverter);
}
@Override
public DataType mapJdbcType(final JdbcTypeDescription jdbcTypeDescription) {
if (jdbcTypeDescription.getJdbcType() == Types.TIME) {
return DataType.createVarChar(30, DataType.ExaCharset.UTF8);
}
return super.mapJdbcType(jdbcTypeDescription);
}
}
| EXASOL/virtual-schemas | src/main/java/com/exasol/adapter/dialects/bigquery/BigQueryColumnMetadataReader.java | Java | mit | 1,364 |
const chalk = require('chalk');
const Sequelize = require('sequelize');
// db server constant(s)
const dbName = 'relationshipVisualizer';
// +(process.env.NODE_ENV === 'testing' ? '_test' : '');
const url = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`;
// notify the user we're about to do it
console.log(chalk.yellow(`Opening database connection to ${url}`))
// init the db
const db = new Sequelize(url, {
define: {
freezeTableName: true // don't go changing my table names sequelize!
},
logging: false
});
module.exports = db;
| smanwaring/relationship-visualizer | db/db.js | JavaScript | mit | 566 |
#!/usr/bin/env bash
mkdir -p target/sandboxjava9jlink;
/usr/lib/jvm/java-9-oracle/bin/javac \
--module-path ./../java9module/target/sandboxjava9module \
-d target/sandboxjava9jlink \
$(find ./src/main/java -name "*.java")
| banadiga/sandbox | java9jlink/javac.sh | Shell | mit | 237 |
using System;
using Windows.Devices.Enumeration;
using Windows.Devices.Spi;
using Windows.Foundation.Metadata;
namespace ABElectronics_Win10IOT_Libraries
{
/// <summary>
/// Class for accessing the ADCDAC Pi from AB Electronics UK.
/// </summary>
public class ADCDACPi : IDisposable
{
private const string SPI_CONTROLLER_NAME = "SPI0";
private const Int32 ADC_CHIP_SELECT_LINE = 0; // ADC on SPI channel select CE0
private const Int32 DAC_CHIP_SELECT_LINE = 1; // ADC on SPI channel select CE1
private SpiDevice adc;
private double ADCReferenceVoltage = 3.3;
private SpiDevice dac;
/// <summary>
/// Event triggers when a connection is established.
/// </summary>
public bool IsConnected { get; private set; }
// Flag: Has Dispose already been called?
bool disposed = false;
// Instantiate a SafeHandle instance.
System.Runtime.InteropServices.SafeHandle handle = new Microsoft.Win32.SafeHandles.SafeFileHandle(IntPtr.Zero, true);
/// <summary>
/// Open a connection to the ADCDAC Pi.
/// </summary>
public async void Connect()
{
if (IsConnected)
{
return; // Already connected
}
if(!ApiInformation.IsTypePresent("Windows.Devices.Spi.SpiDevice"))
{
return; // This system does not support this feature: can't connect
}
try
{
// Create SPI initialization settings for the ADC
var adcsettings =
new SpiConnectionSettings(ADC_CHIP_SELECT_LINE)
{
ClockFrequency = 10000000, // SPI clock frequency of 10MHz
Mode = SpiMode.Mode0
};
var spiAqs = SpiDevice.GetDeviceSelector(SPI_CONTROLLER_NAME); // Find the selector string for the SPI bus controller
var devicesInfo = await DeviceInformation.FindAllAsync(spiAqs); // Find the SPI bus controller device with our selector string
if (devicesInfo.Count == 0)
{
return; // Controller not found
}
adc = await SpiDevice.FromIdAsync(devicesInfo[0].Id, adcsettings); // Create an ADC connection with our bus controller and SPI settings
// Create SPI initialization settings for the DAC
var dacSettings =
new SpiConnectionSettings(DAC_CHIP_SELECT_LINE)
{
ClockFrequency = 2000000, // SPI clock frequency of 20MHz
Mode = SpiMode.Mode0
};
dac = await SpiDevice.FromIdAsync(devicesInfo[0].Id, dacSettings); // Create a DAC connection with our bus controller and SPI settings
IsConnected = true; // connection established, set IsConnected to true.
// Fire the Connected event handler
Connected?.Invoke(this, EventArgs.Empty);
}
/* If initialization fails, display the exception and stop running */
catch (Exception ex)
{
IsConnected = false;
throw new Exception("SPI Initialization Failed", ex);
}
}
/// <summary>
/// Event occurs when connection is made.
/// </summary>
public event EventHandler Connected;
/// <summary>
/// Read the voltage from the selected <paramref name="channel" /> on the ADC.
/// </summary>
/// <param name="channel">1 or 2</param>
/// <returns>voltage</returns>
public double ReadADCVoltage(byte channel)
{
if (channel < 1 || channel > 2)
{
throw new ArgumentOutOfRangeException(nameof(channel));
}
var raw = ReadADCRaw(channel);
var voltage = ADCReferenceVoltage / 4096 * raw; // convert the raw value into a voltage based on the reference voltage.
return voltage;
}
/// <summary>
/// Read the raw value from the selected <paramref name="channel" /> on the ADC.
/// </summary>
/// <param name="channel">1 or 2</param>
/// <returns>Integer</returns>
public int ReadADCRaw(byte channel)
{
if (channel < 1 || channel > 2)
{
throw new ArgumentOutOfRangeException(nameof(channel));
}
CheckConnected();
var writeArray = new byte[] { 0x01, (byte) ((1 + channel) << 6), 0x00}; // create the write bytes based on the input channel
var readBuffer = new byte[3]; // this holds the output data
adc.TransferFullDuplex(writeArray, readBuffer); // transfer the adc data
var ret = (short) (((readBuffer[1] & 0x0F) << 8) + readBuffer[2]); // combine the two bytes into a single 16bit integer
return ret;
}
/// <summary>
/// Set the reference <paramref name="voltage" /> for the analogue to digital converter.
/// The ADC uses the raspberry pi 3.3V power as a <paramref name="voltage" /> reference
/// so using this method to set the reference to match the exact output
/// <paramref name="voltage" /> from the 3.3V regulator will increase the accuracy of
/// the ADC readings.
/// </summary>
/// <param name="voltage">double</param>
public void SetADCrefVoltage(double voltage)
{
CheckConnected();
if (voltage < 0.0 || voltage > 7.0)
{
throw new ArgumentOutOfRangeException(nameof(voltage), "Reference voltage must be between 0.0V and 7.0V.");
}
ADCReferenceVoltage = voltage;
}
/// <summary>
/// Set the <paramref name="voltage" /> for the selected channel on the DAC.
/// </summary>
/// <param name="channel">1 or 2</param>
/// <param name="voltage">Voltage can be between 0 and 2.047 volts</param>
public void SetDACVoltage(byte channel, double voltage)
{
// Check for valid channel and voltage variables
if (channel < 1 || channel > 2)
{
throw new ArgumentOutOfRangeException();
}
if (voltage >= 0.0 && voltage < 2.048)
{
var rawval = Convert.ToInt16(voltage / 2.048 * 4096); // convert the voltage into a raw value
SetDACRaw(channel, rawval);
}
else
{
throw new ArgumentOutOfRangeException();
}
}
/// <summary>
/// Set the raw <paramref name="value" /> from the selected <paramref name="channel" /> on the DAC.
/// </summary>
/// <param name="channel">1 or 2</param>
/// <param name="value">Value between 0 and 4095</param>
public void SetDACRaw(byte channel, short value)
{
CheckConnected();
if (channel < 1 || channel > 2)
{
throw new ArgumentOutOfRangeException();
}
// split the raw value into two bytes and send it to the DAC.
var lowByte = (byte) (value & 0xff);
var highByte = (byte) (((value >> 8) & 0xff) | ((channel - 1) << 7) | (0x1 << 5) | (1 << 4));
var writeBuffer = new [] { highByte, lowByte};
dac.Write(writeBuffer);
}
private void CheckConnected()
{
if (!IsConnected)
{
throw new InvalidOperationException("Not connected. You must call .Connect() first.");
}
}
/// <summary>
/// Dispose of the resources
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Protected implementation of Dispose pattern
/// </summary>
/// <param name="disposing"></param>
protected virtual void Dispose(bool disposing)
{
if (disposed)
return;
if (disposing)
{
handle.Dispose();
// Free any other managed objects here.
adc?.Dispose();
adc = null;
dac?.Dispose();
dac = null;
IsConnected = false;
}
// Free any unmanaged objects here.
//
disposed = true;
}
}
} | abelectronicsuk/ABElectronics_Win10IOT_Libraries | ABElectronics_Win10IOT_Libraries/ADCDACPi.cs | C# | mit | 8,804 |
FROM stilliard/pure-ftpd
ENV FTP_USER=ftpuser \
FTP_PASSWORD=ftpuser \
FTP_HOME_DIRECTORY=/share/ftp \
PASV_PORT_MIN=30000 \
PASV_PORT_MAX=30009 \
CONTAINER_USER_UID=ftpuser \
MAX_CLIENTS_NUMBER=50 \
MAX_CLIENTS_PER_IP=10 \
DOWNLOAD_LIMIT_KB=0 \
UPLOAD_LIMIT_KB=0 \
MAX_SIMULTANEOUS_SESSIONS=0 \
LOG_ENABLED=0
COPY run.sh /pure-ftpd/run.sh
RUN chmod u+x /pure-ftpd/run.sh
CMD ["/pure-ftpd/run.sh"]
| fsimplice/docker-pure-ftpd | Dockerfile | Dockerfile | mit | 446 |
var system = require('system');
var args = system.args;
var url = "http://"+args[1],
filename = args[2]+".png",
timeout = args[3],
savePath = args[4],
page = require('webpage').create();
//setTimeout(function(){phantom.exit();}, timeout)
page.viewportSize = { width: 1200, height: 700 };
page.clipRect = { top: 0, left: 0, width: 1200, height: 700 };
var f = false;
page.onLoadFinished = function(status) {
console.log('Status: ' + status);
setTimeout(function(){
render(page);
phantom.exit();
}, 15000)
};
page.onResourceReceived = function(response) {
if (response.url === url && !f) {
setTimeout(function(){
render(page);
phantom.exit();
}, 15000)
f = true
}
};
function render(page) {
var resPath
if (savePath == "") {
resPath = filename
} else {
resPath = savePath + "/" + filename
}
page.render(resPath)
}
console.log("start get " + url)
page.open(url, function() {
}); | zhuharev/shot | assets/rasterize.js | JavaScript | mit | 936 |
class SiteController < ApplicationController
skip_before_filter :verify_authenticity_token
no_login_required
cattr_writer :cache_timeout
def self.cache_timeout
@@cache_timeout ||= 5.minutes
end
def show_page
url = params[:url]
if Array === url
url = url.join('/')
else
url = url.to_s
end
if @page = find_page(url)
batch_page_status_refresh if (url == "/" || url == "")
process_page(@page)
set_cache_control
@performed_render ||= true
else
render :template => 'site/not_found', :status => 404
end
rescue Page::MissingRootPageError
redirect_to welcome_url
end
private
def batch_page_status_refresh
@changed_pages = []
@pages = Page.find(:all, :conditions => {:status_id => 90})
@pages.each do |page|
if page.published_at <= Time.now
page.status_id = 100
page.save
@changed_pages << page.id
end
end
expires_in nil, :private=>true, "no-cache" => true if @changed_pages.length > 0
end
def set_cache_control
if (request.head? || request.get?) && @page.cache? && live?
expires_in self.class.cache_timeout, :public => true, :private => false
else
expires_in nil, :private => true, "no-cache" => true
headers['ETag'] = ''
end
end
def find_page(url)
found = Page.find_by_url(url, live?)
found if found and (found.published? or dev?)
end
def process_page(page)
page.process(request, response)
end
def dev?
if dev_host = @config['dev.host']
request.host == dev_host
else
request.host =~ /^dev\./
end
end
def live?
not dev?
end
end
| mikehale/halefamilyfarm | vendor/radiant/app/controllers/site_controller.rb | Ruby | mit | 1,781 |
namespace Vulcan.Core.DataAccess.Migrations.MigrationProviders
{
public enum ExecutionType
{
Insert,
InsertWithIdentity,
Update,
Delete
}
}
| SachiraChin/Vulcan | Vulcan.Core.DataAccess/Migrations/MigrationProviders/ExecutionType.cs | C# | mit | 187 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Mithril_Kendo_WebApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mithril_Kendo_WebApp")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1489ca50-41a3-42be-8e92-4cac9b1762d5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| brakmic/Mithril_Kendo | Properties/AssemblyInfo.cs | C# | mit | 1,371 |
<!-- Jumbotron Header -->
<header class="jumbotron hero-spacer" style="padding: 2em; text-align: center;">
<img style="max-width:100%; max-height:100%;" src="<?=base_url()?>assets/img/slogan.png">
<!--
<h1>Read and let read!</h1>
<p>
Welcome to Discipulus, your humble start up for buying and selling books. We’re dedicated to giving you the very best experience on this website, with a focus on look, feel, functionality, and great community of likeminded people.Welcome to Discipulus, your humble start up for buying and selling books. We’re dedicated to giving you the very best experience on this website, with a focus on look, feel, functionality, and great community of likeminded people.
</p>
-->
<!-- <p><a class="btn btn-primary btn-large">Call to action!</a>-->
<!-- </p>-->
</header>
<hr>
<!-- Title -->
<!-- <div class="row">-->
<!-- <div class="col-lg-12">-->
<!-- <h3>Latest Features</h3>-->
<!-- </div>-->
<!-- </div>-->
<!-- /.row -->
<!-- Page Features -->
<div class="row text-center">
<?php
if(count($products) == 0){
echo '<center><i><h3>No data available</h3></i></center>';
}
foreach($products as $product){
?>
<div class="col-sm-3 col-lg-3 col-md-3">
<div class="thumbnail">
<div class="thumbnailx">
<img src="<?=$product->img?>" style="" alt="">
</div>
<div class="caption-ownad">
<h4><a href="<?=base_url().'shop/viewProduct/'.$product->id?>"><?=$product->title?></a></h4>
<span style="font-weight: bold;">P<?=$product->price?>.00</span>
<p style="margin-top: 0.3em;"><?=$product->description?></p>
</div>
</div>
</div>
<?php
}
?>
</div>
<!-- /.row -->
| jjsarmiento/itecm | application/views/shop/home.php | PHP | mit | 2,046 |
# vimconfig
stuff from my vimrc breaks into pieces for keeping organised things more organised
### Install
On Unix execute:
```sh
#backup current vimrc file if existed
mv ~/.vimrc{,_backup}
#clone project into special folder
git clone https://github.com/iiey/vimconfig ~/.vim/bundle/vimconfig \
&& ln -sfn ~/.vim/bundle/vimconfig/vimrc ~/.vim/vimrc
```
#### Structure
- Basic vim setting: ``vimconfig/plugin/setting.vim``
- Commands: ``vimconfig/plugin/command.vim``
- Mapping: ``vimconfig/plugin/mapping.vim``
- Plugins configuration: ``vimconfig/plugin/bundle.vim``
- Functions implementation: ``vimconfig/autoload/utilfunc.vim``
#### Note
- Some plugin keybindings may changed to avoid conflict with default vim mapping
- More detail see each plugin SECTION under **bundle.vim**
- ``~/.vim/bundle`` is path where plugins are stored and managed by [vim-plug][1]
##### [airline][2]
- Modify setting.vim to enable statusline with powerline symbols
```vim
let g:airline_powerline_fonts=0
```
- Make sure powerline-fonts installed
- On Linux: [fontconfig][3] should work out for any font without patching
- On MacOS: download and install patched [fonts][4] from [powerline-fonts][5], set terminal using patched fonts
##### [ultisnip][6]
- See also ``:h ultisnips-triggers``
- Key changes in section ULTISNIPS
```vim
g:UltiSnipsExpandTrigger <c-l>
g:UltiSnipsListSnippets <c-l>l
g:UltiSnipsJumpForwardTrigger <c-l>n
g:UltiSnipsJumpBackwardTrigger <c-l>p
```
##### [clang\_complete][7]
- Set default library path
```vim
let g:clang_library_path=expand("$HOME")."/lib/"
```
- Avoid conflict with tagjump ``<c-]>``
```vim
g:clang_jumpto_declaration_key <c-w>[
```
##### [ctrlp][8]
- Default shortcut to not conflict with behaviours ``<c-n>`` ``<c-p>``
```vim
let g:ctrlp_map =[p
```
- Just fall back method which rarely used. Better using ``[f`` to call [fzf][9]
[1]: https://github.com/junegunn/vim-plug
[2]: https://github.com/vim-airline/vim-airline
[3]: http://powerline.readthedocs.io/en/master/installation/linux.html#fontconfig
[4]: https://github.com/iiey/dotfiles/tree/master/fonts/Powerline
[5]: https://github.com/powerline/fonts
[6]: https://github.com/SirVer/ultisnips
[7]: https://github.com/Rip-Rip/clang_complete
[8]: https://github.com/ctrlpvim/ctrlp.vim
[9]: https://github.com/junegunn/fzf
| iiey/vimconfig | README.md | Markdown | mit | 2,393 |
/* globals describe, before, beforeEach, after, afterEach, it */
'use strict';
const chai = require('chai');
const assert = chai.assert;
const expect = chai.expect;
chai.should();
chai.use(require('chai-things')); //http://chaijs.com/plugins/chai-things
chai.use(require('chai-arrays'));
describe('<%= pkgName %>', function () {
before('before', function () {
});
beforeEach('beforeEach', function () {
});
afterEach('afterEach', function () {
});
after('after', function () {
});
describe('Stub test', function () {
it('should have unit test', function () {
assert(false, 'Please add unit tests.');
});
});
});
| alykoshin/generator-mini-package | app/templates/test/index.js | JavaScript | mit | 666 |
//
// PgpMimeTests.cs
//
// Author: Jeffrey Stedfast <[email protected]>
//
// Copyright (c) 2013-2022 .NET Foundation and Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using NUnit.Framework;
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Bcpg.OpenPgp;
using MimeKit;
using MimeKit.IO;
using MimeKit.IO.Filters;
using MimeKit.Cryptography;
namespace UnitTests.Cryptography {
[TestFixture]
public class PgpMimeTests
{
static PgpMimeTests ()
{
Environment.SetEnvironmentVariable ("GNUPGHOME", Path.GetFullPath ("."));
var dataDir = Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp");
CryptographyContext.Register (typeof (DummyOpenPgpContext));
foreach (var name in new [] { "pubring.gpg", "pubring.gpg~", "secring.gpg", "secring.gpg~", "gpg.conf" }) {
if (File.Exists (name))
File.Delete (name);
}
using (var ctx = new DummyOpenPgpContext ()) {
using (var seckeys = File.OpenRead (Path.Combine (dataDir, "mimekit.gpg.sec"))) {
using (var armored = new ArmoredInputStream (seckeys))
ctx.Import (new PgpSecretKeyRingBundle (armored));
}
using (var pubkeys = File.OpenRead (Path.Combine (dataDir, "mimekit.gpg.pub")))
ctx.Import (pubkeys);
}
File.Copy (Path.Combine (dataDir, "gpg.conf"), "gpg.conf", true);
}
static bool IsSupported (EncryptionAlgorithm algorithm)
{
switch (algorithm) {
case EncryptionAlgorithm.RC2128:
case EncryptionAlgorithm.RC264:
case EncryptionAlgorithm.RC240:
case EncryptionAlgorithm.Seed:
return false;
default:
return true;
}
}
[Test]
public void TestPreferredAlgorithms ()
{
using (var ctx = new DummyOpenPgpContext ()) {
var encryptionAlgorithms = ctx.EnabledEncryptionAlgorithms;
Assert.AreEqual (4, encryptionAlgorithms.Length);
Assert.AreEqual (EncryptionAlgorithm.Aes256, encryptionAlgorithms[0]);
Assert.AreEqual (EncryptionAlgorithm.Aes192, encryptionAlgorithms[1]);
Assert.AreEqual (EncryptionAlgorithm.Aes128, encryptionAlgorithms[2]);
Assert.AreEqual (EncryptionAlgorithm.TripleDes, encryptionAlgorithms[3]);
var digestAlgorithms = ctx.EnabledDigestAlgorithms;
Assert.AreEqual (3, digestAlgorithms.Length);
Assert.AreEqual (DigestAlgorithm.Sha256, digestAlgorithms[0]);
Assert.AreEqual (DigestAlgorithm.Sha512, digestAlgorithms[1]);
Assert.AreEqual (DigestAlgorithm.Sha1, digestAlgorithms[2]);
}
}
[Test]
public void TestKeyEnumeration ()
{
using (var ctx = new DummyOpenPgpContext ()) {
var unknownMailbox = new MailboxAddress ("Snarky McSnarkypants", "[email protected]");
var knownMailbox = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
int count = ctx.EnumeratePublicKeys ().Count ();
// Note: the count will be 8 if run as a complete unit test or 2 if run individually
Assert.IsTrue (count == 8 || count == 2, "Unexpected number of public keys");
Assert.AreEqual (0, ctx.EnumeratePublicKeys (unknownMailbox).Count (), "Unexpected number of public keys for an unknown mailbox");
Assert.AreEqual (2, ctx.EnumeratePublicKeys (knownMailbox).Count (), "Unexpected number of public keys for a known mailbox");
Assert.AreEqual (2, ctx.EnumerateSecretKeys ().Count (), "Unexpected number of secret keys");
Assert.AreEqual (0, ctx.EnumerateSecretKeys (unknownMailbox).Count (), "Unexpected number of secret keys for an unknown mailbox");
Assert.AreEqual (2, ctx.EnumerateSecretKeys (knownMailbox).Count (), "Unexpected number of secret keys for a known mailbox");
Assert.IsTrue (ctx.CanSign (knownMailbox));
Assert.IsFalse (ctx.CanSign (unknownMailbox));
Assert.IsTrue (ctx.CanEncrypt (knownMailbox));
Assert.IsFalse (ctx.CanEncrypt (unknownMailbox));
}
}
[Test]
public void TestKeyGeneration ()
{
using (var ctx = new DummyOpenPgpContext ()) {
var mailbox = new MailboxAddress ("Snarky McSnarkypants", "[email protected]");
int publicKeyRings = ctx.EnumeratePublicKeyRings ().Count ();
int secretKeyRings = ctx.EnumerateSecretKeyRings ().Count ();
ctx.GenerateKeyPair (mailbox, "password", DateTime.Now.AddYears (1), EncryptionAlgorithm.Cast5);
var pubring = ctx.EnumeratePublicKeyRings (mailbox).FirstOrDefault ();
Assert.IsNotNull (pubring, "Expected to find the generated public keyring");
ctx.Delete (pubring);
Assert.AreEqual (publicKeyRings, ctx.EnumeratePublicKeyRings ().Count (), "Unexpected number of public keyrings");
var secring = ctx.EnumerateSecretKeyRings (mailbox).FirstOrDefault ();
Assert.IsNotNull (secring, "Expected to find the generated secret keyring");
ctx.Delete (secring);
Assert.AreEqual (secretKeyRings, ctx.EnumerateSecretKeyRings ().Count (), "Unexpected number of secret keyrings");
}
}
[Test]
public void TestKeySigning ()
{
using (var ctx = new DummyOpenPgpContext ()) {
var seckey = ctx.EnumerateSecretKeys (new MailboxAddress ("", "[email protected]")).FirstOrDefault ();
var mailbox = new MailboxAddress ("Snarky McSnarkypants", "[email protected]");
ctx.GenerateKeyPair (mailbox, "password", DateTime.Now.AddYears (1), EncryptionAlgorithm.Cast5);
// delete the secret keyring, we don't need it
var secring = ctx.EnumerateSecretKeyRings (mailbox).FirstOrDefault ();
ctx.Delete (secring);
var pubring = ctx.EnumeratePublicKeyRings (mailbox).FirstOrDefault ();
var pubkey = pubring.GetPublicKey ();
int sigCount = 0;
foreach (PgpSignature sig in pubkey.GetKeySignatures ())
sigCount++;
Assert.AreEqual (0, sigCount);
ctx.SignKey (seckey, pubkey, DigestAlgorithm.Sha256, OpenPgpKeyCertification.CasualCertification);
pubring = ctx.EnumeratePublicKeyRings (mailbox).FirstOrDefault ();
pubkey = pubring.GetPublicKey ();
sigCount = 0;
foreach (PgpSignature sig in pubkey.GetKeySignatures ()) {
Assert.AreEqual (seckey.KeyId, sig.KeyId);
Assert.AreEqual (HashAlgorithmTag.Sha256, sig.HashAlgorithm);
Assert.AreEqual ((int) OpenPgpKeyCertification.CasualCertification, sig.SignatureType);
sigCount++;
}
Assert.AreEqual (1, sigCount);
ctx.Delete (pubring);
}
}
[Test]
public void TestMimeMessageSign ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body is set
Assert.Throws<InvalidOperationException> (() => message.Sign (ctx));
message.Body = body;
// throws because no sender is set
Assert.Throws<InvalidOperationException> (() => message.Sign (ctx));
message.From.Add (self);
// ok, now we can sign
message.Sign (ctx);
Assert.IsInstanceOf<MultipartSigned> (message.Body);
var multipart = (MultipartSigned) message.Body;
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual (ctx.SignatureProtocol, protocol, "The multipart/signed protocol does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
var signatures = multipart.Verify (ctx);
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
var signature = signatures[0];
Assert.AreEqual ("MimeKit UnitTests", signature.SignerCertificate.Name);
Assert.AreEqual ("[email protected]", signature.SignerCertificate.Email);
Assert.AreEqual ("44CD48EEC90D8849961F36BA50DCD107AB0821A2", signature.SignerCertificate.Fingerprint);
Assert.AreEqual (new DateTime (2013, 11, 3, 18, 32, 27), signature.SignerCertificate.CreationDate, "CreationDate");
Assert.AreEqual (DateTime.MaxValue, signature.SignerCertificate.ExpirationDate, "ExpirationDate");
Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, signature.SignerCertificate.PublicKeyAlgorithm);
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestMimeMessageSignAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body is set
Assert.Throws<InvalidOperationException> (() => message.Sign (ctx));
message.Body = body;
// throws because no sender is set
Assert.Throws<InvalidOperationException> (() => message.Sign (ctx));
message.From.Add (self);
// ok, now we can sign
message.Sign (ctx);
Assert.IsInstanceOf<MultipartSigned> (message.Body);
var multipart = (MultipartSigned) message.Body;
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual (ctx.SignatureProtocol, protocol, "The multipart/signed protocol does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
var signatures = await multipart.VerifyAsync (ctx);
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
var signature = signatures[0];
Assert.AreEqual ("MimeKit UnitTests", signature.SignerCertificate.Name);
Assert.AreEqual ("[email protected]", signature.SignerCertificate.Email);
Assert.AreEqual ("44CD48EEC90D8849961F36BA50DCD107AB0821A2", signature.SignerCertificate.Fingerprint);
Assert.AreEqual (new DateTime (2013, 11, 3, 18, 32, 27), signature.SignerCertificate.CreationDate, "CreationDate");
Assert.AreEqual (DateTime.MaxValue, signature.SignerCertificate.ExpirationDate, "ExpirationDate");
Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, signature.SignerCertificate.PublicKeyAlgorithm);
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestMultipartSignedVerifyExceptions ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
using (var ctx = new DummyOpenPgpContext ()) {
var signed = MultipartSigned.Create (ctx, self, DigestAlgorithm.Sha256, body);
var protocol = signed.ContentType.Parameters["protocol"];
signed.ContentType.Parameters.Remove ("protocol");
Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/o protocol parameter");
Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/o protocol parameter");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/o protocol parameter");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/o protocol parameter");
signed.ContentType.Parameters.Add ("protocol", "invalid-protocol");
Assert.Throws<NotSupportedException> (() => signed.Verify (), "Verify() w/ invalid protocol parameter");
Assert.Throws<NotSupportedException> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid protocol parameter");
Assert.ThrowsAsync<NotSupportedException> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid protocol parameter");
Assert.ThrowsAsync<NotSupportedException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid protocol parameter");
signed.ContentType.Parameters["protocol"] = protocol;
var signature = signed[1];
signed.RemoveAt (1);
Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/ < 2 parts");
Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/ < 2 parts");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/ < 2 parts");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ < 2 parts");
var emptySignature = new MimePart ("application", "octet-stream");
signed.Add (emptySignature);
Assert.Throws<FormatException> (() => signed.Verify (), "Verify() w/ invalid signature part");
Assert.Throws<FormatException> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid signature part");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid signature part");
Assert.ThrowsAsync<FormatException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid signature part");
var invalidContent = new MimePart ("image", "jpeg") {
Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false))
};
signed[1] = invalidContent;
Assert.Throws<NotSupportedException> (() => signed.Verify (), "Verify() w/ invalid content part");
Assert.Throws<NotSupportedException> (() => signed.Verify (ctx), "Verify(ctx) w/ invalid content part");
Assert.ThrowsAsync<NotSupportedException> (() => signed.VerifyAsync (), "VerifyAsync() w/ invalid content part");
Assert.ThrowsAsync<NotSupportedException> (() => signed.VerifyAsync (ctx), "VerifyAsync(ctx) w/ invalid content part");
}
}
[Test]
public void TestMultipartSignedSignUsingKeys ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "44CD48EEC90D8849961F36BA50DCD107AB0821A2");
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
signer = ctx.GetSigningKey (self);
foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) {
if (digest == DigestAlgorithm.None ||
digest == DigestAlgorithm.DoubleSha ||
digest == DigestAlgorithm.Tiger192 ||
digest == DigestAlgorithm.Haval5160 ||
digest == DigestAlgorithm.MD4)
continue;
var multipart = MultipartSigned.Create (signer, digest, body);
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match.");
var micalg = multipart.ContentType.Parameters["micalg"];
var algorithm = ctx.GetDigestAlgorithm (micalg);
Assert.AreEqual (digest, algorithm, "The multipart/signed micalg does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
var signatures = multipart.Verify ();
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
}
}
[Test]
public async Task TestMultipartSignedSignUsingKeysAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "44CD48EEC90D8849961F36BA50DCD107AB0821A2");
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
signer = ctx.GetSigningKey (self);
foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) {
if (digest == DigestAlgorithm.None ||
digest == DigestAlgorithm.DoubleSha ||
digest == DigestAlgorithm.Tiger192 ||
digest == DigestAlgorithm.Haval5160 ||
digest == DigestAlgorithm.MD4)
continue;
var multipart = await MultipartSigned.CreateAsync (signer, digest, body);
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match.");
var micalg = multipart.ContentType.Parameters["micalg"];
var algorithm = ctx.GetDigestAlgorithm (micalg);
Assert.AreEqual (digest, algorithm, "The multipart/signed micalg does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
var signatures = await multipart.VerifyAsync ();
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
}
}
[Test]
public void TestMimeMessageEncrypt ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "44CD48EEC90D8849961F36BA50DCD107AB0821A2");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body has been set
Assert.Throws<InvalidOperationException> (() => message.Encrypt (ctx));
message.Body = body;
// throws because no recipients have been set
Assert.Throws<InvalidOperationException> (() => message.Encrypt (ctx));
message.From.Add (self);
message.To.Add (self);
message.Encrypt (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
var encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
// now do the same thing, but encrypt to the Resent-To headers
message.From.Clear ();
message.To.Clear ();
message.From.Add (new MailboxAddress ("Dummy Sender", "[email protected]"));
message.To.Add (new MailboxAddress ("Dummy Recipient", "[email protected]"));
message.ResentFrom.Add (self);
message.ResentTo.Add (self);
message.Body = body;
message.Encrypt (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
[Test]
public async Task TestMimeMessageEncryptAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "44CD48EEC90D8849961F36BA50DCD107AB0821A2");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body has been set
Assert.ThrowsAsync<InvalidOperationException> (() => message.EncryptAsync (ctx));
message.Body = body;
// throws because no recipients have been set
Assert.ThrowsAsync<InvalidOperationException> (() => message.EncryptAsync (ctx));
message.From.Add (self);
message.To.Add (self);
await message.EncryptAsync (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
var encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
// now do the same thing, but encrypt to the Resent-To headers
message.From.Clear ();
message.To.Clear ();
message.From.Add (new MailboxAddress ("Dummy Sender", "[email protected]"));
message.To.Add (new MailboxAddress ("Dummy Recipient", "[email protected]"));
message.ResentFrom.Add (self);
message.ResentTo.Add (self);
message.Body = body;
await message.EncryptAsync (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
[Test]
public void TestMultipartEncryptedDecryptExceptions ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
var encrypted = MultipartEncrypted.Encrypt (new[] { self }, body);
using (var ctx = new DummyOpenPgpContext ()) {
var protocol = encrypted.ContentType.Parameters["protocol"];
encrypted.ContentType.Parameters.Remove ("protocol");
Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/o protocol parameter");
Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/o protocol parameter");
encrypted.ContentType.Parameters.Add ("protocol", "invalid-protocol");
//Assert.Throws<NotSupportedException> (() => encrypted.Decrypt (), "Decrypt() w/ invalid protocol parameter");
Assert.Throws<NotSupportedException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid protocol parameter");
encrypted.ContentType.Parameters["protocol"] = protocol;
var version = encrypted[0];
encrypted.RemoveAt (0);
Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ < 2 parts");
Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ < 2 parts");
var invalidVersion = new MimePart ("application", "octet-stream") {
Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false))
};
encrypted.Insert (0, invalidVersion);
Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ invalid version part");
Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid version part");
var emptyContent = new MimePart ("application", "octet-stream");
var content = encrypted[1];
encrypted[1] = emptyContent;
encrypted[0] = version;
Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ empty content part");
Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ empty content part");
var invalidContent = new MimePart ("image", "jpeg") {
Content = new MimeContent (new MemoryStream (Array.Empty<byte> (), false))
};
encrypted[1] = invalidContent;
Assert.Throws<FormatException> (() => encrypted.Decrypt (), "Decrypt() w/ invalid content part");
Assert.Throws<FormatException> (() => encrypted.Decrypt (ctx), "Decrypt(ctx) w/ invalid content part");
}
}
[Test]
public void TestMultipartEncryptedEncrypt ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
var encrypted = MultipartEncrypted.Encrypt (new [] { self }, body);
using (var stream = new MemoryStream ()) {
encrypted.WriteTo (stream);
stream.Position = 0;
var entity = MimeEntity.Load (stream);
Assert.IsInstanceOf<MultipartEncrypted> (entity, "Encrypted part is not the expected type");
encrypted = (MultipartEncrypted) entity;
Assert.IsInstanceOf<ApplicationPgpEncrypted> (encrypted[0], "First child of multipart/encrypted is not the expected type");
Assert.IsInstanceOf<MimePart> (encrypted[1], "Second child of multipart/encrypted is not the expected type");
Assert.AreEqual ("application/octet-stream", encrypted[1].ContentType.MimeType, "Second child of multipart/encrypted is not the expected mime-type");
}
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
[Test]
public async Task TestMultipartEncryptedEncryptAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
var encrypted = await MultipartEncrypted.EncryptAsync (new[] { self }, body);
using (var stream = new MemoryStream ()) {
await encrypted.WriteToAsync (stream);
stream.Position = 0;
var entity = await MimeEntity.LoadAsync (stream);
Assert.IsInstanceOf<MultipartEncrypted> (entity, "Encrypted part is not the expected type");
encrypted = (MultipartEncrypted) entity;
Assert.IsInstanceOf<ApplicationPgpEncrypted> (encrypted[0], "First child of multipart/encrypted is not the expected type");
Assert.IsInstanceOf<MimePart> (encrypted[1], "Second child of multipart/encrypted is not the expected type");
Assert.AreEqual ("application/octet-stream", encrypted[1].ContentType.MimeType, "Second child of multipart/encrypted is not the expected mime-type");
}
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
[Test]
public void TestMultipartEncryptedEncryptUsingKeys ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
IList<PgpPublicKey> recipients;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = ctx.GetPublicKeys (new [] { self });
}
var encrypted = MultipartEncrypted.Encrypt (recipients, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
[Test]
public async Task TestMultipartEncryptedEncryptUsingKeysAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
IList<PgpPublicKey> recipients;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = await ctx.GetPublicKeysAsync (new[] { self });
}
var encrypted = await MultipartEncrypted.EncryptAsync (recipients, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
[Test]
public void TestMultipartEncryptedEncryptAlgorithm ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
using (var ctx = new DummyOpenPgpContext ()) {
foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) {
if (!IsSupported (algorithm))
continue;
var encrypted = MultipartEncrypted.Encrypt (algorithm, new [] { self }, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
}
[Test]
public async Task TestMultipartEncryptedEncryptAlgorithmAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
using (var ctx = new DummyOpenPgpContext ()) {
foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) {
if (!IsSupported (algorithm))
continue;
var encrypted = await MultipartEncrypted.EncryptAsync (algorithm, new[] { self }, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (ctx);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
}
[Test]
public void TestMultipartEncryptedEncryptAlgorithmUsingKeys ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
IList<PgpPublicKey> recipients;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = ctx.GetPublicKeys (new [] { self });
}
foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) {
if (!IsSupported (algorithm))
continue;
var encrypted = MultipartEncrypted.Encrypt (algorithm, recipients, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
[Test]
public async Task TestMultipartEncryptedEncryptAlgorithmUsingKeysAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up encrypting..." };
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
IList<PgpPublicKey> recipients;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = await ctx.GetPublicKeysAsync (new[] { self });
}
foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) {
if (!IsSupported (algorithm))
continue;
var encrypted = await MultipartEncrypted.EncryptAsync (algorithm, recipients, body);
//using (var file = File.Create ("pgp-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt ();
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
}
}
[Test]
public void TestMimeMessageSignAndEncrypt ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
DigitalSignatureCollection signatures;
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body has been set
Assert.Throws<InvalidOperationException> (() => message.SignAndEncrypt (ctx));
message.Body = body;
// throws because no sender has been set
Assert.Throws<InvalidOperationException> (() => message.SignAndEncrypt (ctx));
message.From.Add (self);
message.To.Add (self);
message.SignAndEncrypt (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
var encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (ctx, out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
// now do the same thing, but encrypt to the Resent-To headers
message.From.Clear ();
message.To.Clear ();
message.From.Add (new MailboxAddress ("Dummy Sender", "[email protected]"));
message.To.Add (new MailboxAddress ("Dummy Recipient", "[email protected]"));
message.ResentFrom.Add (self);
message.ResentTo.Add (self);
message.Body = body;
message.SignAndEncrypt (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
decrypted = encrypted.Decrypt (ctx, out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
}
[Test]
public async Task TestMimeMessageSignAndEncryptAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
var message = new MimeMessage { Subject = "Test of signing with OpenPGP" };
DigitalSignatureCollection signatures;
using (var ctx = new DummyOpenPgpContext ()) {
// throws because no Body has been set
Assert.ThrowsAsync<InvalidOperationException> (() => message.SignAndEncryptAsync (ctx));
message.Body = body;
// throws because no sender has been set
Assert.ThrowsAsync<InvalidOperationException> (() => message.SignAndEncryptAsync (ctx));
message.From.Add (self);
message.To.Add (self);
await message.SignAndEncryptAsync (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
var encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (ctx, out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
// now do the same thing, but encrypt to the Resent-To headers
message.From.Clear ();
message.To.Clear ();
message.From.Add (new MailboxAddress ("Dummy Sender", "[email protected]"));
message.To.Add (new MailboxAddress ("Dummy Recipient", "[email protected]"));
message.ResentFrom.Add (self);
message.ResentTo.Add (self);
message.Body = body;
await message.SignAndEncryptAsync (ctx);
Assert.IsInstanceOf<MultipartEncrypted> (message.Body);
encrypted = (MultipartEncrypted) message.Body;
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
decrypted = encrypted.Decrypt (ctx, out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
}
[Test]
public void TestMultipartEncryptedSignAndEncrypt ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
var encrypted = MultipartEncrypted.SignAndEncrypt (self, DigestAlgorithm.Sha1, new [] { self }, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestMultipartEncryptedSignAndEncryptAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
var encrypted = await MultipartEncrypted.SignAndEncryptAsync (self, DigestAlgorithm.Sha1, new[] { self }, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestMultipartEncryptedSignAndEncryptUsingKeys ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
IList<PgpPublicKey> recipients;
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = ctx.GetPublicKeys (new [] { self });
signer = ctx.GetSigningKey (self);
}
var encrypted = MultipartEncrypted.SignAndEncrypt (signer, DigestAlgorithm.Sha1, recipients, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestMultipartEncryptedSignAndEncryptUsingKeysAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
IList<PgpPublicKey> recipients;
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = await ctx.GetPublicKeysAsync (new[] { self });
signer = await ctx.GetSigningKeyAsync (self);
}
var encrypted = await MultipartEncrypted.SignAndEncryptAsync (signer, DigestAlgorithm.Sha1, recipients, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestMultipartEncryptedSignAndEncryptAlgorithm ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
var encrypted = MultipartEncrypted.SignAndEncrypt (self, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, new [] { self }, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestMultipartEncryptedSignAndEncryptAlgorithmAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
var encrypted = await MultipartEncrypted.SignAndEncryptAsync (self, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, new[] { self }, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestMultipartEncryptedSignAndEncryptAlgorithmUsingKeys ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
IList<PgpPublicKey> recipients;
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = ctx.GetPublicKeys (new [] { self });
signer = ctx.GetSigningKey (self);
}
var encrypted = MultipartEncrypted.SignAndEncrypt (signer, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, recipients, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestMultipartEncryptedSignAndEncryptAlgorithmUsingKeysAsync ()
{
var body = new TextPart ("plain") { Text = "This is some cleartext that we'll end up signing and encrypting..." };
var self = new SecureMailboxAddress ("MimeKit UnitTests", "[email protected]", "AB0821A2");
DigitalSignatureCollection signatures;
IList<PgpPublicKey> recipients;
PgpSecretKey signer;
using (var ctx = new DummyOpenPgpContext ()) {
recipients = await ctx.GetPublicKeysAsync (new[] { self });
signer = await ctx.GetSigningKeyAsync (self);
}
var encrypted = await MultipartEncrypted.SignAndEncryptAsync (signer, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, recipients, body);
//using (var file = File.Create ("pgp-signed-encrypted.asc"))
// encrypted.WriteTo (file);
// TODO: implement DecryptAsync
var decrypted = encrypted.Decrypt (out signatures);
Assert.IsInstanceOf<TextPart> (decrypted, "Decrypted part is not the expected type.");
Assert.AreEqual (body.Text, ((TextPart) decrypted).Text, "Decrypted content is not the same as the original.");
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException ex) {
Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestAutoKeyRetrieve ()
{
var message = MimeMessage.Load (Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "[Announce] GnuPG 2.1.20 released.eml"));
var multipart = (MultipartSigned) ((Multipart) message.Body)[0];
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match.");
var micalg = multipart.ContentType.Parameters["micalg"];
Assert.AreEqual ("pgp-sha1", micalg, "The multipart/signed micalg does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
DigitalSignatureCollection signatures;
try {
signatures = multipart.Verify ();
} catch (IOException ex) {
if (ex.Message == "unknown PGP public key algorithm encountered") {
Assert.Ignore ("Known issue: {0}", ex.Message);
return;
}
throw;
}
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException) {
// Note: Werner Koch's keyring has an EdDSA subkey which breaks BouncyCastle's
// PgpPublicKeyRingBundle reader. If/when one of the round-robin keys.gnupg.net
// key servers returns this particular keyring, we can expect to get an exception
// about being unable to find Werner's public key.
//Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public async Task TestAutoKeyRetrieveAsync ()
{
var message = await MimeMessage.LoadAsync (Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "[Announce] GnuPG 2.1.20 released.eml"));
var multipart = (MultipartSigned) ((Multipart) message.Body)[0];
Assert.AreEqual (2, multipart.Count, "The multipart/signed has an unexpected number of children.");
var protocol = multipart.ContentType.Parameters["protocol"];
Assert.AreEqual ("application/pgp-signature", protocol, "The multipart/signed protocol does not match.");
var micalg = multipart.ContentType.Parameters["micalg"];
Assert.AreEqual ("pgp-sha1", micalg, "The multipart/signed micalg does not match.");
Assert.IsInstanceOf<TextPart> (multipart[0], "The first child is not a text part.");
Assert.IsInstanceOf<ApplicationPgpSignature> (multipart[1], "The second child is not a detached signature.");
DigitalSignatureCollection signatures;
try {
signatures = await multipart.VerifyAsync ();
} catch (IOException ex) {
if (ex.Message == "unknown PGP public key algorithm encountered") {
Assert.Ignore ("Known issue: {0}", ex.Message);
return;
}
throw;
}
Assert.AreEqual (1, signatures.Count, "Verify returned an unexpected number of signatures.");
foreach (var signature in signatures) {
try {
bool valid = signature.Verify ();
Assert.IsTrue (valid, "Bad signature from {0}", signature.SignerCertificate.Email);
} catch (DigitalSignatureVerifyException) {
// Note: Werner Koch's keyring has an EdDSA subkey which breaks BouncyCastle's
// PgpPublicKeyRingBundle reader. If/when one of the round-robin keys.gnupg.net
// key servers returns this particular keyring, we can expect to get an exception
// about being unable to find Werner's public key.
//Assert.Fail ("Failed to verify signature: {0}", ex);
}
}
}
[Test]
public void TestExport ()
{
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
using (var ctx = new DummyOpenPgpContext ()) {
Assert.AreEqual ("application/pgp-keys", ctx.KeyExchangeProtocol, "The key-exchange protocol does not match.");
var keys = ctx.EnumeratePublicKeys (self).ToList ();
var exported = ctx.Export (new [] { self });
Assert.IsNotNull (exported, "The exported MIME part should not be null.");
Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart.");
Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType);
exported = ctx.Export (keys);
Assert.IsNotNull (exported, "The exported MIME part should not be null.");
Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart.");
Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType);
using (var stream = new MemoryStream ()) {
ctx.Export (new[] { self }, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
foreach (var keyring in ctx.EnumeratePublicKeyRings (self)) {
using (var stream = new MemoryStream ()) {
ctx.Export (new[] { self }, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
}
using (var stream = new MemoryStream ()) {
ctx.Export (keys, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
}
}
[Test]
public async Task TestExportAsync ()
{
var self = new MailboxAddress ("MimeKit UnitTests", "[email protected]");
using (var ctx = new DummyOpenPgpContext ()) {
Assert.AreEqual ("application/pgp-keys", ctx.KeyExchangeProtocol, "The key-exchange protocol does not match.");
var keys = ctx.EnumeratePublicKeys (self).ToList ();
var exported = await ctx.ExportAsync (new[] { self });
Assert.IsNotNull (exported, "The exported MIME part should not be null.");
Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart.");
Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType);
exported = await ctx.ExportAsync (keys);
Assert.IsNotNull (exported, "The exported MIME part should not be null.");
Assert.IsInstanceOf<MimePart> (exported, "The exported MIME part should be a MimePart.");
Assert.AreEqual ("application/pgp-keys", exported.ContentType.MimeType);
using (var stream = new MemoryStream ()) {
await ctx.ExportAsync (new[] { self }, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
foreach (var keyring in ctx.EnumeratePublicKeyRings (self)) {
using (var stream = new MemoryStream ()) {
await ctx.ExportAsync (new[] { self }, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
}
using (var stream = new MemoryStream ()) {
await ctx.ExportAsync (keys, stream, true);
Assert.AreEqual (exported.Content.Stream.Length, stream.Length);
}
}
}
[Test]
public void TestDefaultEncryptionAlgorithm ()
{
using (var ctx = new DummyOpenPgpContext ()) {
foreach (EncryptionAlgorithm algorithm in Enum.GetValues (typeof (EncryptionAlgorithm))) {
if (!IsSupported (algorithm)) {
Assert.Throws<NotSupportedException> (() => ctx.DefaultEncryptionAlgorithm = algorithm);
continue;
}
ctx.DefaultEncryptionAlgorithm = algorithm;
Assert.AreEqual (algorithm, ctx.DefaultEncryptionAlgorithm, "Default encryption algorithm does not match.");
}
}
}
[Test]
public void TestSupports ()
{
var supports = new [] { "application/pgp-encrypted", "application/pgp-signature", "application/pgp-keys",
"application/x-pgp-encrypted", "application/x-pgp-signature", "application/x-pgp-keys" };
using (var ctx = new DummyOpenPgpContext ()) {
for (int i = 0; i < supports.Length; i++)
Assert.IsTrue (ctx.Supports (supports[i]), supports[i]);
Assert.IsFalse (ctx.Supports ("application/octet-stream"), "application/octet-stream");
Assert.IsFalse (ctx.Supports ("text/plain"), "text/plain");
}
}
[Test]
public void TestAlgorithmMappings ()
{
using (var ctx = new DummyOpenPgpContext ()) {
foreach (DigestAlgorithm digest in Enum.GetValues (typeof (DigestAlgorithm))) {
if (digest == DigestAlgorithm.None || digest == DigestAlgorithm.DoubleSha)
continue;
var name = ctx.GetDigestAlgorithmName (digest);
var algo = ctx.GetDigestAlgorithm (name);
Assert.AreEqual (digest, algo);
}
Assert.AreEqual (DigestAlgorithm.MD5, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.MD5));
Assert.AreEqual (DigestAlgorithm.Sha1, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha1));
Assert.AreEqual (DigestAlgorithm.RipeMD160, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.RipeMD160));
Assert.AreEqual (DigestAlgorithm.DoubleSha, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.DoubleSha));
Assert.AreEqual (DigestAlgorithm.MD2, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.MD2));
Assert.AreEqual (DigestAlgorithm.Tiger192, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Tiger192));
Assert.AreEqual (DigestAlgorithm.Haval5160, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Haval5pass160));
Assert.AreEqual (DigestAlgorithm.Sha256, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha256));
Assert.AreEqual (DigestAlgorithm.Sha384, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha384));
Assert.AreEqual (DigestAlgorithm.Sha512, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha512));
Assert.AreEqual (DigestAlgorithm.Sha224, OpenPgpContext.GetDigestAlgorithm (Org.BouncyCastle.Bcpg.HashAlgorithmTag.Sha224));
Assert.AreEqual (PublicKeyAlgorithm.RsaGeneral, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.RsaGeneral));
Assert.AreEqual (PublicKeyAlgorithm.RsaEncrypt, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.RsaEncrypt));
Assert.AreEqual (PublicKeyAlgorithm.RsaSign, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.RsaSign));
Assert.AreEqual (PublicKeyAlgorithm.ElGamalGeneral, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.ElGamalGeneral));
Assert.AreEqual (PublicKeyAlgorithm.ElGamalEncrypt, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.ElGamalEncrypt));
Assert.AreEqual (PublicKeyAlgorithm.Dsa, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.Dsa));
Assert.AreEqual (PublicKeyAlgorithm.EllipticCurve, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.ECDH));
Assert.AreEqual (PublicKeyAlgorithm.EllipticCurveDsa, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.ECDsa));
Assert.AreEqual (PublicKeyAlgorithm.DiffieHellman, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.DiffieHellman));
//Assert.AreEqual (PublicKeyAlgorithm.EdwardsCurveDsa, OpenPgpContext.GetPublicKeyAlgorithm (Org.BouncyCastle.Bcpg.PublicKeyAlgorithmTag.EdDSA));
}
}
[Test]
public void TestArgumentExceptions ()
{
Assert.Throws<ArgumentNullException> (() => CryptographyContext.Create (null));
Assert.Throws<ArgumentNullException> (() => CryptographyContext.Register ((Type) null));
Assert.Throws<ArgumentNullException> (() => CryptographyContext.Register ((Func<OpenPgpContext>) null));
Assert.Throws<ArgumentNullException> (() => CryptographyContext.Register ((Func<SecureMimeContext>) null));
using (var ctx = new DummyOpenPgpContext ()) {
var clientEastwood = new MailboxAddress ("Man with No Name", "[email protected]");
var mailboxes = new [] { new MailboxAddress ("MimeKit UnitTests", "[email protected]") };
var emptyMailboxes = new MailboxAddress[0];
var pubkeys = ctx.GetPublicKeys (mailboxes);
var key = ctx.GetSigningKey (mailboxes[0]);
var emptyPubkeys = new PgpPublicKey[0];
DigitalSignatureCollection signatures;
var stream = new MemoryStream ();
var entity = new MimePart ();
Assert.Throws<ArgumentException> (() => ctx.KeyServer = new Uri ("relative/uri", UriKind.Relative));
Assert.Throws<ArgumentNullException> (() => ctx.GetDigestAlgorithm (null));
Assert.Throws<ArgumentOutOfRangeException> (() => ctx.GetDigestAlgorithmName (DigestAlgorithm.DoubleSha));
Assert.Throws<NotSupportedException> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.DoubleSha));
Assert.Throws<NotSupportedException> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.Tiger192));
Assert.Throws<NotSupportedException> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.Haval5160));
Assert.Throws<NotSupportedException> (() => OpenPgpContext.GetHashAlgorithm (DigestAlgorithm.MD4));
Assert.Throws<ArgumentOutOfRangeException> (() => OpenPgpContext.GetDigestAlgorithm ((Org.BouncyCastle.Bcpg.HashAlgorithmTag) 1024));
Assert.Throws<ArgumentNullException> (() => new ApplicationPgpEncrypted ((MimeEntityConstructorArgs) null));
Assert.Throws<ArgumentNullException> (() => new ApplicationPgpSignature ((MimeEntityConstructorArgs) null));
Assert.Throws<ArgumentNullException> (() => new ApplicationPgpSignature ((Stream) null));
// Accept
Assert.Throws<ArgumentNullException> (() => new ApplicationPgpEncrypted ().Accept (null));
Assert.Throws<ArgumentNullException> (() => new ApplicationPgpSignature (stream).Accept (null));
Assert.Throws<ArgumentNullException> (() => ctx.CanSign (null));
Assert.Throws<ArgumentNullException> (() => ctx.CanEncrypt (null));
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.CanSignAsync (null));
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.CanEncryptAsync (null));
// Delete
Assert.Throws<ArgumentNullException> (() => ctx.Delete ((PgpPublicKeyRing) null), "Delete");
Assert.Throws<ArgumentNullException> (() => ctx.Delete ((PgpSecretKeyRing) null), "Delete");
// Decrypt
Assert.Throws<ArgumentNullException> (() => ctx.Decrypt (null), "Decrypt");
// Encrypt
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt ((MailboxAddress[]) null, stream), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt ((PgpPublicKey[]) null, stream), "Encrypt");
Assert.Throws<ArgumentException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "Encrypt");
Assert.Throws<ArgumentException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "Encrypt");
Assert.Throws<ArgumentException> (() => ctx.Encrypt (emptyMailboxes, stream), "Encrypt");
Assert.Throws<ArgumentException> (() => ctx.Encrypt (emptyPubkeys, stream), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, mailboxes, null), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (EncryptionAlgorithm.Cast5, pubkeys, null), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (mailboxes, null), "Encrypt");
Assert.Throws<ArgumentNullException> (() => ctx.Encrypt (pubkeys, null), "Encrypt");
// EncryptAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync ((MailboxAddress[]) null, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync ((PgpPublicKey[]) null, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (emptyMailboxes, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.EncryptAsync (emptyPubkeys, stream), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, mailboxes, null), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (EncryptionAlgorithm.Cast5, pubkeys, null), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (mailboxes, null), "EncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.EncryptAsync (pubkeys, null), "EncryptAsync");
// Export
Assert.Throws<ArgumentNullException> (() => ctx.Export ((PgpPublicKeyRingBundle) null), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export ((MailboxAddress[]) null), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export ((PgpPublicKey[]) null), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export ((PgpPublicKeyRingBundle) null, stream, true), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export ((MailboxAddress[]) null, stream, true), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export ((PgpPublicKey[]) null, stream, true), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export (ctx.PublicKeyRingBundle, null, true), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export (mailboxes, null, true), "Export");
Assert.Throws<ArgumentNullException> (() => ctx.Export (pubkeys, null, true), "Export");
// ExportAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((PgpPublicKeyRingBundle) null), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((MailboxAddress[]) null), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((PgpPublicKey[]) null), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((PgpPublicKeyRingBundle) null, stream, true), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((MailboxAddress[]) null, stream, true), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync ((PgpPublicKey[]) null, stream, true), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync (ctx.PublicKeyRingBundle, null, true), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync (mailboxes, null, true), "ExportAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ExportAsync (pubkeys, null, true), "ExportAsync");
// EnumeratePublicKey[Ring]s
Assert.Throws<ArgumentNullException> (() => ctx.EnumeratePublicKeyRings (null).FirstOrDefault ());
Assert.Throws<ArgumentNullException> (() => ctx.EnumeratePublicKeys (null).FirstOrDefault ());
Assert.Throws<ArgumentNullException> (() => ctx.EnumerateSecretKeyRings (null).FirstOrDefault ());
Assert.Throws<ArgumentNullException> (() => ctx.EnumerateSecretKeys (null).FirstOrDefault ());
// GenerateKeyPair
Assert.Throws<ArgumentNullException> (() => ctx.GenerateKeyPair (null, "password"));
Assert.Throws<ArgumentNullException> (() => ctx.GenerateKeyPair (mailboxes[0], null));
Assert.Throws<ArgumentException> (() => ctx.GenerateKeyPair (mailboxes[0], "password", DateTime.Now));
// DecryptTo
Assert.Throws<ArgumentNullException> (() => ctx.DecryptTo (null, stream), "DecryptTo");
Assert.Throws<ArgumentNullException> (() => ctx.DecryptTo (stream, null), "DecryptTo");
// DecryptToAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.DecryptToAsync (null, stream), "DecryptToAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.DecryptToAsync (stream, null), "DecryptToAsync");
// GetDigestAlgorithmName
Assert.Throws<ArgumentOutOfRangeException> (() => ctx.GetDigestAlgorithmName (DigestAlgorithm.None), "GetDigestAlgorithmName");
// GetPublicKeys
Assert.Throws<ArgumentNullException> (() => ctx.GetPublicKeys (null));
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.GetPublicKeysAsync (null));
Assert.Throws<PublicKeyNotFoundException> (() => ctx.GetPublicKeys (new MailboxAddress[] { clientEastwood }));
Assert.ThrowsAsync<PublicKeyNotFoundException> (() => ctx.GetPublicKeysAsync (new MailboxAddress[] { clientEastwood }));
// GetSigningKey
Assert.Throws<ArgumentNullException> (() => ctx.GetSigningKey (null));
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.GetSigningKeyAsync (null));
Assert.Throws<PrivateKeyNotFoundException> (() => ctx.GetSigningKey (clientEastwood));
Assert.ThrowsAsync<PrivateKeyNotFoundException> (() => ctx.GetSigningKeyAsync (clientEastwood));
// Import
Assert.Throws<ArgumentNullException> (() => ctx.Import ((Stream) null), "Import");
Assert.Throws<ArgumentNullException> (() => ctx.Import ((PgpPublicKeyRing) null), "Import");
Assert.Throws<ArgumentNullException> (() => ctx.Import ((PgpPublicKeyRingBundle) null), "Import");
Assert.Throws<ArgumentNullException> (() => ctx.Import ((PgpSecretKeyRing) null), "Import");
Assert.Throws<ArgumentNullException> (() => ctx.Import ((PgpSecretKeyRingBundle) null), "Import");
// ImportAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ImportAsync ((Stream) null), "ImportAsync");
//Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ImportAsync ((PgpPublicKeyRing) null), "ImportAsync");
//Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ImportAsync ((PgpPublicKeyRingBundle) null), "ImportAsync");
//Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ImportAsync ((PgpSecretKeyRing) null), "ImportAsync");
//Assert.ThrowsAsync<ArgumentNullException> (() => ctx.ImportAsync ((PgpSecretKeyRingBundle) null), "ImportAsync");
// Sign
Assert.Throws<ArgumentNullException> (() => ctx.Sign ((MailboxAddress) null, DigestAlgorithm.Sha1, stream), "Sign");
Assert.Throws<ArgumentNullException> (() => ctx.Sign ((PgpSecretKey) null, DigestAlgorithm.Sha1, stream), "Sign");
Assert.Throws<ArgumentNullException> (() => ctx.Sign (mailboxes[0], DigestAlgorithm.Sha1, null), "Sign");
Assert.Throws<ArgumentNullException> (() => ctx.Sign (key, DigestAlgorithm.Sha1, null), "Sign");
// SignAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, stream), "SignAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, stream), "SignAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAsync (mailboxes[0], DigestAlgorithm.Sha1, null), "SignAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAsync (key, DigestAlgorithm.Sha1, null), "SignAsync");
// SignAndEncrypt
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "SignAndEncrypt");
Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "SignAndEncrypt");
Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, (MailboxAddress[]) null, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, (PgpPublicKey[]) null, stream), "SignAndEncrypt");
Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, stream), "SignAndEncrypt");
Assert.Throws<ArgumentException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, emptyPubkeys, stream), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null), "SignAndEncrypt");
Assert.Throws<ArgumentNullException> (() => ctx.SignAndEncrypt (key, DigestAlgorithm.Sha1, pubkeys, null), "SignAndEncrypt");
// SignAndEncryptAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, (MailboxAddress[]) null, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, (PgpPublicKey[]) null, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, emptyPubkeys, stream), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null), "SignAndEncryptAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, pubkeys, null), "SignAndEncryptAsync");
// SignKey
Assert.Throws<ArgumentNullException> (() => ctx.SignKey (null, pubkeys[0]), "SignKey");
Assert.Throws<ArgumentNullException> (() => ctx.SignKey (key, null), "SignKey");
// Supports
Assert.Throws<ArgumentNullException> (() => ctx.Supports (null), "Supports");
// Verify
Assert.Throws<ArgumentNullException> (() => ctx.Verify (null, stream), "Verify");
Assert.Throws<ArgumentNullException> (() => ctx.Verify (stream, null), "Verify");
// VerifyAsync
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.VerifyAsync (null, stream), "VerifyAsync");
Assert.ThrowsAsync<ArgumentNullException> (() => ctx.VerifyAsync (stream, null), "VerifyAsync");
// MultipartEncrypted
// Encrypt
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt ((MailboxAddress[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt ((PgpPublicKey[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (null, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, (MailboxAddress[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (null, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, (PgpPublicKey[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (EncryptionAlgorithm.Cast5, pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (null, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (null, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.Encrypt (ctx, EncryptionAlgorithm.Cast5, pubkeys, null));
// EncryptAsync
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync ((MailboxAddress[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync ((PgpPublicKey[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (null, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, (MailboxAddress[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (null, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, (PgpPublicKey[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (EncryptionAlgorithm.Cast5, pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (null, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, (MailboxAddress[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (null, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, (PgpPublicKey[]) null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.EncryptAsync (ctx, EncryptionAlgorithm.Cast5, pubkeys, null));
// SignAndEncrypt
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (null, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (null, key, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (null, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (null, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.Throws<ArgumentException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.Throws<ArgumentNullException> (() => MultipartEncrypted.SignAndEncrypt (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null));
// SignAndEncryptAsync
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (null, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (null, key, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync ((MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (null, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyMailboxes, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, mailboxes, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (null, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, null, entity));
Assert.ThrowsAsync<ArgumentException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, emptyPubkeys, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartEncrypted.SignAndEncryptAsync (ctx, key, DigestAlgorithm.Sha1, EncryptionAlgorithm.Cast5, pubkeys, null));
var encrypted = new MultipartEncrypted ();
Assert.Throws<ArgumentNullException> (() => encrypted.Accept (null));
Assert.Throws<ArgumentNullException> (() => encrypted.Decrypt (null));
Assert.Throws<ArgumentNullException> (() => encrypted.Decrypt (null, out signatures));
// MultipartSigned.Create
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (null, mailboxes[0], DigestAlgorithm.Sha1, entity));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, entity));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (ctx, mailboxes[0], DigestAlgorithm.Sha1, null));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (null, key, DigestAlgorithm.Sha1, entity));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, entity));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (ctx, key, DigestAlgorithm.Sha1, null));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create ((PgpSecretKey) null, DigestAlgorithm.Sha1, entity));
Assert.Throws<ArgumentNullException> (() => MultipartSigned.Create (key, DigestAlgorithm.Sha1, null));
// MultipartSigned.CreateAsync
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (null, mailboxes[0], DigestAlgorithm.Sha1, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (ctx, (MailboxAddress) null, DigestAlgorithm.Sha1, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (ctx, mailboxes[0], DigestAlgorithm.Sha1, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (null, key, DigestAlgorithm.Sha1, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (ctx, (PgpSecretKey) null, DigestAlgorithm.Sha1, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (ctx, key, DigestAlgorithm.Sha1, null));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync ((PgpSecretKey) null, DigestAlgorithm.Sha1, entity));
Assert.ThrowsAsync<ArgumentNullException> (() => MultipartSigned.CreateAsync (key, DigestAlgorithm.Sha1, null));
var signed = MultipartSigned.Create (key, DigestAlgorithm.Sha1, entity);
Assert.Throws<ArgumentNullException> (() => signed.Accept (null));
Assert.Throws<ArgumentOutOfRangeException> (() => signed.Prepare (EncodingConstraint.SevenBit, 0));
Assert.Throws<ArgumentNullException> (() => signed.Verify (null));
Assert.ThrowsAsync<ArgumentNullException> (() => signed.VerifyAsync (null));
}
}
static void PumpDataThroughFilter (IMimeFilter filter, string fileName, bool isText)
{
using (var stream = File.OpenRead (fileName)) {
using (var filtered = new FilteredStream (stream)) {
var buffer = new byte[1];
int outputLength;
int outputIndex;
int n;
if (isText)
filtered.Add (new Unix2DosFilter ());
while ((n = filtered.Read (buffer, 0, buffer.Length)) > 0)
filter.Filter (buffer, 0, n, out outputIndex, out outputLength);
filter.Flush (buffer, 0, 0, out outputIndex, out outputLength);
}
}
}
[Test]
public void TestOpenPgpDetectionFilter ()
{
var filter = new OpenPgpDetectionFilter ();
PumpDataThroughFilter (filter, Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "mimekit.gpg.pub"), true);
Assert.AreEqual (OpenPgpDataType.PublicKey, filter.DataType);
Assert.AreEqual (0, filter.BeginOffset);
Assert.AreEqual (1754, filter.EndOffset);
filter.Reset ();
PumpDataThroughFilter (filter, Path.Combine (TestHelper.ProjectDir, "TestData", "openpgp", "mimekit.gpg.sec"), true);
Assert.AreEqual (OpenPgpDataType.PrivateKey, filter.DataType);
Assert.AreEqual (0, filter.BeginOffset);
Assert.AreEqual (3650, filter.EndOffset);
}
}
}
| jstedfast/MimeKit | UnitTests/Cryptography/PgpMimeTests.cs | C# | mit | 103,153 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Number7</source>
<translation>Σχετικά με το Number7</translation>
</message>
<message>
<location line="+39"/>
<source><b>Number7</b> version</source>
<translation>Έκδοση Number7</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation>Πνευματική ιδιοκτησία </translation>
</message>
<message>
<location line="+0"/>
<source>The Number7 developers</source>
<translation>Οι Number7 προγραμματιστές </translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Βιβλίο Διευθύνσεων</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Διπλό-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Δημιούργησε νέα διεύθυνση</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Νέα διεύθυνση</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Number7 addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Αυτές είναι οι Number7 διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Αντιγραφή διεύθυνσης</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Δείξε &QR κωδικα</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Number7 address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Number7</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>&Υπέγραψε το μήνυμα</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Αντιγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation>&Εξαγωγή</translation>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Number7 address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Number7</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Διαγραφή</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Number7 addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Αυτές είναι οι Number7 διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Αντιγραφή &επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Επεξεργασία</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Εξαγωγή Δεδομενων Βιβλίου Διευθύνσεων</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Εξαγωγή λαθών</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Αδυναμία εγγραφής στο αρχείο %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Ετικέτα</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(χωρίς ετικέτα)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Φράση πρόσβασης </translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Βάλτε κωδικό πρόσβασης</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Νέος κωδικός πρόσβασης</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Εισάγετε τον νέο κωδικό πρόσβασης στον πορτοφόλι <br/> Παρακαλώ χρησιμοποιείστε ένα κωδικό με <b> 10 ή περισσότερους τυχαίους χαρακτήρες</b> ή <b> οχτώ ή παραπάνω λέξεις</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Κρυπτογράφησε το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Αυτη η ενεργεία χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Ξεκλειδωσε το πορτοφολι</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Αυτη η ενεργεια χρειάζεται τον κωδικο του πορτοφολιου για να αποκρυπτογραφησειι το πορτοφολι.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Αποκρυπτογράφησε το πορτοφολι</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Άλλαξε κωδικο πρόσβασης</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Εισάγετε τον παλιό και τον νεο κωδικο στο πορτοφολι.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Επιβεβαίωσε την κρυπτογραφηση του πορτοφολιού</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR NUMBER7S</b>!</source>
<translation>Προσοχη: Εαν κρυπτογραφησεις το πορτοφολι σου και χάσεις τον κωδικο σου θα χάσεις <b> ΟΛΑ ΣΟΥ ΤΑ NUMBER7S</b>!
Είσαι σίγουρος ότι θέλεις να κρυπτογραφησεις το πορτοφολι;</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Είστε σίγουροι ότι θέλετε να κρυπτογραφήσετε το πορτοφόλι σας;</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>ΣΗΜΑΝΤΙΚΟ: Τα προηγούμενα αντίγραφα ασφαλείας που έχετε κάνει από το αρχείο του πορτοφόλιου σας θα πρέπει να αντικατασταθουν με το νέο που δημιουργείται, κρυπτογραφημένο αρχείο πορτοφόλιου. Για λόγους ασφαλείας, τα προηγούμενα αντίγραφα ασφαλείας του μη κρυπτογραφημένου αρχείου πορτοφόλιου θα καταστουν άχρηστα μόλις αρχίσετε να χρησιμοποιείτε το νέο κρυπτογραφημένο πορτοφόλι. </translation>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Προσοχη: το πλήκτρο Caps Lock είναι ενεργο.</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Κρυπτογραφημενο πορτοφολι</translation>
</message>
<message>
<location line="-56"/>
<source>Number7 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your number7s from being stolen by malware infecting your computer.</source>
<translation>Το Number7 θα κλεισει τώρα για να τελειώσει την διαδικασία κρυπτογραφησης. Θυμησου ότι κρυπτογραφώντας το πορτοφολι σου δεν μπορείς να προστατέψεις πλήρως τα number7s σου από κλοπή στην περίπτωση όπου μολυνθεί ο υπολογιστής σου με κακόβουλο λογισμικο.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Η κρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε λογω εσωτερικού σφάλματος. Το πορτοφολι δεν κρυπτογραφηθηκε.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Οι εισαχθέντες κωδικοί δεν ταιριάζουν.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Ο κωδικος που εισήχθη για την αποκρυπτογραφηση του πορτοφολιού ήταν λαθος.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Η αποκρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Ο κωδικος του πορτοφολιού άλλαξε με επιτυχία.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Υπογραφή &Μηνύματος...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Συγχρονισμός με το δίκτυο...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Επισκόπηση</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Εμφάνισε γενική εικονα του πορτοφολιού</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Συναλλαγές</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Περιήγηση στο ιστορικο συνναλαγων</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Εξεργασια της λιστας των αποθηκευμενων διευθύνσεων και ετικετων</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Εμφάνισε την λίστα των διευθύνσεων για την παραλαβή πληρωμων</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>Έ&ξοδος</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Εξοδος από την εφαρμογή</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Number7</source>
<translation>Εμφάνισε πληροφορίες σχετικά με το Number7</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Σχετικά με &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Επιλογές...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Κρυπτογράφησε το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Αντίγραφο ασφαλείας του πορτοφολιού</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Άλλαξε κωδικο πρόσβασης</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation>Εισαγωγή μπλοκ από τον σκληρο δίσκο ... </translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation>Φόρτωση ευρετηρίου μπλοκ στον σκληρο δισκο...</translation>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Number7 address</source>
<translation>Στείλε νομισματα σε μια διεύθυνση number7</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Number7</source>
<translation>Επεργασία ρυθμισεων επιλογών για το Number7</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Παράθυρο αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Άνοιγμα κονσόλας αποσφαλμάτωσης και διαγνωστικών</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Number7</source>
<translation>Number7</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Πορτοφόλι</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation>&Αποστολή</translation>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation>&Παραλαβή </translation>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation>&Διεύθυνσεις</translation>
</message>
<message>
<location line="+22"/>
<source>&About Number7</source>
<translation>&Σχετικα:Number7</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Εμφάνισε/Κρύψε</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation>Εμφάνιση ή αποκρύψη του κεντρικου παράθυρου </translation>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Κρυπτογραφήστε τα ιδιωτικά κλειδιά που ανήκουν στο πορτοφόλι σας </translation>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Number7 addresses to prove you own them</source>
<translation>Υπογράψτε ένα μήνυμα για να βεβαιώσετε πως είστε ο κάτοχος αυτής της διεύθυνσης</translation>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Number7 addresses</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Number7</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Αρχείο</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Ρυθμίσεις</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Βοήθεια</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Εργαλειοθήκη καρτελών</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>Number7 client</source>
<translation>Πελάτης Number7</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Number7 network</source>
<translation><numerusform>%n ενεργή σύνδεση στο δίκτυο Number7</numerusform><numerusform>%n ενεργές συνδέσεις στο δίκτυο Βitcoin</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation>Η πηγή του μπλοκ δεν ειναι διαθέσιμη... </translation>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation>Μεταποιημένα %1 απο % 2 (κατ 'εκτίμηση) μπλοκ της ιστορίας της συναλλαγής. </translation>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation><numerusform>%n ώρες </numerusform><numerusform>%n ώρες </numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n ημέρες </numerusform><numerusform>%n ημέρες </numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation><numerusform>%n εβδομαδες</numerusform><numerusform>%n εβδομαδες</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation>%1 πίσω</translation>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation>Το τελευταίο μπλοκ που ελήφθη δημιουργήθηκε %1 πριν.</translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation>Οι συναλλαγές μετά από αυτό δεν θα είναι ακόμη ορατες.</translation>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Σφάλμα</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation>Πληροφορία</translation>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation>Η συναλλαγή ξεπερνάει το όριο.
Μπορεί να ολοκληρωθεί με μια αμοιβή των %1, η οποία αποδίδεται στους κόμβους που επεξεργάζονται τις συναλλαγές και βοηθούν στην υποστήριξη του δικτύου.
Θέλετε να συνεχίσετε;</translation>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Ενημερωμένο</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Ενημέρωση...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Επιβεβαίωση αμοιβής συναλλαγής</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Η συναλλαγή απεστάλη</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Εισερχόμενη συναλλαγή</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Ημερομηνία: %1
Ποσό: %2
Τύπος: %3
Διεύθυνση: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>Χειρισμός URI</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Number7 address or malformed URI parameters.</source>
<translation>Το URI δεν μπορεί να αναλυθεί! Αυτό μπορεί να προκληθεί από μια μη έγκυρη διεύθυνση Number7 ή ακατάλληλη παραμέτρο URI.</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>ξεκλείδωτο</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>κλειδωμένο</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Number7 can no longer continue safely and will quit.</source>
<translation>Παρουσιάστηκε ανεπανόρθωτο σφάλμα. Το Number7 δεν μπορεί πλέον να συνεχίσει με ασφάλεια και θα τερματισθει.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Ειδοποίηση Δικτύου</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Επεξεργασία Διεύθυνσης</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Η επιγραφή που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Διεύθυνση</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Η διεύθυνση που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων. Μπορεί να τροποποιηθεί μόνο για τις διευθύνσεις αποστολής.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Νέα διεύθυνση λήψης</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Νέα διεύθυνση αποστολής</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Επεξεργασία διεύθυνσης λήψης</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Επεξεργασία διεύθυνσης αποστολής</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Η διεύθυνση "%1" βρίσκεται ήδη στο βιβλίο διευθύνσεων.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Number7 address.</source>
<translation>Η διεύθυνση "%1" δεν είναι έγκυρη Number7 διεύθυνση.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Δεν είναι δυνατό το ξεκλείδωμα του πορτοφολιού.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Η δημιουργία νέου κλειδιού απέτυχε.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Number7-Qt</source>
<translation>number7-qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>έκδοση</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>επιλογής γραμμής εντολών</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>επιλογές UI</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Όρισε γλώσσα, για παράδειγμα "de_DE"(προεπιλογή:τοπικές ρυθμίσεις)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Έναρξη ελαχιστοποιημένο</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Εμφάνισε την οθόνη εκκίνησης κατά την εκκίνηση(προεπιλογή:1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Ρυθμίσεις</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Κύριο</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation>Η προαιρετική αμοιβή για κάθε kB επισπεύδει την επεξεργασία των συναλλαγών σας. Οι περισσότερες συναλλαγές είναι 1 kB. </translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Αμοιβή &συναλλαγής</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Number7 after logging in to the system.</source>
<translation>Αυτόματη εκκίνηση του Number7 μετά την εισαγωγή στο σύστημα</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Number7 on system login</source>
<translation>&Έναρξη του Βιtcoin κατά την εκκίνηση του συστήματος</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation>Επαναφορα όλων των επιλογων του πελάτη σε default.</translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation>Επαναφορα ρυθμίσεων</translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Δίκτυο</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Number7 client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Αυτόματο άνοιγμα των θυρών Number7 στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Απόδοση θυρών με χρήστη &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Number7 network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Σύνδεση στο Number7 δίκτυο μέσω διαμεσολαβητή SOCKS4 (π.χ. για σύνδεση μέσω Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Σύνδεση μέσω διαμεσολαβητή SOCKS</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>&IP διαμεσολαβητή:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Διεύθυνση IP του διαμεσολαβητή (π.χ. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Θύρα:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Θύρα διαμεσολαβητή</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Έκδοση:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS εκδοση του διαμεσολαβητη (e.g. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Παράθυρο</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Εμφάνιση μόνο εικονιδίου στην περιοχή ειδοποιήσεων κατά την ελαχιστοποίηση</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Ελαχιστοποίηση αντί για έξοδο κατά το κλείσιμο του παραθύρου</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>Ε&λαχιστοποίηση κατά το κλείσιμο</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>%Απεικόνιση</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Γλώσσα περιβάλλοντος εργασίας: </translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Number7.</source>
<translation>Εδώ μπορεί να ρυθμιστεί η γλώσσα διεπαφής χρήστη. Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του Number7.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Μονάδα μέτρησης:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Number7 addresses in the transaction list or not.</source>
<translation>Επιλέξτε αν θέλετε να εμφανίζονται οι διευθύνσεις Number7 στη λίστα συναλλαγών.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>Εμφάνιση διευθύνσεων στη λίστα συναλλαγών</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&ΟΚ</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Ακύρωση</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Εφαρμογή</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>προεπιλογή</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation>Επιβεβαιώση των επιλογων επαναφοράς </translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation>Για ορισμένες ρυθμίσεις πρεπει η επανεκκίνηση να τεθεί σε ισχύ.</translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation>Θέλετε να προχωρήσετε;</translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Number7.</source>
<translation>Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του Number7.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Φόρμα</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Number7 network after a connection is established, but this process has not completed yet.</source>
<translation>Οι πληροφορίες που εμφανίζονται μπορεί να είναι ξεπερασμένες. Το πορτοφόλι σας συγχρονίζεται αυτόματα με το δίκτυο Number7 μετά από μια σύνδεση, αλλά αυτή η διαδικασία δεν έχει ακόμη ολοκληρωθεί. </translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Υπόλοιπο</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Ανεπιβεβαίωτες</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Πορτοφόλι</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>Ανώριμος</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Εξορυγμενο υπόλοιπο που δεν έχει ακόμα ωριμάσει </translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Πρόσφατες συναλλαγές</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Το τρέχον υπόλοιπο</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον υπόλοιπό σας</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>εκτός συγχρονισμού</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start number7: click-to-pay handler</source>
<translation>Δεν είναι δυνατή η εκκίνηση του Number7: click-to-pay handler</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>Κώδικας QR</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Αίτηση πληρωμής</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Ποσό:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Επιγραφή:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Μήνυμα:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Αποθήκευση ως...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Σφάλμα κατά την κωδικοποίηση του URI σε κώδικα QR</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Το αναγραφόμενο ποσό δεν είναι έγκυρο, παρακαλούμε να το ελέγξετε.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Το αποτέλεσμα της διεύθυνσης είναι πολύ μεγάλο. Μειώστε το μέγεθος για το κείμενο της ετικέτας/ μηνύματος.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Αποθήκευση κώδικα QR</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>Εικόνες PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Όνομα Πελάτη</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>Μη διαθέσιμο</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Έκδοση Πελάτη</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Πληροφορία</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Χρησιμοποιηση της OpenSSL εκδοσης</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Χρόνος εκκίνησης</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Δίκτυο</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Αριθμός συνδέσεων</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Στο testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>αλυσίδα εμποδισμού</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Τρέχον αριθμός μπλοκ</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Κατ' εκτίμηση συνολικά μπλοκς</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Χρόνος τελευταίου μπλοκ</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Άνοιγμα</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>επιλογής γραμμής εντολών</translation>
</message>
<message>
<location line="+7"/>
<source>Show the Number7-Qt help message to get a list with possible Number7 command-line options.</source>
<translation>Εμφανιση του Number7-Qt μήνυματος βοήθειας για να πάρετε μια λίστα με τις πιθανές επιλογές Number7 γραμμής εντολών.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Εμφάνιση</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Κονσόλα</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Ημερομηνία κατασκευής</translation>
</message>
<message>
<location line="-104"/>
<source>Number7 - Debug window</source>
<translation>Number7 - Παράθυρο αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+25"/>
<source>Number7 Core</source>
<translation>Number7 Core</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Αρχείο καταγραφής εντοπισμού σφαλμάτων </translation>
</message>
<message>
<location line="+7"/>
<source>Open the Number7 debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Ανοίξτε το αρχείο καταγραφής εντοπισμού σφαλμάτων από τον τρέχοντα κατάλογο δεδομένων. Αυτό μπορεί να πάρει μερικά δευτερόλεπτα για τα μεγάλα αρχεία καταγραφής. </translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Καθαρισμός κονσόλας</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Number7 RPC console.</source>
<translation>Καλώς ήρθατε στην Number7 RPC κονσόλα.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Χρησιμοποιήστε το πάνω και κάτω βέλος για να περιηγηθείτε στο ιστορικο, και <b>Ctrl-L</b> για εκκαθαριση οθονης.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Γράψτε <b>βοήθεια</b> για μια επισκόπηση των διαθέσιμων εντολών</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Προσθήκη αποδέκτη</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Διαγραφή όλων των πεδίων συναλλαγής</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Καθαρισμός &Όλων</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Υπόλοιπο:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Επιβεβαίωση αποστολής</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>Αποστολη</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> σε %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Επιβεβαίωση αποστολής νομισμάτων</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Είστε βέβαιοι για την αποστολή %1;</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>και</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Η διεύθυνση του αποδέκτη δεν είναι σωστή. Παρακαλώ ελέγξτε ξανά.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Το ποσό πληρωμής πρέπει να είναι μεγαλύτερο από 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Το ποσό ξεπερνάει το διαθέσιμο υπόλοιπο</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Το σύνολο υπερβαίνει το υπόλοιπό σας όταν συμπεριληφθεί και η αμοιβή %1</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Βρέθηκε η ίδια διεύθυνση δύο φορές. Επιτρέπεται μία μόνο εγγραφή για κάθε διεύθυνση, σε κάθε διαδικασία αποστολής.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation>Σφάλμα: Η δημιουργία της συναλλαγής απέτυχε</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Σφάλμα: Η συναλλαγή απερρίφθη. Αυτό ενδέχεται να συμβαίνει αν κάποια από τα νομίσματα έχουν ήδη ξοδευθεί, όπως αν χρησιμοποιήσατε αντίγραφο του wallet.dat και τα νομίσματα ξοδεύθηκαν εκεί.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Φόρμα</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Ποσό:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Πληρωμή &σε:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Διεύθυνση αποστολής της πληρωμής (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Εισάγετε μια επιγραφή για αυτή τη διεύθυνση ώστε να καταχωρηθεί στο βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το πρόχειρο</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Αφαίρεση αποδέκτη</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Number7 address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση Number7 (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Υπογραφές - Είσοδος / Επαλήθευση μήνυματος </translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Υπογραφή Μηνύματος</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν' αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση Number7 (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation>Υπογραφή</translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Αντέγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Number7 address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση Number7</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Υπογραφη μήνυματος</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Επαναφορά όλων των πεδίων μήνυματος</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Καθαρισμός &Όλων</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Πληκτρολογήστε την υπογραφή διεύθυνσης, μήνυμα (βεβαιωθείτε ότι έχετε αντιγράψει τις αλλαγές γραμμής, κενά, tabs, κ.λπ. ακριβώς) και την υπογραφή παρακάτω, για να ελέγξει το μήνυμα. Να είστε προσεκτικοί για να μην διαβάσετε περισσότερα στην υπογραφή ό, τι είναι στην υπογραφή ίδιο το μήνυμα , για να μην εξαπατηθούν από έναν άνθρωπο -in - the-middle επίθεση.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση Number7 (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Number7 address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως υπογραφθηκε απο μια συγκεκριμένη διεύθυνση Number7</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation>Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Επαναφορά όλων επαλήθευμενων πεδίων μήνυματος </translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Number7 address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση Number7 (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Κάντε κλικ στο "Υπογραφή Μηνύματος" για να λάβετε την υπογραφή</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Number7 signature</source>
<translation>Εισαγωγή υπογραφής Number7</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Η διεύθυνση που εισήχθη είναι λάθος.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Παρακαλούμε ελέγξτε την διεύθυνση και δοκιμάστε ξανά.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Η διεύθυνση που έχει εισαχθεί δεν αναφέρεται σε ένα πλήκτρο.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Το προσωπικό κλειδί εισαγμενης διευθυνσης δεν είναι διαθέσιμο.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Η υπογραφή του μηνύματος απέτυχε.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Μήνυμα υπεγράφη.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Η υπογραφή δεν μπόρεσε να αποκρυπτογραφηθεί.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Παρακαλούμε ελέγξτε την υπογραφή και δοκιμάστε ξανά.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Η υπογραφή δεν ταιριάζει με το μήνυμα. </translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Η επιβεβαίωση του μηνύματος απέτυχε</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Μήνυμα επιβεβαιώθηκε.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Number7 developers</source>
<translation>Οι Number7 προγραμματιστές </translation>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/χωρίς σύνδεση;</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/χωρίς επιβεβαίωση</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 επιβεβαιώσεις</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Κατάσταση</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Πηγή</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Δημιουργία </translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Από</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Προς</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation> δική σας διεύθυνση </translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>eπιγραφή</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Πίστωση </translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>μη αποδεκτό</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debit</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Τέλος συναλλαγής </translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Καθαρό ποσό</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Μήνυμα</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Σχόλιο:</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID Συναλλαγής:</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 7 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Πρέπει να περιμένετε 7 μπλοκ πριν μπορέσετε να χρησιμοποιήσετε τα νομίσματα που έχετε δημιουργήσει. Το μπλοκ που δημιουργήσατε μεταδόθηκε στο δίκτυο για να συμπεριληφθεί στην αλυσίδα των μπλοκ. Αν δεν μπει σε αυτή θα μετατραπεί σε "μη αποδεκτό" και δε θα μπορεί να καταναλωθεί. Αυτό συμβαίνει σπάνια όταν κάποιος άλλος κόμβος δημιουργήσει ένα μπλοκ λίγα δευτερόλεπτα πριν από εσάς.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Πληροφορίες αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Συναλλαγή</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>εισροές </translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>αληθής</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>αναληθής </translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, δεν έχει ακόμα μεταδοθεί μ' επιτυχία</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>άγνωστο</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Λεπτομέρειες συναλλαγής</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Αυτό το παράθυρο δείχνει μια λεπτομερή περιγραφή της συναλλαγής</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Χωρίς σύνδεση (%1 επικυρώσεις)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Χωρίς επιβεβαίωση (%1 από %2 επικυρώσεις)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Επικυρωμένη (%1 επικυρώσεις)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Αυτό το μπλοκ δεν έχει παραληφθεί από κανέναν άλλο κόμβο και κατά πάσα πιθανότητα θα απορριφθεί!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Δημιουργήθηκε αλλά απορρίφθηκε</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Παραλαβή με</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Ελήφθη από</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Αποστολή προς</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Πληρωμή προς εσάς</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(δ/α)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Κατάσταση συναλλαγής. Πηγαίνετε το ποντίκι πάνω από αυτό το πεδίο για να δείτε τον αριθμό των επικυρώσεων</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Ημερομηνία κι ώρα λήψης της συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Είδος συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Διεύθυνση αποστολής της συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Ποσό που αφαιρέθηκε ή προστέθηκε στο υπόλοιπο.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Όλα</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Σήμερα</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Αυτή την εβδομάδα</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Αυτόν τον μήνα</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Τον προηγούμενο μήνα</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Αυτό το έτος</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Έκταση...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Ελήφθη με</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Απεστάλη προς</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Προς εσάς</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Άλλο</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Αναζήτηση με βάση τη διεύθυνση ή την επιγραφή</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Ελάχιστο ποσό</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Αντιγραφή διεύθυνσης</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Αντιγραφή επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Αντιγραφή ποσού</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Αντιγραφη του ID Συναλλαγής</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Επεξεργασία επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Εμφάνιση λεπτομερειών συναλλαγής</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Εξαγωγή Στοιχείων Συναλλαγών</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Επικυρωμένες</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Επιγραφή</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Σφάλμα εξαγωγής</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Αδυναμία εγγραφής στο αρχείο %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Έκταση:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>έως</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation>&Εξαγωγή</translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation>Αντίγραφο ασφαλείας του πορτοφολιού</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Αρχεία δεδομένων πορτοφολιού (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Αποτυχία κατά τη δημιουργία αντιγράφου</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Παρουσιάστηκε σφάλμα κατά την αποθήκευση των δεδομένων πορτοφολιού στη νέα τοποθεσία.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation>Η δημιουργια αντιγραφου ασφαλειας πετυχε</translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation>Τα δεδομένα πορτοφόλιου αποθηκεύτηκαν με επιτυχία στη νέα θέση. </translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Number7 version</source>
<translation>Έκδοση Number7</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or number7d</source>
<translation>Αποστολή εντολής στον εξυπηρετητή ή στο number7d</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Λίστα εντολών</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Επεξήγηση εντολής</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Επιλογές:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: number7.conf)</source>
<translation>Ορίστε αρχείο ρυθμίσεων (προεπιλογή: number7.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: number7d.pid)</source>
<translation>Ορίστε αρχείο pid (προεπιλογή: number7d.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Ορισμός φακέλου δεδομένων</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Όρισε το μέγεθος της βάσης προσωρινής αποθήκευσης σε megabytes(προεπιλογή:25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 6093 or testnet: 16093)</source>
<translation>Εισερχόμενες συνδέσεις στη θύρα <port> (προεπιλογή: 6093 ή στο testnet: 16093)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Μέγιστες αριθμός συνδέσεων με τους peers <n> (προεπιλογή: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομοτίμους, και αποσυνδέσh</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>Διευκρινίστε τη δικιά σας δημόσια διεύθυνση.</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %u για αναμονή IPv4: %s</translation>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 6094 or testnet: 16094)</source>
<translation>Εισερχόμενες συνδέσεις JSON-RPC στη θύρα <port> (προεπιλογή: 6094 or testnet: 16094)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Χρήση του δοκιμαστικού δικτύου</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=number7rpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Number7 Alert" [email protected]
</source>
<translation>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=number7rpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Number7 Alert" [email protected]
</translation>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η υποδοχη RPC %u για αναμονη του IPv6, επεσε πισω στο IPv4:%s</translation>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Αποθηκευση σε συγκεκριμένη διεύθυνση. Χρησιμοποιήστε τα πλήκτρα [Host] : συμβολισμός θύρα για IPv6</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Number7 is probably already running.</source>
<translation>Αδυναμία κλειδώματος του φακέλου δεδομένων %s. Πιθανώς το Number7 να είναι ήδη ενεργό.</translation>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Σφάλμα: Η συναλλαγή απορρίφθηκε.
Αυτό ίσως οφείλεται στο ότι τα νομίσματά σας έχουν ήδη ξοδευτεί, π.χ. με την αντιγραφή του wallet.dat σε άλλο σύστημα και την χρήση τους εκεί, χωρίς η συναλλαγή να έχει καταγραφεί στο παρόν σύστημα.</translation>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation>Σφάλμα: Αυτή η συναλλαγή απαιτεί αμοιβή συναλλαγής τουλάχιστον %s λόγω του μεγέθους, πολυπλοκότητας ή της χρήσης πρόσφατης παραλαβής κεφαλαίου</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Εκτέλεση της εντολής όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Ορίστε το μέγιστο μέγεθος των high-priority/low-fee συναλλαγων σε bytes (προεπιλογή: 27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Αυτό είναι ένα προ-τεστ κυκλοφορίας - χρησιμοποιήστε το με δική σας ευθύνη - δεν χρησιμοποιείτε για εξόρυξη ή για αλλες εφαρμογές</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Προειδοποίηση: Η παράμετρος -paytxfee είναι πολύ υψηλή. Πρόκειται για την αμοιβή που θα πληρώνετε για κάθε συναλλαγή που θα στέλνετε.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Προειδοποίηση: Εμφανίσεις συναλλαγων δεν μπορεί να είναι σωστες! Μπορεί να χρειαστεί να αναβαθμίσετε, ή άλλοι κόμβοι μπορεί να χρειαστεί να αναβαθμίστουν. </translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Number7 will not work properly.</source>
<translation>Προειδοποίηση: Παρακαλώ βεβαιωθείτε πως η ημερομηνία κι ώρα του συστήματός σας είναι σωστές. Αν το ρολόι του υπολογιστή σας πάει λάθος, ενδέχεται να μη λειτουργεί σωστά το Number7.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Προειδοποίηση : Σφάλμα wallet.dat κατα την ανάγνωση ! Όλα τα κλειδιά αναγνωρισθηκαν σωστά, αλλά τα δεδομένα των συναλλαγών ή καταχωρήσεις στο βιβλίο διευθύνσεων μπορεί να είναι ελλιπείς ή λανθασμένα. </translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Προειδοποίηση : το αρχειο wallet.dat ειναι διεφθαρμένο, τα δεδομένα σώζονται ! Original wallet.dat αποθηκεύονται ως πορτοφόλι { timestamp } bak στο % s ? . . Αν το υπόλοιπο του ή τις συναλλαγές σας, είναι λάθος θα πρέπει να επαναφέρετε από ένα αντίγραφο ασφαλείας</translation>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat </translation>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Αποκλεισμός επιλογων δημιουργίας: </translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Σύνδεση μόνο με ορισμένους κόμβους</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation>Εντοπισθηκε διεφθαρμενη βαση δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Ανακαλύψτε την δικη σας IP διεύθυνση (προεπιλογή: 1 όταν ακούει και δεν - externalip) </translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation>Θελετε να δημιουργηθει τωρα η βαση δεδομενων του μπλοκ? </translation>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων μπλοκ</translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων πορτοφόλιου %s!</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation>Προειδοποίηση: Χαμηλός χώρος στο δίσκο </translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Σφάλμα: το πορτοφόλι είναι κλειδωμένο, δεν μπορεί να δημιουργηθεί συναλλαγή</translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation>Λάθος: λάθος συστήματος:</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>ταλαιπωρηθειτε για να ακούσετε σε οποιαδήποτε θύρα. Χρήση - ακούστε = 0 , αν θέλετε αυτό.</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation>Αποτυχία αναγνωσης των block πληροφοριων</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation>Η αναγνωση του μπλοκ απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation>Ο συγχρονισμος του μπλοκ ευρετηριου απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation>Η δημιουργια του μπλοκ ευρετηριου απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation>Η δημιουργια των μπλοκ πληροφοριων απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation>Η δημιουργια του μπλοκ απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation>Αδυναμία εγγραφής πληροφοριων αρχειου</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation>Αποτυχία εγγραφής στη βάση δεδομένων νομίσματος</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation>Αποτυχία εγγραφής δείκτη συναλλαγών </translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation>Αποτυχία εγγραφής αναίρεσης δεδομένων </translation>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>Βρες ομότιμους υπολογιστές χρησιμοποιώντας αναζήτηση DNS(προεπιλογή:1)</translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation>Δημιουργία νομισμάτων (προκαθορισμος: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>Πόσα μπλοκ να ελέγχθουν κατά την εκκίνηση (προεπιλογή:288,0=όλα)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation>Πόσο εξονυχιστική να είναι η επιβεβαίωση του μπλοκ(0-4, προεπιλογή:3)</translation>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation>Δεν ειναι αρκετες περιγραφες αρχείων διαθέσιμες.</translation>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation>Ορίσμος του αριθμόυ θεματων στην υπηρεσία κλήσεων RPC (προεπιλογή: 4) </translation>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation>Επαλήθευση των μπλοκ... </translation>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation>Επαλήθευση πορτοφολιου... </translation>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation>Ορίσμος του αριθμό των νημάτων ελέγχου σεναρίου (μέχρι 16, 0 = auto, <0 = αφήνουν τους πολλους πυρήνες δωρεάν, default: 0)</translation>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation>Πληροφορία</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation>Διατηρήση ένος πλήρες ευρετήριου συναλλαγών (προεπιλογή: 0) </translation>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Μέγιστος buffer λήψης ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Μέγιστος buffer αποστολής ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 1000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation>Μονο αποδοχη αλυσίδας μπλοκ που ταιριάζει με τα ενσωματωμένα σημεία ελέγχου (προεπιλογή: 1) </translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation> Συνδέση μόνο σε κόμβους του δικτύου <net> (IPv4, IPv6 ή Tor) </translation>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Χρονοσφραγίδα πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Number7 Wiki for SSL setup instructions)</source>
<translation>Ρυθμίσεις SSL: (ανατρέξτε στο Number7 Wiki για οδηγίες ρυθμίσεων SSL)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Επιλέξτε την έκδοση του διαμεσολαβητη για να χρησιμοποιήσετε (4-5 , προεπιλογή: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στον debugger</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Ορίσμος του μέγιστου μέγεθος block σε bytes (προεπιλογή: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Ορίστε το μέγιστο μέγεθος block σε bytes (προεπιλογή: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation>Η υπογραφή συναλλαγής απέτυχε </translation>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation>Λάθος Συστήματος:</translation>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation>Το ποσό της συναλλαγής είναι πολύ μικρο </translation>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation>Τα ποσά των συναλλαγών πρέπει να είναι θετικα</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation>Η συναλλαγή ειναι πολύ μεγάλη </translation>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:1)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Χρήση διακομιστή μεσολάβησης για την επίτευξη των Tor κρυμμένων υπηρεσιων (προεπιλογή: ίδιο με το-proxy) </translation>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Προειδοποίηση: Αυτή η έκδοση είναι ξεπερασμένη, απαιτείται αναβάθμιση </translation>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation>Θα πρέπει να ξαναχτίστουν οι βάσεις δεδομένων που χρησιμοποιούντε-Αναδημιουργία αλλάγων-txindex </translation>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>Το αρχειο wallet.dat ειναι διεφθαρμένο, η διάσωση απέτυχε</translation>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Κωδικός για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Αποστολή εντολών στον κόμβο <ip> (προεπιλογή: 127.0.0.1)</translation>
</message>
<message>
<location line="-7"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Όριο πλήθους κλειδιών pool <n> (προεπιλογή: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Αποδεκτά κρυπτογραφήματα (προεπιλογή: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Αυτό το κείμενο βοήθειας</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή (bind returned error %d, %s) </translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Σύνδεση μέσω διαμεσολαβητή socks</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Φόρτωση διευθύνσεων...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Number7</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του Number7</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Number7 to complete</source>
<translation>Απαιτείται η επανεγγραφή του Πορτοφολιού, η οποία θα ολοκληρωθεί στην επανεκκίνηση του Number7</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Σφάλμα φόρτωσης αρχείου wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Άγνωστo δίκτυο ορίζεται σε onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Άγνωστo δίκτυο ορίζεται: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Λάθος ποσότητα</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Ανεπαρκές κεφάλαιο</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Φόρτωση ευρετηρίου μπλοκ...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Προσέθεσε ένα κόμβο για σύνδεση και προσπάθησε να κρατήσεις την σύνδεση ανοιχτή</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Number7 is probably already running.</source>
<translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή. Το Number7 είναι πιθανώς ήδη ενεργό.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Αμοιβή ανά KB που θα προστίθεται στις συναλλαγές που στέλνεις</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Φόρτωση πορτοφολιού...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Ανίχνευση...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Η φόρτωση ολοκληρώθηκε</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Χρήση της %s επιλογής</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Σφάλμα</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s
Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό</translation>
</message>
</context>
</TS> | number7team/number7 | src/qt/locale/bitcoin_el_GR.ts | TypeScript | mit | 138,071 |
.home-layout {
padding-top: 50px;
padding-bottom: 50px;
text-align: center;
background: url('https://scontent-ord1-1.xx.fbcdn.net/hphotos-xta1/t31.0-8/10991609_10104851058880999_4908278955780656545_o.jpg') no-repeat center center fixed;
background-size: cover;
height: 855px;
}
.home-row {
position: relative;
padding-top: 20%;
padding-bottom: 20%;
}
#home-logo {
font-family: 'Oswald', sans-serif;
font-size: 4em;
}
#home-motto {
font-family: 'Lora', serif;
font-size: 25px;
}
#home-links {
float: none;
margin: 0 auto;
}
.about-layout {
padding-top: 50px;
height: 855px;
}
.about-image {
width: 300px;
}
.portfolio-layout {
padding-top: 50px;
/*height: 855px;*/
}
.portfolio-img {
width: 300px;
height: 280px;
box-shadow: 3px 3px 6px #888888;
}
.contact-layout {
padding-top: 50px;
height: 500px;
}
footer {
padding-top: 10px;
background-color: #85adad;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
} | jujubeee314/freeCodeCamp_Portfolio | css/style.css | CSS | mit | 1,001 |
var _ = require("underscore"),
Events = require("./Events"),
querystring = require("querystring"),
httpClient = require("./httpClient"),
utils = require("./utils"),
logger = require("config-logger");
var environments = {
sandbox: {
restHost: "api-sandbox.oanda.com",
streamHost: "stream-sandbox.oanda.com",
secure: false
},
practice: {
restHost: "api-fxpractice.oanda.com",
streamHost: "stream-fxpractice.oanda.com"
},
live: {
restHost: "api-fxtrade.oanda.com",
streamHost: "stream-fxtrade.oanda.com"
}
};
var maxRequestsPerSecond = 15,
maxRequestsWarningThreshold = 1000;
/*
* config.environment
* config.accessToken
* config.username (Sandbox only)
*/
function OandaAdapter (config) {
config.environment = config.environment || "practice";
// this.accountId = accountId;
this.accessToken = config.accessToken;
this.restHost = environments[config.environment].restHost;
this.streamHost = environments[config.environment].streamHost;
this.secure = environments[config.environment].secure;
if (config.environment === "sandbox") {
this.username = config.username;
}
this.subscriptions = {};
this._eventsBuffer = [];
this._pricesBuffer = [];
this._sendRESTRequest = utils.rateLimit(this._sendRESTRequest, this, 1000 / maxRequestsPerSecond, maxRequestsWarningThreshold);
}
Events.mixin(OandaAdapter.prototype);
/*
* Subscribes to events for all accounts authorized by the token
*/
OandaAdapter.prototype.subscribeEvents = function (listener, context) {
var existingSubscriptions = this.getHandlers("event");
this.off("event", listener, context);
this.on("event", listener, context);
if (existingSubscriptions.length === 0) {
this._streamEvents();
}
};
OandaAdapter.prototype.unsubscribeEvents = function (listener, context) {
this.off("event", listener, context);
this._streamEvents();
};
OandaAdapter.prototype._streamEvents = function () {
var subscriptionCount = this.getHandlers("event").length;
if (this.eventsRequest) {
this.eventsRequest.abort();
}
if (subscriptionCount === 0) {
return;
}
clearTimeout(this.eventsTimeout);
this.eventsTimeout = setTimeout(this._eventsHeartbeatTimeout.bind(this), 20000);
this.eventsRequest = httpClient.sendRequest({
hostname: this.streamHost,
method: "GET",
path: "/v1/events",
headers: {
Authorization: "Bearer " + this.accessToken,
Connection: "Keep-Alive"
},
secure: this.secure
},
this._onEventsResponse.bind(this),
this._onEventsData.bind(this)
);
};
OandaAdapter.prototype._onEventsResponse = function (error, body, statusCode) {
if (statusCode !== 200) {
if (body && body.disconnect) {
this.trigger("message", null, "Events streaming API disconnected.\nOanda code " + body.disconnect.code + ": " + body.disconnect.message);
} else {
this.trigger("message", null, "Events streaming API disconnected with status " + statusCode);
}
}
clearTimeout(this.eventsTimeout);
this.eventsTimeout = setTimeout(this._eventsHeartbeatTimeout.bind(this), 20000);
};
OandaAdapter.prototype._onEventsData = function (data) {
// Single chunks sometimes contain more than one event. Each always end with /r/n. Whole chunk therefore not JSON parsable, so must split.
// Also, an event may be split accross data chunks, so must buffer.
data.split(/\r\n/).forEach(function (line) {
var update;
if (line) {
this._eventsBuffer.push(line);
try {
update = JSON.parse(this._eventsBuffer.join(""));
} catch (error) {
if (this._eventsBuffer.length <= 5) {
// Wait for next line.
return;
}
logger.error("Unable to parse Oanda events subscription update", this._eventsBuffer.join("\n"), error);
this._eventsBuffer = [];
return;
}
this._eventsBuffer = [];
if (update.heartbeat) {
clearTimeout(this.eventsTimeout);
this.eventsTimeout = setTimeout(this._eventsHeartbeatTimeout.bind(this), 20000);
return;
}
this.trigger("event", update);
}
}, this);
};
OandaAdapter.prototype._eventsHeartbeatTimeout = function () {
logger.warn("OandaAdapter: No heartbeat received from events stream for 20 seconds. Reconnecting.");
this._streamEvents();
};
OandaAdapter.prototype.getAccounts = function (callback) {
this._sendRESTRequest({
method: "GET",
path: "/v1/accounts" + (this.username ? "?username=" + this.username : "")
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body.accounts) {
callback(null, body.accounts);
} else {
callback("Unexpected accounts response");
}
});
};
OandaAdapter.prototype.getAccount = function (accountId, callback) {
this._sendRESTRequest({
method: "GET",
path: "/v1/accounts/" + accountId
}, callback);
};
OandaAdapter.prototype.getInstruments = function (accountId, callback) {
this._sendRESTRequest({
method: "GET",
path: "/v1/instruments?accountId=" + accountId + "&fields=" + ["instrument", "displayName", "pip", "maxTradeUnits", "precision", "maxTrailingStop", "minTrailingStop", "marginRate", "halted"].join("%2C"),
},
function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body.instruments) {
callback(null, body.instruments);
} else {
callback("Unexpected instruments response");
}
});
};
OandaAdapter.prototype.getPrice = function (symbol, callback) {
var multiple = _.isArray(symbol);
if (multiple) {
symbol = symbol.join("%2C");
}
this._sendRESTRequest({
method: "GET",
path: "/v1/prices?instruments=" + symbol
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body && body.prices[0]) {
callback(null, multiple ? body.prices : body.prices[0]);
} else {
callback("Unexpected price response for " + symbol);
}
});
};
OandaAdapter.prototype.subscribePrice = function (accountId, symbol, listener, context) {
var existingSubscriptions = this.getHandlers("price/" + symbol);
// Price stream needs an accountId to be passed for streaming prices, though prices for a connection are same anyway
if (!this.streamPrices) {
this.streamPrices = _.throttle(this._streamPrices.bind(this, accountId));
}
this.off("price/" + symbol, listener, context);
this.on("price/" + symbol, listener, context);
if (existingSubscriptions.length === 0) {
this.streamPrices();
}
};
OandaAdapter.prototype.unsubscribePrice = function (symbol, listener, context) {
this.off("price/" + symbol, listener, context);
this.streamPrices();
};
// Kills rates streaming keep alive request for account and creates a new one whenever subsciption list changes. Should always be throttled.
OandaAdapter.prototype._streamPrices = function (accountId) {
var changed;
this.priceSubscriptions = Object.keys(this.getHandlers()).reduce(function (memo, event) {
var match = event.match("^price/(.+)$");
if (match) {
memo.push(match[1]);
}
return memo;
}, []).sort().join("%2C");
changed = !this.lastPriceSubscriptions || this.priceSubscriptions !== this.lastPriceSubscriptions;
this.lastPriceSubscriptions = this.priceSubscriptions;
if (!changed) {
return;
}
if (this.pricesRequest) {
this.pricesRequest.abort();
}
if (this.priceSubscriptions === "") {
return;
}
clearTimeout(this.pricesTimeout);
this.pricesTimeout = setTimeout(this._pricesHeartbeatTimeout.bind(this), 10000);
this.pricesRequest = httpClient.sendRequest({
hostname: this.streamHost,
method: "GET",
path: "/v1/prices?accountId=" + accountId + "&instruments=" + this.priceSubscriptions,
headers: {
Authorization: "Bearer " + this.accessToken,
Connection: "Keep-Alive"
},
secure: this.secure
},
this._onPricesResponse.bind(this, accountId),
this._onPricesData.bind(this)
);
};
OandaAdapter.prototype._onPricesResponse = function (accountId, error, body, statusCode) {
if (statusCode !== 200) {
if (body && body.disconnect) {
this.trigger("message", accountId, "Prices streaming API disconnected.\nOanda code " + body.disconnect.code + ": " + body.disconnect.message);
} else {
this.trigger("message", accountId, "Prices streaming API disconnected with status " + statusCode);
}
}
clearTimeout(this.pricesTimeout);
this.pricesTimeout = setTimeout(this._pricesHeartbeatTimeout.bind(this), 10000);
};
OandaAdapter.prototype._onPricesData = function (data) {
// Single data chunks sometimes contain more than one tick. Each always end with /r/n. Whole chunk therefore not JSON parsable, so must split.
// A tick may also be split accross data chunks, so must buffer
data.split(/\r\n/).forEach(function (line) {
var update;
if (line) {
this._pricesBuffer.push(line);
try {
update = JSON.parse(this._pricesBuffer.join(""));
} catch (error) {
if (this._pricesBuffer.length <= 5) {
// Wait for next update.
return;
}
// Drop if cannot produce object after 5 updates
logger.error("Unable to parse Oanda price subscription update", this._pricesBuffer.join("\n"), error);
this._pricesBuffer = [];
return;
}
this._pricesBuffer = [];
if (update.heartbeat) {
clearTimeout(this.pricesTimeout);
this.pricesTimeout = setTimeout(this._pricesHeartbeatTimeout.bind(this), 10000);
return;
}
if (update.tick) {
update.tick.time = new Date(update.tick.time);
this.trigger("price/" + update.tick.instrument, update.tick);
}
}
}, this);
};
OandaAdapter.prototype._pricesHeartbeatTimeout = function () {
logger.warn("OandaAdapter: No heartbeat received from prices stream for 10 seconds. Reconnecting.");
delete this.lastPriceSubscriptions;
this._streamPrices();
};
/**
* Get historical price information about an instrument in candlestick format as defined at
* http://developer.oanda.com/rest-live/rates/#aboutCandlestickRepresentation
*/
OandaAdapter.prototype.getCandles = function (instrument, options, callback)
{
options = _.extend(options, {instrument: instrument});
this._sendRESTRequest({
method: "GET",
path: "/v1/candles?" + querystring.stringify(options),
headers: {
Authorization: "Bearer " + this.accessToken,
"X-Accept-Datetime-Format": "UNIX"
}
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body && body.candles) {
callback(null, body.candles);
} else if (body === "") {
// Body is an empty string if there are no candles to return
callback(null, []);
} else {
callback("Unexpected candles response for " + symbol);
}
});
};
OandaAdapter.prototype.getOpenPositions = function (accountId, callback) {
this._sendRESTRequest({
method: "GET",
path: "/v1/accounts/" + accountId + "/positions"
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body && body.positions) {
callback(null, body.positions);
} else {
callback("Unexpected response for open positions");
}
});
};
OandaAdapter.prototype.getOpenTrades = function (accountId, callback) {
this._sendRESTRequest({
method: "GET",
path: "/v1/accounts/" + accountId + "/trades"
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body && body.trades) {
callback(null, body.trades);
} else {
callback("Unexpected response for open trades");
}
});
};
/**
* @method createOrder
* @param {String} accountId Required.
* @param {Object} order
* @param {String} order.instrument Required. Instrument to open the order on.
* @param {Number} order.units Required. The number of units to open order for.
* @param {String} order.side Required. Direction of the order, either ‘buy’ or ‘sell’.
* @param {String} order.type Required. The type of the order ‘limit’, ‘stop’, ‘marketIfTouched’ or ‘market’.
* @param {String} order.expiry Required. If order type is ‘limit’, ‘stop’, or ‘marketIfTouched’. The value specified must be in a valid datetime format.
* @param {String} order.price Required. If order type is ‘limit’, ‘stop’, or ‘marketIfTouched’. The price where the order is set to trigger at.
* @param {Number} order.lowerBound Optional. The minimum execution price.
* @param {Number} order.upperBound Optional. The maximum execution price.
* @param {Number} order.stopLoss Optional. The stop loss price.
* @param {Number} order.takeProfit Optional. The take profit price.
* @param {Number} order.trailingStop Optional The trailing stop distance in pips, up to one decimal place.
* @param {Function} callback
*/
OandaAdapter.prototype.createOrder = function (accountId, order, callback) {
if (!order.instrument) {
return callback("'instrument' is a required field");
}
if (!order.units) {
return callback("'units' is a required field");
}
if (!order.side) {
return callback("'side' is a required field. Specify 'buy' or 'sell'");
}
if (!order.type) {
return callback("'type' is a required field. Specify 'market', 'marketIfTouched', 'stop' or 'limit'");
}
if ((order.type !== "market") && !order.expiry) {
return callback("'expiry' is a required field for order type '" + order.type + "'");
}
if ((order.type !== "market") && !order.price) {
return callback("'price' is a required field for order type '" + order.type + "'");
}
this._sendRESTRequest({
method: "POST",
path: "/v1/accounts/" + accountId + "/orders",
data: order,
headers: {
Authorization: "Bearer " + this.accessToken,
"Content-Type": "application/x-www-form-urlencoded"
},
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
callback(null, body);
});
};
OandaAdapter.prototype.closeTrade = function (accountId, tradeId, callback) {
this._sendRESTRequest({
method: "DELETE",
path: "/v1/accounts/" + accountId + "/trades/" + tradeId
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
if (body) {
callback(null, body);
} else {
callback("Unexpected response for open positions");
}
});
};
OandaAdapter.prototype.getOrders = function (accountId, callback)
{
this._sendRESTRequest({
method: "GET",
path: "/v1/accounts/" + accountId + "/orders",
headers: {
Authorization: "Bearer " + this.accessToken,
"Content-Type": "application/x-www-form-urlencoded"
},
}, function (error, body, statusCode) {
if (error) {
if (body && body.message) {
logger.error("Response from Oanda", statusCode + " Error: " + body.message + " (OANDA error code " + body.code + ")");
return callback(body.message);
}
return callback(error);
}
callback(null, body);
});
};
OandaAdapter.prototype._sendRESTRequest = function (request, callback) {
request.hostname = this.restHost;
request.headers = request.headers || {
Authorization: "Bearer " + this.accessToken
};
request.secure = this.secure;
httpClient.sendRequest(request, callback);
};
OandaAdapter.prototype.kill = function () {
if (this.pricesRequest) {
this.pricesRequest.abort();
}
if (this.eventsRequest) {
this.eventsRequest.abort();
}
this.off();
};
module.exports = OandaAdapter; | naddison36/oanda-adapter | OandaAdapter.js | JavaScript | mit | 19,053 |
require "mscorlib"
require "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Collections.Generic, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Linq, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
require "System.Text, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
module CodeBuilder.DataSource.Exporter
require "PhysicalDataModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
class SqlServer2000Exporter < BaseExporter, IExporter
def Export(connectionString)
if connectionString == nil then
raise ArgumentNullException.new("connectionString", "Argument is null")
end
model = Model.new()
model.Database = "SqlServer2000"
return model
end
def GetTables()
return nil
end
def GetViews()
return nil
end
def GetColumns()
return nil
end
def GetKeys()
return nil
end
def GetPrimaryKeys()
return nil
end
end
end | xianrendzw/CodeBuilder.Ruby | CodeBuilder.Framework/Exporter/SQLServer/SqlServer2000Exporter.rb | Ruby | mit | 1,015 |
package com.semmle.jcorn;
import com.semmle.js.ast.Position;
public class SyntaxError extends RuntimeException {
private static final long serialVersionUID = -4883173648492364902L;
private final Position position;
public SyntaxError(String msg, Position loc, int raisedAt) {
super(msg);
this.position = loc;
}
public Position getPosition() {
return position;
}
}
| github/codeql | javascript/extractor/src/com/semmle/jcorn/SyntaxError.java | Java | mit | 392 |
## Sentence No. 124 -
annat var det 1976 när after dark tog sina första steg som dragshowgrupp , och 1980 när de **flyttade** **in** på hamburger börs .
### Existing MWEs:
1- **flyttade in** (VPC)Tokens :
flyttade
in
### Identified MWEs:
1- **tog sina** Tokens :
tog
sina
0- SHIFT > S= [] B= [annat, var, det ,.. ]
1- SHIFT > S= [annat] B= [var, det, 1976 ,.. ]
2- COMPLETE > S= [] B= [var, det, 1976 ,.. ]
3- SHIFT > S= [var] B= [det, 1976, när ,.. ]
4- COMPLETE > S= [] B= [det, 1976, när ,.. ]
5- SHIFT > S= [det] B= [1976, när, after ,.. ]
6- COMPLETE > S= [] B= [1976, när, after ,.. ]
7- SHIFT > S= [1976] B= [när, after, dark ,.. ]
8- COMPLETE > S= [] B= [när, after, dark ,.. ]
9- SHIFT > S= [när] B= [after, dark, tog ,.. ]
10- COMPLETE > S= [] B= [after, dark, tog ,.. ]
11- SHIFT > S= [after] B= [dark, tog, sina ,.. ]
12- COMPLETE > S= [] B= [dark, tog, sina ,.. ]
13- SHIFT > S= [dark] B= [tog, sina, första ,.. ]
14- COMPLETE > S= [] B= [tog, sina, första ,.. ]
15- SHIFT > S= [tog] B= [sina, första, steg ,.. ]
16- SHIFT > S= [tog, sina] B= [första, steg, som ,.. ]
17- **MERGE** > S= [[tog, sina]] B= [första, steg, som ,.. ]
18- COMPLETE > S= [] B= [första, steg, som ,.. ]
19- SHIFT > S= [första] B= [steg, som, dragshowgrupp ,.. ]
20- COMPLETE > S= [] B= [steg, som, dragshowgrupp ,.. ]
21- SHIFT > S= [steg] B= [som, dragshowgrupp, , ,.. ]
22- COMPLETE > S= [] B= [som, dragshowgrupp, , ,.. ]
23- SHIFT > S= [som] B= [dragshowgrupp, ,, och ,.. ]
24- COMPLETE > S= [] B= [dragshowgrupp, ,, och ,.. ]
25- SHIFT > S= [dragshowgrupp] B= [,, och, 1980 ,.. ]
26- COMPLETE > S= [] B= [,, och, 1980 ,.. ]
27- SHIFT > S= [,] B= [och, 1980, när ,.. ]
28- COMPLETE > S= [] B= [och, 1980, när ,.. ]
29- SHIFT > S= [och] B= [1980, när, de ,.. ]
30- COMPLETE > S= [] B= [1980, när, de ,.. ]
31- SHIFT > S= [1980] B= [när, de, flyttade ,.. ]
32- COMPLETE > S= [] B= [när, de, flyttade ,.. ]
33- SHIFT > S= [när] B= [de, flyttade, in ,.. ]
34- COMPLETE > S= [] B= [de, flyttade, in ,.. ]
35- SHIFT > S= [de] B= [flyttade, in, på ,.. ]
36- COMPLETE > S= [] B= [flyttade, in, på ,.. ]
37- SHIFT > S= [flyttade] B= [in, på, hamburger ,.. ]
38- COMPLETE > S= [] B= [in, på, hamburger ,.. ]
39- SHIFT > S= [in] B= [på, hamburger, börs ,.. ]
40- COMPLETE > S= [] B= [på, hamburger, börs ,.. ]
41- SHIFT > S= [på] B= [hamburger, börs, . ,.. ]
42- COMPLETE > S= [] B= [hamburger, börs, . ,.. ]
43- SHIFT > S= [hamburger] B= [börs, . ,.. ]
44- COMPLETE > S= [] B= [börs, . ,.. ]
45- SHIFT > S= [börs] B= [.]
46- COMPLETE > S= [] B= [.]
47- SHIFT > S= [.] B= [ ]
48- COMPLETE > S= [] B= [ ]
## Sentence No. 133 -
– de berättade att de hade klagat ända sedan verksamheten började utan att **få** **gehör** , säger frida nowotny .
### Existing MWEs:
1- **få gehör** (ID)Tokens :
få
gehör
0- SHIFT > S= [] B= [–, de, berättade ,.. ]
1- SHIFT > S= [–] B= [de, berättade, att ,.. ]
2- COMPLETE > S= [] B= [de, berättade, att ,.. ]
3- SHIFT > S= [de] B= [berättade, att, de ,.. ]
4- COMPLETE > S= [] B= [berättade, att, de ,.. ]
5- SHIFT > S= [berättade] B= [att, de, hade ,.. ]
6- COMPLETE > S= [] B= [att, de, hade ,.. ]
7- SHIFT > S= [att] B= [de, hade, klagat ,.. ]
8- COMPLETE > S= [] B= [de, hade, klagat ,.. ]
9- SHIFT > S= [de] B= [hade, klagat, ända ,.. ]
10- COMPLETE > S= [] B= [hade, klagat, ända ,.. ]
11- SHIFT > S= [hade] B= [klagat, ända, sedan ,.. ]
12- COMPLETE > S= [] B= [klagat, ända, sedan ,.. ]
13- SHIFT > S= [klagat] B= [ända, sedan, verksamheten ,.. ]
14- COMPLETE > S= [] B= [ända, sedan, verksamheten ,.. ]
15- SHIFT > S= [ända] B= [sedan, verksamheten, började ,.. ]
16- COMPLETE > S= [] B= [sedan, verksamheten, började ,.. ]
17- SHIFT > S= [sedan] B= [verksamheten, började, utan ,.. ]
18- COMPLETE > S= [] B= [verksamheten, började, utan ,.. ]
19- SHIFT > S= [verksamheten] B= [började, utan, att ,.. ]
20- COMPLETE > S= [] B= [började, utan, att ,.. ]
21- SHIFT > S= [började] B= [utan, att, få ,.. ]
22- COMPLETE > S= [] B= [utan, att, få ,.. ]
23- SHIFT > S= [utan] B= [att, få, gehör ,.. ]
24- COMPLETE > S= [] B= [att, få, gehör ,.. ]
25- SHIFT > S= [att] B= [få, gehör, , ,.. ]
26- COMPLETE > S= [] B= [få, gehör, , ,.. ]
27- SHIFT > S= [få] B= [gehör, ,, säger ,.. ]
28- COMPLETE > S= [] B= [gehör, ,, säger ,.. ]
29- SHIFT > S= [gehör] B= [,, säger, frida ,.. ]
30- COMPLETE > S= [] B= [,, säger, frida ,.. ]
31- SHIFT > S= [,] B= [säger, frida, nowotny ,.. ]
32- COMPLETE > S= [] B= [säger, frida, nowotny ,.. ]
33- SHIFT > S= [säger] B= [frida, nowotny, . ,.. ]
34- COMPLETE > S= [] B= [frida, nowotny, . ,.. ]
35- SHIFT > S= [frida] B= [nowotny, . ,.. ]
36- COMPLETE > S= [] B= [nowotny, . ,.. ]
37- SHIFT > S= [nowotny] B= [.]
38- COMPLETE > S= [] B= [.]
39- SHIFT > S= [.] B= [ ]
40- COMPLETE > S= [] B= [ ]
## Sentence No. 141 -
inte bara genom det hårda arbete han visar här , utan också som center i frölundas förstakedja , som har **fått** **i** **gång** maskineriet ordentligt .
### Existing MWEs:
1- **fått i gång** (VPC)Tokens :
fått
i
gång
0- SHIFT > S= [] B= [inte, bara, genom ,.. ]
1- SHIFT > S= [inte] B= [bara, genom, det ,.. ]
2- COMPLETE > S= [] B= [bara, genom, det ,.. ]
3- SHIFT > S= [bara] B= [genom, det, hårda ,.. ]
4- COMPLETE > S= [] B= [genom, det, hårda ,.. ]
5- SHIFT > S= [genom] B= [det, hårda, arbete ,.. ]
6- COMPLETE > S= [] B= [det, hårda, arbete ,.. ]
7- SHIFT > S= [det] B= [hårda, arbete, han ,.. ]
8- COMPLETE > S= [] B= [hårda, arbete, han ,.. ]
9- SHIFT > S= [hårda] B= [arbete, han, visar ,.. ]
10- COMPLETE > S= [] B= [arbete, han, visar ,.. ]
11- SHIFT > S= [arbete] B= [han, visar, här ,.. ]
12- COMPLETE > S= [] B= [han, visar, här ,.. ]
13- SHIFT > S= [han] B= [visar, här, , ,.. ]
14- COMPLETE > S= [] B= [visar, här, , ,.. ]
15- SHIFT > S= [visar] B= [här, ,, utan ,.. ]
16- COMPLETE > S= [] B= [här, ,, utan ,.. ]
17- SHIFT > S= [här] B= [,, utan, också ,.. ]
18- COMPLETE > S= [] B= [,, utan, också ,.. ]
19- SHIFT > S= [,] B= [utan, också, som ,.. ]
20- COMPLETE > S= [] B= [utan, också, som ,.. ]
21- SHIFT > S= [utan] B= [också, som, center ,.. ]
22- COMPLETE > S= [] B= [också, som, center ,.. ]
23- SHIFT > S= [också] B= [som, center, i ,.. ]
24- COMPLETE > S= [] B= [som, center, i ,.. ]
25- SHIFT > S= [som] B= [center, i, frölundas ,.. ]
26- COMPLETE > S= [] B= [center, i, frölundas ,.. ]
27- SHIFT > S= [center] B= [i, frölundas, förstakedja ,.. ]
28- COMPLETE > S= [] B= [i, frölundas, förstakedja ,.. ]
29- SHIFT > S= [i] B= [frölundas, förstakedja, , ,.. ]
30- COMPLETE > S= [] B= [frölundas, förstakedja, , ,.. ]
31- SHIFT > S= [frölundas] B= [förstakedja, ,, som ,.. ]
32- COMPLETE > S= [] B= [förstakedja, ,, som ,.. ]
33- SHIFT > S= [förstakedja] B= [,, som, har ,.. ]
34- COMPLETE > S= [] B= [,, som, har ,.. ]
35- SHIFT > S= [,] B= [som, har, fått ,.. ]
36- COMPLETE > S= [] B= [som, har, fått ,.. ]
37- SHIFT > S= [som] B= [har, fått, i ,.. ]
38- COMPLETE > S= [] B= [har, fått, i ,.. ]
39- SHIFT > S= [har] B= [fått, i, gång ,.. ]
40- COMPLETE > S= [] B= [fått, i, gång ,.. ]
41- SHIFT > S= [fått] B= [i, gång, maskineriet ,.. ]
42- COMPLETE > S= [] B= [i, gång, maskineriet ,.. ]
43- SHIFT > S= [i] B= [gång, maskineriet, ordentligt ,.. ]
44- COMPLETE > S= [] B= [gång, maskineriet, ordentligt ,.. ]
45- SHIFT > S= [gång] B= [maskineriet, ordentligt, . ,.. ]
46- COMPLETE > S= [] B= [maskineriet, ordentligt, . ,.. ]
47- SHIFT > S= [maskineriet] B= [ordentligt, . ,.. ]
48- COMPLETE > S= [] B= [ordentligt, . ,.. ]
49- SHIFT > S= [ordentligt] B= [.]
50- COMPLETE > S= [] B= [.]
51- SHIFT > S= [.] B= [ ]
52- COMPLETE > S= [] B= [ ]
## Sentence No. 144 -
jag är positivt överraskad av hur skönt det faktiskt är , har inte gillat att **röra** **på** **mig** sedan jag spelade fotboll i tonåren .
### Existing MWEs:
1- **röra på mig** (ID)Tokens :
röra
på
mig
0- SHIFT > S= [] B= [jag, är, positivt ,.. ]
1- SHIFT > S= [jag] B= [är, positivt, överraskad ,.. ]
2- COMPLETE > S= [] B= [är, positivt, överraskad ,.. ]
3- SHIFT > S= [är] B= [positivt, överraskad, av ,.. ]
4- COMPLETE > S= [] B= [positivt, överraskad, av ,.. ]
5- SHIFT > S= [positivt] B= [överraskad, av, hur ,.. ]
6- COMPLETE > S= [] B= [överraskad, av, hur ,.. ]
7- SHIFT > S= [överraskad] B= [av, hur, skönt ,.. ]
8- COMPLETE > S= [] B= [av, hur, skönt ,.. ]
9- SHIFT > S= [av] B= [hur, skönt, det ,.. ]
10- COMPLETE > S= [] B= [hur, skönt, det ,.. ]
11- SHIFT > S= [hur] B= [skönt, det, faktiskt ,.. ]
12- COMPLETE > S= [] B= [skönt, det, faktiskt ,.. ]
13- SHIFT > S= [skönt] B= [det, faktiskt, är ,.. ]
14- COMPLETE > S= [] B= [det, faktiskt, är ,.. ]
15- SHIFT > S= [det] B= [faktiskt, är, , ,.. ]
16- COMPLETE > S= [] B= [faktiskt, är, , ,.. ]
17- SHIFT > S= [faktiskt] B= [är, ,, har ,.. ]
18- COMPLETE > S= [] B= [är, ,, har ,.. ]
19- SHIFT > S= [är] B= [,, har, inte ,.. ]
20- COMPLETE > S= [] B= [,, har, inte ,.. ]
21- SHIFT > S= [,] B= [har, inte, gillat ,.. ]
22- COMPLETE > S= [] B= [har, inte, gillat ,.. ]
23- SHIFT > S= [har] B= [inte, gillat, att ,.. ]
24- COMPLETE > S= [] B= [inte, gillat, att ,.. ]
25- SHIFT > S= [inte] B= [gillat, att, röra ,.. ]
26- COMPLETE > S= [] B= [gillat, att, röra ,.. ]
27- SHIFT > S= [gillat] B= [att, röra, på ,.. ]
28- COMPLETE > S= [] B= [att, röra, på ,.. ]
29- SHIFT > S= [att] B= [röra, på, mig ,.. ]
30- COMPLETE > S= [] B= [röra, på, mig ,.. ]
31- SHIFT > S= [röra] B= [på, mig, sedan ,.. ]
32- COMPLETE > S= [] B= [på, mig, sedan ,.. ]
33- SHIFT > S= [på] B= [mig, sedan, jag ,.. ]
34- COMPLETE > S= [] B= [mig, sedan, jag ,.. ]
35- SHIFT > S= [mig] B= [sedan, jag, spelade ,.. ]
36- COMPLETE > S= [] B= [sedan, jag, spelade ,.. ]
37- SHIFT > S= [sedan] B= [jag, spelade, fotboll ,.. ]
38- COMPLETE > S= [] B= [jag, spelade, fotboll ,.. ]
39- SHIFT > S= [jag] B= [spelade, fotboll, i ,.. ]
40- COMPLETE > S= [] B= [spelade, fotboll, i ,.. ]
41- SHIFT > S= [spelade] B= [fotboll, i, tonåren ,.. ]
42- COMPLETE > S= [] B= [fotboll, i, tonåren ,.. ]
43- SHIFT > S= [fotboll] B= [i, tonåren, . ,.. ]
44- COMPLETE > S= [] B= [i, tonåren, . ,.. ]
45- SHIFT > S= [i] B= [tonåren, . ,.. ]
46- COMPLETE > S= [] B= [tonåren, . ,.. ]
47- SHIFT > S= [tonåren] B= [.]
48- COMPLETE > S= [] B= [.]
49- SHIFT > S= [.] B= [ ]
50- COMPLETE > S= [] B= [ ]
## Sentence No. 148 -
det **riktas** ibland **kritik** mot amorteringskrav , som att boendekostnader blir högre och unga köpare drabbas .
### Existing MWEs:
1- **riktas kritik** (LVC)Tokens :
riktas
kritik
0- SHIFT > S= [] B= [det, riktas, ibland ,.. ]
1- SHIFT > S= [det] B= [riktas, ibland, kritik ,.. ]
2- COMPLETE > S= [] B= [riktas, ibland, kritik ,.. ]
3- SHIFT > S= [riktas] B= [ibland, kritik, mot ,.. ]
4- COMPLETE > S= [] B= [ibland, kritik, mot ,.. ]
5- SHIFT > S= [ibland] B= [kritik, mot, amorteringskrav ,.. ]
6- COMPLETE > S= [] B= [kritik, mot, amorteringskrav ,.. ]
7- SHIFT > S= [kritik] B= [mot, amorteringskrav, , ,.. ]
8- COMPLETE > S= [] B= [mot, amorteringskrav, , ,.. ]
9- SHIFT > S= [mot] B= [amorteringskrav, ,, som ,.. ]
10- COMPLETE > S= [] B= [amorteringskrav, ,, som ,.. ]
11- SHIFT > S= [amorteringskrav] B= [,, som, att ,.. ]
12- COMPLETE > S= [] B= [,, som, att ,.. ]
13- SHIFT > S= [,] B= [som, att, boendekostnader ,.. ]
14- COMPLETE > S= [] B= [som, att, boendekostnader ,.. ]
15- SHIFT > S= [som] B= [att, boendekostnader, blir ,.. ]
16- COMPLETE > S= [] B= [att, boendekostnader, blir ,.. ]
17- SHIFT > S= [att] B= [boendekostnader, blir, högre ,.. ]
18- COMPLETE > S= [] B= [boendekostnader, blir, högre ,.. ]
19- SHIFT > S= [boendekostnader] B= [blir, högre, och ,.. ]
20- COMPLETE > S= [] B= [blir, högre, och ,.. ]
21- SHIFT > S= [blir] B= [högre, och, unga ,.. ]
22- COMPLETE > S= [] B= [högre, och, unga ,.. ]
23- SHIFT > S= [högre] B= [och, unga, köpare ,.. ]
24- COMPLETE > S= [] B= [och, unga, köpare ,.. ]
25- SHIFT > S= [och] B= [unga, köpare, drabbas ,.. ]
26- COMPLETE > S= [] B= [unga, köpare, drabbas ,.. ]
27- SHIFT > S= [unga] B= [köpare, drabbas, . ,.. ]
28- COMPLETE > S= [] B= [köpare, drabbas, . ,.. ]
29- SHIFT > S= [köpare] B= [drabbas, . ,.. ]
30- COMPLETE > S= [] B= [drabbas, . ,.. ]
31- SHIFT > S= [drabbas] B= [.]
32- COMPLETE > S= [] B= [.]
33- SHIFT > S= [.] B= [ ]
34- COMPLETE > S= [] B= [ ]
| hazemalsaied/IdenSys | Results/Gold/CV/FirstVersion/SV/4/Parsing.md | Markdown | mit | 21,342 |
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Spincommerce Guía de Estilos">
<meta name="keywords" content="">
<meta name="author" content="Spincommerce">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300,600,400italic' rel='stylesheet' type='text/css'>
<title>
Scaffolding · Spincommerce
</title>
<link rel="stylesheet" href="/spincommerce-style-guide/docs.css">
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" href="/spincommerce-style-guide/img/apple-touch-icon-precomposed.png">
<link rel="icon" href="/spincommerce-style-guide/favicon.ico">
</head>
<body>
<header class="masthead">
<div class="row">
<a href="/spincommerce-style-guide/" class="masthead-logo">
<span class="isotype"></span>
SpinCommerce
</a>
<nav class="masthead-nav">
<a href="/spincommerce-style-guide/scaffolding">Docs</a>
<a href="/spincommerce-style-guide/about">About</a>
<a href="https://github.com/Corpspin/spincommerce-style-guide" target="_blank">GitHub</a>
</nav>
</div>
</header>
<div class="row">
<div class="docs-layout">
<div class="medium-3 column">
<nav class="menu docs-menu">
<a class="menu-item selected" href="/spincommerce-style-guide/scaffolding/">
Scaffolding
</a>
<a class="menu-item " href="/spincommerce-style-guide/layout/">
Layout
</a>
<a class="menu-item " href="/spincommerce-style-guide/type/">
Type
</a>
<a class="menu-item " href="/spincommerce-style-guide/buttons/">
Buttons
</a>
<a class="menu-item " href="/spincommerce-style-guide/icons/">
Icons
</a>
<a class="menu-item " href="/spincommerce-style-guide/utilities/">
Utilities
</a>
<a class="menu-item " href="/spincommerce-style-guide/guidelines/">
Code guidelines
</a>
</nav>
<nav class="menu docs-menu">
<a class="menu-item " href="/spincommerce-style-guide/branding/">
Branding
</a>
<a class="menu-item " href="/spincommerce-style-guide/colors/">
Colors
</a>
<a class="menu-item " href="/spincommerce-style-guide/fonts/">
Fonts
</a>
</nav>
</div>
<div class="medium-9 column markdown-body">
<h1 class="page-title">
Scaffolding
</h1>
<div class="markdown-body">
<p>Scaffolding refers to the global resets and dependencies that SpinCommerce is built upon.</p>
<h2 id="contents">Contents</h2>
<ul id="markdown-toc">
<li><a href="#contents" id="markdown-toc-contents">Contents</a></li>
<li><a href="#html5-doctype" id="markdown-toc-html5-doctype">HTML5 doctype</a></li>
<li><a href="#box-sizing" id="markdown-toc-box-sizing">Box-sizing</a></li>
<li><a href="#built-on-normalize" id="markdown-toc-built-on-normalize">Built on Normalize</a></li>
<li><a href="#based-on-foundation-5" id="markdown-toc-based-on-foundation-5">Based on Foundation 5</a></li>
</ul>
<h2 id="html5-doctype">HTML5 doctype</h2>
<p>SpinCommerce makes use of certain HTML elements and CSS properties that <strong>require</strong> the use of the HTML5 doctype. Include it at the beginning of all your pages.</p>
<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="cp"><!DOCTYPE html></span>
<span class="nt"><html</span> <span class="na">lang=</span><span class="s">"es"</span><span class="nt">></span>
...
<span class="nt"></html></span></code></pre></figure>
<h2 id="box-sizing">Box-sizing</h2>
<p>We reset <code class="highlighter-rouge">box-sizing</code> to <code class="highlighter-rouge">border-box</code> for every element in SpinCommerce. This allows us to more easily assign widths to elements that also have <code class="highlighter-rouge">padding</code> and <code class="highlighter-rouge">border</code>s.</p>
<h2 id="built-on-normalize">Built on Normalize</h2>
<p>For improved cross-browser rendering, we use <a href="http://necolas.github.io/normalize.css/">Normalize.css</a> to correct small inconsistencies across browsers and devices.</p>
<h2 id="based-on-foundation-5">Based on Foundation 5</h2>
<p>SpinCommerce is based on Foundation 5. <a href="http://foundation.zurb.com/sites/docs/v/5.5.3/">Read Docs</a>.</p>
</div>
</div>
</div>
<footer class="footer column small-12">
Copyright SpinCommerce 2016.<br>
Created and maintained by SpinCommerce team. <strong>Currently v0.1.</strong>
</footer>
</div>
<script src="/spincommerce-style-guide/js/anchor.min.js"></script>
<script>
var selector = '.markdown-body h2, .markdown-body h3';
anchors.options = {
placement: 'left',
class: 'anchor-link'
};
anchors.add(selector);
</script>
</body>
</html>
| Corpspin/spincommerce-style-guide | _site/scaffolding/index.html | HTML | mit | 5,003 |
var nums = [];
for (var i = 0; i < 100; ++i) {
nums[i] = Math.floor(Math.random() * 101);
}
insertionsort(nums);
dispArr(nums);
print();
putstr("Enter a value to count: ");
var val = parseInt(readline());
var retVal = count(nums, val);
print("Found " + retVal + " occurrences of " + val + ".");
| jomjose/js-algorithms | queues/queues (15).js | JavaScript | mit | 309 |
/**
* This package provides the necessary classes to slice and compose a file.
*
* @author Sergio Merino
*/
package assembler; | merinhunter/SecureApp | assembler/package-info.java | Java | mit | 131 |
import imageContainer from '../server/api/helpers/imageContainer';
const entries = [
{
html: '<img src="/img/60x30.png" alt="60x30" class="zoom" data-zoom-src="/img/60x30-original.png">',
},
{
html: `<div>
<img src="/img/20x50.jpg">
</div>
<img src="/img/40x10.svg" alt="40x10">`,
},
{
html: '<div>Hello, World!</div>',
},
];
describe('ImageContainer', () => {
const modifiedEntries = imageContainer(entries, __dirname);
it('Parses one image', () => {
expect(modifiedEntries[0].html).toContain('<div class="imageContainer" style="width: 60px;">');
expect(modifiedEntries[0].html).toContain('<div style="padding-bottom: 50%">');
});
it('Parses multiple images', () => {
expect(modifiedEntries[1].html).toContain('<div class="imageContainer" style="width: 20px;">');
expect(modifiedEntries[1].html).toContain('<div style="padding-bottom: 250%">');
expect(modifiedEntries[1].html).toContain('<div class="imageContainer" style="width: 40px;">');
expect(modifiedEntries[1].html).toContain('<div style="padding-bottom: 25%">');
});
it('Doesn’t parse things it shouldn’t', () => {
expect(modifiedEntries[2].html.length).toEqual(entries[2].html.length);
});
it('Doesn’t crash when passing in an empty array', () => {
const emptyEntries = [];
expect(emptyEntries).toEqual(imageContainer(emptyEntries));
});
});
| JohanLi/johanli.com | test/imageContainer.test.js | JavaScript | mit | 1,395 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Unsigned` trait in crate `num`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Unsigned">
<title>num::traits::Unsigned - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<section class="sidebar">
<a href='../../num/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a>
<p class='location'><a href='../index.html'>num</a>::<wbr><a href='index.html'>traits</a></p><script>window.sidebarCurrent = {name: 'Unsigned', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press 'S' to search, '?' for more options..."
type="search">
</div>
</form>
</nav>
<section id='main' class="content trait">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>num</a>::<wbr><a href='index.html'>traits</a>::<wbr><a class='trait' href=''>Unsigned</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-16766' class='srclink' href='../../src/num/traits.rs.html#420' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait Unsigned: <a class='trait' href='../../num/traits/trait.Num.html' title='num::traits::Num'>Num</a> { }</pre><div class='docblock'><p>A trait for values which cannot be negative</p>
</div>
<h2 id='implementors'>Implementors</h2>
<ul class='item-list' id='implementors-list'>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a class='struct' href='../../num/bigint/struct.BigUint.html' title='num::bigint::BigUint'>BigUint</a></code></li>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></li>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a></code></li>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.u16.html'>u16</a></code></li>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a></code></li>
<li><code>impl <a class='trait' href='../../num/traits/trait.Unsigned.html' title='num::traits::Unsigned'>Unsigned</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code></li>
</ul><script type="text/javascript" async
src="../../implementors/num/traits/trait.Unsigned.js">
</script></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div class="shortcuts">
<h1>Keyboard shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>typedef</code> (or
<code>tdef</code>).
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "num";
window.playgroundUrl = "http://play.rust-lang.org/";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script src="../../playpen.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html> | mcanders/bevy | doc/num/traits/trait.Unsigned.html | HTML | mit | 5,593 |
import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setUp(self):
self.latitude = 32.074322
self.longitude = 34.792081
self.radius_meters = 100
self.number_of_vertices = 36
self.polycircle = \
polycircles.Polycircle(latitude=self.latitude,
longitude=self.longitude,
radius=self.radius_meters,
number_of_vertices=self.number_of_vertices)
def test_lat_lon_output(self):
"""Asserts that the vertices in the lat-lon output are in the
right order (lat before long)."""
for vertex in self.polycircle.to_lat_lon():
assert_almost_equal(vertex[0], self.latitude, places=2)
assert_almost_equal(vertex[1], self.longitude, places=2)
def test_lon_lat_output(self):
"""Asserts that the vertices in the lat-lon output are in the
right order (lat before long)."""
for vertex in self.polycircle.to_lon_lat():
assert_almost_equal(vertex[0], self.longitude, places=2)
assert_almost_equal(vertex[1], self.latitude, places=2)
def test_vertices_equals_lat_lon(self):
"""Asserts that the "vertices" property is identical to the return
value of to_lat_lon()."""
assert_equal(self.polycircle.vertices, self.polycircle.to_lat_lon())
def test_kml_equals_lon_lat(self):
"""Asserts that the return value of to_kml() property is identical to
the return value of to_lon_lat()."""
assert_equal(self.polycircle.to_kml(), self.polycircle.to_lon_lat())
if __name__ == '__main__':
unittest.main() | adamatan/polycircles | polycircles/test/test_different_outputs.py | Python | mit | 1,881 |
@CHARSET "UTF-8";
/******* GENERAL RESET *******/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td {
border:0pt none;
font-family:inherit;
font-size: 100%;
font-style:inherit;
font-weight:inherit;
margin:0pt;
padding:0pt;
vertical-align:baseline;
}
body{
background: #fff;
line-height:14px;
font-size: 11px;
font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif;
margin:0pt;
overflow: hidden;
cursor: default !Important;
}
html,body{
height:100%;
}
.clear{
clear: both;
height: 0;
visibility: hidden;
display: block;
}
a{
text-decoration: none;
}
/******* GENERAL RESET *******/
/******* MAIN *******/
#main{
height: 100%;
background: transparent url(images/background.jpg) no-repeat scroll center center;
overflow: none;
}
/******* /MAIN *******/
/******* ICONS *******/
#main div.icon{
min-width: 48px;
min-height: 48px;
padding: 0px 14px 8px;
border: 1px solid transparent;
margin: 0pt auto;
text-align: left;
position: absolute;
display: none;
}
#main div.icon:hover{
background-color: #0a2c5e !Important;
border: 1px solid #3b567e;
}
#main div.icon.active{
background-color: #0a2c5e !Important;
border: 1px solid #3b567e;
}
#main div.icon div.name{
margin-top: 52px;
text-align: center;
color: #fff;
}
#main #mipc{
background: transparent url(images/mipc.png) no-repeat scroll center 4px;
top: 32px;
left: 32px;
}
#main #home{
background: transparent url(images/homeNeXT.png) no-repeat scroll center 4px;
top: 128px;
left: 32px;
}
#main #usb{
background: transparent url(images/usb.png) no-repeat scroll center 4px;
top: 224px;
left: 32px;
}
#main #trash{
background: transparent url(images/trash.png) no-repeat scroll center 4px;
}
/******* /ICONS *******/
/******* TASKBAR *******/
#main #taskbar{
width: 100%;
height: 42px;
line-height: 42px;
background: #e6e6e6 url(images/taskbar.jpg) repeat-x left top;
position: absolute;
left: 0;
bottom: 0px;
padding: 4px 0px 1px 0px;
display: none;
}
#main #taskbar #start{
float: left;
background: transparent url(images/start.png) no-repeat 4px -3px;
width: 64px;
margin: 0 4px 0 0;
padding: 0 2px 0 42px;
font-size: 18px;
font-style: italic;
font-weight: 700;
text-align: center;
}
#main #taskbar #start:hover{
background-color: #fff;
}
#main #taskbar #clock{
float: right;
background: #e6e6e6 url(images/clock.jpg) no-repeat 4px center;
padding: 0 8px 0 50px;
font-size: 12px;
border-left: 2px solid #f9f9f9;
font-weight: 700;
text-align: center;
}
/******* /TASKBAR *******/ | mlaville/cirrus | css/general.css | CSS | mit | 2,784 |
package betterwithaddons.crafting.recipes;
import betterwithaddons.crafting.ICraftingResult;
import betterwithaddons.util.ItemUtil;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class PackingRecipe
{
public ICraftingResult output;
public List<Ingredient> inputs;
public PackingRecipe(List<Ingredient> inputs, ICraftingResult output) {
this.output = output;
this.inputs = inputs;
}
public ICraftingResult getOutput(List<ItemStack> inputs, IBlockState compressState) {
return this.output.copy();
}
public boolean consume(List<ItemStack> inputs, IBlockState compressState, boolean simulate)
{
inputs = new ArrayList<>(inputs);
for (Ingredient ingredient : this.inputs) {
boolean matches = false;
Iterator<ItemStack> iterator = inputs.iterator();
while(iterator.hasNext()) {
ItemStack checkStack = iterator.next();
if(ingredient.apply(checkStack)) {
if(!simulate)
checkStack.shrink(ItemUtil.getSize(ingredient));
iterator.remove();
matches = true;
}
}
if(!matches)
return false;
}
return true;
}
} | DaedalusGame/BetterWithAddons | src/main/java/betterwithaddons/crafting/recipes/PackingRecipe.java | Java | mit | 1,468 |
<?php
namespace Frontend42;
return [
'migration' => [
'directory' => [
__NAMESPACE__ => __DIR__ . '/../../data/migrations'
],
],
];
| raum42/frontend42 | config/cli/migration.config.php | PHP | mit | 174 |
#pragma once
#include "platform.h"
#include "value.h"
#include "vm.h"
#include "result.h"
#include <memory>
#include <vector>
namespace imq
{
class IMQ_API ScriptFunction : public QFunction
{
public:
ScriptFunction(const String& funcName, Context* outerCtx, const std::shared_ptr<VBlock> block, const std::vector<String>& argNames);
virtual ~ScriptFunction();
virtual Result execute(VMachine* vm, int32_t argCount, QValue* args, QValue* result) override;
virtual size_t GC_getSize() const override;
virtual bool GC_isDynamic() const override { return false; }
protected:
virtual void GC_markChildren() override;
private:
ScriptFunction(const ScriptFunction& other) = default;
ScriptFunction& operator=(const ScriptFunction& other) = default;
String funcName;
Context* outerCtx;
std::shared_ptr<VBlock> block;
std::vector<String> argNames;
};
class IMQ_API DefineFunctionExpr : public VExpression
{
public:
DefineFunctionExpr(const String& funcName, VBlock* block, const std::vector<String>& argNames, const VLocation& loc);
DefineFunctionExpr(VBlock* block, const std::vector<String>& argNames, const VLocation& loc);
virtual ~DefineFunctionExpr();
virtual String getName() const override;
virtual Result execute(Context* context, QValue* result) override;
private:
String funcName;
VBlock* initialBlock;
std::shared_ptr<VBlock> block;
std::vector<String> argNames;
};
} | redxdev/imquery | include/imq/scriptfunction.h | C | mit | 1,435 |
#include "cf_internal.h"
#define CACHE_SIZE 1024
#define INDEX(i) ((i) % CACHE_SIZE)
static frame_cache_t* open_real_video_cache(cf_session_t* s)
{
frame_cache_t* cache = calloc(1, sizeof(frame_cache_t));
cache->wait_timer = s->proc->rtt + 2 * s->proc->rtt_val;
cache->state = buffer_waiting;
cache->frame_timer = 100;
cache->size = CACHE_SIZE;
cache->frames = calloc(cache->size, sizeof(cf_frame_t));
return cache;
}
static inline void real_video_clean_frame(cf_session_t* session, frame_cache_t* c, cf_frame_t* frame)
{
int i;
if (frame->seg_number == 0)
return;
for (i = 0; i < frame->seg_number; ++i){
if (frame->segments[i] != NULL){
slab_free(session->mem, frame->segments[i]);
frame->segments[i] = NULL;
}
}
free(frame->segments);
log_debug("buffer clean frame, frame id = %u, ts = %llu\n", frame->fid, frame->ts);
frame->ts = 0;
frame->frame_type = 0;
frame->seg_number = 0;
c->min_fid = frame->fid;
}
static void close_real_video_cache(cf_session_t* s, frame_cache_t* cache)
{
uint32_t i;
for (i = 0; i < cache->size; ++i)
real_video_clean_frame(s, cache, &cache->frames[i]);
free(cache->frames);
free(cache);
}
static void reset_real_video_cache(cf_session_t* s, frame_cache_t* cache)
{
uint32_t i;
for (i = 0; i < cache->size; ++i)
real_video_clean_frame(s, cache, &cache->frames[i]);
cache->min_fid = 0;
cache->max_fid = 0;
cache->play_ts = 0;
cache->frame_ts = 0;
cache->max_ts = 100;
cache->frame_timer = 100;
cache->state = buffer_waiting;
cache->wait_timer = SU_MAX(100, s->proc->rtt + 2 * s->proc->rtt_val);
cache->loss_flag = 0;
}
static void real_video_evict_frame(cf_session_t* s, frame_cache_t* c, uint32_t fid)
{
uint32_t pos, i;
for (pos = c->max_fid + 1; pos <= fid; pos++)
real_video_clean_frame(s, c, &c->frames[INDEX(pos)]);
if (fid < c->min_fid + c->size)
return;
for (pos = c->min_fid + 1; pos < c->max_fid; ++pos){
if (c->frames[INDEX(pos)].frame_type == 1)
break;
}
for (i = c->min_fid + 1; i < pos; ++i)
real_video_clean_frame(s, c, &c->frames[INDEX(i)]);
}
static int real_video_cache_put(cf_session_t* s, frame_cache_t* c, cf_seg_video_t* seg)
{
cf_frame_t* frame;
int ret = -1;
if (seg->index >= seg->total){
assert(0);
return ret;
}
else if (seg->fid <= c->min_fid)
return ret;
if (seg->fid > c->max_fid){
if (c->max_fid > 0)
real_video_evict_frame(s, c, seg->fid);
else if (c->min_fid == 0)
c->min_fid = seg->fid - 1;
if (c->max_fid >= 0 && c->max_fid < seg->fid && c->max_ts < seg->ts){
c->frame_timer = (seg->ts - c->max_ts) / (seg->fid - c->max_fid);
if (c->frame_timer < 20)
c->frame_timer = 20;
else if (c->frame_timer > 200)
c->frame_timer = 200;
}
c->max_ts = seg->ts;
c->max_fid = seg->fid;
}
log_debug("buffer put video frame, frame = %u, seq = %u, ts = %u\n", seg->fid, seg->seq, seg->ts);
frame = &(c->frames[INDEX(seg->fid)]);
frame->fid = seg->fid;
frame->frame_type = seg->ftype;
frame->ts = seg->ts;
if (frame->seg_number == 0){
frame->seg_number = seg->total;
frame->segments = calloc(frame->seg_number, sizeof(seg));
frame->segments[seg->index] = seg;
ret = 0;
}
else{
if (frame->segments[seg->index] == NULL){
frame->segments[seg->index] = seg;
ret = 0;
}
}
return ret;
}
static void real_video_cache_check_playing(cf_session_t* s, frame_cache_t* c)
{
uint64_t max_ts, min_ts;
if (c->max_fid > c->min_fid){
max_ts = c->frames[INDEX(c->max_fid)].ts;
min_ts = c->frames[INDEX(c->min_fid + 1)].ts;
if (min_ts > 0 && max_ts > min_ts + (c->wait_timer * 5 / 4) && c->max_fid >= c->min_fid + 1){
c->state = buffer_playing;
c->play_ts = GET_SYS_MS();
c->frame_ts = max_ts - (c->wait_timer * 5 / 4);
}
}
}
static inline void real_video_cache_check_waiting(cf_session_t* s, frame_cache_t* c)
{
if (c->max_fid <= c->min_fid){
c->state = buffer_waiting;
log_debug("buffer waiting ...........\n");
}
}
static inline int real_video_cache_check_frame_full(cf_session_t* s, cf_frame_t* frame)
{
int i;
for (i = 0; i < frame->seg_number; ++i)
if (frame->segments[i] == NULL)
return -1;
return 0;
}
static inline void real_video_cache_sync_timestamp(cf_session_t* s, frame_cache_t* c)
{
uint64_t cur_ts = GET_SYS_MS();
if (cur_ts > c->play_ts){
c->frame_ts = (uint32_t)(cur_ts - c->play_ts) + c->frame_ts;
c->play_ts = cur_ts;
}
}
static int real_video_cache_get(cf_session_t* s, frame_cache_t* c, uint8_t* data, size_t* sizep)
{
uint32_t pos;
size_t size;
int ret, i;
cf_frame_t* frame;
uint64_t max_ts;
if (c->state == buffer_waiting)
real_video_cache_check_playing(s, c);
else
real_video_cache_check_waiting(s, c);
if (c->state != buffer_playing){
size = 0;
ret = -1;
goto err;
}
real_video_cache_sync_timestamp(s, c);
max_ts = c->frames[INDEX(c->max_fid)].ts;
pos = INDEX(c->min_fid + 1);
frame = &c->frames[pos];
if (frame->ts <= c->frame_ts && real_video_cache_check_frame_full(s, frame) == 0){
size = 0;
for (i = 0; i < frame->seg_number; ++i){
memcpy(data + size, frame->segments[i]->data, frame->segments[i]->data_size);
size += frame->segments[i]->data_size;
}
if (frame->ts + c->wait_timer * 5 / 4 >= max_ts || c->min_fid + 1 == c->max_fid)
c->frame_ts = frame->ts;
else
c->frame_ts = max_ts - c->wait_timer * 5 / 4;
real_video_clean_frame(s, c, frame);
ret = 0;
}
else{
size = 0;
ret = -1;
}
err:
*sizep = size;
return ret;
}
static uint32_t real_video_cache_get_min_seq(cf_session_t* s, frame_cache_t* c)
{
int i;
cf_frame_t* frame;
cf_seg_video_t* seg;
frame = &c->frames[INDEX(c->min_fid)];
for (i = 0; i < frame->seg_number; ++i){
seg = frame->segments[i];
if (seg != NULL)
return seg->seq - seg->index - 1;
}
return 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
uint64_t ts;
int count;
}wb_loss_t;
static inline void loss_free(skiplist_item_t key, skiplist_item_t val)
{
free(val.ptr);
}
cf_video_real_buffer_t* create_video_real_buffer(cf_session_t* s)
{
cf_video_real_buffer_t* r = calloc(1, sizeof(cf_video_real_buffer_t));
r->loss = skiplist_create(id_compare, loss_free);
r->cache = open_real_video_cache(s);
r->cache_ts = GET_SYS_MS();
return r;
}
void destroy_video_real_buffer(cf_session_t* s, cf_video_real_buffer_t* r)
{
if (r == NULL)
return;
assert(r->cache && r->loss);
skiplist_destroy(r->loss);
close_real_video_cache(s, r->cache);
free(r);
}
void reset_video_real_buffer(cf_session_t* s, cf_video_real_buffer_t* r)
{
reset_real_video_cache(s, r->cache);
skiplist_clear(r->loss);
r->base_uid = 0;
r->base_seq = 0;
r->actived = 0;
r->max_seq = 0;
r->ack_ts = GET_SYS_MS();
r->active_ts = r->ack_ts;
r->loss_count = 0;
}
int active_video_real_buffer(cf_session_t* s, cf_video_real_buffer_t* r, uint32_t start_seq, uint16_t rate, uint32_t base_uid)
{
if (r->actived == 1)
return -1;
if (start_seq > 0){
r->base_seq = start_seq;
r->max_seq = r->base_seq;
}
r->actived = 1;
r->base_seq = start_seq;
r->base_uid = base_uid;
if (rate > 0)
r->cache->frame_timer = SU_MAX(20, 1000 / rate);
r->active_ts = GET_SYS_MS();
return 0;
}
static void video_real_buffer_update_loss(cf_session_t* s, cf_video_real_buffer_t* r, uint32_t seq)
{
uint32_t i;
skiplist_item_t key, val;
skiplist_iter_t* iter;
key.u32 = seq;
skiplist_remove(r->loss, key);
for (i = r->max_seq + 1; i < seq; ++i){
key.u32 = i;
iter = skiplist_search(r->loss, key);
if (iter == NULL){
wb_loss_t* l = calloc(1, sizeof(wb_loss_t));
l->ts = GET_SYS_MS() - s->proc->rtt;
l->count = 0;
val.ptr = l;
skiplist_insert(r->loss, key, val);
}
}
}
static inline void video_send_segment(cf_session_t* s, cf_segment_ack_t* ack)
{
cf_header_t header;
CF_INIT_HEADER(header, SEG_ACK, s->rid, s->uid);
cf_encode_msg(&s->sstrm, &header, ack);
processor_send(s, s->proc, &s->sstrm, &s->proc->server_node);
}
static void video_real_ack(cf_session_t* s, cf_video_real_buffer_t* r, int hb)
{
uint64_t cur_ts;
cf_segment_ack_t ack;
skiplist_iter_t* iter;
skiplist_item_t key;
wb_loss_t* l;
uint32_t min_seq, delay;
int max_count = 0;
cur_ts = GET_SYS_MS();
if (r->ack_ts + 10 < cur_ts){
min_seq = real_video_cache_get_min_seq(s, r->cache);
if (min_seq > r->base_seq){
for (key.u32 = r->base_seq + 1; key.u32 <= min_seq; ++key.u32)
skiplist_remove(r->loss, key);
r->base_seq = min_seq;
}
ack.base_uid = r->base_uid;
ack.base = r->base_seq;
ack.loss_num = 0;
SKIPLIST_FOREACH(r->loss, iter){
l = (wb_loss_t*)iter->val.ptr;
if (iter->key.u32 <= r->base_seq)
continue;
if (l->ts + s->proc->rtt + s->proc->rtt_val <= cur_ts && ack.loss_num < LOSS_SISE){
ack.loss[ack.loss_num++] = iter->key.u32;
l->ts = cur_ts;
r->loss_count++;
l->count++;
}
if (l->count > max_count)
max_count = l->count;
}
if (ack.loss_num > 0 || hb == 0)
video_send_segment(s, &ack);
r->ack_ts = cur_ts;
}
/*if (r->active_ts + 10000 < cur_ts)*/{
if (max_count > 1){
delay = (max_count * 16 + 7) * (s->proc->rtt + s->proc->rtt_val) / 16;
if (delay > r->cache->wait_timer)
r->cache->wait_timer = SU_MIN(delay, 5000);
}
else if (skiplist_size(r->loss) > 0)
r->cache->wait_timer = SU_MAX((s->proc->rtt + s->proc->rtt_val * 2), r->cache->wait_timer);
}
r->cache->wait_timer = SU_MAX(r->cache->frame_timer, r->cache->wait_timer);
}
int video_real_video_put(cf_session_t* s, cf_video_real_buffer_t* r, cf_seg_video_t* seg)
{
uint32_t seq;
cf_seg_video_t* tmp;
if (r->max_seq == 0 && seg->ftype == 0)
return -1;
seq = seg->seq;
if (r->actived == 0 || seg->seq <= r->base_seq || (r->max_seq > 0 && seq > r->max_seq + 2000)){
return -1;
}
if (r->max_seq == 0 && seg->seq > seg->index){
r->max_seq = seg->seq - seg->index - 1;
r->base_seq = seg->seq - seg->index - 1;
}
video_real_buffer_update_loss(s, r, seq);
tmp = calloc(1, sizeof(cf_seg_video_t));
*tmp = *seg;
if (real_video_cache_put(s, r->cache, tmp) != 0){
free(tmp);
return -1;
}
if (seq == r->base_seq + 1)
r->base_seq = seq;
r->max_seq = SU_MAX(r->max_seq, seq);
video_real_ack(s, r, 0);
return 0;
}
int video_real_video_get(cf_session_t* s, cf_video_real_buffer_t* r, uint8_t* data, size_t* sizep)
{
if (r->actived == 0)
return -1;
return real_video_cache_get(s, r->cache, data, sizep);
}
void video_real_video_timer(cf_session_t* s, cf_video_real_buffer_t* r)
{
video_real_ack(s, r, 1);
if (r->cache_ts + SU_MAX(s->proc->rtt + s->proc->rtt_val, 1000) < GET_SYS_MS()){
if (r->loss_count == 0)
r->cache->wait_timer = SU_MAX(r->cache->wait_timer * 7 / 8, r->cache->frame_timer);
else if (r->cache->wait_timer > 2 * (s->proc->rtt + s->proc->rtt_val))
r->cache->wait_timer = SU_MAX(r->cache->wait_timer * 15 / 16, r->cache->frame_timer);
r->cache_ts = GET_SYS_MS();
r->loss_count = 0;
}
}
| yuanrongxi/sharing | sharing/buffer/cf_real_video.c | C | mit | 10,971 |
{{ Form::label('title', __('validation.attributes.title'), ['class' => 'label']) }}
<div class="mb-4">
{{ Form::text('title', old('title', $category->title), ['class' => 'input' . ($errors->has('title') ? ' has-error' : ''), 'required' => true]) }}
@if ($errors->has('title'))
<div class="invalid-feedback">
{{ $errors->first('title') }}
</div>
@endif
</div>
@include('shared._form_color', ['item' => $category])
{{ Form::button($submitTitle, ['type' => 'submit', 'class' => 'btn btn-primary']) }}
| Kaishiyoku/Crystal-RSS | resources/views/category/_form.blade.php | PHP | mit | 542 |
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['mocha', 'chai', 'sinon'],
// list of files / patterns to load in the browser
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
| kyleaclark/game-of-life | karma.conf.js | JavaScript | mit | 1,319 |
using System.ComponentModel;
namespace LinqAn.Google.Dimensions
{
/// <summary>
/// DCM creative type name of the DCM click matching the Google Analytics session (premium only).
/// </summary>
[Description("DCM creative type name of the DCM click matching the Google Analytics session (premium only).")]
public class DcmClickCreativeType: Dimension
{
/// <summary>
/// Instantiates a <seealso cref="DcmClickCreativeType" />.
/// </summary>
public DcmClickCreativeType(): base("DFA Creative Type (GA Model)",false,"ga:dcmClickCreativeType")
{
}
}
}
| kenshinthebattosai/LinqAn.Google | src/LinqAn.Google/Dimensions/DcmClickCreativeType.cs | C# | mit | 575 |
#include <QDebug>
#include <QFileDialog>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QProcess>
#include <QWidget>
#include "app.h"
#include "import.h"
#include "ui_import.h"
Import::Import(App* app) :
app(app),
platform(-1) {
this->ui.setupUi(this);
connect(this->ui.toolFilepath, SIGNAL(clicked()), this, SLOT(onFilepathTool()));
connect(this->ui.start, SIGNAL(clicked()), this, SLOT(onStart()));
connect(this->ui.filepath, SIGNAL(textChanged(const QString&)), this, SLOT(onFilepathChange()));
connect(&importProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(onImportFinished()));
}
Import::~Import() {
this->ui.filepath->setText("");
this->ui.start->setEnabled(false);
}
void Import::reset() {
}
void Import::onFilepathTool() {
QFileDialog fileDialog(this);
fileDialog.setOption(QFileDialog::DontUseNativeDialog, true);
connect(&fileDialog, SIGNAL(fileSelected(const QString&)), this, SLOT(onSelectedFilepath(const QString&)));
fileDialog.exec();
}
void Import::onSelectedFilepath(const QString& filepath) {
this->ui.filepath->setText(filepath);
}
void Import::onFilepathChange() {
if (this->ui.filepath->text().length() > 0) {
this->ui.start->setEnabled(true);
} else {
this->ui.start->setEnabled(false);
}
}
void Import::onStart() {
this->ui.start->setEnabled(false);
// close the db to not corrupt it.
this->app->getDb()->close();
QString mehtadataPath = app->mehtadataPath();
if (mehtadataPath.length() == 0) {
QMessageBox::critical(NULL, "Can't find mehtadata", "The import can't be executed because the exe mehtadata is not found.");
return;
}
// start the import
importProcess.setProgram(mehtadataPath);
QStringList arguments;
arguments << "-db" << this->app->getDb()->filename << "-import-es";
QProcessEnvironment env;
env.insert("PLATFORM_ID", QString::number(this->platform));
env.insert("GAMELIST", this->ui.filepath->text()) ;
importProcess.setProcessEnvironment(env);
importProcess.setArguments(arguments);
importProcess.start();
qDebug() << "OK";
qDebug() << arguments;
}
void Import::onImportFinished() {
this->ui.start->setEnabled(true);
this->app->getDb()->open(this->app->getDb()->filename);
this->app->getSelectedPlatform().id = -1;
this->app->onPlatformSelected(this->app->getCurrentItem(), NULL);
this->hide();
}
| remeh/mehstation-config | src/import.cpp | C++ | mit | 2,334 |
import {Component} from '@angular/core';
@Component({
selector: "recomendaciones",
templateUrl: "app/components/htmls/recomendacionesysugerencias/recomendaciones.html",
styleUrls: ["app/components/htmls/htmlStyles.css"]
})
export class RecomendacionesComponent {};
| everitosan/CursoUnamDemencia | app/components/htmls/recomendacionesysugerencias/recomendaciones.component.ts | TypeScript | mit | 273 |
Please take a read at this article so we can help you better, we are always happy to support you at our [chat](https://gitter.im/beto-rodriguez/Live-Charts), normally we respond you really fast.
### Features
We are open to add new features to this library, but before suggesting one, ensure it is not implemented yet, There are a lot of examples showing the already supported features in the library, in the [website](http://lvcharts.net/App/examples/wpf/start) and in [in this repo](https://github.com/beto-rodriguez/Live-Charts/tree/master/Examples).
After you are sure it is not implemented, open a [new issue](https://github.com/beto-rodriguez/Live-Charts/issues/new) that contains:
* What you are trying to do and cannot be solved with the [latest](https://www.nuget.org/packages/LiveCharts/) library version, if you can do it but you think it can be easier, then exaplin so and how.
* Since this is a visual library always adding an image with the expected result is helpful.
### Bugs
A bug should be ascertainable with the [latest](https://www.nuget.org/packages/LiveCharts/) version of the library.
A good way to say thanks for this library is doing good reports, the better you report the faster we can fix it. the next list is ordered by "ease to attend" for the developers of the library, you can choose any of these methods to give us your feedback.
* Create a repository that illustrates the issue, please use as less dependencies as possible.
* If you are not very familiar with git, you could simply send us a mail with an example project that illustrates the issue at [email protected]
* Simply open a [new issue](https://github.com/beto-rodriguez/Live-Charts/issues/new) following the sugested structure.
* Comment it in out [chat](https://gitter.im/beto-rodriguez/Live-Charts).
### Pull Request
Please do suggest whatever you think is necessary to improve, name your PR with a clear name of what you have done, explain a bit about it and you are done, we will review your code and merge it if we think it is appropiated.
Notice that by doing a PR you must respect and agree our [license](https://github.com/beto-rodriguez/Live-Charts/blob/master/LICENSE.TXT).
| rusanov-vladimir/Live-Charts | .github/CONTRIBUTING.md | Markdown | mit | 2,192 |
/**
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
package com.github.anba.es6draft.runtime.types.builtins;
import java.lang.invoke.MethodHandle;
import java.lang.reflect.Method;
import com.github.anba.es6draft.runtime.ExecutionContext;
import com.github.anba.es6draft.runtime.Realm;
import com.github.anba.es6draft.runtime.types.Constructor;
/**
* <h1>9 Ordinary and Exotic Objects Behaviours</h1>
* <ul>
* <li>9.3 Built-in Function Objects
* </ul>
*/
public abstract class BuiltinConstructor extends BuiltinFunction implements Constructor {
private MethodHandle constructMethod;
/**
* Constructs a new built-in constructor function.
*
* @param realm
* the realm object
* @param name
* the function name
* @param arity
* the function arity
*/
protected BuiltinConstructor(Realm realm, String name, int arity) {
super(realm, name, arity);
}
/**
* Returns `(? extends BuiltinConstructor, ExecutionContext, Constructor, Object[]) {@literal ->} ScriptObject`
* method-handle.
*
* @return the call method handle
*/
public MethodHandle getConstructMethod() {
if (constructMethod == null) {
try {
Method method = getClass().getDeclaredMethod("construct", ExecutionContext.class, Constructor.class,
Object[].class);
constructMethod = lookup().unreflect(method);
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
}
return constructMethod;
}
}
| anba/es6draft | src/main/java/com/github/anba/es6draft/runtime/types/builtins/BuiltinConstructor.java | Java | mit | 1,758 |
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This class contains the configuration information for the bundle.
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*
* @author Michael Williams <[email protected]>
*/
class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree.
*
* @return TreeBuilder
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sonata_admin', 'array');
$rootNode
->fixXmlConfig('option')
->fixXmlConfig('admin_service')
->fixXmlConfig('template')
->fixXmlConfig('extension')
->children()
->arrayNode('security')
->addDefaultsIfNotSet()
->fixXmlConfig('admin_permission')
->fixXmlConfig('object_permission')
->children()
->scalarNode('handler')->defaultValue('sonata.admin.security.handler.noop')->end()
->arrayNode('information')
->useAttributeAsKey('id')
->prototype('array')
->performNoDeepMerging()
->beforeNormalization()
->ifString()
->then(function ($v) {
return array($v);
})
->end()
->prototype('scalar')->end()
->end()
->end()
->arrayNode('admin_permissions')
->defaultValue(array('CREATE', 'LIST', 'DELETE', 'UNDELETE', 'EXPORT', 'OPERATOR', 'MASTER'))
->prototype('scalar')->end()
->end()
->arrayNode('object_permissions')
->defaultValue(array('VIEW', 'EDIT', 'DELETE', 'UNDELETE', 'OPERATOR', 'MASTER', 'OWNER'))
->prototype('scalar')->end()
->end()
->scalarNode('acl_user_manager')->defaultNull()->end()
->end()
->end()
->scalarNode('title')->defaultValue('Sonata Admin')->cannotBeEmpty()->end()
->scalarNode('title_logo')->defaultValue('bundles/sonataadmin/logo_title.png')->cannotBeEmpty()->end()
->arrayNode('breadcrumbs')
->addDefaultsIfNotSet()
->children()
->scalarNode('child_admin_route')
->defaultValue('edit')
->info('Change the default route used to generate the link to the parent object, when in a child admin')
->end()
->end()
->end()
->arrayNode('options')
->addDefaultsIfNotSet()
->children()
->booleanNode('html5_validate')->defaultTrue()->end()
->booleanNode('sort_admins')->defaultFalse()->info('Auto order groups and admins by label or id')->end()
->booleanNode('confirm_exit')->defaultTrue()->end()
->booleanNode('use_select2')->defaultTrue()->end()
->booleanNode('use_icheck')->defaultTrue()->end()
->booleanNode('use_bootlint')->defaultFalse()->end()
->booleanNode('use_stickyforms')->defaultTrue()->end()
->integerNode('pager_links')->defaultNull()->end()
->scalarNode('form_type')->defaultValue('standard')->end()
->integerNode('dropdown_number_groups_per_colums')->defaultValue(2)->end()
->enumNode('title_mode')
->values(array('single_text', 'single_image', 'both'))
->defaultValue('both')
->cannotBeEmpty()
->end()
->booleanNode('lock_protection')
->defaultFalse()
->info('Enable locking when editing an object, if the corresponding object manager supports it.')
->end()
->end()
->end()
->arrayNode('dashboard')
->addDefaultsIfNotSet()
->fixXmlConfig('group')
->fixXmlConfig('block')
->children()
->arrayNode('groups')
->useAttributeAsKey('id')
->prototype('array')
->beforeNormalization()
->ifArray()
->then(function ($items) {
if (isset($items['provider'])) {
$disallowedItems = array('items', 'label');
foreach ($disallowedItems as $item) {
if (isset($items[$item])) {
throw new \InvalidArgumentException(sprintf('The config value "%s" cannot be used alongside "provider" config value', $item));
}
}
}
return $items;
})
->end()
->fixXmlConfig('item')
->fixXmlConfig('item_add')
->children()
->scalarNode('label')->end()
->scalarNode('label_catalogue')->end()
->scalarNode('icon')->defaultValue('<i class="fa fa-folder"></i>')->end()
->scalarNode('on_top')->defaultFalse()->info('Show menu item in side dashboard menu without treeview')->end()
->scalarNode('provider')->end()
->arrayNode('items')
->beforeNormalization()
->ifArray()
->then(function ($items) {
foreach ($items as $key => $item) {
if (is_array($item)) {
if (!array_key_exists('label', $item) || !array_key_exists('route', $item)) {
throw new \InvalidArgumentException('Expected either parameters "route" and "label" for array items');
}
if (!array_key_exists('route_params', $item)) {
$items[$key]['route_params'] = array();
}
$items[$key]['admin'] = '';
} else {
$items[$key] = array(
'admin' => $item,
'label' => '',
'route' => '',
'route_params' => array(),
'route_absolute' => true,
);
}
}
return $items;
})
->end()
->prototype('array')
->children()
->scalarNode('admin')->end()
->scalarNode('label')->end()
->scalarNode('route')->end()
->arrayNode('route_params')
->prototype('scalar')->end()
->end()
->booleanNode('route_absolute')
->info('Whether the generated url should be absolute')
->defaultTrue()
->end()
->end()
->end()
->end()
->arrayNode('item_adds')
->prototype('scalar')->end()
->end()
->arrayNode('roles')
->prototype('scalar')->defaultValue(array())->end()
->end()
->end()
->end()
->end()
->arrayNode('blocks')
->defaultValue(array(array(
'position' => 'left',
'settings' => array(),
'type' => 'sonata.admin.block.admin_list',
'roles' => array(),
)))
->prototype('array')
->fixXmlConfig('setting')
->children()
->scalarNode('type')->cannotBeEmpty()->end()
->arrayNode('roles')
->defaultValue(array())
->prototype('scalar')->end()
->end()
->arrayNode('settings')
->useAttributeAsKey('id')
->prototype('variable')->defaultValue(array())->end()
->end()
->scalarNode('position')->defaultValue('right')->end()
->scalarNode('class')->defaultValue('col-md-4')->end()
->end()
->end()
->end()
->end()
->end()
->arrayNode('admin_services')
->prototype('array')
->children()
->scalarNode('model_manager')->defaultNull()->end()
->scalarNode('form_contractor')->defaultNull()->end()
->scalarNode('show_builder')->defaultNull()->end()
->scalarNode('list_builder')->defaultNull()->end()
->scalarNode('datagrid_builder')->defaultNull()->end()
->scalarNode('translator')->defaultNull()->end()
->scalarNode('configuration_pool')->defaultNull()->end()
->scalarNode('route_generator')->defaultNull()->end()
->scalarNode('validator')->defaultNull()->end()
->scalarNode('security_handler')->defaultNull()->end()
->scalarNode('label')->defaultNull()->end()
->scalarNode('menu_factory')->defaultNull()->end()
->scalarNode('route_builder')->defaultNull()->end()
->scalarNode('label_translator_strategy')->defaultNull()->end()
->scalarNode('pager_type')->defaultNull()->end()
->arrayNode('templates')
->addDefaultsIfNotSet()
->children()
->arrayNode('form')
->prototype('scalar')->end()
->end()
->arrayNode('filter')
->prototype('scalar')->end()
->end()
->arrayNode('view')
->useAttributeAsKey('id')
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
->end()
->end()
->arrayNode('templates')
->addDefaultsIfNotSet()
->children()
->scalarNode('user_block')->defaultValue('SonataAdminBundle:Core:user_block.html.twig')->cannotBeEmpty()->end()
->scalarNode('add_block')->defaultValue('SonataAdminBundle:Core:add_block.html.twig')->cannotBeEmpty()->end()
->scalarNode('layout')->defaultValue('SonataAdminBundle::standard_layout.html.twig')->cannotBeEmpty()->end()
->scalarNode('ajax')->defaultValue('SonataAdminBundle::ajax_layout.html.twig')->cannotBeEmpty()->end()
->scalarNode('dashboard')->defaultValue('SonataAdminBundle:Core:dashboard.html.twig')->cannotBeEmpty()->end()
->scalarNode('search')->defaultValue('SonataAdminBundle:Core:search.html.twig')->cannotBeEmpty()->end()
->scalarNode('list')->defaultValue('SonataAdminBundle:CRUD:list.html.twig')->cannotBeEmpty()->end()
->scalarNode('filter')->defaultValue('SonataAdminBundle:Form:filter_admin_fields.html.twig')->cannotBeEmpty()->end()
->scalarNode('show')->defaultValue('SonataAdminBundle:CRUD:show.html.twig')->cannotBeEmpty()->end()
->scalarNode('show_compare')->defaultValue('SonataAdminBundle:CRUD:show_compare.html.twig')->cannotBeEmpty()->end()
->scalarNode('edit')->defaultValue('SonataAdminBundle:CRUD:edit.html.twig')->cannotBeEmpty()->end()
->scalarNode('preview')->defaultValue('SonataAdminBundle:CRUD:preview.html.twig')->cannotBeEmpty()->end()
->scalarNode('history')->defaultValue('SonataAdminBundle:CRUD:history.html.twig')->cannotBeEmpty()->end()
->scalarNode('acl')->defaultValue('SonataAdminBundle:CRUD:acl.html.twig')->cannotBeEmpty()->end()
->scalarNode('history_revision_timestamp')->defaultValue('SonataAdminBundle:CRUD:history_revision_timestamp.html.twig')->cannotBeEmpty()->end()
->scalarNode('action')->defaultValue('SonataAdminBundle:CRUD:action.html.twig')->cannotBeEmpty()->end()
->scalarNode('select')->defaultValue('SonataAdminBundle:CRUD:list__select.html.twig')->cannotBeEmpty()->end()
->scalarNode('list_block')->defaultValue('SonataAdminBundle:Block:block_admin_list.html.twig')->cannotBeEmpty()->end()
->scalarNode('search_result_block')->defaultValue('SonataAdminBundle:Block:block_search_result.html.twig')->cannotBeEmpty()->end()
->scalarNode('short_object_description')->defaultValue('SonataAdminBundle:Helper:short-object-description.html.twig')->cannotBeEmpty()->end()
->scalarNode('delete')->defaultValue('SonataAdminBundle:CRUD:delete.html.twig')->cannotBeEmpty()->end()
->scalarNode('batch')->defaultValue('SonataAdminBundle:CRUD:list__batch.html.twig')->cannotBeEmpty()->end()
->scalarNode('batch_confirmation')->defaultValue('SonataAdminBundle:CRUD:batch_confirmation.html.twig')->cannotBeEmpty()->end()
->scalarNode('inner_list_row')->defaultValue('SonataAdminBundle:CRUD:list_inner_row.html.twig')->cannotBeEmpty()->end()
->scalarNode('outer_list_rows_mosaic')->defaultValue('SonataAdminBundle:CRUD:list_outer_rows_mosaic.html.twig')->cannotBeEmpty()->end()
->scalarNode('outer_list_rows_list')->defaultValue('SonataAdminBundle:CRUD:list_outer_rows_list.html.twig')->cannotBeEmpty()->end()
->scalarNode('outer_list_rows_tree')->defaultValue('SonataAdminBundle:CRUD:list_outer_rows_tree.html.twig')->cannotBeEmpty()->end()
->scalarNode('base_list_field')->defaultValue('SonataAdminBundle:CRUD:base_list_field.html.twig')->cannotBeEmpty()->end()
->scalarNode('pager_links')->defaultValue('SonataAdminBundle:Pager:links.html.twig')->cannotBeEmpty()->end()
->scalarNode('pager_results')->defaultValue('SonataAdminBundle:Pager:results.html.twig')->cannotBeEmpty()->end()
->scalarNode('tab_menu_template')->defaultValue('SonataAdminBundle:Core:tab_menu_template.html.twig')->cannotBeEmpty()->end()
->scalarNode('knp_menu_template')->defaultValue('SonataAdminBundle:Menu:sonata_menu.html.twig')->cannotBeEmpty()->end()
->scalarNode('action_create')->defaultValue('SonataAdminBundle:CRUD:dashboard__action_create.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_acl')->defaultValue('SonataAdminBundle:Button:acl_button.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_create')->defaultValue('SonataAdminBundle:Button:create_button.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_edit')->defaultValue('SonataAdminBundle:Button:edit_button.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_history')->defaultValue('SonataAdminBundle:Button:history_button.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_list')->defaultValue('SonataAdminBundle:Button:list_button.html.twig')->cannotBeEmpty()->end()
->scalarNode('button_show')->defaultValue('SonataAdminBundle:Button:show_button.html.twig')->cannotBeEmpty()->end()
->end()
->end()
->arrayNode('assets')
->addDefaultsIfNotSet()
->children()
->arrayNode('stylesheets')
->defaultValue(array(
'bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css',
'bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css',
'bundles/sonatacore/vendor/ionicons/css/ionicons.min.css',
'bundles/sonataadmin/vendor/admin-lte/dist/css/AdminLTE.min.css',
'bundles/sonataadmin/vendor/admin-lte/dist/css/skins/skin-black.min.css',
'bundles/sonataadmin/vendor/iCheck/skins/square/blue.css',
'bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
'bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css',
'bundles/sonatacore/vendor/select2/select2.css',
'bundles/sonatacore/vendor/select2-bootstrap-css/select2-bootstrap.min.css',
'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css',
'bundles/sonataadmin/css/styles.css',
'bundles/sonataadmin/css/layout.css',
'bundles/sonataadmin/css/tree.css',
))
->prototype('scalar')->end()
->end()
->arrayNode('javascripts')
->defaultValue(array(
'bundles/sonatacore/vendor/jquery/dist/jquery.min.js',
'bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.min.js',
'bundles/sonatacore/vendor/moment/min/moment.min.js',
'bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js',
'bundles/sonataadmin/vendor/jqueryui/ui/minified/i18n/jquery-ui-i18n.min.js',
'bundles/sonatacore/vendor/bootstrap/dist/js/bootstrap.min.js',
'bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'bundles/sonataadmin/vendor/jquery-form/jquery.form.js',
'bundles/sonataadmin/jquery/jquery.confirmExit.js',
'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.min.js',
'bundles/sonatacore/vendor/select2/select2.min.js',
'bundles/sonataadmin/vendor/admin-lte/dist/js/app.min.js',
'bundles/sonataadmin/vendor/iCheck/icheck.min.js',
'bundles/sonataadmin/vendor/slimScroll/jquery.slimscroll.min.js',
'bundles/sonataadmin/vendor/waypoints/lib/jquery.waypoints.min.js',
'bundles/sonataadmin/vendor/waypoints/lib/shortcuts/sticky.min.js',
'bundles/sonataadmin/Admin.js',
'bundles/sonataadmin/treeview.js',
))
->prototype('scalar')->end()
->end()
->end()
->end()
->arrayNode('extensions')
->useAttributeAsKey('id')
->defaultValue(array('admins' => array(), 'excludes' => array(), 'implements' => array(), 'extends' => array(), 'instanceof' => array(), 'uses' => array()))
->prototype('array')
->fixXmlConfig('admin')
->fixXmlConfig('exclude')
->fixXmlConfig('implement')
->fixXmlConfig('extend')
->fixXmlConfig('use')
->children()
->arrayNode('admins')
->prototype('scalar')->end()
->end()
->arrayNode('excludes')
->prototype('scalar')->end()
->end()
->arrayNode('implements')
->prototype('scalar')->end()
->end()
->arrayNode('extends')
->prototype('scalar')->end()
->end()
->arrayNode('instanceof')
->prototype('scalar')->end()
->end()
->arrayNode('uses')
->prototype('scalar')->end()
->validate()
->ifTrue(function ($v) {
return !empty($v) && version_compare(PHP_VERSION, '5.4.0', '<');
})
->thenInvalid('PHP >= 5.4.0 is required to use traits.')
->end()
->end()
->end()
->end()
->end()
->scalarNode('persist_filters')->defaultFalse()->end()
->booleanNode('show_mosaic_button')
->defaultTrue()
->info('Show mosaic button on all admin screens')
->end()
->end()
->end();
return $treeBuilder;
}
}
| amirlionor/admin | vendor/sonata-project/admin-bundle/DependencyInjection/Configuration.php | PHP | mit | 25,648 |
//
// AAAreaspline.h
// AAChartKit
//
// Created by An An on 17/3/15.
// Copyright © 2017年 An An. All rights reserved.
//*************** ...... SOURCE CODE ...... ***************
//***...................................................***
//*** https://github.com/AAChartModel/AAChartKit ***
//*** https://github.com/AAChartModel/AAChartKit-Swift ***
//***...................................................***
//*************** ...... SOURCE CODE ...... ***************
/*
* -------------------------------------------------------------------------------
*
* 🌕 🌖 🌗 🌘 ❀❀❀ WARM TIPS!!! ❀❀❀ 🌑 🌒 🌓 🌔
*
* Please contact me on GitHub,if there are any problems encountered in use.
* GitHub Issues : https://github.com/AAChartModel/AAChartKit/issues
* -------------------------------------------------------------------------------
* And if you want to contribute for this project, please contact me as well
* GitHub : https://github.com/AAChartModel
* StackOverflow : https://stackoverflow.com/users/12302132/codeforu
* JianShu : https://www.jianshu.com/u/f1e6753d4254
* SegmentFault : https://segmentfault.com/u/huanghunbieguan
*
* -------------------------------------------------------------------------------
*/
#import <Foundation/Foundation.h>
@class AADataLabels;
@interface AAAreaspline : NSObject
AAPropStatementAndPropSetFuncStatement(strong, AAAreaspline, AADataLabels *, dataLabels)
@end
| AAChartModel/AAChartKit | AAChartKitLib/AAOptionsModel/AAAreaspline.h | C | mit | 1,490 |
/*
* Reading a variable.
*/
if (typeof print !== 'function') { print = console.log; }
function test() {
function outer() {
var o = 123;
return function inner() {
var i;
var t;
for (i = 0; i < 1e6; i++) {
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o; t = o;
}
};
}
var f = outer();
f();
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}
| svaarala/duktape | tests/perf/test-var-read-outerscope-closed.js | JavaScript | mit | 1,264 |
# frozen_string_literal: true
require "cases/helper"
require "models/user"
require "models/visitor"
class SecurePasswordTest < ActiveModel::TestCase
setup do
# Used only to speed up tests
@original_min_cost = ActiveModel::SecurePassword.min_cost
ActiveModel::SecurePassword.min_cost = true
@user = User.new
@visitor = Visitor.new
# Simulate loading an existing user from the DB
@existing_user = User.new
@existing_user.password_digest = BCrypt::Password.create("password", cost: BCrypt::Engine::MIN_COST)
end
teardown do
ActiveModel::SecurePassword.min_cost = @original_min_cost
end
test "automatically include ActiveModel::Validations when validations are enabled" do
assert_respond_to @user, :valid?
end
test "don't include ActiveModel::Validations when validations are disabled" do
assert_not_respond_to @visitor, :valid?
end
test "create a new user with validations and valid password/confirmation" do
@user.password = "password"
@user.password_confirmation = "password"
assert @user.valid?(:create), "user should be valid"
@user.password = "a" * 72
@user.password_confirmation = "a" * 72
assert @user.valid?(:create), "user should be valid"
end
test "create a new user with validation and a spaces only password" do
@user.password = " " * 72
assert @user.valid?(:create), "user should be valid"
end
test "create a new user with validation and a blank password" do
@user.password = ""
assert [email protected]?(:create), "user should be invalid"
assert_equal 1, @user.errors.count
assert_equal ["can't be blank"], @user.errors[:password]
end
test "create a new user with validation and a nil password" do
@user.password = nil
assert [email protected]?(:create), "user should be invalid"
assert_equal 1, @user.errors.count
assert_equal ["can't be blank"], @user.errors[:password]
end
test "create a new user with validation and password length greater than 72" do
@user.password = "a" * 73
@user.password_confirmation = "a" * 73
assert [email protected]?(:create), "user should be invalid"
assert_equal 1, @user.errors.count
assert_equal ["is too long (maximum is 72 characters)"], @user.errors[:password]
end
test "create a new user with validation and a blank password confirmation" do
@user.password = "password"
@user.password_confirmation = ""
assert [email protected]?(:create), "user should be invalid"
assert_equal 1, @user.errors.count
assert_equal ["doesn't match Password"], @user.errors[:password_confirmation]
end
test "create a new user with validation and a nil password confirmation" do
@user.password = "password"
@user.password_confirmation = nil
assert @user.valid?(:create), "user should be valid"
end
test "create a new user with validation and an incorrect password confirmation" do
@user.password = "password"
@user.password_confirmation = "something else"
assert [email protected]?(:create), "user should be invalid"
assert_equal 1, @user.errors.count
assert_equal ["doesn't match Password"], @user.errors[:password_confirmation]
end
test "update an existing user with validation and no change in password" do
assert @existing_user.valid?(:update), "user should be valid"
end
test "update an existing user with validations and valid password/confirmation" do
@existing_user.password = "password"
@existing_user.password_confirmation = "password"
assert @existing_user.valid?(:update), "user should be valid"
@existing_user.password = "a" * 72
@existing_user.password_confirmation = "a" * 72
assert @existing_user.valid?(:update), "user should be valid"
end
test "updating an existing user with validation and a blank password" do
@existing_user.password = ""
assert @existing_user.valid?(:update), "user should be valid"
end
test "updating an existing user with validation and a spaces only password" do
@user.password = " " * 72
assert @user.valid?(:update), "user should be valid"
end
test "updating an existing user with validation and a blank password and password_confirmation" do
@existing_user.password = ""
@existing_user.password_confirmation = ""
assert @existing_user.valid?(:update), "user should be valid"
end
test "updating an existing user with validation and a nil password" do
@existing_user.password = nil
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["can't be blank"], @existing_user.errors[:password]
end
test "updating an existing user with validation and password length greater than 72" do
@existing_user.password = "a" * 73
@existing_user.password_confirmation = "a" * 73
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["is too long (maximum is 72 characters)"], @existing_user.errors[:password]
end
test "updating an existing user with validation and a blank password confirmation" do
@existing_user.password = "password"
@existing_user.password_confirmation = ""
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["doesn't match Password"], @existing_user.errors[:password_confirmation]
end
test "updating an existing user with validation and a nil password confirmation" do
@existing_user.password = "password"
@existing_user.password_confirmation = nil
assert @existing_user.valid?(:update), "user should be valid"
end
test "updating an existing user with validation and an incorrect password confirmation" do
@existing_user.password = "password"
@existing_user.password_confirmation = "something else"
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["doesn't match Password"], @existing_user.errors[:password_confirmation]
end
test "updating an existing user with validation and a blank password digest" do
@existing_user.password_digest = ""
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["can't be blank"], @existing_user.errors[:password]
end
test "updating an existing user with validation and a nil password digest" do
@existing_user.password_digest = nil
assert !@existing_user.valid?(:update), "user should be invalid"
assert_equal 1, @existing_user.errors.count
assert_equal ["can't be blank"], @existing_user.errors[:password]
end
test "setting a blank password should not change an existing password" do
@existing_user.password = ""
assert @existing_user.password_digest == "password"
end
test "setting a nil password should clear an existing password" do
@existing_user.password = nil
assert_nil @existing_user.password_digest
end
test "authenticate" do
@user.password = "secret"
assert_not @user.authenticate("wrong")
assert @user.authenticate("secret")
end
test "Password digest cost defaults to bcrypt default cost when min_cost is false" do
ActiveModel::SecurePassword.min_cost = false
@user.password = "secret"
assert_equal BCrypt::Engine::DEFAULT_COST, @user.password_digest.cost
end
test "Password digest cost honors bcrypt cost attribute when min_cost is false" do
begin
original_bcrypt_cost = BCrypt::Engine.cost
ActiveModel::SecurePassword.min_cost = false
BCrypt::Engine.cost = 5
@user.password = "secret"
assert_equal BCrypt::Engine.cost, @user.password_digest.cost
ensure
BCrypt::Engine.cost = original_bcrypt_cost
end
end
test "Password digest cost can be set to bcrypt min cost to speed up tests" do
ActiveModel::SecurePassword.min_cost = true
@user.password = "secret"
assert_equal BCrypt::Engine::MIN_COST, @user.password_digest.cost
end
end
| pvalena/rails | activemodel/test/cases/secure_password_test.rb | Ruby | mit | 8,096 |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstring>
#include "../include/globals.hpp"
#include "../include/classes.hpp"
#include "../include/functions.hpp"
struct cell{
double xStart;
double yStart;
double zStart;
};
int main(int argc, char** argv)
{
int a;
int run=0;
gsl_rng_set(r,98);
gsl_histogram_set_ranges_uniform(gas_in,-1,5);
gsl_histogram_set_ranges_uniform(gas_out,-1,5);
gsl_histogram_set_ranges_uniform(gas_real_in,-1,5);
Particle *cube = new Particle[N];
std::list<Particle*> gas;
std::list<Particle*> gasHistory;
double* rCM = new double[3];
double* rCMtemp = new double[3];
double* vCM = new double[3];
double energy = 0;
InitPositions(cube);
calcCM(cube,rCMStart,vCM);
calcCM(cube,rCM,vCM);
InitVelocities(cube);
ComputeAccelerations(cube);
/*
*for(run=0;run<10000;run++)
*{
* if(run%500==0)
* printf("(INIT) Zeitschritt %d\n",run);
* VelocityVerlet(cube,0,NULL);
* if(run%100 == 0)
* rescaleVelocities(cube);
* if(run%100 == 0)
* GenerateOutput(cube,gas,run);
*}
*/
gsl_histogram *cells = gsl_histogram_alloc(100);
gsl_histogram_set_ranges_uniform(cells,0,50);
double lcx = floor(L/rCutOff);
double rcx = L/lcx;
double c = 0;
double ci[3] = {0,0,0};
for(int i=0;i<N;i++)
{
for(int k=0;k<3;k++)
ci[k] = floor(cube[i].r[k]/rcx);
c = ci[0]*lcx*lcx+ci[1]*lcx+ci[2];
std::cout << c << std::endl;
gsl_histogram_increment(cells,c);
}
FILE* celldata = fopen("cell_list_test.dat","w");
gsl_histogram_fprintf(celldata,cells,"%f","%f");
fclose(celldata);
return 0;
}
| homeslike/OpticalTweezer | test/cell_list.cpp | C++ | mit | 1,878 |
<?php
namespace Sigcotweb\AplicativoBundle\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('aplicativo');
// 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;
}
}
| ovelasquez/sigcot | src/Sigcotweb/AplicativoBundle/DependencyInjection/Configuration.php | PHP | mit | 885 |
using System;
using System.Collections.Generic;
using System.Text;
using _03BarracksFactory.Contracts;
namespace P03_BarraksWars.Core.Commands
{
class RetireCommand : Command
{
public RetireCommand(string[] data, IRepository repository, IUnitFactory unitFactory)
: base(data, repository, unitFactory)
{
}
public override string Execute()
{
try
{
this.Repository.RemoveUnit(this.Data[1]);
return $"{this.Data[1]} retured!";
}
catch (InvalidOperationException ex)
{
return ex.Message;
}
}
}
}
| CvetelinLozanov/SoftUni-C- | C# OOP Advanced/Reflection_And_Attributes-Exercise/P03_BarraksWars/P03_BarraksWars/Core/Commands/RetireCommand.cs | C# | mit | 700 |
/*
* Globalize Culture id
*
* http://github.com/jquery/globalize
*
* Copyright Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* This file was generated by the Globalize Culture Generator
* Translation: bugs found in this file need to be fixed in the generator * Portions (c) Corporate Web Solutions Ltd.
*/
(function( window, undefined ) {
var Globalize;
if ( typeof require !== "undefined" &&
typeof exports !== "undefined" &&
typeof module !== "undefined" ) {
// Assume CommonJS
Globalize = require( "globalize" );
} else {
// Global variable
Globalize = window.Globalize;
}
Globalize.addCultureInfo( "id", "default", {
name: "id",
englishName: "Indonesian",
nativeName: "Bahasa Indonesia",
language: "id",
numberFormat: {
",": ".",
".": ",",
percent: {
",": ".",
".": ","
},
currency: {
decimals: 0,
",": ".",
".": ",",
symbol: "Rp"
}
},
calendars: {
standard: {
firstDay: 1,
days: {
names: ["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],
namesAbbr: ["Minggu","Sen","Sel","Rabu","Kamis","Jumat","Sabtu"],
namesShort: ["M","S","S","R","K","J","S"]
},
months: {
names: ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","Nopember","Desember",""],
namesAbbr: ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agust","Sep","Okt","Nop","Des",""]
},
AM: null,
PM: null,
patterns: {
d: "dd/MM/yyyy",
D: "dd MMMM yyyy",
t: "H:mm",
T: "H:mm:ss",
f: "dd MMMM yyyy H:mm",
F: "dd MMMM yyyy H:mm:ss",
M: "dd MMMM",
Y: "MMMM yyyy"
}
}
}
});
}( this ));
| bevacqua/jscharting | bundle/JSC/cultures/globalize.culture.id.js | JavaScript | mit | 1,780 |
package de.codecentric.awesome.recommendation.core;
import java.util.HashMap;
import java.util.Map;
/**
* Created by afitz on 15.03.16.
*/
public class RecommendationLookup {
private static RecommendationLookup ourInstance = new RecommendationLookup();
private String standardProductRecommendation = "P999";
// Map<User, Product>
private final Map<String, String> recommendationMap = new HashMap<String, String>();
public static RecommendationLookup getInstance() {
return ourInstance;
}
private RecommendationLookup() {
recommendationMap.put("P00T", "P001");
recommendationMap.put("P001", "P002");
recommendationMap.put("P002", "P003");
recommendationMap.put("P003", "P003");
}
public Product getRecommendation (Product product) {
return new Product((recommendationMap.containsKey(product.getId()) ? recommendationMap.get(product.getId()) : standardProductRecommendation));
}
}
| cc-afitz/awesome-services | recommendation/src/main/java/de/codecentric/awesome/recommendation/core/RecommendationLookup.java | Java | mit | 979 |
import omit from 'lodash/omit';
import get from 'lodash/get';
import isFunction from 'lodash/isFunction';
import { bunyanLevelToRollbarLevelName } from '../common/rollbar';
// Rollbar script exposes this global immediately, whether or not its already initialized
export const isGlobalRollbarConfigured = () => !!get(global, 'Rollbar');
/**
* Custom rollbar stream that transports to logentries from a browser
* Wortks with a global Rollbar instance that is already initialized.
* Note this expects rollbar to be loaded in the head, not via an npm module.
* See https://rollbar.com/docs/notifier/rollbar.js/#quick-start for details on
* integrating Rollbar in client apps
*
* @param {String} options.token
* @param {String} options.environment
* @param {String} options.codeVersion
*/
export default function ClientRollbarLogger({ token, environment, codeVersion }) {
// Rollbar may already be initialized, but thats ok
// https://rollbar.com/docs/notifier/rollbar.js/configuration/
global.Rollbar.configure({
accessToken: token,
environment,
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment,
javascript: {
code_version: codeVersion,
source_map_enabled: true,
},
},
});
}
/**
* Transport logs to Rollbar
* @param {Object} data
* @returns {undefined}
*/
ClientRollbarLogger.prototype.write = function (data = {}) {
const rollbarLevelName = bunyanLevelToRollbarLevelName(data.level);
const scopeData = omit(data, ['err', 'level']);
const payload = Object.assign({ level: rollbarLevelName }, scopeData);
// https://rollbar.com/docs/notifier/rollbar.js/#rollbarlog
const logFn = global.Rollbar[rollbarLevelName];
if (isFunction(logFn)) {
logFn.call(global.Rollbar, data.msg, data.err, payload);
} else {
global.Rollbar.error(data.msg, data.err, payload);
}
};
| wework/we-js-logger | src/util/client/rollbarLogger.js | JavaScript | mit | 1,896 |
# coding: utf-8
""" General utilities. """
from __future__ import division, print_function
__author__ = "adrn <[email protected]>"
# Standard library
import collections
import sys
import logging
import multiprocessing
# Third-party
import numpy as np
__all__ = ['get_pool']
# Create logger
logger = logging.getLogger(__name__)
class SerialPool(object):
def close(self):
return
def map(self, *args, **kwargs):
return map(*args, **kwargs)
def get_pool(mpi=False, threads=None):
""" Get a pool object to pass to emcee for parallel processing.
If mpi is False and threads is None, pool is None.
Parameters
----------
mpi : bool
Use MPI or not. If specified, ignores the threads kwarg.
threads : int (optional)
If mpi is False and threads is specified, use a Python
multiprocessing pool with the specified number of threads.
"""
if mpi:
from emcee.utils import MPIPool
# Initialize the MPI pool
pool = MPIPool()
# Make sure the thread we're running on is the master
if not pool.is_master():
pool.wait()
sys.exit(0)
logger.debug("Running with MPI...")
elif threads > 1:
logger.debug("Running with multiprocessing on {} cores..."
.format(threads))
pool = multiprocessing.Pool(threads)
else:
logger.debug("Running serial...")
pool = SerialPool()
return pool
def gram_schmidt(y):
""" Modified Gram-Schmidt orthonormalization of the matrix y(n,n) """
n = y.shape[0]
if y.shape[1] != n:
raise ValueError("Invalid shape: {}".format(y.shape))
mo = np.zeros(n)
# Main loop
for i in range(n):
# Remove component in direction i
for j in range(i):
esc = np.sum(y[j]*y[i])
y[i] -= y[j]*esc
# Normalization
mo[i] = np.linalg.norm(y[i])
y[i] /= mo[i]
return mo
class use_backend(object):
def __init__(self, backend):
import matplotlib.pyplot as plt
from IPython.core.interactiveshell import InteractiveShell
from IPython.core.pylabtools import backend2gui
self.shell = InteractiveShell.instance()
self.old_backend = backend2gui[str(plt.get_backend())]
self.new_backend = backend
def __enter__(self):
gui, backend = self.shell.enable_matplotlib(self.new_backend)
def __exit__(self, type, value, tb):
gui, backend = self.shell.enable_matplotlib(self.old_backend)
def inherit_docs(cls):
for name, func in vars(cls).items():
if not func.__doc__:
for parent in cls.__bases__:
try:
parfunc = getattr(parent, name)
except AttributeError: # parent doesn't have function
break
if parfunc and getattr(parfunc, '__doc__', None):
func.__doc__ = parfunc.__doc__
break
return cls
class ImmutableDict(collections.Mapping):
def __init__(self, somedict):
self._dict = dict(somedict) # make a copy
self._hash = None
def __getitem__(self, key):
return self._dict[key]
def __len__(self):
return len(self._dict)
def __iter__(self):
return iter(self._dict)
def __hash__(self):
if self._hash is None:
self._hash = hash(frozenset(self._dict.items()))
return self._hash
def __eq__(self, other):
return self._dict == other._dict
| abonaca/gary | gary/util.py | Python | mit | 3,607 |
{% extends 'layout.server.view.html' %}
{% block content %}
<div ui-view></div>
{% endblock %}
| hackathon-uva/team-2 | app/views/index.server.view.html | HTML | mit | 97 |
##  PdfRasterizer Plugin for Xamarin and Windows
Simple cross platform plugin that renders PDF files to images for easier integration.
### Setup
* Available on NuGet: http://www.nuget.org/packages/Xam.Plugin.PdfRasterizer [](https://www.nuget.org/packages/Xam.Plugin.PdfRasterizer/)
* Install into your PCL project and Client projects.
**Platform Support**
|Platform|Supported|Version|
| ------------------- | :-----------: | :------------------: |
|Xamarin.iOS|Yes|iOS 6+|
|Xamarin.iOS Unified|Yes|iOS 6+|
|Xamarin.Android|Yes|API 21+|
|Windows Store RT|Yes|8.1+|
|Windows 10 UWP|Yes|10+|
|Windows Phone Silverlight|No||
|Windows Phone RT|No||
|Xamarin.Mac|No||
### API Usage
Call **CrossPdfRasterizer.Current** from any project or PCL to gain access to APIs.
A `.pdf` document rasterization will render all of its pages as `.png` images in the local storage of the application (by default in the `/.pdf/` subfolder). Local and distant document can be prodvided. If the provided document path starts with `http://` or `https://`, the document will be downloaded first in the local temporary folder of the application.
#### Example
```csharp
try
{
const string documentUrl = "https://developer.xamarin.com/guides/xamarin-forms/getting-started/introduction-to-xamarin-forms/offline.pdf";
const bool forceRasterize = false;
var rasterizer = CrossPdfRasterizer.Current;
var document = await rasterizer.Rasterize(documentUrl,forceRasterize);
var pageImages = document.Pages.Select((p) => p.Path);
}
catch(Exception ex)
{
Debug.WriteLine("Unable to rasterize provided document: " + ex);
}
```
#### API
```csharp
/// <summary>
/// The directory where all the rasterized PDF's sub-directories containing page images are created (default: "/.pdf/").
/// </summary>
string RasterizationCacheDirectory { get; set; }
```
```csharp
/// <summary>
/// Renders a local PDF file as a set of page images into the local storage.
/// </summary>
/// <param name="pdfPath">The relative path to the PDF file in local storage, or a distant url. If a distant Url is provided, the document will be downloaded first in the temporary folder of the application.</param>
/// <param name="cachePirority">Indicates whether the already rasterized version should be taken, or images must be forced to be rasterized again.</param>
/// <returns>A document containing all the pages with their paths.</returns>
Task<PdfDocument> Rasterize(string pdfPath, bool cachePirority = true);
```
```csharp
/// <summary>
/// Gets the locally rendered document if it has already been rasterized, else it returns null.
/// </summary>
/// <param name="pdfPath"></param>
/// <returns></returns>
Task<PdfDocument> GetRasterized(string pdfPath);
```
#### Q&A
> Why is the rasterizer only available for Android version prior to Lollipop ?
Because the `PdfRenderer` was introduced only in this version. I didn't found any free solution to have the same result of older versions of Android. If you have a solution don't hesitate to contact me !
### Roadmap / Ideas
* Adding custoization for generation location.
* Adding more document meta-data (with maybe the original document available too)
* Adding PDF drawing generation functionality (*iOS and Android only*)
* Creating a Xamarin.Forms SimplePdfViewer
### Contributors
* [aloisdeniel](https://github.com/aloisdeniel)
Thanks!
### License
Licensed under main repo license | aloisdeniel/Xamarin.Plugins | PdfRasterizer/README.md | Markdown | mit | 3,511 |
#include <pthread.h>
#include <assert.h>
int g = 17; // matches expected precise read
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
pthread_mutex_lock(&B);
pthread_mutex_lock(&C);
g = 42;
pthread_mutex_unlock(&B);
g = 17;
pthread_mutex_unlock(&C);
return NULL;
}
int main(void) {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
pthread_mutex_lock(&A);
pthread_mutex_lock(&B);
pthread_mutex_lock(&C);
assert(g == 17);
pthread_mutex_unlock(&A);
pthread_mutex_unlock(&B);
pthread_mutex_unlock(&C);
return 0;
}
| goblint/analyzer | tests/regression/13-privatized/42-traces-ex-mini.c | C | mit | 671 |
import EmberObject from '@ember/object';
import { htmlSafe } from '@ember/string';
import RSVP from 'rsvp';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import {
render,
settled,
find,
click
} from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
const { resolve } = RSVP;
module('Integration | Component | school session types list', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
assert.expect(19);
let assessmentOption = EmberObject.create({
id: 1,
name: 'formative'
});
let sessionType1 = EmberObject.create({
id: 1,
school: 1,
title: 'not needed anymore',
assessment: false,
assessmentOption: resolve(null),
safeCalendarColor: htmlSafe('#ffffff'),
sessionCount: 2,
active: false,
});
let sessionType2 = EmberObject.create({
id: 2,
school: 1,
title: 'second',
assessment: true,
assessmentOption: resolve(assessmentOption),
safeCalendarColor: htmlSafe('#123456'),
sessionCount: 0,
active: true,
});
let sessionType3 = EmberObject.create({
id: 2,
school: 1,
title: 'first',
assessment: false,
assessmentOption: resolve(null),
safeCalendarColor: htmlSafe('#cccccc'),
sessionCount: 2,
active: true,
});
this.set('sessionTypes', [sessionType1, sessionType2, sessionType3]);
this.set('nothing', parseInt);
await render(hbs`{{school-session-types-list
sessionTypes=sessionTypes
manageSessionType=(action nothing)
}}`);
const rows = 'table tbody tr';
const firstSessionType = `${rows}:nth-of-type(1)`;
const firstTitle = `${firstSessionType} td:nth-of-type(1)`;
const firstSessionCount = `${firstSessionType} td:nth-of-type(2)`;
const firstAssessment = `${firstSessionType} td:nth-of-type(3) svg`;
const firstAssessmentOption = `${firstSessionType} td:nth-of-type(4)`;
const firstColorBox = `${firstSessionType} td:nth-of-type(6) .box`;
const secondSessionType = `${rows}:nth-of-type(2)`;
const secondTitle = `${secondSessionType} td:nth-of-type(1)`;
const secondSessionCount = `${secondSessionType} td:nth-of-type(2)`;
const secondAssessment = `${secondSessionType} td:nth-of-type(3) svg`;
const secondAssessmentOption = `${secondSessionType} td:nth-of-type(4)`;
const secondColorBox = `${secondSessionType} td:nth-of-type(6) .box`;
const thirdSessionType = `${rows}:nth-of-type(3)`;
const thirdTitle = `${thirdSessionType} td:nth-of-type(1)`;
const thirdSessionCount = `${thirdSessionType} td:nth-of-type(2)`;
const thirdAssessment = `${thirdSessionType} td:nth-of-type(3) svg`;
const thirdAssessmentOption = `${thirdSessionType} td:nth-of-type(4)`;
const thirdColorBox = `${thirdSessionType} td:nth-of-type(6) .box`;
assert.dom(firstTitle).hasText('first');
assert.dom(firstSessionCount).hasText('2');
assert.dom(firstAssessment).hasClass('no');
assert.dom(firstAssessment).hasClass('fa-ban');
assert.dom(firstAssessmentOption).hasText('');
assert.equal(find(firstColorBox).style.getPropertyValue('background-color').trim(), ('rgb(204, 204, 204)'));
assert.dom(secondTitle).hasText('second');
assert.dom(secondSessionCount).hasText('0');
assert.dom(secondAssessment).hasClass('yes');
assert.dom(secondAssessment).hasClass('fa-check');
assert.dom(secondAssessmentOption).hasText('formative');
assert.equal(find(secondColorBox).style.getPropertyValue('background-color').trim(), ('rgb(18, 52, 86)'));
assert.ok(find(thirdTitle).textContent.trim().startsWith('not needed anymore'));
assert.ok(find(thirdTitle).textContent.trim().endsWith('(inactive)'));
assert.dom(thirdSessionCount).hasText('2');
assert.dom(thirdAssessment).hasClass('no');
assert.dom(thirdAssessment).hasClass('fa-ban');
assert.dom(thirdAssessmentOption).hasText('');
assert.equal(find(thirdColorBox).style.getPropertyValue('background-color').trim(), ('rgb(255, 255, 255)'));
});
test('clicking edit fires action', async function(assert) {
assert.expect(1);
let sessionType = EmberObject.create({
id: 1,
school: 1,
title: 'first',
assessment: false,
assessmentOption: resolve(null),
calendarColor: '#fff'
});
this.set('sessionTypes', [sessionType]);
this.set('manageSessionType', sessionTypeId => {
assert.equal(sessionTypeId, 1);
});
await render(hbs`{{school-session-types-list
sessionTypes=sessionTypes
manageSessionType=(action manageSessionType)
}}`);
await settled();
const rows = 'table tbody tr';
const edit = `${rows}:nth-of-type(1) td:nth-of-type(7) .fa-edit`;
await click(edit);
});
test('clicking title fires action', async function(assert) {
assert.expect(1);
let sessionType = EmberObject.create({
id: 1,
school: 1,
title: 'first',
assessment: false,
assessmentOption: resolve(null),
calendarColor: '#fff'
});
this.set('sessionTypes', [sessionType]);
this.set('manageSessionType', sessionTypeId => {
assert.equal(sessionTypeId, 1);
});
await render(hbs`{{school-session-types-list
sessionTypes=sessionTypes
manageSessionType=(action manageSessionType)
}}`);
await settled();
const rows = 'table tbody tr';
const title = `${rows}:nth-of-type(1) td:nth-of-type(1) a`;
await click(title);
});
test('session types without sessions can be deleted', async function(assert) {
assert.expect(4);
let unlinkedSessionType = EmberObject.create({
id: 1,
school: 1,
title: 'unlinked',
active: true,
assessment: false,
assessmentOption: resolve(null),
calendarColor: '#fff',
sessionCount: 0,
deleteRecord(){
assert.ok(true, 'was deleted');
return resolve();
}
});
let linkedSessionType = EmberObject.create({
id: 1,
school: 1,
title: 'linked',
active: true,
assessment: false,
assessmentOption: resolve(null),
calendarColor: '#fff',
sessionCount: 5,
deleteRecord(){
assert.ok(true, 'was deleted');
return resolve();
}
});
this.set('sessionTypes', [linkedSessionType, unlinkedSessionType]);
this.set('nothing', parseInt);
await render(hbs`{{school-session-types-list
sessionTypes=sessionTypes
manageSessionType=(action nothing)
canDelete=true
}}`);
await settled();
const rows = 'table tbody tr';
const linkedTitle = `${rows}:nth-of-type(1) td:nth-of-type(1)`;
const unlinkedTitle = `${rows}:nth-of-type(2) td:nth-of-type(1)`;
const linkedTrash = `${rows}:nth-of-type(1) td:nth-of-type(7) .fa-trash.disabled`;
const unlinkedTrash = `${rows}:nth-of-type(2) td:nth-of-type(7) .fa-trash.enabled`;
assert.dom(linkedTitle).hasText('linked', 'linked is first');
assert.dom(unlinkedTitle).hasText('unlinked', 'unlinked is second');
assert.dom(linkedTrash).exists({ count: 1 }, 'linked has a disabled trash can');
assert.dom(unlinkedTrash).exists({ count: 1 }, 'unlinked has an enabled trash can');
});
test('clicking delete deletes the record', async function(assert) {
assert.expect(2);
let sessionType = EmberObject.create({
id: 1,
school: 1,
title: 'first',
assessment: false,
assessmentOption: resolve(null),
calendarColor: '#fff',
sessionCount: 0,
deleteRecord(){
assert.ok(true, 'was deleted');
},
save(){
assert.ok(true, 'was deleted');
return resolve();
},
});
this.set('sessionTypes', [sessionType]);
this.set('nothing', parseInt);
await render(hbs`{{school-session-types-list
sessionTypes=sessionTypes
manageSessionType=(action nothing)
canDelete=true
}}`);
await settled();
const rows = 'table tbody tr';
const trash = `${rows}:nth-of-type(1) td:nth-of-type(7) .fa-trash`;
await click(trash);
await settled();
});
});
| djvoa12/frontend | tests/integration/components/school-session-types-list-test.js | JavaScript | mit | 8,230 |
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Dependinator.Common.ModelMetadataFolders;
using Dependinator.Common.ModelMetadataFolders.Private;
using Dependinator.Common.SettingsHandling;
using Dependinator.Utils;
using Dependinator.Utils.Dependencies;
using Dependinator.Utils.ErrorHandling;
using Dependinator.Utils.Net;
using Dependinator.Utils.OsSystem;
using Dependinator.Utils.Serialization;
using Dependinator.Utils.Threading;
using Microsoft.Win32;
namespace Dependinator.Common.Installation.Private
{
[SingleInstance]
internal class LatestVersionService : ILatestVersionService
{
private static readonly TimeSpan IdleTimerInterval = TimeSpan.FromMinutes(1);
private static readonly TimeSpan IdleTimeBeforeRestarting = TimeSpan.FromMinutes(10);
private static readonly string latestUri =
"https://api.github.com/repos/michael-reichenauer/Dependinator/releases/latest";
private static readonly string UserAgent = "Dependinator";
private readonly ModelMetadata modelMetadata;
private readonly ISettingsService settingsService;
private readonly IStartInstanceService startInstanceService;
private DispatcherTimer idleTimer;
private DateTime lastIdleCheck = DateTime.MaxValue;
public LatestVersionService(
IStartInstanceService startInstanceService,
ISettingsService settingsService,
ModelMetadata modelMetadata)
{
this.startInstanceService = startInstanceService;
this.settingsService = settingsService;
this.modelMetadata = modelMetadata;
}
public event EventHandler OnNewVersionAvailable;
public void StartCheckForLatestVersion()
{
idleTimer = new DispatcherTimer();
idleTimer.Tick += CheckIdleBeforeRestart;
idleTimer.Interval = IdleTimerInterval;
idleTimer.Start();
SystemEvents.PowerModeChanged += OnPowerModeChange;
}
public async Task CheckLatestVersionAsync()
{
if (settingsService.Get<Options>().DisableAutoUpdate)
{
return;
}
if (await IsNewRemoteVersionAvailableAsync())
{
await DownloadLatestVersionAsync();
await IsNewRemoteVersionAvailableAsync();
}
}
private async Task<bool> IsNewRemoteVersionAvailableAsync()
{
Version remoteVersion = await GetLatestRemoteVersionAsync();
Version currentVersion = Version.Parse(ProgramInfo.Version);
Version installedVersion = ProgramInfo.GetInstalledVersion();
Version setupVersion = ProgramInfo.GetSetupVersion();
LogVersion(currentVersion, installedVersion, remoteVersion, setupVersion);
return installedVersion < remoteVersion && setupVersion < remoteVersion;
}
private async Task<bool> DownloadLatestVersionAsync()
{
try
{
Log.Info($"Downloading remote setup {latestUri} ...");
LatestInfo latestInfo = GetCachedLatestVersionInfo();
if (latestInfo == null)
{
// No installed version.
return false;
}
using (HttpClientDownloadWithProgress httpClient = GetDownloadHttpClient())
{
await DownloadSetupAsync(httpClient, latestInfo);
return true;
}
}
catch (Exception e) when (e.IsNotFatal())
{
Log.Error($"Failed to install new version {e}");
}
return false;
}
private static async Task<string> DownloadSetupAsync(
HttpClientDownloadWithProgress httpClient, LatestInfo latestInfo)
{
Asset setupFileInfo = latestInfo.assets.First(a => a.name == $"{ProgramInfo.Name}Setup.exe");
string downloadUrl = setupFileInfo.browser_download_url;
Log.Info($"Downloading {latestInfo.tag_name} from {downloadUrl} ...");
Timing t = Timing.Start();
httpClient.ProgressChanged += (totalFileSize, totalBytesDownloaded, progressPercentage) =>
{
Log.Info($"Downloading {latestInfo.tag_name} {progressPercentage}% (time: {t.Elapsed}) ...");
};
string setupPath = ProgramInfo.GetSetupFilePath();
if (File.Exists(setupPath))
{
File.Delete(setupPath);
}
await httpClient.StartDownloadAsync(downloadUrl, setupPath);
Log.Info($"Downloaded {latestInfo.tag_name} to {setupPath}");
return setupPath;
}
private async Task<Version> GetLatestRemoteVersionAsync()
{
try
{
M<LatestInfo> latestInfo = await GetLatestInfoAsync();
if (latestInfo.IsOk && latestInfo.Value.tag_name != null)
{
Version version = Version.Parse(latestInfo.Value.tag_name.Substring(1));
return version;
}
}
catch (Exception e) when (e.IsNotFatal())
{
Log.Warn($"Failed to get latest version {e}");
}
return new Version(0, 0, 0, 0);
}
private async Task<M<LatestInfo>> GetLatestInfoAsync()
{
try
{
using (HttpClient httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("user-agent", UserAgent);
// Try get cached information about latest remote version
string eTag = GetCachedLatestVersionInfoEtag();
if (!string.IsNullOrEmpty(eTag))
{
// There is cached information, lets use the ETag when checking to follow
// GitHub Rate Limiting method.
httpClient.DefaultRequestHeaders.IfNoneMatch.Clear();
httpClient.DefaultRequestHeaders.IfNoneMatch.Add(new EntityTagHeaderValue(eTag));
}
HttpResponseMessage response = await httpClient.GetAsync(latestUri);
if (response.StatusCode == HttpStatusCode.NotModified || response.Content == null)
{
return GetCachedLatestVersionInfo();
}
string latestInfoText = await response.Content.ReadAsStringAsync();
Log.Debug("New version info");
if (response.Headers.ETag != null)
{
eTag = response.Headers.ETag.Tag;
CacheLatestVersionInfo(eTag, latestInfoText);
}
return Json.As<LatestInfo>(latestInfoText);
}
}
catch (Exception e) when (e.IsNotFatal())
{
Log.Exception(e, "Failed to download latest setup");
return Error.From(e);
}
}
private LatestInfo GetCachedLatestVersionInfo()
{
ProgramSettings programSettings = settingsService.Get<ProgramSettings>();
return Json.As<LatestInfo>(programSettings.LatestVersionInfo);
}
private string GetCachedLatestVersionInfoEtag()
{
ProgramSettings programSettings = settingsService.Get<ProgramSettings>();
return programSettings.LatestVersionInfoETag;
}
private void CacheLatestVersionInfo(string eTag, string latestInfoText)
{
if (string.IsNullOrEmpty(eTag)) return;
// Cache the latest version info
settingsService.Edit<ProgramSettings>(s =>
{
s.LatestVersionInfoETag = eTag;
s.LatestVersionInfo = latestInfoText;
});
}
private static void LogVersion(Version current, Version installed, Version remote, Version setup)
{
Log.Usage(
$"Version current: {current}, installed: {installed}, remote: {remote}, setup {setup}");
}
private void NotifyIfNewVersionIsAvailable()
{
if (IsNewVersionInstalled())
{
OnNewVersionAvailable?.Invoke(this, EventArgs.Empty);
}
}
private void OnPowerModeChange(object sender, PowerModeChangedEventArgs e)
{
Log.Info($"Power mode {e.Mode}");
if (e.Mode == PowerModes.Resume)
{
if (IsNewVersionInstalled())
{
Log.Info("Newer version is installed, restart ...");
if (startInstanceService.StartInstance(modelMetadata.ModelFilePath))
{
// Newer version is started, close this instance
Application.Current.Shutdown(0);
}
}
}
}
private void CheckIdleBeforeRestart(object sender, EventArgs e)
{
TimeSpan timeSinceCheck = DateTime.UtcNow - lastIdleCheck;
bool wasSleeping = false;
if (timeSinceCheck > IdleTimerInterval + TimeSpan.FromMinutes(1))
{
// The timer did not tick within the expected timeout, thus computer was probably sleeping.
Log.Info($"Idle timer timeout, was: {timeSinceCheck}");
wasSleeping = true;
}
lastIdleCheck = DateTime.UtcNow;
TimeSpan idleTime = SystemIdle.GetLastInputIdleTimeSpan();
if (wasSleeping || idleTime > IdleTimeBeforeRestarting)
{
if (IsNewVersionInstalled())
{
if (startInstanceService.StartInstance(modelMetadata.ModelFilePath))
{
// Newer version is started, close this instance
Application.Current.Shutdown(0);
}
}
}
}
private static bool IsNewVersionInstalled()
{
Version currentVersion = Version.Parse(ProgramInfo.Version);
Version installedVersion = ProgramInfo.GetInstalledVersion();
Log.Debug($"Current version: {currentVersion} installed version: {installedVersion}");
return currentVersion < installedVersion;
}
private static HttpClientDownloadWithProgress GetDownloadHttpClient()
{
HttpClientDownloadWithProgress client = new HttpClientDownloadWithProgress();
client.NetworkActivityTimeout = TimeSpan.FromSeconds(30);
client.HttpClient.Timeout = TimeSpan.FromSeconds(60 * 5);
client.HttpClient.DefaultRequestHeaders.Add("user-agent", UserAgent);
return client;
}
// Type used when parsing latest version information json
public class LatestInfo
{
public Asset[] assets;
public string tag_name;
}
// Type used when parsing latest version information json
internal class Asset
{
public string browser_download_url;
public int download_count;
public string name;
}
}
}
| michael-reichenauer/Dependinator | Dependinator/Common/Installation/Private/LatestVersionService.cs | C# | mit | 11,771 |
var mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');
// define the schema for our user model
var authUserSchema = mongoose.Schema({
unique_ID : String,
username : String,
password : String,
role : String,
first_name : String,
last_name : String
});
// methods ======================
// generating a hash
authUserSchema.methods.generateHash = function(password) {
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};
// checking if password is valid
authUserSchema.methods.validPassword = function(password) {
return bcrypt.compareSync(password, this.password);
};
// create the model for users and expose it to our app
module.exports = mongoose.model('authUser', authUserSchema);
| ishwant/Auth-Server | app/models/authUser.js | JavaScript | mit | 791 |
<?php
namespace fm\KitBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class KitBundle extends Bundle
{
}
| davidpestana/erp.fm | src/fm/KitBundle/KitBundle.php | PHP | mit | 116 |
from notifications_utils.clients.antivirus.antivirus_client import (
AntivirusClient,
)
from notifications_utils.clients.redis.redis_client import RedisClient
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
antivirus_client = AntivirusClient()
zendesk_client = ZendeskClient()
redis_client = RedisClient()
| alphagov/notifications-admin | app/extensions.py | Python | mit | 340 |
/**
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var Lib = require('../../lib');
// The contour extraction is great, except it totally fails for constraints because we
// need weird range loops and flipped contours instead of the usual format. This function
// does some weird manipulation of the extracted pathinfo data such that it magically
// draws contours correctly *as* constraints.
module.exports = function(pathinfo, operation) {
var i, pi0, pi1;
var op0 = function(arr) { return arr.reverse(); };
var op1 = function(arr) { return arr; };
switch(operation) {
case '][':
case ')[':
case '](':
case ')(':
var tmp = op0;
op0 = op1;
op1 = tmp;
// It's a nice rule, except this definitely *is* what's intended here.
/* eslint-disable: no-fallthrough */
case '[]':
case '[)':
case '(]':
case '()':
/* eslint-enable: no-fallthrough */
if(pathinfo.length !== 2) {
Lib.warn('Contour data invalid for the specified inequality range operation.');
return;
}
// In this case there should be exactly two contour levels in pathinfo. We
// simply concatenate the info into one pathinfo and flip all of the data
// in one. This will draw the contour as closed.
pi0 = pathinfo[0];
pi1 = pathinfo[1];
for(i = 0; i < pi0.edgepaths.length; i++) {
pi0.edgepaths[i] = op0(pi0.edgepaths[i]);
}
for(i = 0; i < pi0.paths.length; i++) {
pi0.paths[i] = op0(pi0.paths[i]);
}
while(pi1.edgepaths.length) {
pi0.edgepaths.push(op1(pi1.edgepaths.shift()));
}
while(pi1.paths.length) {
pi0.paths.push(op1(pi1.paths.shift()));
}
pathinfo.pop();
break;
case '>=':
case '>':
if(pathinfo.length !== 1) {
Lib.warn('Contour data invalid for the specified inequality operation.');
return;
}
// In this case there should be exactly two contour levels in pathinfo. We
// simply concatenate the info into one pathinfo and flip all of the data
// in one. This will draw the contour as closed.
pi0 = pathinfo[0];
for(i = 0; i < pi0.edgepaths.length; i++) {
pi0.edgepaths[i] = op0(pi0.edgepaths[i]);
}
for(i = 0; i < pi0.paths.length; i++) {
pi0.paths[i] = op0(pi0.paths[i]);
}
break;
}
};
| iongroup/plotly.js | src/traces/contourcarpet/convert_to_constraints.js | JavaScript | mit | 2,890 |
module.exports = {
defersToPromises : function(defers) {
if(Array.isArray(defers)) {
return defers.map(function(defer) {
return defer && defer.promise ?
defer.promise :
defer;
});
}
var res = {};
Object.keys(defers).forEach(function(key) {
res[key] = defers[key] && defers[key].promise ?
defers[key].promise :
defer;
});
return res;
}
}; | stenin-nikita/module-promise | test/utils/helpers.js | JavaScript | mit | 518 |
export default (sequelize, DataTypes) => {
const Product = sequelize.define('Product', {
name: DataTypes.STRING,
description: DataTypes.TEXT,
price: DataTypes.FLOAT,
releasedate: DataTypes.DATE
}, {
classMethods: {
associate: models => {
Product.belongsToMany(models.Cart, {through: 'ProductCart'});
Product.belongsToMany(models.Platform, {through: 'ProductPlatform'});
Product.belongsTo(models.SpecialEdition);
}
}
});
return Product;
};
| Kennyomg/gamersonline-uni | api/models/product.js | JavaScript | mit | 508 |
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>lora imoti</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/modern-business.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/pgwslideshow.css" rel="stylesheet">
<link href="css/pgwslideshow.min.css" rel="stylesheet">
<link href="css/pgwslideshow_light.css" rel="stylesheet">
<link href="css/pgwslideshow_light.min.css" rel="stylesheet">
<!-- 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Lora imoti</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="team.html">Team</a>
</li>
<li>
<a href="services.html">Services</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Portfolio <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="portfolio-1-col.html">1 Column Portfolio</a>
</li>
<li>
<a href="portfolio-2-col.html">2 Column Portfolio</a>
</li>
<li>
<a href="portfolio-3-col.html">3 Column Portfolio</a>
</li>
<li>
<a href="portfolio-4-col.html">4 Column Portfolio</a>
</li>
</ul>
</li>
<li>
<a href="search.php">Search</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Top <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="naem.html">Naem</a>
</li>
<li>
<a href="prodava.html">Prodava</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Naem <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="ednostaen.html">Ednostaen</a>
</li>
<li>
<a href="dvustaen.html">Dvustaen</a>
</li>
<li>
<a href="tristaen.html">Tristaen</a>
</li>
<li>
<a href="mnogostaen.html">Mnogostaen</a>
</li>
<li>
<a href="mezonet.html">Mezonet</a>
</li>
<li>
<a href="Ofis.html">Ofis</a>
</li>
<li>
<a href="magazin.html">Magazin</a>
</li>
<li>
<a href="zavedenie.html">Zavedenie</a>
</li>
<li>
<a href="kashta.html">Kashta</a>
</li>
<li>
<a href="sklad.html">Sklad</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Prodava <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="1_Ednostaen.html">Ednostaen</a>
</li>
<li>
<a href="2_Dvustaen.html">Dvustaen</a>
</li>
<li>
<a href="3_Tristaen.html">Tristaen</a>
</li>
<li>
<a href="4_Mnogostaen.html">Mnogostaen</a>
</li>
<li>
<a href="5_Mezonet.html">Mezonet</a>
</li>
<li>
<a href="6_Ofis.html">Ofis</a>
</li>
<li>
<a href="7_Magazin.html">Magazin</a>
</li>
<li>
<a href="8_Zavedenie.html">Zavedenie</a>
</li>
<li>
<a href="9_Kashta.html">Kashta</a>
</li>
<li>
<a href="10_Sklad.html">Sklad</a>
</li>
</ul>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Naem dvustaen apartament
</h1>
</div>
<div class="row">
<div class="col-md-4">
<a href="dvustaen-vraska-1.html">
<img class="img-responsive img-hover" src="img/hol.jpg" alt="">
</a>
<h3>
<a href="dvustaenn-vraska-1.html">Centar</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
<div class="col-md-4">
<a href="dvustaen-vraska-2.html">
<img class="img-responsive img-hover" src="img/holluk.jpg" alt="">
</a>
<h3>
<a href="dvustaen-vraska-2.html">Malchika</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
<div class="col-md-4">
<a href="dvustaen-vraska-3.html">
<img class="img-responsive img-hover" src="img/kuhnq.jpg" alt="">
</a>
<h3>
<a href="dvustaen-vraska-3.html">Gagarin</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
</div>
<!-- /.row -->
<!-- Projects Row -->
<div class="row">
<div class="col-md-4">
<a href="dvustaen-vraska-4.html">
<img class="img-responsive img-hover" src="img/doc.jpg" alt="">
</a>
<h3>
<a href="dvustaen-vrask-4.html">Belomorski</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
<div class="col-md-4">
<a href="dvustaen-vraska-5.html">
<img class="img-responsive img-hover" src="img/ofice.jpg" alt="">
</a>
<h3>
<a href="dvustaen-vraska-5.html">Marasha</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
<div class="col-md-4">
<a href="dvustaen-vraska-6.html">
<img class="img-responsive img-hover" src="img/docum.jpg" alt="">
</a>
<h3>
<a href="dvustaen-vraska-6.html">Centar</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae.</p>
</div>
</div>
</div>
<!-- Pagination -->
<div class="row text-center">
<div class="col-lg-12">
<ul class="pagination">
<li>
<a href="#">«</a>
</li>
<li class="active">
<a href="#">1</a>
</li>
<li>
<a href="#">2</a>
</li>
<li>
<a href="#">3</a>
</li>
<li>
<a href="#">4</a>
</li>
<li>
<a href="#">5</a>
</li>
<li>
<a href="#">»</a>
</li>
</ul>
</div>
</div>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
| setaagopqn/sait | Dvustaen.html | HTML | mit | 12,872 |
<?php
namespace Glucose\Exceptions\User;
class PrimaryKeyCollisionException extends \Glucose\Exceptions\Entity\DuplicateEntityException {
} | andsens/Glucose | Glucose/Exceptions/User/PrimaryKeyCollisionException.class.php | PHP | mit | 141 |
Arktrail
========
You are the captain of a futuristic interstellar ark that quite honestly, left space-dock months too early.
Will you patch up your ship and survive the long journey between worlds to finish the space gate you are tasked to build, or will your ship succumb to the perils of interstellar space?
#####
Current version uses LibGDX 1.3.1 and Artemis-odb 1.7.1<br/>
Originally coded in 48 hours for Ludum Dare 30!
##### License
The MIT License (MIT)
##### Links
*Play it here:*
http://www.mostlyoriginal.net/play-arktrail/
*Coding Timelapse:*
http://youtu.be/A6wYyjA10tA
*More of my games:*
http://www.mostlyoriginal.net/
| DaanVanYperen/arktrail | README.md | Markdown | mit | 645 |
require "tenant/engine"
module Tenant
end
| cshirley/tenant_engine | lib/tenant.rb | Ruby | mit | 43 |
import { SET_SORT_ORDER } from '../constants/actions';
export default function (state = 'ASCENDING', action) {
switch (action.type) {
case SET_SORT_ORDER:
return action.order;
default:
return state;
}
}
| ColdForge/icebox | src/reducers/sortOrderReducer.js | JavaScript | mit | 212 |
<app-header></app-header>
<app-slider></app-slider>
<<div class="container text-center">
<h1 id="title">Delicious Recipes</h1>
<p>Angular</p>
<h4>The Tranquil Gazelles</h4>
<img [src]="gazelles" class="img-circle" alt="Us">
<p>We have created a fictional food SPA.</p>
</div>
<div class="latest-recipes row eq-height">
<h3 class="col-sm-12" id="enjoy">Enjoy Our Recipes</h3>
<div *ngFor="let recipe of allRecipes; let i=index" class="col-sm-12 col-md-3 eq-height" (click)="redirectToDetails(recipe?.key)">
<div *ngIf="i<8" class="recipe-container"> <!-- shows only 8 recipes -->
<img src="{{recipe.img}}" alt="recipe image">
<p><strong>{{recipe.title}}</strong></p>
</div>
</div>
</div>
<app-footer></app-footer> | Camyul/Angular2Project | src/app/home/home.component.html | HTML | mit | 774 |
import mongoose from 'mongoose';
const ModelPortfolioSchema = new mongoose.Schema({
id: String,
name: String,
displayName: String,
email: String,
securities: [{
symbol: String,
allocation: {type: Number, min: 0, max: 100},
}]
});
ModelPortfolioSchema.add({
subGroups: [ModelPortfolioSchema],
modelPortfolios: [ModelPortfolioSchema],
});
export default mongoose.model('ModelPortfolio', ModelPortfolioSchema);
| AlexisDeschamps/portfolio-rebalancer | server/db/mongo/models/modelPortfolio.js | JavaScript | mit | 430 |
import React, { Component } from 'react';
class Home extends Component {
render () {
return (
<div>
<h1>Home</h1>
<p>Bienvenidos!!!</p>
<pre>{`
{
path: '/',
pathExact: true,
component: Home
},
{
path: '/pageOne',
pathExact: true,
component: PageOne
},
{
path: '/pageTwo',
pathExact: true,
component: PageTwo
},
{
path: '/pageThree',
pathExact: true,
auth: true,
component: PageThree,
routes: [
// PAGE 3/ADD
{
path: '/pageThree/add',
pathExact: true,
auth: true,
component: PageThreeAdd
},
// PAGE 4
{
path: '/pageFour/:id/:action',
auth: true,
component: PageFour
}
]
},
// 404 NOT FOUND
{
component: NotFound
}
`}
</pre>
</div>
);
}
}
export default Home;
| gabriel-lopez-lopez/dynamic-react-route | dynamic-react-router demo/src/Components/Home/index.js | JavaScript | mit | 1,789 |
---
author: Joanna Rothkopf
lang: en
title: 'The sharing economy is a lie: Uber, Ayn Rand and the truth about tech and libertarians'
---
Horror stories about the increasingly unpopular taxi service Uber have been commonplace in recent months, but there is still much to be learned from its handling of the recent hostage drama in downtown Sydney, Australia. We’re told that we reveal our true character in moments of crisis, and apparently that’s as true for companies as it is for individuals.
A number of experts have challenged the idea that the horrific explosion of violence in a Sydney café was “terrorism,” since the attacker was mentally unbalanced and acted alone. But, terror or not, the ordeal was certainly terrifying. Amid the chaos and uncertainty, the city believed itself to be under a coordinated and deadly attack.
Uber had an interesting, if predictable, response to the panic and mayhem: It raised prices. A lot.
In case you missed the story, the facts are these: Someone named Man Haron Monis, who was considered mentally unstable and had been investigated for murdering his ex-wife, seized hostages in a café that was located in Sydney’s Central Business District or “CBD.” In the process he put up an Islamic flag – “igniting,” as [Reuters] reported, “fears of a jihadist attack in the heart of the country’s biggest city.”
In the midst of the fear, Uber stepped in and tweeted this announcement: “We are all concerned with events in CBD. Fares have increased to encourage more drivers to come online & pick up passengers in the area.”
As [Mashable] reports, the company announced that it would charge a minimum of \$100 Australian to take passengers from the area immediately surrounding the ongoing crisis, and prices increased by as much as four times the standard amount. A firestorm of criticism quickly erupted – “[@Uber\_Sydney] stop being assholes,” one Twitter response began – and Uber soon found itself offering free rides out of the troubled area instead.
That opener suggests that Uber, as part of a community under siege, is preparing to respond in a civic manner.
*“… Fares have increased to encourage more drivers to come online & pick up passengers in the area.”*
But, despite the expression of shared concern, there is no sense of *civitas* to be found in the statement that follows. There is only a transaction, executed at what the corporation believes to be market value. Lesson \#1 about Uber is, therefore, that in its view there is no heroism, only self-interest. This is Ayn Rand’s brutal, irrational and primitive philosophy in its purest form: altruism is evil, and self-interest is the only true heroism.
There was once a time when we might have read of “hero cabdrivers” or “hero bus drivers” placing themselves in harm’s way to rescue their fellow citizens. For its part, Uber might have suggested that it would use its network of drivers and its scheduling software to recruit volunteer drivers for a rescue mission.
Instead, we are told that Uber’s pricing surge *was* its expression of concern. Uber’s way to address a human crisis is apparently by letting the market govern human behavior, as if there were (in libertarian economist Tyler Cowen’s phrase) “markets in everything” – including the lives of a city’s beleaguered citizens (and its Uber drivers).
Where would this kind of market-driven practice leave poor or middle-income citizens in a time of crisis? If they can’t afford the “surged” price, apparently it would leave them squarely in the line of fire. And come to think of it, why would Uber drivers value their lives so cheaply, unless they’re underpaid?
One of the lessons of Sydney is this: Uber’s philosophy, whether consciously expressed or not, is that life belongs to the highest bidder – and therefore, by implication, the highest bidder’s life has the greatest value. Society, on the other hand, may choose to believe that every life has equal value – or that lifesaving services should be available at affordable prices.
If nothing else, the Sydney experience should prove once and for all that there is no such thing as “the sharing economy.” Uber is a taxi company, albeit an under-regulated one, and nothing more. It’s certainly not a “ride sharing” service, where someone who happens to be going in the same direction is willing to take along an extra passenger and split gas costs. A ride-sharing service wouldn’t find itself “increasing fares to encourage more drivers” to come into Sydney’s terrorized Central Business District.
A “sharing economy,” by definition, is lateral in structure. It is a peer-to-peer economy. But Uber, as its name suggests, is hierarchical in structure. It monitors and controls its drivers, demanding that they purchase services from it while guiding their movements and determining their level of earnings. And its pricing mechanisms impose unpredictable costs on its customers, extracting greater amounts whenever the data suggests customers can be compelled to pay them.
This is a top-down economy, not a “shared” one.
A number of Uber’s fans and supporters defended the company on the grounds that its “surge prices,” including those seen during the Sydney crisis, are determined by an algorithm. But an algorithm can be an ideological statement, and is always a cultural artifact. As human creations, algorithms reflect their creators.
Uber’s tweet during the Sydney crisis made it sound as if human intervention, rather than algorithmic processes, caused prices to soar that day. But it doesn’t really matter if that surge was manually or algorithmically driven. Either way the prices were Uber’s doing – and its moral choice.
Uber has been strenuously defending its surge pricing in the wake of accusations (apparently [justified]) that the company enjoyed windfall profits during Hurricane Sandy. It has now promised the state of New York that it will cap its surge prices (at three times the highest rate on two non-emergency days). But if Uber has its way, it will soon enjoy a monopolistic stranglehold on car service rates in most major markets. And it has demonstrated its willingness to ignore rules and regulations. That means predictable and affordable taxi fares could become a thing of the past.
In practice, surge pricing could become a new, privatized form of taxation on middle-class taxi customers.
Even without surge pricing, Uber and its supporters are hiding its full costs. When middle-class workers are underpaid or deprived of benefits and full working rights, as Uber’s [reportedly are], the entire middle-class economy suffers. Overall wages and benefits are suppressed for the majority, while the wealthy few are made even richer. The invisible costs of ventures like Uber are extracted over time, far surpassing whatever short-term savings they may occasionally offer.
Like Walmart, Uber underpays its employees – many of its drivers *are* employees, in everything but name – and then drains the social safety net to make up the difference. While Uber preaches libertarianism, it practices a form of corporate welfare. It’s reportedly [celebrating Obamacare], for example, since the Affordable Care Act allows it to avoid providing health insurance to its workforce. But the ACA’s subsidies, together with Uber’s often woefully insufficient wages, mean that the rest of us are paying its tab instead. And the lack of income security among Uber’s drivers creates another social cost for Americans – in lost tax revenue, and possibly in increased use of social services.
The company’s war on regulation will also carry a social price. Uber and its supporters don’t seem to understand that regulations exist for a reason. It’s true that nobody likes excessive bureaucracy, but not all regulations are excessive or onerous. And when they are, it’s a flaw in execution rather than principle.
Regulations were created because they serve a social purpose, ensuring the free and fair exchange of services and resources among all segments of society. Some services, such as transportation, are of such importance that the public has a vested interest in ensuring they will be readily available at reasonably affordable prices. That’s not unreasonable for taxi services, especially given the fact that they profit from publicly maintained roads and bridges.
Uber has presented itself as a modernized, efficient alternative to government oversight. But it’s an evasion of regulation, not its replacement. As [Alexis Madrigal]reports, Uber has deliberately ignored city regulators and used customer demand to force its model of inadequate self-governance (my conclusion, not his) onto one city after another.
Uber presented itself as a refreshing alternative to the over-bureaucratized world of urban transportation. But that’s a false choice. We can streamline sclerotic city regulators, upgrade taxi fleets and even provide users with fancy apps that make it easier to call a cab. The company’s binary presentation – us, or City Hall – frames the debate in artificial terms.
Uber claims that its driver rating system is a more efficient way to monitor drivers, but that’s an entirely unproven assumption. While taxi drivers have been known to misbehave, the worldwide litany of complaints against Uber drivers – for everything from dirty cars and [spider bites] to [assault with a hammer], [fondling] and [rape]– suggest that Uber’s system may not work as well as old-fashioned regulation. It’s certainly not noticeably superior.
In fact, [prosecutors in San Francisco and Los Angeles] say Uber has been lying to its customers about the level and quality of its background checks. The company now promises it will do a better job at screening drivers. But it [won’t tell us] what measures its taking to improve its safety record, and it’s [fighting the kind of driver scrutiny][won’t tell us] that taxicab companies have been required to enforce for many decades.
Many reports suggest that beleaguered drivers don’t feel much better about the company than victimized passengers do. They tell [horror stories] about the company’s hiring and management practices. Uber [unilaterally slashes drivers’ rates], while claiming they don’t need to unionize. (The [Teamsters] disagree.)
The company also pushes [sketchy, substandard loans] onto its drivers – but hey, what could go wrong?
Uber has many libertarian defenders. And yet, it [deceives the press] and [threatens to spy on journalists], [lies to its own employees], keeps its practices a secret and routinely invades the privacy of civilians – sometimes merely for entertainment. (It has a tool, with the Orwellian name the “[God View],” that it can use for monitoring customers’ personal movements.)
Aren’t those the kinds of things libertarians say they hate about *government*?
This isn’t a “gotcha” exercise. It matters. Uber is the poster child for the pro-privatization, anti-regulatory ideology that ascribes magical powers to technology and the private sector. It is deeply a political entity, from its Nietzschean name to its recent hiring of White House veteran David Plouffe. Uber is built around a relatively simple app (which relies on government-created technology), but it’s not really a tech company. Above all else Uber is an ideological campaign, a neoliberal project whose real products are deregulation and the dismantling of the social contract.
Or maybe, as that tweeter in Sydney suggested, they’re just assholes.
Either way, it’s important that Uber’s worldview and business practices not be allowed to “disrupt” our economy or our social fabric. People who work hard deserve to make a decent living. Society at large deserves access to safe and affordable transportation. And government, as the collective expression of a democratic society, has a role to play in protecting its citizens.
And then there’s the matter of our collective psyche. In her book “A Paradise Built in Hell: The Extraordinary Communities that Arise in Disaster,” Rebecca Solnit wrote of the purpose, meaning and deep satisfaction people find when they pull together to help one another in the face of adversity. But in the world Uber seeks to create, those surges of the spirit would be replaced by surge pricing.
You don’t need a “God view” to see what happens next. When heroism is reduced to a transaction, the soul of a society is sold cheap.
[Reuters]: http://www.reuters.com/article/2014/12/15/us-australia-security-idUSKBN0JS0WX20141215
[Mashable]: http://mashable.com/2014/12/14/uber-sydney-surge-pricing/
[@Uber\_Sydney]: https://twitter.com/Uber_Sydney
[justified]: http://gothamist.com/2012/11/04/uber.php
[reportedly are]: http://www.businessinsider.com/uber-drivers-say-theyre-making-less-than-minimum-wage-2014-10
[celebrating Obamacare]: http://www.washingtonpost.com/blogs/wonkblog/wp/2014/11/17/why-uber-loves-obamacare/
[Alexis Madrigal]: http://fusion.net/story/33680/the-inside-story-of-how-the-uber-portland-negotiations-broke-down/
[spider bites]: http://consumerist.com/2014/07/30/uber-passenger-complains-of-spider-bite-in-filthy-car/
[assault with a hammer]: http://www.forbes.com/sites/ellenhuet/2014/09/30/uber-driver-hammer-attack-liability/
[fondling]: http://www.businessinsider.com/uber-nikki-williams-2014-12
[rape]: http://www.businessinsider.com/an-uber-driver-allegedly-raped-a-female-passenger-in-boston-2014-12
[prosecutors in San Francisco and Los Angeles]: http://www.huffingtonpost.com/2014/12/09/uber-california-lawsuit_n_6298206.html
[won’t tell us]: http://consumerist.com/2014/12/18/uber-reportedly-revamping-security-wont-say-exactly-what-its-doing/
[horror stories]: http://qz.com/299655/why-your-uber-driver-hates-uber/
[unilaterally slashes drivers’ rates]: http://www.salon.com/2014/09/03/uber_unrest_drivers_in_los_angeles_protest_the_slashing_of_rates/
[Teamsters]: http://www.fastcompany.com/3037371/the-teamsters-of-the-21st-century-how-uber-lyft-and-facebook-drivers-are-organizing
[sketchy, substandard loans]: http://thinkprogress.org/economy/2014/11/06/3589715/uber-lending-investigation/
[deceives the press]: http://pando.com/2014/10/29/uber-prs-latest-trick-impersonating-its-drivers-and-trying-to-scam-journalists/
[threatens to spy on journalists]: http://www.slate.com/blogs/the_slatest/2014/11/17/uber_exec_suggests_using_personal_info_against_journalists.html
[lies to its own employees]: http://money.cnn.com/2014/08/04/technology/uber-lyft/
[God View]: http://www.forbes.com/sites/kashmirhill/2014/10/03/god-view-uber-allegedly-stalked-users-for-party-goers-viewing-pleasure/
| davidar/peruse | test/md/salon-1.md | Markdown | mit | 14,851 |
<ion-view view-title="{{ctrl.guideTitle}}">
<ion-content>
<div class="list">
<div class="card-panel grey lighten-4" ng-repeat="guide in ctrl.guides">
<div ng-repeat="guideline in guide.guidelines">
<div class="item-text-wrap">{{guideline.text}}</div>
</div>
</div>
</div>
</ion-content>
</ion-view>
| CodeForGiessen/refugeeApp | app/main/templates/guideline-detail.html | HTML | mit | 349 |
define('findScriptUrls', [], function () {
return function(pattern) {
var type = typeof pattern, i, tags = document.querySelectorAll("script"), matches = [], src;
for (i = 0; i < tags.length; i++) {
src = tags[i].src || "";
if (type === "string") {
if (src.indexOf(pattern) !== -1) {
matches.push(src);
}
} else if (pattern.test(src)) {
matches.push(src);
}
}
return matches;
};
}); | obogo/hummingbird | src/utils/browser/findScriptUrls.js | JavaScript | mit | 538 |
<h2>Sprzątanie pobojowisk</h2>
<?php
f('jednostki_miasto');
$jednostki = jednostki_miasto($gracz);
if(!empty($_POST['cel']) && !empty($_POST['u'])){
f('sprzatanie_wyslij');
echo sprzatanie_wyslij($jednostki,$_POST['cel'],$_POST['u'],$gracz);
$gracz = gracz($gracz['gracz']);
f('jednostki_miasto');
$jednostki = jednostki_miasto($gracz);
} elseif(!empty($_GET['przerwij'])){
f('sprzatanie_przerwij');
echo sprzatanie_przerwij($gracz,$_GET['przerwij']);
$gracz = gracz($gracz['gracz']);
}
if(!empty($jednostki)){
$razem = 0;
$echo ="
<p>
<br style='clear:both'/>
<form action ='?a=sprzatanie' method='post'>
<table>
<tr>
<td>cel </td>
<td><input type='text' name='cel' class='input2' value ='".$_GET['cel']."'></td>
</tr>
";
foreach($jednostki as $oddzial){
if($oddzial['ilosc'] > 0){
$razem = 1;
$echo .="
<tr>
<td>".$oddzial['nazwa']." ( ".$oddzial['ilosc']." ) <span style='float:right'> udźwig: ".$oddzial['udzwig']."</span></td>
<td> <input type='text' class='input2' name='u[".$oddzial['id']."]' ></td>
</tr>
";
}
}
$echo .="
<tr>
<th colspan='2'><input type='submit' class='submit' value='wyślij'></th>
</tr>
</table>
</form>
</p>";
if($razem == 0){
echo "<p class='error'>Nie posiadasz jednostek</p>";
} else {
echo $echo;
}
} else echo "<p class='error'>Brak jednostek w grze</p>";
$wyslane = mysql_query("select * from osadnicy_sprzatanie inner join osadnicy_miasta on do_miasto = miasto where z_miasto = ".$gracz['aktywne_miasto']." order by koniec asc");
if(mysql_num_rows($wyslane) > 0){
echo "<hr/>Akcje<br/>
<table>
<tr>
<th>cel</th>
<th></th>
</tr>
";
$czas = time();
while($akcja = mysql_fetch_array($wyslane)){
$pozostalo = $akcja['koniec'] - $czas;
if($akcja['status'] == 0){
$tekst = "wyprawa kieruje się do miasta <i><b>".$akcja['nazwa']."</b></i>";
$opcja = " <a href='?a=sprzatanie&przerwij=".$akcja['id']."'>X</a>";
} else {
$tekst = "wyprawa powraca z miasta <i><b>".$akcja['nazwa']."</b></i>";
$opcja = "";
}
echo "
<tr align='center'>
<td>".$tekst."</td>
<td>
<span id='sp".$akcja['id']."'></span>
<script type='text/javascript'>liczCzas('sp".$akcja['id']."',".$pozostalo.");</script>
".$opcja."
</td>
</tr>";
}
echo "</table>";
}
?>
| WlasnaGra/Osadnicy | strony/gracz/sprzatanie.php | PHP | mit | 2,375 |
package net.tmachq.Ported_Blocks.tileentities.renderers;
import java.io.DataInputStream;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import net.tmachq.Ported_Blocks.models.SailModel;
public class TileEntitySailRenderer extends TileEntitySpecialRenderer {
private final SailModel model;
public TileEntitySailRenderer() {
this.model = new SailModel();
}
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
int rotation = 180;
switch (te.getBlockMetadata() % 4) {
case 0:
rotation = 0;
break;
case 3:
rotation = 90;
break;
case 2:
rotation = 180;
break;
case 1:
rotation = 270;
break;
}
GL11.glPushMatrix();
int i = te.getBlockMetadata();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("Ported_Blocks:textures/texturemaps/Sail_HD.png"));
GL11.glScalef(1.0F, -1F, -1F);
model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
private void adjustLightFixture(World world, int i, int j, int k, Block block) {
Tessellator tess = Tessellator.instance;
float brightness = block.getBlockBrightness(world, i, j, k);
int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
int modulousModifier = skyLight % 65536;
int divModifier = skyLight / 65536;
tess.setColorOpaque_F(brightness, brightness, brightness);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);
}
} | TMAC-Coding/Ported-Blocks | src/net/tmachq/Ported_Blocks/tileentities/renderers/TileEntitySailRenderer.java | Java | mit | 2,561 |
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
START_ATF_NAMESPACE
enum MENUPARTS
{
MENUPartFiller0 = 0x0,
MP_MENUITEM = 0x1,
MP_MENUDROPDOWN = 0x2,
MP_MENUBARITEM = 0x3,
MP_MENUBARDROPDOWN = 0x4,
MP_CHEVRON = 0x5,
MP_SEPARATOR = 0x6,
};
END_ATF_NAMESPACE
| goodwinxp/Yorozuya | library/ATF/MENUPARTS.hpp | C++ | mit | 415 |
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2015-05-11 using
// generator-karma 0.8.3
module.exports = function(config) {
'use strict';
config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// base path, that will be used to resolve files and exclude
basePath: '../',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/scripts/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: [
'PhantomJS'
],
// Which plugins to enable
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine'
],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
colors: true,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// Uncomment the following lines if you are using grunt's server to run the tests
// proxies: {
// '/': 'http://localhost:9000/'
// },
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});
};
| jjp12383/Portfolio | test/karma.conf.js | JavaScript | mit | 1,620 |
var indexSectionsWithContent =
{
0: "dfrsw~",
1: "drs",
2: "dfrs~",
3: "rs",
4: "w"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "functions",
3: "variables",
4: "pages"
};
var indexSectionLabels =
{
0: "All",
1: "Classes",
2: "Functions",
3: "Variables",
4: "Pages"
};
| sabertazimi/hust-lab | network/webserver/docs/search/searchdata.js | JavaScript | mit | 313 |
---
layout: post
title: 1212 TIL
excerpt: ""
tags: [TIL]
categories: [TIL]
link:
comments: true
pinned: true
image:
feature:
---
## Today Check List
- [ ] S3로 이미지 업로딩 테스트
- [ ] 지도 위치 DB에 넣기
- [ ] 그룹스터디 express 환경세팅
## Tomorrow Check List
## Today I learned
### Spring
뷰 데이터를 Controller로 전달하는 여러가지 방법.
* https://netframework.tistory.com/entry/25-View-%EB%8D%B0%EC%9D%B4%ED%84%B0%EC%9D%98-Controller-%EC%A0%84%EB%8B%AC-%EB%B0%A9%EB%B2%95
자바에서 String을 JSON으로 변환하는 방법
* https://zzznara2.tistory.com/673
자바 각종 타입 변환
* https://blog.opid.kr/248
## Today's Algorithm
| YouDuk/Youduk.github.io | _posts/2017-12-12-1212 TIL.md | Markdown | mit | 702 |
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
## Database authenticatable
t.boolean :admin
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
t.timestamps null: false
end
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
end
end
| njazari/sef-founderwall | db/migrate/20161030044448_devise_create_users.rb | Ruby | mit | 1,378 |
class RoomSerializer < ActiveModel::Serializer
attribute :id
attribute :name, key: :title
end
| guidance-guarantee-programme/tesco_planner | app/serializers/room_serializer.rb | Ruby | mit | 98 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Authentication extends CI_Controller {
function index(){
$value = $this->input->cookie('remember_me');
if ($value == 'true') {
$arr = array(
'user' => $this->input->cookie('user'),
'real_name' => $this->input->cookie('real_name'),
'user_id' => $this->input->cookie('user_id'),
);
$this->session->set_userdata($arr);
}
$this->load->view('login_view');
}
function create_user(){
$this->load->library('myencryption');
$arr = array('username'=>$this->myencryption->encode('admin'),
'password'=>$this->myencryption->encode('123'));
$this->db->insert('user',$arr);
}
function resetPassword(){
$this->load->library('myencryption');
$this->load->library('form_validation');
$this->form_validation->set_rules('resetmail','Reset email','valid_email');
$this->form_validation->set_error_delimiters('<div class="alert alert-warning">','</div>');
if ($this->form_validation->run() == false) {
$this->load->view('login_view');
}else{
$mail = $this->input->post('resetmail');
$this->db->where('email_address',trim(strtolower($mail)));
$result = $this->db->get('user');
if ($result->num_rows() == 1 ){
function get_random_password($chars_min=8, $chars_max=10, $use_upper_case=true, $include_numbers=true, $include_special_chars=false){
$length = rand($chars_min, $chars_max);
$selection = 'aeuoyibcdfghjklmnpqrstvwxz';
if($include_numbers) {
$selection .= "1234567890";
}
if($include_special_chars) {
$selection .= "!@\"#$%&[]{}?|";
}
$password = "";
for($i=0; $i<$length; $i++) {
$current_letter = $use_upper_case ? (rand(0,1) ? strtoupper($selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))];
$password .= $current_letter;
}
return $password;
}
$newpass = get_random_password();
$this->db->where('email_address',trim(strtolower($mail)));
$newpass1 = $this->myencryption->encode($newpass);
$this->db->update('user',array('password'=>$newpass1));
if ($this->db->affected_rows() == 1){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'Broskomsot123',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$this->email->from('[email protected]', 'Rest password MSC');
$this->email->to($mail);
$this->email->subject('New Password');
$this->email->message('Your New Password is : '.$newpass);
if (! $this->email->send()) {
$arr['message'] = '<div class="alert alert-warning" style="text-align:left">Reset password failed. please try again later.</div>';
$this->load->view('login_view',$arr);
}else{
$arr['message'] = '<div class="alert alert-success" style="text-align:left">Reset password successful. Please check your email for the new password</div>';
$this->load->view('login_view',$arr);
}
}
}else{
$arr['message'] = '<div class="alert alert-warning">Given reset email dose not exist!</div>';
$this->load->view('login_view',$arr);
}
}
}
function validation(){
$this->load->library('myencryption');
$this->load->library('form_validation');
$this->form_validation->set_rules('username','Username','required');
$this->form_validation->set_rules('password','Password','required');
$this->form_validation->set_error_delimiters('<div class="alert alert-warning">','</div>');
if ($this->form_validation->run() == false ) {
$this->load->view('login_view');
}else{
$username = $this->input->post('username');
$password = $this->input->post('password');
$rememberme = $this->input->post('rememberme');
$this->db->where('username',$this->myencryption->encode($username));
$this->db->where('password',$this->myencryption->encode($password));
$result = $this->db->get('user');
if ($result->num_rows()==1) {
$value = $result->row();
if ($rememberme == 'on'){
$arr = array('user'=>TRUE,'real_name'=>$value->real_name,'user_id'=>$value->id);
$this->session->set_userdata($arr);
$cookie = array(
'name' => 'remember_me',
'value' => 'true',
'expire' => '15000000',
'prefix' => ''
);
$this->input->set_cookie($cookie);
$cookie = array(
'name' => 'user',
'value' => TRUE,
'expire' => '15000000',
'prefix' => ''
);
$this->input->set_cookie($cookie);
$cookie = array(
'name' => 'real_name',
'value' => $value->real_name,
'expire' => '15000000',
'prefix' => ''
);
$this->input->set_cookie($cookie);
$cookie = array(
'name' => 'user_id',
'value' => $value->id,
'expire' => '15000000',
'prefix' => ''
);
$this->input->set_cookie($cookie);
}else{
$arr = array('user'=>TRUE,'real_name'=>$value->real_name,'user_id'=>$value->id);
$this->session->set_userdata($arr);
$cookie = array(
'name' => 'remember_me',
'value' => 'false',
'expire' => '15000000',
'prefix' => ''
);
$this->input->set_cookie($cookie);
}
redirect('home');
}else{
$arr['message'] = '<div class="alert alert-danger" style="text-align:left">Incorrect username or password !!! </div>';
$this->load->view('login_view',$arr);
}
}
}
} | tavhu/msc | application/controllers/Authentication.php | PHP | mit | 6,198 |
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Web Client
* Copyright (C) 2006, 2007, 2009, 2010 Zimbra, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.zimbra.com/license.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.webClient.build;
import java.io.*;
import java.util.*;
import java.util.regex.*;
import org.apache.tools.ant.*;
import org.apache.tools.ant.types.*;
public class PackageJammerTask
extends Task {
//
// Constants
//
private static final Pattern RE_DEFINE = Pattern.compile("^AjxPackage\\.define\\(['\"]([^'\"]+)['\"]\\);?");
private static final Pattern RE_UNDEFINE = Pattern.compile("^AjxPackage\\.undefine\\(['\"]([^'\"]+)['\"]\\);?");
private static final Pattern RE_REQUIRE = Pattern.compile("^AjxPackage\\.require\\(['\"]([^'\"]+)['\"](.*?)\\);?");
private static final Pattern RE_REQUIRE_OBJ = Pattern.compile("^AjxPackage\\.require\\((\\s*\\{\\s*name\\s*:\")?([^'\"]+)['\"](.*?)\\);?");
private static final String OUTPUT_JS = "js";
private static final String OUTPUT_HTML = "html";
private static final String OUTPUT_ALL = "all";
//
// Data
//
// attributes
private File destFile;
private File jsFile;
private File htmlFile;
private List<Source> sources = new LinkedList<Source>();
private File dependsFile;
private String output = OUTPUT_JS;
private String basepath = "";
private String extension = ".js";
private boolean verbose = false;
// children
private Text prefix;
private Text suffix;
private List<JammerFiles> files = new LinkedList<JammerFiles>();
// internal state
private String depth;
private Map<String,Boolean> defines;
private boolean isJs = true;
private boolean isHtml = false;
private boolean isAll = false;
//
// Public methods
//
// attributes
public void setDestFile(File file) {
this.destFile = file;
}
public void setJsDestFile(File file) {
this.jsFile = file;
}
public void setHtmlDestFile(File file) {
this.htmlFile = file;
}
public void setJsDir(File dir) {
Source source = new Source();
source.setDir(dir);
this.sources.clear();
this.sources.add(source);
}
public void setDependsFile(File file) {
this.dependsFile = file;
}
public void setOutput(String output) {
this.output = output;
this.isAll = OUTPUT_ALL.equals(output);
this.isHtml = this.isAll || OUTPUT_HTML.equals(output);
this.isJs = this.isAll || OUTPUT_JS.equals(output) || !this.isHtml;
}
public void setBasePath(String basepath) {
this.basepath = basepath;
}
public void setExtension(String extension) {
this.extension = extension;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
// children
public Text createPrefix() {
return this.prefix = new Text();
}
public Text createSuffix() {
return this.suffix = new Text();
}
public FileList createFileList() {
JammerFileList fileList = new JammerFileList();
this.files.add(fileList);
return fileList;
}
public FileSet createFileSet() {
JammerFileSet fileSet = new JammerFileSet();
this.files.add(fileSet);
return fileSet;
}
public Source createSrc() {
Source source = new Source();
this.sources.add(source);
return source;
}
//
// Task methods
//
public void execute() throws BuildException {
this.depth = "";
this.defines = new HashMap<String,Boolean>();
PrintWriter jsOut = null;
PrintWriter htmlOut = null;
PrintWriter dependsOut = null;
try {
if (this.isJs) {
File file = this.jsFile != null ? this.jsFile : this.destFile;
log("Jamming to ",file.toString());
jsOut = new PrintWriter(new FileWriter(file));
}
if (this.isHtml) {
File file = this.htmlFile != null ? this.htmlFile : this.destFile;
log("Jamming to ",file.toString());
htmlOut = new PrintWriter(new FileWriter(file));
}
if (this.dependsFile != null) {
log("Dependencies saved to "+this.dependsFile);
dependsOut = new PrintWriter(new FileWriter(this.dependsFile));
}
if (this.prefix != null) {
PrintWriter out = OUTPUT_JS.equals(this.prefix.output) ? jsOut : htmlOut;
if (out != null) {
out.println(this.prefix.toString());
}
}
List<String> packages = new LinkedList<String>();
for (JammerFiles files : this.files) {
boolean wrap = files.isWrapped();
boolean isManifest = files.isManifest();
File dir = files.getDir(this.getProject());
for (String filename : files.getFiles(this.getProject())) {
File file = new File(dir, filename);
String pkg = path2package(stripExt(filename).replace(File.separatorChar, '/'));
packages.add(pkg);
if (this.isHtml && !isManifest) {
printHTML(htmlOut, pkg, files.getBasePath(), files.getExtension());
}
jamFile(jsOut, htmlOut, file, pkg, packages, wrap, true, dependsOut);
}
}
if (this.isHtml && packages.size() > 0 && htmlOut != null) {
htmlOut.println("<script type=\"text/javascript\">");
for (String pkg : packages) {
htmlOut.print("AjxPackage.define(\"");
htmlOut.print(pkg);
htmlOut.println("\");");
}
htmlOut.println("</script>");
}
if (this.suffix != null) {
PrintWriter out = OUTPUT_JS.equals(this.prefix.output) ? jsOut : htmlOut;
if (out != null) {
out.println(this.suffix.toString());
}
}
}
catch (IOException e) {
throw new BuildException(e);
}
finally {
if (jsOut != null) jsOut.close();
if (htmlOut != null) htmlOut.close();
if (dependsOut != null) dependsOut.close();
}
}
//
// Private methods
//
private void jamFile(PrintWriter jsOut, PrintWriter htmlOut, File ifile,
String pkg, List<String> packages,
boolean wrap, boolean top, PrintWriter dependsOut)
throws IOException {
if (this.verbose) log("file: ",ifile.toString());
BufferedReader in = new BufferedReader(new FileReader(ifile));
boolean isJS = ifile.getName().endsWith(".js");
// "wrap" source
if (this.isJs && isJS && pkg != null && wrap && jsOut != null) {
jsOut.print("if (AjxPackage.define(\"");
jsOut.print(pkg);
jsOut.println("\")) {");
}
// remember this file
if (dependsOut != null) {
dependsOut.println(ifile.getCanonicalPath());
dependsOut.flush();
}
// read file
String line;
while ((line = in.readLine()) != null) {
// define package
String define = matchDefine(line);
if (define != null) {
if (this.verbose) log("define ", define);
this.defines.put(package2path(define), true);
continue;
}
// undefine package
String undefine = matchUndefine(line);
if (undefine != null) {
if (this.verbose) log("undefine ", undefine);
this.defines.remove(package2path(undefine));
continue;
}
// require package
String require = matchRequire(line);
if (require != null) {
if (this.verbose) log("require ", require);
String path = package2path(require);
if (this.defines.get(path) == null) {
packages.add(require);
// output script tag
if (this.isHtml && !path.endsWith("__all__")) {
printHTML(htmlOut, require, null, null);
}
// implicitly define and jam on!
this.defines.put(path, true);
File file = this.getFileForPath(path);
String odepth = this.verbose ? this.depth : null;
if (this.verbose) this.depth += " ";
jamFile(jsOut, htmlOut, file, path2package(require), packages, wrap, false, dependsOut);
if (this.verbose) this.depth = odepth;
}
continue;
}
// leave line intact
if (this.isJs && isJS && jsOut != null) {
jsOut.println(line);
}
}
if (this.isJs && isJS && pkg != null && wrap && jsOut != null) {
jsOut.println("}");
}
in.close();
}
private File getFileForPath(String path) {
String name = path.replace('/',File.separatorChar)+".js";
File file = null;
for (Source source : this.sources) {
String filename = name;
if (source.prefix != null && name.startsWith(source.prefix+"/")) {
filename = name.substring(source.prefix.length() + 1);
}
file = new File(source.dir, filename);
if (file.exists()) {
break;
}
}
return file;
}
private void printHTML(PrintWriter out, String pkg, String basePath, String extension) {
if (out == null) return;
String path = package2path(pkg);
out.print("<script type=\"text/javascript\" src=\"");
out.print(basePath != null ? basePath : this.basepath);
out.print(path);
out.print(extension != null ? extension : this.extension);
out.println("\"></script>");
}
private String matchDefine(String s) {
Matcher m = RE_DEFINE.matcher(s);
return m.matches() ? m.group(1) : null;
}
private String matchUndefine(String s) {
Matcher m = RE_UNDEFINE.matcher(s);
return m.matches() ? m.group(1) : null;
}
private String matchRequire(String s) {
Matcher m = RE_REQUIRE.matcher(s);
if (m.matches()){
return m.group(1);
}
m = RE_REQUIRE_OBJ.matcher(s);
if (m.matches()){
return m.group(2);
}
return null;
}
private void log(String... ss) {
System.out.print(this.depth);
for (String s : ss) {
System.out.print(s);
}
System.out.println();
}
//
// Private functions
//
private static String package2path(String pkg) {
return pkg.replace('.', '/').replaceAll("\\*$", "__all__");
}
private static String path2package(String path) {
return path.replace('/', '.').replaceAll("\\*$", "__all__");
}
private static String stripExt(String fname) {
return fname.replaceAll("\\..+$", "");
}
//
// Classes
//
private static interface JammerFiles {
public boolean isWrapped();
public boolean isManifest();
public String getBasePath();
public String getExtension();
public File getDir(Project project);
public String[] getFiles(Project project);
}
public static class JammerFileList
extends FileList
implements JammerFiles {
//
// Data
//
private boolean wrap = true;
private boolean manifest = true;
private String basePath;
private String extension;
//
// Public methods
//
public void setWrap(boolean wrap) {
this.wrap = wrap;
}
public boolean isWrapped() {
return this.wrap;
}
public void setManifest(boolean manifest) {
this.manifest = manifest;
}
public boolean isManifest() {
return this.manifest;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getBasePath() {
return this.basePath;
}
public void setExtension(String extension) {
this.extension = extension;
}
public String getExtension() {
return this.extension;
}
} // class JammerFileList
public static class JammerFileSet
extends FileSet
implements JammerFiles {
//
// Data
//
private boolean wrap = true;
private boolean manifest = true;
private String basePath;
private String extension;
//
// Public methods
//
public String[] getFiles(Project project) {
return this.getDirectoryScanner(project).getIncludedFiles();
}
public void setWrap(boolean wrap) {
this.wrap = wrap;
}
public boolean isWrapped() {
return wrap;
}
public void setManifest(boolean manifest) {
this.manifest = manifest;
}
public boolean isManifest() {
return this.manifest;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getBasePath() {
return this.basePath;
}
public void setExtension(String extension) {
this.extension = extension;
}
public String getExtension() {
return this.extension;
}
} // class JammerFileList
public static class Text {
public String output = PackageJammerTask.OUTPUT_JS;
private StringBuilder str = new StringBuilder();
public void setOutput(String output) {
this.output = output;
}
public void addText(String s) {
str.append(s);
}
public String toString() { return str.toString(); }
}
public class Source {
public File dir;
public String prefix;
public void setDir(File dir) {
this.dir = dir;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
}
} // class PackageJammerTask
| nico01f/z-pec | ZimbraWebClient/src/com/zimbra/webClient/build/PackageJammerTask.java | Java | mit | 14,020 |
var pub = {},
Q,
Knex;
module.exports = function ($inject) {
$inject = $inject || {};
Q = $inject.Q;
Knex = $inject.Knex;
return pub;
};
pub.get = function(tableName) {
var q = Q.defer();
pub.getMetadata(tableName)
.then(function(relations) {
q.resolve(relations[0]);
});
return q.promise;
};
pub.getMetadata = function(tableName) {
return Knex.knex.raw('SELECT ' +
'KCU1.CONSTRAINT_NAME AS FK_CONSTRAINT_NAME, ' +
'KCU1.COLUMN_NAME AS FK_COLUMN_NAME, ' +
'KCU2.CONSTRAINT_NAME AS REFERENCED_CONSTRAINT_NAME, ' +
'KCU2.TABLE_NAME AS REFERENCED_TABLE_NAME, ' +
'KCU2.COLUMN_NAME AS REFERENCED_COLUMN_NAME ' +
'FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC ' +
'INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU1 ' +
'ON KCU1.CONSTRAINT_CATALOG = RC.CONSTRAINT_CATALOG ' +
'AND KCU1.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA ' +
'AND KCU1.CONSTRAINT_NAME = RC.CONSTRAINT_NAME ' +
'AND KCU1.TABLE_NAME = RC.TABLE_NAME ' +
'INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU2 ' +
'ON KCU2.CONSTRAINT_CATALOG = RC.UNIQUE_CONSTRAINT_CATALOG ' +
'AND KCU2.CONSTRAINT_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA ' +
'AND KCU2.CONSTRAINT_NAME = RC.UNIQUE_CONSTRAINT_NAME ' +
'AND KCU2.ORDINAL_POSITION = KCU1.ORDINAL_POSITION ' +
'AND KCU2.TABLE_NAME = RC.REFERENCED_TABLE_NAME ' +
'WHERE kcu1.table_name = ?', tableName);
};
| heinzelmannchen/mysql2json | lib/relations.js | JavaScript | mit | 1,911 |
using System.Web.Mvc;
using FFLTask.SRV.ServiceInterface;
using FFLTask.UI.PC.Filter;
using FFLTask.SRV.ViewModel.Account;
using FFLTask.SRV.ViewModel.Shared;
namespace FFLTask.UI.PC.Controllers
{
public class RegisterController : BaseController
{
private IRegisterService _registerService;
public RegisterController(IRegisterService registerService)
{
_registerService = registerService;
}
#region URL: /Register
[HttpGet]
[CheckCookieEnabled]
public ActionResult Index()
{
return View(new RegisterModel());
}
[HttpPost]
public ActionResult Index(RegisterModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
model.ImageCode = imageCodeHelper.CheckResult();
if (model.ImageCode.ImageCodeError != ImageCodeError.NoError)
{
return View(model);
}
if (_registerService.GetUserByName(model.UserName) > 0)
{
ModelState.AddModelError("UserName", "*用户名已被使用");
return View(model);
}
int userId = _registerService.Do(model);
userHelper.SetUserId(userId.ToString());
return RedirectToAction("Profile", "User");
}
#endregion
#region Ajax
public JsonResult IsUserNameExist(string name)
{
bool duplicated = _registerService.GetUserByName(name) > 0;
return Json(duplicated);
}
#endregion
}
}
| feilang864/task.zyfei.net | UI/PC/Controllers/RegisterController.cs | C# | mit | 1,657 |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->string('name')->unique();
$table->string('empresa')->unique();
$table->string('first_name');
$table->string('last_name');
$table->string('email')->unique()->nullable();
$table->string('password', 60);
$table->integer('role_id');
$table->rememberToken()->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
| 3dlink/age | database/migrations/2014_10_12_000000_create_users_table.php | PHP | mit | 774 |
# frozen_string_literal: true
require 'fieldhand/metadata_format'
module Fieldhand
# A parser for ListMetadataFormats responses.
#
# See https://www.openarchives.org/OAI/openarchivesprotocol.html#ListMetadataFormats
class ListMetadataFormatsParser
attr_reader :response_parser
# Return a parser for the given response parser.
def initialize(response_parser)
@response_parser = response_parser
end
# Return an array of `MetadataFormat`s found in the response.
def items
response_parser.
root.
locate('ListMetadataFormats/metadataFormat').
map { |item| MetadataFormat.new(item, response_parser.response_date) }
end
end
end
| altmetric/fieldhand | lib/fieldhand/list_metadata_formats_parser.rb | Ruby | mit | 699 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Botos</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body{
color: #28fe14;
background-color: black;
font-family: "Courier New";
font-size: 15pt;
cursor: default
}
</style>
<script type="text/javascript">
document.ondragstart = function(){return false;}
document.oncontextmenu = function(){return false;}
document.onselectstart = function(){return false;}
</script>
</head>
<body>
| BirkhoffLee/Botos | cmd/extra/main.header.php | PHP | mit | 633 |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Resources
{
// Intentionally excluding visibility so it defaults to internal except for
// the one public version in System.Resources.ResourceManager which defines
// another version of this partial class with the public visibility
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
sealed partial class NeutralResourcesLanguageAttribute : Attribute
{
private readonly string _culture;
public NeutralResourcesLanguageAttribute(string cultureName)
{
if (cultureName == null)
throw new ArgumentNullException("cultureName");
_culture = cultureName;
}
public string CultureName
{
get { return _culture; }
}
}
}
| mafiya69/corefx | src/Common/src/System/Resources/NeutralResourcesLanguageAttribute.cs | C# | mit | 984 |
//---------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//---------------------------------------------------------------------------------------------------------------------
namespace CodeGraphModel
{
using System.Collections.Generic;
using System.Runtime.Serialization;
[DataContract]
public class Symbol : Entity
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string SymbolType { get; set; }
[DataMember]
public bool IsExternal { get; set; }
[DataMember]
public int LineStart { get; set; }
[DataMember]
public int LineEnd { get; set; }
[DataMember]
public int ColumnStart { get; set; }
[DataMember]
public int ColumnEnd { get; set; }
[DataMember]
public string FileUId { get; set; }
[DataMember]
public List<SymbolReference> References { get; set; }
public override string ToString()
{
return string.Format("[Name: {0}, Type: {1}, UId: {2}]", Name, Type, UId);
}
public override bool IsValid()
{
return this.Type == EntityType.Symbol;
}
}
public class SymbolResponse
{
[DataMember]
public string uid;
[DataMember]
public string name;
[DataMember]
public string type;
[DataMember]
public string fileUid;
[DataMember]
public int lineStart;
[DataMember]
public int lineEnd;
[DataMember]
public int columnStart;
[DataMember]
public int columnEnd;
}
} | too4words/Call-Graph-Builder-DotNet | CodeGraphModel/Symbol.cs | C# | mit | 1,852 |
// Compiled by ClojureScript 1.7.170 {}
goog.provide('figwheel.client.file_reloading');
goog.require('cljs.core');
goog.require('goog.string');
goog.require('goog.Uri');
goog.require('goog.net.jsloader');
goog.require('cljs.core.async');
goog.require('goog.object');
goog.require('clojure.set');
goog.require('clojure.string');
goog.require('figwheel.client.utils');
figwheel.client.file_reloading.queued_file_reload;
if(typeof figwheel.client.file_reloading.figwheel_meta_pragmas !== 'undefined'){
} else {
figwheel.client.file_reloading.figwheel_meta_pragmas = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
}
figwheel.client.file_reloading.on_jsload_custom_event = (function figwheel$client$file_reloading$on_jsload_custom_event(url){
return figwheel.client.utils.dispatch_custom_event.call(null,"figwheel.js-reload",url);
});
figwheel.client.file_reloading.before_jsload_custom_event = (function figwheel$client$file_reloading$before_jsload_custom_event(files){
return figwheel.client.utils.dispatch_custom_event.call(null,"figwheel.before-js-reload",files);
});
figwheel.client.file_reloading.namespace_file_map_QMARK_ = (function figwheel$client$file_reloading$namespace_file_map_QMARK_(m){
var or__16826__auto__ = (cljs.core.map_QMARK_.call(null,m)) && (typeof new cljs.core.Keyword(null,"namespace","namespace",-377510372).cljs$core$IFn$_invoke$arity$1(m) === 'string') && (((new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(m) == null)) || (typeof new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(m) === 'string')) && (cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(m),new cljs.core.Keyword(null,"namespace","namespace",-377510372)));
if(or__16826__auto__){
return or__16826__auto__;
} else {
cljs.core.println.call(null,"Error not namespace-file-map",cljs.core.pr_str.call(null,m));
return false;
}
});
figwheel.client.file_reloading.add_cache_buster = (function figwheel$client$file_reloading$add_cache_buster(url){
return goog.Uri.parse(url).makeUnique();
});
figwheel.client.file_reloading.name__GT_path = (function figwheel$client$file_reloading$name__GT_path(ns){
return (goog.dependencies_.nameToPath[ns]);
});
figwheel.client.file_reloading.provided_QMARK_ = (function figwheel$client$file_reloading$provided_QMARK_(ns){
return (goog.dependencies_.written[figwheel.client.file_reloading.name__GT_path.call(null,ns)]);
});
figwheel.client.file_reloading.fix_node_request_url = (function figwheel$client$file_reloading$fix_node_request_url(url){
if(cljs.core.truth_(goog.string.startsWith(url,"../"))){
return clojure.string.replace.call(null,url,"../","");
} else {
return [cljs.core.str("goog/"),cljs.core.str(url)].join('');
}
});
figwheel.client.file_reloading.immutable_ns_QMARK_ = (function figwheel$client$file_reloading$immutable_ns_QMARK_(name){
var or__16826__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 9, ["svgpan.SvgPan",null,"far.out",null,"testDep.bar",null,"someprotopackage.TestPackageTypes",null,"goog",null,"an.existing.path",null,"cljs.core",null,"ns",null,"dup.base",null], null), null).call(null,name);
if(cljs.core.truth_(or__16826__auto__)){
return or__16826__auto__;
} else {
return cljs.core.some.call(null,cljs.core.partial.call(null,goog.string.startsWith,name),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["goog.","cljs.","clojure.","fake.","proto2."], null));
}
});
figwheel.client.file_reloading.get_requires = (function figwheel$client$file_reloading$get_requires(ns){
return cljs.core.set.call(null,cljs.core.filter.call(null,(function (p1__23844_SHARP_){
return cljs.core.not.call(null,figwheel.client.file_reloading.immutable_ns_QMARK_.call(null,p1__23844_SHARP_));
}),goog.object.getKeys((goog.dependencies_.requires[figwheel.client.file_reloading.name__GT_path.call(null,ns)]))));
});
if(typeof figwheel.client.file_reloading.dependency_data !== 'undefined'){
} else {
figwheel.client.file_reloading.dependency_data = cljs.core.atom.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"pathToName","pathToName",-1236616181),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"dependents","dependents",136812837),cljs.core.PersistentArrayMap.EMPTY], null));
}
figwheel.client.file_reloading.path_to_name_BANG_ = (function figwheel$client$file_reloading$path_to_name_BANG_(path,name){
return cljs.core.swap_BANG_.call(null,figwheel.client.file_reloading.dependency_data,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pathToName","pathToName",-1236616181),path], null),cljs.core.fnil.call(null,clojure.set.union,cljs.core.PersistentHashSet.EMPTY),cljs.core.PersistentHashSet.fromArray([name], true));
});
/**
* Setup a path to name dependencies map.
* That goes from path -> #{ ns-names }
*/
figwheel.client.file_reloading.setup_path__GT_name_BANG_ = (function figwheel$client$file_reloading$setup_path__GT_name_BANG_(){
var nameToPath = goog.object.filter(goog.dependencies_.nameToPath,(function (v,k,o){
return goog.string.startsWith(v,"../");
}));
return goog.object.forEach(nameToPath,((function (nameToPath){
return (function (v,k,o){
return figwheel.client.file_reloading.path_to_name_BANG_.call(null,v,k);
});})(nameToPath))
);
});
/**
* returns a set of namespaces defined by a path
*/
figwheel.client.file_reloading.path__GT_name = (function figwheel$client$file_reloading$path__GT_name(path){
return cljs.core.get_in.call(null,cljs.core.deref.call(null,figwheel.client.file_reloading.dependency_data),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pathToName","pathToName",-1236616181),path], null));
});
figwheel.client.file_reloading.name_to_parent_BANG_ = (function figwheel$client$file_reloading$name_to_parent_BANG_(ns,parent_ns){
return cljs.core.swap_BANG_.call(null,figwheel.client.file_reloading.dependency_data,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dependents","dependents",136812837),ns], null),cljs.core.fnil.call(null,clojure.set.union,cljs.core.PersistentHashSet.EMPTY),cljs.core.PersistentHashSet.fromArray([parent_ns], true));
});
/**
* This reverses the goog.dependencies_.requires for looking up ns-dependents.
*/
figwheel.client.file_reloading.setup_ns__GT_dependents_BANG_ = (function figwheel$client$file_reloading$setup_ns__GT_dependents_BANG_(){
var requires = goog.object.filter(goog.dependencies_.requires,(function (v,k,o){
return goog.string.startsWith(k,"../");
}));
return goog.object.forEach(requires,((function (requires){
return (function (v,k,_){
return goog.object.forEach(v,((function (requires){
return (function (v_SINGLEQUOTE_,k_SINGLEQUOTE_,___$1){
var seq__23849 = cljs.core.seq.call(null,figwheel.client.file_reloading.path__GT_name.call(null,k));
var chunk__23850 = null;
var count__23851 = (0);
var i__23852 = (0);
while(true){
if((i__23852 < count__23851)){
var n = cljs.core._nth.call(null,chunk__23850,i__23852);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,k_SINGLEQUOTE_,n);
var G__23853 = seq__23849;
var G__23854 = chunk__23850;
var G__23855 = count__23851;
var G__23856 = (i__23852 + (1));
seq__23849 = G__23853;
chunk__23850 = G__23854;
count__23851 = G__23855;
i__23852 = G__23856;
continue;
} else {
var temp__4425__auto__ = cljs.core.seq.call(null,seq__23849);
if(temp__4425__auto__){
var seq__23849__$1 = temp__4425__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__23849__$1)){
var c__17629__auto__ = cljs.core.chunk_first.call(null,seq__23849__$1);
var G__23857 = cljs.core.chunk_rest.call(null,seq__23849__$1);
var G__23858 = c__17629__auto__;
var G__23859 = cljs.core.count.call(null,c__17629__auto__);
var G__23860 = (0);
seq__23849 = G__23857;
chunk__23850 = G__23858;
count__23851 = G__23859;
i__23852 = G__23860;
continue;
} else {
var n = cljs.core.first.call(null,seq__23849__$1);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,k_SINGLEQUOTE_,n);
var G__23861 = cljs.core.next.call(null,seq__23849__$1);
var G__23862 = null;
var G__23863 = (0);
var G__23864 = (0);
seq__23849 = G__23861;
chunk__23850 = G__23862;
count__23851 = G__23863;
i__23852 = G__23864;
continue;
}
} else {
return null;
}
}
break;
}
});})(requires))
);
});})(requires))
);
});
figwheel.client.file_reloading.ns__GT_dependents = (function figwheel$client$file_reloading$ns__GT_dependents(ns){
return cljs.core.get_in.call(null,cljs.core.deref.call(null,figwheel.client.file_reloading.dependency_data),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"dependents","dependents",136812837),ns], null));
});
figwheel.client.file_reloading.build_topo_sort = (function figwheel$client$file_reloading$build_topo_sort(get_deps){
var get_deps__$1 = cljs.core.memoize.call(null,get_deps);
var topo_sort_helper_STAR_ = ((function (get_deps__$1){
return (function figwheel$client$file_reloading$build_topo_sort_$_topo_sort_helper_STAR_(x,depth,state){
var deps = get_deps__$1.call(null,x);
if(cljs.core.empty_QMARK_.call(null,deps)){
return null;
} else {
return topo_sort_STAR_.call(null,deps,depth,state);
}
});})(get_deps__$1))
;
var topo_sort_STAR_ = ((function (get_deps__$1){
return (function() {
var figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_ = null;
var figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___1 = (function (deps){
return figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_.call(null,deps,(0),cljs.core.atom.call(null,cljs.core.sorted_map.call(null)));
});
var figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___3 = (function (deps,depth,state){
cljs.core.swap_BANG_.call(null,state,cljs.core.update_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [depth], null),cljs.core.fnil.call(null,cljs.core.into,cljs.core.PersistentHashSet.EMPTY),deps);
var seq__23903_23910 = cljs.core.seq.call(null,deps);
var chunk__23904_23911 = null;
var count__23905_23912 = (0);
var i__23906_23913 = (0);
while(true){
if((i__23906_23913 < count__23905_23912)){
var dep_23914 = cljs.core._nth.call(null,chunk__23904_23911,i__23906_23913);
topo_sort_helper_STAR_.call(null,dep_23914,(depth + (1)),state);
var G__23915 = seq__23903_23910;
var G__23916 = chunk__23904_23911;
var G__23917 = count__23905_23912;
var G__23918 = (i__23906_23913 + (1));
seq__23903_23910 = G__23915;
chunk__23904_23911 = G__23916;
count__23905_23912 = G__23917;
i__23906_23913 = G__23918;
continue;
} else {
var temp__4425__auto___23919 = cljs.core.seq.call(null,seq__23903_23910);
if(temp__4425__auto___23919){
var seq__23903_23920__$1 = temp__4425__auto___23919;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__23903_23920__$1)){
var c__17629__auto___23921 = cljs.core.chunk_first.call(null,seq__23903_23920__$1);
var G__23922 = cljs.core.chunk_rest.call(null,seq__23903_23920__$1);
var G__23923 = c__17629__auto___23921;
var G__23924 = cljs.core.count.call(null,c__17629__auto___23921);
var G__23925 = (0);
seq__23903_23910 = G__23922;
chunk__23904_23911 = G__23923;
count__23905_23912 = G__23924;
i__23906_23913 = G__23925;
continue;
} else {
var dep_23926 = cljs.core.first.call(null,seq__23903_23920__$1);
topo_sort_helper_STAR_.call(null,dep_23926,(depth + (1)),state);
var G__23927 = cljs.core.next.call(null,seq__23903_23920__$1);
var G__23928 = null;
var G__23929 = (0);
var G__23930 = (0);
seq__23903_23910 = G__23927;
chunk__23904_23911 = G__23928;
count__23905_23912 = G__23929;
i__23906_23913 = G__23930;
continue;
}
} else {
}
}
break;
}
if(cljs.core._EQ_.call(null,depth,(0))){
return elim_dups_STAR_.call(null,cljs.core.reverse.call(null,cljs.core.vals.call(null,cljs.core.deref.call(null,state))));
} else {
return null;
}
});
figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_ = function(deps,depth,state){
switch(arguments.length){
case 1:
return figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___1.call(this,deps);
case 3:
return figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___3.call(this,deps,depth,state);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_.cljs$core$IFn$_invoke$arity$1 = figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___1;
figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_.cljs$core$IFn$_invoke$arity$3 = figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR___3;
return figwheel$client$file_reloading$build_topo_sort_$_topo_sort_STAR_;
})()
;})(get_deps__$1))
;
var elim_dups_STAR_ = ((function (get_deps__$1){
return (function figwheel$client$file_reloading$build_topo_sort_$_elim_dups_STAR_(p__23907){
var vec__23909 = p__23907;
var x = cljs.core.nth.call(null,vec__23909,(0),null);
var xs = cljs.core.nthnext.call(null,vec__23909,(1));
if((x == null)){
return cljs.core.List.EMPTY;
} else {
return cljs.core.cons.call(null,x,figwheel$client$file_reloading$build_topo_sort_$_elim_dups_STAR_.call(null,cljs.core.map.call(null,((function (vec__23909,x,xs,get_deps__$1){
return (function (p1__23865_SHARP_){
return clojure.set.difference.call(null,p1__23865_SHARP_,x);
});})(vec__23909,x,xs,get_deps__$1))
,xs)));
}
});})(get_deps__$1))
;
return topo_sort_STAR_;
});
figwheel.client.file_reloading.get_all_dependencies = (function figwheel$client$file_reloading$get_all_dependencies(ns){
var topo_sort_SINGLEQUOTE_ = figwheel.client.file_reloading.build_topo_sort.call(null,figwheel.client.file_reloading.get_requires);
return cljs.core.apply.call(null,cljs.core.concat,topo_sort_SINGLEQUOTE_.call(null,cljs.core.set.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [ns], null))));
});
figwheel.client.file_reloading.get_all_dependents = (function figwheel$client$file_reloading$get_all_dependents(nss){
var topo_sort_SINGLEQUOTE_ = figwheel.client.file_reloading.build_topo_sort.call(null,figwheel.client.file_reloading.ns__GT_dependents);
return cljs.core.reverse.call(null,cljs.core.apply.call(null,cljs.core.concat,topo_sort_SINGLEQUOTE_.call(null,cljs.core.set.call(null,nss))));
});
figwheel.client.file_reloading.unprovide_BANG_ = (function figwheel$client$file_reloading$unprovide_BANG_(ns){
var path = figwheel.client.file_reloading.name__GT_path.call(null,ns);
goog.object.remove(goog.dependencies_.visited,path);
goog.object.remove(goog.dependencies_.written,path);
return goog.object.remove(goog.dependencies_.written,[cljs.core.str(goog.basePath),cljs.core.str(path)].join(''));
});
figwheel.client.file_reloading.resolve_ns = (function figwheel$client$file_reloading$resolve_ns(ns){
return [cljs.core.str(goog.basePath),cljs.core.str(figwheel.client.file_reloading.name__GT_path.call(null,ns))].join('');
});
figwheel.client.file_reloading.addDependency = (function figwheel$client$file_reloading$addDependency(path,provides,requires){
var seq__23943 = cljs.core.seq.call(null,provides);
var chunk__23944 = null;
var count__23945 = (0);
var i__23946 = (0);
while(true){
if((i__23946 < count__23945)){
var prov = cljs.core._nth.call(null,chunk__23944,i__23946);
figwheel.client.file_reloading.path_to_name_BANG_.call(null,path,prov);
var seq__23947_23955 = cljs.core.seq.call(null,requires);
var chunk__23948_23956 = null;
var count__23949_23957 = (0);
var i__23950_23958 = (0);
while(true){
if((i__23950_23958 < count__23949_23957)){
var req_23959 = cljs.core._nth.call(null,chunk__23948_23956,i__23950_23958);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,req_23959,prov);
var G__23960 = seq__23947_23955;
var G__23961 = chunk__23948_23956;
var G__23962 = count__23949_23957;
var G__23963 = (i__23950_23958 + (1));
seq__23947_23955 = G__23960;
chunk__23948_23956 = G__23961;
count__23949_23957 = G__23962;
i__23950_23958 = G__23963;
continue;
} else {
var temp__4425__auto___23964 = cljs.core.seq.call(null,seq__23947_23955);
if(temp__4425__auto___23964){
var seq__23947_23965__$1 = temp__4425__auto___23964;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__23947_23965__$1)){
var c__17629__auto___23966 = cljs.core.chunk_first.call(null,seq__23947_23965__$1);
var G__23967 = cljs.core.chunk_rest.call(null,seq__23947_23965__$1);
var G__23968 = c__17629__auto___23966;
var G__23969 = cljs.core.count.call(null,c__17629__auto___23966);
var G__23970 = (0);
seq__23947_23955 = G__23967;
chunk__23948_23956 = G__23968;
count__23949_23957 = G__23969;
i__23950_23958 = G__23970;
continue;
} else {
var req_23971 = cljs.core.first.call(null,seq__23947_23965__$1);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,req_23971,prov);
var G__23972 = cljs.core.next.call(null,seq__23947_23965__$1);
var G__23973 = null;
var G__23974 = (0);
var G__23975 = (0);
seq__23947_23955 = G__23972;
chunk__23948_23956 = G__23973;
count__23949_23957 = G__23974;
i__23950_23958 = G__23975;
continue;
}
} else {
}
}
break;
}
var G__23976 = seq__23943;
var G__23977 = chunk__23944;
var G__23978 = count__23945;
var G__23979 = (i__23946 + (1));
seq__23943 = G__23976;
chunk__23944 = G__23977;
count__23945 = G__23978;
i__23946 = G__23979;
continue;
} else {
var temp__4425__auto__ = cljs.core.seq.call(null,seq__23943);
if(temp__4425__auto__){
var seq__23943__$1 = temp__4425__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__23943__$1)){
var c__17629__auto__ = cljs.core.chunk_first.call(null,seq__23943__$1);
var G__23980 = cljs.core.chunk_rest.call(null,seq__23943__$1);
var G__23981 = c__17629__auto__;
var G__23982 = cljs.core.count.call(null,c__17629__auto__);
var G__23983 = (0);
seq__23943 = G__23980;
chunk__23944 = G__23981;
count__23945 = G__23982;
i__23946 = G__23983;
continue;
} else {
var prov = cljs.core.first.call(null,seq__23943__$1);
figwheel.client.file_reloading.path_to_name_BANG_.call(null,path,prov);
var seq__23951_23984 = cljs.core.seq.call(null,requires);
var chunk__23952_23985 = null;
var count__23953_23986 = (0);
var i__23954_23987 = (0);
while(true){
if((i__23954_23987 < count__23953_23986)){
var req_23988 = cljs.core._nth.call(null,chunk__23952_23985,i__23954_23987);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,req_23988,prov);
var G__23989 = seq__23951_23984;
var G__23990 = chunk__23952_23985;
var G__23991 = count__23953_23986;
var G__23992 = (i__23954_23987 + (1));
seq__23951_23984 = G__23989;
chunk__23952_23985 = G__23990;
count__23953_23986 = G__23991;
i__23954_23987 = G__23992;
continue;
} else {
var temp__4425__auto___23993__$1 = cljs.core.seq.call(null,seq__23951_23984);
if(temp__4425__auto___23993__$1){
var seq__23951_23994__$1 = temp__4425__auto___23993__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__23951_23994__$1)){
var c__17629__auto___23995 = cljs.core.chunk_first.call(null,seq__23951_23994__$1);
var G__23996 = cljs.core.chunk_rest.call(null,seq__23951_23994__$1);
var G__23997 = c__17629__auto___23995;
var G__23998 = cljs.core.count.call(null,c__17629__auto___23995);
var G__23999 = (0);
seq__23951_23984 = G__23996;
chunk__23952_23985 = G__23997;
count__23953_23986 = G__23998;
i__23954_23987 = G__23999;
continue;
} else {
var req_24000 = cljs.core.first.call(null,seq__23951_23994__$1);
figwheel.client.file_reloading.name_to_parent_BANG_.call(null,req_24000,prov);
var G__24001 = cljs.core.next.call(null,seq__23951_23994__$1);
var G__24002 = null;
var G__24003 = (0);
var G__24004 = (0);
seq__23951_23984 = G__24001;
chunk__23952_23985 = G__24002;
count__23953_23986 = G__24003;
i__23954_23987 = G__24004;
continue;
}
} else {
}
}
break;
}
var G__24005 = cljs.core.next.call(null,seq__23943__$1);
var G__24006 = null;
var G__24007 = (0);
var G__24008 = (0);
seq__23943 = G__24005;
chunk__23944 = G__24006;
count__23945 = G__24007;
i__23946 = G__24008;
continue;
}
} else {
return null;
}
}
break;
}
});
figwheel.client.file_reloading.figwheel_require = (function figwheel$client$file_reloading$figwheel_require(src,reload){
goog.require = figwheel$client$file_reloading$figwheel_require;
if(cljs.core._EQ_.call(null,reload,"reload-all")){
var seq__24013_24017 = cljs.core.seq.call(null,figwheel.client.file_reloading.get_all_dependencies.call(null,src));
var chunk__24014_24018 = null;
var count__24015_24019 = (0);
var i__24016_24020 = (0);
while(true){
if((i__24016_24020 < count__24015_24019)){
var ns_24021 = cljs.core._nth.call(null,chunk__24014_24018,i__24016_24020);
figwheel.client.file_reloading.unprovide_BANG_.call(null,ns_24021);
var G__24022 = seq__24013_24017;
var G__24023 = chunk__24014_24018;
var G__24024 = count__24015_24019;
var G__24025 = (i__24016_24020 + (1));
seq__24013_24017 = G__24022;
chunk__24014_24018 = G__24023;
count__24015_24019 = G__24024;
i__24016_24020 = G__24025;
continue;
} else {
var temp__4425__auto___24026 = cljs.core.seq.call(null,seq__24013_24017);
if(temp__4425__auto___24026){
var seq__24013_24027__$1 = temp__4425__auto___24026;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__24013_24027__$1)){
var c__17629__auto___24028 = cljs.core.chunk_first.call(null,seq__24013_24027__$1);
var G__24029 = cljs.core.chunk_rest.call(null,seq__24013_24027__$1);
var G__24030 = c__17629__auto___24028;
var G__24031 = cljs.core.count.call(null,c__17629__auto___24028);
var G__24032 = (0);
seq__24013_24017 = G__24029;
chunk__24014_24018 = G__24030;
count__24015_24019 = G__24031;
i__24016_24020 = G__24032;
continue;
} else {
var ns_24033 = cljs.core.first.call(null,seq__24013_24027__$1);
figwheel.client.file_reloading.unprovide_BANG_.call(null,ns_24033);
var G__24034 = cljs.core.next.call(null,seq__24013_24027__$1);
var G__24035 = null;
var G__24036 = (0);
var G__24037 = (0);
seq__24013_24017 = G__24034;
chunk__24014_24018 = G__24035;
count__24015_24019 = G__24036;
i__24016_24020 = G__24037;
continue;
}
} else {
}
}
break;
}
} else {
}
if(cljs.core.truth_(reload)){
figwheel.client.file_reloading.unprovide_BANG_.call(null,src);
} else {
}
return goog.require_figwheel_backup_(src);
});
/**
* Reusable browser REPL bootstrapping. Patches the essential functions
* in goog.base to support re-loading of namespaces after page load.
*/
figwheel.client.file_reloading.bootstrap_goog_base = (function figwheel$client$file_reloading$bootstrap_goog_base(){
if(cljs.core.truth_(COMPILED)){
return null;
} else {
goog.require_figwheel_backup_ = (function (){var or__16826__auto__ = goog.require__;
if(cljs.core.truth_(or__16826__auto__)){
return or__16826__auto__;
} else {
return goog.require;
}
})();
goog.isProvided_ = (function (name){
return false;
});
figwheel.client.file_reloading.setup_path__GT_name_BANG_.call(null);
figwheel.client.file_reloading.setup_ns__GT_dependents_BANG_.call(null);
goog.addDependency_figwheel_backup_ = goog.addDependency;
goog.addDependency = (function() {
var G__24038__delegate = function (args){
cljs.core.apply.call(null,figwheel.client.file_reloading.addDependency,args);
return cljs.core.apply.call(null,goog.addDependency_figwheel_backup_,args);
};
var G__24038 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__24039__i = 0, G__24039__a = new Array(arguments.length - 0);
while (G__24039__i < G__24039__a.length) {G__24039__a[G__24039__i] = arguments[G__24039__i + 0]; ++G__24039__i;}
args = new cljs.core.IndexedSeq(G__24039__a,0);
}
return G__24038__delegate.call(this,args);};
G__24038.cljs$lang$maxFixedArity = 0;
G__24038.cljs$lang$applyTo = (function (arglist__24040){
var args = cljs.core.seq(arglist__24040);
return G__24038__delegate(args);
});
G__24038.cljs$core$IFn$_invoke$arity$variadic = G__24038__delegate;
return G__24038;
})()
;
goog.constructNamespace_("cljs.user");
goog.global.CLOSURE_IMPORT_SCRIPT = figwheel.client.file_reloading.queued_file_reload;
return goog.require = figwheel.client.file_reloading.figwheel_require;
}
});
figwheel.client.file_reloading.patch_goog_base = (function figwheel$client$file_reloading$patch_goog_base(){
if(typeof figwheel.client.file_reloading.bootstrapped_cljs !== 'undefined'){
return null;
} else {
figwheel.client.file_reloading.bootstrapped_cljs = (function (){
figwheel.client.file_reloading.bootstrap_goog_base.call(null);
return true;
})()
;
}
});
figwheel.client.file_reloading.reload_file_STAR_ = (function (){var pred__24042 = cljs.core._EQ_;
var expr__24043 = figwheel.client.utils.host_env_QMARK_.call(null);
if(cljs.core.truth_(pred__24042.call(null,new cljs.core.Keyword(null,"node","node",581201198),expr__24043))){
var path_parts = ((function (pred__24042,expr__24043){
return (function (p1__24041_SHARP_){
return clojure.string.split.call(null,p1__24041_SHARP_,/[\/\\]/);
});})(pred__24042,expr__24043))
;
var sep = (cljs.core.truth_(cljs.core.re_matches.call(null,/win.*/,process.platform))?"\\":"/");
var root = clojure.string.join.call(null,sep,cljs.core.pop.call(null,cljs.core.pop.call(null,path_parts.call(null,__dirname))));
return ((function (path_parts,sep,root,pred__24042,expr__24043){
return (function (request_url,callback){
var cache_path = clojure.string.join.call(null,sep,cljs.core.cons.call(null,root,path_parts.call(null,figwheel.client.file_reloading.fix_node_request_url.call(null,request_url))));
(require.cache[cache_path] = null);
return callback.call(null,(function (){try{return require(cache_path);
}catch (e24045){if((e24045 instanceof Error)){
var e = e24045;
figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"error","error",-978969032),[cljs.core.str("Figwheel: Error loading file "),cljs.core.str(cache_path)].join(''));
figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"error","error",-978969032),e.stack);
return false;
} else {
throw e24045;
}
}})());
});
;})(path_parts,sep,root,pred__24042,expr__24043))
} else {
if(cljs.core.truth_(pred__24042.call(null,new cljs.core.Keyword(null,"html","html",-998796897),expr__24043))){
return ((function (pred__24042,expr__24043){
return (function (request_url,callback){
var deferred = goog.net.jsloader.load(figwheel.client.file_reloading.add_cache_buster.call(null,request_url),{"cleanupWhenDone": true});
deferred.addCallback(((function (deferred,pred__24042,expr__24043){
return (function (){
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [true], null));
});})(deferred,pred__24042,expr__24043))
);
return deferred.addErrback(((function (deferred,pred__24042,expr__24043){
return (function (){
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [false], null));
});})(deferred,pred__24042,expr__24043))
);
});
;})(pred__24042,expr__24043))
} else {
return ((function (pred__24042,expr__24043){
return (function (a,b){
throw "Reload not defined for this platform";
});
;})(pred__24042,expr__24043))
}
}
})();
figwheel.client.file_reloading.reload_file = (function figwheel$client$file_reloading$reload_file(p__24046,callback){
var map__24049 = p__24046;
var map__24049__$1 = ((((!((map__24049 == null)))?((((map__24049.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24049.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24049):map__24049);
var file_msg = map__24049__$1;
var request_url = cljs.core.get.call(null,map__24049__$1,new cljs.core.Keyword(null,"request-url","request-url",2100346596));
figwheel.client.utils.debug_prn.call(null,[cljs.core.str("FigWheel: Attempting to load "),cljs.core.str(request_url)].join(''));
return figwheel.client.file_reloading.reload_file_STAR_.call(null,request_url,((function (map__24049,map__24049__$1,file_msg,request_url){
return (function (success_QMARK_){
if(cljs.core.truth_(success_QMARK_)){
figwheel.client.utils.debug_prn.call(null,[cljs.core.str("FigWheel: Successfully loaded "),cljs.core.str(request_url)].join(''));
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.assoc.call(null,file_msg,new cljs.core.Keyword(null,"loaded-file","loaded-file",-168399375),true)], null));
} else {
figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"error","error",-978969032),[cljs.core.str("Figwheel: Error loading file "),cljs.core.str(request_url)].join(''));
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [file_msg], null));
}
});})(map__24049,map__24049__$1,file_msg,request_url))
);
});
if(typeof figwheel.client.file_reloading.reload_chan !== 'undefined'){
} else {
figwheel.client.file_reloading.reload_chan = cljs.core.async.chan.call(null);
}
if(typeof figwheel.client.file_reloading.on_load_callbacks !== 'undefined'){
} else {
figwheel.client.file_reloading.on_load_callbacks = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
}
if(typeof figwheel.client.file_reloading.dependencies_loaded !== 'undefined'){
} else {
figwheel.client.file_reloading.dependencies_loaded = cljs.core.atom.call(null,cljs.core.PersistentVector.EMPTY);
}
figwheel.client.file_reloading.blocking_load = (function figwheel$client$file_reloading$blocking_load(url){
var out = cljs.core.async.chan.call(null);
figwheel.client.file_reloading.reload_file.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"request-url","request-url",2100346596),url], null),((function (out){
return (function (file_msg){
cljs.core.async.put_BANG_.call(null,out,file_msg);
return cljs.core.async.close_BANG_.call(null,out);
});})(out))
);
return out;
});
if(typeof figwheel.client.file_reloading.reloader_loop !== 'undefined'){
} else {
figwheel.client.file_reloading.reloader_loop = (function (){var c__20950__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__20950__auto__){
return (function (){
var f__20951__auto__ = (function (){var switch__20838__auto__ = ((function (c__20950__auto__){
return (function (state_24073){
var state_val_24074 = (state_24073[(1)]);
if((state_val_24074 === (7))){
var inst_24069 = (state_24073[(2)]);
var state_24073__$1 = state_24073;
var statearr_24075_24095 = state_24073__$1;
(statearr_24075_24095[(2)] = inst_24069);
(statearr_24075_24095[(1)] = (3));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (1))){
var state_24073__$1 = state_24073;
var statearr_24076_24096 = state_24073__$1;
(statearr_24076_24096[(2)] = null);
(statearr_24076_24096[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (4))){
var inst_24053 = (state_24073[(7)]);
var inst_24053__$1 = (state_24073[(2)]);
var state_24073__$1 = (function (){var statearr_24077 = state_24073;
(statearr_24077[(7)] = inst_24053__$1);
return statearr_24077;
})();
if(cljs.core.truth_(inst_24053__$1)){
var statearr_24078_24097 = state_24073__$1;
(statearr_24078_24097[(1)] = (5));
} else {
var statearr_24079_24098 = state_24073__$1;
(statearr_24079_24098[(1)] = (6));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (6))){
var state_24073__$1 = state_24073;
var statearr_24080_24099 = state_24073__$1;
(statearr_24080_24099[(2)] = null);
(statearr_24080_24099[(1)] = (7));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (3))){
var inst_24071 = (state_24073[(2)]);
var state_24073__$1 = state_24073;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_24073__$1,inst_24071);
} else {
if((state_val_24074 === (2))){
var state_24073__$1 = state_24073;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_24073__$1,(4),figwheel.client.file_reloading.reload_chan);
} else {
if((state_val_24074 === (11))){
var inst_24065 = (state_24073[(2)]);
var state_24073__$1 = (function (){var statearr_24081 = state_24073;
(statearr_24081[(8)] = inst_24065);
return statearr_24081;
})();
var statearr_24082_24100 = state_24073__$1;
(statearr_24082_24100[(2)] = null);
(statearr_24082_24100[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (9))){
var inst_24057 = (state_24073[(9)]);
var inst_24059 = (state_24073[(10)]);
var inst_24061 = inst_24059.call(null,inst_24057);
var state_24073__$1 = state_24073;
var statearr_24083_24101 = state_24073__$1;
(statearr_24083_24101[(2)] = inst_24061);
(statearr_24083_24101[(1)] = (11));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (5))){
var inst_24053 = (state_24073[(7)]);
var inst_24055 = figwheel.client.file_reloading.blocking_load.call(null,inst_24053);
var state_24073__$1 = state_24073;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_24073__$1,(8),inst_24055);
} else {
if((state_val_24074 === (10))){
var inst_24057 = (state_24073[(9)]);
var inst_24063 = cljs.core.swap_BANG_.call(null,figwheel.client.file_reloading.dependencies_loaded,cljs.core.conj,inst_24057);
var state_24073__$1 = state_24073;
var statearr_24084_24102 = state_24073__$1;
(statearr_24084_24102[(2)] = inst_24063);
(statearr_24084_24102[(1)] = (11));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24074 === (8))){
var inst_24059 = (state_24073[(10)]);
var inst_24053 = (state_24073[(7)]);
var inst_24057 = (state_24073[(2)]);
var inst_24058 = cljs.core.deref.call(null,figwheel.client.file_reloading.on_load_callbacks);
var inst_24059__$1 = cljs.core.get.call(null,inst_24058,inst_24053);
var state_24073__$1 = (function (){var statearr_24085 = state_24073;
(statearr_24085[(9)] = inst_24057);
(statearr_24085[(10)] = inst_24059__$1);
return statearr_24085;
})();
if(cljs.core.truth_(inst_24059__$1)){
var statearr_24086_24103 = state_24073__$1;
(statearr_24086_24103[(1)] = (9));
} else {
var statearr_24087_24104 = state_24073__$1;
(statearr_24087_24104[(1)] = (10));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
});})(c__20950__auto__))
;
return ((function (switch__20838__auto__,c__20950__auto__){
return (function() {
var figwheel$client$file_reloading$state_machine__20839__auto__ = null;
var figwheel$client$file_reloading$state_machine__20839__auto____0 = (function (){
var statearr_24091 = [null,null,null,null,null,null,null,null,null,null,null];
(statearr_24091[(0)] = figwheel$client$file_reloading$state_machine__20839__auto__);
(statearr_24091[(1)] = (1));
return statearr_24091;
});
var figwheel$client$file_reloading$state_machine__20839__auto____1 = (function (state_24073){
while(true){
var ret_value__20840__auto__ = (function (){try{while(true){
var result__20841__auto__ = switch__20838__auto__.call(null,state_24073);
if(cljs.core.keyword_identical_QMARK_.call(null,result__20841__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__20841__auto__;
}
break;
}
}catch (e24092){if((e24092 instanceof Object)){
var ex__20842__auto__ = e24092;
var statearr_24093_24105 = state_24073;
(statearr_24093_24105[(5)] = ex__20842__auto__);
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_24073);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e24092;
}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__20840__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__24106 = state_24073;
state_24073 = G__24106;
continue;
} else {
return ret_value__20840__auto__;
}
break;
}
});
figwheel$client$file_reloading$state_machine__20839__auto__ = function(state_24073){
switch(arguments.length){
case 0:
return figwheel$client$file_reloading$state_machine__20839__auto____0.call(this);
case 1:
return figwheel$client$file_reloading$state_machine__20839__auto____1.call(this,state_24073);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
figwheel$client$file_reloading$state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$file_reloading$state_machine__20839__auto____0;
figwheel$client$file_reloading$state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$file_reloading$state_machine__20839__auto____1;
return figwheel$client$file_reloading$state_machine__20839__auto__;
})()
;})(switch__20838__auto__,c__20950__auto__))
})();
var state__20952__auto__ = (function (){var statearr_24094 = f__20951__auto__.call(null);
(statearr_24094[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__20950__auto__);
return statearr_24094;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__20952__auto__);
});})(c__20950__auto__))
);
return c__20950__auto__;
})();
}
figwheel.client.file_reloading.queued_file_reload = (function figwheel$client$file_reloading$queued_file_reload(url){
return cljs.core.async.put_BANG_.call(null,figwheel.client.file_reloading.reload_chan,url);
});
figwheel.client.file_reloading.require_with_callback = (function figwheel$client$file_reloading$require_with_callback(p__24107,callback){
var map__24110 = p__24107;
var map__24110__$1 = ((((!((map__24110 == null)))?((((map__24110.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24110.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24110):map__24110);
var file_msg = map__24110__$1;
var namespace = cljs.core.get.call(null,map__24110__$1,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
var request_url = figwheel.client.file_reloading.resolve_ns.call(null,namespace);
cljs.core.swap_BANG_.call(null,figwheel.client.file_reloading.on_load_callbacks,cljs.core.assoc,request_url,((function (request_url,map__24110,map__24110__$1,file_msg,namespace){
return (function (file_msg_SINGLEQUOTE_){
cljs.core.swap_BANG_.call(null,figwheel.client.file_reloading.on_load_callbacks,cljs.core.dissoc,request_url);
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.merge.call(null,file_msg,cljs.core.select_keys.call(null,file_msg_SINGLEQUOTE_,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"loaded-file","loaded-file",-168399375)], null)))], null));
});})(request_url,map__24110,map__24110__$1,file_msg,namespace))
);
return figwheel.client.file_reloading.figwheel_require.call(null,cljs.core.name.call(null,namespace),true);
});
figwheel.client.file_reloading.reload_file_QMARK_ = (function figwheel$client$file_reloading$reload_file_QMARK_(p__24112){
var map__24115 = p__24112;
var map__24115__$1 = ((((!((map__24115 == null)))?((((map__24115.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24115.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24115):map__24115);
var file_msg = map__24115__$1;
var namespace = cljs.core.get.call(null,map__24115__$1,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
var meta_pragmas = cljs.core.get.call(null,cljs.core.deref.call(null,figwheel.client.file_reloading.figwheel_meta_pragmas),cljs.core.name.call(null,namespace));
var and__16814__auto__ = cljs.core.not.call(null,new cljs.core.Keyword(null,"figwheel-no-load","figwheel-no-load",-555840179).cljs$core$IFn$_invoke$arity$1(meta_pragmas));
if(and__16814__auto__){
var or__16826__auto__ = new cljs.core.Keyword(null,"figwheel-always","figwheel-always",799819691).cljs$core$IFn$_invoke$arity$1(meta_pragmas);
if(cljs.core.truth_(or__16826__auto__)){
return or__16826__auto__;
} else {
var or__16826__auto____$1 = new cljs.core.Keyword(null,"figwheel-load","figwheel-load",1316089175).cljs$core$IFn$_invoke$arity$1(meta_pragmas);
if(cljs.core.truth_(or__16826__auto____$1)){
return or__16826__auto____$1;
} else {
return figwheel.client.file_reloading.provided_QMARK_.call(null,cljs.core.name.call(null,namespace));
}
}
} else {
return and__16814__auto__;
}
});
figwheel.client.file_reloading.js_reload = (function figwheel$client$file_reloading$js_reload(p__24117,callback){
var map__24120 = p__24117;
var map__24120__$1 = ((((!((map__24120 == null)))?((((map__24120.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24120.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24120):map__24120);
var file_msg = map__24120__$1;
var request_url = cljs.core.get.call(null,map__24120__$1,new cljs.core.Keyword(null,"request-url","request-url",2100346596));
var namespace = cljs.core.get.call(null,map__24120__$1,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
if(cljs.core.truth_(figwheel.client.file_reloading.reload_file_QMARK_.call(null,file_msg))){
return figwheel.client.file_reloading.require_with_callback.call(null,file_msg,callback);
} else {
figwheel.client.utils.debug_prn.call(null,[cljs.core.str("Figwheel: Not trying to load file "),cljs.core.str(request_url)].join(''));
return cljs.core.apply.call(null,callback,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [file_msg], null));
}
});
figwheel.client.file_reloading.reload_js_file = (function figwheel$client$file_reloading$reload_js_file(file_msg){
var out = cljs.core.async.chan.call(null);
figwheel.client.file_reloading.js_reload.call(null,file_msg,((function (out){
return (function (url){
cljs.core.async.put_BANG_.call(null,out,url);
return cljs.core.async.close_BANG_.call(null,out);
});})(out))
);
return out;
});
/**
* Returns a chanel with one collection of loaded filenames on it.
*/
figwheel.client.file_reloading.load_all_js_files = (function figwheel$client$file_reloading$load_all_js_files(files){
var out = cljs.core.async.chan.call(null);
var c__20950__auto___24208 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__20950__auto___24208,out){
return (function (){
var f__20951__auto__ = (function (){var switch__20838__auto__ = ((function (c__20950__auto___24208,out){
return (function (state_24190){
var state_val_24191 = (state_24190[(1)]);
if((state_val_24191 === (1))){
var inst_24168 = cljs.core.nth.call(null,files,(0),null);
var inst_24169 = cljs.core.nthnext.call(null,files,(1));
var inst_24170 = files;
var state_24190__$1 = (function (){var statearr_24192 = state_24190;
(statearr_24192[(7)] = inst_24168);
(statearr_24192[(8)] = inst_24169);
(statearr_24192[(9)] = inst_24170);
return statearr_24192;
})();
var statearr_24193_24209 = state_24190__$1;
(statearr_24193_24209[(2)] = null);
(statearr_24193_24209[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24191 === (2))){
var inst_24173 = (state_24190[(10)]);
var inst_24170 = (state_24190[(9)]);
var inst_24173__$1 = cljs.core.nth.call(null,inst_24170,(0),null);
var inst_24174 = cljs.core.nthnext.call(null,inst_24170,(1));
var inst_24175 = (inst_24173__$1 == null);
var inst_24176 = cljs.core.not.call(null,inst_24175);
var state_24190__$1 = (function (){var statearr_24194 = state_24190;
(statearr_24194[(11)] = inst_24174);
(statearr_24194[(10)] = inst_24173__$1);
return statearr_24194;
})();
if(inst_24176){
var statearr_24195_24210 = state_24190__$1;
(statearr_24195_24210[(1)] = (4));
} else {
var statearr_24196_24211 = state_24190__$1;
(statearr_24196_24211[(1)] = (5));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24191 === (3))){
var inst_24188 = (state_24190[(2)]);
var state_24190__$1 = state_24190;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_24190__$1,inst_24188);
} else {
if((state_val_24191 === (4))){
var inst_24173 = (state_24190[(10)]);
var inst_24178 = figwheel.client.file_reloading.reload_js_file.call(null,inst_24173);
var state_24190__$1 = state_24190;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_24190__$1,(7),inst_24178);
} else {
if((state_val_24191 === (5))){
var inst_24184 = cljs.core.async.close_BANG_.call(null,out);
var state_24190__$1 = state_24190;
var statearr_24197_24212 = state_24190__$1;
(statearr_24197_24212[(2)] = inst_24184);
(statearr_24197_24212[(1)] = (6));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24191 === (6))){
var inst_24186 = (state_24190[(2)]);
var state_24190__$1 = state_24190;
var statearr_24198_24213 = state_24190__$1;
(statearr_24198_24213[(2)] = inst_24186);
(statearr_24198_24213[(1)] = (3));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24191 === (7))){
var inst_24174 = (state_24190[(11)]);
var inst_24180 = (state_24190[(2)]);
var inst_24181 = cljs.core.async.put_BANG_.call(null,out,inst_24180);
var inst_24170 = inst_24174;
var state_24190__$1 = (function (){var statearr_24199 = state_24190;
(statearr_24199[(9)] = inst_24170);
(statearr_24199[(12)] = inst_24181);
return statearr_24199;
})();
var statearr_24200_24214 = state_24190__$1;
(statearr_24200_24214[(2)] = null);
(statearr_24200_24214[(1)] = (2));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__20950__auto___24208,out))
;
return ((function (switch__20838__auto__,c__20950__auto___24208,out){
return (function() {
var figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__ = null;
var figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____0 = (function (){
var statearr_24204 = [null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_24204[(0)] = figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__);
(statearr_24204[(1)] = (1));
return statearr_24204;
});
var figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____1 = (function (state_24190){
while(true){
var ret_value__20840__auto__ = (function (){try{while(true){
var result__20841__auto__ = switch__20838__auto__.call(null,state_24190);
if(cljs.core.keyword_identical_QMARK_.call(null,result__20841__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__20841__auto__;
}
break;
}
}catch (e24205){if((e24205 instanceof Object)){
var ex__20842__auto__ = e24205;
var statearr_24206_24215 = state_24190;
(statearr_24206_24215[(5)] = ex__20842__auto__);
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_24190);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e24205;
}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__20840__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__24216 = state_24190;
state_24190 = G__24216;
continue;
} else {
return ret_value__20840__auto__;
}
break;
}
});
figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__ = function(state_24190){
switch(arguments.length){
case 0:
return figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____0.call(this);
case 1:
return figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____1.call(this,state_24190);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____0;
figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto____1;
return figwheel$client$file_reloading$load_all_js_files_$_state_machine__20839__auto__;
})()
;})(switch__20838__auto__,c__20950__auto___24208,out))
})();
var state__20952__auto__ = (function (){var statearr_24207 = f__20951__auto__.call(null);
(statearr_24207[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__20950__auto___24208);
return statearr_24207;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__20952__auto__);
});})(c__20950__auto___24208,out))
);
return cljs.core.async.into.call(null,cljs.core.PersistentVector.EMPTY,out);
});
figwheel.client.file_reloading.eval_body = (function figwheel$client$file_reloading$eval_body(p__24217,opts){
var map__24221 = p__24217;
var map__24221__$1 = ((((!((map__24221 == null)))?((((map__24221.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24221.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24221):map__24221);
var eval_body__$1 = cljs.core.get.call(null,map__24221__$1,new cljs.core.Keyword(null,"eval-body","eval-body",-907279883));
var file = cljs.core.get.call(null,map__24221__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
if(cljs.core.truth_((function (){var and__16814__auto__ = eval_body__$1;
if(cljs.core.truth_(and__16814__auto__)){
return typeof eval_body__$1 === 'string';
} else {
return and__16814__auto__;
}
})())){
var code = eval_body__$1;
try{figwheel.client.utils.debug_prn.call(null,[cljs.core.str("Evaling file "),cljs.core.str(file)].join(''));
return figwheel.client.utils.eval_helper.call(null,code,opts);
}catch (e24223){var e = e24223;
return figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"error","error",-978969032),[cljs.core.str("Unable to evaluate "),cljs.core.str(file)].join(''));
}} else {
return null;
}
});
figwheel.client.file_reloading.expand_files = (function figwheel$client$file_reloading$expand_files(files){
var deps = figwheel.client.file_reloading.get_all_dependents.call(null,cljs.core.map.call(null,new cljs.core.Keyword(null,"namespace","namespace",-377510372),files));
return cljs.core.filter.call(null,cljs.core.comp.call(null,cljs.core.not,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, ["figwheel.connect",null], null), null),new cljs.core.Keyword(null,"namespace","namespace",-377510372)),cljs.core.map.call(null,((function (deps){
return (function (n){
var temp__4423__auto__ = cljs.core.first.call(null,cljs.core.filter.call(null,((function (deps){
return (function (p1__24224_SHARP_){
return cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"namespace","namespace",-377510372).cljs$core$IFn$_invoke$arity$1(p1__24224_SHARP_),n);
});})(deps))
,files));
if(cljs.core.truth_(temp__4423__auto__)){
var file_msg = temp__4423__auto__;
return file_msg;
} else {
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"namespace","namespace",-377510372),new cljs.core.Keyword(null,"namespace","namespace",-377510372),n], null);
}
});})(deps))
,deps));
});
figwheel.client.file_reloading.sort_files = (function figwheel$client$file_reloading$sort_files(files){
if((cljs.core.count.call(null,files) <= (1))){
return files;
} else {
var keep_files = cljs.core.set.call(null,cljs.core.keep.call(null,new cljs.core.Keyword(null,"namespace","namespace",-377510372),files));
return cljs.core.filter.call(null,cljs.core.comp.call(null,keep_files,new cljs.core.Keyword(null,"namespace","namespace",-377510372)),figwheel.client.file_reloading.expand_files.call(null,files));
}
});
figwheel.client.file_reloading.get_figwheel_always = (function figwheel$client$file_reloading$get_figwheel_always(){
return cljs.core.map.call(null,(function (p__24229){
var vec__24230 = p__24229;
var k = cljs.core.nth.call(null,vec__24230,(0),null);
var v = cljs.core.nth.call(null,vec__24230,(1),null);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"namespace","namespace",-377510372),k,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"namespace","namespace",-377510372)], null);
}),cljs.core.filter.call(null,(function (p__24231){
var vec__24232 = p__24231;
var k = cljs.core.nth.call(null,vec__24232,(0),null);
var v = cljs.core.nth.call(null,vec__24232,(1),null);
return new cljs.core.Keyword(null,"figwheel-always","figwheel-always",799819691).cljs$core$IFn$_invoke$arity$1(v);
}),cljs.core.deref.call(null,figwheel.client.file_reloading.figwheel_meta_pragmas)));
});
figwheel.client.file_reloading.reload_js_files = (function figwheel$client$file_reloading$reload_js_files(p__24236,p__24237){
var map__24484 = p__24236;
var map__24484__$1 = ((((!((map__24484 == null)))?((((map__24484.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24484.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24484):map__24484);
var opts = map__24484__$1;
var before_jsload = cljs.core.get.call(null,map__24484__$1,new cljs.core.Keyword(null,"before-jsload","before-jsload",-847513128));
var on_jsload = cljs.core.get.call(null,map__24484__$1,new cljs.core.Keyword(null,"on-jsload","on-jsload",-395756602));
var reload_dependents = cljs.core.get.call(null,map__24484__$1,new cljs.core.Keyword(null,"reload-dependents","reload-dependents",-956865430));
var map__24485 = p__24237;
var map__24485__$1 = ((((!((map__24485 == null)))?((((map__24485.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24485.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24485):map__24485);
var msg = map__24485__$1;
var files = cljs.core.get.call(null,map__24485__$1,new cljs.core.Keyword(null,"files","files",-472457450));
var figwheel_meta = cljs.core.get.call(null,map__24485__$1,new cljs.core.Keyword(null,"figwheel-meta","figwheel-meta",-225970237));
var recompile_dependents = cljs.core.get.call(null,map__24485__$1,new cljs.core.Keyword(null,"recompile-dependents","recompile-dependents",523804171));
if(cljs.core.empty_QMARK_.call(null,figwheel_meta)){
} else {
cljs.core.reset_BANG_.call(null,figwheel.client.file_reloading.figwheel_meta_pragmas,figwheel_meta);
}
var c__20950__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (){
var f__20951__auto__ = (function (){var switch__20838__auto__ = ((function (c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (state_24638){
var state_val_24639 = (state_24638[(1)]);
if((state_val_24639 === (7))){
var inst_24501 = (state_24638[(7)]);
var inst_24500 = (state_24638[(8)]);
var inst_24502 = (state_24638[(9)]);
var inst_24499 = (state_24638[(10)]);
var inst_24507 = cljs.core._nth.call(null,inst_24500,inst_24502);
var inst_24508 = figwheel.client.file_reloading.eval_body.call(null,inst_24507,opts);
var inst_24509 = (inst_24502 + (1));
var tmp24640 = inst_24501;
var tmp24641 = inst_24500;
var tmp24642 = inst_24499;
var inst_24499__$1 = tmp24642;
var inst_24500__$1 = tmp24641;
var inst_24501__$1 = tmp24640;
var inst_24502__$1 = inst_24509;
var state_24638__$1 = (function (){var statearr_24643 = state_24638;
(statearr_24643[(7)] = inst_24501__$1);
(statearr_24643[(8)] = inst_24500__$1);
(statearr_24643[(9)] = inst_24502__$1);
(statearr_24643[(11)] = inst_24508);
(statearr_24643[(10)] = inst_24499__$1);
return statearr_24643;
})();
var statearr_24644_24730 = state_24638__$1;
(statearr_24644_24730[(2)] = null);
(statearr_24644_24730[(1)] = (5));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (20))){
var inst_24542 = (state_24638[(12)]);
var inst_24550 = figwheel.client.file_reloading.sort_files.call(null,inst_24542);
var state_24638__$1 = state_24638;
var statearr_24645_24731 = state_24638__$1;
(statearr_24645_24731[(2)] = inst_24550);
(statearr_24645_24731[(1)] = (21));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (27))){
var state_24638__$1 = state_24638;
var statearr_24646_24732 = state_24638__$1;
(statearr_24646_24732[(2)] = null);
(statearr_24646_24732[(1)] = (28));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (1))){
var inst_24491 = (state_24638[(13)]);
var inst_24488 = before_jsload.call(null,files);
var inst_24489 = figwheel.client.file_reloading.before_jsload_custom_event.call(null,files);
var inst_24490 = (function (){return ((function (inst_24491,inst_24488,inst_24489,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p1__24233_SHARP_){
return new cljs.core.Keyword(null,"eval-body","eval-body",-907279883).cljs$core$IFn$_invoke$arity$1(p1__24233_SHARP_);
});
;})(inst_24491,inst_24488,inst_24489,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24491__$1 = cljs.core.filter.call(null,inst_24490,files);
var inst_24492 = cljs.core.not_empty.call(null,inst_24491__$1);
var state_24638__$1 = (function (){var statearr_24647 = state_24638;
(statearr_24647[(13)] = inst_24491__$1);
(statearr_24647[(14)] = inst_24489);
(statearr_24647[(15)] = inst_24488);
return statearr_24647;
})();
if(cljs.core.truth_(inst_24492)){
var statearr_24648_24733 = state_24638__$1;
(statearr_24648_24733[(1)] = (2));
} else {
var statearr_24649_24734 = state_24638__$1;
(statearr_24649_24734[(1)] = (3));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (24))){
var state_24638__$1 = state_24638;
var statearr_24650_24735 = state_24638__$1;
(statearr_24650_24735[(2)] = null);
(statearr_24650_24735[(1)] = (25));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (39))){
var inst_24592 = (state_24638[(16)]);
var state_24638__$1 = state_24638;
var statearr_24651_24736 = state_24638__$1;
(statearr_24651_24736[(2)] = inst_24592);
(statearr_24651_24736[(1)] = (40));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (46))){
var inst_24633 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24652_24737 = state_24638__$1;
(statearr_24652_24737[(2)] = inst_24633);
(statearr_24652_24737[(1)] = (31));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (4))){
var inst_24536 = (state_24638[(2)]);
var inst_24537 = cljs.core.List.EMPTY;
var inst_24538 = cljs.core.reset_BANG_.call(null,figwheel.client.file_reloading.dependencies_loaded,inst_24537);
var inst_24539 = (function (){return ((function (inst_24536,inst_24537,inst_24538,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p1__24234_SHARP_){
var and__16814__auto__ = new cljs.core.Keyword(null,"namespace","namespace",-377510372).cljs$core$IFn$_invoke$arity$1(p1__24234_SHARP_);
if(cljs.core.truth_(and__16814__auto__)){
return cljs.core.not.call(null,new cljs.core.Keyword(null,"eval-body","eval-body",-907279883).cljs$core$IFn$_invoke$arity$1(p1__24234_SHARP_));
} else {
return and__16814__auto__;
}
});
;})(inst_24536,inst_24537,inst_24538,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24540 = cljs.core.filter.call(null,inst_24539,files);
var inst_24541 = figwheel.client.file_reloading.get_figwheel_always.call(null);
var inst_24542 = cljs.core.concat.call(null,inst_24540,inst_24541);
var state_24638__$1 = (function (){var statearr_24653 = state_24638;
(statearr_24653[(17)] = inst_24536);
(statearr_24653[(18)] = inst_24538);
(statearr_24653[(12)] = inst_24542);
return statearr_24653;
})();
if(cljs.core.truth_(reload_dependents)){
var statearr_24654_24738 = state_24638__$1;
(statearr_24654_24738[(1)] = (16));
} else {
var statearr_24655_24739 = state_24638__$1;
(statearr_24655_24739[(1)] = (17));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (15))){
var inst_24526 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24656_24740 = state_24638__$1;
(statearr_24656_24740[(2)] = inst_24526);
(statearr_24656_24740[(1)] = (12));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (21))){
var inst_24552 = (state_24638[(19)]);
var inst_24552__$1 = (state_24638[(2)]);
var inst_24553 = figwheel.client.file_reloading.load_all_js_files.call(null,inst_24552__$1);
var state_24638__$1 = (function (){var statearr_24657 = state_24638;
(statearr_24657[(19)] = inst_24552__$1);
return statearr_24657;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_24638__$1,(22),inst_24553);
} else {
if((state_val_24639 === (31))){
var inst_24636 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_24638__$1,inst_24636);
} else {
if((state_val_24639 === (32))){
var inst_24592 = (state_24638[(16)]);
var inst_24597 = inst_24592.cljs$lang$protocol_mask$partition0$;
var inst_24598 = (inst_24597 & (64));
var inst_24599 = inst_24592.cljs$core$ISeq$;
var inst_24600 = (inst_24598) || (inst_24599);
var state_24638__$1 = state_24638;
if(cljs.core.truth_(inst_24600)){
var statearr_24658_24741 = state_24638__$1;
(statearr_24658_24741[(1)] = (35));
} else {
var statearr_24659_24742 = state_24638__$1;
(statearr_24659_24742[(1)] = (36));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (40))){
var inst_24613 = (state_24638[(20)]);
var inst_24612 = (state_24638[(2)]);
var inst_24613__$1 = cljs.core.get.call(null,inst_24612,new cljs.core.Keyword(null,"figwheel-no-load","figwheel-no-load",-555840179));
var inst_24614 = cljs.core.get.call(null,inst_24612,new cljs.core.Keyword(null,"not-required","not-required",-950359114));
var inst_24615 = cljs.core.not_empty.call(null,inst_24613__$1);
var state_24638__$1 = (function (){var statearr_24660 = state_24638;
(statearr_24660[(20)] = inst_24613__$1);
(statearr_24660[(21)] = inst_24614);
return statearr_24660;
})();
if(cljs.core.truth_(inst_24615)){
var statearr_24661_24743 = state_24638__$1;
(statearr_24661_24743[(1)] = (41));
} else {
var statearr_24662_24744 = state_24638__$1;
(statearr_24662_24744[(1)] = (42));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (33))){
var state_24638__$1 = state_24638;
var statearr_24663_24745 = state_24638__$1;
(statearr_24663_24745[(2)] = false);
(statearr_24663_24745[(1)] = (34));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (13))){
var inst_24512 = (state_24638[(22)]);
var inst_24516 = cljs.core.chunk_first.call(null,inst_24512);
var inst_24517 = cljs.core.chunk_rest.call(null,inst_24512);
var inst_24518 = cljs.core.count.call(null,inst_24516);
var inst_24499 = inst_24517;
var inst_24500 = inst_24516;
var inst_24501 = inst_24518;
var inst_24502 = (0);
var state_24638__$1 = (function (){var statearr_24664 = state_24638;
(statearr_24664[(7)] = inst_24501);
(statearr_24664[(8)] = inst_24500);
(statearr_24664[(9)] = inst_24502);
(statearr_24664[(10)] = inst_24499);
return statearr_24664;
})();
var statearr_24665_24746 = state_24638__$1;
(statearr_24665_24746[(2)] = null);
(statearr_24665_24746[(1)] = (5));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (22))){
var inst_24552 = (state_24638[(19)]);
var inst_24560 = (state_24638[(23)]);
var inst_24556 = (state_24638[(24)]);
var inst_24555 = (state_24638[(25)]);
var inst_24555__$1 = (state_24638[(2)]);
var inst_24556__$1 = cljs.core.filter.call(null,new cljs.core.Keyword(null,"loaded-file","loaded-file",-168399375),inst_24555__$1);
var inst_24557 = (function (){var all_files = inst_24552;
var res_SINGLEQUOTE_ = inst_24555__$1;
var res = inst_24556__$1;
return ((function (all_files,res_SINGLEQUOTE_,res,inst_24552,inst_24560,inst_24556,inst_24555,inst_24555__$1,inst_24556__$1,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p1__24235_SHARP_){
return cljs.core.not.call(null,new cljs.core.Keyword(null,"loaded-file","loaded-file",-168399375).cljs$core$IFn$_invoke$arity$1(p1__24235_SHARP_));
});
;})(all_files,res_SINGLEQUOTE_,res,inst_24552,inst_24560,inst_24556,inst_24555,inst_24555__$1,inst_24556__$1,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24558 = cljs.core.filter.call(null,inst_24557,inst_24555__$1);
var inst_24559 = cljs.core.deref.call(null,figwheel.client.file_reloading.dependencies_loaded);
var inst_24560__$1 = cljs.core.filter.call(null,new cljs.core.Keyword(null,"loaded-file","loaded-file",-168399375),inst_24559);
var inst_24561 = cljs.core.not_empty.call(null,inst_24560__$1);
var state_24638__$1 = (function (){var statearr_24666 = state_24638;
(statearr_24666[(26)] = inst_24558);
(statearr_24666[(23)] = inst_24560__$1);
(statearr_24666[(24)] = inst_24556__$1);
(statearr_24666[(25)] = inst_24555__$1);
return statearr_24666;
})();
if(cljs.core.truth_(inst_24561)){
var statearr_24667_24747 = state_24638__$1;
(statearr_24667_24747[(1)] = (23));
} else {
var statearr_24668_24748 = state_24638__$1;
(statearr_24668_24748[(1)] = (24));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (36))){
var state_24638__$1 = state_24638;
var statearr_24669_24749 = state_24638__$1;
(statearr_24669_24749[(2)] = false);
(statearr_24669_24749[(1)] = (37));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (41))){
var inst_24613 = (state_24638[(20)]);
var inst_24617 = cljs.core.comp.call(null,figwheel.client.file_reloading.name__GT_path,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
var inst_24618 = cljs.core.map.call(null,inst_24617,inst_24613);
var inst_24619 = cljs.core.pr_str.call(null,inst_24618);
var inst_24620 = [cljs.core.str("figwheel-no-load meta-data: "),cljs.core.str(inst_24619)].join('');
var inst_24621 = figwheel.client.utils.log.call(null,inst_24620);
var state_24638__$1 = state_24638;
var statearr_24670_24750 = state_24638__$1;
(statearr_24670_24750[(2)] = inst_24621);
(statearr_24670_24750[(1)] = (43));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (43))){
var inst_24614 = (state_24638[(21)]);
var inst_24624 = (state_24638[(2)]);
var inst_24625 = cljs.core.not_empty.call(null,inst_24614);
var state_24638__$1 = (function (){var statearr_24671 = state_24638;
(statearr_24671[(27)] = inst_24624);
return statearr_24671;
})();
if(cljs.core.truth_(inst_24625)){
var statearr_24672_24751 = state_24638__$1;
(statearr_24672_24751[(1)] = (44));
} else {
var statearr_24673_24752 = state_24638__$1;
(statearr_24673_24752[(1)] = (45));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (29))){
var inst_24552 = (state_24638[(19)]);
var inst_24558 = (state_24638[(26)]);
var inst_24592 = (state_24638[(16)]);
var inst_24560 = (state_24638[(23)]);
var inst_24556 = (state_24638[(24)]);
var inst_24555 = (state_24638[(25)]);
var inst_24588 = figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: NOT loading these files ");
var inst_24591 = (function (){var all_files = inst_24552;
var res_SINGLEQUOTE_ = inst_24555;
var res = inst_24556;
var files_not_loaded = inst_24558;
var dependencies_that_loaded = inst_24560;
return ((function (all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24592,inst_24560,inst_24556,inst_24555,inst_24588,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p__24590){
var map__24674 = p__24590;
var map__24674__$1 = ((((!((map__24674 == null)))?((((map__24674.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24674.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24674):map__24674);
var namespace = cljs.core.get.call(null,map__24674__$1,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
var meta_data = cljs.core.get.call(null,cljs.core.deref.call(null,figwheel.client.file_reloading.figwheel_meta_pragmas),cljs.core.name.call(null,namespace));
if((meta_data == null)){
return new cljs.core.Keyword(null,"not-required","not-required",-950359114);
} else {
if(cljs.core.truth_(meta_data.call(null,new cljs.core.Keyword(null,"figwheel-no-load","figwheel-no-load",-555840179)))){
return new cljs.core.Keyword(null,"figwheel-no-load","figwheel-no-load",-555840179);
} else {
return new cljs.core.Keyword(null,"not-required","not-required",-950359114);
}
}
});
;})(all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24592,inst_24560,inst_24556,inst_24555,inst_24588,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24592__$1 = cljs.core.group_by.call(null,inst_24591,inst_24558);
var inst_24594 = (inst_24592__$1 == null);
var inst_24595 = cljs.core.not.call(null,inst_24594);
var state_24638__$1 = (function (){var statearr_24676 = state_24638;
(statearr_24676[(16)] = inst_24592__$1);
(statearr_24676[(28)] = inst_24588);
return statearr_24676;
})();
if(inst_24595){
var statearr_24677_24753 = state_24638__$1;
(statearr_24677_24753[(1)] = (32));
} else {
var statearr_24678_24754 = state_24638__$1;
(statearr_24678_24754[(1)] = (33));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (44))){
var inst_24614 = (state_24638[(21)]);
var inst_24627 = cljs.core.map.call(null,new cljs.core.Keyword(null,"file","file",-1269645878),inst_24614);
var inst_24628 = cljs.core.pr_str.call(null,inst_24627);
var inst_24629 = [cljs.core.str("not required: "),cljs.core.str(inst_24628)].join('');
var inst_24630 = figwheel.client.utils.log.call(null,inst_24629);
var state_24638__$1 = state_24638;
var statearr_24679_24755 = state_24638__$1;
(statearr_24679_24755[(2)] = inst_24630);
(statearr_24679_24755[(1)] = (46));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (6))){
var inst_24533 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24680_24756 = state_24638__$1;
(statearr_24680_24756[(2)] = inst_24533);
(statearr_24680_24756[(1)] = (4));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (28))){
var inst_24558 = (state_24638[(26)]);
var inst_24585 = (state_24638[(2)]);
var inst_24586 = cljs.core.not_empty.call(null,inst_24558);
var state_24638__$1 = (function (){var statearr_24681 = state_24638;
(statearr_24681[(29)] = inst_24585);
return statearr_24681;
})();
if(cljs.core.truth_(inst_24586)){
var statearr_24682_24757 = state_24638__$1;
(statearr_24682_24757[(1)] = (29));
} else {
var statearr_24683_24758 = state_24638__$1;
(statearr_24683_24758[(1)] = (30));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (25))){
var inst_24556 = (state_24638[(24)]);
var inst_24572 = (state_24638[(2)]);
var inst_24573 = cljs.core.not_empty.call(null,inst_24556);
var state_24638__$1 = (function (){var statearr_24684 = state_24638;
(statearr_24684[(30)] = inst_24572);
return statearr_24684;
})();
if(cljs.core.truth_(inst_24573)){
var statearr_24685_24759 = state_24638__$1;
(statearr_24685_24759[(1)] = (26));
} else {
var statearr_24686_24760 = state_24638__$1;
(statearr_24686_24760[(1)] = (27));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (34))){
var inst_24607 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
if(cljs.core.truth_(inst_24607)){
var statearr_24687_24761 = state_24638__$1;
(statearr_24687_24761[(1)] = (38));
} else {
var statearr_24688_24762 = state_24638__$1;
(statearr_24688_24762[(1)] = (39));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (17))){
var state_24638__$1 = state_24638;
var statearr_24689_24763 = state_24638__$1;
(statearr_24689_24763[(2)] = recompile_dependents);
(statearr_24689_24763[(1)] = (18));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (3))){
var state_24638__$1 = state_24638;
var statearr_24690_24764 = state_24638__$1;
(statearr_24690_24764[(2)] = null);
(statearr_24690_24764[(1)] = (4));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (12))){
var inst_24529 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24691_24765 = state_24638__$1;
(statearr_24691_24765[(2)] = inst_24529);
(statearr_24691_24765[(1)] = (9));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (2))){
var inst_24491 = (state_24638[(13)]);
var inst_24498 = cljs.core.seq.call(null,inst_24491);
var inst_24499 = inst_24498;
var inst_24500 = null;
var inst_24501 = (0);
var inst_24502 = (0);
var state_24638__$1 = (function (){var statearr_24692 = state_24638;
(statearr_24692[(7)] = inst_24501);
(statearr_24692[(8)] = inst_24500);
(statearr_24692[(9)] = inst_24502);
(statearr_24692[(10)] = inst_24499);
return statearr_24692;
})();
var statearr_24693_24766 = state_24638__$1;
(statearr_24693_24766[(2)] = null);
(statearr_24693_24766[(1)] = (5));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (23))){
var inst_24552 = (state_24638[(19)]);
var inst_24558 = (state_24638[(26)]);
var inst_24560 = (state_24638[(23)]);
var inst_24556 = (state_24638[(24)]);
var inst_24555 = (state_24638[(25)]);
var inst_24563 = figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: loaded these dependencies");
var inst_24565 = (function (){var all_files = inst_24552;
var res_SINGLEQUOTE_ = inst_24555;
var res = inst_24556;
var files_not_loaded = inst_24558;
var dependencies_that_loaded = inst_24560;
return ((function (all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24563,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p__24564){
var map__24694 = p__24564;
var map__24694__$1 = ((((!((map__24694 == null)))?((((map__24694.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24694.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24694):map__24694);
var request_url = cljs.core.get.call(null,map__24694__$1,new cljs.core.Keyword(null,"request-url","request-url",2100346596));
return clojure.string.replace.call(null,request_url,goog.basePath,"");
});
;})(all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24563,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24566 = cljs.core.reverse.call(null,inst_24560);
var inst_24567 = cljs.core.map.call(null,inst_24565,inst_24566);
var inst_24568 = cljs.core.pr_str.call(null,inst_24567);
var inst_24569 = figwheel.client.utils.log.call(null,inst_24568);
var state_24638__$1 = (function (){var statearr_24696 = state_24638;
(statearr_24696[(31)] = inst_24563);
return statearr_24696;
})();
var statearr_24697_24767 = state_24638__$1;
(statearr_24697_24767[(2)] = inst_24569);
(statearr_24697_24767[(1)] = (25));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (35))){
var state_24638__$1 = state_24638;
var statearr_24698_24768 = state_24638__$1;
(statearr_24698_24768[(2)] = true);
(statearr_24698_24768[(1)] = (37));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (19))){
var inst_24542 = (state_24638[(12)]);
var inst_24548 = figwheel.client.file_reloading.expand_files.call(null,inst_24542);
var state_24638__$1 = state_24638;
var statearr_24699_24769 = state_24638__$1;
(statearr_24699_24769[(2)] = inst_24548);
(statearr_24699_24769[(1)] = (21));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (11))){
var state_24638__$1 = state_24638;
var statearr_24700_24770 = state_24638__$1;
(statearr_24700_24770[(2)] = null);
(statearr_24700_24770[(1)] = (12));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (9))){
var inst_24531 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24701_24771 = state_24638__$1;
(statearr_24701_24771[(2)] = inst_24531);
(statearr_24701_24771[(1)] = (6));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (5))){
var inst_24501 = (state_24638[(7)]);
var inst_24502 = (state_24638[(9)]);
var inst_24504 = (inst_24502 < inst_24501);
var inst_24505 = inst_24504;
var state_24638__$1 = state_24638;
if(cljs.core.truth_(inst_24505)){
var statearr_24702_24772 = state_24638__$1;
(statearr_24702_24772[(1)] = (7));
} else {
var statearr_24703_24773 = state_24638__$1;
(statearr_24703_24773[(1)] = (8));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (14))){
var inst_24512 = (state_24638[(22)]);
var inst_24521 = cljs.core.first.call(null,inst_24512);
var inst_24522 = figwheel.client.file_reloading.eval_body.call(null,inst_24521,opts);
var inst_24523 = cljs.core.next.call(null,inst_24512);
var inst_24499 = inst_24523;
var inst_24500 = null;
var inst_24501 = (0);
var inst_24502 = (0);
var state_24638__$1 = (function (){var statearr_24704 = state_24638;
(statearr_24704[(32)] = inst_24522);
(statearr_24704[(7)] = inst_24501);
(statearr_24704[(8)] = inst_24500);
(statearr_24704[(9)] = inst_24502);
(statearr_24704[(10)] = inst_24499);
return statearr_24704;
})();
var statearr_24705_24774 = state_24638__$1;
(statearr_24705_24774[(2)] = null);
(statearr_24705_24774[(1)] = (5));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (45))){
var state_24638__$1 = state_24638;
var statearr_24706_24775 = state_24638__$1;
(statearr_24706_24775[(2)] = null);
(statearr_24706_24775[(1)] = (46));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (26))){
var inst_24552 = (state_24638[(19)]);
var inst_24558 = (state_24638[(26)]);
var inst_24560 = (state_24638[(23)]);
var inst_24556 = (state_24638[(24)]);
var inst_24555 = (state_24638[(25)]);
var inst_24575 = figwheel.client.utils.log.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"Figwheel: loaded these files");
var inst_24577 = (function (){var all_files = inst_24552;
var res_SINGLEQUOTE_ = inst_24555;
var res = inst_24556;
var files_not_loaded = inst_24558;
var dependencies_that_loaded = inst_24560;
return ((function (all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24575,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (p__24576){
var map__24707 = p__24576;
var map__24707__$1 = ((((!((map__24707 == null)))?((((map__24707.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24707.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24707):map__24707);
var namespace = cljs.core.get.call(null,map__24707__$1,new cljs.core.Keyword(null,"namespace","namespace",-377510372));
var file = cljs.core.get.call(null,map__24707__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
if(cljs.core.truth_(namespace)){
return figwheel.client.file_reloading.name__GT_path.call(null,cljs.core.name.call(null,namespace));
} else {
return file;
}
});
;})(all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24575,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24578 = cljs.core.map.call(null,inst_24577,inst_24556);
var inst_24579 = cljs.core.pr_str.call(null,inst_24578);
var inst_24580 = figwheel.client.utils.log.call(null,inst_24579);
var inst_24581 = (function (){var all_files = inst_24552;
var res_SINGLEQUOTE_ = inst_24555;
var res = inst_24556;
var files_not_loaded = inst_24558;
var dependencies_that_loaded = inst_24560;
return ((function (all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24575,inst_24577,inst_24578,inst_24579,inst_24580,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function (){
figwheel.client.file_reloading.on_jsload_custom_event.call(null,res);
return cljs.core.apply.call(null,on_jsload,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [res], null));
});
;})(all_files,res_SINGLEQUOTE_,res,files_not_loaded,dependencies_that_loaded,inst_24552,inst_24558,inst_24560,inst_24556,inst_24555,inst_24575,inst_24577,inst_24578,inst_24579,inst_24580,state_val_24639,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var inst_24582 = setTimeout(inst_24581,(10));
var state_24638__$1 = (function (){var statearr_24709 = state_24638;
(statearr_24709[(33)] = inst_24575);
(statearr_24709[(34)] = inst_24580);
return statearr_24709;
})();
var statearr_24710_24776 = state_24638__$1;
(statearr_24710_24776[(2)] = inst_24582);
(statearr_24710_24776[(1)] = (28));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (16))){
var state_24638__$1 = state_24638;
var statearr_24711_24777 = state_24638__$1;
(statearr_24711_24777[(2)] = reload_dependents);
(statearr_24711_24777[(1)] = (18));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (38))){
var inst_24592 = (state_24638[(16)]);
var inst_24609 = cljs.core.apply.call(null,cljs.core.hash_map,inst_24592);
var state_24638__$1 = state_24638;
var statearr_24712_24778 = state_24638__$1;
(statearr_24712_24778[(2)] = inst_24609);
(statearr_24712_24778[(1)] = (40));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (30))){
var state_24638__$1 = state_24638;
var statearr_24713_24779 = state_24638__$1;
(statearr_24713_24779[(2)] = null);
(statearr_24713_24779[(1)] = (31));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (10))){
var inst_24512 = (state_24638[(22)]);
var inst_24514 = cljs.core.chunked_seq_QMARK_.call(null,inst_24512);
var state_24638__$1 = state_24638;
if(inst_24514){
var statearr_24714_24780 = state_24638__$1;
(statearr_24714_24780[(1)] = (13));
} else {
var statearr_24715_24781 = state_24638__$1;
(statearr_24715_24781[(1)] = (14));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (18))){
var inst_24546 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
if(cljs.core.truth_(inst_24546)){
var statearr_24716_24782 = state_24638__$1;
(statearr_24716_24782[(1)] = (19));
} else {
var statearr_24717_24783 = state_24638__$1;
(statearr_24717_24783[(1)] = (20));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (42))){
var state_24638__$1 = state_24638;
var statearr_24718_24784 = state_24638__$1;
(statearr_24718_24784[(2)] = null);
(statearr_24718_24784[(1)] = (43));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (37))){
var inst_24604 = (state_24638[(2)]);
var state_24638__$1 = state_24638;
var statearr_24719_24785 = state_24638__$1;
(statearr_24719_24785[(2)] = inst_24604);
(statearr_24719_24785[(1)] = (34));
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_24639 === (8))){
var inst_24512 = (state_24638[(22)]);
var inst_24499 = (state_24638[(10)]);
var inst_24512__$1 = cljs.core.seq.call(null,inst_24499);
var state_24638__$1 = (function (){var statearr_24720 = state_24638;
(statearr_24720[(22)] = inst_24512__$1);
return statearr_24720;
})();
if(inst_24512__$1){
var statearr_24721_24786 = state_24638__$1;
(statearr_24721_24786[(1)] = (10));
} else {
var statearr_24722_24787 = state_24638__$1;
(statearr_24722_24787[(1)] = (11));
}
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
;
return ((function (switch__20838__auto__,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents){
return (function() {
var figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__ = null;
var figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____0 = (function (){
var statearr_24726 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_24726[(0)] = figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__);
(statearr_24726[(1)] = (1));
return statearr_24726;
});
var figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____1 = (function (state_24638){
while(true){
var ret_value__20840__auto__ = (function (){try{while(true){
var result__20841__auto__ = switch__20838__auto__.call(null,state_24638);
if(cljs.core.keyword_identical_QMARK_.call(null,result__20841__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__20841__auto__;
}
break;
}
}catch (e24727){if((e24727 instanceof Object)){
var ex__20842__auto__ = e24727;
var statearr_24728_24788 = state_24638;
(statearr_24728_24788[(5)] = ex__20842__auto__);
cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_24638);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e24727;
}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__20840__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__24789 = state_24638;
state_24638 = G__24789;
continue;
} else {
return ret_value__20840__auto__;
}
break;
}
});
figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__ = function(state_24638){
switch(arguments.length){
case 0:
return figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____0.call(this);
case 1:
return figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____1.call(this,state_24638);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$0 = figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____0;
figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__.cljs$core$IFn$_invoke$arity$1 = figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto____1;
return figwheel$client$file_reloading$reload_js_files_$_state_machine__20839__auto__;
})()
;})(switch__20838__auto__,c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
})();
var state__20952__auto__ = (function (){var statearr_24729 = f__20951__auto__.call(null);
(statearr_24729[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__20950__auto__);
return statearr_24729;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__20952__auto__);
});})(c__20950__auto__,map__24484,map__24484__$1,opts,before_jsload,on_jsload,reload_dependents,map__24485,map__24485__$1,msg,files,figwheel_meta,recompile_dependents))
);
return c__20950__auto__;
});
figwheel.client.file_reloading.current_links = (function figwheel$client$file_reloading$current_links(){
return Array.prototype.slice.call(document.getElementsByTagName("link"));
});
figwheel.client.file_reloading.truncate_url = (function figwheel$client$file_reloading$truncate_url(url){
return clojure.string.replace_first.call(null,clojure.string.replace_first.call(null,clojure.string.replace_first.call(null,clojure.string.replace_first.call(null,cljs.core.first.call(null,clojure.string.split.call(null,url,/\?/)),[cljs.core.str(location.protocol),cljs.core.str("//")].join(''),""),".*://",""),/^\/\//,""),/[^\\/]*/,"");
});
figwheel.client.file_reloading.matches_file_QMARK_ = (function figwheel$client$file_reloading$matches_file_QMARK_(p__24792,link){
var map__24795 = p__24792;
var map__24795__$1 = ((((!((map__24795 == null)))?((((map__24795.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24795.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24795):map__24795);
var file = cljs.core.get.call(null,map__24795__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
var temp__4425__auto__ = link.href;
if(cljs.core.truth_(temp__4425__auto__)){
var link_href = temp__4425__auto__;
var match = clojure.string.join.call(null,"/",cljs.core.take_while.call(null,cljs.core.identity,cljs.core.map.call(null,((function (link_href,temp__4425__auto__,map__24795,map__24795__$1,file){
return (function (p1__24790_SHARP_,p2__24791_SHARP_){
if(cljs.core._EQ_.call(null,p1__24790_SHARP_,p2__24791_SHARP_)){
return p1__24790_SHARP_;
} else {
return false;
}
});})(link_href,temp__4425__auto__,map__24795,map__24795__$1,file))
,cljs.core.reverse.call(null,clojure.string.split.call(null,file,"/")),cljs.core.reverse.call(null,clojure.string.split.call(null,figwheel.client.file_reloading.truncate_url.call(null,link_href),"/")))));
var match_length = cljs.core.count.call(null,match);
var file_name_length = cljs.core.count.call(null,cljs.core.last.call(null,clojure.string.split.call(null,file,"/")));
if((match_length >= file_name_length)){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"link","link",-1769163468),link,new cljs.core.Keyword(null,"link-href","link-href",-250644450),link_href,new cljs.core.Keyword(null,"match-length","match-length",1101537310),match_length,new cljs.core.Keyword(null,"current-url-length","current-url-length",380404083),cljs.core.count.call(null,figwheel.client.file_reloading.truncate_url.call(null,link_href))], null);
} else {
return null;
}
} else {
return null;
}
});
figwheel.client.file_reloading.get_correct_link = (function figwheel$client$file_reloading$get_correct_link(f_data){
var temp__4425__auto__ = cljs.core.first.call(null,cljs.core.sort_by.call(null,(function (p__24801){
var map__24802 = p__24801;
var map__24802__$1 = ((((!((map__24802 == null)))?((((map__24802.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24802.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24802):map__24802);
var match_length = cljs.core.get.call(null,map__24802__$1,new cljs.core.Keyword(null,"match-length","match-length",1101537310));
var current_url_length = cljs.core.get.call(null,map__24802__$1,new cljs.core.Keyword(null,"current-url-length","current-url-length",380404083));
return (current_url_length - match_length);
}),cljs.core.keep.call(null,(function (p1__24797_SHARP_){
return figwheel.client.file_reloading.matches_file_QMARK_.call(null,f_data,p1__24797_SHARP_);
}),figwheel.client.file_reloading.current_links.call(null))));
if(cljs.core.truth_(temp__4425__auto__)){
var res = temp__4425__auto__;
return new cljs.core.Keyword(null,"link","link",-1769163468).cljs$core$IFn$_invoke$arity$1(res);
} else {
return null;
}
});
figwheel.client.file_reloading.clone_link = (function figwheel$client$file_reloading$clone_link(link,url){
var clone = document.createElement("link");
clone.rel = "stylesheet";
clone.media = link.media;
clone.disabled = link.disabled;
clone.href = figwheel.client.file_reloading.add_cache_buster.call(null,url);
return clone;
});
figwheel.client.file_reloading.create_link = (function figwheel$client$file_reloading$create_link(url){
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = figwheel.client.file_reloading.add_cache_buster.call(null,url);
return link;
});
figwheel.client.file_reloading.add_link_to_doc = (function figwheel$client$file_reloading$add_link_to_doc(var_args){
var args24804 = [];
var len__17884__auto___24807 = arguments.length;
var i__17885__auto___24808 = (0);
while(true){
if((i__17885__auto___24808 < len__17884__auto___24807)){
args24804.push((arguments[i__17885__auto___24808]));
var G__24809 = (i__17885__auto___24808 + (1));
i__17885__auto___24808 = G__24809;
continue;
} else {
}
break;
}
var G__24806 = args24804.length;
switch (G__24806) {
case 1:
return figwheel.client.file_reloading.add_link_to_doc.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return figwheel.client.file_reloading.add_link_to_doc.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
throw (new Error([cljs.core.str("Invalid arity: "),cljs.core.str(args24804.length)].join('')));
}
});
figwheel.client.file_reloading.add_link_to_doc.cljs$core$IFn$_invoke$arity$1 = (function (new_link){
return (document.getElementsByTagName("head")[(0)]).appendChild(new_link);
});
figwheel.client.file_reloading.add_link_to_doc.cljs$core$IFn$_invoke$arity$2 = (function (orig_link,klone){
var parent = orig_link.parentNode;
if(cljs.core._EQ_.call(null,orig_link,parent.lastChild)){
parent.appendChild(klone);
} else {
parent.insertBefore(klone,orig_link.nextSibling);
}
return setTimeout(((function (parent){
return (function (){
return parent.removeChild(orig_link);
});})(parent))
,(300));
});
figwheel.client.file_reloading.add_link_to_doc.cljs$lang$maxFixedArity = 2;
figwheel.client.file_reloading.distictify = (function figwheel$client$file_reloading$distictify(key,seqq){
return cljs.core.vals.call(null,cljs.core.reduce.call(null,(function (p1__24811_SHARP_,p2__24812_SHARP_){
return cljs.core.assoc.call(null,p1__24811_SHARP_,cljs.core.get.call(null,p2__24812_SHARP_,key),p2__24812_SHARP_);
}),cljs.core.PersistentArrayMap.EMPTY,seqq));
});
figwheel.client.file_reloading.reload_css_file = (function figwheel$client$file_reloading$reload_css_file(p__24813){
var map__24816 = p__24813;
var map__24816__$1 = ((((!((map__24816 == null)))?((((map__24816.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24816.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24816):map__24816);
var f_data = map__24816__$1;
var file = cljs.core.get.call(null,map__24816__$1,new cljs.core.Keyword(null,"file","file",-1269645878));
var temp__4425__auto__ = figwheel.client.file_reloading.get_correct_link.call(null,f_data);
if(cljs.core.truth_(temp__4425__auto__)){
var link = temp__4425__auto__;
return figwheel.client.file_reloading.add_link_to_doc.call(null,link,figwheel.client.file_reloading.clone_link.call(null,link,link.href));
} else {
return null;
}
});
figwheel.client.file_reloading.reload_css_files = (function figwheel$client$file_reloading$reload_css_files(p__24818,files_msg){
var map__24825 = p__24818;
var map__24825__$1 = ((((!((map__24825 == null)))?((((map__24825.cljs$lang$protocol_mask$partition0$ & (64))) || (map__24825.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__24825):map__24825);
var opts = map__24825__$1;
var on_cssload = cljs.core.get.call(null,map__24825__$1,new cljs.core.Keyword(null,"on-cssload","on-cssload",1825432318));
if(cljs.core.truth_(figwheel.client.utils.html_env_QMARK_.call(null))){
var seq__24827_24831 = cljs.core.seq.call(null,figwheel.client.file_reloading.distictify.call(null,new cljs.core.Keyword(null,"file","file",-1269645878),new cljs.core.Keyword(null,"files","files",-472457450).cljs$core$IFn$_invoke$arity$1(files_msg)));
var chunk__24828_24832 = null;
var count__24829_24833 = (0);
var i__24830_24834 = (0);
while(true){
if((i__24830_24834 < count__24829_24833)){
var f_24835 = cljs.core._nth.call(null,chunk__24828_24832,i__24830_24834);
figwheel.client.file_reloading.reload_css_file.call(null,f_24835);
var G__24836 = seq__24827_24831;
var G__24837 = chunk__24828_24832;
var G__24838 = count__24829_24833;
var G__24839 = (i__24830_24834 + (1));
seq__24827_24831 = G__24836;
chunk__24828_24832 = G__24837;
count__24829_24833 = G__24838;
i__24830_24834 = G__24839;
continue;
} else {
var temp__4425__auto___24840 = cljs.core.seq.call(null,seq__24827_24831);
if(temp__4425__auto___24840){
var seq__24827_24841__$1 = temp__4425__auto___24840;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__24827_24841__$1)){
var c__17629__auto___24842 = cljs.core.chunk_first.call(null,seq__24827_24841__$1);
var G__24843 = cljs.core.chunk_rest.call(null,seq__24827_24841__$1);
var G__24844 = c__17629__auto___24842;
var G__24845 = cljs.core.count.call(null,c__17629__auto___24842);
var G__24846 = (0);
seq__24827_24831 = G__24843;
chunk__24828_24832 = G__24844;
count__24829_24833 = G__24845;
i__24830_24834 = G__24846;
continue;
} else {
var f_24847 = cljs.core.first.call(null,seq__24827_24841__$1);
figwheel.client.file_reloading.reload_css_file.call(null,f_24847);
var G__24848 = cljs.core.next.call(null,seq__24827_24841__$1);
var G__24849 = null;
var G__24850 = (0);
var G__24851 = (0);
seq__24827_24831 = G__24848;
chunk__24828_24832 = G__24849;
count__24829_24833 = G__24850;
i__24830_24834 = G__24851;
continue;
}
} else {
}
}
break;
}
return setTimeout(((function (map__24825,map__24825__$1,opts,on_cssload){
return (function (){
return on_cssload.call(null,new cljs.core.Keyword(null,"files","files",-472457450).cljs$core$IFn$_invoke$arity$1(files_msg));
});})(map__24825,map__24825__$1,opts,on_cssload))
,(100));
} else {
return null;
}
});
//# sourceMappingURL=file_reloading.js.map?rel=1449036926031 | imaximix/om-tutorials | resources/public/js/compiled/out/figwheel/client/file_reloading.js | JavaScript | mit | 99,819 |
export default class State {
constructor($rootScope) {
this.$rootScope = $rootScope;
this.state = [];
}
setData(data) {
console.log('state set data', data)
this.state = data;
this.$rootScope.$apply();
}
getData() {
//console.log('state get data', state)
return this.state;
}
}
| vanzylv/youtube-dl-gui-v2 | scripts/services/downloadState.js | JavaScript | mit | 361 |
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 9 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 10 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 11 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 12 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 13 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
python tile_grab2.py -b "35.247;32.130;42.786;37.676" -z 14 -i false -d "syria_satellite" -u "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic3BhdGlhbG5ldHdvcmtzIiwiYSI6ImNpcW83Mm1kYjAxZ3hmbm5ub2llYnNuMmkifQ.an57h9ykokxNlGArcWQztw" -f jpg
| geobabbler/tile-grab | scrape2.sh | Shell | mit | 1,769 |
<?php
/**
* This file is part of the BootstrapBundle project.
*
* (c) 2013 Philipp Boes <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace P2\Bundle\BootstrapBundle\Form\Extension;
/**
* Class FormTypeExtension
* @package P2\Bundle\BootstrapBundle\Form\Extension
*/
class FormTypeExtension extends AbstractTypeExtension
{
/**
* {@inheritDoc}
*/
public function getExtendedType()
{
return 'form';
}
}
| phillies2k/bootstrap-bundle | Form/Extension/FormTypeExtension.php | PHP | mit | 558 |
---
layout: post
date: 2015-10-14
title: "Allure Quinceanera Dresses - Style Q400 2015 Sleeveless Floor-Length Ballgown"
category: Allure
tags: [Allure,Ballgown,Sweetheart,Floor-Length,Sleeveless,2015]
---
### Allure Quinceanera Dresses - Style Q400
Just **$266.99**
### 2015 Sleeveless Floor-Length Ballgown
<table><tr><td>BRANDS</td><td>Allure</td></tr><tr><td>Silhouette</td><td>Ballgown</td></tr><tr><td>Neckline</td><td>Sweetheart</td></tr><tr><td>Hemline/Train</td><td>Floor-Length</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr><tr><td>Years</td><td>2015</td></tr></table>
<a href="https://www.readybrides.com/en/allure/439-allure-quinceanera-dresses-style-q400.html"><img src="//img.readybrides.com/1554/allure-quinceanera-dresses-style-q400.jpg" alt="Allure Quinceanera Dresses - Style Q400" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/allure/439-allure-quinceanera-dresses-style-q400.html"><img src="//img.readybrides.com/1555/allure-quinceanera-dresses-style-q400.jpg" alt="Allure Quinceanera Dresses - Style Q400" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/allure/439-allure-quinceanera-dresses-style-q400.html"><img src="//img.readybrides.com/1553/allure-quinceanera-dresses-style-q400.jpg" alt="Allure Quinceanera Dresses - Style Q400" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/allure/439-allure-quinceanera-dresses-style-q400.html](https://www.readybrides.com/en/allure/439-allure-quinceanera-dresses-style-q400.html)
| HOLEIN/HOLEIN.github.io | _posts/2015-10-14-Allure-Quinceanera-Dresses-Style-Q400-2015-Sleeveless-FloorLength-Ballgown.md | Markdown | mit | 1,527 |
14 uid=311598
27 mtime=1430738623.672251
27 atime=1430738623.671251
| Pintulalmeena/Projects | Virtual Memory Implementation/Theme_B_9/GeekOS (os)/build/PaxHeader/Makefile | Makefile | mit | 68 |
var request = require('request');
var Client = (function () {
function Client() {
this.options = {
"url": "",
"method": "GET",
"bodyParams": {},
"gzip": true,
"json": true
};
}
Client.prototype.connect = function (parent) {
var config = parent.config;
this.configure(config);
this._connector = parent;
parent.logger.trace('Connected to google custom search');
};
Client.prototype.disconnect = function (parent) {
this.config = {};
this.url = '';
this._connector = parent;
parent.logger.trace('Disconnected from google custom search');
};
Client.prototype.configure = function (config) {
if (!config || !config.key)
throw new Error('Configuration is not set.');
this.key = config.key;
this.config = config;
if (config.cx)
this.cx = config.cx;
else if (config.cref)
this.cref = config.cref;
if (!this.cx && !this.cref)
throw new Error('You must provide either cx or cref parameter in your configuration!');
this.url = 'https://www.googleapis.com/customsearch/v1?key=' + this.key;
if (this.cx)
this.url += '&cx=' + this.cx;
else if (this.cref)
this.url += '&cref=' + this.cref;
this.baseUrl = this.url;
return true;
};
Client.prototype.setParameters = function (v) {
if (!v.where)
throw "You need to set a where clause and provide a query ('q') parameter";
if (typeof v.where === 'string' || v.where instanceof String)
v.where = JSON.parse(v.where);
if (!v.where.q) {
throw "You need to provide a query ('q') parameter in where clause.";
}
this._parseParameters(v);
this._creteQuery();
this.url = this.baseUrl + this._query;
return this;
};
Client.prototype.query = function (callback) {
this.options.url = this.url;
return request(this.options, callback);
};
Client.prototype.prepareResults = function (results, model) {
var tmp_results = [];
if (results && results.length) {
for (var i = 0; i < results.length; i++) {
var p_model = this._createIndividualModel(model, results[i]);
tmp_results.push(p_model);
}
}
return tmp_results;
};
Client.prototype._creteQuery = function () {
var params = this._params;
var i = 0;
for (var key in params) {
if (i === 0) {
this._query = '&' + key + '=' + params[key];
}
else {
this._query += '&' + key + '=' + params[key];
}
i++;
}
return this._query;
};
Client.prototype._parseParameters = function (v) {
if (!v.per_page)
v.where.num = 10;
else
v.where.num = v.per_page;
if (!v.skip)
v.where.start = 1;
else
v.where.start = v.skip;
if (v.limit)
v.where.num = v.limit - v.where.start;
if (v.page) {
v.where.start = ((v.page - 1) * v.per_page + 1);
}
if (v.order)
v.where.sort = v.order;
if (v.linkSite)
v.where.linkSite = v.linkSite;
if (v.lowRange)
v.where.lowRange = v.lowRange;
if (v.relatedSite)
v.where.relatedSite = v.relatedSite;
if (v.searchType)
v.where.searchType = v.searchType;
if (v.siteSearch)
v.where.siteSearch = v.siteSearch;
if (v.siteSearchFilter)
v.where.siteSearchFilter = v.siteSearchFilter;
this._params = v.where;
return true;
};
Client.prototype._createIndividualModel = function (Model, data) {
var model = Model.instance(data, true);
model.setPrimaryKey(data.cacheId);
return model;
};
return Client;
})();
exports.Client = Client;
//# sourceMappingURL=client.js.map | marinvvasilev/appc.googlesearch | lib/client.js | JavaScript | mit | 4,155 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.