text:
The documentation is designed for a specific purpose to help you to apply the features on your side. ByteScout PDF Suite is the bundle that provides six different SDK libraries to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript and you can use it to create listbox in pdf form with pdf sdk with VB.NET.

 These VB.NET code samples for VB.NET guide developers to speed up coding of the application when using ByteScout PDF Suite. IF you want to implement the functionality, just copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. Check VB.NET sample code samples to see if they respond to your needs and requirements for the project.

The trial version of ByteScout PDF Suite can be downloaded for free from our website. It also includes source code samples for VB.NET and other programming languages.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20PDF%20Suite%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20PDF%20Suite%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=NEwNs2b9YN8](https://www.youtube.com/watch?v=NEwNs2b9YN8)

<!-- code block begin -->

##### ****ListBoxes.VS2005.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project 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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <ProductVersion>8.0.50727</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****ListBoxes.VS2008.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" 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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <ProductVersion>9.0.30729</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****ListBoxes.VS2010.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****ListBoxes.VS2012.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****ListBoxes.VS2013.vbproj:**

```
<?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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****ListBoxes.VS2015.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.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>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>ListBoxes</RootNamespace>
    <AssemblyName>ListBoxes</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
```

<!-- code block end -->

<!-- code block begin -->

##### ****Program.vb:**

```
Imports Bytescout.PDF

''' <summary>
''' This example demonstrates how to create a listbox.
''' </summary>
Class Program

    Shared Sub Main()

        ' Create new document
        Dim pdfDocument = New Document()
        pdfDocument.RegistrationName = "demo"
		pdfDocument.RegistrationKey = "demo"
        ' Add page
        Dim page = New Page(PaperFormat.A4)
        pdfDocument.Pages.Add(page)

        ' Add list box, add items and make it multi-selectable
        Dim listBox1 = New ListBox(20, 20, 120, 80, "listBox1")
        listBox1.Items.Add("Value 1")
        listBox1.Items.Add("Value 2")
        listBox1.Items.Add("Value 3")
        listBox1.Items.Add("Value 4")
        listBox1.Items.Add("Value 5")
        listBox1.MultiSelect = True
        ' Decorate listbox
        listBox1.Font = New Font(StandardFonts.Helvetica, 10)
        listBox1.FontColor = New ColorRGB(0, 0, 128)
        listBox1.BorderColor = New ColorRGB(0, 0, 128)
        listBox1.BackgroundColor = New ColorRGB(240, 240, 255)
        listBox1.BorderWidth = 2

        page.Annotations.Add(listBox1)

        ' Save document to file
        pdfDocument.Save("result.pdf")

        ' Cleanup
		pdfDocument.Dispose()

        ' Open document in default PDF viewer app
        Process.Start("result.pdf")

    End Sub

End Class

```

<!-- code block end -->


text:
package org.jasig.portal.api.portlet;

import javax.portlet.PortletMode;
import javax.portlet.WindowState;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * Set state and mode for the delegate portlet
 *
 * @author Eric Dalquist
 * @version $Revision$
 */
public class DelegateState {
    private final PortletMode portletMode;
    private final WindowState windowState;

    /**
     * @param portletMode Mode for the delegate portlet, if null the current or default mode is used
     * @param windowState State for the delegate portlet, if null the current or default state is used
     */
    public DelegateState(PortletMode portletMode, WindowState windowState) {
        this.portletMode = portletMode;
        this.windowState = windowState;
    }

    public PortletMode getPortletMode() {
        return portletMode;
    }

    public WindowState getWindowState() {
        return windowState;
    }

    /**
     * @see java.lang.Object#equals(Object)
     */
    @Override
    public boolean equals(Object object) {
        if (object == this) {
            return true;
        }
        if (!(object instanceof DelegateState)) {
            return false;
        }
        DelegateState rhs = (DelegateState) object;
        return new EqualsBuilder()
            .append(this.windowState, rhs.getWindowState())
            .append(this.portletMode, rhs.getPortletMode())
            .isEquals();
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return new HashCodeBuilder(1445247369, -1009176817)
            .append(this.windowState)
            .append(this.portletMode)
            .toHashCode();
    }

    /**
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
            .append("windowState", this.windowState)
            .append("portletMode", this.portletMode)
            .toString();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.compomics.thermo_msf_parser_API.lowmeminstance.controllers.version_1_2;

import com.compomics.thermo_msf_parser_API.lowmeminstance.controllers.PeptideLowMemController;
import com.compomics.thermo_msf_parser_API.lowmeminstance.model.MsfFile;
import com.compomics.thermo_msf_parser_API.lowmeminstance.model.PeptideLowMem;
import com.compomics.thermo_msf_parser_API.lowmeminstance.model.ProteinLowMem;
import java.io.File;
import java.net.URISyntaxException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

/**
 *
 * @author Davy
 */
public class PeptideLowMemControllerTest {

    static MsfFile msfFile;
    ProteinLowMem proteinWithOnlyOnePeptideConfidenceLevel1;
    ProteinLowMem proteinWithOnlyPeptidesConfidenceLevel1;
    ProteinLowMem proteinWithOnlyPeptidesConfidenceLevel3;
    ProteinLowMem proteinWithPeptidesMultipleConfidenceLevels;

    public PeptideLowMemControllerTest() {
    }

    @BeforeClass
    public static void setUpClass() throws ClassNotFoundException, SQLException, URISyntaxException {
        msfFile = new MsfFile(new File(PeptideLowMemControllerTest.class.getClassLoader().getResource("test-msf-v-1.2.msf").getPath()));
    }

    @Before
    public void setUp() {
        proteinWithOnlyOnePeptideConfidenceLevel1 = new ProteinLowMem("P50528", 16237);
        proteinWithOnlyPeptidesConfidenceLevel1 = new ProteinLowMem("P87313", 16240);
        proteinWithOnlyPeptidesConfidenceLevel3 = new ProteinLowMem("Q09811", 16233);
        proteinWithPeptidesMultipleConfidenceLevels = new ProteinLowMem("O14108", 16234);
    }

    /**
     * Test of getPeptidesForProtein method, of class PeptideLowMemController.
     */
    @Test
    public void testGetPeptidesForProtein() {
        System.out.println("getPeptidesForProtein");
        PeptideLowMemController instance = new PeptideLowMemController();
        List<PeptideLowMem> result = instance.getPeptidesForProtein(proteinWithOnlyOnePeptideConfidenceLevel1, msfFile);
        assertThat(result.size(), is(1));
        assertThat(result.get(0).getSequence(), is("IIVLDK"));
        assertThat(result.get(0).getPeptideId(), is(9));
        result = instance.getPeptidesForProtein(proteinWithOnlyPeptidesConfidenceLevel1, msfFile);
        assertThat(result.size(), is(15));
        assertThat(result.get(0).getSequence(), is("VDRGAIK"));
        assertThat(result.get(0).getPeptideId(), is(23));
        assertThat(result.get(4).getSequence(), is("VDRGAIK"));
        assertThat(result.get(4).getPeptideId(), is(41));
        result = instance.getPeptidesForProtein(proteinWithOnlyPeptidesConfidenceLevel3, msfFile);
        assertThat(result.size(), is(2));
        assertThat(result.get(0).getSequence(), is("IILDVK"));
        assertThat(result.get(0).getPeptideId(), is(5));
        assertThat(result.get(1).getSequence(), is("IILDVK"));
        assertThat(result.get(1).getPeptideId(), is(74));
        result = instance.getPeptidesForProtein(proteinWithPeptidesMultipleConfidenceLevels, msfFile);
        assertThat(result.size(), is(3));
        assertThat(result.get(0).getSequence(), is("LLDLVK"));
        assertThat(result.get(0).getPeptideId(), is(6));
        assertThat(result.get(2).getSequence(), is("VESTNSFNAK"));
        assertThat(result.get(2).getPeptideId(), is(242));
    }

    /**
     * Test of getPeptidesForAccession method, of class PeptideLowMemController.
     */
    @Test
    public void testGetPeptidesForAccession() {
        System.out.println("getPeptidesForAccession");
        PeptideLowMemController instance = new PeptideLowMemController();
        List<PeptideLowMem> result = instance.getPeptidesForAccession(proteinWithOnlyOnePeptideConfidenceLevel1.getAccession(), msfFile);
        assertThat(result.size(), is(1));
        assertThat(result.get(0).getSequence(), is("IIVLDK"));
        assertThat(result.get(0).getPeptideId(), is(9));
        result = instance.getPeptidesForAccession(proteinWithOnlyPeptidesConfidenceLevel1.getAccession(), msfFile);
        assertThat(result.size(), is(15));
        assertThat(result.get(0).getSequence(), is("VDRGAIK"));
        assertThat(result.get(0).getPeptideId(), is(23));
        assertThat(result.get(4).getSequence(), is("VDRGAIK"));
        assertThat(result.get(4).getPeptideId(), is(41));
        result = instance.getPeptidesForAccession(proteinWithOnlyPeptidesConfidenceLevel3.getAccession(), msfFile);
        assertThat(result.size(), is(2));
        assertThat(result.get(0).getSequence(), is("IILDVK"));
        assertThat(result.get(0).getPeptideId(), is(5));
        assertThat(result.get(1).getSequence(), is("IILDVK"));
        assertThat(result.get(1).getPeptideId(), is(74));
        result = instance.getPeptidesForAccession(proteinWithPeptidesMultipleConfidenceLevels.getAccession(), msfFile);
        assertThat(result.size(), is(3));
        assertThat(result.get(0).getSequence(), is("LLDLVK"));
        assertThat(result.get(0).getPeptideId(), is(6));
        assertThat(result.get(2).getSequence(), is("VESTNSFNAK"));
        assertThat(result.get(2).getPeptideId(), is(242));

    }

    /**
     * Test of getInformationForPeptide method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetInformationForPeptide() {
        System.out.println("getInformationForPeptide");
        int peptideID = 0;
        boolean fullInfo = false;
        PeptideLowMemController instance = new PeptideLowMemController();
        List expResult = new ArrayList();
        List result = instance.getInformationForPeptide(peptideID, msfFile, fullInfo);
        assertEquals(expResult, result);
    }

    /**
     * Test of getPeptidesWithConfidenceLevel method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetPeptidesWithConfidenceLevel() {
        System.out.println("getPeptidesWithConfidenceLevel");
        int confidenceLevel = 1;
        PeptideLowMemController instance = new PeptideLowMemController();
        List<PeptideLowMem> result = instance.getPeptidesWithConfidenceLevel(confidenceLevel, msfFile);
        assertThat(result.size(), is(271));
        assertThat(result.get(0).getSequence(), is("IIVLDK"));
        assertThat(result.get(55).getSequence(), is("LEINNDKK"));

        confidenceLevel = 2;
        result = instance.getPeptidesWithConfidenceLevel(confidenceLevel, msfFile);
        assertThat(result.size(), is(0));

        confidenceLevel = 3;
        result = instance.getPeptidesWithConfidenceLevel(confidenceLevel, msfFile);
        assertThat(result.size(), is(9));
        assertThat(result.get(0).getSequence(), is("IILDVK"));
        assertThat(result.get(8).getSequence(), is("SCQIQLLIDSATK"));
    }

    /**
     * Test of getNumberOfPeptidesForConfidenceLevel method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetNumberOfPeptidesForConfidenceLevel() {
        System.out.println("getNumberOfPeptidesForConfidenceLevel");
        int confidenceLevel = 1;
        PeptideLowMemController instance = new PeptideLowMemController();
        int expResult = 271;
        int result = instance.getNumberOfPeptidesForConfidenceLevel(confidenceLevel, msfFile);
        assertEquals(expResult, result);

        expResult = 0;
        confidenceLevel = 2;
        result = instance.getNumberOfPeptidesForConfidenceLevel(confidenceLevel, msfFile);
        assertEquals(expResult, result);

        expResult = 9;
        confidenceLevel = 3;
        result = instance.getNumberOfPeptidesForConfidenceLevel(confidenceLevel, msfFile);
        assertEquals(expResult, result);

    }

    /**
     * Test of getNumberOfPeptidesProcessed method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetNumberOfPeptidesProcessed() {
        System.out.println("getNumberOfPeptidesProcessed");
        PeptideLowMemController instance = new PeptideLowMemController();
        Integer expResult = 0;
        Integer result = instance.getNumberOfPeptidesProcessed();
        assertEquals(expResult, result);
        expResult = 9;
        assertThat(expResult, allOf(is(instance.getNumberOfPeptidesForConfidenceLevel(3, msfFile)), is(instance.getNumberOfPeptidesProcessed())));
        assertThat(instance.getNumberOfPeptidesForConfidenceLevel(1, msfFile), allOf(is(271), is(instance.getNumberOfPeptidesProcessed())));
        assertThat(expResult, is(not(instance.getNumberOfPeptidesProcessed())));
    }

    /**
     * Test of addPeptidesToProteinsInList method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetPeptidesForProteinList_3args() {
        System.out.println("getPeptidesForProteinListAndConfidenceLevel");
        List<ProteinLowMem> proteinLowMemList = new ArrayList<ProteinLowMem>() {
            {
                this.add(proteinWithOnlyOnePeptideConfidenceLevel1);
                this.add(proteinWithOnlyPeptidesConfidenceLevel1);
                this.add(proteinWithOnlyPeptidesConfidenceLevel3);
                this.add(proteinWithPeptidesMultipleConfidenceLevels);
            }
        };
        int confidenceLevel = 0;
        PeptideLowMemController instance = new PeptideLowMemController();
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile, confidenceLevel);
        assertThat(0, allOf(is(proteinLowMemList.get(0).getPeptidesForProtein().size()), is(proteinLowMemList.get(1).getPeptidesForProtein().size()), is(proteinLowMemList.get(2).getPeptidesForProtein().size()), is(proteinLowMemList.get(3).getPeptidesForProtein().size())));
        confidenceLevel = 1;
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile, confidenceLevel);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        assertThat(proteinLowMemList.get(1).getPeptidesForProtein().size(), is(15));
        assertThat(proteinLowMemList.get(2).getPeptidesForProtein().size(), is(0));
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(1));
        confidenceLevel = 2;
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile, confidenceLevel);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        assertThat(proteinLowMemList.get(1).getPeptidesForProtein().size(), is(15));
        assertThat(proteinLowMemList.get(2).getPeptidesForProtein().size(), is(0));
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(1));
        confidenceLevel = 3;
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile, confidenceLevel);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        assertThat(proteinLowMemList.get(1).getPeptidesForProtein().size(), is(15));
        assertThat(proteinLowMemList.get(2).getPeptidesForProtein().size(), is(2));
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(3));
    }

    /**
     * Test of addPeptidesToProteinsInList method, of class
     * PeptideLowMemController.
     */
    @Test
    public void testGetPeptidesForProteinList_List_MsfFile() {
        System.out.println("getPeptidesForProteinList");
        List<ProteinLowMem> proteinLowMemList = new ArrayList<ProteinLowMem>() {
            {
                this.add(proteinWithOnlyOnePeptideConfidenceLevel1);
            }
        };
        PeptideLowMemController instance = new PeptideLowMemController();
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,1);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,3);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(),is(1));
        proteinLowMemList.add(proteinWithOnlyPeptidesConfidenceLevel1);
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,1);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        assertThat(proteinLowMemList.get(1).getPeptidesForProtein().size(), is(15));

        proteinLowMemList.add(proteinWithOnlyPeptidesConfidenceLevel3);
        proteinLowMemList.add(proteinWithPeptidesMultipleConfidenceLevels);
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,3);
        assertThat(proteinLowMemList.get(0).getPeptidesForProtein().size(), is(1));
        assertThat(proteinLowMemList.get(1).getPeptidesForProtein().size(), is(15));
        assertThat(proteinLowMemList.get(2).getPeptidesForProtein().size(), is(2));
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(2));
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,1);
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(3));
        instance.getPeptidesForProteinList(proteinLowMemList, msfFile,1);
        assertThat(proteinLowMemList.get(3).getPeptidesForProtein().size(), is(3));
    }

    /**
     * Test of returnNumberOfPeptides method, of class PeptideLowMemController.
     */
    @Test
    public void testReturnNumberOfPeptides() {
        System.out.println("returnNumberOfPeptides");
        PeptideLowMemController instance = new PeptideLowMemController();
        int expResult = 280;
        int result = instance.returnNumberOfPeptides(msfFile);
        assertEquals(expResult, result);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BuildFeed.Models.ViewModel
{
    public class StatsPage
    {
        public IEnumerable<MonthCount> AdditionsByMonth { get; set; }
        public IEnumerable<MonthCount> CompilesByMonth { get; set; }
        public IEnumerable<Tuple<string, int>> BuildsByLab { get; set; }
    }

    public struct MonthCount
    {
        public int Year { get; set; }
        public int Month { get; set; }
        public double Count { get; set; }
    }
}


text:
* Author: samdeg555
* Version: Version 1.0
* Target: Windows

## Description

Dumps saved Wi-Fi infos including clear text passwords to the bash bunny
Saves to the loot folder on the Bash Bunny USB Mass Storage partition in WiPassDump folder.

## Configuration

None needed.

## STATUS

| LED                | Status                                       |
| ------------------ | -------------------------------------------- |
| Red (blinking)     | Setting up                                   |
| Blue (blinking)    | Attack running                               |
| Purple (blinking)  | Almost done (cleaning up)                    |
| Green              | Attack Complete                              |

## Discussion
None yet.


text:
x$(window).load(function(e){
	x$('#header__icon').on('click', function (e) {
			e.preventDefault();
            x$('.site-pusher').toggleClass('menuaa');
            x$('#site-cache').toggleClass('site-cache');
      });
		x$('#site-cache').click(function(e){
		console.log('entre');
        x$('.site-pusher').toggleClass('menuaa');
        x$('#site-cache').toggleClass('site-cache');

	});

});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    >

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/white"
        android:textSize="20sp"
        />

    <TextView
        android:id="@+id/tv_sub_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/tv_title"
        android:textColor="@color/white"
        android:layout_alignBottom="@+id/tv_title"
        />

</RelativeLayout>


text:
use rand::Rng;
use std::sync::Mutex;
use std::sync::MutexGuard;
use std::collections::HashMap;
use std::ops::Deref;
use std::ops::DerefMut;

use error::prelude::*;

pub struct ObjectCache<T>{
    pub store: Mutex<HashMap<u32, Mutex<T>>>,
}

impl<T> Default for ObjectCache<T> {
    fn default() -> ObjectCache<T>
    {
        ObjectCache {
            store: Default::default()
        }
    }
}

impl<T> ObjectCache<T> {

    fn _lock_store(&self) -> VcxResult<MutexGuard<HashMap<u32, Mutex<T>>>> {
        match self.store.lock() {
            Ok(g) => Ok(g),
            Err(e) => {
                error!("Unable to lock Object Store: {:?}", e);
                Err(VcxError::from_msg(VcxErrorKind::Common(10), format!("Unable to lock Object Store: {:?}", e)))
            }
        }
    }

    pub fn has_handle(&self, handle: u32) -> bool {
        let store = match self._lock_store() {
            Ok(g) => g,
            Err(_) => return false
        };
        store.contains_key(&handle)
    }

    pub fn get<F,R>(&self, handle:u32, closure: F) -> VcxResult<R>
        where F: Fn(&T) -> VcxResult<R> {

        let store = self._lock_store()?;
        match store.get(&handle) {
            Some(m) => match m.lock() {
                Ok(obj) => closure(obj.deref()),
                Err(err) => return Err(VcxError::from_msg(VcxErrorKind::Common(10), "Unable to lock Object Store")) //TODO better error
            },
            None => return Err(VcxError::from_msg(VcxErrorKind::InvalidHandle, format!("Object not found for handle: {}", handle)))
        }
    }

    pub fn get_mut<F, R>(&self, handle:u32, closure: F) -> VcxResult<R>
        where F: Fn(&mut T) -> VcxResult<R> {

        let mut store = self._lock_store()?;
        match store.get_mut(&handle) {
            Some(m) => match m.lock() {
                Ok(mut obj) => closure(obj.deref_mut()),
                Err(err) => return Err(VcxError::from_msg(VcxErrorKind::Common(10), "Unable to lock Object Store")) //TODO better error
            },
            None => return Err(VcxError::from_msg(VcxErrorKind::InvalidHandle, format!("Object not found for handle: {}", handle)))
        }
    }

    pub fn add(&self, obj:T) -> VcxResult<u32> {
        let mut store = self._lock_store()?;

        let mut new_handle = rand::thread_rng().gen::<u32>();
        loop {
            if !store.contains_key(&new_handle){
                break;
            }
            new_handle = rand::thread_rng().gen::<u32>();
        }

        match store.insert(new_handle, Mutex::new(obj)){
            Some(_) => Ok(new_handle),
            None => Ok(new_handle)
        }
    }

    pub fn release(&self, handle:u32) -> VcxResult<()> {
        let mut store = self._lock_store()?;
        match store.remove(&handle) {
            Some(_) => Ok(()),
            None => return Err(VcxError::from_msg(VcxErrorKind::InvalidHandle, format!("Object not found for handle: {}", handle)))
        }
    }

    pub fn drain(&self) -> VcxResult<()> {
        let mut store = self._lock_store()?;
        Ok(store.clear())
    }
}

#[cfg(test)]
mod tests{
    use object_cache::ObjectCache;

    #[test]
    fn create_test(){
        let c:ObjectCache<u32> = Default::default();
    }

    #[test]
    fn get_closure(){
        let test:ObjectCache<u32> = Default::default();
        let handle = test.add(2222).unwrap();
        let rtn = test.get(handle, |obj| Ok(obj.clone()));
        assert_eq!(2222, rtn.unwrap())
    }

    #[test]
    fn to_string_test() {
        let test:ObjectCache<u32> = Default::default();
        let handle = test.add(2222).unwrap();
        let string: String = test.get(handle, |obj|{
           Ok(String::from("TEST"))
        }).unwrap();

        assert_eq!("TEST", string);

    }

    fn mut_object_test(){
        let test:ObjectCache<String> = Default::default();
        let handle = test.add(String::from("TEST")).unwrap();

        test.get_mut(handle, |obj|{
            obj.to_lowercase();
            Ok(())
        }).unwrap();

        let string: String = test.get(handle, |obj|{
            Ok(obj.clone())
        }).unwrap();

        assert_eq!("test", string);
    }

}


text:
package org.pentaho.di.core.row;

import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

import junit.framework.TestCase;

import org.pentaho.di.core.row.value.ValueMetaString;

/**
 * Test functionality in ValueMeta
 *
 * @author sboden
 */
public class ValueMetaTest extends TestCase {
  /**
   * Compare to byte arrays for equality.
   *
   * @param b1 1st byte array
   * @param b2 2nd byte array
   * @return true if equal
   */
  private boolean byteCompare( byte[] b1, byte[] b2 ) {
    if ( b1.length != b2.length ) {
      return false;
    }

    int idx = 0;
    while ( idx < b1.length ) {
      if ( b1[idx] != b2[idx] ) {
        return false;
      }
      idx++;
    }
    return true;
  }

  public void testCvtStringToBinaryString() throws Exception {
    ValueMeta val1 = new ValueMeta( "STR1", ValueMetaInterface.TYPE_STRING );
    val1.setLength( 6 );
    val1.setStringEncoding( "UTF8" );

    // No truncating or padding!!!
    byte[] b1 = val1.getBinary( "PDI123" );
    assertTrue( byteCompare( b1, new byte[]{ 'P', 'D', 'I', '1', '2', '3' } ) );

    byte[] b2 = val1.getBinary( "PDI" );
    assertTrue( byteCompare( b2, new byte[]{ 'P', 'D', 'I' } ) );

    byte[] b3 = val1.getBinary( "PDI123456" );
    assertTrue( byteCompare( b3, new byte[]{ 'P', 'D', 'I', '1', '2', '3', '4', '5', '6' } ) );

    ValueMeta val2 = new ValueMeta( "STR2", ValueMetaInterface.TYPE_STRING );
    val2.setLength( 1 );

    byte[] b4 = val2.getBinary( "PDI123" );
    assertTrue( byteCompare( b4, new byte[]{ 'P', 'D', 'I', '1', '2', '3' } ) );

    byte[] b5 = val2.getBinary( "PDI" );
    assertTrue( byteCompare( b5, new byte[]{ 'P', 'D', 'I' } ) );

    byte[] b6 = val2.getBinary( "PDI123456" );
    assertTrue( byteCompare( b6, new byte[]{ 'P', 'D', 'I', '1', '2', '3', '4', '5', '6' } ) );
  }

  public void testCvtStringBinaryString() throws Exception {
    ValueMeta val1 = new ValueMeta( "STR1", ValueMetaInterface.TYPE_STRING );
    val1.setLength( 6 );
    val1.setStringEncoding( "UTF8" );

    ValueMeta val2 =
        new ValueMeta( "BINSTR1", ValueMetaInterface.TYPE_STRING, ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
    val2.setStorageMetadata( val1 );
    val2.setLength( 6 );
    val2.setStringEncoding( "UTF8" );

    String str1 = val2.getString( val1.getBinary( "PDI123" ) );
    assertTrue( "PDI123".equals( str1 ) );

    String str2 = val2.getString( val1.getBinary( "PDI" ) );
    assertTrue( "PDI".equals( str2 ) );

    String str3 = val2.getString( val1.getBinary( "PDI123456" ) );
    assertTrue( "PDI123456".equals( str3 ) );
  }

  public void testIntegerToStringToInteger() throws Exception {
    ValueMetaInterface intValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_INTEGER );
    intValueMeta.setConversionMask( null );
    intValueMeta.setLength( 7 );

    Long originalValue = new Long( 123L );

    String string = intValueMeta.getString( originalValue );

    assertEquals( " 0000123", string );

    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMetadata( intValueMeta );

    Long x = (Long) strValueMeta.convertDataUsingConversionMetaData( string );

    assertEquals( originalValue, x );
  }

  public void testNumberToStringToNumber() throws Exception {
    ValueMetaInterface numValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_NUMBER );
    numValueMeta.setConversionMask( null );
    numValueMeta.setLength( 7, 3 );
    numValueMeta.setDecimalSymbol( "," );
    numValueMeta.setGroupingSymbol( "." );

    Double originalValue = new Double( 123.456 );

    String string = numValueMeta.getString( originalValue );

    assertEquals( " 0123,456", string );

    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMetadata( numValueMeta );

    Double x = (Double) strValueMeta.convertDataUsingConversionMetaData( string );

    assertEquals( originalValue, x );
  }

  public void testBigNumberToStringToBigNumber() throws Exception {
    ValueMetaInterface numValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_BIGNUMBER );
    numValueMeta.setLength( 42, 9 );
    numValueMeta.setDecimalSymbol( "." );
    numValueMeta.setGroupingSymbol( "," );

    BigDecimal originalValue = new BigDecimal( "34039423484343123.443489056" );

    String string = numValueMeta.getString( originalValue );

    assertEquals( "34039423484343123.443489056", string );

    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMetadata( numValueMeta );

    BigDecimal x = (BigDecimal) strValueMeta.convertDataUsingConversionMetaData( string );

    assertEquals( originalValue, x );
  }

  public void testDateToStringToDate() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "CET" ) );

    ValueMetaInterface datValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_DATE );
    datValueMeta.setConversionMask( "yyyy - MM - dd   HH:mm:ss'('SSS')' z" );
    Date originalValue = new Date( 7258114799999L );

    String string = datValueMeta.getString( originalValue );

    assertEquals( "2199 - 12 - 31   23:59:59(999) CET", string );

    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMetadata( datValueMeta );

    Date x = (Date) strValueMeta.convertDataUsingConversionMetaData( string );

    assertEquals( originalValue, x );
  }

  public void testDateStringDL8601() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "America/New_York" ) );

    ValueMetaInterface datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000'XXX" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02:34:54.000Z" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }

    datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000'XXX" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02:34:54.000+01:00" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }

    datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH-mm-ss'.000'XXX" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02-34-54.000-01:00" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }
  }

  public void testDateStringUTC() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "America/New_York" ) );

    ValueMetaInterface datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000'Z" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02:34:54.000UTC" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }
  }

  public void testDateStringOffset() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "America/New_York" ) );

    ValueMetaInterface datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000'Z" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02:34:54.000-0100" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }
    datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000'Z" );
    try {
      Date res = datValueMeta.getDate( "2008-03-09T02:34:54.000+0100" );
      // make sure it's what we expect...
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 8", 8, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2008", 2008, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }
  }

  public void testDateString8601() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "Europe/Kaliningrad" ) );

    ValueMetaInterface datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000Z'" );
    try {
      Date res = datValueMeta.getDate( "2011-03-13T02:23:18.000Z" );
      Calendar c = Calendar.getInstance();
      c.setTime( res );
      assertEquals( "Month should be 2", 2, c.get( Calendar.MONTH ) );
      assertEquals( "Day should be 13", 13, c.get( Calendar.DAY_OF_MONTH ) );
      assertEquals( "Year should be 2011", 2011, c.get( Calendar.YEAR ) );
    } catch ( Exception ex ) {
      fail( "Error converting date." + ex.getMessage() );
    }

    TimeZone.setDefault( TimeZone.getTimeZone( "America/New_York" ) );
    datValueMeta = new ValueMetaString();
    datValueMeta.setConversionMask( "yyyy-MM-dd'T'HH:mm:ss'.000Z'" );
    try {
      datValueMeta.getDate( "2011-03-13T02:23:18.000Z" );
      fail( "Expected exception when trying to convert date" );
    } catch ( Exception ex ) {
    }
  }

  public void testConvertDataDate() throws Exception {
    TimeZone.setDefault( TimeZone.getTimeZone( "CET" ) );

    ValueMetaInterface source = new ValueMeta( "src", ValueMetaInterface.TYPE_STRING );
    source.setConversionMask( "SSS.ss:mm:HH dd/MM/yyyy z" );
    ValueMetaInterface target = new ValueMeta( "tgt", ValueMetaInterface.TYPE_DATE );

    Date date = (Date) target.convertData( source, "999.59:59:23 31/12/2007 CET" );
    assertEquals( new Date( 1199141999999L ), date );

    target.setConversionMask( "yy/MM/dd HH:mm" );

    String string = (String) source.convertData( target, date );
    assertEquals( "07/12/31 23:59", string );

  }

  public void testConvertDataInteger() throws Exception {
    ValueMetaInterface source = new ValueMeta( "src", ValueMetaInterface.TYPE_STRING );
    source.setConversionMask( " #,##0" );
    source.setLength( 12, 3 );
    source.setDecimalSymbol( "," );
    source.setGroupingSymbol( "." );
    ValueMetaInterface target = new ValueMeta( "tgt", ValueMetaInterface.TYPE_INTEGER );

    Long d = (Long) target.convertData( source, " 2.837" );
    assertEquals( 2837L, d.longValue() );

    target.setConversionMask( "###,###,##0.00" );
    target.setLength( 12, 4 );
    target.setDecimalSymbol( "." );
    target.setGroupingSymbol( "'" );
    String string = (String) source.convertData( target, d );
    assertEquals( "2'837.00", string );
  }

  public void testConvertDataNumber() throws Exception {
    ValueMetaInterface source = new ValueMeta( "src", ValueMetaInterface.TYPE_STRING );
    source.setConversionMask( "###,###,##0.000" );
    source.setLength( 3, 0 );
    source.setDecimalSymbol( "," );
    source.setGroupingSymbol( "." );
    ValueMetaInterface target = new ValueMeta( "tgt", ValueMetaInterface.TYPE_NUMBER );

    Double d = (Double) target.convertData( source, "123.456.789,012" );
    assertEquals( 123456789.012, d );

    target.setConversionMask( "###,###,##0.00" );
    target.setLength( 12, 4 );
    target.setDecimalSymbol( "." );
    target.setGroupingSymbol( "'" );

    String string = (String) source.convertData( target, d );
    assertEquals( "123'456'789.01", string );
  }

  /**
   * Lazy conversion is used to read data from disk in a binary format. The data itself is not converted from the byte[]
   * to Integer, rather left untouched until it's needed.
   *

   * However at that time we do need it we should get the correct value back.
   *
   * @throws Exception
   */
  public void testLazyConversionInteger() throws Exception {
    byte[] data = ( "1234" ).getBytes();
    ValueMetaInterface intValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_INTEGER );
    intValueMeta.setConversionMask( null );
    intValueMeta.setLength( 7 );
    intValueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    intValueMeta.setStorageMetadata( strValueMeta );

    Long integerValue = intValueMeta.getInteger( data );
    assertEquals( new Long( 1234L ), integerValue );
    Double numberValue = intValueMeta.getNumber( data );
    assertEquals( new Double( 1234 ), numberValue );
    BigDecimal bigNumberValue = intValueMeta.getBigNumber( data );
    assertEquals( new BigDecimal( 1234 ), bigNumberValue );
    Date dateValue = intValueMeta.getDate( data );
    assertEquals( new Date( 1234L ), dateValue );
    String string = intValueMeta.getString( data );
    assertEquals( " 0001234", string );
  }

  /**
   * Lazy conversion is used to read data from disk in a binary format. The data itself is not converted from the byte[]
   * to Integer, rather left untouched until it's needed.
   *

   * However at that time we do need it we should get the correct value back.
   *
   * @throws Exception
   */
  public void testLazyConversionNumber() throws Exception {
    byte[] data = ( "1,234.56" ).getBytes();
    ValueMetaInterface numValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_NUMBER );
    numValueMeta.setConversionMask( null );

    // The representation formatting options.
    //
    numValueMeta.setLength( 12, 4 );
    numValueMeta.setDecimalSymbol( "," );
    numValueMeta.setGroupingSymbol( "." );
    numValueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );

    // let's explain to the parser how the input data looks like. (the storage metadata)
    //
    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMask( "#,##0.00" );
    strValueMeta.setDecimalSymbol( "." );
    strValueMeta.setGroupingSymbol( "," );
    numValueMeta.setStorageMetadata( strValueMeta );

    Long integerValue = numValueMeta.getInteger( data );
    assertEquals( new Long( 1235L ), integerValue );
    Double numberValue = numValueMeta.getNumber( data );
    assertEquals( new Double( 1234.56 ), numberValue );
    BigDecimal bigNumberValue = numValueMeta.getBigNumber( data );
    assertEquals( BigDecimal.valueOf( 1234.56 ), bigNumberValue );
    Date dateValue = numValueMeta.getDate( data );
    assertEquals( new Date( 1234L ), dateValue );
    String string = numValueMeta.getString( data );
    assertEquals( " 00001234,5600", string );

    // Get the binary data back : has to return exactly the same as we asked ONLY if the formatting options are the same
    // In this unit test they are not!
    //
    byte[] binaryValue = numValueMeta.getBinaryString( data );
    assertTrue( byteCompare( ( " 00001234,5600" ).getBytes(), binaryValue ) );
  }

  /**
   * Lazy conversion is used to read data from disk in a binary format. The data itself is not converted from the byte[]
   * to Integer, rather left untouched until it's needed.
   *

   * However at that time we do need it we should get the correct value back.
   *
   * @throws Exception
   */
  public void testLazyConversionBigNumber() throws Exception {
    String originalValue = "34983433433212304121900934.5634314343";
    byte[] data = originalValue.getBytes();
    ValueMetaInterface numValueMeta = new ValueMeta( "i", ValueMetaInterface.TYPE_BIGNUMBER );
    // The representation formatting options.
    //
    numValueMeta.setLength( 36, 10 );
    numValueMeta.setConversionMask( "#.############" );
    numValueMeta.setDecimalSymbol( "." );
    numValueMeta.setGroupingSymbol( "," );
    numValueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );

    // let's explain to the parser how the input data looks like. (the storage metadata)
    //
    ValueMetaInterface strValueMeta = new ValueMeta( "str", ValueMetaInterface.TYPE_STRING );
    strValueMeta.setConversionMask( "#.############" );
    strValueMeta.setDecimalSymbol( "." );
    strValueMeta.setGroupingSymbol( "," );

    numValueMeta.setStorageMetadata( strValueMeta );

    // NOTE This is obviously a number that is too large to fit into an Integer or a Number, but this is what we expect
    // to come back.
    // Later it might be better to throw exceptions for big-number to integer conversion.
    // At the time of writing this unit test is not the case.
    // -- Matt

    Long integerValue = numValueMeta.getInteger( data ); // -8165278906150410137
    assertEquals( new Long( -5045838617297571962L ), integerValue );
    Double numberValue = numValueMeta.getNumber( data ); // 3.49834334332123E35
    assertEquals( new Double( "3.4983433433212304E25" ), numberValue );
    BigDecimal bigNumberValue = numValueMeta.getBigNumber( data ); // 349834334332123041219009345634314343
    assertEquals( new BigDecimal( originalValue ), bigNumberValue );
    Date dateValue = numValueMeta.getDate( data );
    assertEquals( new Date( -5045838617297571962L ), dateValue );
    String string = numValueMeta.getString( data );
    assertEquals( originalValue, string );
  }

  public void testCompareIntegersNormalStorageData() throws Exception {
    Long integer1 = new Long( 1234L );
    Long integer2 = new Long( 1235L );
    Long integer3 = new Long( 1233L );
    Long integer4 = new Long( 1234L );
    Long integer5 = null;
    Long integer6 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_INTEGER );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_INTEGER );

    assertTrue( one.compare( integer1, integer2 ) < 0 );
    assertTrue( one.compare( integer1, integer3 ) > 0 );
    assertTrue( one.compare( integer1, integer4 ) == 0 );
    assertTrue( one.compare( integer1, integer5 ) != 0 );
    assertTrue( one.compare( integer5, integer6 ) == 0 );

    assertTrue( one.compare( integer1, two, integer2 ) < 0 );
    assertTrue( one.compare( integer1, two, integer3 ) > 0 );
    assertTrue( one.compare( integer1, two, integer4 ) == 0 );
    assertTrue( one.compare( integer1, two, integer5 ) != 0 );
    assertTrue( one.compare( integer5, two, integer6 ) == 0 );
  }

  public void testCompareNumbersNormalStorageData() throws Exception {
    Double number1 = new Double( 1234.56 );
    Double number2 = new Double( 1235.56 );
    Double number3 = new Double( 1233.56 );
    Double number4 = new Double( 1234.56 );
    Double number5 = null;
    Double number6 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_NUMBER );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_NUMBER );

    assertTrue( one.compare( number1, number2 ) < 0 );
    assertTrue( one.compare( number1, number3 ) > 0 );
    assertTrue( one.compare( number1, number4 ) == 0 );
    assertTrue( one.compare( number1, number5 ) != 0 );
    assertTrue( one.compare( number5, number6 ) == 0 );

    assertTrue( one.compare( number1, two, number2 ) < 0 );
    assertTrue( one.compare( number1, two, number3 ) > 0 );
    assertTrue( one.compare( number1, two, number4 ) == 0 );
    assertTrue( one.compare( number1, two, number5 ) != 0 );
    assertTrue( one.compare( number5, two, number6 ) == 0 );
  }

  public void testCompareBigNumberNormalStorageData() throws Exception {
    BigDecimal number1 = new BigDecimal( "987908798769876.23943409" );
    BigDecimal number2 = new BigDecimal( "999908798769876.23943409" );
    BigDecimal number3 = new BigDecimal( "955908798769876.23943409" );
    BigDecimal number4 = new BigDecimal( "987908798769876.23943409" );
    BigDecimal number5 = null;
    BigDecimal number6 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_BIGNUMBER );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_BIGNUMBER );

    assertTrue( one.compare( number1, number2 ) < 0 );
    assertTrue( one.compare( number1, number3 ) > 0 );
    assertTrue( one.compare( number1, number4 ) == 0 );
    assertTrue( one.compare( number1, number5 ) != 0 );
    assertTrue( one.compare( number5, number6 ) == 0 );

    assertTrue( one.compare( number1, two, number2 ) < 0 );
    assertTrue( one.compare( number1, two, number3 ) > 0 );
    assertTrue( one.compare( number1, two, number4 ) == 0 );
    assertTrue( one.compare( number1, two, number5 ) != 0 );
    assertTrue( one.compare( number5, two, number6 ) == 0 );
  }

  public void testCompareDatesNormalStorageData() throws Exception {
    Date date1 = new Date();
    Date date2 = new Date( date1.getTime() + 3600 );
    Date date3 = new Date( date1.getTime() - 3600 );
    Date date4 = new Date( date1.getTime() );
    Date date5 = null;
    Date date6 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_DATE );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_DATE );

    assertTrue( one.compare( date1, date2 ) < 0 );
    assertTrue( one.compare( date1, date3 ) > 0 );
    assertTrue( one.compare( date1, date4 ) == 0 );
    assertTrue( one.compare( date1, date5 ) != 0 );
    assertTrue( one.compare( date5, date6 ) == 0 );

    assertTrue( one.compare( date1, two, date2 ) < 0 );
    assertTrue( one.compare( date1, two, date3 ) > 0 );
    assertTrue( one.compare( date1, two, date4 ) == 0 );
    assertTrue( one.compare( date1, two, date5 ) != 0 );
    assertTrue( one.compare( date5, two, date6 ) == 0 );
  }

  public void testCompareBooleanNormalStorageData() throws Exception {
    Boolean boolean1 = new Boolean( false );
    Boolean boolean2 = new Boolean( true );
    Boolean boolean3 = new Boolean( false );
    Boolean boolean4 = null;
    Boolean boolean5 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_BOOLEAN );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_BOOLEAN );

    assertTrue( one.compare( boolean1, boolean2 ) < 0 );
    assertTrue( one.compare( boolean1, boolean3 ) == 0 );
    assertTrue( one.compare( boolean1, boolean4 ) != 0 );
    assertTrue( one.compare( boolean4, boolean5 ) == 0 );

    assertTrue( one.compare( boolean1, two, boolean2 ) < 0 );
    assertTrue( one.compare( boolean1, two, boolean3 ) == 0 );
    assertTrue( one.compare( boolean1, two, boolean4 ) != 0 );
    assertTrue( one.compare( boolean4, two, boolean5 ) == 0 );
  }

  public void testCompareStringsNormalStorageData() throws Exception {
    String string1 = "bbbbb";
    String string2 = "ccccc";
    String string3 = "aaaaa";
    String string4 = "bbbbb";
    String string5 = null;
    String string6 = null;

    ValueMetaInterface one = new ValueMeta( "one", ValueMetaInterface.TYPE_STRING );
    ValueMetaInterface two = new ValueMeta( "two", ValueMetaInterface.TYPE_STRING );

    assertTrue( one.compare( string1, string2 ) < 0 );
    assertTrue( one.compare( string1, string3 ) > 0 );
    assertTrue( one.compare( string1, string4 ) == 0 );
    assertTrue( one.compare( string1, string5 ) != 0 );
    assertTrue( one.compare( string5, string6 ) == 0 );

    assertTrue( one.compare( string1, two, string2 ) < 0 );
    assertTrue( one.compare( string1, two, string3 ) > 0 );
    assertTrue( one.compare( string1, two, string4 ) == 0 );
    assertTrue( one.compare( string1, two, string5 ) != 0 );
    assertTrue( one.compare( string5, two, string6 ) == 0 );
  }

  public void testValueMetaInheritance() {
    assertTrue( new ValueMeta() instanceof ValueMetaInterface );
  }
}


