text
stringlengths 2
100k
| meta
dict |
---|---|
#
# Author: Hari Sekhon
# Date: 2016-01-16 12:21:15 +0000 (Sat, 16 Jan 2016)
#
# vim:ts=4:sts=4:sw=4:noet
#
# https://github.com/harisekhon/Dockerfiles
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/harisekhon
#
REPO := harisekhon/nagios-plugin-kafka
include ../Makefile.in
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{26FF8D32-886E-426E-A5BA-8AA7D7F14DFA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PoorMansTSqlFormatterSSMSLib</RootNamespace>
<AssemblyName>PoorMansTSqlFormatterSSMSLib</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GeneralLanguageContent.Designer.cs">
<DependentUpon>GeneralLanguageContent.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="GenericVSHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<DependentUpon>Settings.settings</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PoorMansTSqlFormatterLib\PoorMansTSqlFormatterLib.csproj">
<Project>{adbdfdca-cab6-4569-9151-0bd42e65b400}</Project>
<Name>PoorMansTSqlFormatterLib</Name>
</ProjectReference>
<ProjectReference Include="..\PoorMansTSqlFormatterPluginShared\PoorMansTSqlFormatterPluginShared.csproj">
<Project>{4c350944-937b-4416-8442-3197fc7098f2}</Project>
<Name>PoorMansTSqlFormatterPluginShared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Key.snk" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="GeneralLanguageContent.es.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="GeneralLanguageContent.fr.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="GeneralLanguageContent.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>GeneralLanguageContent.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>FixedColumns example - Right column only</title>
<link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.css">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
<style type="text/css" class="init">
/* Ensure that the demo table scrolls */
th, td { white-space: nowrap; }
div.dataTables_wrapper {
width: 800px;
margin: 0 auto;
}
</style>
<script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
<script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
<script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable( {
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false
} );
new $.fn.dataTable.FixedColumns( table, {
leftColumns: 0,
rightColumns: 1
} );
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>FixedColumns example <span>Right column only</span></h1>
<div class="info">
<p>FixedColumns has the ability to freeze columns on both the left and right hand sides of the table. By default it will fix the first column on the left, but
using the initialisation parameters <code>leftColumns</code> and <code>rightColumns</code> you can alter this to fix the columns on the right as well. This example
shows a single column fixed in place, in this case the right most column.</p>
</div>
<table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
<thead>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>Extn.</th>
<th>E-mail</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger</td>
<td>Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
<td>5421</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Garrett</td>
<td>Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
<td>8422</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Ashton</td>
<td>Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
<td>1562</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Cedric</td>
<td>Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
<td>6224</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Airi</td>
<td>Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
<td>5407</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Brielle</td>
<td>Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
<td>4804</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Herrod</td>
<td>Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
<td>9608</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Rhona</td>
<td>Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
<td>6200</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Colleen</td>
<td>Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
<td>2360</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Sonya</td>
<td>Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
<td>1667</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jena</td>
<td>Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
<td>3814</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Quinn</td>
<td>Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
<td>9497</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Charde</td>
<td>Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
<td>6741</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Haley</td>
<td>Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
<td>3597</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Tatyana</td>
<td>Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
<td>1965</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Michael</td>
<td>Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
<td>1581</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Paul</td>
<td>Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
<td>3059</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Gloria</td>
<td>Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
<td>1721</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Bradley</td>
<td>Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
<td>2558</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Dai</td>
<td>Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
<td>2290</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jenette</td>
<td>Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
<td>1937</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Yuri</td>
<td>Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
<td>6154</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Caesar</td>
<td>Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
<td>8330</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Doris</td>
<td>Wilder</td>
<td>Sales Assistant</td>
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
<td>3023</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Angelica</td>
<td>Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
<td>5797</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Gavin</td>
<td>Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
<td>8822</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jennifer</td>
<td>Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
<td>9239</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Brenden</td>
<td>Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
<td>1314</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Fiona</td>
<td>Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
<td>2947</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Shou</td>
<td>Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
<td>8899</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Michelle</td>
<td>House</td>
<td>Integration Specialist</td>
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
<td>2769</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Suki</td>
<td>Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
<td>6832</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Prescott</td>
<td>Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
<td>3606</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Gavin</td>
<td>Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
<td>2860</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Martena</td>
<td>Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
<td>8240</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Unity</td>
<td>Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
<td>5384</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Howard</td>
<td>Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
<td>7031</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Hope</td>
<td>Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
<td>6318</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Vivian</td>
<td>Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
<td>9422</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Timothy</td>
<td>Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
<td>7580</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jackson</td>
<td>Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
<td>1042</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Olivia</td>
<td>Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
<td>2120</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Bruno</td>
<td>Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
<td>6222</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Sakura</td>
<td>Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
<td>9383</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Thor</td>
<td>Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
<td>8327</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Finn</td>
<td>Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
<td>2927</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Serge</td>
<td>Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
<td>8352</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Zenaida</td>
<td>Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
<td>7439</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Zorita</td>
<td>Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
<td>4389</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jennifer</td>
<td>Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
<td>3431</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Cara</td>
<td>Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
<td>3990</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Hermione</td>
<td>Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
<td>1016</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Lael</td>
<td>Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
<td>6733</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Jonas</td>
<td>Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
<td>8196</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Shad</td>
<td>Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
<td>6373</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Michael</td>
<td>Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
<td>5384</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Donna</td>
<td>Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
<td>4226</td>
<td>[email protected]</td>
</tr>
</tbody>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
var table = $('#example').DataTable( {
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false
} );
new $.fn.dataTable.FixedColumns( table, {
leftColumns: 0,
rightColumns: 1
} );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul>
<li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
<li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
<li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
</ul>
</div>
<div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
th, td { white-space: nowrap; }
div.dataTables_wrapper {
width: 800px;
margin: 0 auto;
}</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
<li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
</ul>
</div>
<div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
documentation</a>.</p>
</div>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Examples</a></h3>
<ul class="toc active">
<li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
<li><a href="./simple.html">Basic initialisation</a></li>
<li><a href="./two_columns.html">Multiple fixed columns</a></li>
<li class="active"><a href="./right_column.html">Right column only</a></li>
<li><a href="./rowspan.html">Complex headers</a></li>
<li><a href="./colvis.html">ColVis integration</a></li>
<li><a href="./server-side-processing.html">Server-side processing</a></li>
<li><a href="./css_size.html">CSS row sizing</a></li>
<li><a href="./size_fixed.html">Assigned column width</a></li>
<li><a href="./size_fluid.html">Fluid column width</a></li>
<li><a href="./col_filter.html">Individual column filtering</a></li>
<li><a href="./bootstrap.html">Bootstrap</a></li>
<li><a href="./index_column.html">Index column</a></li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a>
which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
# An Ensime-based Scala Language Server
This extension installs an Ensime-based Scala language server. At the moment, the following features are supported:
- errors as you type
- code completion
- goto definition (F12 and CMD-F12)
- hover
- file structure (definitions)
If you find this useful, please file tickets and contribute fixes. I'm working on this in my spare time and fix those issues that prevent me from using it, but I can't guarantee more than that.
If you can't contribute your time but would like to donate, please [donate to the Ensime project](http://ensime.org/sponsor/) instead. This plugin delegates to Ensime for most of its features.
# Setting up
> It only supports Scala 2.12 projects for the moment (it might work to some extent with 2.11 if you're not using macros)
tl;dr;
```
// add sbt-ensime to your build or in global.sbt
addSbtPlugin("org.ensime" % "sbt-ensime" % "2.5.1")
// then generate ensime configuration
sbt ensimeConfig
```
This extension is based on [Ensime](http://ensime.org), so you need to create an Ensime configuration file before you can use it. This file lists source directories, classpath entries and compiler arguments. If you have an Sbt project simply add the [sbt-ensime](http://ensime.org/build_tools/sbt/) plugin and follow the guide (other build tools are [supported](http://ensime.org/build_tools/)). Then just run `sbt ensimeConfig` and voilà! You're all set up.
>Remember to regenerate this file everytime you change your build (adding/removing dependencies, compiler arguments, etc.).
If you already started Code, it should detect that a new `.ensime` file was created and pick up the project.
# Setting the JDK
The path to the Java Development Kit is searched in the following order:
- the `JDK_HOME` environment variable
- the `JAVA_HOME` environment variable
- on the current system path
# Configuration
If VSCode is running behind a proxy add the following standard VSCode proxy settings (File -> Preferences -> Settings):
```
{
"http.proxy": "http://host:port/"
}
```
This setting is translated as Coursier's vm arguments: -Dhttp.proxyHost=host -Dhttps.proxyHost=host -Dhttp.proxyPort=port -Dhttps.proxyPort=port.
Language server setttings:
```
{
"scalaLanguageServer.logLevel" : "DEBUG"
"scalaLanguageServer.heapSize" : "768M"
}
```
These settings are passed to the Language Server affecting the log level on the server, with possible values "DEBUG", "ERROR", "INFO", "WARN". The heap size used by the Scala language server, for example `512m` or `4G`, can also be configured. By default it will use 768M, which is probably insufficient for larger projects.
|
{
"pile_set_name": "Github"
}
|
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// mkpost processes the output of cgo -godefs to
// modify the generated types. It is used to clean up
// the sys API in an architecture specific manner.
//
// mkpost is run after cgo -godefs; see README.md.
package main
import (
"bytes"
"fmt"
"go/format"
"io/ioutil"
"log"
"os"
"regexp"
)
func main() {
// Get the OS and architecture (using GOARCH_TARGET if it exists)
goos := os.Getenv("GOOS")
goarch := os.Getenv("GOARCH_TARGET")
if goarch == "" {
goarch = os.Getenv("GOARCH")
}
// Check that we are using the new build system if we should be.
if goos == "linux" && goarch != "sparc64" {
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n")
os.Stderr.WriteString("See README.md\n")
os.Exit(1)
}
}
b, err := ioutil.ReadAll(os.Stdin)
if err != nil {
log.Fatal(err)
}
// If we have empty Ptrace structs, we should delete them. Only s390x emits
// nonempty Ptrace structs.
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
b = ptraceRexexp.ReplaceAll(b, nil)
// Replace the control_regs union with a blank identifier for now.
controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
// Remove fields that are added by glibc
// Note that this is unstable as the identifers are private.
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
// We refuse to export private fields on s390x
if goarch == "s390x" && goos == "linux" {
// Remove cgo padding fields
removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
// Remove padding, hidden, or unused fields
removeFieldsRegex = regexp.MustCompile(`X_\S+`)
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
}
// Remove the first line of warning from cgo
b = b[bytes.IndexByte(b, '\n')+1:]
// Modify the command in the header to include:
// mkpost, our own warning, and a build tag.
replacement := fmt.Sprintf(`$1 | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build %s,%s`, goarch, goos)
cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
// gofmt
b, err = format.Source(b)
if err != nil {
log.Fatal(err)
}
os.Stdout.Write(b)
}
|
{
"pile_set_name": "Github"
}
|
package com.j256.ormlite;
import java.io.File;
import org.junit.Ignore;
import com.j256.ormlite.db.DatabaseType;
/**
* Set of test utilities for all of the unit tests.
*
* @author graywatson
*/
@Ignore("Test utilities and not tests")
public class TestUtils {
public static void deleteDirectory(File directory) {
if (!directory.exists()) {
return;
}
if (directory.isFile()) {
directory.delete();
return;
}
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
deleteDirectory(file);
}
file.delete();
}
}
public static String appendEscapedEntityName(DatabaseType databaseType, String word) {
StringBuilder sb = new StringBuilder();
databaseType.appendEscapedEntityName(sb, word);
return sb.toString();
}
public static String appendEscapedWord(DatabaseType databaseType, String word) {
StringBuilder sb = new StringBuilder();
databaseType.appendEscapedWord(sb, word);
return sb.toString();
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef RIBBONTOOLBARWRAPPER_H
#define RIBBONTOOLBARWRAPPER_H
#include "wxc_widget.h" // Base class: wxcWidget
class RibbonToolBarWrapper : public wxcWidget
{
public:
RibbonToolBarWrapper();
virtual ~RibbonToolBarWrapper();
public:
virtual wxcWidget* Clone() const;
virtual wxString CppCtorCode() const;
virtual void GetIncludeFile(wxArrayString& headers) const;
virtual wxString GetWxClassName() const;
virtual void ToXRC(wxString& text, XRC_TYPE type) const;
virtual wxString DoGenerateCppCtorCode_End() const;
virtual bool IsLicensed() const { return wxcSettings::Get().IsLicensed(); }
};
#endif // RIBBONTOOLBARWRAPPER_H
|
{
"pile_set_name": "Github"
}
|
//
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
#ifndef BOOST_GRAPH_DETAIL_MUTABLE_HEAP_H
#define BOOST_GRAPH_DETAIL_MUTABLE_HEAP_H
/*
There are a few things wrong with this set of functions.
ExternalData should be removed, it is not part of the core
algorithm. It can be handled inside the tree nodes.
The swap() should be replaced by assignment since its use is causing
the number of memory references to double.
The min_element should be replaced by a fixed length loop
(fixed at d for d-heaps).
The member functions of TreeNode should be changed to global
functions.
These functions will be replaced by those in heap_tree.h
*/
namespace boost {
template <class TreeNode, class Compare, class ExternalData>
inline TreeNode up_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
while (x.has_parent() && comp(x, x.parent()))
x.swap(x.parent(), edata);
return x;
}
template <class TreeNode, class Compare, class ExternalData>
inline TreeNode down_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
while (x.children().size() > 0) {
typename TreeNode::children_type::iterator
child_iter = std::min_element(x.children().begin(),
x.children().end(),
comp);
if (comp(*child_iter, x))
x.swap(*child_iter, edata);
else
break;
}
return x;
}
template <class TreeNode, class Compare, class ExternalData>
inline void update_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
x = down_heap(x, comp, edata);
(void)up_heap(x, comp, edata);
}
}
#endif
|
{
"pile_set_name": "Github"
}
|
// Copyright 2014 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package expfmt
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"math"
"strconv"
"strings"
"sync"
"github.com/prometheus/common/model"
dto "github.com/prometheus/client_model/go"
)
// enhancedWriter has all the enhanced write functions needed here. bufio.Writer
// implements it.
type enhancedWriter interface {
io.Writer
WriteRune(r rune) (n int, err error)
WriteString(s string) (n int, err error)
WriteByte(c byte) error
}
const (
initialNumBufSize = 24
)
var (
bufPool = sync.Pool{
New: func() interface{} {
return bufio.NewWriter(ioutil.Discard)
},
}
numBufPool = sync.Pool{
New: func() interface{} {
b := make([]byte, 0, initialNumBufSize)
return &b
},
}
)
// MetricFamilyToText converts a MetricFamily proto message into text format and
// writes the resulting lines to 'out'. It returns the number of bytes written
// and any error encountered. The output will have the same order as the input,
// no further sorting is performed. Furthermore, this function assumes the input
// is already sanitized and does not perform any sanity checks. If the input
// contains duplicate metrics or invalid metric or label names, the conversion
// will result in invalid text format output.
//
// This method fulfills the type 'prometheus.encoder'.
func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err error) {
// Fail-fast checks.
if len(in.Metric) == 0 {
return 0, fmt.Errorf("MetricFamily has no metrics: %s", in)
}
name := in.GetName()
if name == "" {
return 0, fmt.Errorf("MetricFamily has no name: %s", in)
}
// Try the interface upgrade. If it doesn't work, we'll use a
// bufio.Writer from the sync.Pool.
w, ok := out.(enhancedWriter)
if !ok {
b := bufPool.Get().(*bufio.Writer)
b.Reset(out)
w = b
defer func() {
bErr := b.Flush()
if err == nil {
err = bErr
}
bufPool.Put(b)
}()
}
var n int
// Comments, first HELP, then TYPE.
if in.Help != nil {
n, err = w.WriteString("# HELP ")
written += n
if err != nil {
return
}
n, err = w.WriteString(name)
written += n
if err != nil {
return
}
err = w.WriteByte(' ')
written++
if err != nil {
return
}
n, err = writeEscapedString(w, *in.Help, false)
written += n
if err != nil {
return
}
err = w.WriteByte('\n')
written++
if err != nil {
return
}
}
n, err = w.WriteString("# TYPE ")
written += n
if err != nil {
return
}
n, err = w.WriteString(name)
written += n
if err != nil {
return
}
metricType := in.GetType()
switch metricType {
case dto.MetricType_COUNTER:
n, err = w.WriteString(" counter\n")
case dto.MetricType_GAUGE:
n, err = w.WriteString(" gauge\n")
case dto.MetricType_SUMMARY:
n, err = w.WriteString(" summary\n")
case dto.MetricType_UNTYPED:
n, err = w.WriteString(" untyped\n")
case dto.MetricType_HISTOGRAM:
n, err = w.WriteString(" histogram\n")
default:
return written, fmt.Errorf("unknown metric type %s", metricType.String())
}
written += n
if err != nil {
return
}
// Finally the samples, one line for each.
for _, metric := range in.Metric {
switch metricType {
case dto.MetricType_COUNTER:
if metric.Counter == nil {
return written, fmt.Errorf(
"expected counter in metric %s %s", name, metric,
)
}
n, err = writeSample(
w, name, "", metric, "", 0,
metric.Counter.GetValue(),
)
case dto.MetricType_GAUGE:
if metric.Gauge == nil {
return written, fmt.Errorf(
"expected gauge in metric %s %s", name, metric,
)
}
n, err = writeSample(
w, name, "", metric, "", 0,
metric.Gauge.GetValue(),
)
case dto.MetricType_UNTYPED:
if metric.Untyped == nil {
return written, fmt.Errorf(
"expected untyped in metric %s %s", name, metric,
)
}
n, err = writeSample(
w, name, "", metric, "", 0,
metric.Untyped.GetValue(),
)
case dto.MetricType_SUMMARY:
if metric.Summary == nil {
return written, fmt.Errorf(
"expected summary in metric %s %s", name, metric,
)
}
for _, q := range metric.Summary.Quantile {
n, err = writeSample(
w, name, "", metric,
model.QuantileLabel, q.GetQuantile(),
q.GetValue(),
)
written += n
if err != nil {
return
}
}
n, err = writeSample(
w, name, "_sum", metric, "", 0,
metric.Summary.GetSampleSum(),
)
written += n
if err != nil {
return
}
n, err = writeSample(
w, name, "_count", metric, "", 0,
float64(metric.Summary.GetSampleCount()),
)
case dto.MetricType_HISTOGRAM:
if metric.Histogram == nil {
return written, fmt.Errorf(
"expected histogram in metric %s %s", name, metric,
)
}
infSeen := false
for _, b := range metric.Histogram.Bucket {
n, err = writeSample(
w, name, "_bucket", metric,
model.BucketLabel, b.GetUpperBound(),
float64(b.GetCumulativeCount()),
)
written += n
if err != nil {
return
}
if math.IsInf(b.GetUpperBound(), +1) {
infSeen = true
}
}
if !infSeen {
n, err = writeSample(
w, name, "_bucket", metric,
model.BucketLabel, math.Inf(+1),
float64(metric.Histogram.GetSampleCount()),
)
written += n
if err != nil {
return
}
}
n, err = writeSample(
w, name, "_sum", metric, "", 0,
metric.Histogram.GetSampleSum(),
)
written += n
if err != nil {
return
}
n, err = writeSample(
w, name, "_count", metric, "", 0,
float64(metric.Histogram.GetSampleCount()),
)
default:
return written, fmt.Errorf(
"unexpected type in metric %s %s", name, metric,
)
}
written += n
if err != nil {
return
}
}
return
}
// writeSample writes a single sample in text format to w, given the metric
// name, the metric proto message itself, optionally an additional label name
// with a float64 value (use empty string as label name if not required), and
// the value. The function returns the number of bytes written and any error
// encountered.
func writeSample(
w enhancedWriter,
name, suffix string,
metric *dto.Metric,
additionalLabelName string, additionalLabelValue float64,
value float64,
) (int, error) {
var written int
n, err := w.WriteString(name)
written += n
if err != nil {
return written, err
}
if suffix != "" {
n, err = w.WriteString(suffix)
written += n
if err != nil {
return written, err
}
}
n, err = writeLabelPairs(
w, metric.Label, additionalLabelName, additionalLabelValue,
)
written += n
if err != nil {
return written, err
}
err = w.WriteByte(' ')
written++
if err != nil {
return written, err
}
n, err = writeFloat(w, value)
written += n
if err != nil {
return written, err
}
if metric.TimestampMs != nil {
err = w.WriteByte(' ')
written++
if err != nil {
return written, err
}
n, err = writeInt(w, *metric.TimestampMs)
written += n
if err != nil {
return written, err
}
}
err = w.WriteByte('\n')
written++
if err != nil {
return written, err
}
return written, nil
}
// writeLabelPairs converts a slice of LabelPair proto messages plus the
// explicitly given additional label pair into text formatted as required by the
// text format and writes it to 'w'. An empty slice in combination with an empty
// string 'additionalLabelName' results in nothing being written. Otherwise, the
// label pairs are written, escaped as required by the text format, and enclosed
// in '{...}'. The function returns the number of bytes written and any error
// encountered.
func writeLabelPairs(
w enhancedWriter,
in []*dto.LabelPair,
additionalLabelName string, additionalLabelValue float64,
) (int, error) {
if len(in) == 0 && additionalLabelName == "" {
return 0, nil
}
var (
written int
separator byte = '{'
)
for _, lp := range in {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
n, err := w.WriteString(lp.GetName())
written += n
if err != nil {
return written, err
}
n, err = w.WriteString(`="`)
written += n
if err != nil {
return written, err
}
n, err = writeEscapedString(w, lp.GetValue(), true)
written += n
if err != nil {
return written, err
}
err = w.WriteByte('"')
written++
if err != nil {
return written, err
}
separator = ','
}
if additionalLabelName != "" {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
n, err := w.WriteString(additionalLabelName)
written += n
if err != nil {
return written, err
}
n, err = w.WriteString(`="`)
written += n
if err != nil {
return written, err
}
n, err = writeFloat(w, additionalLabelValue)
written += n
if err != nil {
return written, err
}
err = w.WriteByte('"')
written++
if err != nil {
return written, err
}
}
err := w.WriteByte('}')
written++
if err != nil {
return written, err
}
return written, nil
}
// writeEscapedString replaces '\' by '\\', new line character by '\n', and - if
// includeDoubleQuote is true - '"' by '\"'.
var (
escaper = strings.NewReplacer("\\", `\\`, "\n", `\n`)
quotedEscaper = strings.NewReplacer("\\", `\\`, "\n", `\n`, "\"", `\"`)
)
func writeEscapedString(w enhancedWriter, v string, includeDoubleQuote bool) (int, error) {
if includeDoubleQuote {
return quotedEscaper.WriteString(w, v)
}
return escaper.WriteString(w, v)
}
// writeFloat is equivalent to fmt.Fprint with a float64 argument but hardcodes
// a few common cases for increased efficiency. For non-hardcoded cases, it uses
// strconv.AppendFloat to avoid allocations, similar to writeInt.
func writeFloat(w enhancedWriter, f float64) (int, error) {
switch {
case f == 1:
return 1, w.WriteByte('1')
case f == 0:
return 1, w.WriteByte('0')
case f == -1:
return w.WriteString("-1")
case math.IsNaN(f):
return w.WriteString("NaN")
case math.IsInf(f, +1):
return w.WriteString("+Inf")
case math.IsInf(f, -1):
return w.WriteString("-Inf")
default:
bp := numBufPool.Get().(*[]byte)
*bp = strconv.AppendFloat((*bp)[:0], f, 'g', -1, 64)
written, err := w.Write(*bp)
numBufPool.Put(bp)
return written, err
}
}
// writeInt is equivalent to fmt.Fprint with an int64 argument but uses
// strconv.AppendInt with a byte slice taken from a sync.Pool to avoid
// allocations.
func writeInt(w enhancedWriter, i int64) (int, error) {
bp := numBufPool.Get().(*[]byte)
*bp = strconv.AppendInt((*bp)[:0], i, 10)
written, err := w.Write(*bp)
numBufPool.Put(bp)
return written, err
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>freeverb</class>
<widget class="QWidget" name="freeverb">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>512</width>
<height>205</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>200</height>
</size>
</property>
<property name="windowTitle">
<string>Tap-Reverberator</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Decay [ms]</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="MusEGui::DoubleLabel" name="P0label" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frame" stdset="0">
<bool>true</bool>
</property>
<property name="id" stdset="0">
<number>0</number>
</property>
<property name="value" stdset="0">
<number>0</number>
</property>
<property name="minValue" stdset="0">
<number>0</number>
</property>
<property name="maxValue" stdset="0">
<number>10000</number>
</property>
<property name="precision" stdset="0">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="MusEGui::DoubleLabel" name="P1label" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frame" stdset="0">
<bool>true</bool>
</property>
<property name="id" stdset="0">
<number>1</number>
</property>
<property name="value" stdset="0">
<number>0</number>
</property>
<property name="offValue" stdset="0">
<number>-70</number>
</property>
<property name="minValue" stdset="0">
<number>-70</number>
</property>
<property name="maxValue" stdset="0">
<number>10</number>
</property>
<property name="suffix" stdset="0">
<string>dB</string>
</property>
<property name="precision" stdset="0">
<number>2</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel2">
<property name="text">
<string>Dry Level [dB]</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="MusEGui::DoubleLabel" name="P2label" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frame" stdset="0">
<bool>true</bool>
</property>
<property name="id" stdset="0">
<number>2</number>
</property>
<property name="value" stdset="0">
<number>0</number>
</property>
<property name="offValue" stdset="0">
<number>-70</number>
</property>
<property name="minValue" stdset="0">
<number>-70</number>
</property>
<property name="maxValue" stdset="0">
<number>10</number>
</property>
<property name="suffix" stdset="0">
<string>dB</string>
</property>
<property name="precision" stdset="0">
<number>2</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>Wet Level [dB]</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="MusEGui::Slider" name="P1Slider" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="id" stdset="0">
<number>1</number>
</property>
<property name="minValue" stdset="0">
<number>-70</number>
</property>
<property name="maxValue" stdset="0">
<number>10</number>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="MusEGui::Slider" name="P2Slider" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="id" stdset="0">
<number>2</number>
</property>
<property name="minValue" stdset="0">
<number>-70</number>
</property>
<property name="maxValue" stdset="0">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="MusEGui::Slider" name="P0Slider" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="id" stdset="0">
<number>0</number>
</property>
<property name="maxValue" stdset="0">
<number>10000</number>
</property>
</widget>
</item>
<item row="4" column="2" rowspan="2">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel1_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Preset:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="3" rowspan="2">
<widget class="QComboBox" name="P7presetCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>AfterBurn</string>
</property>
</item>
<item>
<property name="text">
<string>AfterBurn (Long)</string>
</property>
</item>
<item>
<property name="text">
<string>Ambience</string>
</property>
</item>
<item>
<property name="text">
<string>Ambience (Thick)</string>
</property>
</item>
<item>
<property name="text">
<string>Ambience (Thick) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Cathedral</string>
</property>
</item>
<item>
<property name="text">
<string>Cathedral - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Drum Chamber</string>
</property>
</item>
<item>
<property name="text">
<string>Garage</string>
</property>
</item>
<item>
<property name="text">
<string>Garage (Bright)</string>
</property>
</item>
<item>
<property name="text">
<string>Gymnasium</string>
</property>
</item>
<item>
<property name="text">
<string>Gymnasium (Bright)</string>
</property>
</item>
<item>
<property name="text">
<string>Gymnasium (Bright) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Hall (Small)</string>
</property>
</item>
<item>
<property name="text">
<string>Hall (Medium)</string>
</property>
</item>
<item>
<property name="text">
<string>Hall (Large)</string>
</property>
</item>
<item>
<property name="text">
<string>Hall (Large) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Plate (Small)</string>
</property>
</item>
<item>
<property name="text">
<string>Plate (Medium)</string>
</property>
</item>
<item>
<property name="text">
<string>Plate (Large)</string>
</property>
</item>
<item>
<property name="text">
<string>Plate (Large) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Pulse Chamber</string>
</property>
</item>
<item>
<property name="text">
<string>Pulse Chamber (Reverse)</string>
</property>
</item>
<item>
<property name="text">
<string>Resonator (96 ms)</string>
</property>
</item>
<item>
<property name="text">
<string>Resonator (152 ms)</string>
</property>
</item>
<item>
<property name="text">
<string>Resonator (208 ms)</string>
</property>
</item>
<item>
<property name="text">
<string>Room (Small)</string>
</property>
</item>
<item>
<property name="text">
<string>Room (Medium)</string>
</property>
</item>
<item>
<property name="text">
<string>Room (Large)</string>
</property>
</item>
<item>
<property name="text">
<string>Room (Large) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Slap Chamber</string>
</property>
</item>
<item>
<property name="text">
<string>Slap Chamber - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Slap Chamber (Bright)</string>
</property>
</item>
<item>
<property name="text">
<string>Slap Chamber (Bright) HD</string>
</property>
</item>
<item>
<property name="text">
<string>Smooth Hall (Small)</string>
</property>
</item>
<item>
<property name="text">
<string>Smooth Hall (Medium)</string>
</property>
</item>
<item>
<property name="text">
<string>Smooth Hall (Large)</string>
</property>
</item>
<item>
<property name="text">
<string>Smooth Hall (Large) - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Vocal Plate</string>
</property>
</item>
<item>
<property name="text">
<string>Vocal Plate - HD</string>
</property>
</item>
<item>
<property name="text">
<string>Warble Chamber</string>
</property>
</item>
<item>
<property name="text">
<string>Warehoouse</string>
</property>
</item>
<item>
<property name="text">
<string>Warehouse - HD</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="P3checkbox">
<property name="text">
<string>Comb Filters</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="P4checkbox">
<property name="text">
<string>Allpass Filters</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="P5checkbox">
<property name="text">
<string>Bandpass Filters</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QCheckBox" name="P6checkBox">
<property name="text">
<string>Enhanced Stereo</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>MusEGui::DoubleLabel</class>
<extends>QWidget</extends>
<header>doublelabel.h</header>
</customwidget>
<customwidget>
<class>MusEGui::Slider</class>
<extends>QWidget</extends>
<header>slider.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
|
{
"pile_set_name": "Github"
}
|
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import css from "../css/app.css"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import dependencies
//
import "phoenix_html"
// Import local files
//
// Local files can be imported directly using relative paths, for example:
// import socket from "./socket"
|
{
"pile_set_name": "Github"
}
|
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// 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.
///
/// @ref gtc_type_ptr
/// @file glm/gtc/type_ptr.hpp
/// @date 2009-05-06 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
/// @see gtc_quaternion (dependence)
///
/// @defgroup gtc_type_ptr GLM_GTC_type_ptr
/// @ingroup gtc
///
/// @brief Handles the interaction between pointers and vector, matrix types.
///
/// This extension defines an overloaded function, glm::value_ptr, which
/// takes any of the \ref core_template "core template types". It returns
/// a pointer to the memory layout of the object. Matrix types store their values
/// in column-major order.
///
/// This is useful for uploading data to matrices or copying data to buffer objects.
///
/// Example:
/// @code
/// #include <glm/glm.hpp>
/// #include <glm/gtc/type_ptr.hpp>
///
/// glm::vec3 aVector(3);
/// glm::mat4 someMatrix(1.0);
///
/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector));
/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix));
/// @endcode
///
/// <glm/gtc/type_ptr.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_GTC_type_ptr
#define GLM_GTC_type_ptr GLM_VERSION
// Dependency:
#include "../glm.hpp"
#include "../gtc/half_float.hpp"
#include "../gtc/quaternion.hpp"
#include <cstring>
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTC_type_ptr extension included")
#endif
namespace glm
{
/// @addtogroup gtc_type_ptr
/// @{
/// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename genType>
typename genType::value_type const * value_ptr(genType const & vec);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec2<T> make_vec2(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec3<T> make_vec3(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec4<T> make_vec4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x2<T> make_mat2x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x3<T> make_mat2x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x4<T> make_mat2x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x2<T> make_mat3x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x3<T> make_mat3x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x4<T> make_mat3x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x2<T> make_mat4x2(
T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x3<T> make_mat4x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x4<T> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x2<T> make_mat2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x3<T> make_mat3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x4<T> make_mat4(T const * const ptr);
/// Build a quaternion from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tquat<T> make_quat(T const * const ptr);
/// @}
}//namespace glm
#include "type_ptr.inl"
#endif//GLM_GTC_type_ptr
|
{
"pile_set_name": "Github"
}
|
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
import org.libreoffice.unotest
import pathlib
def get_url_for_data_file(file_name):
return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
#Bug 118207 - CRASH: Cutting and pasting a conditional format column and undoing
class tdf118207(UITestCase):
def test_tdf118207(self):
calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf118189.xlsx"))
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
#Make sure that tools-options-LibreOffice Calc-General-Input settings-Show overwrite warning when pasting data is NOT tagged.
self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
xDialogOpt = self.xUITest.getTopFocusWindow()
xPages = xDialogOpt.getChild("pages")
xCalcEntry = xPages.getChild('3') # Calc
xCalcEntry.executeAction("EXPAND", tuple())
xCalcGeneralEntry = xCalcEntry.getChild('0')
xCalcGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
xreplwarncb = xDialogOpt.getChild("replwarncb")
if (get_state_as_dict(xreplwarncb)["Selected"]) == "true":
xreplwarncb.executeAction("CLICK", tuple())
xOKBtn = xDialogOpt.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
#Select Column A
#Cut it
gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
self.xUITest.executeCommand(".uno:SelectColumn")
self.xUITest.executeCommand(".uno:Cut")
#Paste it in Column B , Paste it in Column B again
gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
self.xUITest.executeCommand(".uno:Paste")
self.xUITest.executeCommand(".uno:Paste")
#Undo 3 times
self.xUITest.executeCommand(".uno:Undo")
self.xUITest.executeCommand(".uno:Undo")
self.xUITest.executeCommand(".uno:Undo")
#-> CRASH
self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "On Back Order")
#verify
self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
{
"pile_set_name": "Github"
}
|
/* ____ ______________ ________________________ __________
* \ \/ / \ \/ / __/ / \ \/ / \
* \______/___/\___\______/___/_____/___/\___\______/___/\___\
*
* Copyright 2020 Vavr, http://vavr.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.vavr.collection;
import io.vavr.control.Option;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.function.BiFunction;
/**
* Interface of foldable data structures.
* <p>
* <strong>Example:</strong>
*
* <pre><code>
* // = "123"
* Stream.of("1", "2", "3").fold("", (a1, a2) -> a1 + a2);
* </code></pre>
*
* @param <T> Component type of this foldable
* @deprecated Marked for removal. Methods moved to io.vavr.collection.Traverable.
*/
@Deprecated
public interface Foldable<T> {
/**
* Folds this elements using the given associative binary operator, starting with {@code zero} and
* successively calling {@code combine}. The order in which the elements are combined is
* non-deterministic.
* <p>
* The methods {@code fold}, {@code foldLeft} and {@code foldRight} differ in how the elements are combined:
*
* <ul>
* <li>{@link #foldLeft(Object, BiFunction)} associates to the left</li>
* <li>{@link #foldRight(Object, BiFunction)} associates to the right</li>
* <li>
* {@code fold} takes an associative combine operation because the traversal of elements is
* unordered/non-deterministic. The associativity guarantees that in each case the result will
* be the same, it does not matter in which order the elements are combined. Generally binary
* operators aren't associative, i.e. the result may differ if elements are combined in a different
* order.
* <p>
* We say that this Foldable and the associative combine operation form a
* <a href="https://en.wikipedia.org/wiki/Monoid" target="_blank">Monoid</a>.
* </li>
* </ul>
*
* Example:
*
* <pre> {@code
* // = 6
* Set(1, 2, 3).fold(0, (a, b) -> a + b);
* } </pre>
*
* @param zero A zero element to start with.
* @param combine A function which combines elements.
* @return a folded value
* @throws NullPointerException if {@code combine} is null
*/
default T fold(T zero, BiFunction<? super T, ? super T, ? extends T> combine) {
Objects.requireNonNull(combine, "combine is null");
return foldLeft(zero, combine);
}
/**
* Folds this elements from the left, starting with {@code zero} and successively calling {@code combine}.
* <p>
* Example:
*
* <pre> {@code
* // = "cba!"
* List("a", "b", "c").foldLeft("!", (xs, x) -> x + xs)
* } </pre>
*
* @param <U> the type to fold over
* @param zero A zero element to start with.
* @param combine A function which combines elements.
* @return a folded value
* @throws NullPointerException if {@code combine} is null
*/
<U> U foldLeft(U zero, BiFunction<? super U, ? super T, ? extends U> combine);
/**
* Folds this elements from the right, starting with {@code zero} and successively calling {@code combine}.
* <p>
* Example:
*
* <pre> {@code
* // = "!cba"
* List("a", "b", "c").foldRight("!", (x, xs) -> xs + x)
* } </pre>
*
* @param <U> the type of the folded value
* @param zero A zero element to start with.
* @param combine A function which combines elements.
* @return a folded value
* @throws NullPointerException if {@code combine} is null
*/
<U> U foldRight(U zero, BiFunction<? super T, ? super U, ? extends U> combine);
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op}.
* The order of element iteration is undetermined.
*
* @param op A BiFunction of type T
* @return the reduced value.
* @throws NoSuchElementException if this is empty
* @throws NullPointerException if {@code op} is null
*/
default T reduce(BiFunction<? super T, ? super T, ? extends T> op) {
Objects.requireNonNull(op, "op is null");
return reduceLeft(op);
}
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op}.
* The order of element iteration is undetermined.
*
* @param op A BiFunction of type T
* @return Some of reduced value or None if the Foldable is empty.
* @throws NullPointerException if {@code op} is null
*/
default Option<T> reduceOption(BiFunction<? super T, ? super T, ? extends T> op) {
Objects.requireNonNull(op, "op is null");
return reduceLeftOption(op);
}
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op} from the left.
*
* @param op A BiFunction of type T
* @return the reduced value.
* @throws NoSuchElementException if this is empty
* @throws NullPointerException if {@code op} is null
*/
T reduceLeft(BiFunction<? super T, ? super T, ? extends T> op);
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op} from the left.
*
* @param op A BiFunction of type T
* @return Some of reduced value or None if the Foldable is empty.
* @throws NullPointerException if {@code op} is null
*/
Option<T> reduceLeftOption(BiFunction<? super T, ? super T, ? extends T> op);
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op} from the right.
*
* @param op An operation of type T
* @return the reduced value.
* @throws NoSuchElementException if this is empty
* @throws NullPointerException if {@code op} is null
*/
T reduceRight(BiFunction<? super T, ? super T, ? extends T> op);
/**
* Accumulates the elements of this Foldable by successively calling the given operation {@code op} from the right.
*
* @param op An operation of type T
* @return Some of reduced value or None.
* @throws NullPointerException if {@code op} is null
*/
Option<T> reduceRightOption(BiFunction<? super T, ? super T, ? extends T> op);
}
|
{
"pile_set_name": "Github"
}
|
let makeTuple a b = (a, b)
|
{
"pile_set_name": "Github"
}
|
{
"pile_set_name": "Github"
}
|
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_THUNK_PPAPI_THUNK_EXPORT_H_
#define PPAPI_THUNK_PPAPI_THUNK_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(PPAPI_THUNK_IMPLEMENTATION)
#define PPAPI_THUNK_EXPORT __declspec(dllexport)
#else
#define PPAPI_THUNK_EXPORT __declspec(dllimport)
#endif // defined(PPAPI_THUNK_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(PPAPI_THUNK_IMPLEMENTATION)
#define PPAPI_THUNK_EXPORT __attribute__((visibility("default")))
#else
#define PPAPI_THUNK_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define PPAPI_THUNK_EXPORT
#endif
#endif // PPAPI_THUNK_PPAPI_THUNK_EXPORT_H_
|
{
"pile_set_name": "Github"
}
|
import slug from 'slug';
import SitemapService from '../services/sitemap';
const slugConfig = {
symbols: false, // replace unicode symbols or not
remove: null, // (optional) regex to remove characters
lower: true // result in lower case
};
const cleanSlug = text => {
return slug(text || '', slugConfig);
};
const getAvailableSlug = (path, resource, enableCleanPath = true) => {
return SitemapService.getPaths().then(paths => {
if (enableCleanPath) {
path = cleanSlug(path);
}
let pathExists = paths.find(
e => e.path === '/' + path && e.resource != resource
);
while (pathExists) {
path += '-2';
pathExists = paths.find(
e => e.path === '/' + path && e.resource != resource
);
}
return path;
});
};
const getCorrectFileName = filename => {
if (filename) {
// replace unsafe characters
return filename.replace(/[\s*/:;&?@$()<>#%\{\}|\\\^\~\[\]]/g, '-');
} else {
return filename;
}
};
const getProjectionFromFields = fields => {
const fieldsArray = fields && fields.length > 0 ? fields.split(',') : [];
return Object.assign({}, ...fieldsArray.map(key => ({ [key]: 1 })));
};
export default {
cleanSlug: cleanSlug,
getAvailableSlug: getAvailableSlug,
getCorrectFileName: getCorrectFileName,
getProjectionFromFields: getProjectionFromFields
};
|
{
"pile_set_name": "Github"
}
|
{% set version = '0.2-15' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}
package:
name: r-codetools
version: {{ version|replace("-", "_") }}
source:
fn: codetools_{{ version }}.tar.gz
url:
- https://cran.r-project.org/src/contrib/codetools_{{ version }}.tar.gz
- https://cran.r-project.org/src/contrib/Archive/codetools/codetools_{{ version }}.tar.gz
sha256: 4e0798ed79281a614f8cdd199e25f2c1bd8f35ecec902b03016544bd7795fa40
# patches:
# List any patch files here
# - fix.patch
build:
# If this is a new build for the same version, increment the build number.
number: 0
# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r-base
run:
- r-base
test:
commands:
# You can put additional test commands to be run here.
- $R -e "library('codetools')" # [not win]
- "\"%R%\" -e \"library('codetools')\"" # [win]
# You can also put a file called run_test.py, run_test.sh, or run_test.bat
# in the recipe that will be run at test time.
# requires:
# Put any additional test requirements here.
about:
home: https://CRAN.R-project.org/package=codetools
license: GPL
summary: Code analysis tools for R.
license_family: GPL
# The original CRAN metadata for this package was:
# Package: codetools
# Version: 0.2-15
# Priority: recommended
# Author: Luke Tierney <[email protected]>
# Description: Code analysis tools for R.
# Title: Code Analysis Tools for R
# Depends: R (>= 2.1)
# Maintainer: Luke Tierney <[email protected]>
# License: GPL
# NeedsCompilation: no
# Packaged: 2016-10-05 12:32:32 UTC; luke
# Repository: CRAN
# Date/Publication: 2016-10-05 16:36:47
# See
# http://docs.continuum.io/conda/build.html for
# more information about meta.yaml
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
#
# Util/py3compat.py : Compatibility code for handling Py3k / Python 2.x
#
# Written in 2010 by Thorsten Behrens
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associated with the
# contents of this file for any purpose whatsoever.
# No rights are reserved.
#
# 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.
# ===================================================================
"""Compatibility code for handling string/bytes changes from Python 2.x to Py3k
In Python 2.x, strings (of type ''str'') contain binary data, including encoded
Unicode text (e.g. UTF-8). The separate type ''unicode'' holds Unicode text.
Unicode literals are specified via the u'...' prefix. Indexing or slicing
either type always produces a string of the same type as the original.
Data read from a file is always of '''str'' type.
In Python 3.x, strings (type ''str'') may only contain Unicode text. The u'...'
prefix and the ''unicode'' type are now redundant. A new type (called
''bytes'') has to be used for binary data (including any particular
''encoding'' of a string). The b'...' prefix allows one to specify a binary
literal. Indexing or slicing a string produces another string. Slicing a byte
string produces another byte string, but the indexing operation produces an
integer. Data read from a file is of '''str'' type if the file was opened in
text mode, or of ''bytes'' type otherwise.
Since PyCrypto aims at supporting both Python 2.x and 3.x, the following helper
functions are used to keep the rest of the library as independent as possible
from the actual Python version.
In general, the code should always deal with binary strings, and use integers
instead of 1-byte character strings.
b(s)
Take a text string literal (with no prefix or with u'...' prefix) and
make a byte string.
bchr(c)
Take an integer and make a 1-character byte string.
bord(c)
Take the result of indexing on a byte string and make an integer.
tobytes(s)
Take a text string, a byte string, or a sequence of character taken from
a byte string and make a byte string.
"""
import sys
import abc
if sys.version_info[0] == 2:
def b(s):
return s
def bchr(s):
return chr(s)
def bstr(s):
return str(s)
def bord(s):
return ord(s)
def tobytes(s, encoding="latin-1"):
if isinstance(s, unicode):
return s.encode(encoding)
elif isinstance(s, str):
return s
elif isinstance(s, bytearray):
return bytes(s)
else:
return ''.join(s)
def tostr(bs):
return bs
def byte_string(s):
return isinstance(s, str)
# In Pyton 2.x, StringIO is a stand-alone module
from StringIO import StringIO as BytesIO
from sys import maxint
if sys.version_info[1] < 7:
import types
_memoryview = types.NoneType
else:
_memoryview = memoryview
iter_range = xrange
def is_native_int(x):
return isinstance(x, (int, long))
def is_string(x):
return isinstance(x, basestring)
ABC = abc.ABCMeta('ABC', (object,), {'__slots__': ()})
else:
def b(s):
return s.encode("latin-1") # utf-8 would cause some side-effects we don't want
def bchr(s):
return bytes([s])
def bstr(s):
if isinstance(s,str):
return bytes(s,"latin-1")
else:
return bytes(s)
def bord(s):
return s
def tobytes(s, encoding="latin-1"):
if isinstance(s, bytes):
return s
elif isinstance(s, bytearray):
return bytes(s)
elif isinstance(s,str):
return s.encode(encoding)
else:
return bytes([s])
def tostr(bs):
return bs.decode("latin-1")
def byte_string(s):
return isinstance(s, bytes)
# In Python 3.x, StringIO is a sub-module of io
from io import BytesIO
from sys import maxsize as maxint
_memoryview = memoryview
iter_range = range
def is_native_int(x):
return isinstance(x, int)
def is_string(x):
return isinstance(x, str)
from abc import ABC
def _copy_bytes(start, end, seq):
"""Return an immutable copy of a sequence (byte string, byte array, memoryview)
in a certain interval [start:seq]"""
if isinstance(seq, _memoryview):
return seq[start:end].tobytes()
elif isinstance(seq, bytearray):
return bytes(seq[start:end])
else:
return seq[start:end]
del sys
del abc
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.samza.operators.spec;
import java.io.Serializable;
import java.util.Collection;
import java.util.LinkedHashSet;
import org.apache.samza.annotation.InterfaceStability;
import org.apache.samza.operators.MessageStream;
import org.apache.samza.operators.MessageStreamImpl;
import org.apache.samza.operators.functions.ScheduledFunction;
import org.apache.samza.operators.functions.WatermarkFunction;
/**
* A stream operator specification that holds all the information required to transform
* the input {@link MessageStreamImpl} and produce the output
* {@link MessageStreamImpl}.
*
* @param <M> the type of input message to the operator
* @param <OM> the type of output message from the operator
*/
@InterfaceStability.Unstable
public abstract class OperatorSpec<M, OM> implements Serializable {
public enum OpCode {
INPUT,
MAP,
FLAT_MAP,
FILTER,
SINK,
SEND_TO,
JOIN,
WINDOW,
MERGE,
PARTITION_BY,
OUTPUT,
BROADCAST,
ASYNC_FLAT_MAP
}
private final String opId;
private final OpCode opCode;
private StackTraceElement[] creationStackTrace;
/**
* The set of operators that consume the messages produced from this operator.
* <p>
* We use a LinkedHashSet since we need both deterministic ordering in initializing/closing operators and serializability.
*/
private final LinkedHashSet<OperatorSpec<OM, ?>> nextOperatorSpecs = new LinkedHashSet<>();
// this method is used in unit tests to verify an {@link OperatorSpec} instance is a deserialized copy of this object.
final boolean isClone(OperatorSpec other) {
return this != other && this.getClass().isAssignableFrom(other.getClass())
&& this.opCode.equals(other.opCode) && this.opId.equals(other.opId);
}
public OperatorSpec(OpCode opCode, String opId) {
this.opCode = opCode;
this.opId = opId;
this.creationStackTrace = Thread.currentThread().getStackTrace();
}
/**
* Register the next operator spec in the chain that this operator should propagate its output to.
* @param nextOperatorSpec the next operator in the chain.
*/
public void registerNextOperatorSpec(OperatorSpec<OM, ?> nextOperatorSpec) {
nextOperatorSpecs.add(nextOperatorSpec);
}
/**
* Get the collection of chained {@link OperatorSpec}s that are consuming the output of this node
*
* @return the collection of chained {@link OperatorSpec}s
*/
public Collection<OperatorSpec<OM, ?>> getRegisteredOperatorSpecs() {
return nextOperatorSpecs;
}
/**
* Get the {@link OpCode} for this operator.
* @return the {@link OpCode} for this operator
*/
public final OpCode getOpCode() {
return this.opCode;
}
/**
* Get the unique ID of this operator in the
* {@link org.apache.samza.application.descriptors.StreamApplicationDescriptorImpl}.
* @return the unique operator ID
*/
public final String getOpId() {
return this.opId;
}
/**
* Get the user source code location that created the operator.
* @return source code location for the operator
*/
public final String getSourceLocation() {
// The stack trace for most operators looks like:
// [0] Thread.getStackTrace()
// [1] OperatorSpec.init<>()
// [2] SomeOperatorSpec.<init>()
// [3] OperatorSpecs.createSomeOperatorSpec()
// [4] MessageStreamImpl.someOperator()
// [5] User/MessageStreamImpl code that calls [4]
// We are interested in the first call below this that originates from user code
StackTraceElement element = this.creationStackTrace[5];
/**
* Sometimes [5] above is a call from MessageStream/MessageStreamImpl itself (e.g. for
* {@link org.apache.samza.operators.MessageStream#mergeAll(Collection)} or
* {@link MessageStreamImpl#partitionBy(Function, Function)}).
* If that's the case, find the first call from a class other than these.
*/
for (int i = 5; i < creationStackTrace.length; i++) {
if (!creationStackTrace[i].getClassName().equals(MessageStreamImpl.class.getName())
&& !creationStackTrace[i].getClassName().equals(MessageStream.class.getName())) {
element = creationStackTrace[i];
break;
}
}
return String.format("%s:%s", element.getFileName(), element.getLineNumber());
}
abstract public WatermarkFunction getWatermarkFn();
abstract public ScheduledFunction getScheduledFn();
}
|
{
"pile_set_name": "Github"
}
|
package com.netflix.governator.event;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Before;
import org.junit.Test;
import com.google.inject.AbstractModule;
import com.google.inject.CreationException;
import com.google.inject.Injector;
import com.netflix.governator.InjectorBuilder;
import com.netflix.governator.event.guava.GuavaApplicationEventModule;
public class ApplicationEventModuleTest {
private Injector injector;
@Before
public void setup() {
injector = InjectorBuilder.fromModules(new GuavaApplicationEventModule(), new AbstractModule() {
@Override
protected void configure() {
bind(TestAnnotatedListener.class).toInstance(new TestAnnotatedListener());
bind(TestListenerInterface.class).toInstance(new TestListenerInterface());
}
}).createInjector();
}
@Test
public void testProvidedComponentsPresent() {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
TestAnnotatedListener listener = injector.getInstance(TestAnnotatedListener.class);
TestListenerInterface listenerInterface = injector.getInstance(TestListenerInterface.class);
assertNotNull(dispatcher);
assertNotNull(listener);
assertNotNull(listenerInterface);
}
@Test
public void testAnnotatedListener() throws Exception {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
TestAnnotatedListener listener = injector.getInstance(TestAnnotatedListener.class);
assertEquals(0, listener.invocationCount.get());
dispatcher.publishEvent(new TestEvent());
assertEquals(1, listener.invocationCount.get());
dispatcher.publishEvent(new NotTestEvent());
assertEquals(1, listener.invocationCount.get());
}
@Test
public void testManuallyRegisteredApplicationEventListeners() throws Exception {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
final AtomicInteger testEventCounter = new AtomicInteger();
final AtomicInteger notTestEventCounter = new AtomicInteger();
final AtomicInteger allEventCounter = new AtomicInteger();
dispatcher.registerListener(TestEvent.class, new ApplicationEventListener<TestEvent>() {
public void onEvent(TestEvent event) {
testEventCounter.incrementAndGet();
}
});
dispatcher.registerListener(NotTestEvent.class, new ApplicationEventListener<NotTestEvent>() {
public void onEvent(NotTestEvent event) {
notTestEventCounter.incrementAndGet();
}
});
dispatcher.registerListener(ApplicationEvent.class, new ApplicationEventListener<ApplicationEvent>() {
public void onEvent(ApplicationEvent event) {
allEventCounter.incrementAndGet();
}
});
dispatcher.publishEvent(new TestEvent());
assertEquals(1, testEventCounter.get());
assertEquals(0, notTestEventCounter.get());
assertEquals(1, allEventCounter.get());
}
@Test
public void testManuallyRegisteredApplicationEventListenersWithoutClassArgument() throws Exception {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
final AtomicInteger testEventCounter = new AtomicInteger();
final AtomicInteger notTestEventCounter = new AtomicInteger();
final AtomicInteger allEventCounter = new AtomicInteger();
dispatcher.registerListener(new ApplicationEventListener<TestEvent>() {
public void onEvent(TestEvent event) {
testEventCounter.incrementAndGet();
}
});
dispatcher.registerListener(new ApplicationEventListener<NotTestEvent>() {
public void onEvent(NotTestEvent event) {
notTestEventCounter.incrementAndGet();
}
});
dispatcher.registerListener(new ApplicationEventListener<ApplicationEvent>() {
public void onEvent(ApplicationEvent event) {
allEventCounter.incrementAndGet();
}
});
dispatcher.publishEvent(new TestEvent());
assertEquals(1, testEventCounter.get());
assertEquals(0, notTestEventCounter.get());
assertEquals(1, allEventCounter.get());
}
@Test
public void testInjectorDiscoveredApplicationEventListeners() throws Exception {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
TestListenerInterface listener = injector.getInstance(TestListenerInterface.class);
assertEquals(0, listener.invocationCount.get());
dispatcher.publishEvent(new TestEvent());
assertEquals(1, listener.invocationCount.get());
dispatcher.publishEvent(new NotTestEvent());
assertEquals(1, listener.invocationCount.get());
}
@Test
public void testUnregisterApplicationEventListener() throws Exception {
ApplicationEventDispatcher dispatcher = injector.getInstance(ApplicationEventDispatcher.class);
final AtomicInteger testEventCounter = new AtomicInteger();
ApplicationEventRegistration registration = dispatcher.registerListener(new ApplicationEventListener<TestEvent>() {
public void onEvent(TestEvent event) {
testEventCounter.incrementAndGet();
}
});
dispatcher.publishEvent(new TestEvent());
assertEquals(1, testEventCounter.get());
registration.unregister();
assertEquals(1, testEventCounter.get());
}
@Test(expected=CreationException.class)
public void testEventListenerWithInvalidArgumentsFailsFast() {
injector = InjectorBuilder.fromModules(new GuavaApplicationEventModule(), new AbstractModule() {
@Override
protected void configure() {
bind(TestFailFastEventListener.class).toInstance(new TestFailFastEventListener());
}
}).createInjector();
}
private class TestAnnotatedListener {
AtomicInteger invocationCount = new AtomicInteger();
@EventListener
public void doThing(TestEvent event) {
invocationCount.incrementAndGet();
}
}
private class TestFailFastEventListener {
@EventListener
public void doNothing(String invalidArgumentType) {
fail("This should never be called");
}
}
private class TestListenerInterface implements ApplicationEventListener<TestEvent> {
AtomicInteger invocationCount = new AtomicInteger();
@Override
public void onEvent(TestEvent event) {
invocationCount.incrementAndGet();
}
}
private class TestEvent implements ApplicationEvent {
}
private class NotTestEvent implements ApplicationEvent {
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kie.dmn.model.v1_2.dmndi;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
public class DMNDiagram extends Diagram implements org.kie.dmn.model.api.dmndi.DMNDiagram {
protected org.kie.dmn.model.api.dmndi.Dimension size;
protected List<org.kie.dmn.model.api.dmndi.DiagramElement> dmnDiagramElement;
/**
* Gets the value of the size property.
*
* @return
* possible object is
* {@link Dimension }
*
*/
public org.kie.dmn.model.api.dmndi.Dimension getSize() {
return size;
}
/**
* Sets the value of the size property.
*
* @param value
* allowed object is
* {@link Dimension }
*
*/
public void setSize(org.kie.dmn.model.api.dmndi.Dimension value) {
this.size = value;
}
/**
* Gets the value of the dmnDiagramElement property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dmnDiagramElement property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDMNDiagramElement().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link DMNShape }{@code >}
* {@link JAXBElement }{@code <}{@link DiagramElement }{@code >}
* {@link JAXBElement }{@code <}{@link DMNEdge }{@code >}
*
*
*/
public List<org.kie.dmn.model.api.dmndi.DiagramElement> getDMNDiagramElement() {
if (dmnDiagramElement == null) {
dmnDiagramElement = new ArrayList<>();
}
return this.dmnDiagramElement;
}
}
|
{
"pile_set_name": "Github"
}
|
\version "2.12.1"
\include "Fonctions.lyp"
\include "Global.lyp"
#(set-global-staff-size 20)
#(ly:set-option 'point-and-click #f)
\paper{
top-margin = 5.0
bottom-margin = 5.0
before-title-space = 10.0
after-title-space = 5.0
oddHeaderMarkup = \markup \fill-line {
" "
\on-the-fly #not-first-page \fromproperty #'header:instrumentHeader
\on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string }
evenHeaderMarkup = \markup \fill-line {
\on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string
\on-the-fly #not-first-page \fromproperty #'header:instrumentHeader
" " }
oddFooterMarkup = \markup \fill-line \teeny { \fromproperty #'header:copyright }
ragged-last-bottom = ##f
% first-page-number = 2
} %% fin paper
\book {
\header {
title = \cTitre
composer = \cCompositeur
copyright = \cCopyright
poet = \markup \box { \pad-around #1 {"Clarinette 2 en ut"}} %% placé en haut à gauche
instrumentHeader = \markup {"Clarinette 2 en ut"}
} %% fin header
\markup \fill-line {\bold \huge "I"}
\score {
\new Staff <<
\reperes \silencesMulti
\keepWithTag #'partie
\include "Mvt1/Cl2-1.lyp" >>
} %% fin score I
\markup \fill-line {\bold \huge "II"}
\score {
\new Staff {
\reperes \silencesMulti
\keepWithTag #'partie
\include "Mvt2/Cl2-2.lyp" }
} %% fin score II
\markup \fill-line {\bold \huge "III"}
\score {
\new Staff {
\reperes \silencesMulti
\keepWithTag #'partie
\include "Mvt3/Cl2-3.lyp" }
} %% fin score III
\markup \fill-line {\bold \huge "IV"}
\score {
\new Staff {
\reperes \silencesMulti
\keepWithTag #'partie
\include "Mvt4/Cl2-4.lyp" }
} %% fin score IV
} %% fin book
%{
%}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def add_multiply(x, y=1, z):
return (x + y) * z
add_multiply(x=1, 2, 3) # Raises `SyntaxError` in definition and call
|
{
"pile_set_name": "Github"
}
|
14.4: Timepicker custom meridian example
========================================
**Primary Actor**: User
**Scope**: Ngx-bootstrap DEMO / BS version 3&4
**Goal**: Show user timepicker functionality with changing meridian param
Main success scenario:
----------------------
1. User opens Timepicker demo page
2. User clicks on Custom meridian sub-menu
3. User sees timepicker component and info alert with selected date and time (current by default)
4. User sees current hour and current minute in timepicker inputs and button "12H"("24H") by default (depend on current time)
5. When user clicks on "12H / 24H", then input data stay the same and info changed appropriate
6. Component src should be written with meridians = \['12H', '24H']
7. Template src should be written with \[meridians]="meridians"
Variations:
-----------
2*. User scrolls to Custom meridian sub-menu
|
{
"pile_set_name": "Github"
}
|
/*
* Tencent is pleased to support the open source community by making TBase available.
*
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
*
* TBase is licensed under the BSD 3-Clause License, except for the third-party component listed below.
*
* A copy of the BSD 3-Clause License is included in this file.
*
* Other dependencies and licenses:
*
* Open Source Software Licensed Under the PostgreSQL License:
* --------------------------------------------------------------------
* 1. Postgres-XL XL9_5_STABLE
* Portions Copyright (c) 2015-2016, 2ndQuadrant Ltd
* Portions Copyright (c) 2012-2015, TransLattice, Inc.
* Portions Copyright (c) 2010-2017, Postgres-XC Development Group
* Portions Copyright (c) 1996-2015, The PostgreSQL Global Development Group
* Portions Copyright (c) 1994, The Regents of the University of California
*
* Terms of the PostgreSQL License:
* --------------------------------------------------------------------
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written agreement
* is hereby granted, provided that the above copyright notice and this
* paragraph and the following two paragraphs appear in all copies.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
* DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*
* Terms of the BSD 3-Clause License:
* --------------------------------------------------------------------
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of THL A29 Limited nor the names of its contributors may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*/
#include "stree.h"
#include "util.h"
static stree *
stree_insert_internal(stree * root, stree * node, int (*compare)(void *, void *))
{
stree * left;
stree * right;
int ret;
if (!root)
return node;
left = root->left;
right = root->right;
ret = compare(node->data, root->data);
if (ret > 0)
{
if (!right)
{
root->right = node;
}
else
{
stree_insert_internal(right, node, compare);
}
}
else
{
if (!left)
{
root->left = node;
}
else
{
stree_insert_internal(left, node, compare);
}
}
return root;
}
stree *
stree_insert(stree * root, void * data, int (*compare)(void *, void *))
{
stree * node;
node = (stree *)Malloc(sizeof(stree));
node->left = NULL;
node->right = NULL;
node->data = data;
return stree_insert_internal(root, node, compare);
}
void
stree_pre_traverse(stree * root, void (*traverse)(void *))
{
if (root)
{
stree_pre_traverse(root->left, traverse);
traverse(root->data);
stree_pre_traverse(root->right, traverse);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Driver for SAA6588 RDS decoder
(c) 2005 Hans J. Koch
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/wait.h>
#include <linux/uaccess.h>
#include <media/i2c/saa6588.h>
#include <media/v4l2-device.h>
/* insmod options */
static unsigned int debug;
static unsigned int xtal;
static unsigned int mmbs;
static unsigned int plvl;
static unsigned int bufblocks = 100;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
module_param(xtal, int, 0);
MODULE_PARM_DESC(xtal, "select oscillator frequency (0..3), default 0");
module_param(mmbs, int, 0);
MODULE_PARM_DESC(mmbs, "enable MMBS mode: 0=off (default), 1=on");
module_param(plvl, int, 0);
MODULE_PARM_DESC(plvl, "select pause level (0..3), default 0");
module_param(bufblocks, int, 0);
MODULE_PARM_DESC(bufblocks, "number of buffered blocks, default 100");
MODULE_DESCRIPTION("v4l2 driver module for SAA6588 RDS decoder");
MODULE_AUTHOR("Hans J. Koch <[email protected]>");
MODULE_LICENSE("GPL");
/* ---------------------------------------------------------------------- */
#define UNSET (-1U)
#define PREFIX "saa6588: "
#define dprintk if (debug) printk
struct saa6588 {
struct v4l2_subdev sd;
struct delayed_work work;
spinlock_t lock;
unsigned char *buffer;
unsigned int buf_size;
unsigned int rd_index;
unsigned int wr_index;
unsigned int block_count;
unsigned char last_blocknum;
wait_queue_head_t read_queue;
int data_available_for_read;
u8 sync;
};
static inline struct saa6588 *to_saa6588(struct v4l2_subdev *sd)
{
return container_of(sd, struct saa6588, sd);
}
/* ---------------------------------------------------------------------- */
/*
* SAA6588 defines
*/
/* Initialization and mode control byte (0w) */
/* bit 0+1 (DAC0/DAC1) */
#define cModeStandard 0x00
#define cModeFastPI 0x01
#define cModeReducedRequest 0x02
#define cModeInvalid 0x03
/* bit 2 (RBDS) */
#define cProcessingModeRDS 0x00
#define cProcessingModeRBDS 0x04
/* bit 3+4 (SYM0/SYM1) */
#define cErrCorrectionNone 0x00
#define cErrCorrection2Bits 0x08
#define cErrCorrection5Bits 0x10
#define cErrCorrectionNoneRBDS 0x18
/* bit 5 (NWSY) */
#define cSyncNormal 0x00
#define cSyncRestart 0x20
/* bit 6 (TSQD) */
#define cSigQualityDetectOFF 0x00
#define cSigQualityDetectON 0x40
/* bit 7 (SQCM) */
#define cSigQualityTriggered 0x00
#define cSigQualityContinous 0x80
/* Pause level and flywheel control byte (1w) */
/* bits 0..5 (FEB0..FEB5) */
#define cFlywheelMaxBlocksMask 0x3F
#define cFlywheelDefault 0x20
/* bits 6+7 (PL0/PL1) */
#define cPauseLevel_11mV 0x00
#define cPauseLevel_17mV 0x40
#define cPauseLevel_27mV 0x80
#define cPauseLevel_43mV 0xC0
/* Pause time/oscillator frequency/quality detector control byte (1w) */
/* bits 0..4 (SQS0..SQS4) */
#define cQualityDetectSensMask 0x1F
#define cQualityDetectDefault 0x0F
/* bit 5 (SOSC) */
#define cSelectOscFreqOFF 0x00
#define cSelectOscFreqON 0x20
/* bit 6+7 (PTF0/PTF1) */
#define cOscFreq_4332kHz 0x00
#define cOscFreq_8664kHz 0x40
#define cOscFreq_12996kHz 0x80
#define cOscFreq_17328kHz 0xC0
/* ---------------------------------------------------------------------- */
static bool block_from_buf(struct saa6588 *s, unsigned char *buf)
{
int i;
if (s->rd_index == s->wr_index) {
if (debug > 2)
dprintk(PREFIX "Read: buffer empty.\n");
return false;
}
if (debug > 2) {
dprintk(PREFIX "Read: ");
for (i = s->rd_index; i < s->rd_index + 3; i++)
dprintk("0x%02x ", s->buffer[i]);
}
memcpy(buf, &s->buffer[s->rd_index], 3);
s->rd_index += 3;
if (s->rd_index >= s->buf_size)
s->rd_index = 0;
s->block_count--;
if (debug > 2)
dprintk("%d blocks total.\n", s->block_count);
return true;
}
static void read_from_buf(struct saa6588 *s, struct saa6588_command *a)
{
unsigned char __user *buf_ptr = a->buffer;
unsigned char buf[3];
unsigned long flags;
unsigned int rd_blocks;
unsigned int i;
a->result = 0;
if (!a->buffer)
return;
while (!a->nonblocking && !s->data_available_for_read) {
int ret = wait_event_interruptible(s->read_queue,
s->data_available_for_read);
if (ret == -ERESTARTSYS) {
a->result = -EINTR;
return;
}
}
rd_blocks = a->block_count;
spin_lock_irqsave(&s->lock, flags);
if (rd_blocks > s->block_count)
rd_blocks = s->block_count;
spin_unlock_irqrestore(&s->lock, flags);
if (!rd_blocks)
return;
for (i = 0; i < rd_blocks; i++) {
bool got_block;
spin_lock_irqsave(&s->lock, flags);
got_block = block_from_buf(s, buf);
spin_unlock_irqrestore(&s->lock, flags);
if (!got_block)
break;
if (copy_to_user(buf_ptr, buf, 3)) {
a->result = -EFAULT;
return;
}
buf_ptr += 3;
a->result += 3;
}
spin_lock_irqsave(&s->lock, flags);
s->data_available_for_read = (s->block_count > 0);
spin_unlock_irqrestore(&s->lock, flags);
}
static void block_to_buf(struct saa6588 *s, unsigned char *blockbuf)
{
unsigned int i;
if (debug > 3)
dprintk(PREFIX "New block: ");
for (i = 0; i < 3; ++i) {
if (debug > 3)
dprintk("0x%02x ", blockbuf[i]);
s->buffer[s->wr_index] = blockbuf[i];
s->wr_index++;
}
if (s->wr_index >= s->buf_size)
s->wr_index = 0;
if (s->wr_index == s->rd_index) {
s->rd_index += 3;
if (s->rd_index >= s->buf_size)
s->rd_index = 0;
} else
s->block_count++;
if (debug > 3)
dprintk("%d blocks total.\n", s->block_count);
}
static void saa6588_i2c_poll(struct saa6588 *s)
{
struct i2c_client *client = v4l2_get_subdevdata(&s->sd);
unsigned long flags;
unsigned char tmpbuf[6];
unsigned char blocknum;
unsigned char tmp;
/* Although we only need 3 bytes, we have to read at least 6.
SAA6588 returns garbage otherwise. */
if (6 != i2c_master_recv(client, &tmpbuf[0], 6)) {
if (debug > 1)
dprintk(PREFIX "read error!\n");
return;
}
s->sync = tmpbuf[0] & 0x10;
if (!s->sync)
return;
blocknum = tmpbuf[0] >> 5;
if (blocknum == s->last_blocknum) {
if (debug > 3)
dprintk("Saw block %d again.\n", blocknum);
return;
}
s->last_blocknum = blocknum;
/*
Byte order according to v4l2 specification:
Byte 0: Least Significant Byte of RDS Block
Byte 1: Most Significant Byte of RDS Block
Byte 2 Bit 7: Error bit. Indicates that an uncorrectable error
occurred during reception of this block.
Bit 6: Corrected bit. Indicates that an error was
corrected for this data block.
Bits 5-3: Same as bits 0-2.
Bits 2-0: Block number.
SAA6588 byte order is Status-MSB-LSB, so we have to swap the
first and the last of the 3 bytes block.
*/
swap(tmpbuf[2], tmpbuf[0]);
/* Map 'Invalid block E' to 'Invalid Block' */
if (blocknum == 6)
blocknum = V4L2_RDS_BLOCK_INVALID;
/* And if are not in mmbs mode, then 'Block E' is also mapped
to 'Invalid Block'. As far as I can tell MMBS is discontinued,
and if there is ever a need to support E blocks, then please
contact the linux-media mailinglist. */
else if (!mmbs && blocknum == 5)
blocknum = V4L2_RDS_BLOCK_INVALID;
tmp = blocknum;
tmp |= blocknum << 3; /* Received offset == Offset Name (OK ?) */
if ((tmpbuf[2] & 0x03) == 0x03)
tmp |= V4L2_RDS_BLOCK_ERROR; /* uncorrectable error */
else if ((tmpbuf[2] & 0x03) != 0x00)
tmp |= V4L2_RDS_BLOCK_CORRECTED; /* corrected error */
tmpbuf[2] = tmp; /* Is this enough ? Should we also check other bits ? */
spin_lock_irqsave(&s->lock, flags);
block_to_buf(s, tmpbuf);
spin_unlock_irqrestore(&s->lock, flags);
s->data_available_for_read = 1;
wake_up_interruptible(&s->read_queue);
}
static void saa6588_work(struct work_struct *work)
{
struct saa6588 *s = container_of(work, struct saa6588, work.work);
saa6588_i2c_poll(s);
schedule_delayed_work(&s->work, msecs_to_jiffies(20));
}
static void saa6588_configure(struct saa6588 *s)
{
struct i2c_client *client = v4l2_get_subdevdata(&s->sd);
unsigned char buf[3];
int rc;
buf[0] = cSyncRestart;
if (mmbs)
buf[0] |= cProcessingModeRBDS;
buf[1] = cFlywheelDefault;
switch (plvl) {
case 0:
buf[1] |= cPauseLevel_11mV;
break;
case 1:
buf[1] |= cPauseLevel_17mV;
break;
case 2:
buf[1] |= cPauseLevel_27mV;
break;
case 3:
buf[1] |= cPauseLevel_43mV;
break;
default: /* nothing */
break;
}
buf[2] = cQualityDetectDefault | cSelectOscFreqON;
switch (xtal) {
case 0:
buf[2] |= cOscFreq_4332kHz;
break;
case 1:
buf[2] |= cOscFreq_8664kHz;
break;
case 2:
buf[2] |= cOscFreq_12996kHz;
break;
case 3:
buf[2] |= cOscFreq_17328kHz;
break;
default: /* nothing */
break;
}
dprintk(PREFIX "writing: 0w=0x%02x 1w=0x%02x 2w=0x%02x\n",
buf[0], buf[1], buf[2]);
rc = i2c_master_send(client, buf, 3);
if (rc != 3)
printk(PREFIX "i2c i/o error: rc == %d (should be 3)\n", rc);
}
/* ---------------------------------------------------------------------- */
static long saa6588_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{
struct saa6588 *s = to_saa6588(sd);
struct saa6588_command *a = arg;
switch (cmd) {
/* --- close() for /dev/radio --- */
case SAA6588_CMD_CLOSE:
s->data_available_for_read = 1;
wake_up_interruptible(&s->read_queue);
s->data_available_for_read = 0;
a->result = 0;
break;
/* --- read() for /dev/radio --- */
case SAA6588_CMD_READ:
read_from_buf(s, a);
break;
/* --- poll() for /dev/radio --- */
case SAA6588_CMD_POLL:
a->result = 0;
if (s->data_available_for_read)
a->result |= POLLIN | POLLRDNORM;
poll_wait(a->instance, &s->read_queue, a->event_list);
break;
default:
/* nothing */
return -ENOIOCTLCMD;
}
return 0;
}
static int saa6588_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
{
struct saa6588 *s = to_saa6588(sd);
vt->capability |= V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO;
if (s->sync)
vt->rxsubchans |= V4L2_TUNER_SUB_RDS;
return 0;
}
static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct saa6588 *s = to_saa6588(sd);
saa6588_configure(s);
return 0;
}
/* ----------------------------------------------------------------------- */
static const struct v4l2_subdev_core_ops saa6588_core_ops = {
.ioctl = saa6588_ioctl,
};
static const struct v4l2_subdev_tuner_ops saa6588_tuner_ops = {
.g_tuner = saa6588_g_tuner,
.s_tuner = saa6588_s_tuner,
};
static const struct v4l2_subdev_ops saa6588_ops = {
.core = &saa6588_core_ops,
.tuner = &saa6588_tuner_ops,
};
/* ---------------------------------------------------------------------- */
static int saa6588_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct saa6588 *s;
struct v4l2_subdev *sd;
v4l_info(client, "saa6588 found @ 0x%x (%s)\n",
client->addr << 1, client->adapter->name);
s = devm_kzalloc(&client->dev, sizeof(*s), GFP_KERNEL);
if (s == NULL)
return -ENOMEM;
s->buf_size = bufblocks * 3;
s->buffer = devm_kzalloc(&client->dev, s->buf_size, GFP_KERNEL);
if (s->buffer == NULL)
return -ENOMEM;
sd = &s->sd;
v4l2_i2c_subdev_init(sd, client, &saa6588_ops);
spin_lock_init(&s->lock);
s->block_count = 0;
s->wr_index = 0;
s->rd_index = 0;
s->last_blocknum = 0xff;
init_waitqueue_head(&s->read_queue);
s->data_available_for_read = 0;
saa6588_configure(s);
/* start polling via eventd */
INIT_DELAYED_WORK(&s->work, saa6588_work);
schedule_delayed_work(&s->work, 0);
return 0;
}
static int saa6588_remove(struct i2c_client *client)
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct saa6588 *s = to_saa6588(sd);
v4l2_device_unregister_subdev(sd);
cancel_delayed_work_sync(&s->work);
return 0;
}
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id saa6588_id[] = {
{ "saa6588", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, saa6588_id);
static struct i2c_driver saa6588_driver = {
.driver = {
.name = "saa6588",
},
.probe = saa6588_probe,
.remove = saa6588_remove,
.id_table = saa6588_id,
};
module_i2c_driver(saa6588_driver);
|
{
"pile_set_name": "Github"
}
|
<requires>
alloc
filters
hex
rng
</requires>
|
{
"pile_set_name": "Github"
}
|
using JetBrains.Annotations;
using System.Threading.Tasks;
namespace Volo.Abp.Sms
{
public static class SmsSenderExtensions
{
public static Task SendAsync([NotNull] this ISmsSender smsSender, [NotNull] string phoneNumber, [NotNull] string text)
{
Check.NotNull(smsSender, nameof(smsSender));
return smsSender.SendAsync(new SmsMessage(phoneNumber, text));
}
}
}
|
{
"pile_set_name": "Github"
}
|
// @ts-check
import half from './src/half.js';
export default half;
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Common.Logging.Log4Net206</id>
<version>0.0.0</version>
<!-- placeholder value replaced by build script -->
<authors>Aleksandar Seovic, Mark Pollack, Erich Eichinger, Stephen Bohlen, G. Stoynev</authors>
<owners>Aleksandar Seovic, Mark Pollack, Erich Eichinger, Stephen Bohlen</owners>
<projectUrl>http://net-commons.github.io/common-logging/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/net-commons/common-logging/master/nuget-graphics/common-logging-icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Common.Logging library bindings for Log4Net 2.0.6 logging framework.</description>
<tags>Log4Net Common.Logging.Log4Net logging log Common.Logging</tags>
<language>en-US</language>
<dependencies>
<dependency id="Common.Logging" version="3.4.1" />
<dependency id="Log4Net" version="[2.0.6]" />
</dependencies>
</metadata>
<files>
<file src="..\..\build\net20\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.dll" target="lib\net35" />
<file src="..\..\build\net20\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.pdb" target="lib\net35" />
<file src="..\..\build\net20\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.xml" target="lib\net35" />
<file src="..\..\build\net40\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.dll" target="lib\net40" />
<file src="..\..\build\net40\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.pdb" target="lib\net40" />
<file src="..\..\build\net40\Common.Logging.Log4Net206\Release\Common.Logging.Log4Net206.xml" target="lib\net40" />
</files>
</package>
|
{
"pile_set_name": "Github"
}
|
*******************************************************************************
** Building TigerVNC
*******************************************************************************
================================
Build Requirements (All Systems)
================================
-- CMake (http://www.cmake.org) v2.8 or later
-- zlib
-- pixman
-- FLTK 1.3.3 or later
-- If building TLS support:
* GnuTLS 3.x
* See "Building TLS Support" below.
-- If building native language support (NLS):
* Gnu gettext 0.14.4 or later
* See "Building Native Language Support" below.
-- libjpeg-turbo
* "Normal" libjpegv6 is also supported, although it is not
recommended as it is much slower.
=========================
Build Requirements (Unix)
=========================
-- Non-Mac platforms:
* X11 development kit
* PAM
-- If building Xvnc/libvnc.so:
* Xorg server source code, 1.16 or never
* All build requirements Xorg imposes (see its documentation)
============================
Build Requirements (Windows)
============================
-- MinGW or MinGW-w64
-- Inno Setup (needed to build the TigerVNC installer)
Inno Setup can be downloaded from http://www.jrsoftware.org/isinfo.php.
You also need the Inno Setup Preprocessor, which is available in the
Inno Setup QuickStart Pack.
Add the directory containing iscc.exe (for instance,
C:\Program Files\Inno Setup 5) to the system or user PATH environment
variable prior to building TigerVNC.
=========================
Build Requirements (Java)
=========================
-- Sun/Oracle JDK 1.7 or later or OpenJDK 7 or later
-- See "Building Java Support" below.
==================
Out-of-Tree Builds
==================
Binary objects, libraries, and executables are generated in the same directory
from which cmake was executed (the "binary directory"), and this directory need
not necessarily be the same as the TigerVNC source directory. You can create
multiple independent binary directories, in which different versions of
TigerVNC can be built from the same source tree using different compilers or
settings. In the sections below, {build_directory} refers to the binary
directory, whereas {source_directory} refers to the TigerVNC source directory.
For in-tree builds, these directories are the same.
=================
Building TigerVNC
=================
Building the TigerVNC Viewer on Unix/Mac Systems
------------------------------------------------
The following procedure will build the TigerVNC Viewer on Linux and Unix
systems. On 64-bit systems, this will build a 64-bit version of TigerVNC. See
"Build Recipes" for specific build instructions for building a 32-bit version
of TigerVNC on 64-bit systems.
cd {build_directory}
cmake -G "Unix Makefiles" [additional CMake flags] {source_directory}
make
Building the TigerVNC Server on Unix/Linux Systems
--------------------------------------------------
Building the TigerVNC Server (Xvnc) is a bit trickier. Xvnc is typically built
to use the X11 shared libraries provided with the system. The procedure for
this is system-specific, since it requires specifying such things as font
directories, but the general outline is as follows (this procedure assumes
that the viewer has already been built, per above.)
> cd {build_directory}
If performing an out-of-tree build:
> mkdir unix
> cp -R {source_directory}/unix/xserver unix/
> cp -R {xorg_source}/* unix/xserver/
(NOTE: {xorg_source} is the directory containing the Xorg source for the
machine on which you are building TigerVNC. The most recent versions of
Red Hat/CentOS/Fedora, for instance, provide an RPM called
"xorg-x11-server-source", which installs the Xorg source under
/usr/share/xorg-x11-server-source.)
> cd unix/xserver/
> patch -p1 < {source_directory}/unix/xserver{version}.patch
(where {version} matches the X server version you are building, such as
"120" for version 1.20.x.)
> autoreconf -fiv
> ./configure --with-pic --without-dtrace --disable-static --disable-dri \
--disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
--disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
--disable-config-dbus --disable-config-hal --disable-config-udev \
--disable-dri2 --enable-install-libxf86config --enable-glx \
--with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
--with-fontdir=/usr/share/X11/fonts \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-xkb-bin-directory=/usr/bin \
--with-serverconfig-path=/usr/lib[64]/xorg \
--with-dri-driver-path=/usr/lib[64]/dri \
{additional configure options}
(NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
6 and recent Fedora releases. You should customize it for your particular
system. In particular, it will be necessary to customize the font, XKB,
and DRI directories.)
> make TIGERVNC_SRCDIR={source_directory}
Building the Windows TigerVNC Viewer with MinGW
-----------------------------------------------
If building the Windows version of TigerVNC on a Windows build system, use
the following procedure.
cd {build_directory}
cmake -G "MSYS Makefiles" [additional CMake flags] {source_directory}
make
If cross-compiling on a Unix/Linux system, then see the "Build Recipes" section
below.
Debug Build
-----------
Add "-DCMAKE_BUILD_TYPE=Debug" to the CMake command line.
Portable (semi-static) Build
----------------------------
TigerVNC can under favourble circumstances be built in a way that allows
the resulting binaries to run on any system without having to also install
all the dynamic libraries it depends on. Enable this mode by adding:
-DBUILD_STATIC=1
to the CMake command line.
Note that the method used to achieve this is very fragile and it may be
necessary to tweak cmake/StaticBuild.cmake to make things work on your
specific system.
=====================
Building Java Support
=====================
TigerVNC includes a Java version of the TigerVNC Viewer, which can be used on
any platform that has a Java Runtime Environment (JRE) installed. The Java
viewer works similarly to the native viewer, but with lower performance.
To build the Java TigerVNC Viewer, add
-DBUILD_JAVA=1
to the CMake or build-xorg command line. The build system will attempt to find
an installed Java Development Kit (JDK) and determine the appropriate paths for
the Java compiler (javac) and the JAR creation utility (jar). You can override
these paths by setting the Java_JAVAC_EXECUTABLE and Java_JAR_EXECUTABLE CMake
variables. You can also override the default flags that are passed to javac
by setting the JAVACFLAGS CMake variable. The build system will look for
keytool and jarsigner in the same directory as Java_JAR_EXECUTABLE. These
tools are needed to sign the JAR file, which is necessary to enable certain
functionality (such as clipboard transfers) when the Java viewer is used as an
applet.
If the Java viewer is built along with the Windows TigerVNC Server (WinVNC),
then the build system will embed the Java viewer into WinVNC4.exe so that it
will automatically be served up using WinVNC's built-in HTTP server.
Similarly, if the Java viewer is built along with the Unix TigerVNC Server
(Xvnc), then the build system will include the Java viewer in the server
tarball.
By default, a self-signed certificate will be generated and used to sign the
jar file. By specifying the following command line arguments to the CMake
command line, an alternate certificate may be used for signing.
-DJAVA_KEYSTORE=${keystore_location_or_url}
-DJAVA_KEYSTORE_TYPE=${keystore_type} (Default: "jks")
-DJAVA_KEY_ALIAS=${keytore_key_alias}
-DJAVA_STOREPASS=${keystore_password}
-DJAVA_KEYPASS=${keystore_entry_password}
-DJAVA_TSA_URL=${url_of_timestamping_authority}
The values of the JAVA_STOREPASS and JAVA_KEYPASS arguments may optionally be
read from file or environment variables by prefixing the value with ":env "
or ":file " (see the jarsigner documentation for more info):
export StorePass=tigervnc
export KeyPass=tigervnc
cmake \
...
-DJAVA_STOREPASS=":env StorePass"
-DJAVA_KEYPASS=":env KeyPass"
======================================
Building TLS Support
======================================
TLS requires GnuTLS, which is supplied with most Linux distributions and
with MinGW for Windows and can be built from source on OS X and other
Unix variants. However, GnuTLS versions > 2.12.x && < 3.3.x should be
avoided because of potential incompatibilities during initial handshaking.
You can override the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR CMake variables
to specify the locations of libgnutls and any dependencies. For instance,
adding
-DGNUTLS_INCLUDE_DIR=/usr/local/include \
-DGNUTLS_LIBRARY=/usr/local/lib/libgnutls.a
to the CMake command line would link TigerVNC against a static version of
libgnutls located under /usr/local.
======================================
Building Native Language Support (NLS)
======================================
NLS requires gettext, which is supplied with most Linux distributions and
with MinGW for Windows and which can easily be built from source on OS X and
other Unix variants.
You can override the ICONV_LIBRARIES and LIBINTL_LIBRARY CMake variables to
specify the locations of libiconv and libintl, respectively. For instance,
adding
-DLIBINTL_LIBRARY=/opt/gettext/lib/libintl.a
to the CMake command line would link TigerVNC against a static version of
libintl located under /opt/gettext. Adding
-DICONV_INCLUDE_DIR=/mingw/include \
-DICONV_LIBRARIES=/mingw/lib/libiconv.a \
-DGETTEXT_INCLUDE_DIR=/mingw/include \
-DLIBINTL_LIBRARY=/mingw/lib/libintl.a
to the CMake command line would link TigerVNC against the static versions of
libiconv and libintl included in the MinGW Developer Toolkit.
===================
Installing TigerVNC
===================
You can use the build system to install TigerVNC into a directory of your
choosing. To do this, add:
-DCMAKE_INSTALL_PREFIX={install_directory}
to the CMake command line. Then, you can run 'make install' to build and
install it.
If you don't specify CMAKE_INSTALL_PREFIX, then the default is
c:\Program Files\TigerVNC on Windows and /usr/local on Unix.
=========================
Creating Release Packages
=========================
The following commands can be used to create various types of release packages:
Unix
----
make tarball
Create a binary tarball containing the TigerVNC Viewer
make servertarball
Create a binary tarball containing both the TigerVNC Server and Viewer
make dmg
Create Macintosh disk image file that contains an application bundle of the
TigerVNC Viewer
make udmg
On 64-bit OS X systems, this creates a version of the Macintosh package and
disk image which contains universal i386/x86-64 binaries. You should first
configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
out-of-tree build, then run 'make udmg' from the 64-bit build directory. The
build system will look for the 32-bit build under {source_directory}/osxx86
by default, but you can override this by setting the OSX_X86_BUILD CMake
variable to the directory containing your configured 32-bit build. Either
the 64-bit or 32-bit build can be configured to be backward compatible by
using the instructions in the "Build Recipes" section.
Windows
-------
make installer
Create a Windows installer using Inno Setup. The installer package
(TigerVNC[64].exe) will be located under {build_directory}.
=============
Build Recipes
=============
32-bit Build on 64-bit Linux/Unix (including OS X)
--------------------------------------------------
Set the following environment variables before building TigerVNC.
CFLAGS='-O3 -m32'
CXXFLAGS='-O3 -m32'
LDFLAGS=-m32
If you are building the TigerVNC Server on a modern Unix/Linux system, then
you will also need to pass the appropriate --host argument when configuring the
X server source (for instance, --host=i686-pc-linux-gnu).
64-bit Backward-Compatible Build on 64-bit OS X
-----------------------------------------------
Add
-DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
to the CMake command line. The OS X 10.5 SDK must be installed.
32-bit Backward-Compatible Build on 64-bit OS X
-----------------------------------------------
Set the following environment variables:
CC=gcc-4.0
CXX=g++-4.0
CFLAGS='-O3 -m32'
CXXFLAGS='-O3 -m32'
LDFLAGS=-m32
and add
-DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
to the CMake command line. The OS X 10.4 SDK must be installed.
64-bit MinGW Build on Cygwin
----------------------------
cd {build_directory}
CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
RC=/usr/bin/x86_64-w64-mingw32-windres \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
-DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
make
This produces a 64-bit build of TigerVNC that does not depend on cygwin1.dll or
other Cygwin DLL's. The mingw64-x86_64-gcc-core and mingw64-x86_64-gcc-g++
packages (and their dependencies) must be installed.
32-bit MinGW Build on Cygwin
----------------------------
cd {build_directory}
CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
RC=/usr/bin/i686-w64-mingw32-windres \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
-DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
make
This produces a 32-bit build of TigerVNC that does not depend on cygwin1.dll or
other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++
packages (and their dependencies) must be installed.
MinGW-w64 Build on Windows
--------------------------
This produces a 64-bit build of TigerVNC using the "native" MinGW-w64 toolchain
(which is faster than the Cygwin version):
cd {build_directory}
CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
RC={mingw-w64_binary_path}/x86_64-w64-mingw32-windres \
cmake -G "MSYS Makefiles" \
-DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
-DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
{source_directory}
make
MinGW Build on Linux
--------------------
cd {build_directory}
CC={mingw_binary_path}/i386-mingw32-gcc \
CXX={mingw_binary_path}/i386-mingw32-g++ \
RC={mingw_binary_path}/i386-mingw32-windres \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
-DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
{source_directory}
make
===============================
Distribution-Specific Packaging
===============================
RPM Packages for RHEL / CentOS
------------------------------
The RPM spec files and patches used to create the nightly builds
and releases can be found in the "contrib/rpm/el{5,6}" directories
of the TigerVNC subversion trunk. All external source tarballs
must be fetched manually and placed into the 'SOURCES' directory
under the rpmbuild root. Additionally, the following macros need
to be defined:
EL6:
%debug_package %{nil}
EL5:
%dist .el5
%_smp_mflags -j3
%debug_package %{nil}
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
Debian packages for Ubuntu 12.04LTS
-----------------------------------
The debian folder used to create the nightly builds and releases
can be found in the "contrib/deb/ubuntu-precise" directory of the
TigerVNC subversion trunk.
|
{
"pile_set_name": "Github"
}
|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.15.11
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1ServicePort(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'name': 'str',
'node_port': 'int',
'port': 'int',
'protocol': 'str',
'target_port': 'object'
}
attribute_map = {
'name': 'name',
'node_port': 'nodePort',
'port': 'port',
'protocol': 'protocol',
'target_port': 'targetPort'
}
def __init__(self, name=None, node_port=None, port=None, protocol=None, target_port=None, local_vars_configuration=None): # noqa: E501
"""V1ServicePort - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._name = None
self._node_port = None
self._port = None
self._protocol = None
self._target_port = None
self.discriminator = None
if name is not None:
self.name = name
if node_port is not None:
self.node_port = node_port
self.port = port
if protocol is not None:
self.protocol = protocol
if target_port is not None:
self.target_port = target_port
@property
def name(self):
"""Gets the name of this V1ServicePort. # noqa: E501
The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service. # noqa: E501
:return: The name of this V1ServicePort. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this V1ServicePort.
The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service. # noqa: E501
:param name: The name of this V1ServicePort. # noqa: E501
:type: str
"""
self._name = name
@property
def node_port(self):
"""Gets the node_port of this V1ServicePort. # noqa: E501
The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport # noqa: E501
:return: The node_port of this V1ServicePort. # noqa: E501
:rtype: int
"""
return self._node_port
@node_port.setter
def node_port(self, node_port):
"""Sets the node_port of this V1ServicePort.
The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport # noqa: E501
:param node_port: The node_port of this V1ServicePort. # noqa: E501
:type: int
"""
self._node_port = node_port
@property
def port(self):
"""Gets the port of this V1ServicePort. # noqa: E501
The port that will be exposed by this service. # noqa: E501
:return: The port of this V1ServicePort. # noqa: E501
:rtype: int
"""
return self._port
@port.setter
def port(self, port):
"""Sets the port of this V1ServicePort.
The port that will be exposed by this service. # noqa: E501
:param port: The port of this V1ServicePort. # noqa: E501
:type: int
"""
if self.local_vars_configuration.client_side_validation and port is None: # noqa: E501
raise ValueError("Invalid value for `port`, must not be `None`") # noqa: E501
self._port = port
@property
def protocol(self):
"""Gets the protocol of this V1ServicePort. # noqa: E501
The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP. # noqa: E501
:return: The protocol of this V1ServicePort. # noqa: E501
:rtype: str
"""
return self._protocol
@protocol.setter
def protocol(self, protocol):
"""Sets the protocol of this V1ServicePort.
The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP. # noqa: E501
:param protocol: The protocol of this V1ServicePort. # noqa: E501
:type: str
"""
self._protocol = protocol
@property
def target_port(self):
"""Gets the target_port of this V1ServicePort. # noqa: E501
Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service # noqa: E501
:return: The target_port of this V1ServicePort. # noqa: E501
:rtype: object
"""
return self._target_port
@target_port.setter
def target_port(self, target_port):
"""Sets the target_port of this V1ServicePort.
Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service # noqa: E501
:param target_port: The target_port of this V1ServicePort. # noqa: E501
:type: object
"""
self._target_port = target_port
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, V1ServicePort):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, V1ServicePort):
return True
return self.to_dict() != other.to_dict()
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright © 2017 camunda services GmbH ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.zeebe.model.bpmn.validation.zeebe;
import io.zeebe.model.bpmn.instance.BaseElement;
import io.zeebe.model.bpmn.instance.ExtensionElements;
import org.camunda.bpm.model.xml.instance.ModelElementInstance;
import org.camunda.bpm.model.xml.validation.ModelElementValidator;
import org.camunda.bpm.model.xml.validation.ValidationResultCollector;
public final class ExtensionElementsValidator<T extends BaseElement, E extends ModelElementInstance>
implements ModelElementValidator<T> {
private final Class<T> elementType;
private final Class<E> extensionElement;
private final String extensionElementName;
private ExtensionElementsValidator(
final Class<T> elementType,
final Class<E> extensionElement,
final String extensionElementName) {
this.elementType = elementType;
this.extensionElement = extensionElement;
this.extensionElementName = extensionElementName;
}
@Override
public Class<T> getElementType() {
return elementType;
}
@Override
public void validate(final T element, final ValidationResultCollector validationResultCollector) {
final ExtensionElements extensionElements = element.getExtensionElements();
if (extensionElements == null
|| extensionElements.getChildElementsByType(extensionElement).size() != 1) {
validationResultCollector.addError(
0,
String.format(
"Must have exactly one 'zeebe:%s' extension element", extensionElementName));
}
}
public static <T extends BaseElement> Builder<T> verifyThat(final Class<T> elementType) {
return new Builder<>(elementType);
}
public static class Builder<T extends BaseElement> {
private final Class<T> elementType;
public Builder(final Class<T> elementType) {
this.elementType = elementType;
}
public <E extends ModelElementInstance>
ExtensionElementsValidator<T, E> hasSingleExtensionElement(
final Class<E> extensionElement, final String name) {
return new ExtensionElementsValidator<>(elementType, extensionElement, name);
}
}
}
|
{
"pile_set_name": "Github"
}
|
@import '../../../assets/sass/theme.scss';
.project-share-button {
background-color: transparent;
height: 100%;
width: 100%;
border-radius: 0;
&:hover{
background-color: $lighter-3;
}
&.is-disabled {
.ms-Icon {
color: $darker-5;
font-size: 1rem;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSCameraUsageDescription</key>
<string>Need camera please!</string>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using UnityEngine;
using System.Collections;
namespace DaydreamElements.Teleport {
/// Animate player teleport transition with a linear animation.
public class LinearTeleportTransition : BaseTeleportTransition {
/// Speed of Lerp transition.
[Tooltip("Speed of transition")]
public float transitionSpeed = 10.0f;
/// True if transition is in progress.
public override bool IsTransitioning { get { return isTransitioning; } }
private bool isTransitioning;
private Vector3 targetPosition;
private Transform player;
void Update () {
if (isTransitioning == false) {
return;
}
// Animate player to position with linear steps
player.position = Vector3.MoveTowards(
player.position,
targetPosition,
transitionSpeed * Time.deltaTime);
// Check if transition is finished.
if (player.transform.position.Equals(targetPosition)) {
isTransitioning = false;
}
}
public override void StartTransition(
Transform playerTransform, Transform controller, Vector3 target) {
player = playerTransform;
targetPosition = target;
isTransitioning = true;
}
public override void CancelTransition() {
isTransitioning = false;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/sso-admin/SSOAdmin_EXPORTS.h>
#include <aws/sso-admin/SSOAdminRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sso-admin/model/ProvisioningStatus.h>
#include <utility>
namespace Aws
{
namespace SSOAdmin
{
namespace Model
{
/**
*/
class AWS_SSOADMIN_API ListAccountsForProvisionedPermissionSetRequest : public SSOAdminRequest
{
public:
ListAccountsForProvisionedPermissionSetRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "ListAccountsForProvisionedPermissionSet"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline const Aws::String& GetInstanceArn() const{ return m_instanceArn; }
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline bool InstanceArnHasBeenSet() const { return m_instanceArnHasBeenSet; }
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline void SetInstanceArn(const Aws::String& value) { m_instanceArnHasBeenSet = true; m_instanceArn = value; }
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline void SetInstanceArn(Aws::String&& value) { m_instanceArnHasBeenSet = true; m_instanceArn = std::move(value); }
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline void SetInstanceArn(const char* value) { m_instanceArnHasBeenSet = true; m_instanceArn.assign(value); }
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithInstanceArn(const Aws::String& value) { SetInstanceArn(value); return *this;}
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithInstanceArn(Aws::String&& value) { SetInstanceArn(std::move(value)); return *this;}
/**
* <p>The ARN of the SSO instance under which the operation will be executed. For
* more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names
* (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithInstanceArn(const char* value) { SetInstanceArn(value); return *this;}
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline const Aws::String& GetPermissionSetArn() const{ return m_permissionSetArn; }
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline bool PermissionSetArnHasBeenSet() const { return m_permissionSetArnHasBeenSet; }
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline void SetPermissionSetArn(const Aws::String& value) { m_permissionSetArnHasBeenSet = true; m_permissionSetArn = value; }
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline void SetPermissionSetArn(Aws::String&& value) { m_permissionSetArnHasBeenSet = true; m_permissionSetArn = std::move(value); }
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline void SetPermissionSetArn(const char* value) { m_permissionSetArnHasBeenSet = true; m_permissionSetArn.assign(value); }
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithPermissionSetArn(const Aws::String& value) { SetPermissionSetArn(value); return *this;}
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithPermissionSetArn(Aws::String&& value) { SetPermissionSetArn(std::move(value)); return *this;}
/**
* <p>The ARN of the <a>PermissionSet</a> from which the associated AWS accounts
* will be listed.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithPermissionSetArn(const char* value) { SetPermissionSetArn(value); return *this;}
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline const ProvisioningStatus& GetProvisioningStatus() const{ return m_provisioningStatus; }
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline bool ProvisioningStatusHasBeenSet() const { return m_provisioningStatusHasBeenSet; }
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline void SetProvisioningStatus(const ProvisioningStatus& value) { m_provisioningStatusHasBeenSet = true; m_provisioningStatus = value; }
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline void SetProvisioningStatus(ProvisioningStatus&& value) { m_provisioningStatusHasBeenSet = true; m_provisioningStatus = std::move(value); }
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithProvisioningStatus(const ProvisioningStatus& value) { SetProvisioningStatus(value); return *this;}
/**
* <p>The permission set provisioning status for an AWS account.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithProvisioningStatus(ProvisioningStatus&& value) { SetProvisioningStatus(std::move(value)); return *this;}
/**
* <p>The maximum number of results to display for the <a>PermissionSet</a>.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The maximum number of results to display for the <a>PermissionSet</a>.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The maximum number of results to display for the <a>PermissionSet</a>.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The maximum number of results to display for the <a>PermissionSet</a>.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The pagination token for the list API. Initially the value is null. Use the
* output of previous API calls to make subsequent calls.</p>
*/
inline ListAccountsForProvisionedPermissionSetRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::String m_instanceArn;
bool m_instanceArnHasBeenSet;
Aws::String m_permissionSetArn;
bool m_permissionSetArnHasBeenSet;
ProvisioningStatus m_provisioningStatus;
bool m_provisioningStatusHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
};
} // namespace Model
} // namespace SSOAdmin
} // namespace Aws
|
{
"pile_set_name": "Github"
}
|
package memcache
import (
"context"
"strconv"
"strings"
"time"
"github.com/go-kratos/kratos/pkg/log"
"github.com/go-kratos/kratos/pkg/net/trace"
)
const (
_slowLogDuration = time.Millisecond * 250
)
func newTraceConn(conn Conn, address string) Conn {
tags := []trace.Tag{
trace.String(trace.TagSpanKind, "client"),
trace.String(trace.TagComponent, "cache/memcache"),
trace.String(trace.TagPeerService, "memcache"),
trace.String(trace.TagPeerAddress, address),
}
return &traceConn{Conn: conn, tags: tags}
}
type traceConn struct {
Conn
tags []trace.Tag
}
func (t *traceConn) setTrace(ctx context.Context, action, statement string) func(error) error {
now := time.Now()
parent, ok := trace.FromContext(ctx)
if !ok {
return func(err error) error { return err }
}
span := parent.Fork("", "Memcache:"+action)
span.SetTag(t.tags...)
span.SetTag(trace.String(trace.TagDBStatement, action+" "+statement))
return func(err error) error {
span.Finish(&err)
t := time.Since(now)
if t > _slowLogDuration {
log.Warn("memcache slow log action: %s key: %s time: %v", action, statement, t)
}
return err
}
}
func (t *traceConn) AddContext(ctx context.Context, item *Item) error {
finishFn := t.setTrace(ctx, "Add", item.Key)
return finishFn(t.Conn.Add(item))
}
func (t *traceConn) SetContext(ctx context.Context, item *Item) error {
finishFn := t.setTrace(ctx, "Set", item.Key)
return finishFn(t.Conn.Set(item))
}
func (t *traceConn) ReplaceContext(ctx context.Context, item *Item) error {
finishFn := t.setTrace(ctx, "Replace", item.Key)
return finishFn(t.Conn.Replace(item))
}
func (t *traceConn) GetContext(ctx context.Context, key string) (*Item, error) {
finishFn := t.setTrace(ctx, "Get", key)
item, err := t.Conn.Get(key)
return item, finishFn(err)
}
func (t *traceConn) GetMultiContext(ctx context.Context, keys []string) (map[string]*Item, error) {
finishFn := t.setTrace(ctx, "GetMulti", strings.Join(keys, " "))
items, err := t.Conn.GetMulti(keys)
return items, finishFn(err)
}
func (t *traceConn) DeleteContext(ctx context.Context, key string) error {
finishFn := t.setTrace(ctx, "Delete", key)
return finishFn(t.Conn.Delete(key))
}
func (t *traceConn) IncrementContext(ctx context.Context, key string, delta uint64) (newValue uint64, err error) {
finishFn := t.setTrace(ctx, "Increment", key+" "+strconv.FormatUint(delta, 10))
newValue, err = t.Conn.Increment(key, delta)
return newValue, finishFn(err)
}
func (t *traceConn) DecrementContext(ctx context.Context, key string, delta uint64) (newValue uint64, err error) {
finishFn := t.setTrace(ctx, "Decrement", key+" "+strconv.FormatUint(delta, 10))
newValue, err = t.Conn.Decrement(key, delta)
return newValue, finishFn(err)
}
func (t *traceConn) CompareAndSwapContext(ctx context.Context, item *Item) error {
finishFn := t.setTrace(ctx, "CompareAndSwap", item.Key)
return finishFn(t.Conn.CompareAndSwap(item))
}
func (t *traceConn) TouchContext(ctx context.Context, key string, seconds int32) (err error) {
finishFn := t.setTrace(ctx, "Touch", key+" "+strconv.Itoa(int(seconds)))
return finishFn(t.Conn.Touch(key, seconds))
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8" ?>
<result>
<nb_visits>35</nb_visits>
<nb_actions>95</nb_actions>
<nb_visits_converted>35</nb_visits_converted>
<bounce_count>18</bounce_count>
<sum_visit_length>27579</sum_visit_length>
<max_actions>5</max_actions>
<bounce_rate>51%</bounce_rate>
<nb_actions_per_visit>2.7</nb_actions_per_visit>
<avg_time_on_site>788</avg_time_on_site>
</result>
|
{
"pile_set_name": "Github"
}
|
package com.zdcf.leetcode;
//860. Lemonade Change
//At a lemonade stand, each lemonade costs $5.
//
// Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).
//
// Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net transaction is that the customer pays $5.
//
// Note that you don't have any change in hand at first.
//
// Return true if and only if you can provide every customer with correct change.
//
//
//
// Example 1:
//
// Input: [5,5,5,10,20]
// Output: true
// Explanation:
// From the first 3 customers, we collect three $5 bills in order.
// From the fourth customer, we collect a $10 bill and give back a $5.
// From the fifth customer, we give a $10 bill and a $5 bill.
// Since all customers got correct change, we output true.
// Example 2:
//
// Input: [5,5,10]
// Output: true
// Example 3:
//
// Input: [10,10]
// Output: false
// Example 4:
//
// Input: [5,5,10,10,20]
// Output: false
// Explanation:
// From the first two customers in order, we collect two $5 bills.
// For the next two customers in order, we collect a $10 bill and give back a $5 bill.
// For the last customer, we can't give change of $15 back because we only have two $10 bills.
// Since not every customer received correct change, the answer is false.
//
//
// Note:
//
// 0 <= bills.length <= 10000
// bills[i] will be either 5, 10, or 20.
public class LemonadeChange {
public static boolean lemonadeChange(int[] bills) {
int temp[] = new int[2];
for(int i=0;i<bills.length;i++){
if(bills[i]==5){
temp[0]++;
}else if(bills[i]==10){
if(temp[0]==0){
return false;
}else{
temp[0]--;
temp[1]++;
}
}else if (bills[i]==20){
if(temp[1]>0&&temp[0]>0){
temp[0]--;
temp[1]--;
}else if (temp[0]>2){
temp[0]= temp[0]-3;
}else{
return false;
}
}
}
return true;
}
public static void main(String[] args) {
int[] a = {5,5,10,20,5,5,5,5,5,5,5,5,5,10,5,5,20,5,20,5};
System.out.println( lemonadeChange(a));
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package SpringWeb
import (
"net/http"
)
const (
MethodGet = 0x0001 // "GET"
MethodHead = 0x0002 // "HEAD"
MethodPost = 0x0004 // "POST"
MethodPut = 0x0008 // "PUT"
MethodPatch = 0x0010 // "PATCH"
MethodDelete = 0x0020 // "DELETE"
MethodConnect = 0x0040 // "CONNECT"
MethodOptions = 0x0080 // "OPTIONS"
MethodTrace = 0x0100 // "TRACE"
MethodAny = 0xffff
MethodGetPost = MethodGet | MethodPost
)
var methods = map[uint32]string{
MethodGet: http.MethodGet,
MethodHead: http.MethodHead,
MethodPost: http.MethodPost,
MethodPut: http.MethodPut,
MethodPatch: http.MethodPatch,
MethodDelete: http.MethodDelete,
MethodConnect: http.MethodConnect,
MethodOptions: http.MethodOptions,
MethodTrace: http.MethodTrace,
}
// GetMethod 返回 method 对应的 HTTP 方法
func GetMethod(method uint32) []string {
var r []string
for k, v := range methods {
if method&k == k {
r = append(r, v)
}
}
return r
}
|
{
"pile_set_name": "Github"
}
|
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Mark Pilgrim - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from . import constants
import sys
from .charsetprober import CharSetProber
class CharSetGroupProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mActiveNum = 0
self._mProbers = []
self._mBestGuessProber = None
def reset(self):
CharSetProber.reset(self)
self._mActiveNum = 0
for prober in self._mProbers:
if prober:
prober.reset()
prober.active = True
self._mActiveNum += 1
self._mBestGuessProber = None
def get_charset_name(self):
if not self._mBestGuessProber:
self.get_confidence()
if not self._mBestGuessProber:
return None
# self._mBestGuessProber = self._mProbers[0]
return self._mBestGuessProber.get_charset_name()
def feed(self, aBuf):
for prober in self._mProbers:
if not prober:
continue
if not prober.active:
continue
st = prober.feed(aBuf)
if not st:
continue
if st == constants.eFoundIt:
self._mBestGuessProber = prober
return self.get_state()
elif st == constants.eNotMe:
prober.active = False
self._mActiveNum -= 1
if self._mActiveNum <= 0:
self._mState = constants.eNotMe
return self.get_state()
return self.get_state()
def get_confidence(self):
st = self.get_state()
if st == constants.eFoundIt:
return 0.99
elif st == constants.eNotMe:
return 0.01
bestConf = 0.0
self._mBestGuessProber = None
for prober in self._mProbers:
if not prober:
continue
if not prober.active:
if constants._debug:
sys.stderr.write(prober.get_charset_name()
+ ' not active\n')
continue
cf = prober.get_confidence()
if constants._debug:
sys.stderr.write('%s confidence = %s\n' %
(prober.get_charset_name(), cf))
if bestConf < cf:
bestConf = cf
self._mBestGuessProber = prober
if not self._mBestGuessProber:
return 0.0
return bestConf
# else:
# self._mBestGuessProber = self._mProbers[0]
# return self._mBestGuessProber.get_confidence()
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2015 Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
* integrated circuit in a product or a software update for such product, must reproduce
* the above copyright notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific prior
* written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary or object form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef MUTEX_H__
#define MUTEX_H__
#include <stdint.h>
#include <stdbool.h>
/**
* @cond NO_DOXYGEN
* @defgroup pm_mutex Mutex
* @ingroup peer_manager
* @{
* @brief An internal module of @ref peer_manager. This module provides thread-safe mutexes.
*/
/**@brief Defines the storage size of a specified mutex group.
*
* @param number_of_mutexes the number of mutexes in the group.
*/
#define MUTEX_STORAGE_SIZE(number_of_mutexes) ((7 + (number_of_mutexes)) >> 3)
/**@brief Initializes a mutex group.
*
* @param[in] p_mutex Pointer to the mutex group. See @ref MUTEX_STORAGE_SIZE().
* @param[in] mutex_size The size of the mutex group in number of mutexes.
*/
void pm_mutex_init(uint8_t * p_mutex, uint16_t mutex_size);
/**@brief Locks the mutex specified by the bit id.
*
* @param[inout] p_mutex Pointer to the mutex group.
* @param[in] mutex_bit_id The bit id of the mutex.
*
* @retval true if it was possible to lock the mutex.
* @retval false otherwise.
*/
bool pm_mutex_lock(uint8_t * p_mutex, uint16_t mutex_bit_id);
/**@brief Locks the first unlocked mutex within the mutex group.
*
* @param[in, out] p_mutex Pointer to the mutex group.
* @param[in] mutex_size The size of the mutex group.
*
* @return The first unlocked mutex id in the group.
* @retval group-size if there was no unlocked mutex available.
*/
uint16_t pm_mutex_lock_first_available(uint8_t * p_mutex, uint16_t mutex_size);
/**@brief Unlocks the mutex specified by the bit id.
*
* @param[in, out] p_mutex Pointer to the mutex group.
* @param[in] mutex_bit_id The bit id of the mutex.
*/
void pm_mutex_unlock(uint8_t * p_mutex, uint16_t mutex_bit_id);
/**@brief Gets the locking status of the specified mutex.
*
* @param[in, out] p_mutex Pointer to the mutex group.
* @param[in] mutex_bit_id The bit id of the mutex.
*
* @retval true if the mutex was locked.
* @retval false otherwise.
*/
bool pm_mutex_lock_status_get(uint8_t * p_mutex, uint16_t mutex_bit_id);
#endif // MUTEX_H__
/** @}
* @endcond
*/
|
{
"pile_set_name": "Github"
}
|
#
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
main.usage.summary=\
Usage: {0} <extract | info | list | verify> <options> jimage...\n\
use -h or --help for a list of possible options.
main.usage=\
Usage: {0} <extract | info | list | verify> <options> jimage...\n\
\n\
\ extract - Extract all jimage entries and place in a directory specified\n\
\ by the --dir=<directory> (default='.') option.\n\
\n\
\ info - Prints detailed information contained in the jimage header.\n\
\n\
\ list - Prints the names of all the entries in the jimage. When used with\n\
\ --verbose, list will also print entry size and offset attributes.\n\
\n\
\ verify - Reports on any .class entries that don't verify as classes.\n\
\n\
Possible options include:
main.usage.extract=\
\ extract - Extract all jimage entries and place in a directory specified\n\
\ by the --dir=<directory> (default='.') option.
main.usage.info=\
\ info - Prints detailed information contained in the jimage header.
main.usage.list=\
\ list - Prints the names of all the entries in the jimage. When used with\n\
\ --verbose, list will also print entry size and offset attributes.
main.usage.verify=\
\ verify - Reports errors on any .class entries that don't verify as classes.
error.prefix=Error:
warn.prefix=Warning:
main.opt.dir=\
\ --dir Target directory for extract directive
main.opt.include=\
\ --include <pattern-list> Pattern list for filtering entries.
main.opt.full-version=\
\ --full-version Print full version information
main.opt.help=\
\ -?, -h, --help Print this help message
main.opt.verbose=\
\ --verbose Listing prints entry size and offset\n\
\ attributes
main.opt.version=\
\ --version Print version information
main.command.files=\
\ @<filename> Read options from file
main.opt.footer=\
\n\
\For options requiring a <pattern-list>, the value will be a comma separated\n\
\list of elements each using one the following forms:\n\
\ <glob-pattern>\n\
\ glob:<glob-pattern>\n\
\ regex:<regex-pattern>
err.not.a.task=task must be one of <extract | info | list | verify>: {0}
err.missing.arg=no value given for {0}
err.not.a.dir=not a directory: {0}
err.not.a.jimage=not a jimage file: {0}
err.invalid.jimage=Unable to open {0}: {1}
err.no.jimage=no jimage provided
err.option.unsupported={0} not supported: {1}
err.unknown.option=unknown option: {0}
err.cannot.create.dir=cannot create directory {0}
|
{
"pile_set_name": "Github"
}
|
<!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.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Brew.js: bjs::js::Object Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</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>
<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 id="projectlogo"><img alt="Logo" src="Doxygen.Logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Brew.js
 <span id="projectnumber">2.0 - beta 1</span>
</div>
<div id="projectbrief">Brew.js - C++ high-level JavaScript API for Nintendo 3DS/Switch - Nintendo 3DS documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classbjs_1_1js_1_1_object.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classbjs_1_1js_1_1_object-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">bjs::js::Object Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Represents a JavaScript object. Usually used in <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>.
<a href="classbjs_1_1js_1_1_object.html#details">More...</a></p>
<p><code>#include <<a class="el" href="_types_8hpp_source.html">Types.hpp</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abf521cc6fea780561f71a9319f9e0474"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#abf521cc6fea780561f71a9319f9e0474">Object</a> (<a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> Context)</td></tr>
<tr class="memdesc:abf521cc6fea780561f71a9319f9e0474"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new object with the given context. <a href="#abf521cc6fea780561f71a9319f9e0474">More...</a><br /></td></tr>
<tr class="separator:abf521cc6fea780561f71a9319f9e0474"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ea889f83e95f9f796ef259793e3d7a0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a7ea889f83e95f9f796ef259793e3d7a0">Object</a> (<a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> Context, u32 Index)</td></tr>
<tr class="memdesc:a7ea889f83e95f9f796ef259793e3d7a0"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new object object with the given context and from the specifiec argument index. <a href="#a7ea889f83e95f9f796ef259793e3d7a0">More...</a><br /></td></tr>
<tr class="separator:a7ea889f83e95f9f796ef259793e3d7a0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a86396453681daa26205a6855aa7ad36b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a86396453681daa26205a6855aa7ad36b">Initialize</a> ()</td></tr>
<tr class="memdesc:a86396453681daa26205a6855aa7ad36b"><td class="mdescLeft"> </td><td class="mdescRight">Initializes internally the array. <a href="#a86396453681daa26205a6855aa7ad36b">More...</a><br /></td></tr>
<tr class="separator:a86396453681daa26205a6855aa7ad36b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6f5bbb6dce389be20f35adc0597760ac"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a6f5bbb6dce389be20f35adc0597760ac">AddString</a> (std::string Name, std::string Value)</td></tr>
<tr class="memdesc:a6f5bbb6dce389be20f35adc0597760ac"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a std::string with the specified property name to the object. <a href="#a6f5bbb6dce389be20f35adc0597760ac">More...</a><br /></td></tr>
<tr class="separator:a6f5bbb6dce389be20f35adc0597760ac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef96bd0d7dc55bec9a95727d76d5e967"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#aef96bd0d7dc55bec9a95727d76d5e967">AddInt</a> (std::string Name, s64 Value)</td></tr>
<tr class="memdesc:aef96bd0d7dc55bec9a95727d76d5e967"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a signed integer with the specified property name to the object. <a href="#aef96bd0d7dc55bec9a95727d76d5e967">More...</a><br /></td></tr>
<tr class="separator:aef96bd0d7dc55bec9a95727d76d5e967"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd40a2868426c7d25fa38cb46d37e980"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#acd40a2868426c7d25fa38cb46d37e980">AddUInt</a> (std::string Name, u64 Value)</td></tr>
<tr class="memdesc:acd40a2868426c7d25fa38cb46d37e980"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) an unsigned integer with the specified property name to the object. <a href="#acd40a2868426c7d25fa38cb46d37e980">More...</a><br /></td></tr>
<tr class="separator:acd40a2868426c7d25fa38cb46d37e980"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4220a226928a602f858b8f92e83a19be"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a4220a226928a602f858b8f92e83a19be">AddDouble</a> (std::string Name, double Value)</td></tr>
<tr class="memdesc:a4220a226928a602f858b8f92e83a19be"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a double with the specified property name to the object. <a href="#a4220a226928a602f858b8f92e83a19be">More...</a><br /></td></tr>
<tr class="separator:a4220a226928a602f858b8f92e83a19be"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae473e82055428cd9fd1173b806740173"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#ae473e82055428cd9fd1173b806740173">AddBoolean</a> (std::string Name, bool Value)</td></tr>
<tr class="memdesc:ae473e82055428cd9fd1173b806740173"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a boolean with the specified property name to the object. <a href="#ae473e82055428cd9fd1173b806740173">More...</a><br /></td></tr>
<tr class="separator:ae473e82055428cd9fd1173b806740173"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aee12a74187ef140514e3a68801510e89"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#aee12a74187ef140514e3a68801510e89">AddFunction</a> (std::string Name, <a class="el" href="namespacebjs_1_1js.html#aa2c3229ee238c28865176ec6f38dbc3c">NativeFunction</a> Value)</td></tr>
<tr class="memdesc:aee12a74187ef140514e3a68801510e89"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) an API JS function with the specified property name to the object. <a href="#aee12a74187ef140514e3a68801510e89">More...</a><br /></td></tr>
<tr class="separator:aee12a74187ef140514e3a68801510e89"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fec037acd9111967237055cdf914c69"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a4fec037acd9111967237055cdf914c69">AddUndefined</a> (std::string Name)</td></tr>
<tr class="memdesc:a4fec037acd9111967237055cdf914c69"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) an undefined value with the specified property name to the object. <a href="#a4fec037acd9111967237055cdf914c69">More...</a><br /></td></tr>
<tr class="separator:a4fec037acd9111967237055cdf914c69"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adaa5fef88e205892249007d78a037aca"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#adaa5fef88e205892249007d78a037aca">AddNull</a> (std::string Name)</td></tr>
<tr class="memdesc:adaa5fef88e205892249007d78a037aca"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a null value with the specified property name to the object. <a href="#adaa5fef88e205892249007d78a037aca">More...</a><br /></td></tr>
<tr class="separator:adaa5fef88e205892249007d78a037aca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a32aa0ade07b9ce6bb41e316f08a5082d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a32aa0ade07b9ce6bb41e316f08a5082d">AddNaN</a> (std::string Name)</td></tr>
<tr class="memdesc:a32aa0ade07b9ce6bb41e316f08a5082d"><td class="mdescLeft"> </td><td class="mdescRight">Adds (pushes) a NaN value with the specified property name to the object. <a href="#a32aa0ade07b9ce6bb41e316f08a5082d">More...</a><br /></td></tr>
<tr class="separator:a32aa0ade07b9ce6bb41e316f08a5082d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b6fd61343e2f8f6094703b77b12a122"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a8b6fd61343e2f8f6094703b77b12a122">InitializeAddingArray</a> (std::string Name, <a class="el" href="classbjs_1_1js_1_1_array.html">Array</a> &Value)</td></tr>
<tr class="separator:a8b6fd61343e2f8f6094703b77b12a122"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0635514830920be3952ff2f9635c9a88"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a0635514830920be3952ff2f9635c9a88">FinalizeAddingArray</a> ()</td></tr>
<tr class="separator:a0635514830920be3952ff2f9635c9a88"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a286c6483a1411a4622b372fbe5c3edde"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a286c6483a1411a4622b372fbe5c3edde">InitializeAddingObject</a> (std::string Name, <a class="el" href="classbjs_1_1js_1_1_object.html">Object</a> &Value)</td></tr>
<tr class="separator:a286c6483a1411a4622b372fbe5c3edde"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adddc3f381a4218828421946d2f69a0d2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#adddc3f381a4218828421946d2f69a0d2">FinalizeAddingObject</a> ()</td></tr>
<tr class="separator:adddc3f381a4218828421946d2f69a0d2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af3cc27ef3d6f02cb0a388509296bb1a9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#af3cc27ef3d6f02cb0a388509296bb1a9">Close</a> ()</td></tr>
<tr class="memdesc:af3cc27ef3d6f02cb0a388509296bb1a9"><td class="mdescLeft"> </td><td class="mdescRight">Finishes the object (closes it). <a href="#af3cc27ef3d6f02cb0a388509296bb1a9">More...</a><br /></td></tr>
<tr class="separator:af3cc27ef3d6f02cb0a388509296bb1a9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a0c845ff20cd1806199558f5964bd33"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a5a0c845ff20cd1806199558f5964bd33">GetString</a> (std::string Name)</td></tr>
<tr class="memdesc:a5a0c845ff20cd1806199558f5964bd33"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as a std::string. No conversions are done to get it. <a href="#a5a0c845ff20cd1806199558f5964bd33">More...</a><br /></td></tr>
<tr class="separator:a5a0c845ff20cd1806199558f5964bd33"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4ed635f39e40a53b607764b4cf32d3d8"><td class="memItemLeft" align="right" valign="top">s64 </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a4ed635f39e40a53b607764b4cf32d3d8">GetInt</a> (std::string Name)</td></tr>
<tr class="memdesc:a4ed635f39e40a53b607764b4cf32d3d8"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as a signed integer. No conversions are done to get it. <a href="#a4ed635f39e40a53b607764b4cf32d3d8">More...</a><br /></td></tr>
<tr class="separator:a4ed635f39e40a53b607764b4cf32d3d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6f8fae94880cdaf791237e6628a2db68"><td class="memItemLeft" align="right" valign="top">u64 </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a6f8fae94880cdaf791237e6628a2db68">GetUInt</a> (std::string Name)</td></tr>
<tr class="memdesc:a6f8fae94880cdaf791237e6628a2db68"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as an unsigned integer. No conversions are done to get it. <a href="#a6f8fae94880cdaf791237e6628a2db68">More...</a><br /></td></tr>
<tr class="separator:a6f8fae94880cdaf791237e6628a2db68"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2203d27bcf8784dbadf6982f24c4fe33"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a2203d27bcf8784dbadf6982f24c4fe33">GetDouble</a> (std::string Name)</td></tr>
<tr class="memdesc:a2203d27bcf8784dbadf6982f24c4fe33"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as a double. No conversions are done to get it. <a href="#a2203d27bcf8784dbadf6982f24c4fe33">More...</a><br /></td></tr>
<tr class="separator:a2203d27bcf8784dbadf6982f24c4fe33"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8387fea2d8119578df84836b56dd3500"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a8387fea2d8119578df84836b56dd3500">GetBoolean</a> (std::string Name)</td></tr>
<tr class="memdesc:a8387fea2d8119578df84836b56dd3500"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as a boolean. No conversions are done to get it. <a href="#a8387fea2d8119578df84836b56dd3500">More...</a><br /></td></tr>
<tr class="separator:a8387fea2d8119578df84836b56dd3500"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5b481f46ac3268ff84c2ddf871cdcf5e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbjs_1_1js_1_1_array.html">Array</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a5b481f46ac3268ff84c2ddf871cdcf5e">GetArray</a> (std::string Name)</td></tr>
<tr class="memdesc:a5b481f46ac3268ff84c2ddf871cdcf5e"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as an array. No conversions are done to get it. <a href="#a5b481f46ac3268ff84c2ddf871cdcf5e">More...</a><br /></td></tr>
<tr class="separator:a5b481f46ac3268ff84c2ddf871cdcf5e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a94b6b32a72ea18a60124019583ab8f23"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbjs_1_1js_1_1_object.html">Object</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a94b6b32a72ea18a60124019583ab8f23">GetObject</a> (std::string Name)</td></tr>
<tr class="memdesc:a94b6b32a72ea18a60124019583ab8f23"><td class="mdescLeft"> </td><td class="mdescRight">Gets the property named as the given name as an object. No conversions are done to get it. <a href="#a94b6b32a72ea18a60124019583ab8f23">More...</a><br /></td></tr>
<tr class="separator:a94b6b32a72ea18a60124019583ab8f23"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1480f4c08da607c315326c93d9a953a2"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#a1480f4c08da607c315326c93d9a953a2">AsJSON</a> ()</td></tr>
<tr class="memdesc:a1480f4c08da607c315326c93d9a953a2"><td class="mdescLeft"> </td><td class="mdescRight">Gets the JSON std::string representation of this object. <a href="#a1480f4c08da607c315326c93d9a953a2">More...</a><br /></td></tr>
<tr class="separator:a1480f4c08da607c315326c93d9a953a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac76016510b3b1d73e371786fbf2465a2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#ac76016510b3b1d73e371786fbf2465a2">GetId</a> ()</td></tr>
<tr class="separator:ac76016510b3b1d73e371786fbf2465a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad4d441c678893878f3627d50396d3706"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbjs_1_1js_1_1_object.html#ad4d441c678893878f3627d50396d3706">GetContext</a> ()</td></tr>
<tr class="separator:ad4d441c678893878f3627d50396d3706"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a JavaScript object. Usually used in <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="abf521cc6fea780561f71a9319f9e0474"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf521cc6fea780561f71a9319f9e0474">◆ </a></span>Object() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bjs::js::Object::Object </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> </td>
<td class="paramname"><em>Context</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new object with the given context. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Context</td><td>The context to use with the object. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a7ea889f83e95f9f796ef259793e3d7a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ea889f83e95f9f796ef259793e3d7a0">◆ </a></span>Object() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bjs::js::Object::Object </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> </td>
<td class="paramname"><em>Context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32 </td>
<td class="paramname"><em>Index</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new object object with the given context and from the specifiec argument index. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Context</td><td>The context to use with the object. </td></tr>
<tr><td class="paramname">Index</td><td>The argument index to get it from. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Better to call FunctionHandler.getObject(...) instead! </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae473e82055428cd9fd1173b806740173"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae473e82055428cd9fd1173b806740173">◆ </a></span>AddBoolean()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddBoolean </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a boolean with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The boolean value to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4220a226928a602f858b8f92e83a19be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4220a226928a602f858b8f92e83a19be">◆ </a></span>AddDouble()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddDouble </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a double with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The double value to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aee12a74187ef140514e3a68801510e89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee12a74187ef140514e3a68801510e89">◆ </a></span>AddFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddFunction </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespacebjs_1_1js.html#aa2c3229ee238c28865176ec6f38dbc3c">NativeFunction</a> </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) an API JS function with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The function to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aef96bd0d7dc55bec9a95727d76d5e967"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef96bd0d7dc55bec9a95727d76d5e967">◆ </a></span>AddInt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddInt </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s64 </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a signed integer with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The signed integer value to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a32aa0ade07b9ce6bb41e316f08a5082d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32aa0ade07b9ce6bb41e316f08a5082d">◆ </a></span>AddNaN()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddNaN </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a NaN value with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the NaN will have. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="adaa5fef88e205892249007d78a037aca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adaa5fef88e205892249007d78a037aca">◆ </a></span>AddNull()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddNull </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a null value with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the null will have. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a6f5bbb6dce389be20f35adc0597760ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f5bbb6dce389be20f35adc0597760ac">◆ </a></span>AddString()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddString </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) a std::string with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The std::string value to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="acd40a2868426c7d25fa38cb46d37e980"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd40a2868426c7d25fa38cb46d37e980">◆ </a></span>AddUInt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddUInt </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u64 </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) an unsigned integer with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the value will have. </td></tr>
<tr><td class="paramname">Value</td><td>The unsigned integer value to add. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4fec037acd9111967237055cdf914c69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fec037acd9111967237055cdf914c69">◆ </a></span>AddUndefined()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::AddUndefined </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds (pushes) an undefined value with the specified property name to the object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name the undefined will have. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a1480f4c08da607c315326c93d9a953a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1480f4c08da607c315326c93d9a953a2">◆ </a></span>AsJSON()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string bjs::js::Object::AsJSON </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the JSON std::string representation of this object. </p>
<dl class="section return"><dt>Returns</dt><dd>The JSON representation as a std::string. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="af3cc27ef3d6f02cb0a388509296bb1a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3cc27ef3d6f02cb0a388509296bb1a9">◆ </a></span>Close()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::Close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Finishes the object (closes it). </p>
<dl class="section note"><dt>Note</dt><dd>This should NOT be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a0635514830920be3952ff2f9635c9a88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0635514830920be3952ff2f9635c9a88">◆ </a></span>FinalizeAddingArray()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::FinalizeAddingArray </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="adddc3f381a4218828421946d2f69a0d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adddc3f381a4218828421946d2f69a0d2">◆ </a></span>FinalizeAddingObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::FinalizeAddingObject </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a5b481f46ac3268ff84c2ddf871cdcf5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b481f46ac3268ff84c2ddf871cdcf5e">◆ </a></span>GetArray()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classbjs_1_1js_1_1_array.html">Array</a> bjs::js::Object::GetArray </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as an array. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as an array. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a8387fea2d8119578df84836b56dd3500"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8387fea2d8119578df84836b56dd3500">◆ </a></span>GetBoolean()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool bjs::js::Object::GetBoolean </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as a boolean. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as a boolean. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="ad4d441c678893878f3627d50396d3706"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4d441c678893878f3627d50396d3706">◆ </a></span>GetContext()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacebjs_1_1js.html#a488315754def6b6114338db05a2d1150">NativeContext</a> bjs::js::Object::GetContext </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2203d27bcf8784dbadf6982f24c4fe33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2203d27bcf8784dbadf6982f24c4fe33">◆ </a></span>GetDouble()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double bjs::js::Object::GetDouble </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as a double. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as a double. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="ac76016510b3b1d73e371786fbf2465a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac76016510b3b1d73e371786fbf2465a2">◆ </a></span>GetId()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int bjs::js::Object::GetId </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4ed635f39e40a53b607764b4cf32d3d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ed635f39e40a53b607764b4cf32d3d8">◆ </a></span>GetInt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s64 bjs::js::Object::GetInt </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as a signed integer. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as a signed integer. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a94b6b32a72ea18a60124019583ab8f23"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94b6b32a72ea18a60124019583ab8f23">◆ </a></span>GetObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classbjs_1_1js_1_1_object.html">Object</a> bjs::js::Object::GetObject </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as an object. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as an object. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a5a0c845ff20cd1806199558f5964bd33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a0c845ff20cd1806199558f5964bd33">◆ </a></span>GetString()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string bjs::js::Object::GetString </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as a std::string. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as a std::string. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a6f8fae94880cdaf791237e6628a2db68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f8fae94880cdaf791237e6628a2db68">◆ </a></span>GetUInt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u64 bjs::js::Object::GetUInt </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the property named as the given name as an unsigned integer. No conversions are done to get it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Name</td><td>The name of the property. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The property as an unsigned integer. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This should ONLY be CALLED if using it from a <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a>. </dd></dl>
</div>
</div>
<a id="a86396453681daa26205a6855aa7ad36b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86396453681daa26205a6855aa7ad36b">◆ </a></span>Initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::Initialize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes internally the array. </p>
<dl class="section note"><dt>Note</dt><dd>This should NOT be CALLED manually, as pushing it to <a class="el" href="classbjs_1_1js_1_1_function_handler.html" title="Class for handling API JS functions. It should be instantiated in API JS functions. ">FunctionHandler</a> actually calls this. </dd></dl>
</div>
</div>
<a id="a8b6fd61343e2f8f6094703b77b12a122"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b6fd61343e2f8f6094703b77b12a122">◆ </a></span>InitializeAddingArray()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::InitializeAddingArray </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classbjs_1_1js_1_1_array.html">Array</a> & </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a286c6483a1411a4622b372fbe5c3edde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a286c6483a1411a4622b372fbe5c3edde">◆ </a></span>InitializeAddingObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void bjs::js::Object::InitializeAddingObject </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"><em>Name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classbjs_1_1js_1_1_object.html">Object</a> & </td>
<td class="paramname"><em>Value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Include/bjs/js/<a class="el" href="_types_8hpp_source.html">Types.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacebjs.html">bjs</a></li><li class="navelem"><a class="el" href="namespacebjs_1_1js.html">js</a></li><li class="navelem"><a class="el" href="classbjs_1_1js_1_1_object.html">Object</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/* @flow weak */
import React from 'react';
import ActionAccountBalance from 'material-ui/lib/svg-icons/action/account-balance'; // Speak in senate
import ActionAccessibility from 'material-ui/lib/svg-icons/action/accessibility'; // Exercise
import ActionDoneAll from 'material-ui/lib/svg-icons/action/done-all'; // Get things done
import ActionTrendingUp from 'material-ui/lib/svg-icons/action/trending-up'; // Play the stock market
import ContentCreate from 'material-ui/lib/svg-icons/content/create'; // Write poems
import HardwareHeadset from 'material-ui/lib/svg-icons/hardware/headset'; // Listen to music
import ImageLandscape from 'material-ui/lib/svg-icons/image/landscape'; // Hike
export default function( theType: number )
{
let itemIcon;
if( theType == 1 ) itemIcon = <ActionAccountBalance />; // Speak in senate
else if( theType == 2 ) itemIcon = <ActionAccessibility />; // Exercise
else if( theType == 3 ) itemIcon = <ActionDoneAll />; // Get things done
else if( theType == 4 ) itemIcon = <ActionTrendingUp />; // Speak in senate
else if( theType == 5 ) itemIcon = <ActionTrendingUp />; // Play the stock market
else if( theType == 6 ) itemIcon = <ContentCreate />; // Write poems
else if( theType == 7 ) itemIcon = <HardwareHeadset />; // Listen to music
else if( theType == 8 ) itemIcon = <ImageLandscape />; // Hike
return itemIcon;
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("language","pt-br",{button:"Configure o Idioma",remove:"Remover Idioma"});
|
{
"pile_set_name": "Github"
}
|
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:vann="http://purl.org/vocab/vann/">
<owl:Ontology rdf:about="http://www.w3.org/2000/01/rdf-schema#">
<vann:preferredNamespacePrefix>rdfs</vann:preferredNamespacePrefix>
</owl:Ontology>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Resource">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>Resource</rdfs:label>
<rdfs:comment>The class resource, everything.</rdfs:comment>
</rdfs:Class>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>type</rdfs:label>
<rdfs:comment>The subject is an instance of a class.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Class">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>Class</rdfs:label>
<rdfs:comment>The class of classes.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdfs:Class>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#subClassOf">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>subClassOf</rdfs:label>
<rdfs:comment>The subject is a subclass of a class.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#subPropertyOf">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>subPropertyOf</rdfs:label>
<rdfs:comment>The subject is a subproperty of a property.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
</rdf:Property>
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>Property</rdfs:label>
<rdfs:comment>The class of RDF properties.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdfs:Class>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#comment">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>comment</rdfs:label>
<rdfs:comment>A description of the subject resource.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#label">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>label</rdfs:label>
<rdfs:comment>A human-readable name for the subject.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#domain">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>domain</rdfs:label>
<rdfs:comment>A domain of the subject property.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#range">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>range</rdfs:label>
<rdfs:comment>A range of the subject property.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#seeAlso">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>seeAlso</rdfs:label>
<rdfs:comment>Further information about the subject resource.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#isDefinedBy">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:subPropertyOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#seeAlso"/>
<rdfs:label>isDefinedBy</rdfs:label>
<rdfs:comment>The definition of the subject resource.</rdfs:comment>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Literal">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>Literal</rdfs:label>
<rdfs:comment>The class of literal values, eg. textual strings and integers.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>Statement</rdfs:label>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:comment>The class of RDF statements.</rdfs:comment>
</rdfs:Class>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#subject">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>subject</rdfs:label>
<rdfs:comment>The subject of the subject RDF statement.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>predicate</rdfs:label>
<rdfs:comment>The predicate of the subject RDF statement.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#object">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>object</rdfs:label>
<rdfs:comment>The object of the subject RDF statement.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Container">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>Container</rdfs:label>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:comment>The class of RDF containers.</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>Bag</rdfs:label>
<rdfs:comment>The class of unordered containers.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Container"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>Seq</rdfs:label>
<rdfs:comment>The class of ordered containers.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Container"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>Alt</rdfs:label>
<rdfs:comment>The class of containers of alternatives.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Container"/>
</rdfs:Class>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>ContainerMembershipProperty</rdfs:label>
<rdfs:comment>The class of container membership properties, rdf:_1, rdf:_2, ...,
all of which are sub-properties of 'member'.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
</rdfs:Class>
<rdf:Property rdf:about="http://www.w3.org/2000/01/rdf-schema#member">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>member</rdfs:label>
<rdfs:comment>A member of the subject resource.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#value">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>value</rdfs:label>
<rdfs:comment>Idiomatic property used for structured values.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<!-- the following are new additions, Nov 2002 -->
<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#List">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>List</rdfs:label>
<rdfs:comment>The class of RDF Lists.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/></rdfs:Class>
<rdf:List rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>nil</rdfs:label>
<rdfs:comment>The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it.</rdfs:comment>
</rdf:List>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#first">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>first</rdfs:label>
<rdfs:comment>The first item in the subject RDF list.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
</rdf:Property>
<rdf:Property rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>rest</rdfs:label>
<rdfs:comment>The rest of the subject RDF list after the first item.</rdfs:comment>
<rdfs:domain rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
</rdf:Property>
<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Datatype">
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2000/01/rdf-schema#"/>
<rdfs:label>Datatype</rdfs:label>
<rdfs:comment>The class of RDF datatypes.</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdfs:Class>
<rdfs:Datatype rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">
<rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<rdfs:label>XMLLiteral</rdfs:label>
<rdfs:comment>The class of XML literal values.</rdfs:comment>
</rdfs:Datatype>
<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#">
<rdfs:seeAlso rdf:resource="http://www.w3.org/2000/01/rdf-schema-more"/>
</rdf:Description>
</rdf:RDF>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/iv_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/apple"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal" >
</ImageView>
<!-- From: file:/D:/MewX_Projects/Wenku8_Android/eclipse-android-old/LightNovelLibrary/res/layout/activity_setting_zoom_view.xml -->
|
{
"pile_set_name": "Github"
}
|
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Screengrid — add_screengrid • mapdeck</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
<!-- bootstrap-toc -->
<link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Add Screengrid — add_screengrid" />
<meta property="og:description" content="The Screen Grid Layer takes in an array of latitude and longitude coordinated points,
aggregates them into histogram bins and renders as a grid" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mapdeck</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.3.4</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa fas fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../articles/mapdeck.html">Get started</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/benchmarks.html">Benchmarks</a>
</li>
<li>
<a href="../articles/colours.html">Colours</a>
</li>
<li>
<a href="../articles/google_map.html">Google Map</a>
</li>
<li>
<a href="../articles/issues.html">Why isn't it working?</a>
</li>
<li>
<a href="../articles/layers.html">Layers</a>
</li>
<li>
<a href="../articles/legends.html">Legends</a>
</li>
<li>
<a href="../articles/tips_tricks.html">Tips & Tricks</a>
</li>
<li>
<a href="../articles/trips.html">Trips</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/SymbolixAU/mapdeck/">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Add Screengrid</h1>
<small class="dont-index">Source: <a href='https://github.com/SymbolixAU/mapdeck/blob/master/R/map_layer_screengrid.R'><code>R/map_layer_screengrid.R</code></a></small>
<div class="hidden name"><code>add_screengrid.Rd</code></div>
</div>
<div class="ref-description">
<p>The Screen Grid Layer takes in an array of latitude and longitude coordinated points,
aggregates them into histogram bins and renders as a grid</p>
</div>
<pre class="usage"><span class='fu'>add_screengrid</span>(
<span class='no'>map</span>,
<span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'>get_map_data</span>(<span class='no'>map</span>),
<span class='kw'>lon</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>lat</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>polyline</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>weight</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>aggregation</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"sum"</span>, <span class='st'>"mean"</span>, <span class='st'>"min"</span>, <span class='st'>"max"</span>),
<span class='kw'>colour_range</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>opacity</span> <span class='kw'>=</span> <span class='fl'>0.8</span>,
<span class='kw'>cell_size</span> <span class='kw'>=</span> <span class='fl'>50</span>,
<span class='kw'>layer_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>update_view</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>focus_layer</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>6</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>map</th>
<td><p>a mapdeck map object</p></td>
</tr>
<tr>
<th>data</th>
<td><p>data to be used in the layer. All coordinates are expected to be
EPSG:4326 (WGS 84) coordinate system</p></td>
</tr>
<tr>
<th>lon</th>
<td><p>column containing longitude values</p></td>
</tr>
<tr>
<th>lat</th>
<td><p>column containing latitude values</p></td>
</tr>
<tr>
<th>polyline</th>
<td><p>optional column of <code>data</code> containing the polylines, if using encoded polylines</p></td>
</tr>
<tr>
<th>weight</th>
<td><p>the weight of each value. Default 1</p></td>
</tr>
<tr>
<th>aggregation</th>
<td><p>one of 'min', 'mean', 'max', 'sum'.
If supplied it specifies how the weights used.</p></td>
</tr>
<tr>
<th>colour_range</th>
<td><p>vector of 6 hex colours</p></td>
</tr>
<tr>
<th>opacity</th>
<td><p>opacity of cells. Value between 0 and 1. Default 0.8</p></td>
</tr>
<tr>
<th>cell_size</th>
<td><p>size of grid squares in pixels. Default 50</p></td>
</tr>
<tr>
<th>layer_id</th>
<td><p>single value specifying an id for the layer. Use this value to
distinguish between shape layers of the same type. Layers with the same id are likely
to conflict and not plot correctly</p></td>
</tr>
<tr>
<th>update_view</th>
<td><p>logical indicating if the map should update the bounds to include this layer</p></td>
</tr>
<tr>
<th>focus_layer</th>
<td><p>logical indicating if the map should update the bounds to only include this layer</p></td>
</tr>
<tr>
<th>digits</th>
<td><p>number of digits for rounding coordinates</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><code>add_screengrid</code> supports POINT and MULTIPOINT sf objects</p>
<h2 class="hasAnchor" id="data"><a class="anchor" href="#data"></a>data</h2>
<p>If the <code>data</code> is a simple feature object, the geometry column is automatically
detected. If the sf object contains more than one geometry column and you want to use a specific one,
you'll need to set the active geometry using <code>sf::st_geometry( x ) <- "your_column" </code>,
where <code>"your_column"</code> is the name of the column you're activating. See <code><a href='https://rdrr.io/pkg/sf/man/st_geometry.html'>?sf::st_geometry</a></code></p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \donttest{</span>
<span class='co'>## You need a valid access token from Mapbox</span>
<span class='no'>key</span> <span class='kw'><-</span> <span class='st'>'abc'</span>
<span class='fu'><a href='set_token.html'>set_token</a></span>( <span class='no'>key</span> )
<span class='no'>df</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/utils/read.table.html'>read.csv</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(
<span class='st'>'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/'</span>,
<span class='st'>'examples/3d-heatmap/heatmap-data.csv'</span>
))
<span class='no'>df</span> <span class='kw'><-</span> <span class='no'>df</span>[ !<span class='fu'><a href='https://rdrr.io/r/base/NA.html'>is.na</a></span>(<span class='no'>df</span>$<span class='no'>lng</span>), ]
<span class='no'>df</span>$<span class='no'>weight</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span>(<span class='fl'>1</span>:<span class='fl'>10</span>, <span class='kw'>size</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/nrow.html'>nrow</a></span>(<span class='no'>df</span>), <span class='kw'>replace</span> <span class='kw'>=</span> <span class='no'>T</span>)
<span class='fu'><a href='mapdeck.html'>mapdeck</a></span>( <span class='kw'>style</span> <span class='kw'>=</span> <span class='fu'><a href='mapdeck_style.html'>mapdeck_style</a></span>(<span class='st'>'dark'</span>), <span class='kw'>pitch</span> <span class='kw'>=</span> <span class='fl'>45</span> ) <span class='kw'>%>%</span>
<span class='fu'>add_screengrid</span>(
<span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>df</span>
, <span class='kw'>lat</span> <span class='kw'>=</span> <span class='st'>"lat"</span>
, <span class='kw'>lon</span> <span class='kw'>=</span> <span class='st'>"lng"</span>
, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"weight"</span>,
, <span class='kw'>layer_id</span> <span class='kw'>=</span> <span class='st'>"screengrid_layer"</span>
, <span class='kw'>cell_size</span> <span class='kw'>=</span> <span class='fl'>10</span>
, <span class='kw'>opacity</span> <span class='kw'>=</span> <span class='fl'>0.3</span>
)
<span class='co'>## as an sf object</span>
<span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>sfheaders</span>)
<span class='no'>sf</span> <span class='kw'><-</span> <span class='kw pkg'>sfheaders</span><span class='kw ns'>::</span><span class='fu'><a href='https://rdrr.io/pkg/sfheaders/man/sf_point.html'>sf_point</a></span>( <span class='no'>df</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"lng"</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='st'>"lat"</span>)
<span class='fu'><a href='mapdeck.html'>mapdeck</a></span>( <span class='kw'>style</span> <span class='kw'>=</span> <span class='fu'><a href='mapdeck_style.html'>mapdeck_style</a></span>(<span class='st'>'dark'</span>), <span class='kw'>pitch</span> <span class='kw'>=</span> <span class='fl'>45</span> ) <span class='kw'>%>%</span>
<span class='fu'>add_screengrid</span>(
<span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>sf</span>
, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"weight"</span>,
, <span class='kw'>layer_id</span> <span class='kw'>=</span> <span class='st'>"screengrid_layer"</span>
, <span class='kw'>cell_size</span> <span class='kw'>=</span> <span class='fl'>10</span>
, <span class='kw'>opacity</span> <span class='kw'>=</span> <span class='fl'>0.3</span>
)
<span class='co'># }</span></div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
<h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by David Cooley.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
</div>
</footer>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
{
"name": "chromecast-js",
"version": "0.1.5",
"description": "Chromecast/Googlecast streaming module all in JS",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/guerrerocarlos/chromecast-js.git"
},
"keywords": [
"chromecast",
"googlecast",
"stream",
"streaming",
"torrentv"
],
"author": {
"name": "Carlos Guerrero",
"email": "[email protected]"
},
"license": "ISC",
"bugs": {
"url": "https://github.com/guerrerocarlos/chromecast-js/issues"
},
"homepage": "https://github.com/guerrerocarlos/chromecast-js",
"dependencies": {
"castv2-client": "0.0.8",
"debug": "^1.0.4",
"node-ssdp": "^2.0.1"
},
"devDependencies": {
"eslint": "^1.1.0"
}
}
|
{
"pile_set_name": "Github"
}
|
<component name="libraryTable">
<library name="Maven: org.apache.hadoop:hadoop-annotations:2.2.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-annotations/2.2.0/hadoop-annotations-2.2.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-annotations/2.2.0/hadoop-annotations-2.2.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hadoop/hadoop-annotations/2.2.0/hadoop-annotations-2.2.0-sources.jar!/" />
</SOURCES>
</library>
</component>
|
{
"pile_set_name": "Github"
}
|
include README.md
include requirements.txt
include Dockerfile
include LICENSE
include pyspider/logging.conf
include pyspider/webui/static/*
include pyspider/webui/templates/*
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Uses of Class javax.print.attribute.IntegerSyntax (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class javax.print.attribute.IntegerSyntax (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../IntegerSyntax.html" title="class in javax.print.attribute">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h2 title="Uses of Class javax.print.attribute.IntegerSyntax" class="title">Uses of Class<br>javax.print.attribute.IntegerSyntax</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<div class="useSummary">
<table>
<caption><span>Packages that use <a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="#javax.print.attribute">javax.print.attribute</a></th>
<td class="colLast">
<div class="block">Provides classes and interfaces that describe the types of Java™ Print
Service attributes and how they can be collected into attribute sets.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="#javax.print.attribute.standard">javax.print.attribute.standard</a></th>
<td class="colLast">
<div class="block">Package <code>javax.print.attribute.standard</code> contains classes for specific
printing attributes.</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList">
<section role="region"><a id="javax.print.attribute">
<!-- -->
</a>
<h3>Uses of <a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a> in <a href="../package-summary.html">javax.print.attribute</a></h3>
<div class="useSummary">
<table>
<caption><span>Methods in <a href="../package-summary.html">javax.print.attribute</a> with parameters of type <a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><span class="typeNameLabel">SetOfIntegerSyntax.</span><code><span class="memberNameLink"><a href="../SetOfIntegerSyntax.html#contains(javax.print.attribute.IntegerSyntax)">contains</a></span>​(<a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a> attribute)</code></th>
<td class="colLast">
<div class="block">Determine if this set-of-integer attribute contains the given integer
attribute's value.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
<li class="blockList">
<section role="region"><a id="javax.print.attribute.standard">
<!-- -->
</a>
<h3>Uses of <a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a> in <a href="../standard/package-summary.html">javax.print.attribute.standard</a></h3>
<div class="useSummary">
<table>
<caption><span>Subclasses of <a href="../IntegerSyntax.html" title="class in javax.print.attribute">IntegerSyntax</a> in <a href="../standard/package-summary.html">javax.print.attribute.standard</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/Copies.html" title="class in javax.print.attribute.standard">Copies</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>Copies</code> is an integer valued printing attribute class that
specifies the number of copies to be printed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobImpressions.html" title="class in javax.print.attribute.standard">JobImpressions</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobImpressions</code> is an integer valued printing attribute class
that specifies the total size in number of impressions of the document(s)
being submitted.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobImpressionsCompleted.html" title="class in javax.print.attribute.standard">JobImpressionsCompleted</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobImpressionsCompleted</code> is an integer valued printing attribute
class that specifies the number of impressions completed for the job so far.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobKOctets.html" title="class in javax.print.attribute.standard">JobKOctets</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobKOctets</code> is an integer valued printing attribute class that
specifies the total size of the document(s) in K octets, i.e., in units of
1024 octets requested to be processed in the job.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobKOctetsProcessed.html" title="class in javax.print.attribute.standard">JobKOctetsProcessed</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobKOctetsProcessed</code> is an integer valued printing attribute
class that specifies the total number of print data octets processed so far
in K octets, i.e., in units of 1024 octets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobMediaSheets.html" title="class in javax.print.attribute.standard">JobMediaSheets</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobMediaSheets</code> is an integer valued printing attribute class
that specifies the total number of media sheets to be produced for this job.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobMediaSheetsCompleted.html" title="class in javax.print.attribute.standard">JobMediaSheetsCompleted</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobMediaSheetsCompleted</code> is an integer valued printing attribute
class that specifies the number of media sheets which have completed marking
and stacking for the entire job so far, whether those sheets have been
processed on one side or on both.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobPriority.html" title="class in javax.print.attribute.standard">JobPriority</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobPriority</code> is an integer valued printing attribute class that
specifies a print job's priority.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/JobPrioritySupported.html" title="class in javax.print.attribute.standard">JobPrioritySupported</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>JobPrioritySupported</code> is an integer valued printing attribute
class that specifies whether a Print Service instance supports the
<a href="../standard/JobPriority.html" title="class in javax.print.attribute.standard"><code>JobPriority</code></a> attribute and the number of different job
priority levels supported.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/NumberOfDocuments.html" title="class in javax.print.attribute.standard">NumberOfDocuments</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>NumberOfDocuments</code> is an integer valued printing attribute that
indicates the number of individual docs the printer has accepted for this
job, regardless of whether the docs' print data has reached the printer or
not.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/NumberOfInterveningJobs.html" title="class in javax.print.attribute.standard">NumberOfInterveningJobs</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>NumberOfInterveningJobs</code> is an integer valued printing attribute
that indicates the number of jobs that are ahead of this job in the relative
chronological order of expected time to complete (i.e., the current scheduled
order).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/NumberUp.html" title="class in javax.print.attribute.standard">NumberUp</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>NumberUp</code> is an integer valued printing attribute class that
specifies the number of print-stream pages to impose upon a single side of an
instance of a selected medium.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/PagesPerMinute.html" title="class in javax.print.attribute.standard">PagesPerMinute</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>PagesPerMinute</code> is an integer valued printing attribute that
indicates the nominal number of pages per minute to the nearest whole number
which may be generated by this printer (e.g., simplex, black-and-white).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/PagesPerMinuteColor.html" title="class in javax.print.attribute.standard">PagesPerMinuteColor</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>PagesPerMinuteColor</code> is an integer valued printing attribute
that indicates the nominal number of pages per minute to the nearest whole
number which may be generated by this printer when printing color (e.g.,
simplex, color).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../standard/QueuedJobCount.html" title="class in javax.print.attribute.standard">QueuedJobCount</a></span></code></th>
<td class="colLast">
<div class="block">Class <code>QueuedJobCount</code> is an integer valued printing attribute that
indicates the number of jobs in the printer whose <a href="../standard/JobState.html" title="class in javax.print.attribute.standard"><code>JobState</code></a>
is either <code>PENDING</code>, <code>PENDING_HELD</code>, <code>PROCESSING</code>, or
<code>PROCESSING_STOPPED</code>.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
</ul>
</li>
</ul>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../IntegerSyntax.html" title="class in javax.print.attribute">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../../../legal/copyright.html">Copyright</a> © 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p>
</footer>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
/**
* Conventions and templates to aid the construction of FRAs.
*/
package com.opengamma.strata.product.fra.type;
|
{
"pile_set_name": "Github"
}
|
namespace JetBrains.ReSharper.Plugins.FSharp.Tests.Features.Daemon
open JetBrains.ReSharper.Daemon.SyntaxHighlighting
open NUnit.Framework
type SyntaxHighlightingTest() =
inherit FSharpHighlightingTestBase()
override x.RelativeTestDataPath = "features/daemon/syntaxHighlighting"
override x.HighlightingPredicate(highlighting, _, _) =
highlighting :? ReSharperSyntaxHighlighting
[<Test>] member x.``Inactive preprocessor branch 01``() = x.DoNamedTest()
|
{
"pile_set_name": "Github"
}
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h"
namespace content {
SyntheticSmoothDragGesture::SyntheticSmoothDragGesture(
const SyntheticSmoothDragGestureParams& params)
: params_(params) {
}
SyntheticSmoothDragGesture::~SyntheticSmoothDragGesture() {
}
SyntheticGesture::Result SyntheticSmoothDragGesture::ForwardInputEvents(
const base::TimeTicks& timestamp,
SyntheticGestureTarget* target) {
if (!move_gesture_) {
if (!InitializeMoveGesture(params_.gesture_source_type, target))
return SyntheticGesture::GESTURE_SOURCE_TYPE_NOT_IMPLEMENTED;
}
return move_gesture_->ForwardInputEvents(timestamp, target);
}
SyntheticSmoothMoveGestureParams::InputType
SyntheticSmoothDragGesture::GetInputSourceType(
SyntheticGestureParams::GestureSourceType gesture_source_type) {
if (gesture_source_type == SyntheticGestureParams::MOUSE_INPUT)
return SyntheticSmoothMoveGestureParams::MOUSE_DRAG_INPUT;
else
return SyntheticSmoothMoveGestureParams::TOUCH_INPUT;
}
bool SyntheticSmoothDragGesture::InitializeMoveGesture(
SyntheticGestureParams::GestureSourceType gesture_type,
SyntheticGestureTarget* target) {
if (gesture_type == SyntheticGestureParams::DEFAULT_INPUT)
gesture_type = target->GetDefaultSyntheticGestureSourceType();
if (gesture_type == SyntheticGestureParams::TOUCH_INPUT ||
gesture_type == SyntheticGestureParams::MOUSE_INPUT) {
SyntheticSmoothMoveGestureParams move_params;
move_params.start_point = params_.start_point;
move_params.distances = params_.distances;
move_params.speed_in_pixels_s = params_.speed_in_pixels_s;
move_params.prevent_fling = true;
move_params.input_type = GetInputSourceType(gesture_type);
move_params.add_slop = false;
move_gesture_.reset(new SyntheticSmoothMoveGesture(move_params));
return true;
}
return false;
}
} // namespace content
|
{
"pile_set_name": "Github"
}
|
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
class Zend_View_Helper_Customvar extends Zend_View_Helper_Abstract
{
/**
* Create dispatch instance
*
* @return $this
*/
public function checkPerformance()
{
return $this;
}
public function customvar($struct)
{
if (is_scalar($struct)) {
return nl2br($this->view->escape(
is_string($struct)
? $struct
: var_export($struct, true)
), false);
} elseif (is_array($struct)) {
return $this->renderArray($struct);
} elseif (is_object($struct)) {
return $this->renderObject($struct);
}
}
protected function renderArray($array)
{
if (empty($array)) {
return '[]';
}
$out = "<ul>\n";
foreach ($array as $val) {
$out .= '<li>' . $this->customvar($val) . "</li>\n";
}
return $out . "</ul>\n";
}
protected function renderObject($object)
{
if (0 === count((array) $object)) {
return '{}';
}
$out = "{<ul>\n";
foreach ($object as $key => $val) {
$out .= '<li>'
. $this->view->escape($key)
. ' => '
. $this->customvar($val)
. "</li>\n";
}
return $out . "</ul>}";
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef _CS_Common_types_password_h_
#define _CS_Common_types_password_h_
#include "../constants.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
// Modifying this structure can introduce incompatibility with previous versions
unsigned __int32 Length;
unsigned char Text[MAX_PASSWORD + 1];
char Pad[3]; // keep 64-bit alignment
} Password;
#ifdef __cplusplus
}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2018 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK.
*
* This work is licensed under the
* Creative Commons Attribution 4.0 International License.
* To view a copy of this license, visit
* <https://creativecommons.org/licenses/by/4.0>.
* or send a letter to Creative Commons, PO Box 1866,
* Mountain View, CA 94042, USA.
*
*/
/*
This example claims the local name "example". It provides an HTTP server that can be
acccessed at "http://example.local/" from a web browser on any computer or mobile device
that supports mDNS.
If the name "example" is already claimed on the current network, a unique name with be
found by appending "-2" or "-3", etc. to the requested name.
The name selected is output to the console. The MDNS constructor provides an optional
callback to report the selected name to the host application.
*/
import MDNS from "mdns";
import {Server} from "http"
import Net from "net"
let hostName = "example"; // the hostName to claim. updated by callback to actual name claimed.
new MDNS({hostName}, function(message, value) {
if (MDNS.hostName === message)
hostName = value;
});
let counter = 0;
let server = new Server({port: 80});
server.callback = function(message, value) {
if (2 == message)
this.path = value;
if (8 == message) {
let body = `Client requested path ${this.path}.\n` +
`Request #${++counter} to this server.\n` +
`Server host name "${hostName}.local" at address ${Net.get("IP")} on network "${Net.get("SSID")}".\n`;
return {headers: ["Content-Type", "text/plain"], body};
}
}
|
{
"pile_set_name": "Github"
}
|
Assessor::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to nil and saved in location specified by config.assets.prefix
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'exchange.asc.ohio-state.edu',
:port => 25,
:enable_starttls_auto => false
}
config.action_mailer.default_url_options = {
:host => 'mooculus-s.asc.ohio-state.edu',
}
end
|
{
"pile_set_name": "Github"
}
|
material {
"name" : "View",
"defines" : [
"baseColor"
],
"parameters" : [
{
"type" : "samplerExternal",
"name" : "viewTexture"
},
{
"type" : "float2",
"name" : "offsetUv"
}
],
"requires" : [
"position",
"uv0"
],
"shadingModel" : "unlit",
"blending" : "transparent",
"doubleSided" : true
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
vec2 uv = getUV0();
if (!gl_FrontFacing) {
uv.x = 1.0 - uv.x;
}
// Set offsetUv if we want to invert around an axis.
// In front facing camera, set offsetUv.x to 1 and offsetUv.y to 0.
uv.x = uv.x + materialParams.offsetUv.x * (1.0 - 2.0 * uv.x);
uv.y = uv.y + materialParams.offsetUv.y * (1.0 - 2.0 * uv.y);
material.baseColor = texture(materialParams_viewTexture, uv);
material.baseColor.rgb = inverseTonemapSRGB(material.baseColor.rgb);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.vision.v1p2beta1.model;
/**
* Metadata for the batch operations such as the current state.
*
* This is included in the `metadata` field of the `Operation` returned by the `GetOperation` call
* of the `google::longrunning::Operations` service.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Vision API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class GoogleCloudVisionV1p4beta1BatchOperationMetadata extends com.google.api.client.json.GenericJson {
/**
* The time when the batch request is finished and google.longrunning.Operation.done is set to
* true.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String endTime;
/**
* The current state of the batch operation.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String state;
/**
* The time when the batch request was submitted to the server.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String submitTime;
/**
* The time when the batch request is finished and google.longrunning.Operation.done is set to
* true.
* @return value or {@code null} for none
*/
public String getEndTime() {
return endTime;
}
/**
* The time when the batch request is finished and google.longrunning.Operation.done is set to
* true.
* @param endTime endTime or {@code null} for none
*/
public GoogleCloudVisionV1p4beta1BatchOperationMetadata setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
/**
* The current state of the batch operation.
* @return value or {@code null} for none
*/
public java.lang.String getState() {
return state;
}
/**
* The current state of the batch operation.
* @param state state or {@code null} for none
*/
public GoogleCloudVisionV1p4beta1BatchOperationMetadata setState(java.lang.String state) {
this.state = state;
return this;
}
/**
* The time when the batch request was submitted to the server.
* @return value or {@code null} for none
*/
public String getSubmitTime() {
return submitTime;
}
/**
* The time when the batch request was submitted to the server.
* @param submitTime submitTime or {@code null} for none
*/
public GoogleCloudVisionV1p4beta1BatchOperationMetadata setSubmitTime(String submitTime) {
this.submitTime = submitTime;
return this;
}
@Override
public GoogleCloudVisionV1p4beta1BatchOperationMetadata set(String fieldName, Object value) {
return (GoogleCloudVisionV1p4beta1BatchOperationMetadata) super.set(fieldName, value);
}
@Override
public GoogleCloudVisionV1p4beta1BatchOperationMetadata clone() {
return (GoogleCloudVisionV1p4beta1BatchOperationMetadata) super.clone();
}
}
|
{
"pile_set_name": "Github"
}
|
package Paws::Cloud9::DescribeEnvironmentsResult;
use Moose;
has Environments => (is => 'ro', isa => 'ArrayRef[Paws::Cloud9::Environment]', traits => ['NameInRequest'], request_name => 'environments' );
has _request_id => (is => 'ro', isa => 'Str');
### main pod documentation begin ###
=head1 NAME
Paws::Cloud9::DescribeEnvironmentsResult
=head1 ATTRIBUTES
=head2 Environments => ArrayRef[L<Paws::Cloud9::Environment>]
Information about the environments that are returned.
=head2 _request_id => Str
=cut
1;
|
{
"pile_set_name": "Github"
}
|
{
"pagination": {}
}
|
{
"pile_set_name": "Github"
}
|
from django.apps import AppConfig
class BlogsConfig(AppConfig):
name = 'blogs'
|
{
"pile_set_name": "Github"
}
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 EMC Corp.
//
// @filename:
// CEnfdProp.h
//
// @doc:
// Base class for all enforceable properties
//---------------------------------------------------------------------------
#ifndef GPOPT_CEnfdProp_H
#define GPOPT_CEnfdProp_H
#include "gpos/base.h"
#include "gpos/common/CDynamicPtrArray.h"
#include "gpos/common/CRefCount.h"
#include "gpopt/base/CPropSpec.h"
#include "gpopt/operators/COperator.h"
namespace gpopt
{
using namespace gpos;
// prototypes
class CPhysical;
class CReqdPropPlan;
//---------------------------------------------------------------------------
// @class:
// CEnfdProp
//
// @doc:
// Abstract base class for all enforceable properties.
//
//---------------------------------------------------------------------------
class CEnfdProp : public CRefCount
{
public:
// Definition of property enforcing type for a given operator.
//
// Each enforced property is queried in CEngine::FCheckEnfdProps() to
// determine if enforcers are required, optional, unnecessary or
// prohibited over an operator given an optimization context of
// properties required of it.
//
// - Required: operator cannot deliver the required properties on its
// own, e.g., requiring a sort order from a table scan
//
// - Optional: operator can request the required properties from its children
// and preserve them, e.g., requiring a sort order from a filter
//
// - Prohibited: operator prohibits enforcing the required properties on its
// output, e.g., requiring a sort order on column A from a sort operator that
// provides sorting on column B
//
// - Unnecessary: operator already establishes the required properties on its
// own, e.g., requiring a sort order on column A from a sort operator that
// provides sorting on column A. If the required property spec is empty, any
// operator satisfies it so its type falls into this category.
//
// NB: 'Prohibited' prevents ANY enforcer to be added for the given
// operator & optimization context, even if one is required by some other
// enforced property.
enum EPropEnforcingType
{
EpetRequired,
EpetOptional,
EpetProhibited,
EpetUnnecessary,
EpetSentinel
};
private:
// private copy ctor
CEnfdProp(const CEnfdProp &);
public:
// ctor
CEnfdProp()
{}
// dtor
virtual
~CEnfdProp()
{}
// append enforcers to dynamic array for the given plan properties
void AppendEnforcers
(
CMemoryPool *mp,
CReqdPropPlan *prpp,
CExpressionArray *pdrgpexpr, // array of enforcer expressions
CExpression *pexprChild, // leaf in the target group where enforcers will be added
CEnfdProp::EPropEnforcingType epet,
CExpressionHandle &exprhdl
)
{
if (FEnforce(epet))
{
Pps()->AppendEnforcers(mp, exprhdl, prpp, pdrgpexpr, pexprChild);
}
}
// property spec accessor
virtual
CPropSpec *Pps() const = 0;
// hash function
virtual
ULONG HashValue() const = 0;
// check if operator requires an enforcer under given enforceable property
// based on the derived enforcing type
static
BOOL FEnforce(EPropEnforcingType epet)
{
return CEnfdProp::EpetOptional == epet || CEnfdProp::EpetRequired == epet;
}
// check if operator requires optimization under given enforceable property
// based on the derived enforcing type
static
BOOL FOptimize(EPropEnforcingType epet)
{
return CEnfdProp::EpetOptional == epet || CEnfdProp::EpetUnnecessary == epet;
}
}; // class CEnfdProp
// shorthand for printing
IOstream &operator << (IOstream &os, CEnfdProp &efdprop);
}
#endif // !GPOPT_CEnfdProp_H
// EOF
|
{
"pile_set_name": "Github"
}
|
/* (c) 2020 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
/* Copyright (c) 2017 Boundless - http://boundlessgeo.com All rights reserved.
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.gsr.crs;
import java.net.URL;
import org.geotools.referencing.factory.epsg.FactoryUsingWKT;
/** Factory defining GSR-specific spatial references, such as 102100. */
public class GSRCustomWKTFactory extends FactoryUsingWKT {
/**
* Returns the URL to the property file that contains CRS definitions.
*
* @return The URL, or {@code null} if none.
*/
@Override
protected URL getDefinitionsURL() {
// Use the built-in property definitions
return GSRCustomWKTFactory.class.getResource("user_epsg.properties");
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* * Copyright (c) 2004-2018 MarkLogic Corporation
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* * The use of the Apache License does not indicate that this project is
* * affiliated with the Apache Software Foundation.
* *
* * Code adapted from Bixio DiskQueue
* * https://github.com/bixo/bixo/blob/master/src/main/java/bixo/utils/DiskQueue.java
* * Original work Copyright 2009-2015 Scale Unlimited
* * Modifications copyright (c) 2016 MarkLogic Corporation
*
*/
package com.marklogic.hub.collector;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.security.InvalidParameterException;
import java.text.MessageFormat;
import java.util.AbstractQueue;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A queue that writes extra elements to disk, and reads them in as needed.
*
* This implementation is optimized for being filled once (ie by the iterator in
* a reducer) and then incrementally read. So it wouldn't work very well if
* reads/writes were happening simultaneously, once anything had spilled to
* disk.
*
* @param <E> - A Serializable Class
*/
public class DiskQueue<E extends Serializable> extends AbstractQueue<String> {
private static final Logger LOG = Logger.getLogger(DiskQueue.class.getName());
private static final float DEFAULT_REFILL_RATIO = 0.75f;
// The memoryQueue represents the head of the queue. It can also be the tail,
// if nothing has spilled over onto the disk.
private MemoryQueue<String> memoryQueue;
private Iterator<String> memoryIterator;
// Percentage of memory queue used/capacity that triggers a refill from disk.
private float refillMemoryRatio;
// Number of elements in the backing store file on disk.
private int fileElementCount = 0;
private File tempDir;
private BufferedWriter fileOut;
private BufferedReader fileIn;
// When moving elements from disk to memory, we don't know whether the memory
// queue has space until the offer is rejected. So rather than trying to push
// back an element into the file, just cache it in cachedElement.
private String cachedElement;
private File fileQueue;
private int nextCount = 0;
/**
* Construct a disk-backed queue that keeps at most
* <code>maxInMemorySize</code> elements in memory.
*
* @param maxInMemorySize Maximum number of elements to keep in memory.
*/
public DiskQueue(int maxInMemorySize) {
this(maxInMemorySize, null);
}
/**
* Construct a disk-backed queue that keeps at most
* <code>maxInMemorySize</code> elements in memory.
*
* @param maxInMemorySize Maximum number of elements to keep in memory.
* @param tempDir Directory where queue temporary files will be written to.
*/
public DiskQueue(int maxInMemorySize, File tempDir) {
super();
if (maxInMemorySize < 1) {
throw new InvalidParameterException(DiskQueue.class.getSimpleName() + " max in-memory size must be at least one");
}
if (tempDir != null && !(tempDir.exists() && tempDir.isDirectory() && tempDir.canWrite())) {
throw new InvalidParameterException(DiskQueue.class.getSimpleName() + " temporary directory must exist and be writable");
}
this.tempDir = tempDir;
memoryQueue = new MemoryQueue<>(maxInMemorySize);
// memoryIterator = memoryQueue.iterator();
refillMemoryRatio = DEFAULT_REFILL_RATIO;
}
/* (non-Javadoc)
* @see java.lang.Object#finalize()
*
* Close down streams, and toss the temp file.
*/
@Override
protected void finalize() throws Throwable {
if (closeFile()) {
LOG.warning(MessageFormat.format("{0} still had open file in finalize", DiskQueue.class.getSimpleName()));
}
super.finalize();
}
/**
* Make sure the file streams are all closed down, the temp file is closed,
* and the temp file has been deleted.
*
* @return true if we had to close down the file.
*/
private boolean closeFile() {
if (fileQueue == null) {
return false;
}
closeQuietly(fileIn);
fileIn = null;
cachedElement = null;
closeQuietly(fileOut);
fileOut = null;
fileElementCount = 0;
fileQueue.delete();
fileQueue = null;
return true;
}
private static boolean isEmpty(final CharSequence value) {
return value == null || value.length() == 0;
}
private static void closeQuietly(Closeable obj) {
if (obj != null) {
try {
obj.close();
} catch (IOException ex) {
// Ignore
}
}
}
private void openFile() throws IOException {
if (fileQueue == null) {
fileQueue = File.createTempFile(DiskQueue.class.getSimpleName() + "-backingstore-", null, tempDir);
fileQueue.deleteOnExit();
LOG.log(Level.INFO, "created backing store {0}", fileQueue.getAbsolutePath());
fileOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileQueue), StandardCharsets.UTF_8));
// Flush output file, so there's something written when we open the input stream.
fileOut.flush();
fileIn = new BufferedReader( new InputStreamReader(
new FileInputStream(fileQueue), "UTF8")
);
}
}
@Override
public Iterator<String> iterator() {
return new Itr();
}
@Override
public int size() {
return memoryQueue.size() + fileElementCount + (cachedElement != null ? 1 : 0);
}
@Override
public boolean offer(String element) {
if (element == null) {
throw new NullPointerException("Element cannot be null for AbstractQueue");
}
boolean hasFileQueue = fileQueue != null;
boolean offerRejected = false;
if (!hasFileQueue) {
offerRejected = !memoryQueue.offer(element);
if (offerRejected) {
memoryIterator = memoryQueue.iterator();
}
}
// If there's anything in the file, or the queue is full, then we have to write to the file.
if (hasFileQueue || offerRejected) {
try {
openFile();
fileOut.write(element);
fileOut.newLine();
fileElementCount++;
} catch (IOException e) {
LOG.severe(MessageFormat.format("Error writing to {0} backing store", DiskQueue.class.getSimpleName()));
return false;
}
}
return true;
}
@Override
public String peek() {
loadMemoryQueue();
return memoryQueue.peek();
}
@Override
public String remove() {
loadMemoryQueue();
return memoryQueue.remove();
}
@Override
public String poll() {
loadMemoryQueue();
return memoryQueue.poll();
}
/* (non-Javadoc)
* @see java.util.AbstractQueue#clear()
*
* Implement faster clear (so AbstractQueue doesn't call poll() repeatedly)
*/
@Override
public void clear() {
memoryQueue.clear();
cachedElement = null;
closeFile();
}
private void loadMemoryQueue() {
// use the memory queue as our buffer, so only load it up when it's below capacity.
if (memoryQueue.size() / (float) memoryQueue.getCapacity() >= refillMemoryRatio) {
return;
}
// See if we have one saved element from the previous read request
if (cachedElement != null && memoryQueue.offer(cachedElement)) {
cachedElement = null;
}
// Now see if we have anything on disk
if (fileQueue != null) {
try {
// Since we buffer writes, we need to make sure everything has
// been written before we start reading.
fileOut.flush();
int usedCount = 0;
while (fileElementCount > 0) {
@SuppressWarnings("unchecked")
String nextFileElement = fileIn.readLine();
fileElementCount--;
usedCount++;
if (!isEmpty(nextFileElement) && !memoryQueue.offer(nextFileElement)) {
//memory queue is full. Cache this entry and jump out
cachedElement = nextFileElement;
memoryIterator = memoryQueue.iterator();
return;
}
}
memoryIterator = memoryQueue.iterator();
// Nothing left in the file, so close/delete it.
closeFile();
// file queue is empty, so could reset length of file, read/write offsets
// to start from zero instead of closing file (but for current use case of fill once, drain
// once this works just fine)
} catch (IOException e) {
LOG.severe(MessageFormat.format("Error reading from {0} backing store", DiskQueue.class.getSimpleName()));
}
}
}
private class Itr implements Iterator<String> {
public Itr() {
memoryIterator = memoryQueue.iterator();
}
public boolean hasNext() {
return memoryIterator.hasNext() || fileElementCount > 0 || cachedElement != null;
}
@SuppressWarnings("unchecked")
public String next() {
String next = memoryIterator.next();
if (!memoryIterator.hasNext() && (fileElementCount > 0 || cachedElement != null)) {
memoryQueue.clear();
loadMemoryQueue();
}
nextCount++;
return next;
}
public void remove() {
memoryIterator.remove();
}
// @Override
// @SuppressWarnings("unchecked")
// public void forEachRemaining(Consumer<String> consumer) {
// Objects.requireNonNull(consumer);
// final int size = ArrayList.this.size;
// int i = cursor;
// if (i >= size) {
// return;
// }
// final Object[] elementData = ArrayList.this.elementData;
// if (i >= elementData.length) {
// throw new ConcurrentModificationException();
// }
// while (i != size && modCount == expectedModCount) {
// consumer.accept((E) elementData[i++]);
// }
// // update once at end of iteration to reduce heap write traffic
// cursor = i;
// lastRet = i - 1;
// checkForComodification();
// }
}
private static class MemoryQueue<E> extends AbstractQueue<String> {
private final List<String> queue;
private final int capacity;
public MemoryQueue(int capacity) {
super();
this.capacity = capacity;
queue = new ArrayList<>(capacity);
}
@Override
public void clear() {
queue.clear();
}
@Override
public Iterator<String> iterator() {
return queue.iterator();
}
public int getCapacity() {
return capacity;
}
@Override
public int size() {
return queue.size();
}
@Override
public boolean offer(String o) {
if (o == null) {
throw new NullPointerException();
} else if (queue.size() >= capacity) {
return false;
} else {
queue.add(o);
return true;
}
}
@Override
public String peek() {
if (queue.isEmpty()) {
return null;
} else {
return queue.get(0);
}
}
@Override
public String poll() {
if (queue.isEmpty()) {
return null;
} else {
return queue.remove(0);
}
}
@Override
public String remove() {
return queue.remove(0);
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.modalnavigation">
<uses-sdk android:minSdkVersion="19" />
<application android:label="ModalNavigation">
</application>
</manifest>
|
{
"pile_set_name": "Github"
}
|
---
swagger: "2.0"
info:
version: "1.0.0"
title: "Swagger Petstore"
description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification"
termsOfService: "http://swagger.io/terms/"
contact:
name: "Swagger API Team"
email: "[email protected]"
url: "http://swagger.io"
license:
name: "MIT"
url: "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
externalDocs:
description: "find more info here"
url: "https://swagger.io/about"
host: "petstore.swagger.io"
basePath: "/api"
schemes:
- "http"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/pets:
get:
description: "Returns all pets from the system that the user has access to"
operationId: "findPets"
externalDocs:
description: "find more info here"
url: "https://swagger.io/about"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "tags"
in: "query"
description: "tags to filter by"
required: false
type: "array"
items:
type: "string"
collectionFormat: "csv"
-
name: "limit"
in: "query"
description: "maximum number of results to return"
required: false
type: "integer"
format: "int32"
responses:
"200":
description: "pet response"
schema:
type: "array"
items:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
post:
description: "Creates a new pet in the store. Duplicates are allowed"
operationId: "addPet"
produces:
- "application/json"
parameters:
-
name: "pet"
in: "body"
description: "Pet to add to the store"
required: true
schema:
$ref: "#/definitions/NewPet"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
/pets/{id}:
get:
description: "Returns a user based on a single ID, if the user does not have access to the pet"
operationId: "findPetById"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "id"
in: "path"
description: "ID of pet to fetch"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
delete:
description: "deletes a single pet based on the ID supplied"
operationId: "deletePet"
parameters:
-
name: "id"
in: "path"
description: "ID of pet to delete"
required: true
type: "integer"
format: "int64"
responses:
"204":
description: "pet deleted"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
definitions:
Pet:
type: "object"
allOf:
-
$ref: "#/definitions/NewPet"
-
required:
- "id"
properties:
id:
type: "integer"
format: "int64"
NewPet:
type: "object"
required:
- "name"
properties:
name:
type: "string"
tag:
type: "string"
ErrorModel:
type: "object"
required:
- "code"
- "message"
properties:
code:
type: "integer"
format: "int32"
message:
type: "string"
|
{
"pile_set_name": "Github"
}
|
package cn.springcloud.book.config.models;
import java.io.Serializable;
public class JwtAuthenticationRequest implements Serializable {
private static final long serialVersionUID = -8445943548965154778L;
private String username;
private String password;
public JwtAuthenticationRequest() {
super();
}
public JwtAuthenticationRequest(String username, String password) {
this.setUsername(username);
this.setPassword(password);
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "JwtAuthenticationRequest [username=" + username + ", password=" + password + "]";
}
}
|
{
"pile_set_name": "Github"
}
|
<div>
<button id="btn">Click Me</button>
</div>
<script type="text/tiscript">
function callback(abc){
view.msgbox(#information,abc);
}
$(#btn).on("click",function(){
var obj = {num:100, str:"Hello World"};
view.getNetInformation(1,"test",callback, obj);
});
</script>
|
{
"pile_set_name": "Github"
}
|
# This patch enables Prometheus scraping for the manager pod.
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
metadata:
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
# Expose the prometheus metrics on default port
- name: manager
ports:
- containerPort: 8080
name: metrics
protocol: TCP
|
{
"pile_set_name": "Github"
}
|
{
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [
{
"corpusPath": "cdm:/foundations.1.1.cdm.json"
},
{
"corpusPath": "/core/operationsCommon/Common.1.0.cdm.json",
"moniker": "base_Common"
},
{
"corpusPath": "/core/operationsCommon/DataEntityView.1.0.cdm.json",
"moniker": "base_DataEntityView"
},
{
"corpusPath": "/core/operationsCommon/Tables/Finance/Ledger/Main/CompanyInfo.1.0.cdm.json"
}
],
"definitions": [
{
"entityName": "CustDebitCreditNoteTaxTmp",
"extendsEntity": "base_Common/Common",
"exhibitsTraits": [
{
"traitReference": "is.CDM.entityVersion",
"arguments": [
{
"name": "versionNumber",
"value": "1.0"
}
]
}
],
"hasAttributes": [
{
"name": "PrintCode",
"dataType": "TaxWriteCode",
"isNullable": true,
"description": ""
},
{
"name": "TaxCode",
"dataType": "TaxCode",
"isNullable": true,
"description": ""
},
{
"name": "TaxAmount",
"dataType": "TaxAmountCur",
"isNullable": true,
"description": ""
},
{
"name": "DataAreaId",
"dataType": "string",
"isReadOnly": true
},
{
"entity": {
"entityReference": "CompanyInfo"
},
"name": "Relationship_CompanyRelationship",
"resolutionGuidance": {
"entityByReference": {
"allowReference": true
}
}
}
],
"displayName": ""
},
{
"dataTypeName": "TaxWriteCode",
"extendsDataType": "string"
},
{
"dataTypeName": "TaxCode",
"extendsDataType": "string"
},
{
"dataTypeName": "TaxAmountCur",
"extendsDataType": "decimal"
}
]
}
|
{
"pile_set_name": "Github"
}
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __DRUMSET_H__
#define __DRUMSET_H__
#include "mscore.h"
#include "tremolo.h"
#include "note.h"
#include "sym.h"
namespace Ms {
class XmlWriter;
struct DrumInstrumentVariant {
int pitch;
QString articulationName;
TremoloType tremolo;
DrumInstrumentVariant()
{
pitch = INVALID_PITCH;
tremolo = TremoloType::INVALID_TREMOLO;
articulationName = "";
}
};
//---------------------------------------------------------
// DrumInstrument
//---------------------------------------------------------
struct DrumInstrument {
QString name;
// if notehead = HEAD_CUSTOM, custom, use noteheads
NoteHead::Group notehead; ///< notehead symbol set
SymId noteheads[int(NoteHead::Type::HEAD_TYPES)]
= { SymId::noteheadWhole, SymId::noteheadHalf, SymId::noteheadBlack, SymId::noteheadDoubleWhole };
int line; ///< place notehead onto this line
Direction stemDirection;
int voice;
char shortcut; ///< accelerator key (CDEFGAB)
QList<DrumInstrumentVariant> variants;
DrumInstrument() {}
DrumInstrument(const char* s, NoteHead::Group nh, int l, Direction d,
int v = 0, char sc = 0)
: name(s), notehead(nh), line(l), stemDirection(d), voice(v), shortcut(sc) {}
void addVariant(DrumInstrumentVariant v) { variants.append(v); }
};
static const int DRUM_INSTRUMENTS = 128;
//---------------------------------------------------------
// Drumset
// defines noteheads and line position for all
// possible midi notes in a drumset
//---------------------------------------------------------
class Drumset
{
DrumInstrument _drum[DRUM_INSTRUMENTS];
public:
bool isValid(int pitch) const { return !_drum[pitch].name.isEmpty(); }
NoteHead::Group noteHead(int pitch) const { return _drum[pitch].notehead; }
SymId noteHeads(int pitch, NoteHead::Type t) const { return _drum[pitch].noteheads[int(t)]; }
int line(int pitch) const { return _drum[pitch].line; }
int voice(int pitch) const { return _drum[pitch].voice; }
Direction stemDirection(int pitch) const { return _drum[pitch].stemDirection; }
const QString& name(int pitch) const { return _drum[pitch].name; }
int shortcut(int pitch) const { return _drum[pitch].shortcut; }
QList<DrumInstrumentVariant> variants(int pitch) const { return _drum[pitch].variants; }
void save(XmlWriter&) const;
void load(XmlReader&);
bool readProperties(XmlReader&, int);
void clear();
int nextPitch(int) const;
int prevPitch(int) const;
DrumInstrument& drum(int i) { return _drum[i]; }
const DrumInstrument& drum(int i) const { return _drum[i]; }
DrumInstrumentVariant findVariant(int pitch, const QVector<Articulation*> articulations, Tremolo* tremolo) const;
};
extern Drumset* smDrumset;
extern Drumset* gpDrumset;
extern void initDrumset();
} // namespace Ms
#endif
|
{
"pile_set_name": "Github"
}
|
-- ========================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <[email protected]>
-- Copyright (C) 2004-2009 Laurent Destailleur <[email protected]>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_c_forme_juridique
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
code integer NOT NULL,
fk_pays integer NOT NULL,
libelle varchar(255),
isvatexempted tinyint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL,
position integer NOT NULL DEFAULT 0
)ENGINE=innodb;
|
{
"pile_set_name": "Github"
}
|
/**********************************************************************
*These solidity codes have been obtained from Etherscan for extracting
*the smartcontract related info.
*The data will be used by MATRIX AI team as the reference basis for
*MATRIX model analysis,extraction of contract semantics,
*as well as AI based data analysis, etc.
**********************************************************************/
pragma solidity ^0.4.15;
pragma solidity ^0.4.15;
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/* ERC 20 token */
contract StandardToken is Token {
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else {
return false;
}
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
pragma solidity ^0.4.15;
pragma solidity ^0.4.15;
contract Ownable {
address public owner;
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
if (msg.sender == owner)
_;
}
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) owner = newOwner;
}
}
/*
* Pausable
* Abstract contract that allows children to implement an
* emergency stop mechanism.
*/
contract Pausable is Ownable {
bool public stopped;
modifier stopInEmergency {
if (stopped) {
throw;
}
_;
}
modifier onlyInEmergency {
if (!stopped) {
throw;
}
_;
}
// called by the owner on emergency, triggers stopped state
function emergencyStop() external onlyOwner {
stopped = true;
}
// called by the owner on end of emergency, returns to normal state
function release() external onlyOwner onlyInEmergency {
stopped = false;
}
}
pragma solidity ^0.4.15;
contract Utils{
//verifies the amount greater than zero
modifier greaterThanZero(uint256 _value){
require(_value>0);
_;
}
///verifies an address
modifier validAddress(address _add){
require(_add!=0x0);
_;
}
}
pragma solidity ^0.4.15;
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
}
contract Crowdsale is StandardToken, Pausable, SafeMath, Utils{
string public constant name = "BlockAim Token";
string public constant symbol = "BA";
uint256 public constant decimals = 18;
string public version = "1.0";
bool public tradingStarted = false;
/**
* @dev modifier that throws if trading has not started yet
*/
modifier hasStartedTrading() {
require(tradingStarted);
_;
}
/**
* @dev Allows the owner to enable the trading. This can not be undone
*/
function startTrading() onlyOwner() {
tradingStarted = true;
}
function transfer(address _to, uint _value) hasStartedTrading returns (bool success) {super.transfer(_to, _value);}
function transferFrom(address _from, address _to, uint _value) hasStartedTrading returns (bool success) {super.transferFrom(_from, _to, _value);}
enum State{
Inactive,
Funding,
Success,
Failure
}
uint256 public investmentETH;
mapping(uint256 => bool) transactionsClaimed;
uint256 public initialSupply;
address wallet;
uint256 public constant _totalSupply = 100 * (10**6) * 10 ** decimals; // 100M ~ 10 Crores
uint256 public fundingStartBlock; // crowdsale start block
uint256 public tokensPerEther = 300; // 1 ETH = 300 tokens
uint256 public constant tokenCreationMax = 10 * (10**6) * 10 ** decimals; // 10M ~ 1 Crores
address[] public investors;
//displays number of uniq investors
function investorsCount() constant external returns(uint) { return investors.length; }
function Crowdsale(uint256 _fundingStartBlock, address _owner, address _wallet){
owner = _owner;
fundingStartBlock =_fundingStartBlock;
totalSupply = _totalSupply;
initialSupply = 0;
wallet = _wallet;
//check configuration if something in setup is looking weird
if (
tokensPerEther == 0
|| owner == 0x0
|| wallet == 0x0
|| fundingStartBlock == 0
|| totalSupply == 0
|| tokenCreationMax == 0
|| fundingStartBlock <= block.number)
throw;
}
// don't just send ether to the contract expecting to get tokens
//function() { throw; }
////@dev This function manages the Crowdsale State machine
///We make it a function and do not assign to a variable//
///so that no chance of stale variable
function getState() constant public returns(State){
///once we reach success lock the State
if(block.number<fundingStartBlock) return State.Inactive;
else if(block.number>fundingStartBlock && initialSupply<tokenCreationMax) return State.Funding;
else if (initialSupply >= tokenCreationMax) return State.Success;
else return State.Failure;
}
///get total tokens in that address mapping
function getTokens(address addr) public returns(uint256){
return balances[addr];
}
function() external payable stopInEmergency{
// Abort if not in Funding Active state.
if(getState() == State.Success) throw;
if (msg.value == 0) throw;
uint256 newCreatedTokens = safeMul(msg.value,tokensPerEther);
///since we are creating tokens we need to increase the total supply
initialSupply = safeAdd(initialSupply,newCreatedTokens);
if(initialSupply>tokenCreationMax) throw;
if (balances[msg.sender] == 0) investors.push(msg.sender);
investmentETH += msg.value;
balances[msg.sender] = safeAdd(balances[msg.sender],newCreatedTokens);
Transfer(this, msg.sender, newCreatedTokens);
// Pocket the money
if(!wallet.send(msg.value)) throw;
}
///to be done only the owner can run this function
function tokenMint(address addr,uint256 tokens)
external
stopInEmergency
onlyOwner()
{
if(getState() == State.Success) throw;
if(addr == 0x0) throw;
if (tokens == 0) throw;
uint256 newCreatedTokens = tokens * 1 ether;
initialSupply = safeAdd(initialSupply,newCreatedTokens);
if(initialSupply>tokenCreationMax) throw;
if (balances[addr] == 0) investors.push(addr);
balances[addr] = safeAdd(balances[addr],newCreatedTokens);
Transfer(this, addr, newCreatedTokens);
}
///change exchange rate ~ update price everyday
function changeExchangeRate(uint256 eth)
external
onlyOwner()
{
if(eth == 0) throw;
tokensPerEther = eth;
}
///blacklist the users which are fraudulent
///from getting any tokens
///to do also refund just in cases
function blacklist(address addr)
external
onlyOwner()
{
balances[addr] = 0;
}
}
|
{
"pile_set_name": "Github"
}
|
package com.show.impl;
import java.util.List;
import org.n3r.idworker.Sid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.show.mapper.BgmMapper;
import com.show.mapper.CategoryMapper;
import com.show.pojo.Bgm;
import com.show.pojo.Category;
import com.show.service.BgmService;
import com.show.service.CategoryService;
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
private CategoryMapper cateGoryMapper;
@Override
public List<Category> queryCategroyList() {
return cateGoryMapper.selectAll();
}
}
|
{
"pile_set_name": "Github"
}
|
#! /usr/bin/env python
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
import re
import struct
import string
import binascii
__all__ = [
# Legacy interface exports traditional RFC 1521 Base64 encodings
'encode', 'decode', 'encodestring', 'decodestring',
# Generalized interface for other encodings
'b64encode', 'b64decode', 'b32encode', 'b32decode',
'b16encode', 'b16decode',
# Standard Base64 encoding
'standard_b64encode', 'standard_b64decode',
# Some common Base64 alternatives. As referenced by RFC 3458, see thread
# starting at:
#
# http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html
'urlsafe_b64encode', 'urlsafe_b64decode',
]
_translation = [chr(_x) for _x in range(256)]
EMPTYSTRING = ''
def _translate(s, altchars):
translation = _translation[:]
for k, v in altchars.items():
translation[ord(k)] = v
return s.translate(''.join(translation))
# Base64 encoding/decoding uses binascii
def b64encode(s, altchars=None):
"""Encode a string using Base64.
s is the string to encode. Optional altchars must be a string of at least
length 2 (additional characters are ignored) which specifies an
alternative alphabet for the '+' and '/' characters. This allows an
application to e.g. generate url or filesystem safe Base64 strings.
The encoded string is returned.
"""
# Strip off the trailing newline
encoded = binascii.b2a_base64(s)[:-1]
if altchars is not None:
return encoded.translate(string.maketrans(b'+/', altchars[:2]))
return encoded
def b64decode(s, altchars=None):
"""Decode a Base64 encoded string.
s is the string to decode. Optional altchars must be a string of at least
length 2 (additional characters are ignored) which specifies the
alternative alphabet used instead of the '+' and '/' characters.
The decoded string is returned. A TypeError is raised if s is
incorrectly padded. Characters that are neither in the normal base-64
alphabet nor the alternative alphabet are discarded prior to the padding
check.
"""
if altchars is not None:
s = s.translate(string.maketrans(altchars[:2], '+/'))
try:
return binascii.a2b_base64(s)
except binascii.Error, msg:
# Transform this exception for consistency
raise TypeError(msg)
def standard_b64encode(s):
"""Encode a string using the standard Base64 alphabet.
s is the string to encode. The encoded string is returned.
"""
return b64encode(s)
def standard_b64decode(s):
"""Decode a string encoded with the standard Base64 alphabet.
Argument s is the string to decode. The decoded string is returned. A
TypeError is raised if the string is incorrectly padded. Characters that
are not in the standard alphabet are discarded prior to the padding
check.
"""
return b64decode(s)
_urlsafe_encode_translation = string.maketrans(b'+/', b'-_')
_urlsafe_decode_translation = string.maketrans(b'-_', b'+/')
def urlsafe_b64encode(s):
"""Encode a string using the URL- and filesystem-safe Base64 alphabet.
Argument s is the string to encode. The encoded string is returned. The
alphabet uses '-' instead of '+' and '_' instead of '/'.
"""
return b64encode(s).translate(_urlsafe_encode_translation)
def urlsafe_b64decode(s):
"""Decode a string using the URL- and filesystem-safe Base64 alphabet.
Argument s is the string to decode. The decoded string is returned. A
TypeError is raised if the string is incorrectly padded. Characters that
are not in the URL-safe base-64 alphabet, and are not a plus '+' or slash
'/', are discarded prior to the padding check.
The alphabet uses '-' instead of '+' and '_' instead of '/'.
"""
return b64decode(s.translate(_urlsafe_decode_translation))
# Base32 encoding/decoding must be done in Python
_b32alphabet = {
0: 'A', 9: 'J', 18: 'S', 27: '3',
1: 'B', 10: 'K', 19: 'T', 28: '4',
2: 'C', 11: 'L', 20: 'U', 29: '5',
3: 'D', 12: 'M', 21: 'V', 30: '6',
4: 'E', 13: 'N', 22: 'W', 31: '7',
5: 'F', 14: 'O', 23: 'X',
6: 'G', 15: 'P', 24: 'Y',
7: 'H', 16: 'Q', 25: 'Z',
8: 'I', 17: 'R', 26: '2',
}
_b32tab = _b32alphabet.items()
_b32tab.sort()
_b32tab = [v for k, v in _b32tab]
_b32rev = dict([(v, long(k)) for k, v in _b32alphabet.items()])
def b32encode(s):
"""Encode a string using Base32.
s is the string to encode. The encoded string is returned.
"""
parts = []
quanta, leftover = divmod(len(s), 5)
# Pad the last quantum with zero bits if necessary
if leftover:
s += ('\0' * (5 - leftover))
quanta += 1
for i in range(quanta):
# c1 and c2 are 16 bits wide, c3 is 8 bits wide. The intent of this
# code is to process the 40 bits in units of 5 bits. So we take the 1
# leftover bit of c1 and tack it onto c2. Then we take the 2 leftover
# bits of c2 and tack them onto c3. The shifts and masks are intended
# to give us values of exactly 5 bits in width.
c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5])
c2 += (c1 & 1) << 16 # 17 bits wide
c3 += (c2 & 3) << 8 # 10 bits wide
parts.extend([_b32tab[c1 >> 11], # bits 1 - 5
_b32tab[(c1 >> 6) & 0x1f], # bits 6 - 10
_b32tab[(c1 >> 1) & 0x1f], # bits 11 - 15
_b32tab[c2 >> 12], # bits 16 - 20 (1 - 5)
_b32tab[(c2 >> 7) & 0x1f], # bits 21 - 25 (6 - 10)
_b32tab[(c2 >> 2) & 0x1f], # bits 26 - 30 (11 - 15)
_b32tab[c3 >> 5], # bits 31 - 35 (1 - 5)
_b32tab[c3 & 0x1f], # bits 36 - 40 (1 - 5)
])
encoded = EMPTYSTRING.join(parts)
# Adjust for any leftover partial quanta
if leftover == 1:
return encoded[:-6] + '======'
elif leftover == 2:
return encoded[:-4] + '===='
elif leftover == 3:
return encoded[:-3] + '==='
elif leftover == 4:
return encoded[:-1] + '='
return encoded
def b32decode(s, casefold=False, map01=None):
"""Decode a Base32 encoded string.
s is the string to decode. Optional casefold is a flag specifying whether
a lowercase alphabet is acceptable as input. For security purposes, the
default is False.
RFC 3548 allows for optional mapping of the digit 0 (zero) to the letter O
(oh), and for optional mapping of the digit 1 (one) to either the letter I
(eye) or letter L (el). The optional argument map01 when not None,
specifies which letter the digit 1 should be mapped to (when map01 is not
None, the digit 0 is always mapped to the letter O). For security
purposes the default is None, so that 0 and 1 are not allowed in the
input.
The decoded string is returned. A TypeError is raised if s were
incorrectly padded or if there are non-alphabet characters present in the
string.
"""
quanta, leftover = divmod(len(s), 8)
if leftover:
raise TypeError('Incorrect padding')
# Handle section 2.4 zero and one mapping. The flag map01 will be either
# False, or the character to map the digit 1 (one) to. It should be
# either L (el) or I (eye).
if map01:
s = s.translate(string.maketrans(b'01', b'O' + map01))
if casefold:
s = s.upper()
# Strip off pad characters from the right. We need to count the pad
# characters because this will tell us how many null bytes to remove from
# the end of the decoded string.
padchars = 0
mo = re.search('(?P<pad>[=]*)$', s)
if mo:
padchars = len(mo.group('pad'))
if padchars > 0:
s = s[:-padchars]
# Now decode the full quanta
parts = []
acc = 0
shift = 35
for c in s:
val = _b32rev.get(c)
if val is None:
raise TypeError('Non-base32 digit found')
acc += _b32rev[c] << shift
shift -= 5
if shift < 0:
parts.append(binascii.unhexlify('%010x' % acc))
acc = 0
shift = 35
# Process the last, partial quanta
last = binascii.unhexlify('%010x' % acc)
if padchars == 0:
last = '' # No characters
elif padchars == 1:
last = last[:-1]
elif padchars == 3:
last = last[:-2]
elif padchars == 4:
last = last[:-3]
elif padchars == 6:
last = last[:-4]
else:
raise TypeError('Incorrect padding')
parts.append(last)
return EMPTYSTRING.join(parts)
# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns
# lowercase. The RFC also recommends against accepting input case
# insensitively.
def b16encode(s):
"""Encode a string using Base16.
s is the string to encode. The encoded string is returned.
"""
return binascii.hexlify(s).upper()
def b16decode(s, casefold=False):
"""Decode a Base16 encoded string.
s is the string to decode. Optional casefold is a flag specifying whether
a lowercase alphabet is acceptable as input. For security purposes, the
default is False.
The decoded string is returned. A TypeError is raised if s is
incorrectly padded or if there are non-alphabet characters present in the
string.
"""
if casefold:
s = s.upper()
if re.search('[^0-9A-F]', s):
raise TypeError('Non-base16 digit found')
return binascii.unhexlify(s)
# Legacy interface. This code could be cleaned up since I don't believe
# binascii has any line length limitations. It just doesn't seem worth it
# though.
MAXLINESIZE = 76 # Excluding the CRLF
MAXBINSIZE = (MAXLINESIZE//4)*3
def encode(input, output):
"""Encode a file."""
while True:
s = input.read(MAXBINSIZE)
if not s:
break
while len(s) < MAXBINSIZE:
ns = input.read(MAXBINSIZE-len(s))
if not ns:
break
s += ns
line = binascii.b2a_base64(s)
output.write(line)
def decode(input, output):
"""Decode a file."""
while True:
line = input.readline()
if not line:
break
s = binascii.a2b_base64(line)
output.write(s)
def encodestring(s):
"""Encode a string into multiple lines of base-64 data."""
pieces = []
for i in range(0, len(s), MAXBINSIZE):
chunk = s[i : i + MAXBINSIZE]
pieces.append(binascii.b2a_base64(chunk))
return "".join(pieces)
def decodestring(s):
"""Decode a string."""
return binascii.a2b_base64(s)
# Useable as a script...
def test():
"""Small test program"""
import sys, getopt
try:
opts, args = getopt.getopt(sys.argv[1:], 'deut')
except getopt.error, msg:
sys.stdout = sys.stderr
print msg
print """usage: %s [-d|-e|-u|-t] [file|-]
-d, -u: decode
-e: encode (default)
-t: encode and decode string 'Aladdin:open sesame'"""%sys.argv[0]
sys.exit(2)
func = encode
for o, a in opts:
if o == '-e': func = encode
if o == '-d': func = decode
if o == '-u': func = decode
if o == '-t': test1(); return
if args and args[0] != '-':
with open(args[0], 'rb') as f:
func(f, sys.stdout)
else:
func(sys.stdin, sys.stdout)
def test1():
s0 = "Aladdin:open sesame"
s1 = encodestring(s0)
s2 = decodestring(s1)
print s0, repr(s1), s2
if __name__ == '__main__':
test()
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
xmlns:md="http://www.medico.com/schemas/record"
xmlns:xacml-context="urn:oasis:names:tc:xacml:3.0:context:schema:os"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
PolicyId="urn:oasis:names:tc:xacml:2.0:conformance-test:IIIG006:policy"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:deny-overrides"
Version="1.0"
xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:policy:schema:os access_control-xacml-2.0-policy-schema-os.xsd">
<Description>
Policy for Conformance Test IIIG006d. Copy of IIG006 using Deprecated XPath functions.
See https://www.oasis-open.org/committees/xacml/ConformanceTests/ConformanceTests.html
and https://www.oasis-open.org/committees/download.php/14877/ConformanceTests.html
Purpose - Non-mandatory Functions: Case: Relative XPath expressions in XPath-based functions DEPRECATED
OPTIONAL test - function may or may not be implemented. See the Response file.
</Description>
<PolicyDefaults>
<XPathVersion>http://www.w3.org/TR/1999/Rec-xpath-19991116</XPathVersion>
</PolicyDefaults>
<Target/>
<Rule Effect="Permit" RuleId="urn:oasis:names:tc:xacml:2.0:conformance-test:IIIG006d:rule">
<Condition>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:xpath-node-count">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
XPathCategory="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" >
//md:name
</AttributeValue>
</Apply>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">2</AttributeValue>
</Apply>
<!-- Testing for equality of one out of a list is a better test than checking that one thing is same as the same thing selected a different way -->
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:xpath-node-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
XPathCategory="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" >
//md:name
</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
XPathCategory="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" >
//md:name[text()='Bart Simpson']
</AttributeValue>
</Apply>
<!-- Test that looks for child node within the first node is more interesting than matching a node with itself -->
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:xpath-node-match">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
XPathCategory="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" >
.
</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
XPathCategory="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" >
//md:name[text()='Bart Simpson']
</AttributeValue>
</Apply>
</Apply>
</Condition>
</Rule>
</Policy>
|
{
"pile_set_name": "Github"
}
|
/**
* This file is copyright 2017 State of the Netherlands (Ministry of Interior Affairs and Kingdom Relations).
* It is made available under the terms of the GNU Affero General Public License, version 3 as published by the Free Software Foundation.
* The project of which this file is part, may be found at https://github.com/MinBZK/operatieBRP.
*/
/**
* Provides...
*/
package nl.bzk.brp.preview.service;
|
{
"pile_set_name": "Github"
}
|
[core]
repositoryformatversion = 0
filemode = true
bare = true
|
{
"pile_set_name": "Github"
}
|
//
// Created by Jiandan on 2018/10/11.
// Copyright (c) 2018 Jiandan. All rights reserved.
//
import Foundation
struct QueueBasedOnLinkedList<Element>: Queue {
/// 队首
var head: Node<Element>?
/// 队尾
var tail: Node<Element>?
// MARK: Protocol: Queue
var isEmpty: Bool { return head == nil }
var size: Int {
if isEmpty {
return 0
}
var count = 1 // head 本身算一个
while head?.next != nil {
count += 1
}
return count
}
var peek: Element? { return head?.value }
mutating func enqueue(newElement: Element) -> Bool {
if isEmpty {
// 空队列
let node = Node(value: newElement)
head = node
tail = node
} else {
tail!.next = Node(value: newElement)
tail = tail!.next
}
return true
}
mutating func dequeue() -> Element? {
if isEmpty {
return nil
}
let node = head
head = head!.next
return node?.value
}
}
|
{
"pile_set_name": "Github"
}
|
"""Odyssey pyFSD module
- implements the functionality of bin\pyFSD.pyd in the EVE install.
Copyright (c) 2003-2013 Jamie "Entity" van den Berge <[email protected]>
This code is free software; you can redistribute it and/or modify
it under the terms of the BSD license (see the file LICENSE.txt
included with the distribution).
"""
from reverence import _pyFSD
FsdUnsignedIntegerKeyMap = _pyFSD.FsdUnsignedIntegerKeyMap
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ModuleReference_Cmds[];
|
{
"pile_set_name": "Github"
}
|
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgqwmpPvUDiOL62Bmo
68+QDgqipuolZa/AMhVHhF717WqhRANCAAT4r/XB7lS5FTk66IZfURkPoIodoke9
uabulh9dUTC4MYHDm6zDghLeZN4nlnu1ZevH1J3VubwqRM9GzKZiesg/
-----END PRIVATE KEY-----
|
{
"pile_set_name": "Github"
}
|
--main Main
--interp
|
{
"pile_set_name": "Github"
}
|
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 [email protected]
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0.
You may use XOWA according to either of these licenses as is most appropriate
for your project on a case-by-case basis.
The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/
package gplx.core.stores; import gplx.*; import gplx.core.*;
import gplx.core.criterias.*; import gplx.dbs.*; import gplx.core.gfo_ndes.*;
public class DbMaprRdr extends DataRdr_base implements SrlMgr {
@Override public String NameOfNode() {return "DbMaprRdr";}
@Override public Object StoreRoot(SrlObj subProto, String key) {
mgr = (DbMaprMgr)this.EnvVars().Get_by_or_fail(DbMaprWtr.Key_Mgr);
DbMaprItm rootMapr = mgr.Root();
GfoNde tbl = GetTbl(rootMapr, rootCrt); int subsCount = tbl.Subs().Count(); if (subsCount == 0) return null; if (subsCount > 1) throw Err_.new_wo_type("criteria returned > 1 row", "criteria", rootCrt.To_str(), "subsCount", subsCount);
SrlObj root = subProto.SrlObj_New(null);
mgr.EnvStack_add(rootMapr, root); RowStack_add(tbl, 0);
root.SrlObj_Srl(this);
mgr.Clear(); rowStack.Clear();
return root;
}
@Override public void SrlList(String subPropKey, List_adp list, SrlObj subProto, String itmKey) {
DbMaprItm curMapr = (DbMaprItm)mgr.MaprStack().Get_at_last();
DbMaprItm subMapr = curMapr.Subs_get(subPropKey);
list.Clear();
Criteria crit = MakeCrt(mgr, subMapr);
GfoNde tbl = GetTbl(subMapr, crit);
int tblLen = tbl.Subs().Count();
for (int i = 0; i < tblLen; i++) {
SrlObj sub = (SrlObj)subProto.SrlObj_New(null);
GfoNde subRow = tbl.Subs().FetchAt_asGfoNde(i);
mgr.EnvStack_add(subMapr, sub); rowStack.Add(subRow);
sub.SrlObj_Srl(this); list.Add(sub);
mgr.EnvStack_del(subMapr, sub); List_adp_.Del_at_last(rowStack);
}
}
Criteria MakeCrt(DbMaprMgr mgr, DbMaprItm mapr) {
Criteria rv = null, cur = null;
List_adp list = GetIdxFlds(mgr, mapr);
for (Object kvObj : list) {
Keyval kv = (Keyval)kvObj;
cur = Db_crt_.New_eq(kv.Key(), kv.Val());
rv = (rv == null) ? cur : Criteria_.And(rv, cur);
}
return rv;
}
List_adp GetIdxFlds(DbMaprMgr mgr, DbMaprItm curMapr) {
List_adp rv = List_adp_.New();
int maprStackCount = mgr.MaprStack().Count() - 0; // -1 b/c current is added to stack
for (int i = 0; i < maprStackCount; i ++) {
DbMaprItm mapr = (DbMaprItm)mgr.MaprStack().Get_at(i);
SrlObj gobj = (SrlObj)mgr.OwnerStack().Get_at(i);
for (Object argObj : mapr.ContextFlds()) {
DbMaprArg arg = (DbMaprArg)argObj;
Object propVal = Gfo_invk_.Invk_by_key((Gfo_invk)gobj, arg.ObjProp());
rv.Add(Keyval_.new_(arg.DbFld(), propVal));
}
}
for (Object argObj : curMapr.ConstantFlds()) {
Keyval arg = (Keyval)argObj;
rv.Add(arg);
}
return rv;
}
GfoNde GetTbl(DbMaprItm mapr, Criteria crit) {
String key = mapr.TableName();
GfoNde tblByRootCrt = GfoNde_.as_(tables.Get_by(key));
if (tblByRootCrt == null) {
DataRdr dbRdr = null;
try {
dbRdr = conn.Exec_qry_as_old_rdr(Db_qry_.select_().From_(mapr.TableName()).Where_(rootCrt));
tblByRootCrt = GfoNde_.rdr_(dbRdr);
}
finally {dbRdr.Rls();}
tables.Add(key, tblByRootCrt);
}
GfoNde rv = GfoNde_.tbl_(mapr.TableName(), tblByRootCrt.Flds());
for (int i = 0; i < tblByRootCrt.Subs().Count(); i++) {
GfoNde row = tblByRootCrt.Subs().FetchAt_asGfoNde(i);
if (crit.Matches(row)) rv.Subs().Add(row);
}
return rv;
}
void RowStack_add(GfoNde tbl, int i) {
GfoNdeList ndeList = tbl.Subs(); if (i >= ndeList.Count()) throw Err_.new_missing_idx(i, ndeList.Count());
rowStack.Add(tbl.Subs().FetchAt_asGfoNde(i));
}
@Override public Object Read(String key) {
DbMaprItm mapr = (DbMaprItm)mgr.MaprStack().Get_at_last();
GfoNde row = (GfoNde)rowStack.Get_at_last();
DbMaprArg arg = mapr.Flds_get(key);
Object dbVal = null; try {dbVal = row.Read(arg.DbFld());} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to read dbVal from row", "key", key, "fld", arg.DbFld());}
return dbVal;
}
@Override public DataRdr Subs_byName_moveFirst(String name) {throw Err_.new_unimplemented();}
@Override public DataRdr Subs() {throw Err_.new_unimplemented();}
@Override public int FieldCount() {throw Err_.new_unimplemented();}
@Override public String KeyAt(int i) {throw Err_.new_unimplemented();}
@Override public Object ReadAt(int i) {throw Err_.new_unimplemented();}
@Override public Keyval KeyValAt(int i) {throw Err_.new_unimplemented();}
@Override public SrlMgr SrlMgr_new(Object o) {return new DbMaprRdr();}
Hash_adp tables = Hash_adp_.New();
Db_conn conn; Criteria rootCrt;
DbMaprMgr mgr; List_adp rowStack = List_adp_.New();
public static DbMaprRdr new_(Db_conn_info dbInfo, Criteria rootCrt) {
DbMaprRdr rv = new DbMaprRdr();
rv.conn = Db_conn_pool.Instance.Get_or_new(dbInfo); rv.rootCrt = rootCrt;
return rv;
} DbMaprRdr() {}
}
|
{
"pile_set_name": "Github"
}
|
from . import cgcrandom
# TODO use cpu factory
from ..native.cpu.x86 import I386Cpu
from ..native.cpu.abstractcpu import Interruption, ConcretizeRegister, ConcretizeArgument
from ..native.memory import SMemory32, Memory32
from ..core.smtlib import *
from ..core.state import TerminateState
from ..binary import CGCElf
from ..platforms.platform import Platform
import logging
import random
logger = logging.getLogger(__name__)
class RestartSyscall(Exception):
pass
class Deadlock(Exception):
pass
class SymbolicSyscallArgument(ConcretizeRegister):
def __init__(self, cpu, number, message="Concretizing syscall argument", policy="SAMPLED"):
reg_name = ["EBX", "ECX", "EDX", "ESI", "EDI", "EBP"][number]
super().__init__(cpu, reg_name, message, policy)
class Socket:
@staticmethod
def pair():
a = Socket()
b = Socket()
a.connect(b)
return a, b
def __init__(self):
self.buffer = [] # queue os bytes
self.peer = None
def __repr__(self):
return "SOCKET(%x, %r, %x)" % (hash(self), self.buffer, hash(self.peer))
def is_connected(self):
return self.peer is not None
def is_empty(self):
return len(self.buffer) == 0
def is_full(self):
return len(self.buffer) > 2 * 1024
def connect(self, peer):
assert not self.is_connected()
assert not peer.is_connected()
self.peer = peer
if peer.peer is None:
peer.peer = self
def receive(self, size):
rx_bytes = min(size, len(self.buffer))
ret = []
for i in range(rx_bytes):
ret.append(self.buffer.pop())
return ret
def transmit(self, buf):
assert self.is_connected()
return self.peer._transmit(buf)
def _transmit(self, buf):
for c in buf:
self.buffer.insert(0, c)
return len(buf)
class Decree(Platform):
"""
A simple Decree Operating System.
This class emulates the most common Decree system calls
"""
CGC_EBADF = 1
CGC_EFAULT = 2
CGC_EINVAL = 3
CGC_ENOMEM = 4
CGC_ENOSYS = 5
CGC_EPIPE = 6
CGC_SSIZE_MAX = 2147483647
CGC_SIZE_MAX = 4294967295
CGC_FD_SETSIZE = 32
def __init__(self, programs, **kwargs):
"""
Builds a Decree OS
:param cpus: CPU for this platform
:param mem: memory for this platform
:todo: generalize for more CPUs
:todo: fix deps?
"""
programs = programs.split(",")
super().__init__(path=programs[0], **kwargs)
self.program = programs[0]
self.clocks = 0
self.files = []
self.syscall_trace = []
self.files = []
# open standard files stdin, stdout, stderr
logger.info("Opening file descriptors (0,1,2)")
self.input = Socket()
self.output = Socket()
stdin = Socket()
stdout = Socket()
stderr = Socket()
# A transmit to stdin,stdout or stderr will be directed to out
stdin.peer = self.output
stdout.peer = self.output
stderr.peer = self.output
# A receive from stdin will get data from inp
self.input.peer = stdin
# A receive on stdout or stderr will return no data (rx_bytes: 0)
assert self._open(stdin) == 0
assert self._open(stdout) == 1
assert self._open(stderr) == 2
# Load process and setup socketpairs
self.procs = []
for program in programs:
self.procs += self.load(program)
socka, sockb = Socket.pair()
self._open(socka)
self._open(sockb)
nprocs = len(self.procs)
nfiles = len(self.files)
assert nprocs > 0
self.running = list(range(nprocs))
self._current = 0
# Each process can wait for one timeout
self.timers = [None] * nprocs
# each fd has a waitlist
self.rwait = [set() for _ in range(nfiles)]
self.twait = [set() for _ in range(nfiles)]
# Install event forwarders
for proc in self.procs:
self.forward_events_from(proc)
@property
def PC(self):
return self._current, self.procs[self._current].PC
def __deepcopy__(self, memo):
return self
def _mk_proc(self):
return I386Cpu(Memory32())
@property
def current(self):
return self.procs[self._current]
def __getstate__(self):
state = super().__getstate__()
state["clocks"] = self.clocks
state["input"] = self.input.buffer
state["output"] = self.output.buffer
state["files"] = [x.buffer for x in self.files]
state["procs"] = self.procs
state["current"] = self._current
state["running"] = self.running
state["rwait"] = self.rwait
state["twait"] = self.twait
state["timers"] = self.timers
state["syscall_trace"] = self.syscall_trace
return state
def __setstate__(self, state):
"""
:todo: some asserts
:todo: fix deps? (last line)
"""
super().__setstate__(state)
self.input = Socket()
self.input.buffer = state["input"]
self.output = Socket()
self.output.buffer = state["output"]
self.files = []
for buf in state["files"]:
f = Socket()
f.buffer = buf
self.files.append(f)
for fd in range(len(self.files)):
if self.connections(fd) is not None:
self.files[fd].peer = self.files[self.connections(fd)]
self.files[0].peer = self.output
self.files[1].peer = self.output
self.files[2].peer = self.output
self.input.peer = self.files[0]
self.procs = state["procs"]
self._current = state["current"]
self.running = state["running"]
self.rwait = state["rwait"]
self.twait = state["twait"]
self.timers = state["timers"]
self.clocks = state["clocks"]
self.syscall_trace = state["syscall_trace"]
# Install event forwarders
for proc in self.procs:
self.forward_events_from(proc)
def _read_string(self, cpu, buf):
"""
Reads a null terminated concrete buffer form memory
:todo: FIX. move to cpu or memory
"""
filename = ""
for i in range(0, 1024):
c = Operators.CHR(cpu.read_int(buf + i, 8))
if c == "\x00":
break
filename += c
return filename
def load(self, filename):
"""
Loads a CGC-ELF program in memory and prepares the initial CPU state
and the stack.
:param filename: pathname of the file to be executed.
"""
CGC_MIN_PAGE_SIZE = 4096
CGC_MIN_ALIGN = CGC_MIN_PAGE_SIZE
TASK_SIZE = 0x80000000
def CGC_PAGESTART(_v):
return (_v) & ~(CGC_MIN_ALIGN - 1)
def CGC_PAGEOFFSET(_v):
return (_v) & (CGC_MIN_ALIGN - 1)
def CGC_PAGEALIGN(_v):
return ((_v) + CGC_MIN_ALIGN - 1) & ~(CGC_MIN_ALIGN - 1)
def BAD_ADDR(x):
return (x) >= TASK_SIZE
# load elf See https://github.com/CyberdyneNYC/linux-source-3.13.2-cgc/blob/master/fs/binfmt_cgc.c
# read the ELF object file
cgc = CGCElf(filename)
logger.info("Loading %s as a %s elf" % (filename, cgc.arch))
# make cpu and memory (Only 1 thread in Decree)
cpu = self._mk_proc()
bss = brk = 0
start_code = 0xFFFFFFFF
end_code = start_data = end_data = 0
for (vaddr, memsz, perms, name, offset, filesz) in cgc.maps():
if vaddr < start_code:
start_code = vaddr
if start_data < vaddr:
start_data = vaddr
if (
vaddr > TASK_SIZE
or filesz > memsz
or memsz > TASK_SIZE
or TASK_SIZE - memsz < vaddr
):
raise Exception("Set_brk can never work. avoid overflows")
# CGCMAP--
addr = None
if filesz > 0:
hint = CGC_PAGESTART(vaddr)
size = CGC_PAGEALIGN(filesz + CGC_PAGEOFFSET(vaddr))
offset = CGC_PAGESTART(offset)
addr = cpu.memory.mmapFile(hint, size, perms, name, offset)
assert not BAD_ADDR(addr)
lo = CGC_PAGEALIGN(vaddr + filesz)
hi = CGC_PAGEALIGN(vaddr + memsz)
else:
# for 0 filesz, we have to include the first page as bss.
lo = CGC_PAGESTART(vaddr + filesz)
hi = CGC_PAGEALIGN(vaddr + memsz)
# map anon pages for the rest (no prefault)
if hi - lo > 0:
zaddr = cpu.memory.mmap(lo, hi - lo, perms)
assert not BAD_ADDR(zaddr)
lo = vaddr + filesz
hi = CGC_PAGEALIGN(vaddr + memsz)
if hi - lo > 0:
old_perms = cpu.memory.perms(lo)
cpu.memory.mprotect(lo, hi - lo, "rw")
try:
cpu.memory[lo:hi] = "\x00" * (hi - lo)
except Exception as e:
logger.debug("Exception zeroing main elf fractional pages: %s" % str(e))
cpu.memory.mprotect(lo, hi, old_perms)
if addr is None:
addr = zaddr
assert addr is not None
k = vaddr + filesz
if k > bss:
bss = k
if "x" in perms and end_code < k:
end_code = k
if end_data < k:
end_data = k
k = vaddr + memsz
if k > brk:
brk = k
bss = brk
stack_base = 0xBAAAAFFC
stack_size = 0x800000
stack = cpu.memory.mmap(0xBAAAB000 - stack_size, stack_size, "rwx") + stack_size - 4
assert (stack_base) in cpu.memory and (stack_base - stack_size + 4) in cpu.memory
# Only one thread in Decree
status, thread = next(cgc.threads())
assert status == "Running"
logger.info("Setting initial cpu state")
cpu.write_register("EAX", 0x0)
cpu.write_register(
"ECX",
cpu.memory.mmap(
CGC_PAGESTART(0x4347C000), CGC_PAGEALIGN(4096 + CGC_PAGEOFFSET(0x4347C000)), "rwx"
),
)
cpu.write_register("EDX", 0x0)
cpu.write_register("EBX", 0x0)
cpu.write_register("ESP", stack)
cpu.write_register("EBP", 0x0)
cpu.write_register("ESI", 0x0)
cpu.write_register("EDI", 0x0)
cpu.write_register("EIP", thread["EIP"])
cpu.write_register("RFLAGS", 0x202)
cpu.write_register("CS", 0x0)
cpu.write_register("SS", 0x0)
cpu.write_register("DS", 0x0)
cpu.write_register("ES", 0x0)
cpu.write_register("FS", 0x0)
cpu.write_register("GS", 0x0)
cpu.memory.mmap(0x4347C000, 0x1000, "r")
# cpu.memory[0x4347c000:0x4347d000] = 'A' 0x1000
logger.info("Entry point: %016x", cpu.EIP)
logger.info("Stack start: %016x", cpu.ESP)
logger.info("Brk: %016x", brk)
logger.info("Mappings:")
for m in str(cpu.memory).split("\n"):
logger.info(" %s", m)
return [cpu]
def _open(self, f):
if None in self.files:
fd = self.files.index(None)
self.files[fd] = f
else:
fd = len(self.files)
self.files.append(f)
return fd
def _close(self, fd):
"""
Closes a file descriptor
:rtype: int
:param fd: the file descriptor to close.
:return: C{0} on success.
"""
self.files[fd] = None
def _dup(self, fd):
"""
Duplicates a file descriptor
:rtype: int
:param fd: the file descriptor to close.
:return: C{0} on success.
"""
return self._open(self.files[fd])
def _is_open(self, fd):
return fd >= 0 and fd < len(self.files) and self.files[fd] is not None
def sys_allocate(self, cpu, length, isX, addr):
""" allocate - allocate virtual memory
The allocate system call creates a new allocation in the virtual address
space of the calling process. The length argument specifies the length of
the allocation in bytes which will be rounded up to the hardware page size.
The kernel chooses the address at which to create the allocation; the
address of the new allocation is returned in *addr as the result of the call.
All newly allocated memory is readable and writeable. In addition, the
is_X argument is a boolean that allows newly allocated memory to be marked
as executable (non-zero) or non-executable (zero).
The allocate function is invoked through system call number 5.
:param cpu: current CPU
:param length: the length of the allocation in bytes
:param isX: boolean that allows newly allocated memory to be marked as executable
:param addr: the address of the new allocation is returned in *addr
:return: On success, allocate returns zero and a pointer to the allocated area
is returned in *addr. Otherwise, an error code is returned
and *addr is undefined.
EINVAL length is zero.
EINVAL length is too large.
EFAULT addr points to an invalid address.
ENOMEM No memory is available or the process' maximum number of allocations
would have been exceeded.
"""
# TODO: check 4 bytes from addr
if addr not in cpu.memory:
logger.info("ALLOCATE: addr points to invalid address. Returning EFAULT")
return Decree.CGC_EFAULT
perms = ["rw ", "rwx"][bool(isX)]
try:
result = cpu.memory.mmap(None, length, perms)
except Exception as e:
logger.info("ALLOCATE exception %s. Returning ENOMEM %r", str(e), length)
return Decree.CGC_ENOMEM
cpu.write_int(addr, result, 32)
logger.info("ALLOCATE(%d, %s, 0x%08x) -> 0x%08x" % (length, perms, addr, result))
self.syscall_trace.append(("_allocate", -1, length))
return 0
def sys_random(self, cpu, buf, count, rnd_bytes):
""" random - fill a buffer with random data
The random system call populates the buffer referenced by buf with up to
count bytes of random data. If count is zero, random returns 0 and optionally
sets *rx_bytes to zero. If count is greater than SSIZE_MAX, the result is unspecified.
:param cpu: current CPU
:param buf: a memory buffer
:param count: max number of bytes to receive
:param rnd_bytes: if valid, points to the actual number of random bytes
:return: 0 On success
EINVAL count is invalid.
EFAULT buf or rnd_bytes points to an invalid address.
"""
ret = 0
if count != 0:
if count > Decree.CGC_SSIZE_MAX or count < 0:
ret = Decree.CGC_EINVAL
else:
# TODO check count bytes from buf
if buf not in cpu.memory or (buf + count) not in cpu.memory:
logger.info("RANDOM: buf points to invalid address. Returning EFAULT")
return Decree.CGC_EFAULT
with open("/dev/urandom", "rb") as f:
data = f.read(count)
self.syscall_trace.append(("_random", -1, data))
cpu.write_bytes(buf, data)
# TODO check 4 bytes from rx_bytes
if rnd_bytes:
if rnd_bytes not in cpu.memory:
logger.info("RANDOM: Not valid rnd_bytes. Returning EFAULT")
return Decree.CGC_EFAULT
cpu.write_int(rnd_bytes, len(data), 32)
logger.info(
"RANDOM(0x%08x, %d, 0x%08x) -> <%s>)" % (buf, count, rnd_bytes, repr(data[:10]))
)
return ret
def sys_receive(self, cpu, fd, buf, count, rx_bytes):
""" receive - receive bytes from a file descriptor
The receive system call reads up to count bytes from file descriptor fd to the
buffer pointed to by buf. If count is zero, receive returns 0 and optionally
sets *rx_bytes to zero.
:param cpu: current CPU.
:param fd: a valid file descriptor
:param buf: a memory buffer
:param count: max number of bytes to receive
:param rx_bytes: if valid, points to the actual number of bytes received
:return: 0 Success
EBADF fd is not a valid file descriptor or is not open
EFAULT buf or rx_bytes points to an invalid address.
"""
data = ""
if count != 0:
if not self._is_open(fd):
logger.info("RECEIVE: Not valid file descriptor on receive. Returning EBADF")
return Decree.CGC_EBADF
# TODO check count bytes from buf
if buf not in cpu.memory: # or not buf+count in cpu.memory:
logger.info("RECEIVE: buf points to invalid address. Returning EFAULT")
return Decree.CGC_EFAULT
# import random
# count = random.randint(1,count)
if fd > 2 and self.files[fd].is_empty():
cpu.PC -= cpu.instruction.size
self.wait([fd], [], None)
raise RestartSyscall()
# get some potential delay
# if random.randint(5) == 0 and count > 1:
# count = count/2
# Read the data and put it in memory
data = self.files[fd].receive(count)
self.syscall_trace.append(("_receive", fd, data))
cpu.write_bytes(buf, data)
self.signal_receive(fd)
# TODO check 4 bytes from rx_bytes
if rx_bytes:
if rx_bytes not in cpu.memory:
logger.info("RECEIVE: Not valid file descriptor on receive. Returning EFAULT")
return Decree.CGC_EFAULT
cpu.write_int(rx_bytes, len(data), 32)
logger.info(
"RECEIVE(%d, 0x%08x, %d, 0x%08x) -> <%s> (size:%d)"
% (fd, buf, count, rx_bytes, repr(data)[: min(count, 10)], len(data))
)
return 0
def sys_transmit(self, cpu, fd, buf, count, tx_bytes):
""" transmit - send bytes through a file descriptor
The transmit system call writes up to count bytes from the buffer pointed
to by buf to the file descriptor fd. If count is zero, transmit returns 0
and optionally sets *tx_bytes to zero.
:param cpu current CPU
:param fd a valid file descriptor
:param buf a memory buffer
:param count number of bytes to send
:param tx_bytes if valid, points to the actual number of bytes transmitted
:return: 0 Success
EBADF fd is not a valid file descriptor or is not open.
EFAULT buf or tx_bytes points to an invalid address.
"""
data = []
if count != 0:
if not self._is_open(fd):
logger.error("TRANSMIT: Not valid file descriptor. Returning EBADFD %d", fd)
return Decree.CGC_EBADF
# TODO check count bytes from buf
if buf not in cpu.memory or (buf + count) not in cpu.memory:
logger.debug("TRANSMIT: buf points to invalid address. Rerurning EFAULT")
return Decree.CGC_EFAULT
if fd > 2 and self.files[fd].is_full():
cpu.PC -= cpu.instruction.size
self.wait([], [fd], None)
raise RestartSyscall()
for i in range(0, count):
value = Operators.CHR(cpu.read_int(buf + i, 8))
if not isinstance(value, str):
logger.debug("TRANSMIT: Writing symbolic values to file %d", fd)
# value = str(value)
data.append(value)
self.files[fd].transmit(data)
logger.info(
"TRANSMIT(%d, 0x%08x, %d, 0x%08x) -> <%.24r>"
% (fd, buf, count, tx_bytes, "".join([str(x) for x in data]))
)
self.syscall_trace.append(("_transmit", fd, data))
self.signal_transmit(fd)
# TODO check 4 bytes from tx_bytes
if tx_bytes:
if tx_bytes not in cpu.memory:
logger.debug("TRANSMIT: Not valid tx_bytes pointer on transmit. Returning EFAULT")
return Decree.CGC_EFAULT
cpu.write_int(tx_bytes, len(data), 32)
return 0
def sys_terminate(self, cpu, error_code):
"""
Exits all threads in a process
:param cpu: current CPU.
:raises Exception: 'Finished'
"""
procid = self.procs.index(cpu)
self.sched()
self.running.remove(procid)
# self.procs[procid] = None #let it there so we can report?
if issymbolic(error_code):
logger.info(
"TERMINATE PROC_%02d with symbolic exit code [%d,%d]",
procid,
solver.minmax(self.constraints, error_code),
)
else:
logger.info("TERMINATE PROC_%02d %x", procid, error_code)
if len(self.running) == 0:
raise TerminateState(f"Process exited correctly. Code: {error_code}")
return error_code
def sys_deallocate(self, cpu, addr, size):
""" deallocate - remove allocations
The deallocate system call deletes the allocations for the specified
address range, and causes further references to the addresses within the
range to generate invalid memory accesses. The region is also
automatically deallocated when the process is terminated.
The address addr must be a multiple of the page size. The length parameter
specifies the size of the region to be deallocated in bytes. All pages
containing a part of the indicated range are deallocated, and subsequent
references will terminate the process. It is not an error if the indicated
range does not contain any allocated pages.
The deallocate function is invoked through system call number 6.
:param cpu: current CPU
:param addr: the starting address to unmap.
:param size: the size of the portion to unmap.
:return 0 On success
EINVAL addr is not page aligned.
EINVAL length is zero.
EINVAL any part of the region being deallocated is outside the valid
address range of the process.
:param cpu: current CPU.
:return: C{0} on success.
"""
logger.info("DEALLOCATE(0x%08x, %d)" % (addr, size))
if addr & 0xFFF != 0:
logger.info("DEALLOCATE: addr is not page aligned")
return Decree.CGC_EINVAL
if size == 0:
logger.info("DEALLOCATE:length is zero")
return Decree.CGC_EINVAL
# unlikely AND WRONG!!!
# if addr > Decree.CGC_SSIZE_MAX or addr+size > Decree.CGC_SSIZE_MAX:
# logger.info("DEALLOCATE: part of the region being deallocated is outside the valid address range of the process")
# return Decree.CGC_EINVAL
cpu.memory.munmap(addr, size)
self.syscall_trace.append(("_deallocate", -1, size))
return 0
def sys_fdwait(self, cpu, nfds, readfds, writefds, timeout, readyfds):
""" fdwait - wait for file descriptors to become ready
"""
logger.debug(
"FDWAIT(%d, 0x%08x, 0x%08x, 0x%08x, 0x%08x)"
% (nfds, readfds, writefds, timeout, readyfds)
)
if timeout:
if timeout not in cpu.memory: # todo: size
logger.info("FDWAIT: timeout is pointing to invalid memory. Returning EFAULT")
return Decree.CGC_EFAULT
if readyfds:
if readyfds not in cpu.memory:
logger.info("FDWAIT: readyfds pointing to invalid memory. Returning EFAULT")
return Decree.CGC_EFAULT
writefds_wait = set()
writefds_ready = set()
fds_bitsize = (nfds + 7) & ~7
if writefds:
if writefds not in cpu.memory:
logger.info("FDWAIT: writefds pointing to invalid memory. Returning EFAULT")
return Decree.CGC_EFAULT
bits = cpu.read_int(writefds, fds_bitsize)
for fd in range(nfds):
if bits & 1 << fd:
if self.files[fd].is_full():
writefds_wait.add(fd)
else:
writefds_ready.add(fd)
readfds_wait = set()
readfds_ready = set()
if readfds:
if readfds not in cpu.memory:
logger.info("FDWAIT: readfds pointing to invalid memory. Returning EFAULT")
return Decree.CGC_EFAULT
bits = cpu.read_int(readfds, fds_bitsize)
for fd in range(nfds):
if bits & 1 << fd:
if self.files[fd].is_empty():
readfds_wait.add(fd)
else:
readfds_ready.add(fd)
n = len(readfds_ready) + len(writefds_ready)
if n == 0:
# TODO FIX timeout symbolic
if timeout != 0:
seconds = cpu.read_int(timeout, 32)
microseconds = cpu.read_int(timeout + 4, 32)
logger.info(
"FDWAIT: waiting for read on fds: {%s} and write to: {%s} timeout: %d",
repr(list(readfds_wait)),
repr(list(writefds_wait)),
microseconds + 1000 * seconds,
)
to = microseconds + 1000 * seconds
# no ready file, wait
else:
to = None
logger.info(
"FDWAIT: waiting for read on fds: {%s} and write to: {%s} timeout: INDIFENITELY",
repr(list(readfds_wait)),
repr(list(writefds_wait)),
)
cpu.PC -= cpu.instruction.size
self.wait(readfds_wait, writefds_wait, to)
raise RestartSyscall() # When coming back from a timeout remember
# not to backtrack instruction and set EAX to 0! :( ugliness alert!
if readfds:
bits = 0
for fd in readfds_ready:
bits |= 1 << fd
for byte in range(0, nfds, 8):
cpu.write_int(readfds, (bits >> byte) & 0xFF, 8)
if writefds:
bits = 0
for fd in writefds_ready:
bits |= 1 << fd
for byte in range(0, nfds, 8):
cpu.write_int(writefds, (bits >> byte) & 0xFF, 8)
logger.info("FDWAIT: continuing. Some file is ready Readyfds: %08x", readyfds)
if readyfds:
cpu.write_int(readyfds, n, 32)
self.syscall_trace.append(("_fdwait", -1, None))
return 0
def int80(self, cpu):
"""
32 bit dispatcher.
:param cpu: current CPU.
_terminate, transmit, receive, fdwait, allocate, deallocate and random
"""
syscalls = {
0x00000001: self.sys_terminate,
0x00000002: self.sys_transmit,
0x00000003: self.sys_receive,
0x00000004: self.sys_fdwait,
0x00000005: self.sys_allocate,
0x00000006: self.sys_deallocate,
0x00000007: self.sys_random,
}
if cpu.EAX not in syscalls.keys():
raise TerminateState(f"32 bit DECREE system call number {cpu.EAX} Not Implemented")
func = syscalls[cpu.EAX]
logger.debug("SYSCALL32: %s (nargs: %d)", func.__name__, func.__code__.co_argcount)
nargs = func.__code__.co_argcount
args = [cpu, cpu.EBX, cpu.ECX, cpu.EDX, cpu.ESI, cpu.EDI, cpu.EBP]
cpu.EAX = func(*args[: nargs - 1])
def sched(self):
""" Yield CPU.
This will choose another process from the RUNNNIG list and change
current running process. May give the same cpu if only one running
process.
"""
if len(self.procs) > 1:
logger.info("SCHED:")
logger.info("\tProcess: %r", self.procs)
logger.info("\tRunning: %r", self.running)
logger.info("\tRWait: %r", self.rwait)
logger.info("\tTWait: %r", self.twait)
logger.info("\tTimers: %r", self.timers)
logger.info("\tCurrent clock: %d", self.clocks)
logger.info("\tCurrent cpu: %d", self._current)
if len(self.running) == 0:
logger.info("None running checking if there is some process waiting for a timeout")
if all([x is None for x in self.timers]):
raise Deadlock()
self.clocks = min([x for x in self.timers if x is not None]) + 1
self.check_timers()
assert len(self.running) != 0, "DEADLOCK!"
self._current = self.running[0]
return
next_index = (self.running.index(self._current) + 1) % len(self.running)
next = self.running[next_index]
if len(self.procs) > 1:
logger.info("\tTransfer control from process %d to %d", self._current, next)
self._current = next
def wait(self, readfds, writefds, timeout):
""" Wait for filedescriptors or timeout.
Adds the current process to the corresponding waiting list and
yields the cpu to another running process.
"""
logger.info("WAIT:")
logger.info(
"\tProcess %d is going to wait for [ %r %r %r ]",
self._current,
readfds,
writefds,
timeout,
)
logger.info("\tProcess: %r", self.procs)
logger.info("\tRunning: %r", self.running)
logger.info("\tRWait: %r", self.rwait)
logger.info("\tTWait: %r", self.twait)
logger.info("\tTimers: %r", self.timers)
for fd in readfds:
self.rwait[fd].add(self._current)
for fd in writefds:
self.twait[fd].add(self._current)
if timeout is not None:
self.timers[self._current] = self.clocks + timeout
else:
self.timers[self._current] = None
procid = self._current
# self.sched()
next_index = (self.running.index(procid) + 1) % len(self.running)
self._current = self.running[next_index]
logger.info("\tTransfer control from process %d to %d", procid, self._current)
logger.info("\tREMOVING %r from %r. Current: %r", procid, self.running, self._current)
self.running.remove(procid)
if self._current not in self.running:
logger.info("\tCurrent not running. Checking for timers...")
self._current = None
if all([x is None for x in self.timers]):
raise Deadlock()
self.check_timers()
def awake(self, procid):
""" Remove procid from waitlists and reestablish it in the running list """
logger.info(
"Remove procid:%d from waitlists and reestablish it in the running list", procid
)
for wait_list in self.rwait:
if procid in wait_list:
wait_list.remove(procid)
for wait_list in self.twait:
if procid in wait_list:
wait_list.remove(procid)
self.timers[procid] = None
self.running.append(procid)
if self._current is None:
self._current = procid
def connections(self, fd):
if fd in [0, 1, 2]:
return None
if fd % 2:
return fd + 1
else:
return fd - 1
def signal_receive(self, fd):
""" Awake one process waiting to receive data on fd """
connections = self.connections
if connections(fd) and self.twait[connections(fd)]:
procid = random.sample(self.twait[connections(fd)], 1)[0]
self.awake(procid)
def signal_transmit(self, fd):
""" Awake one process waiting to transmit data on fd """
connections = self.connections
if connections(fd) and self.rwait[connections(fd)]:
procid = random.sample(self.rwait[connections(fd)], 1)[0]
self.awake(procid)
def check_timers(self):
""" Awake process if timer has expired """
if self._current is None:
# Advance the clocks. Go to future!!
advance = min([x for x in self.timers if x is not None]) + 1
logger.info("Advancing the clock from %d to %d", self.clocks, advance)
self.clocks = advance
for procid in range(len(self.timers)):
if self.timers[procid] is not None:
if self.clocks > self.timers[procid]:
self.procs[procid].PC += self.procs[procid].instruction.size
self.awake(procid)
def execute(self):
"""
Execute one cpu instruction in the current thread (only one supported).
:rtype: bool
:return: C{True}
:todo: This is where we could implement a simple schedule.
"""
try:
self.current.execute()
self.clocks += 1
if self.clocks % 10000 == 0:
self.check_timers()
self.sched()
except Interruption as e:
if e.N != 0x80:
raise
try:
self.int80(self.current)
except RestartSyscall:
pass
return True
############################################################################
# Symbolic versions follows
class SDecree(Decree):
"""
A symbolic extension of a Decree Operating System .
"""
def __init__(self, constraints, programs, symbolic_random=None):
"""
Builds a symbolic extension of a Decree OS
:param constraints: a constraint set
:param cpus: CPU for this platform
:param mem: memory for this platform
"""
self.random = 0
self._constraints = constraints
super().__init__(programs)
def _mk_proc(self):
return I386Cpu(SMemory32(self.constraints))
@property
def constraints(self):
return self._constraints
@constraints.setter
def constraints(self, constraints):
self._constraints = constraints
for proc in self.procs:
proc.memory.constraints = constraints
# marshaling/pickle
def __getstate__(self):
state = super().__getstate__()
state["constraints"] = self.constraints
state["random"] = self.random
return state
def __setstate__(self, state):
self._constraints = state["constraints"]
self.random = state["random"]
super().__setstate__(state)
def sys_receive(self, cpu, fd, buf, count, rx_bytes):
"""
Symbolic version of Decree.sys_receive
"""
if issymbolic(fd):
logger.info("Ask to read from a symbolic file descriptor!!")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 0)
if issymbolic(buf):
logger.info("Ask to read to a symbolic buffer")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 1)
if issymbolic(count):
logger.info("Ask to read a symbolic number of bytes ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 2)
if issymbolic(rx_bytes):
logger.info("Ask to return size to a symbolic address ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 3)
return super().sys_receive(cpu, fd, buf, count, rx_bytes)
def sys_transmit(self, cpu, fd, buf, count, tx_bytes):
"""
Symbolic version of Decree.sys_transmit
"""
if issymbolic(fd):
logger.info("Ask to write to a symbolic file descriptor!!")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 0)
if issymbolic(buf):
logger.info("Ask to write to a symbolic buffer")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 1)
if issymbolic(count):
logger.info("Ask to write a symbolic number of bytes ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 2)
if issymbolic(tx_bytes):
logger.info("Ask to return size to a symbolic address ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 3)
return super().sys_transmit(cpu, fd, buf, count, tx_bytes)
def sys_allocate(self, cpu, length, isX, address_p):
if issymbolic(length):
logger.info("Ask to ALLOCATE a symbolic number of bytes ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 0)
if issymbolic(isX):
logger.info("Ask to ALLOCATE potentially executable or not executable memory")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 1)
if issymbolic(address_p):
logger.info("Ask to return ALLOCATE result to a symbolic reference ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 2)
return super().sys_allocate(cpu, length, isX, address_p)
def sys_deallocate(self, cpu, addr, size):
if issymbolic(addr):
logger.info("Ask to DEALLOCATE a symbolic pointer?!")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 0)
if issymbolic(size):
logger.info("Ask to DEALLOCATE a symbolic size?!")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 1)
return super().sys_deallocate(cpu, addr, size)
def sys_random(self, cpu, buf, count, rnd_bytes):
if issymbolic(buf):
logger.info("Ask to write random bytes to a symbolic buffer")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 0)
if issymbolic(count):
logger.info("Ask to read a symbolic number of random bytes ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 1)
if issymbolic(rnd_bytes):
logger.info("Ask to return rnd size to a symbolic address ")
cpu.PC = cpu.PC - cpu.instruction.size
raise SymbolicSyscallArgument(cpu, 2)
data = []
for i in range(count):
# TODO - should value be symbolic?
value = cgcrandom.stream[self.random]
data.append(value)
self.random += 1
cpu.write_bytes(buf, data)
if rnd_bytes:
cpu.write_int(rnd_bytes, len(data), 32)
logger.info("RANDOM(0x%08x, %d, 0x%08x) -> %d", buf, count, rnd_bytes, len(data))
return 0
class DecreeEmu:
RANDOM = 0
@staticmethod
def cgc_initialize_secret_page(platform):
logger.info("Skipping: cgc_initialize_secret_page()")
return 0
@staticmethod
def cgc_random(platform, buf, count, rnd_bytes):
from . import cgcrandom
if issymbolic(buf):
logger.info("Ask to write random bytes to a symbolic buffer")
raise ConcretizeArgument(platform.current, 0)
if issymbolic(count):
logger.info("Ask to read a symbolic number of random bytes ")
raise ConcretizeArgument(platform.current, 1)
if issymbolic(rnd_bytes):
logger.info("Ask to return rnd size to a symbolic address ")
raise ConcretizeArgument(platform.current, 2)
data = []
for i in range(count):
value = cgcrandom.stream[DecreeEmu.RANDOM]
data.append(value)
DecreeEmu.random += 1
cpu = platform.current
cpu.write(buf, data)
if rnd_bytes:
cpu.store(rnd_bytes, len(data), 32)
logger.info("RANDOM(0x%08x, %d, 0x%08x) -> %d", buf, count, rnd_bytes, len(data))
return 0
|
{
"pile_set_name": "Github"
}
|
[General]
Version=DrumSynth v2.0
Tuning=0.00
Stretch=100.0
Level=0
Filter=1
HighPass=1
Resonance=9
FilterEnv=0,6 238,39 3642,15 442000,100 443000,0
[Tone]
On=1
Level=88
F1=300
F2=110
Droop=42
Phase=45
Envelope=0,0 0,98 665,79 1788,19 3486,0
[Noise]
On=1
Level=149
Slope=-34
Envelope=0,0 0,98 665,79 1520,5 3486,0
FixedSeq=0
[Overtones]
On=0
Level=128
F1=200
Wave1=0
Track1=0
F2=125
Wave2=0
Track2=0
Method=0
Param=50
Envelope1=0,100 3750,30 7500,0
Envelope2=0,100 3000,30 6000,0
Filter=0
[NoiseBand]
On=0
Level=158
F=5000
dF=100
Envelope=0,0 0,98 507,43 1788,19 3486,0
[NoiseBand2]
On=0
Level=128
F=1000
dF=50
Envelope=0,100 839,35 2502,0
[Distortion]
On=1
Clipping=44
Bits=4
Rate=3
|
{
"pile_set_name": "Github"
}
|
# *************************************************************************/
# * Copyright (c) 2015 Ruslan Baratov. */
# * */
# * 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. */
# *************************************************************************/
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_231) on Sun Nov 17 02:09:48 CET 2019 -->
<title>FLASHAlgorithmImpl</title>
<meta name="date" content="2019-11-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FLASHAlgorithmImpl";
}
}
catch(err) {
}
//-->
var methods = {"i0":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FLASHAlgorithmImpl.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/deidentifier/arx/algorithm/FLASHAlgorithm.html" title="class in org.deidentifier.arx.algorithm"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/deidentifier/arx/algorithm/FLASHConfiguration.html" title="class in org.deidentifier.arx.algorithm"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/deidentifier/arx/algorithm/FLASHAlgorithmImpl.html" target="_top">Frames</a></li>
<li><a href="FLASHAlgorithmImpl.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.deidentifier.arx.algorithm</div>
<h2 title="Class FLASHAlgorithmImpl" class="title">Class FLASHAlgorithmImpl</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html" title="class in org.deidentifier.arx.algorithm">org.deidentifier.arx.algorithm.AbstractAlgorithm</a></li>
<li>
<ul class="inheritance">
<li>org.deidentifier.arx.algorithm.FLASHAlgorithmImpl</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">FLASHAlgorithmImpl</span>
extends <a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html" title="class in org.deidentifier.arx.algorithm">AbstractAlgorithm</a></pre>
<div class="block">This class implements the FLASH algorithm.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Fabian Prasser, Florian Kohlmayer</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/deidentifier/arx/algorithm/FLASHAlgorithmImpl.html#FLASHAlgorithmImpl-org.deidentifier.arx.framework.lattice.SolutionSpace-org.deidentifier.arx.framework.check.TransformationChecker-org.deidentifier.arx.algorithm.FLASHStrategy-org.deidentifier.arx.algorithm.FLASHConfiguration-">FLASHAlgorithmImpl</a></span>(<a href="../../../../org/deidentifier/arx/framework/lattice/SolutionSpace.html" title="class in org.deidentifier.arx.framework.lattice">SolutionSpace</a><java.lang.Long> solutionSpace,
<a href="../../../../org/deidentifier/arx/framework/check/TransformationChecker.html" title="class in org.deidentifier.arx.framework.check">TransformationChecker</a> checker,
<a href="../../../../org/deidentifier/arx/algorithm/FLASHStrategy.html" title="class in org.deidentifier.arx.algorithm">FLASHStrategy</a> strategy,
<a href="../../../../org/deidentifier/arx/algorithm/FLASHConfiguration.html" title="class in org.deidentifier.arx.algorithm">FLASHConfiguration</a> config)</code>
<div class="block">Creates a new instance.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/deidentifier/arx/algorithm/FLASHAlgorithmImpl.html#traverse--">traverse</a></span>()</code>
<div class="block">Implement this method in order to provide a new algorithm.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.deidentifier.arx.algorithm.AbstractAlgorithm">
<!-- -->
</a>
<h3>Methods inherited from class org.deidentifier.arx.algorithm.<a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html" title="class in org.deidentifier.arx.algorithm">AbstractAlgorithm</a></h3>
<code><a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html#getGlobalOptimum--">getGlobalOptimum</a>, <a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html#setListener-org.deidentifier.arx.ARXListener-">setListener</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="FLASHAlgorithmImpl-org.deidentifier.arx.framework.lattice.SolutionSpace-org.deidentifier.arx.framework.check.TransformationChecker-org.deidentifier.arx.algorithm.FLASHStrategy-org.deidentifier.arx.algorithm.FLASHConfiguration-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FLASHAlgorithmImpl</h4>
<pre>public FLASHAlgorithmImpl(<a href="../../../../org/deidentifier/arx/framework/lattice/SolutionSpace.html" title="class in org.deidentifier.arx.framework.lattice">SolutionSpace</a><java.lang.Long> solutionSpace,
<a href="../../../../org/deidentifier/arx/framework/check/TransformationChecker.html" title="class in org.deidentifier.arx.framework.check">TransformationChecker</a> checker,
<a href="../../../../org/deidentifier/arx/algorithm/FLASHStrategy.html" title="class in org.deidentifier.arx.algorithm">FLASHStrategy</a> strategy,
<a href="../../../../org/deidentifier/arx/algorithm/FLASHConfiguration.html" title="class in org.deidentifier.arx.algorithm">FLASHConfiguration</a> config)</pre>
<div class="block">Creates a new instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>solutionSpace</code> - </dd>
<dd><code>checker</code> - </dd>
<dd><code>strategy</code> - </dd>
<dd><code>config</code> - </dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="traverse--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>traverse</h4>
<pre>public boolean traverse()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html#traverse--">AbstractAlgorithm</a></code></span></div>
<div class="block">Implement this method in order to provide a new algorithm.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html#traverse--">traverse</a></code> in class <code><a href="../../../../org/deidentifier/arx/algorithm/AbstractAlgorithm.html" title="class in org.deidentifier.arx.algorithm">AbstractAlgorithm</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the result is optimal</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FLASHAlgorithmImpl.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/deidentifier/arx/algorithm/FLASHAlgorithm.html" title="class in org.deidentifier.arx.algorithm"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/deidentifier/arx/algorithm/FLASHConfiguration.html" title="class in org.deidentifier.arx.algorithm"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/deidentifier/arx/algorithm/FLASHAlgorithmImpl.html" target="_top">Frames</a></li>
<li><a href="FLASHAlgorithmImpl.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package identityEntries_test
import (
"testing"
. "github.com/FactomProject/factomd/common/identityEntries"
"github.com/FactomProject/factomd/common/primitives/random"
)
func TestCheckExternalIDsLength(t *testing.T) {
for i := 0; i < 1000; i++ {
l := random.RandIntBetween(0, 100)
extIDs := [][]byte{}
lens := []int{}
for j := 0; j < l; j++ {
b := random.RandByteSlice()
extIDs = append(extIDs, b)
lens = append(lens, len(b))
}
if CheckExternalIDsLength(extIDs, lens) == false {
t.Errorf("Wrong CheckExternalIDsLength response")
}
if len(lens) > 0 {
lens[0]++
if CheckExternalIDsLength(extIDs, lens) == true {
t.Errorf("Wrong CheckExternalIDsLength response")
}
lens = lens[1:]
if CheckExternalIDsLength(extIDs, lens) == true {
t.Errorf("Wrong CheckExternalIDsLength response")
}
extIDs = extIDs[1:]
if CheckExternalIDsLength(extIDs, lens) == false {
t.Errorf("Wrong CheckExternalIDsLength response")
}
}
}
extIDs := [][]byte{
{0x00, 0x00, 0x00, 0x00, 0x00}, // 5
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // 10
{0x00, 0x00, 0x00}, // 3
{0x00}, // 1
{}, // 0
}
lengths := []int{5, 10, 3, 1, 0}
lengthsBad := []int{5, 10, 3, 1, 1}
if CheckExternalIDsLength(extIDs, lengthsBad) {
t.Error("1: CheckExternalIDsLength check failed")
}
lengthsBad = []int{}
if CheckExternalIDsLength(extIDs, lengthsBad) {
t.Error("2: CheckExternalIDsLength check failed")
}
lengthsBad = []int{5, 10, 3, 1}
if CheckExternalIDsLength(extIDs, lengthsBad) {
t.Error("3: CheckExternalIDsLength check failed")
}
if !CheckExternalIDsLength(extIDs, lengths) {
t.Error("4: CheckExternalIDsLength check failed")
}
}
|
{
"pile_set_name": "Github"
}
|
#
# fontconfig/fc-lang/li.orth
#
# Copyright © 2009 Roozbeh Pournader
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of the author(s) not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. The author(s) make(s) no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# THE AUTHOR(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# Limburgan/Limburger/Limburgish (li)
#
# Sources:
# * http://www.limburgsedialecten.nl/pdf/Spellingbook-def.pdf
# * http://li.wikipedia.org/wiki/Wikipedia:Sjpellingssjpiekpagina
#
# There's also an apostrophe-like character that needs more research. U+02BB?
#
0041-005A
0061-007A
00C4
00C8
00CB
00D3
00D6
00E4
00E8
00EB
00F3
00F6
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.2.3.6-2-29
description: >
Object.defineProperty - argument 'P' is a number that converts to
a string (value is 1(following 20 zeros).1)
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.defineProperty(obj, 100000000000000000000.1, {});
return obj.hasOwnProperty("100000000000000000000");
}
runTestCase(testcase);
|
{
"pile_set_name": "Github"
}
|
//
// GHTest+JUnitXML.h
// GHUnit
//
// Created by Gabriel Handford on 6/4/10.
// Copyright 2010. All rights reserved.
//
// 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.
//
//! @cond DEV
#import "GHTest.h"
@interface GHTest(JUnitXML)
/*!
Return test results in JUnit XML format for external parsing use
(such as a Continuous Integration system like Hudson)
*/
- (NSString *)JUnitXML;
@end
//! @endcond
|
{
"pile_set_name": "Github"
}
|
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
* 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.
*/
#include "uv.h"
#include "internal.h"
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <kvm.h>
#include <paths.h>
#include <sys/user.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <vm/vm_param.h> /* VM_LOADAVG */
#include <time.h>
#include <stdlib.h>
#include <unistd.h> /* sysconf */
#include <fcntl.h>
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)
#ifndef CPUSTATES
# define CPUSTATES 5U
#endif
#ifndef CP_USER
# define CP_USER 0
# define CP_NICE 1
# define CP_SYS 2
# define CP_IDLE 3
# define CP_INTR 4
#endif
static char *process_title;
int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop);
}
void uv__platform_loop_delete(uv_loop_t* loop) {
}
uint64_t uv__hrtime(uv_clocktype_t type) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
}
#ifdef __DragonFly__
int uv_exepath(char* buffer, size_t* size) {
char abspath[PATH_MAX * 2 + 1];
ssize_t abspath_size;
if (buffer == NULL || size == NULL || *size == 0)
return -EINVAL;
abspath_size = readlink("/proc/curproc/file", abspath, sizeof(abspath));
if (abspath_size < 0)
return -errno;
assert(abspath_size > 0);
*size -= 1;
if (*size > abspath_size)
*size = abspath_size;
memcpy(buffer, abspath, *size);
buffer[*size] = '\0';
return 0;
}
#else
int uv_exepath(char* buffer, size_t* size) {
char abspath[PATH_MAX * 2 + 1];
int mib[4];
size_t abspath_size;
if (buffer == NULL || size == NULL || *size == 0)
return -EINVAL;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PATHNAME;
mib[3] = -1;
abspath_size = sizeof abspath;
if (sysctl(mib, 4, abspath, &abspath_size, NULL, 0))
return -errno;
assert(abspath_size > 0);
abspath_size -= 1;
*size -= 1;
if (*size > abspath_size)
*size = abspath_size;
memcpy(buffer, abspath, *size);
buffer[*size] = '\0';
return 0;
}
#endif
uint64_t uv_get_free_memory(void) {
int freecount;
size_t size = sizeof(freecount);
if (sysctlbyname("vm.stats.vm.v_free_count", &freecount, &size, NULL, 0))
return -errno;
return (uint64_t) freecount * sysconf(_SC_PAGESIZE);
}
uint64_t uv_get_total_memory(void) {
unsigned long info;
int which[] = {CTL_HW, HW_PHYSMEM};
size_t size = sizeof(info);
if (sysctl(which, 2, &info, &size, NULL, 0))
return -errno;
return (uint64_t) info;
}
void uv_loadavg(double avg[3]) {
struct loadavg info;
size_t size = sizeof(info);
int which[] = {CTL_VM, VM_LOADAVG};
if (sysctl(which, 2, &info, &size, NULL, 0) < 0) return;
avg[0] = (double) info.ldavg[0] / info.fscale;
avg[1] = (double) info.ldavg[1] / info.fscale;
avg[2] = (double) info.ldavg[2] / info.fscale;
}
char** uv_setup_args(int argc, char** argv) {
process_title = argc ? uv__strdup(argv[0]) : NULL;
return argv;
}
int uv_set_process_title(const char* title) {
int oid[4];
uv__free(process_title);
process_title = uv__strdup(title);
oid[0] = CTL_KERN;
oid[1] = KERN_PROC;
oid[2] = KERN_PROC_ARGS;
oid[3] = getpid();
sysctl(oid,
ARRAY_SIZE(oid),
NULL,
NULL,
process_title,
strlen(process_title) + 1);
return 0;
}
int uv_get_process_title(char* buffer, size_t size) {
if (process_title) {
strncpy(buffer, process_title, size);
} else {
if (size > 0) {
buffer[0] = '\0';
}
}
return 0;
}
int uv_resident_set_memory(size_t* rss) {
kvm_t *kd = NULL;
struct kinfo_proc *kinfo = NULL;
pid_t pid;
int nprocs;
size_t page_size = getpagesize();
pid = getpid();
kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");
if (kd == NULL) goto error;
kinfo = kvm_getprocs(kd, KERN_PROC_PID, pid, &nprocs);
if (kinfo == NULL) goto error;
#ifdef __DragonFly__
*rss = kinfo->kp_vm_rssize * page_size;
#else
*rss = kinfo->ki_rssize * page_size;
#endif
kvm_close(kd);
return 0;
error:
if (kd) kvm_close(kd);
return -EPERM;
}
int uv_uptime(double* uptime) {
int r;
struct timespec sp;
r = clock_gettime(CLOCK_MONOTONIC, &sp);
if (r)
return -errno;
*uptime = sp.tv_sec;
return 0;
}
int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
multiplier = ((uint64_t)1000L / ticks), cpuspeed, maxcpus,
cur = 0;
uv_cpu_info_t* cpu_info;
const char* maxcpus_key;
const char* cptimes_key;
char model[512];
long* cp_times;
int numcpus;
size_t size;
int i;
#if defined(__DragonFly__)
/* This is not quite correct but DragonFlyBSD doesn't seem to have anything
* comparable to kern.smp.maxcpus or kern.cp_times (kern.cp_time is a total,
* not per CPU). At least this stops uv_cpu_info() from failing completely.
*/
maxcpus_key = "hw.ncpu";
cptimes_key = "kern.cp_time";
#else
maxcpus_key = "kern.smp.maxcpus";
cptimes_key = "kern.cp_times";
#endif
size = sizeof(model);
if (sysctlbyname("hw.model", &model, &size, NULL, 0))
return -errno;
size = sizeof(numcpus);
if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0))
return -errno;
*cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
if (!(*cpu_infos))
return -ENOMEM;
*count = numcpus;
size = sizeof(cpuspeed);
if (sysctlbyname("hw.clockrate", &cpuspeed, &size, NULL, 0)) {
uv__free(*cpu_infos);
return -errno;
}
/* kern.cp_times on FreeBSD i386 gives an array up to maxcpus instead of
* ncpu.
*/
size = sizeof(maxcpus);
if (sysctlbyname(maxcpus_key, &maxcpus, &size, NULL, 0)) {
uv__free(*cpu_infos);
return -errno;
}
size = maxcpus * CPUSTATES * sizeof(long);
cp_times = uv__malloc(size);
if (cp_times == NULL) {
uv__free(*cpu_infos);
return -ENOMEM;
}
if (sysctlbyname(cptimes_key, cp_times, &size, NULL, 0)) {
uv__free(cp_times);
uv__free(*cpu_infos);
return -errno;
}
for (i = 0; i < numcpus; i++) {
cpu_info = &(*cpu_infos)[i];
cpu_info->cpu_times.user = (uint64_t)(cp_times[CP_USER+cur]) * multiplier;
cpu_info->cpu_times.nice = (uint64_t)(cp_times[CP_NICE+cur]) * multiplier;
cpu_info->cpu_times.sys = (uint64_t)(cp_times[CP_SYS+cur]) * multiplier;
cpu_info->cpu_times.idle = (uint64_t)(cp_times[CP_IDLE+cur]) * multiplier;
cpu_info->cpu_times.irq = (uint64_t)(cp_times[CP_INTR+cur]) * multiplier;
cpu_info->model = uv__strdup(model);
cpu_info->speed = cpuspeed;
cur+=CPUSTATES;
}
uv__free(cp_times);
return 0;
}
void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
int i;
for (i = 0; i < count; i++) {
uv__free(cpu_infos[i].model);
}
uv__free(cpu_infos);
}
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
struct ifaddrs *addrs, *ent;
uv_interface_address_t* address;
int i;
struct sockaddr_dl *sa_addr;
if (getifaddrs(&addrs))
return -errno;
*count = 0;
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
(ent->ifa_addr == NULL) ||
(ent->ifa_addr->sa_family == AF_LINK)) {
continue;
}
(*count)++;
}
*addresses = uv__malloc(*count * sizeof(**addresses));
if (!(*addresses)) {
freeifaddrs(addrs);
return -ENOMEM;
}
address = *addresses;
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
continue;
if (ent->ifa_addr == NULL)
continue;
/*
* On FreeBSD getifaddrs returns information related to the raw underlying
* devices. We're not interested in this information yet.
*/
if (ent->ifa_addr->sa_family == AF_LINK)
continue;
address->name = uv__strdup(ent->ifa_name);
if (ent->ifa_addr->sa_family == AF_INET6) {
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
} else {
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
}
if (ent->ifa_netmask->sa_family == AF_INET6) {
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
} else {
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
}
address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);
address++;
}
/* Fill in physical addresses for each interface */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
(ent->ifa_addr == NULL) ||
(ent->ifa_addr->sa_family != AF_LINK)) {
continue;
}
address = *addresses;
for (i = 0; i < (*count); i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
}
address++;
}
}
freeifaddrs(addrs);
return 0;
}
void uv_free_interface_addresses(uv_interface_address_t* addresses,
int count) {
int i;
for (i = 0; i < count; i++) {
uv__free(addresses[i].name);
}
uv__free(addresses);
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.