text:
package com.mongodb;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Filters;
import org.bson.Document;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.mongodb.Helpers;
import org.bson.conversions.Bson;

import static com.mongodb.client.model.Filters.*;

/**
 * Created by mikedanylov on 1/15/16.
 */
public class FindWithFilterTest {
    public static void main(String[] args) {
        MongoClient client = new MongoClient();
        MongoDatabase db = client.getDatabase("course");
        MongoCollection<Document> collection = db.getCollection("findWithFilterTest");

        collection.drop();

        // insert 10 documents with two random integers
        for (int i = 0; i < 10; i++) {
            collection.insertOne(new Document()
                                .append("x", new Random().nextInt(2))
                                .append("y", new Random().nextInt(100)));
        }

//        Bson filter = new Document("x", 0)
//                .append("y", new Document("$gt", 10).append("$lt", 90));

        Bson filter = and(eq("x", 0), gt("y", 10), lt("y", 90));

        List<Document> all = collection.find(filter).into(new ArrayList<Document>());

        for (Document cur : all) {
            com.mongodb.Helpers.printJson(cur);
        }

        long count = collection.count(filter);
        System.out.println();
        System.out.println(count);
    }
}


text:
Another game where anagrams are useful is "how many words are in the word?".

So if you use all the characters or any subset thereof of any given word, how many words can you form with these characters?

Normally a word is regarded a word in this context if it consists of at least three characters. Shorter ones like "it", "be", "a" are regarded as too easy.

How many words are there in "arrest"?


text:
<?php

use Phinx\Migration\AbstractMigration;

class CreateDerpiMergeLogTable extends AbstractMigration {
  public function change() {

    $this->table('log__derpimerge', ['id' => 'entryid'])
      ->addColumn('post_id', 'integer')
      ->addColumn('original_fullsize', 'string', ['length' => 255])
      ->addColumn('original_preview', 'string', ['length' => 255])
      ->addColumn('new_fullsize', 'string', ['length' => 255])
      ->addColumn('new_preview', 'string', ['length' => 255])
      ->addIndex('post_id')
      ->addForeignKey('post_id', 'posts', 'id', ['delete' => 'NO ACTION', 'update' => 'CASCADE'])
      ->create();
  }
}


text:
package server

import (
	"context"

	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
	emptypb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/empty_go_proto"
	sourcerepopb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/sourcerepo/sourcerepo_go_proto"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/sourcerepo"
)

// Server implements the gRPC interface for Repo.
type RepoServer struct{}

// ProtoToRepoPubsubConfigs converts a RepoPubsubConfigs resource from its proto representation.
func ProtoToSourcerepoRepoPubsubConfigs(p *sourcerepopb.SourcerepoRepoPubsubConfigs) *sourcerepo.RepoPubsubConfigs {
	if p == nil {
		return nil
	}
	obj := &sourcerepo.RepoPubsubConfigs{
		Topic:               dcl.StringOrNil(p.Topic),
		MessageFormat:       dcl.StringOrNil(p.MessageFormat),
		ServiceAccountEmail: dcl.StringOrNil(p.ServiceAccountEmail),
	}
	return obj
}

// ProtoToRepo converts a Repo resource from its proto representation.
func ProtoToRepo(p *sourcerepopb.SourcerepoRepo) *sourcerepo.Repo {
	obj := &sourcerepo.Repo{
		Name:    dcl.StringOrNil(p.Name),
		Size:    dcl.Int64OrNil(p.Size),
		Url:     dcl.StringOrNil(p.Url),
		Project: dcl.StringOrNil(p.Project),
	}
	for _, r := range p.GetPubsubConfigs() {
		obj.PubsubConfigs = append(obj.PubsubConfigs, *ProtoToSourcerepoRepoPubsubConfigs(r))
	}
	return obj
}

// RepoPubsubConfigsToProto converts a RepoPubsubConfigs resource to its proto representation.
func SourcerepoRepoPubsubConfigsToProto(o *sourcerepo.RepoPubsubConfigs) *sourcerepopb.SourcerepoRepoPubsubConfigs {
	if o == nil {
		return nil
	}
	p := &sourcerepopb.SourcerepoRepoPubsubConfigs{
		Topic:               dcl.ValueOrEmptyString(o.Topic),
		MessageFormat:       dcl.ValueOrEmptyString(o.MessageFormat),
		ServiceAccountEmail: dcl.ValueOrEmptyString(o.ServiceAccountEmail),
	}
	return p
}

// RepoToProto converts a Repo resource to its proto representation.
func RepoToProto(resource *sourcerepo.Repo) *sourcerepopb.SourcerepoRepo {
	p := &sourcerepopb.SourcerepoRepo{
		Name:    dcl.ValueOrEmptyString(resource.Name),
		Size:    dcl.ValueOrEmptyInt64(resource.Size),
		Url:     dcl.ValueOrEmptyString(resource.Url),
		Project: dcl.ValueOrEmptyString(resource.Project),
	}
	for _, r := range resource.PubsubConfigs {
		p.PubsubConfigs = append(p.PubsubConfigs, SourcerepoRepoPubsubConfigsToProto(&r))
	}

	return p
}

// ApplyRepo handles the gRPC request by passing it to the underlying Repo Apply() method.
func (s *RepoServer) applyRepo(ctx context.Context, c *sourcerepo.Client, request *sourcerepopb.ApplySourcerepoRepoRequest) (*sourcerepopb.SourcerepoRepo, error) {
	p := ProtoToRepo(request.GetResource())
	res, err := c.ApplyRepo(ctx, p)
	if err != nil {
		return nil, err
	}
	r := RepoToProto(res)
	return r, nil
}

// ApplyRepo handles the gRPC request by passing it to the underlying Repo Apply() method.
func (s *RepoServer) ApplySourcerepoRepo(ctx context.Context, request *sourcerepopb.ApplySourcerepoRepoRequest) (*sourcerepopb.SourcerepoRepo, error) {
	cl, err := createConfigRepo(ctx, request.ServiceAccountFile)
	if err != nil {
		return nil, err
	}
	return s.applyRepo(ctx, cl, request)
}

// DeleteRepo handles the gRPC request by passing it to the underlying Repo Delete() method.
func (s *RepoServer) DeleteSourcerepoRepo(ctx context.Context, request *sourcerepopb.DeleteSourcerepoRepoRequest) (*emptypb.Empty, error) {

	cl, err := createConfigRepo(ctx, request.ServiceAccountFile)
	if err != nil {
		return nil, err
	}
	return &emptypb.Empty{}, cl.DeleteRepo(ctx, ProtoToRepo(request.GetResource()))

}

// ListSourcerepoRepo handles the gRPC request by passing it to the underlying RepoList() method.
func (s *RepoServer) ListSourcerepoRepo(ctx context.Context, request *sourcerepopb.ListSourcerepoRepoRequest) (*sourcerepopb.ListSourcerepoRepoResponse, error) {
	cl, err := createConfigRepo(ctx, request.ServiceAccountFile)
	if err != nil {
		return nil, err
	}

	resources, err := cl.ListRepo(ctx, request.Project)
	if err != nil {
		return nil, err
	}
	var protos []*sourcerepopb.SourcerepoRepo
	for _, r := range resources.Items {
		rp := RepoToProto(r)
		protos = append(protos, rp)
	}
	return &sourcerepopb.ListSourcerepoRepoResponse{Items: protos}, nil
}

func createConfigRepo(ctx context.Context, service_account_file string) (*sourcerepo.Client, error) {

	conf := dcl.NewConfig(dcl.WithUserAgent("dcl-test"), dcl.WithCredentialsFile(service_account_file))
	return sourcerepo.NewClient(conf), nil
}


text:
from typing import List

from whacked4.dehacked.patch import Patch
from whacked4.dehacked.statequery.filterbase import StateFilterBase
from whacked4.dehacked.statequery.result import StateQueryResult
from whacked4.dehacked.statequery.sortbase import StateSortBase

class StateFilterQuery:

    def __init__(self, patch):
        self.patch: Patch = patch

        self.state_filters: List[StateFilterBase] = []
        self.state_sorters: List[StateSortBase] = []

    def filter(self, state_filter: StateFilterBase):
        self.state_filters.append(state_filter)
        return self

    def sort(self, state_sorter: StateSortBase):
        self.state_sorters.append(state_sorter)
        return self

    def execute(self) -> StateQueryResult:
        state_indices = set(range(len(self.patch.states)))

        for state_filter in self.state_filters:
            state_indices = state_filter.apply(state_indices)

        for state_sorter in self.state_sorters:
            state_indices = state_sorter.apply(state_indices)

        return StateQueryResult(self.patch.states, list(state_indices))


text:
<?php
namespace QuickBooksOnline\API\Data;

/**
 * @xmlNamespace http://schema.intuit.com/finance/v3
 * @xmlType IntuitEntity
 * @xmlName IPPInventorySite
 * @var IPPInventorySite
 * @xmlDefinition
				Product: QBW
				Description: The InventorySite resource
				represents a location where inventory is stored.
				Endpoint:
				inventorysite
				Business Rules: [li]The site name must be unique.[/li]

 */
class IPPInventorySite
	extends IPPIntuitEntity	{

		/**
		* Initializes this object, optionally with pre-defined property values
		*
		* Initializes this object and it's property members, using the dictionary
		* of key/value pairs passed as an optional argument.
		*
		* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
		* @param boolean $verbose specifies whether object should echo warnings
		*/
		public function __construct($keyValInitializers=array(), $verbose=FALSE)
		{
			foreach($keyValInitializers as $initPropName => $initPropVal)
			{
				if (property_exists('IPPInventorySite',$initPropName) || property_exists('QuickBooksOnline\API\Data\IPPInventorySite',$initPropName))
				{
					$this->{$initPropName} = $initPropVal;
				}
				else
				{
					if ($verbose)
						echo "Property does not exist ($initPropName) in class (".get_class($this).")";
				}
			}
		}

	/**
	 * @Definition
								Product: QBW
								Filterable: QBW
								Description: User
								recognizable name for the site

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName Name
	 * @var string
	 */
	public $Name;
	/**
	 * @Definition
								Product: QBW
								Filterable: QBW
								Description: Whether
								the site is considered "active", still in use by the business

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName Active
	 * @var boolean
	 */
	public $Active;
	/**
	 * @Definition
								Product: QBW
								Description: Whether this is the
								default site for inventory items that do not indicate a site

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName DefaultSite
	 * @var boolean
	 */
	public $DefaultSite;
	/**
	 * @Definition
								Product: QBW
								Description: Description

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName Description
	 * @var string
	 */
	public $Description;
	/**
	 * @Definition
								Product: QBW
								Description: Name of the person
								responsible for the site

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName Contact
	 * @var string
	 */
	public $Contact;
	/**
	 * @Definition
								Product: QBW
								Description: Tagged postal addresses

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlMaxOccurs unbounded
	 * @xmlName Addr
	 * @var com\intuit\schema\finance\v3\IPPPhysicalAddress
	 */
	public $Addr;
	/**
	 * @Definition
								Product: QBW
								Description: Tagged phone number, possibly include pagers.

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlMaxOccurs unbounded
	 * @xmlName ContactInfo
	 * @var com\intuit\schema\finance\v3\IPPContactInfo
	 */
	public $ContactInfo;
	/**
	 * @Definition Internal use only: extension place holder for
								InventorySite
	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName InventorySiteEx
	 * @var com\intuit\schema\finance\v3\IPPIntuitAnyType
	 */
	public $InventorySiteEx;

} // end class IPPInventorySite


text:
<?php
namespace ebi\exception;
/**
 * Token mismatch
 */
class TokenMismatchException extends \ebi\Exception{
}


text:
{-|
Module      : Control.Monad.Bayes.Free
Description : Free monad transformer over random sampling
Copyright   : (c) Adam Scibior, 2015-2020
License     : MIT
Maintainer  : leonhard.markert@tweag.io
Stability   : experimental
Portability : GHC

'FreeSampler' is a free monad transformer over random sampling.
-}

module Control.Monad.Bayes.Free (
  FreeSampler,
  hoist,
  interpret,
  withRandomness,
  withPartialRandomness,
  runWith
) where

import Data.Functor.Identity

import Control.Monad.Trans
import Control.Monad.Writer
import Control.Monad.State
import Control.Monad.Trans.Free.Church

import Control.Monad.Bayes.Class

-- | Random sampling functor.
newtype SamF a = Random (Double -> a)

instance Functor SamF where
  fmap f (Random k) = Random (f . k)

-- | Free monad transformer over random sampling.

-- Uses the Church-encoded version of the free monad for efficiency.
newtype FreeSampler m a = FreeSampler (FT SamF m a)
  deriving(Functor,Applicative,Monad,MonadTrans)

runFreeSampler :: FreeSampler m a -> FT SamF m a
runFreeSampler (FreeSampler m) = m

instance Monad m => MonadFree SamF (FreeSampler m) where
  wrap = FreeSampler . wrap . fmap runFreeSampler

instance Monad m => MonadSample (FreeSampler m) where
  random = FreeSampler $ liftF (Random id)

-- | Hoist 'FreeSampler' through a monad transform.
hoist :: (Monad m, Monad n) => (forall x. m x -> n x) -> FreeSampler m a -> FreeSampler n a
hoist f (FreeSampler m) = FreeSampler (hoistFT f m)

-- | Execute random sampling in the transformed monad.
interpret :: MonadSample m => FreeSampler m a -> m a
interpret (FreeSampler m) = iterT f m where
  f (Random k) = random >>= k

-- | Execute computation with supplied values for random choices.
withRandomness :: Monad m => [Double] -> FreeSampler m a -> m a
withRandomness randomness (FreeSampler m) = evalStateT (iterTM f m) randomness where
  f (Random k) = do
    xs <- get
    case xs of
      [] -> error "FreeSampler: the list of randomness was too short"
      y:ys -> put ys >> k y

-- | Execute computation with supplied values for a subset of random choices.
-- Return the output value and a record of all random choices used, whether
-- taken as input or drawn using the transformed monad.
withPartialRandomness :: MonadSample m => [Double] -> FreeSampler m a -> m (a, [Double])
withPartialRandomness randomness (FreeSampler m) =
  runWriterT $ evalStateT (iterTM f $ hoistFT lift m) randomness where
    f (Random k) = do
      -- This block runs in StateT [Double] (WriterT [Double]) m.
      -- StateT propagates consumed randomness while WriterT records
      -- randomness used, whether old or new.
      xs <- get
      x <- case xs of
            [] -> random
            y:ys -> put ys >> return y
      tell [x]
      k x

-- | Like 'withPartialRandomness', but use an arbitrary sampling monad.
runWith :: MonadSample m => [Double] -> FreeSampler Identity a -> m (a, [Double])
runWith randomness m = withPartialRandomness randomness $ hoist (return . runIdentity) m